From badfe78d9390f068956b52bffa9b39d15448510b Mon Sep 17 00:00:00 2001 From: Sima Zhu <48036328+sima-zhu@users.noreply.github.com> Date: Thu, 2 Jul 2020 12:02:12 -0700 Subject: [PATCH 001/129] Remove setter from AnalyzeTextOptions (#12777) --- .../converters/AnalyzeRequestConverter.java | 2 - .../indexes/models/AnalyzeTextOptions.java | 88 +++++++------------ 2 files changed, 33 insertions(+), 57 deletions(-) diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/AnalyzeRequestConverter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/AnalyzeRequestConverter.java index 80b6209759a97..8827b92075411 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/AnalyzeRequestConverter.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/AnalyzeRequestConverter.java @@ -29,11 +29,9 @@ public static AnalyzeTextOptions map(com.azure.search.documents.indexes.implemen if (obj.getTokenizer() != null) { LexicalTokenizerName tokenizer = LexicalTokenizerNameConverter.map(obj.getTokenizer()); analyzeTextOptions = new AnalyzeTextOptions(obj.getText(), tokenizer); - analyzeTextOptions.setTokenizerName(tokenizer); } else { LexicalAnalyzerName analyzer = LexicalAnalyzerNameConverter.map(obj.getAnalyzer()); analyzeTextOptions = new AnalyzeTextOptions(obj.getText(), analyzer); - analyzeTextOptions.setAnalyzerName(analyzer); } if (obj.getCharFilters() != null) { diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/AnalyzeTextOptions.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/AnalyzeTextOptions.java index 6b92923558ba9..4039507f14291 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/AnalyzeTextOptions.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/AnalyzeTextOptions.java @@ -77,22 +77,53 @@ public final class AnalyzeTextOptions { * Constructor to {@link AnalyzeTextOptions} which takes analyzerName. * * @param text The text break into tokens. - * @param analyzerName The name of the analyze name. + * @param analyzerName The name of the analyzer to use to break the + * given text. If this parameter is not specified, you must specify a + * tokenizer instead. The tokenizer and analyzer parameters are mutually + * exclusive. Possible values include: 'ArMicrosoft', 'ArLucene', + * 'HyLucene', 'BnMicrosoft', 'EuLucene', 'BgMicrosoft', 'BgLucene', + * 'CaMicrosoft', 'CaLucene', 'ZhHansMicrosoft', 'ZhHansLucene', + * 'ZhHantMicrosoft', 'ZhHantLucene', 'HrMicrosoft', 'CsMicrosoft', + * 'CsLucene', 'DaMicrosoft', 'DaLucene', 'NlMicrosoft', 'NlLucene', + * 'EnMicrosoft', 'EnLucene', 'EtMicrosoft', 'FiMicrosoft', 'FiLucene', + * 'FrMicrosoft', 'FrLucene', 'GlLucene', 'DeMicrosoft', 'DeLucene', + * 'ElMicrosoft', 'ElLucene', 'GuMicrosoft', 'HeMicrosoft', 'HiMicrosoft', + * 'HiLucene', 'HuMicrosoft', 'HuLucene', 'IsMicrosoft', 'IdMicrosoft', + * 'IdLucene', 'GaLucene', 'ItMicrosoft', 'ItLucene', 'JaMicrosoft', + * 'JaLucene', 'KnMicrosoft', 'KoMicrosoft', 'KoLucene', 'LvMicrosoft', + * 'LvLucene', 'LtMicrosoft', 'MlMicrosoft', 'MsMicrosoft', 'MrMicrosoft', + * 'NbMicrosoft', 'NoLucene', 'FaLucene', 'PlMicrosoft', 'PlLucene', + * 'PtBrMicrosoft', 'PtBrLucene', 'PtPtMicrosoft', 'PtPtLucene', + * 'PaMicrosoft', 'RoMicrosoft', 'RoLucene', 'RuMicrosoft', 'RuLucene', + * 'SrCyrillicMicrosoft', 'SrLatinMicrosoft', 'SkMicrosoft', 'SlMicrosoft', + * 'EsMicrosoft', 'EsLucene', 'SvMicrosoft', 'SvLucene', 'TaMicrosoft', + * 'TeMicrosoft', 'ThMicrosoft', 'ThLucene', 'TrMicrosoft', 'TrLucene', + * 'UkMicrosoft', 'UrMicrosoft', 'ViMicrosoft', 'StandardLucene', + * 'StandardAsciiFoldingLucene', 'Keyword', 'Pattern', 'Simple', 'Stop', + * 'Whitespace'. */ public AnalyzeTextOptions(String text, LexicalAnalyzerName analyzerName) { this.text = text; this.analyzerName = analyzerName; + this.tokenizerName = null; } /** * Constructor to {@link AnalyzeTextOptions} which takes tokenizerName. * * @param text The text break into tokens. - * @param tokenizerName The name of the tokenizer name. + * @param tokenizerName The name of the tokenizer to use to break + * the given text. If this parameter is not specified, you must specify an + * analyzer instead. The tokenizer and analyzer parameters are mutually + * exclusive. Possible values include: 'Classic', 'EdgeNGram', 'Keyword', + * 'Letter', 'Lowercase', 'MicrosoftLanguageTokenizer', + * 'MicrosoftLanguageStemmingTokenizer', 'NGram', 'PathHierarchy', + * 'Pattern', 'Standard', 'UaxUrlEmail', 'Whitespace'. */ public AnalyzeTextOptions(String text, LexicalTokenizerName tokenizerName) { this.text = text; this.tokenizerName = tokenizerName; + this.analyzerName = null; } /** @@ -136,41 +167,6 @@ public LexicalAnalyzerName getAnalyzerName() { return this.analyzerName; } - /** - * Set the analyzer property: The name of the analyzer to use to break the - * given text. If this parameter is not specified, you must specify a - * tokenizer instead. The tokenizer and analyzer parameters are mutually - * exclusive. Possible values include: 'ArMicrosoft', 'ArLucene', - * 'HyLucene', 'BnMicrosoft', 'EuLucene', 'BgMicrosoft', 'BgLucene', - * 'CaMicrosoft', 'CaLucene', 'ZhHansMicrosoft', 'ZhHansLucene', - * 'ZhHantMicrosoft', 'ZhHantLucene', 'HrMicrosoft', 'CsMicrosoft', - * 'CsLucene', 'DaMicrosoft', 'DaLucene', 'NlMicrosoft', 'NlLucene', - * 'EnMicrosoft', 'EnLucene', 'EtMicrosoft', 'FiMicrosoft', 'FiLucene', - * 'FrMicrosoft', 'FrLucene', 'GlLucene', 'DeMicrosoft', 'DeLucene', - * 'ElMicrosoft', 'ElLucene', 'GuMicrosoft', 'HeMicrosoft', 'HiMicrosoft', - * 'HiLucene', 'HuMicrosoft', 'HuLucene', 'IsMicrosoft', 'IdMicrosoft', - * 'IdLucene', 'GaLucene', 'ItMicrosoft', 'ItLucene', 'JaMicrosoft', - * 'JaLucene', 'KnMicrosoft', 'KoMicrosoft', 'KoLucene', 'LvMicrosoft', - * 'LvLucene', 'LtMicrosoft', 'MlMicrosoft', 'MsMicrosoft', 'MrMicrosoft', - * 'NbMicrosoft', 'NoLucene', 'FaLucene', 'PlMicrosoft', 'PlLucene', - * 'PtBrMicrosoft', 'PtBrLucene', 'PtPtMicrosoft', 'PtPtLucene', - * 'PaMicrosoft', 'RoMicrosoft', 'RoLucene', 'RuMicrosoft', 'RuLucene', - * 'SrCyrillicMicrosoft', 'SrLatinMicrosoft', 'SkMicrosoft', 'SlMicrosoft', - * 'EsMicrosoft', 'EsLucene', 'SvMicrosoft', 'SvLucene', 'TaMicrosoft', - * 'TeMicrosoft', 'ThMicrosoft', 'ThLucene', 'TrMicrosoft', 'TrLucene', - * 'UkMicrosoft', 'UrMicrosoft', 'ViMicrosoft', 'StandardLucene', - * 'StandardAsciiFoldingLucene', 'Keyword', 'Pattern', 'Simple', 'Stop', - * 'Whitespace'. - * - * @param analyzerName the analyzer value to set. - * @return the AnalyzeRequest object itself. - */ - public AnalyzeTextOptions setAnalyzerName(LexicalAnalyzerName analyzerName) { - this.analyzerName = analyzerName; - this.tokenizerName = null; - return this; - } - /** * Get the tokenizer property: The name of the tokenizer to use to break * the given text. If this parameter is not specified, you must specify an @@ -186,24 +182,6 @@ public LexicalTokenizerName getTokenizerName() { return this.tokenizerName; } - /** - * Set the tokenizer property: The name of the tokenizer to use to break - * the given text. If this parameter is not specified, you must specify an - * analyzer instead. The tokenizer and analyzer parameters are mutually - * exclusive. Possible values include: 'Classic', 'EdgeNGram', 'Keyword', - * 'Letter', 'Lowercase', 'MicrosoftLanguageTokenizer', - * 'MicrosoftLanguageStemmingTokenizer', 'NGram', 'PathHierarchy', - * 'Pattern', 'Standard', 'UaxUrlEmail', 'Whitespace'. - * - * @param tokenizerName the tokenizer value to set. - * @return the AnalyzeRequest object itself. - */ - public AnalyzeTextOptions setTokenizerName(LexicalTokenizerName tokenizerName) { - this.tokenizerName = tokenizerName; - this.analyzerName = null; - return this; - } - /** * Get the tokenFilters property: An optional list of token filters to use * when breaking the given text. This parameter can only be set when using From 1fb2bda606064e1b74f964073b1d627e15f2b4bd Mon Sep 17 00:00:00 2001 From: Sima Zhu <48036328+sima-zhu@users.noreply.github.com> Date: Thu, 2 Jul 2020 12:09:12 -0700 Subject: [PATCH 002/129] Javadoc codesnippets for SearchIndexerAsyncClient (#12776) --- .../search/documents/SearchAsyncClient.java | 14 +- .../azure/search/documents/SearchClient.java | 14 +- .../indexes/SearchIndexAsyncClient.java | 20 +- .../documents/indexes/SearchIndexClient.java | 28 +- .../indexes/SearchIndexerAsyncClient.java | 216 ++++++++ .../indexes/SearchIndexerClient.java | 59 +- .../documents/SearchJavaDocCodeSnippets.java | 504 +++++++++++++++++- 7 files changed, 784 insertions(+), 71 deletions(-) diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/SearchAsyncClient.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/SearchAsyncClient.java index 78c16c81ecae5..eff449625e7ff 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/SearchAsyncClient.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/SearchAsyncClient.java @@ -190,7 +190,7 @@ public Mono uploadDocuments(Iterable documents) { * *

Code Sample

* - *

Upload dynamic SearchDocument with response.

+ *

Upload dynamic SearchDocument.

* * {@codesnippet com.azure.search.documents.SearchAsyncClient.uploadDocumentsWithResponse#Iterable-IndexDocumentsOptions} * @@ -260,7 +260,7 @@ public Mono mergeDocuments(Iterable documents) { * *

Code Sample

* - *

Merge dynamic SearchDocument with response.

+ *

Merge dynamic SearchDocument.

* * {@codesnippet com.azure.search.documents.SearchAsyncClient.mergeDocumentsWithResponse#Iterable-IndexDocumentsOptions} * @@ -332,7 +332,7 @@ public Mono mergeOrUploadDocuments(Iterable documents) * *

Code Sample

* - *

Merge or upload dynamic SearchDocument with response.

+ *

Merge or upload dynamic SearchDocument.

* * {@codesnippet com.azure.search.documents.SearchAsyncClient.mergeOrUploadDocumentsWithResponse#Iterable-IndexDocumentsOptions} * @@ -388,7 +388,7 @@ public Mono deleteDocuments(Iterable documents) { * *

Code Sample

* - *

Delete dynamic SearchDocument with response.

+ *

Delete dynamic SearchDocument.

* * {@codesnippet com.azure.search.documents.SearchAsyncClient.deleteDocumentsWithResponse#Iterable-IndexDocumentsOptions} * @@ -444,7 +444,7 @@ public Mono indexDocuments(IndexDocumentsBatch batch) { * *

Code Sample

* - *

Index batch operation on dynamic SearchDocument with response.

+ *

Index batch operation on dynamic SearchDocument.

* * {@codesnippet com.azure.search.documents.SearchAsyncClient.indexDocumentsWithResponse#IndexDocumentsBatch-IndexDocumentsOptions} * @@ -514,7 +514,7 @@ public Mono getDocument(String key, Class modelClass) { * *

Code Sample

* - *

Get dynamic SearchDocument with response.

+ *

Get dynamic SearchDocument.

* * {@codesnippet com.azure.search.documents.SearchAsyncClient.getDocumentWithResponse#String-Class-List} * @@ -576,7 +576,7 @@ public Mono getDocumentCount() { * *

Code Sample

* - *

Get document count with response.

+ *

Get document count.

* * {@codesnippet com.azure.search.documents.SearchAsyncClient.getDocumentCountWithResponse} * diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/SearchClient.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/SearchClient.java index 43c47a2f80a7e..52964b5a4aba4 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/SearchClient.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/SearchClient.java @@ -99,7 +99,7 @@ public IndexDocumentsResult uploadDocuments(Iterable documents) { * *

Code Sample

* - *

Upload dynamic SearchDocument with response.

+ *

Upload dynamic SearchDocument.

* * {@codesnippet com.azure.search.documents.SearchClient.uploadDocumentsWithResponse#Iterable-IndexDocumentsOptions-Context} * @@ -164,7 +164,7 @@ public IndexDocumentsResult mergeDocuments(Iterable documents) { * *

Code Sample

* - *

Merge dynamic SearchDocument with response.

+ *

Merge dynamic SearchDocument.

* * {@codesnippet com.azure.search.documents.SearchClient.mergeDocumentsWithResponse#Iterable-IndexDocumentsOptions-Context} * @@ -231,7 +231,7 @@ public IndexDocumentsResult mergeOrUploadDocuments(Iterable documents) { * *

Code Sample

* - *

Merge or upload dynamic SearchDocument with response.

+ *

Merge or upload dynamic SearchDocument.

* * {@codesnippet com.azure.search.documents.SearchClient.mergeOrUploadDocumentsWithResponse#Iterable-IndexDocumentsOptions-Context} * @@ -282,7 +282,7 @@ public IndexDocumentsResult deleteDocuments(Iterable documents) { * *

Code Sample

* - *

Delete dynamic SearchDocument with response.

+ *

Delete dynamic SearchDocument.

* * {@codesnippet com.azure.search.documents.SearchClient.deleteDocumentsWithResponse#Iterable-IndexDocumentsOptions-Context} * @@ -333,7 +333,7 @@ public IndexDocumentsResult indexDocuments(IndexDocumentsBatch batch) { * *

Code Sample

* - *

Index batch operation on dynamic SearchDocument with response.

+ *

Index batch operation on dynamic SearchDocument.

* * {@codesnippet com.azure.search.documents.SearchClient.indexDocumentsWithResponse#IndexDocumentsBatch-IndexDocumentsOptions-Context} * @@ -386,7 +386,7 @@ public T getDocument(String key, Class modelClass) { * *

Code Sample

* - *

Get dynamic SearchDocument with response.

+ *

Get dynamic SearchDocument.

* * {@codesnippet com.azure.search.documents.SearchClient.getDocumentWithResponse#String-Class-List-Context} * @@ -426,7 +426,7 @@ public long getDocumentCount() { * *

Code Sample

* - *

Get document count with response.

+ *

Get document count.

* * {@codesnippet com.azure.search.documents.SearchClient.getDocumentCountWithResponse#Context} * diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/SearchIndexAsyncClient.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/SearchIndexAsyncClient.java index 68a0ee059aa84..c35dd69c612da 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/SearchIndexAsyncClient.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/SearchIndexAsyncClient.java @@ -139,7 +139,7 @@ public Mono createIndex(SearchIndex index) { * *

Code Sample

* - *

Create search index named "searchIndex" with response.

+ *

Create search index named "searchIndex".

* * {@codesnippet com.azure.search.documents.indexes.SearchIndexAsyncClient.createIndexWithResponse#SearchIndex} * @@ -185,7 +185,7 @@ public Mono getIndex(String indexName) { * *

Code Sample

* - *

Get search index response with "searchIndex.

+ *

Get search index with "searchIndex.

* * {@codesnippet com.azure.search.documents.indexes.SearchIndexAsyncClient.getIndexWithResponse#String} * @@ -230,7 +230,7 @@ public Mono getIndexStatistics(String indexName) { * *

Code Sample

* - *

Get search index "searchIndex" statistics with response.

+ *

Get search index "searchIndex" statistics.

* * {@codesnippet com.azure.search.documents.indexes.SearchIndexAsyncClient.getIndexStatisticsWithResponse#String} * @@ -344,7 +344,7 @@ public Mono createOrUpdateIndex(SearchIndex index) { * *

Code Sample

* - *

Create or update search index named "searchIndex" with response.

+ *

Create or update search index named "searchIndex".

* * {@codesnippet com.azure.search.documents.indexes.SearchIndexClient.createOrUpdateIndexWithResponse#SearchIndex-boolean-boolean-Context} * @@ -402,7 +402,7 @@ public Mono deleteIndex(String indexName) { * *

Code Sample

* - *

Delete search index response with name "searchIndex".

+ *

Delete search index with name "searchIndex".

* * {@codesnippet com.azure.search.documents.indexes.SearchIndexAsyncClient.deleteIndexWithResponse#SearchIndex-boolean} * @@ -493,7 +493,7 @@ public Mono createSynonymMap(SynonymMap synonymMap) { * *

Code Sample

* - *

Create synonym map response named "synonymMap".

+ *

Create synonym map named "synonymMap".

* * {@codesnippet com.azure.search.documents.indexes.SearchIndexAsyncClient.createSynonymMapWithResponse#SynonymMap} * @@ -541,7 +541,7 @@ public Mono getSynonymMap(String synonymMapName) { * *

Code Sample

* - *

Get synonym map response with name "synonymMap".

+ *

Get synonym map with name "synonymMap".

* * {@codesnippet com.azure.search.documents.indexes.SearchIndexAsyncClient.getSynonymMap#String} * @@ -656,7 +656,7 @@ public Mono createOrUpdateSynonymMap(SynonymMap synonymMap) { * *

Code Sample

* - *

Create or update synonym map response named "synonymMap".

+ *

Create or update synonym map named "synonymMap".

* * {@codesnippet com.azure.search.documents.indexes.SearchIndexAsyncClient.createOrUpdateSynonymMapWithResponse#SynonymMap-boolean-Context} * @@ -712,7 +712,7 @@ public Mono deleteSynonymMap(String synonymMapName) { * *

Code Sample

* - *

Delete synonym map response with name "synonymMap".

+ *

Delete synonym map with name "synonymMap".

* * {@codesnippet com.azure.search.documents.indexes.SearchIndexAsyncClient.deleteSynonymMapWithResponse#SynonymMap-boolean} * @@ -766,7 +766,7 @@ public Mono getServiceStatistics() { * *

Code Sample

* - *

Get service statistics with response.

+ *

Get service statistics.

* * {@codesnippet com.azure.search.documents.indexes.SearchIndexAsyncClient.getServiceStatisticsWithResponse} * diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/SearchIndexClient.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/SearchIndexClient.java index fb1627efd9226..7988efe024730 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/SearchIndexClient.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/SearchIndexClient.java @@ -81,7 +81,7 @@ public SearchIndex createIndex(SearchIndex index) { * *

Code Sample

* - *

Create search index named "searchIndex" with response.

+ *

Create search index named "searchIndex".

* * {@codesnippet com.azure.search.documents.indexes.SearchIndexClient.createIndexWithResponse#SearchIndex-Context} * @@ -116,7 +116,7 @@ public SearchIndex getIndex(String indexName) { * *

Code Sample

* - *

Get search index response with "searchIndex.

+ *

Get search index with "searchIndex.

* * {@codesnippet com.azure.search.documents.indexes.SearchIndexClient.getIndexWithResponse#String-Context} * @@ -151,7 +151,7 @@ public SearchIndexStatistics getIndexStatistics(String indexName) { * *

Code Sample

* - *

Get search index "searchIndex" statistics with response.

+ *

Get search index "searchIndex" statistics.

* * {@codesnippet com.azure.search.documents.indexes.SearchIndexClient.getIndexStatisticsWithResponse#String-Context} * @@ -185,7 +185,7 @@ public PagedIterable listIndexes() { * *

Code Sample

* - *

List all search indexes with response.

+ *

List all search indexes.

* * {@codesnippet com.azure.search.documents.indexes.SearchIndexClient.listIndexesWithResponse#Context} * @@ -218,7 +218,7 @@ public PagedIterable listIndexNames() { * *

Code Sample

* - *

List all search indexes names with response.

+ *

List all search indexes names.

* * {@codesnippet com.azure.search.documents.indexes.SearchIndexClient.listIndexNames#Context} * @@ -252,7 +252,7 @@ public SearchIndex createOrUpdateIndex(SearchIndex index) { * *

Code Sample

* - *

Create or update search index named "searchIndex" with response.

+ *

Create or update search index named "searchIndex".

* * {@codesnippet com.azure.search.documents.indexes.SearchIndexClient.createOrUpdateIndexWithResponse#SearchIndex-boolean-boolean-Context} * @@ -293,7 +293,7 @@ public void deleteIndex(String indexName) { * *

Code Sample

* - *

Delete search index response with name "searchIndex".

+ *

Delete search index with name "searchIndex".

* * {@codesnippet com.azure.search.documents.indexes.SearchIndexClient.deleteIndexWithResponse#SearchIndex-boolean-Context} * @@ -371,7 +371,7 @@ public SynonymMap createSynonymMap(SynonymMap synonymMap) { * *

Code Sample

* - *

Create synonym map response named "synonymMap".

+ *

Create synonym map named "synonymMap".

* * {@codesnippet com.azure.search.documents.indexes.SearchIndexClient.createSynonymMapWithResponse#SynonymMap-Context} * @@ -406,7 +406,7 @@ public SynonymMap getSynonymMap(String synonymMapName) { * *

Code Sample

* - *

Get synonym map response with name "synonymMap".

+ *

Get synonym map with name "synonymMap".

* * {@codesnippet com.azure.search.documents.indexes.SearchIndexClient.getSynonymMapWithResponse#String-Context} * @@ -440,7 +440,7 @@ public PagedIterable listSynonymMaps() { * *

Code Sample

* - *

List all synonym maps response.

+ *

List all synonym maps.

* * {@codesnippet com.azure.search.documents.indexes.SearchIndexClient.listSynonymMapsWithResponse#Context} * @@ -473,7 +473,7 @@ public PagedIterable listSynonymMapNames() { * *

Code Sample

* - *

List all synonym map names response.

+ *

List all synonym map names.

* * {@codesnippet com.azure.search.documents.indexes.SearchIndexClient.listSynonymMapNamesWithResponse#Context} * @@ -507,7 +507,7 @@ public SynonymMap createOrUpdateSynonymMap(SynonymMap synonymMap) { * *

Code Sample

* - *

Create or update synonym map response named "synonymMap".

+ *

Create or update synonym map named "synonymMap".

* * {@codesnippet com.azure.search.documents.indexes.SearchIndexClient.createOrUpdateSynonymMapWithResponse#SynonymMap-boolean-Context} * @@ -545,7 +545,7 @@ public void deleteSynonymMap(String synonymMapName) { * *

Code Sample

* - *

Delete synonym map response with name "synonymMap".

+ *

Delete synonym map with name "synonymMap".

* * {@codesnippet com.azure.search.documents.indexes.SearchIndexClient.deleteSynonymMapWithResponse#SynonymMap-boolean-Context} * @@ -583,7 +583,7 @@ public SearchServiceStatistics getServiceStatistics() { * *

Code Sample

* - *

Get service statistics with response.

+ *

Get service statistics.

* * {@codesnippet com.azure.search.documents.indexes.SearchIndexClient.getServiceStatisticsWithResponse#Context} * diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/SearchIndexerAsyncClient.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/SearchIndexerAsyncClient.java index 6918701efee38..141f6096f4f66 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/SearchIndexerAsyncClient.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/SearchIndexerAsyncClient.java @@ -96,6 +96,12 @@ public String getEndpoint() { /** * Creates a new Azure Cognitive Search data source or updates a data source if it already exists. * + *

Code Sample

+ * + *

Create or update search indexer data source connection named "dataSource".

+ * + * {@codesnippet com.azure.search.documents.indexes.SearchIndexerAsyncClient.createOrUpdateDataSourceConnection#SearchIndexerDataSourceConnection} + * * @param dataSource The definition of the {@link SearchIndexerDataSourceConnection} to create or update. * @return the data source that was created or updated. */ @@ -108,6 +114,12 @@ public Mono createOrUpdateDataSourceConnectio /** * Creates a new Azure Cognitive Search data source or updates a data source if it already exists. * + *

Code Sample

+ * + *

Create or update search indexer data source connection named "dataSource".

+ * + * {@codesnippet com.azure.search.documents.indexes.SearchIndexerAsyncClient.createOrUpdateDataSourceConnectionWithResponse#SearchIndexerDataSourceConnection-boolean} + * * @param dataSource The definition of the {@link SearchIndexerDataSourceConnection} to create or update. * @param onlyIfUnchanged {@code true} to update if the {@code dataSource} is the same as the current service value. * {@code false} to always update existing value. @@ -144,6 +156,12 @@ Mono> createOrUpdateDataSourceConnec /** * Creates a new Azure Cognitive Search data source * + *

Code Sample

+ * + *

Create search indexer data source connection named "dataSource".

+ * + * {@codesnippet com.azure.search.documents.indexes.SearchIndexerAsyncClient.createOrUpdateDataSourceConnection#SearchIndexerDataSourceConnection} + * * @param dataSource The definition of the dataSource to create. * @return a Mono which performs the network request upon subscription. */ @@ -156,6 +174,12 @@ public Mono createDataSourceConnection( /** * Creates a new Azure Cognitive Search data source * + *

Code Sample

+ * + *

Create search indexer data source connection named "dataSource".

+ * + * {@codesnippet com.azure.search.documents.indexes.SearchIndexerAsyncClient.createDataSourceConnectionWithResponse#SearchIndexerDataSourceConnection} + * * @param dataSource The definition of the {@link SearchIndexerDataSourceConnection} to create. * @return a Mono which performs the network request upon subscription. */ @@ -181,6 +205,12 @@ Mono> createDataSourceConnectionWith /** * Retrieves a DataSource from an Azure Cognitive Search service. * + *

Code Sample

+ * + *

Get search indexer data source connection named "dataSource".

+ * + * {@codesnippet com.azure.search.documents.indexes.SearchIndexerAsyncClient.getDataSourceConnection#String} + * * @param dataSourceName the name of the {@link SearchIndexerDataSourceConnection} to retrieve. * @return the DataSource. */ @@ -192,6 +222,12 @@ public Mono getDataSourceConnection(String da /** * Retrieves a DataSource from an Azure Cognitive Search service. * + *

Code Sample

+ * + *

Get search indexer data source connection named "dataSource".

+ * + * {@codesnippet com.azure.search.documents.indexes.SearchIndexerAsyncClient.getDataSourceConnectionWithResponse#String} + * * @param dataSourceName the name of the {@link SearchIndexerDataSourceConnection} to retrieve. * @return a response containing the DataSource. */ @@ -217,6 +253,12 @@ Mono> getDataSourceConnectionWithRes /** * List all DataSources from an Azure Cognitive Search service. * + *

Code Sample

+ * + *

List all search indexer data source connections.

+ * + * {@codesnippet com.azure.search.documents.indexes.SearchIndexerAsyncClient.listDataSourceConnections} + * * @return a list of DataSources */ @ServiceMethod(returns = ReturnType.COLLECTION) @@ -242,6 +284,12 @@ PagedFlux listDataSourceConnections(Context c /** * List all DataSource names from an Azure Cognitive Search service. * + *

Code Sample

+ * + *

List all search indexer data source connection names.

+ * + * {@codesnippet com.azure.search.documents.indexes.SearchIndexerAsyncClient.listDataSourceConnectionNames} + * * @return a list of DataSource names */ public PagedFlux listDataSourceConnectionNames() { @@ -273,6 +321,12 @@ private Mono> listDataSourceConnectionsWithRespo /** * Delete a DataSource * + *

Code Sample

+ * + *

Delete the search indexer data source connection named "dataSource".

+ * + * {@codesnippet com.azure.search.documents.indexes.SearchIndexerAsyncClient.deleteDataSourceConnection#String} + * * @param dataSourceName the name of the {@link SearchIndexerDataSourceConnection} for deletion * @return a void Mono */ @@ -285,6 +339,12 @@ public Mono deleteDataSourceConnection(String dataSourceName) { /** * Deletes an Azure Cognitive Search data source. * + *

Code Sample

+ * + *

Delete the search indexer data source connection named "dataSource".

+ * + * {@codesnippet com.azure.search.documents.indexes.SearchIndexerAsyncClient.deleteDataSourceConnectionWithResponse#SearchIndexerDataSourceConnection-boolean} + * * @param dataSource The {@link SearchIndexerDataSourceConnection} to delete. * @param onlyIfUnchanged {@code true} to delete if the {@code dataSource} is the same as the current service value. * {@code false} to always delete existing value. @@ -318,6 +378,12 @@ Mono> deleteDataSourceConnectionWithResponse(String dataSourceNam /** * Creates a new Azure Cognitive Search indexer. * + *

Code Sample

+ * + *

Create search indexer named "searchIndexer".

+ * + * {@codesnippet com.azure.search.documents.indexes.SearchIndexerAsyncClient.createIndexer#SearchIndexer} + * * @param indexer definition of the indexer to create. * @return the created Indexer. */ @@ -329,6 +395,12 @@ public Mono createIndexer(SearchIndexer indexer) { /** * Creates a new Azure Cognitive Search indexer. * + *

Code Sample

+ * + *

Create search indexer named "searchIndexer".

+ * + * {@codesnippet com.azure.search.documents.indexes.SearchIndexerAsyncClient.createIndexerWithResponse#SearchIndexer} + * * @param indexer definition of the indexer to create * @return a response containing the created Indexer. */ @@ -353,6 +425,12 @@ Mono> createIndexerWithResponse(SearchIndexer indexer, /** * Creates a new Azure Cognitive Search indexer or updates an indexer if it already exists. * + *

Code Sample

+ * + *

Create or update search indexer named "searchIndexer".

+ * + * {@codesnippet com.azure.search.documents.indexes.SearchIndexerAsyncClient.createOrUpdateIndexer#SearchIndexer} + * * @param indexer The definition of the indexer to create or update. * @return a response containing the created Indexer. */ @@ -364,6 +442,12 @@ public Mono createOrUpdateIndexer(SearchIndexer indexer) { /** * Creates a new Azure Cognitive Search indexer or updates an indexer if it already exists. * + *

Code Sample

+ * + *

Create or update search indexer named "searchIndexer".

+ * + * {@codesnippet com.azure.search.documents.indexes.SearchIndexerAsyncClient.createOrUpdateIndexerWithResponse#SearchIndexer-boolean} + * * @param indexer the definition of the {@link SearchIndexer} to create or update * @param onlyIfUnchanged {@code true} to update if the {@code indexer} is the same as the current service value. * {@code false} to always update existing value. @@ -396,6 +480,12 @@ Mono> createOrUpdateIndexerWithResponse(SearchIndexer in /** * Retrieves an indexer definition. * + *

Code Sample

+ * + *

Get search indexer with name "searchIndexer".

+ * + * {@codesnippet com.azure.search.documents.indexes.SearchIndexerAsyncClient.getIndexer#String} + * * @param indexerName the name of the indexer to retrieve * @return the indexer. */ @@ -407,6 +497,12 @@ public Mono getIndexer(String indexerName) { /** * Retrieves an indexer definition. * + *

Code Sample

+ * + *

Get search indexer with name "searchIndexer".

+ * + * {@codesnippet com.azure.search.documents.indexes.SearchIndexerAsyncClient.getIndexerWithResponse#String} + * * @param indexerName the name of the indexer to retrieve * @return a response containing the indexer. */ @@ -430,6 +526,12 @@ Mono> getIndexerWithResponse(String indexerName, /** * Lists all indexers available for an Azure Cognitive Search service. * + *

Code Sample

+ * + *

List all search indexers.

+ * + * {@codesnippet com.azure.search.documents.indexes.SearchIndexerAsyncClient.listIndexers} + * * @return a response containing all Indexers from the Search service. */ @ServiceMethod(returns = ReturnType.COLLECTION) @@ -455,6 +557,12 @@ PagedFlux listIndexers(Context context) { /** * Lists all indexers available for an Azure Cognitive Search service. * + *

Code Sample

+ * + *

List all search indexer names.

+ * + * {@codesnippet com.azure.search.documents.indexes.SearchIndexerAsyncClient.listIndexerNames} + * * @return a response containing all Indexers from the Search service. */ @ServiceMethod(returns = ReturnType.COLLECTION) @@ -487,6 +595,12 @@ private Mono> listIndexersWithResponse(String selec /** * Deletes an Azure Cognitive Search indexer. * + *

Code Sample

+ * + *

Delete search indexer named "searchIndexer".

+ * + * {@codesnippet com.azure.search.documents.indexes.SearchIndexerAsyncClient.deleteIndexer#String} + * * @param indexerName the name of the indexer to delete * @return a response signalling completion. */ @@ -499,6 +613,12 @@ public Mono deleteIndexer(String indexerName) { /** * Deletes an Azure Cognitive Search indexer. * + *

Code Sample

+ * + *

Delete search indexer named "searchIndexer".

+ * + * {@codesnippet com.azure.search.documents.indexes.SearchIndexerAsyncClient.deleteIndexerWithResponse#SearchIndexer-boolean} + * * @param indexer the {@link SearchIndexer} to delete * @param onlyIfUnchanged {@code true} to delete if the {@code indexer} is the same as the current service value. * {@code false} to always delete existing value. @@ -535,6 +655,12 @@ Mono> deleteIndexerWithResponse(String indexerName, String etag, /** * Resets the change tracking state associated with an indexer. * + *

Code Sample

+ * + *

Reset search indexer named "searchIndexer".

+ * + * {@codesnippet com.azure.search.documents.indexes.SearchIndexerAsyncClient.resetIndexer#String} + * * @param indexerName the name of the indexer to reset * @return a response signalling completion. */ @@ -546,6 +672,12 @@ public Mono resetIndexer(String indexerName) { /** * Resets the change tracking state associated with an indexer. * + *

Code Sample

+ * + *

Reset search indexer named "searchIndexer".

+ * + * {@codesnippet com.azure.search.documents.indexes.SearchIndexerAsyncClient.resetIndexerWithResponse#String} + * * @param indexerName the name of the indexer to reset * @return a response signalling completion. */ @@ -568,6 +700,12 @@ Mono> resetIndexerWithResponse(String indexerName, Context contex /** * Runs an indexer on-demand. * + *

Code Sample

+ * + *

Run search indexer named "searchIndexer".

+ * + * {@codesnippet com.azure.search.documents.indexes.SearchIndexerAsyncClient.runIndexer#String} + * * @param indexerName the name of the indexer to run * @return a response signalling completion. */ @@ -579,6 +717,12 @@ public Mono runIndexer(String indexerName) { /** * Runs an indexer on-demand. * + *

Code Sample

+ * + *

Run search indexer named "searchIndexer".

+ * + * {@codesnippet com.azure.search.documents.indexes.SearchIndexerAsyncClient.runIndexerWithResponse#String} + * * @param indexerName the name of the indexer to run * @return a response signalling completion. */ @@ -601,6 +745,12 @@ Mono> runIndexerWithResponse(String indexerName, Context context) /** * Returns the current status and execution history of an indexer. * + *

Code Sample

+ * + *

Get status for search indexer "searchIndexer".

+ * + * {@codesnippet com.azure.search.documents.indexes.SearchIndexerAsyncClient.getIndexerStatus#String} + * * @param indexerName the name of the indexer for which to retrieve status * @return the indexer execution info. */ @@ -612,6 +762,12 @@ public Mono getIndexerStatus(String indexerName) { /** * Returns the current status and execution history of an indexer. * + *

Code Sample

+ * + *

Get search indexer status.

+ * + * {@codesnippet com.azure.search.documents.indexes.SearchIndexerAsyncClient.getIndexerStatusWithResponse#String} + * * @param indexerName the name of the indexer for which to retrieve status * @return a response with the indexer execution info. */ @@ -636,6 +792,12 @@ Mono> getIndexerStatusWithResponse(String indexerN /** * Creates a new skillset in an Azure Cognitive Search service. * + *

Code Sample

+ * + *

Create search indexer skillset "searchIndexerSkillset".

+ * + * {@codesnippet com.azure.search.documents.indexes.SearchIndexerAsyncClient.createSkillset#SearchIndexerSkillset} + * * @param skillset definition of the skillset containing one or more cognitive skills * @return the created Skillset. */ @@ -647,6 +809,12 @@ public Mono createSkillset(SearchIndexerSkillset skillset /** * Creates a new skillset in an Azure Cognitive Search service. * + *

Code Sample

+ * + *

Create search indexer skillset "searchIndexerSkillset".

+ * + * {@codesnippet com.azure.search.documents.indexes.SearchIndexerAsyncClient.createSkillsetWithResponse#SearchIndexerSkillset} + * * @param skillset definition of the skillset containing one or more cognitive skills * @return a response containing the created Skillset. */ @@ -672,6 +840,12 @@ Mono> createSkillsetWithResponse(SearchIndexerSk /** * Retrieves a skillset definition. * + *

Code Sample

+ * + *

Get search indexer skillset "searchIndexerSkillset".

+ * + * {@codesnippet com.azure.search.documents.indexes.SearchIndexerAsyncClient.getSearchIndexerSkillset#String} + * * @param skillsetName the name of the skillset to retrieve * @return the Skillset. */ @@ -683,6 +857,12 @@ public Mono getSkillset(String skillsetName) { /** * Retrieves a skillset definition. * + *

Code Sample

+ * + *

Get search indexer skillset "searchIndexerSkillset".

+ * + * {@codesnippet com.azure.search.documents.indexes.SearchIndexerAsyncClient.getSkillsetWithResponse#String} + * * @param skillsetName the name of the skillset to retrieve * @return a response containing the Skillset. */ @@ -706,6 +886,12 @@ Mono> getSkillsetWithResponse(String skillsetNam /** * Lists all skillsets available for an Azure Cognitive Search service. * + *

Code Sample

+ * + *

List all search indexer skillsets.

+ * + * {@codesnippet com.azure.search.documents.indexes.SearchIndexerAsyncClient.listSkillsets} + * * @return a reactive response emitting the list of skillsets. */ @ServiceMethod(returns = ReturnType.COLLECTION) @@ -731,6 +917,12 @@ PagedFlux listSkillsets(Context context) { /** * Lists all skillset names for an Azure Cognitive Search service. * + *

Code Sample

+ * + *

List all search indexer skillset names.

+ * + * {@codesnippet com.azure.search.documents.indexes.SearchIndexerAsyncClient.listSkillsetNames} + * * @return a reactive response emitting the list of skillset names. */ @ServiceMethod(returns = ReturnType.COLLECTION) @@ -762,6 +954,12 @@ private Mono> listSkillsetsWithResponse(String sel /** * Creates a new Azure Cognitive Search skillset or updates a skillset if it already exists. * + *

Code Sample

+ * + *

Create or update search indexer skillset "searchIndexerSkillset".

+ * + * {@codesnippet com.azure.search.documents.indexes.SearchIndexerAsyncClient.createOrUpdateIndexerSkillset#SearchIndexerSkillset} + * * @param skillset the definition of the skillset to create or update * @return the skillset that was created or updated. */ @@ -773,6 +971,12 @@ public Mono createOrUpdateSkillset(SearchIndexerSkillset /** * Creates a new Azure Cognitive Search skillset or updates a skillset if it already exists. * + *

Code Sample

+ * + *

Create or update search indexer skillset "searchIndexerSkillset".

+ * + * {@codesnippet com.azure.search.documents.indexes.SearchIndexerAsyncClient.createOrUpdateSkillsetWithResponse#SearchIndexerSkillset-boolean} + * * @param skillset the definition of the skillset to create or update * @param onlyIfUnchanged {@code true} to update if the {@code skillset} is the same as the current service value. * {@code false} to always update existing value. @@ -805,6 +1009,12 @@ Mono> createOrUpdateSkillsetWithResponse(SearchI /** * Deletes a cognitive skillset in an Azure Cognitive Search service. * + *

Code Sample

+ * + *

Delete search indexer skillset "searchIndexerSkillset".

+ * + * {@codesnippet com.azure.search.documents.indexes.SearchIndexerAsyncClient.deleteSkillset#String} + * * @param skillsetName the name of the skillset to delete * @return a response signalling completion. */ @@ -817,6 +1027,12 @@ public Mono deleteSkillset(String skillsetName) { /** * Deletes a cognitive skillset in an Azure Cognitive Search service. * + *

Code Sample

+ * + *

Delete search indexer skillset "searchIndexerSkillset".

+ * + * {@codesnippet com.azure.search.documents.indexes.SearchIndexerAsyncClient.deleteSkillsetWithResponse#SearchIndexerSkillset-boolean} + * * @param skillset the {@link SearchIndexerSkillset} to delete. * @param onlyIfUnchanged {@code true} to delete if the {@code skillset} is the same as the current service value. * {@code false} to always delete existing value. diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/SearchIndexerClient.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/SearchIndexerClient.java index 87c5f726d8721..819cdf381f3ce 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/SearchIndexerClient.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/SearchIndexerClient.java @@ -66,7 +66,7 @@ public SearchIndexerDataSourceConnection createOrUpdateDataSourceConnection( * *

Code Sample

* - *

Create or update search indexer data source connection response named "dataSource".

+ *

Create or update search indexer data source connection named "dataSource".

* * {@codesnippet com.azure.search.documents.indexes.SearchIndexerClient.createOrUpdateDataSourceConnectionWithResponse#SearchIndexerDataSourceConnection-boolean-Context} * @@ -79,8 +79,7 @@ public SearchIndexerDataSourceConnection createOrUpdateDataSourceConnection( */ @ServiceMethod(returns = ReturnType.SINGLE) public Response createOrUpdateDataSourceConnectionWithResponse( - SearchIndexerDataSourceConnection dataSourceConnection, boolean onlyIfUnchanged, - Context context) { + SearchIndexerDataSourceConnection dataSourceConnection, boolean onlyIfUnchanged, Context context) { return asyncClient.createOrUpdateDataSourceConnectionWithResponse(dataSourceConnection, onlyIfUnchanged, context).block(); } @@ -108,7 +107,7 @@ public SearchIndexerDataSourceConnection createDataSourceConnection( * *

Code Sample

* - *

Create search indexer data source connection response named "dataSource".

+ *

Create search indexer data source connection named "dataSource".

* * {@codesnippet com.azure.search.documents.indexes.SearchIndexerClient.createDataSourceConnectionWithResponse#SearchIndexerDataSourceConnection-Context} * @@ -128,7 +127,7 @@ public Response createDataSourceConnectionWit * *

Code Sample

* - *

Get search indexer data source connection response named "dataSource".

+ *

Get search indexer data source connection named "dataSource".

* * {@codesnippet com.azure.search.documents.indexes.SearchIndexerClient.getDataSourceConnection#String} * @@ -145,7 +144,7 @@ public SearchIndexerDataSourceConnection getDataSourceConnection(String dataSour * *

Code Sample

* - *

Get search indexer data source connection response named "dataSource".

+ *

Get search indexer data source connection named "dataSource".

* * {@codesnippet com.azure.search.documents.indexes.SearchIndexerClient.getDataSourceConnectionWithResponse#String-Context} * @@ -165,7 +164,7 @@ public Response getDataSourceConnectionWithRe * *

Code Sample

* - *

List all search indexer data source connection.

+ *

List all search indexer data source connections.

* * {@codesnippet com.azure.search.documents.indexes.SearchIndexerClient.listDataSourceConnections} * @@ -181,7 +180,7 @@ public PagedIterable listDataSourceConnection * *

Code Sample

* - *

List all search indexer data source connection.

+ *

List all search indexer data source connections.

* * {@codesnippet com.azure.search.documents.indexes.SearchIndexerClient.listDataSourceConnectionsWithResponse#Context} * @@ -214,7 +213,7 @@ public PagedIterable listDataSourceConnectionNames() { * *

Code Sample

* - *

List all search indexer data source connection names with context.

+ *

List all search indexer data source connection names.

* * {@codesnippet com.azure.search.documents.indexes.SearchIndexerClient.listDataSourceConnectionNamesWithContext#Context} * @@ -248,7 +247,7 @@ public void deleteDataSourceConnection(String dataSourceConnectionName) { * *

Code Sample

* - *

Delete all search indexer data source connection named "dataSource" with response.

+ *

Delete all search indexer data source connection named "dataSource".

* * {@codesnippet com.azure.search.documents.indexes.SearchIndexerClient.deleteDataSourceConnectionWithResponse#SearchIndexerDataSourceConnection-boolean-Context} * @@ -289,7 +288,7 @@ public SearchIndexer createIndexer(SearchIndexer indexer) { * *

Code Sample

* - *

Create search indexer named "searchIndexer" with response.

+ *

Create search indexer named "searchIndexer".

* * {@codesnippet com.azure.search.documents.indexes.SearchIndexerClient.createIndexerWithResponse#SearchIndexer-Context} * @@ -325,7 +324,7 @@ public SearchIndexer createOrUpdateIndexer(SearchIndexer indexer) { * *

Code Sample

* - *

Create or update search indexer named "searchIndexer" with response.

+ *

Create or update search indexer named "searchIndexer".

* * {@codesnippet com.azure.search.documents.indexes.SearchIndexerClient.createOrUpdateIndexerWithResponse#SearchIndexer-boolean-Context} * @@ -346,7 +345,7 @@ public Response createOrUpdateIndexerWithResponse(SearchIndexer i * *

Code Sample

* - *

List all search indexer.

+ *

List all search indexers.

* * {@codesnippet com.azure.search.documents.indexes.SearchIndexerClient.listIndexers} * @@ -362,7 +361,7 @@ public PagedIterable listIndexers() { * *

Code Sample

* - *

List all search indexer with response.

+ *

List all search indexers.

* * {@codesnippet com.azure.search.documents.indexes.SearchIndexerClient.listIndexersWithResponse#Context} * @@ -395,7 +394,7 @@ public PagedIterable listIndexerNames() { * *

Code Sample

* - *

List all search indexer names with response.

+ *

List all search indexer names.

* * {@codesnippet com.azure.search.documents.indexes.SearchIndexerClient.listIndexerNames#Context} * @@ -429,7 +428,7 @@ public SearchIndexer getIndexer(String indexerName) { * *

Code Sample

* - *

Get search indexer response with name "searchIndexer".

+ *

Get search indexer with name "searchIndexer".

* * {@codesnippet com.azure.search.documents.indexes.SearchIndexerClient.getIndexerWithResponse#String-Context} * @@ -464,7 +463,7 @@ public void deleteIndexer(String indexerName) { * *

Code Sample

* - *

Delete search indexer response named "searchIndexer".

+ *

Delete search indexe named "searchIndexer".

* * {@codesnippet com.azure.search.documents.indexes.SearchIndexerClient.deleteIndexerWithResponse#SearchIndexer-boolean-Context} * @@ -502,7 +501,7 @@ public void resetIndexer(String indexerName) { * *

Code Sample

* - *

Reset search indexer response named "searchIndexer".

+ *

Reset search indexer named "searchIndexer".

* * {@codesnippet com.azure.search.documents.indexes.SearchIndexerClient.resetIndexerWithResponse#String-Context} * @@ -536,7 +535,7 @@ public void runIndexer(String indexerName) { * *

Code Sample

* - *

Run search indexer response named "searchIndexer".

+ *

Run search indexer named "searchIndexer".

* * {@codesnippet com.azure.search.documents.indexes.SearchIndexerClient.runIndexerWithResponse#String-Context} * @@ -571,7 +570,7 @@ public SearchIndexerStatus getIndexerStatus(String indexerName) { * *

Code Sample

* - *

Run search indexer status with response.

+ *

Get search indexer status.

* * {@codesnippet com.azure.search.documents.indexes.SearchIndexerClient.getIndexerStatusWithResponse#String-Context} * @@ -608,7 +607,7 @@ public SearchIndexerSkillset createSkillset(SearchIndexerSkillset skillset) { * *

Code Sample

* - *

Create search indexer skillset "searchIndexerSkillset" with response.

+ *

Create search indexer skillset "searchIndexerSkillset".

* * {@codesnippet com.azure.search.documents.indexes.SearchIndexerClient.createSkillsetWithResponse#SearchIndexerSkillset-Context} * @@ -644,7 +643,7 @@ public SearchIndexerSkillset getSkillset(String skillsetName) { * *

Code Sample

* - *

Get search indexer skillset "searchIndexerSkillset" with response.

+ *

Get search indexer skillset "searchIndexerSkillset".

* * {@codesnippet com.azure.search.documents.indexes.SearchIndexerClient.getSkillsetWithResponse#String-Context} * @@ -679,7 +678,7 @@ public PagedIterable listSkillsets() { * *

Code Sample

* - *

List all search indexer skillsets with response.

+ *

List all search indexer skillsets.

* * {@codesnippet com.azure.search.documents.indexes.SearchIndexerClient.listSkillsetsWithContext#Context} * @@ -746,7 +745,7 @@ public SearchIndexerSkillset createOrUpdateSkillset(SearchIndexerSkillset skills * *

Code Sample

* - *

Create or update search indexer skillset "searchIndexerSkillset" with response.

+ *

Create or update search indexer skillset "searchIndexerSkillset".

* * {@codesnippet com.azure.search.documents.indexes.SearchIndexerClient.createOrUpdateSkillsetWithResponse#SearchIndexerSkillset-boolean-Context} * @@ -766,6 +765,12 @@ public Response createOrUpdateSkillsetWithResponse(Search /** * Deletes a cognitive skillset in an Azure Cognitive Search service. * + *

Code Sample

+ * + *

Delete search indexer skillset "searchIndexerSkillset".

+ * + * {@codesnippet com.azure.search.documents.indexes.SearchIndexerClient.deleteSkillset#String} + * * @param skillsetName the name of the skillset to delete */ @ServiceMethod(returns = ReturnType.SINGLE) @@ -776,6 +781,12 @@ public void deleteSkillset(String skillsetName) { /** * Deletes a cognitive skillset in an Azure Cognitive Search service. * + *

Code Sample

+ * + *

Delete search indexer skillset "searchIndexerSkillset".

+ * + * {@codesnippet com.azure.search.documents.indexes.SearchIndexerClient.deleteSkillsetWithResponse#SearchIndexerSkillset-boolean-Context} + * * @param skillset the {@link SearchIndexerSkillset} to delete. * @param onlyIfUnchanged {@code true} to delete if the {@code skillset} is the same as the current service value. * {@code false} to always delete existing value. diff --git a/sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/SearchJavaDocCodeSnippets.java b/sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/SearchJavaDocCodeSnippets.java index 61cc9d5d76e68..62c6b34a4ab3c 100644 --- a/sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/SearchJavaDocCodeSnippets.java +++ b/sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/SearchJavaDocCodeSnippets.java @@ -1642,7 +1642,6 @@ public void listIndexerNamesWithContext() { // END: com.azure.search.documents.indexes.SearchIndexerClient.listIndexerNames#Context } - /** * Code snippet for {@link SearchIndexerClient#createOrUpdateIndexer(SearchIndexer)} */ @@ -1651,11 +1650,9 @@ public void createOrUpdateIndexer() { SearchIndexer searchIndexerFromService = searchIndexerClient.getIndexer("searchIndexer"); searchIndexerFromService.setFieldMappings(Collections.singletonList( new FieldMapping("hotelName").setTargetFieldName("HotelName"))); - SearchIndexer searchIndexer = new SearchIndexer("searchIndexer", "dataSource", - "searchIndex"); - SearchIndexer indexerFromService = searchIndexerClient.createOrUpdateIndexer(searchIndexer); + SearchIndexer updateIndexer = searchIndexerClient.createOrUpdateIndexer(searchIndexerFromService); System.out.printf("The indexer name is %s. The target field name of indexer is %s.%n", - indexerFromService.getName(), indexerFromService.getFieldMappings().get(0).getTargetFieldName()); + updateIndexer.getName(), updateIndexer.getFieldMappings().get(0).getTargetFieldName()); // END: com.azure.search.documents.indexes.SearchIndexerClient.createOrUpdateIndexer#SearchIndexer } @@ -1667,10 +1664,8 @@ public void createOrUpdateIndexerWithResponse() { SearchIndexer searchIndexerFromService = searchIndexerClient.getIndexer("searchIndexer"); searchIndexerFromService.setFieldMappings(Collections.singletonList( new FieldMapping("hotelName").setTargetFieldName("HotelName"))); - SearchIndexer searchIndexer = new SearchIndexer("searchIndexer", "dataSource", - "searchIndex"); Response indexerFromService = searchIndexerClient.createOrUpdateIndexerWithResponse( - searchIndexer, true, new Context(key1, value1)); + searchIndexerFromService, true, new Context(key1, value1)); System.out.printf("The status code of the response is %s.%nThe indexer name is %s. " + "The target field name of indexer is %s.%n", indexerFromService.getStatusCode(), indexerFromService.getValue().getName(), @@ -1875,7 +1870,6 @@ public void listDataSourceNamesWithContext() { // END: com.azure.search.documents.indexes.SearchIndexerClient.listDataSourceConnectionNamesWithContext#Context } - /** * Code snippet for {@link SearchIndexerClient#createOrUpdateDataSourceConnection(SearchIndexerDataSourceConnection)} */ @@ -2131,4 +2125,496 @@ public void createSearchIndexerAsyncClientFromBuilder() { .buildAsyncClient(); // END: com.azure.search.documents.indexes.SearchIndexerAsyncClient.instantiation } + + /** + * Code snippet for creating {@link SearchIndexerAsyncClient#createIndexer(SearchIndexer)}. + */ + public void createSearchIndexerAsync() { + // BEGIN: com.azure.search.documents.indexes.SearchIndexerAsyncClient.createIndexer#SearchIndexer + SearchIndexer searchIndexer = new SearchIndexer("searchIndexer", "dataSource", + "searchIndex"); + searchIndexerAsyncClient.createIndexer(searchIndexer) + .subscribe(indexerFromService -> + System.out.printf("The indexer name is %s. The etag of indexer is %s.%n", indexerFromService.getName(), + indexerFromService.getETag())); + // END: com.azure.search.documents.indexes.SearchIndexerAsyncClient.createIndexer#SearchIndexer + } + + /** + * Code snippet for {@link SearchIndexerAsyncClient#createIndexerWithResponse(SearchIndexer)}. + */ + public void createSearchIndexerWithResponseAsync() { + // BEGIN: com.azure.search.documents.indexes.SearchIndexerAsyncClient.createIndexerWithResponse#SearchIndexer + SearchIndexer searchIndexer = new SearchIndexer("searchIndexer", "dataSource", + "searchIndex"); + searchIndexerAsyncClient.createIndexerWithResponse(searchIndexer) + .subscribe(indexerFromServiceResponse -> + System.out.printf("The status code of the response is %s. The indexer name is %s.%n", + indexerFromServiceResponse.getStatusCode(), indexerFromServiceResponse.getValue().getName())); + // END: com.azure.search.documents.indexes.SearchIndexerAsyncClient.createIndexerWithResponse#SearchIndexer + } + + /** + * Code snippet for {@link SearchIndexerAsyncClient#getIndexer(String)} + */ + public void getSearchIndexerAsync() { + // BEGIN: com.azure.search.documents.indexes.SearchIndexerAsyncClient.getIndexer#String + searchIndexerAsyncClient.getIndexer("searchIndexer") + .subscribe(indexerFromService -> + System.out.printf("The indexer name is %s. The etag of indexer is %s.%n", indexerFromService.getName(), + indexerFromService.getETag())); + // END: com.azure.search.documents.indexes.SearchIndexerAsyncClient.getIndexer#String + } + + /** + * Code snippet for {@link SearchIndexerAsyncClient#getIndexerWithResponse(String)}} + */ + public void getSearchIndexerWithResponseAsync() { + // BEGIN: com.azure.search.documents.indexes.SearchIndexerAsyncClient.getIndexerWithResponse#String + searchIndexerAsyncClient.getIndexerWithResponse("searchIndexer") + .subscribe(indexerFromServiceResponse -> + System.out.printf("The status code of the response is %s. The indexer name is %s.%n", + indexerFromServiceResponse.getStatusCode(), indexerFromServiceResponse.getValue().getName())); + // END: com.azure.search.documents.indexes.SearchIndexerAsyncClient.getIndexerWithResponse#String + } + + + /** + * Code snippet for {@link SearchIndexerAsyncClient#listIndexers()} + */ + public void listIndexersAsync() { + // BEGIN: com.azure.search.documents.indexes.SearchIndexerAsyncClient.listIndexers + searchIndexerAsyncClient.listIndexers() + .subscribe(indexer -> + System.out.printf("The indexer name is %s. The etag of indexer is %s.%n", indexer.getName(), + indexer.getETag())); + // END: com.azure.search.documents.indexes.SearchIndexerAsyncClient.listIndexers + } + + /** + * Code snippet for {@link SearchIndexerAsyncClient#listIndexerNames()} + */ + public void listIndexerNamesAsync() { + // BEGIN: com.azure.search.documents.indexes.SearchIndexerAsyncClient.listIndexerNames + searchIndexerAsyncClient.listIndexerNames() + .subscribe(indexerName -> System.out.printf("The indexer name is %s.%n", indexerName)); + // END: com.azure.search.documents.indexes.SearchIndexerAsyncClient.listIndexerNames + } + + /** + * Code snippet for {@link SearchIndexerAsyncClient#createOrUpdateIndexer(SearchIndexer)} + */ + public void createOrUpdateIndexerAsync() { + // BEGIN: com.azure.search.documents.indexes.SearchIndexerAsyncClient.createOrUpdateIndexer#SearchIndexer + searchIndexerAsyncClient.getIndexer("searchIndexer") + .flatMap(searchIndexerFromService -> { + searchIndexerFromService.setFieldMappings(Collections.singletonList( + new FieldMapping("hotelName").setTargetFieldName("HotelName"))); + return searchIndexerAsyncClient.createOrUpdateIndexer(searchIndexerFromService); + }) + .subscribe(updatedIndexer -> + System.out.printf("The indexer name is %s. The target field name of indexer is %s.%n", + updatedIndexer.getName(), updatedIndexer.getFieldMappings().get(0).getTargetFieldName())); + // END: com.azure.search.documents.indexes.SearchIndexerAsyncClient.createOrUpdateIndexer#SearchIndexer + } + + /** + * Code snippet for {@link SearchIndexerAsyncClient#createOrUpdateIndexer(SearchIndexer)} + */ + public void createOrUpdateIndexerWithResponseAsync() { + // BEGIN: com.azure.search.documents.indexes.SearchIndexerAsyncClient.createOrUpdateIndexerWithResponse#SearchIndexer-boolean + searchIndexerAsyncClient.getIndexer("searchIndexer") + .flatMap(searchIndexerFromService -> { + searchIndexerFromService.setFieldMappings(Collections.singletonList( + new FieldMapping("hotelName").setTargetFieldName("HotelName"))); + return searchIndexerAsyncClient.createOrUpdateIndexerWithResponse(searchIndexerFromService, true); + }) + .subscribe(indexerFromService -> + System.out.printf("The status code of the response is %s.%nThe indexer name is %s. " + + "The target field name of indexer is %s.%n", indexerFromService.getStatusCode(), + indexerFromService.getValue().getName(), + indexerFromService.getValue().getFieldMappings().get(0).getTargetFieldName())); + // END: com.azure.search.documents.indexes.SearchIndexerAsyncClient.createOrUpdateIndexerWithResponse#SearchIndexer-boolean + } + + /** + * Code snippet for {@link SearchIndexerAsyncClient#deleteIndexer(String)} + */ + public void deleteSearchIndexerAsync() { + // BEGIN: com.azure.search.documents.indexes.SearchIndexerAsyncClient.deleteIndexer#String + searchIndexerAsyncClient.deleteIndexer("searchIndexer") + .subscribe(); + // END: com.azure.search.documents.indexes.SearchIndexerAsyncClient.deleteIndexer#String + } + + /** + * Code snippet for {@link SearchIndexerAsyncClient#deleteIndexerWithResponse(SearchIndexer, boolean)} + */ + public void deleteSearchIndexerWithResponseAsync() { + // BEGIN: com.azure.search.documents.indexes.SearchIndexerAsyncClient.deleteIndexerWithResponse#SearchIndexer-boolean + searchIndexerAsyncClient.getIndexer("searchIndexer") + .flatMap(searchIndexer -> + searchIndexerAsyncClient.deleteIndexerWithResponse(searchIndexer, true)) + .subscribe(deleteResponse -> + System.out.printf("The status code of the response is %d.%n", deleteResponse.getStatusCode())); + // END: com.azure.search.documents.indexes.SearchIndexerAsyncClient.deleteIndexerWithResponse#SearchIndexer-boolean + } + + /** + * Code snippet for {@link SearchIndexerAsyncClient#resetIndexer(String)} + */ + public void resetIndexerAsync() { + // BEGIN: com.azure.search.documents.indexes.SearchIndexerAsyncClient.resetIndexer#String + searchIndexerAsyncClient.resetIndexer("searchIndexer") + .subscribe(); + // END: com.azure.search.documents.indexes.SearchIndexerAsyncClient.resetIndexer#String + } + + /** + * Code snippet for {@link SearchIndexerAsyncClient#resetIndexerWithResponse(String)} + */ + public void resetIndexerWithResponseAsync() { + // BEGIN: com.azure.search.documents.indexes.SearchIndexerAsyncClient.resetIndexerWithResponse#String + searchIndexerAsyncClient.resetIndexerWithResponse("searchIndexer") + .subscribe(response -> + System.out.println("The status code of the response is " + response.getStatusCode())); + // END: com.azure.search.documents.indexes.SearchIndexerAsyncClient.resetIndexerWithResponse#String + } + + /** + * Code snippet for {@link SearchIndexerAsyncClient#runIndexer(String)} + */ + public void runIndexerAsync() { + // BEGIN: com.azure.search.documents.indexes.SearchIndexerAsyncClient.runIndexer#String + searchIndexerAsyncClient.runIndexer("searchIndexer") + .subscribe(); + // END: com.azure.search.documents.indexes.SearchIndexerAsyncClient.runIndexer#String + } + + /** + * Code snippet for {@link SearchIndexerAsyncClient#runIndexerWithResponse(String)} + */ + public void runIndexerWithResponseAsync() { + // BEGIN: com.azure.search.documents.indexes.SearchIndexerAsyncClient.runIndexerWithResponse#String + searchIndexerAsyncClient.runIndexerWithResponse("searchIndexer") + .subscribe(response -> + System.out.println("The status code of the response is " + response.getStatusCode())); + // END: com.azure.search.documents.indexes.SearchIndexerAsyncClient.runIndexerWithResponse#String + } + + /** + * Code snippet for {@link SearchIndexerAsyncClient#getIndexerStatus(String)} + */ + public void getIndexerStatusAsync() { + // BEGIN: com.azure.search.documents.indexes.SearchIndexerAsyncClient.getIndexerStatus#String + searchIndexerAsyncClient.getIndexerStatus("searchIndexer") + .subscribe(indexerStatus -> + System.out.printf("The indexer status is %s.%n", indexerStatus.getStatus())); + // END: com.azure.search.documents.indexes.SearchIndexerAsyncClient.getIndexerStatus#String + } + + /** + * Code snippet for {@link SearchIndexerAsyncClient#getIndexerStatusWithResponse(String)} + */ + public void getIndexerStatusWithResponseAsync() { + // BEGIN: com.azure.search.documents.indexes.SearchIndexerAsyncClient.getIndexerStatusWithResponse#String + searchIndexerAsyncClient.getIndexerStatusWithResponse("searchIndexer") + .subscribe(response -> + System.out.printf("The status code of the response is %s.%nThe indexer status is %s.%n", + response.getStatusCode(), response.getValue().getStatus())); + // END: com.azure.search.documents.indexes.SearchIndexerAsyncClient.getIndexerStatusWithResponse#String + } + + /** + * Code snippet for creating {@link SearchIndexerAsyncClient#createDataSourceConnection(SearchIndexerDataSourceConnection)}. + */ + public void createDataSourceAsync() { + // BEGIN: com.azure.search.documents.indexes.SearchIndexerAsyncClient.createDataSourceConnection#SearchIndexerDataSourceConnection + SearchIndexerDataSourceConnection dataSource = new SearchIndexerDataSourceConnection("dataSource", + com.azure.search.documents.indexes.models.SearchIndexerDataSourceType.AZURE_BLOB, "{connectionString}", + new com.azure.search.documents.indexes.models.SearchIndexerDataContainer("container")); + searchIndexerAsyncClient.createDataSourceConnection(dataSource) + .subscribe(dataSourceFromService -> + System.out.printf("The data source name is %s. The etag of data source is %s.%n", + dataSourceFromService.getName(), dataSourceFromService.getETag())); + // END: com.azure.search.documents.indexes.SearchIndexerAsyncClient.createDataSourceConnection#SearchIndexerDataSourceConnection + } + + /** + * Code snippet for {@link SearchIndexerAsyncClient#createDataSourceConnectionWithResponse(SearchIndexerDataSourceConnection)}. + */ + public void createDataSourceWithResponseAsync() { + // BEGIN: com.azure.search.documents.indexes.SearchIndexerAsyncClient.createDataSourceConnectionWithResponse#SearchIndexerDataSourceConnection + SearchIndexerDataSourceConnection dataSource = new SearchIndexerDataSourceConnection("dataSource", + SearchIndexerDataSourceType.AZURE_BLOB, "{connectionString}", + new SearchIndexerDataContainer("container")); + searchIndexerAsyncClient.createDataSourceConnectionWithResponse(dataSource) + .subscribe(dataSourceFromService -> + System.out.printf("The status code of the response is %s. The data source name is %s.%n", + dataSourceFromService.getStatusCode(), dataSourceFromService.getValue().getName())); + // END: com.azure.search.documents.indexes.SearchIndexerAsyncClient.createDataSourceConnectionWithResponse#SearchIndexerDataSourceConnection + } + + /** + * Code snippet for {@link SearchIndexerAsyncClient#getDataSourceConnection(String)} + */ + public void getDataSourceAsync() { + // BEGIN: com.azure.search.documents.indexes.SearchIndexerAsyncClient.getDataSourceConnection#String + searchIndexerAsyncClient.getDataSourceConnection("dataSource") + .subscribe(dataSource -> + System.out.printf("The dataSource name is %s. The etag of dataSource is %s.%n", dataSource.getName(), + dataSource.getETag())); + // END: com.azure.search.documents.indexes.SearchIndexerAsyncClient.getDataSourceConnection#String + } + + /** + * Code snippet for {@link SearchIndexerAsyncClient#getDataSourceConnectionWithResponse(String)} + */ + public void getDataSourceWithResponseAsync() { + // BEGIN: com.azure.search.documents.indexes.SearchIndexerAsyncClient.getDataSourceConnectionWithResponse#String + searchIndexerAsyncClient.getDataSourceConnectionWithResponse("dataSource") + .subscribe(dataSource -> + System.out.printf("The status code of the response is %s. The data source name is %s.%n", + dataSource.getStatusCode(), dataSource.getValue().getName())); + // END: com.azure.search.documents.indexes.SearchIndexerAsyncClient.getDataSourceConnectionWithResponse#String + } + + + /** + * Code snippet for {@link SearchIndexerAsyncClient#listDataSourceConnections()} + */ + public void listDataSourcesAsync() { + // BEGIN: com.azure.search.documents.indexes.SearchIndexerAsyncClient.listDataSourceConnections + searchIndexerAsyncClient.listDataSourceConnections() + .subscribe(dataSource -> + System.out.printf("The dataSource name is %s. The etag of dataSource is %s.%n", + dataSource.getName(), dataSource.getETag()) + ); + // END: com.azure.search.documents.indexes.SearchIndexerAsyncClient.listDataSourceConnections + } + + /** + * Code snippet for {@link SearchIndexerAsyncClient#listDataSourceConnectionNames()} + */ + public void listDataSourceNamesAsync() { + // BEGIN: com.azure.search.documents.indexes.SearchIndexerAsyncClient.listDataSourceConnectionNames + searchIndexerAsyncClient.listDataSourceConnectionNames() + .subscribe(dataSourceName -> System.out.printf("The dataSource name is %s.%n", dataSourceName)); + // END: com.azure.search.documents.indexes.SearchIndexerAsyncClient.listDataSourceConnectionNames + } + + /** + * Code snippet for {@link SearchIndexerAsyncClient#createOrUpdateDataSourceConnection(SearchIndexerDataSourceConnection)} + */ + public void createOrUpdateDataSourceAsync() { + // BEGIN: com.azure.search.documents.indexes.SearchIndexerAsyncClient.createOrUpdateDataSourceConnection#SearchIndexerDataSourceConnection + SearchIndexerDataSourceConnection dataSource = searchIndexerClient.getDataSourceConnection("dataSource"); + dataSource.setContainer(new SearchIndexerDataContainer("updatecontainer")); + + SearchIndexerDataSourceConnection updateDataSource = searchIndexerClient.createOrUpdateDataSourceConnection(dataSource); + System.out.printf("The dataSource name is %s. The container name of dataSource is %s.%n", + updateDataSource.getName(), updateDataSource.getContainer().getName()); + // END: com.azure.search.documents.indexes.SearchIndexerAsyncClient.createOrUpdateDataSourceConnection#SearchIndexerDataSourceConnection + } + + /** + * Code snippet for {@link SearchIndexerAsyncClient#createIndexerWithResponse(SearchIndexer)} + */ + public void createOrUpdateDataSourceWithResponseAsync() { + // BEGIN: com.azure.search.documents.indexes.SearchIndexerAsyncClient.createOrUpdateDataSourceConnectionWithResponse#SearchIndexerDataSourceConnection-boolean + searchIndexerAsyncClient.getDataSourceConnection("dataSource") + .flatMap(dataSource -> { + dataSource.setContainer(new SearchIndexerDataContainer("updatecontainer")); + return searchIndexerAsyncClient.createOrUpdateDataSourceConnectionWithResponse(dataSource, true); + }) + .subscribe(updateDataSource -> + System.out.printf("The status code of the response is %s.%nThe dataSource name is %s. " + + "The container name of dataSource is %s.%n", updateDataSource.getStatusCode(), + updateDataSource.getValue().getName(), updateDataSource.getValue().getContainer().getName())); + // END: com.azure.search.documents.indexes.SearchIndexerAsyncClient.createOrUpdateDataSourceConnectionWithResponse#SearchIndexerDataSourceConnection-boolean + } + + /** + * Code snippet for {@link SearchIndexerAsyncClient#deleteDataSourceConnection(String)} + */ + public void deleteDataSourceAsync() { + // BEGIN: com.azure.search.documents.indexes.SearchIndexerAsyncClient.deleteDataSourceConnection#String + searchIndexerAsyncClient.deleteDataSourceConnection("dataSource") + .subscribe(); + // END: com.azure.search.documents.indexes.SearchIndexerAsyncClient.deleteDataSourceConnection#String + } + + /** + * Code snippet for {@link SearchIndexerAsyncClient#deleteDataSourceConnectionWithResponse(SearchIndexerDataSourceConnection, boolean)} + */ + public void deleteDataSourceWithResponseAsync() { + // BEGIN: com.azure.search.documents.indexes.SearchIndexerAsyncClient.deleteDataSourceConnectionWithResponse#SearchIndexerDataSourceConnection-boolean + searchIndexerAsyncClient.getDataSourceConnection("dataSource") + .flatMap(dataSource -> searchIndexerAsyncClient.deleteDataSourceConnectionWithResponse(dataSource, true)) + .subscribe(deleteResponse -> + System.out.printf("The status code of the response is %d.%n", deleteResponse.getStatusCode())); + // END: com.azure.search.documents.indexes.SearchIndexerAsyncClient.deleteDataSourceConnectionWithResponse#SearchIndexerDataSourceConnection-boolean + } + + /** + * Code snippet for {@link SearchIndexerAsyncClient#createSkillset(SearchIndexerSkillset)} + */ + public void createSearchIndexerSkillsetAsync() { + // BEGIN: com.azure.search.documents.indexes.SearchIndexerAsyncClient.createSkillset#SearchIndexerSkillset + List inputs = Collections.singletonList( + new InputFieldMappingEntry("image") + .setSource("/document/normalized_images/*") + ); + + List outputs = Arrays.asList( + new OutputFieldMappingEntry("text") + .setTargetName("mytext"), + new OutputFieldMappingEntry("layoutText") + .setTargetName("myLayoutText") + ); + SearchIndexerSkillset searchIndexerSkillset = new SearchIndexerSkillset("searchIndexerSkillset", + Collections.singletonList(new OcrSkill(inputs, outputs) + .setShouldDetectOrientation(true) + .setDefaultLanguageCode(null) + .setName("myocr") + .setDescription("Extracts text (plain and structured) from image.") + .setContext("/document/normalized_images/*"))); + searchIndexerAsyncClient.createSkillset(searchIndexerSkillset) + .subscribe(skillset -> + System.out.printf("The indexer skillset name is %s. The etag of indexer skillset is %s.%n", + skillset.getName(), skillset.getETag())); + // END: com.azure.search.documents.indexes.SearchIndexerAsyncClient.createSkillset#SearchIndexerSkillset + } + + /** + * Code snippet for {@link SearchIndexerAsyncClient#createSkillsetWithResponse(SearchIndexerSkillset)}. + */ + public void createSearchIndexerSkillsetWithResponseAsync() { + // BEGIN: com.azure.search.documents.indexes.SearchIndexerAsyncClient.createSkillsetWithResponse#SearchIndexerSkillset + List inputs = Collections.singletonList( + new InputFieldMappingEntry("image") + .setSource("/document/normalized_images/*") + ); + + List outputs = Arrays.asList( + new OutputFieldMappingEntry("text") + .setTargetName("mytext"), + new OutputFieldMappingEntry("layoutText") + .setTargetName("myLayoutText") + ); + SearchIndexerSkillset searchIndexerSkillset = new SearchIndexerSkillset("searchIndexerSkillset", + Collections.singletonList(new OcrSkill(inputs, outputs) + .setShouldDetectOrientation(true) + .setDefaultLanguageCode(null) + .setName("myocr") + .setDescription("Extracts text (plain and structured) from image.") + .setContext("/document/normalized_images/*"))); + searchIndexerAsyncClient.createSkillsetWithResponse(searchIndexerSkillset) + .subscribe(skillsetWithResponse -> + System.out.printf("The status code of the response is %s. The indexer skillset name is %s.%n", + skillsetWithResponse.getStatusCode(), skillsetWithResponse.getValue().getName())); + // END: com.azure.search.documents.indexes.SearchIndexerAsyncClient.createSkillsetWithResponse#SearchIndexerSkillset + } + + /** + * Code snippet for {@link SearchIndexerAsyncClient#getSkillset(String)} + */ + public void getSearchIndexerSkillsetAsync() { + // BEGIN: com.azure.search.documents.indexes.SearchIndexerAsyncClient.getSearchIndexerSkillset#String + searchIndexerAsyncClient.getSkillset("searchIndexerSkillset") + .subscribe(indexerSkillset -> + System.out.printf("The indexer skillset name is %s. The etag of indexer skillset is %s.%n", + indexerSkillset.getName(), indexerSkillset.getETag())); + // END: com.azure.search.documents.indexes.SearchIndexerAsyncClient.getSearchIndexerSkillset#String + } + + /** + * Code snippet for {@link SearchIndexerAsyncClient#getSkillsetWithResponse(String)} + */ + public void getSearchIndexerSkillsetWithResponseAsync() { + // BEGIN: com.azure.search.documents.indexes.SearchIndexerAsyncClient.getSkillsetWithResponse#String + searchIndexerAsyncClient.getSkillsetWithResponse("searchIndexerSkillset") + .subscribe(skillsetWithResponse -> + System.out.printf("The status code of the response is %s. The indexer skillset name is %s.%n", + skillsetWithResponse.getStatusCode(), skillsetWithResponse.getValue().getName())); + // END: com.azure.search.documents.indexes.SearchIndexerAsyncClient.getSkillsetWithResponse#String + } + + /** + * Code snippet for {@link SearchIndexerAsyncClient#listSkillsets()} + */ + public void listIndexerSkillsetAsync() { + // BEGIN: com.azure.search.documents.indexes.SearchIndexerAsyncClient.listSkillsets + searchIndexerAsyncClient.listSkillsets() + .subscribe(skillset -> + System.out.printf("The skillset name is %s. The etag of skillset is %s.%n", skillset.getName(), + skillset.getETag())); + // END: com.azure.search.documents.indexes.SearchIndexerAsyncClient.listSkillsets + } + + /** + * Code snippet for {@link SearchIndexerAsyncClient#listSkillsetNames()} + */ + public void listIndexerSkillsetNamesAsync() { + // BEGIN: com.azure.search.documents.indexes.SearchIndexerAsyncClient.listSkillsetNames + searchIndexerAsyncClient.listSkillsetNames() + .subscribe(skillsetName -> System.out.printf("The indexer skillset name is %s.%n", skillsetName)); + // END: com.azure.search.documents.indexes.SearchIndexerAsyncClient.listSkillsetNames + } + + /** + * Code snippet for {@link SearchIndexerAsyncClient#createOrUpdateSkillset(SearchIndexerSkillset)} + */ + public void createOrUpdateIndexerSkillsetAsync() { + // BEGIN: com.azure.search.documents.indexes.SearchIndexerAsyncClient.createOrUpdateIndexerSkillset#SearchIndexerSkillset + searchIndexerAsyncClient.getSkillset("searchIndexerSkilset") + .flatMap(indexerSkillset -> { + indexerSkillset.setDescription("This is new description!"); + return searchIndexerAsyncClient.createOrUpdateSkillset(indexerSkillset); + }).subscribe(updateSkillset -> + System.out.printf("The indexer skillset name is %s. The description of indexer skillset is %s.%n", + updateSkillset.getName(), updateSkillset.getDescription())); + // END: com.azure.search.documents.indexes.SearchIndexerAsyncClient.createOrUpdateIndexerSkillset#SearchIndexerSkillset + } + + /** + * Code snippet for {@link SearchIndexerAsyncClient#createOrUpdateSkillsetWithResponse(SearchIndexerSkillset, boolean)} + */ + public void createOrUpdateIndexerSkillsetWithResponseAsync() { + // BEGIN: com.azure.search.documents.indexes.SearchIndexerAsyncClient.createOrUpdateSkillsetWithResponse#SearchIndexerSkillset-boolean + searchIndexerAsyncClient.getSkillset("searchIndexerSkilset") + .flatMap(indexerSkillset -> { + indexerSkillset.setDescription("This is new description!"); + return searchIndexerAsyncClient.createOrUpdateSkillsetWithResponse(indexerSkillset, true); + }) + .subscribe(updateSkillsetResponse -> + System.out.printf("The status code of the response is %s.%nThe indexer skillset name is %s. " + + "The description of indexer skilset is %s.%n", updateSkillsetResponse.getStatusCode(), + updateSkillsetResponse.getValue().getName(), + updateSkillsetResponse.getValue().getDescription())); + // END: com.azure.search.documents.indexes.SearchIndexerAsyncClient.createOrUpdateSkillsetWithResponse#SearchIndexerSkillset-boolean + } + + /** + * Code snippet for {@link SearchIndexerAsyncClient#deleteSkillset(String)} + */ + public void deleteSearchIndexerSkillsetAsync() { + // BEGIN: com.azure.search.documents.indexes.SearchIndexerAsyncClient.deleteSkillset#String + searchIndexerAsyncClient.deleteSkillset("searchIndexerSkillset") + .subscribe(); + // END: com.azure.search.documents.indexes.SearchIndexerAsyncClient.deleteSkillset#String + } + + /** + * Code snippet for {@link SearchIndexerAsyncClient#deleteSkillsetWithResponse(SearchIndexerSkillset, boolean)} + */ + public void deleteSearchIndexerSkillsetWithResponseAsync() { + // BEGIN: com.azure.search.documents.indexes.SearchIndexerAsyncClient.deleteSkillsetWithResponse#SearchIndexerSkillset-boolean + searchIndexerAsyncClient.getSkillset("searchIndexerSkilset") + .flatMap(searchIndexerSkilset -> + searchIndexerAsyncClient.deleteSkillsetWithResponse(searchIndexerSkilset, true)) + .subscribe(deleteResponse -> + System.out.printf("The status code of the response is %d.%n", deleteResponse.getStatusCode())); + // END: com.azure.search.documents.indexes.SearchIndexerAsyncClient.deleteSkillsetWithResponse#SearchIndexerSkillset-boolean + } } From ce43c6b3ef499b58d29de8cb184b3c7c8190a82a Mon Sep 17 00:00:00 2001 From: Daniel Jurek Date: Thu, 2 Jul 2020 13:03:20 -0700 Subject: [PATCH 003/129] Add ability to specify subscription configuration, location, and ARM template parameters to live testing template (#12782) --- eng/pipelines/templates/jobs/archetype-sdk-tests.yml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/eng/pipelines/templates/jobs/archetype-sdk-tests.yml b/eng/pipelines/templates/jobs/archetype-sdk-tests.yml index 7e8097590c46b..a788739618976 100644 --- a/eng/pipelines/templates/jobs/archetype-sdk-tests.yml +++ b/eng/pipelines/templates/jobs/archetype-sdk-tests.yml @@ -54,6 +54,9 @@ parameters: publishJUnitResults: false goals: 'test' TestResultsFiles: '' + SubscriptionConfiguration: $(sub-config-azure-cloud-test-resources) + ArmTemplateParameters: '@{}' + Location: '' jobs: - job: ${{ parameters.TestName }} @@ -63,9 +66,11 @@ jobs: - template: ../variables/globals.yml # Default $(SubscriptionConfiguration) if the matrix does not specify a $(SubscriptionConfiguration) - name: SubscriptionConfiguration - value: $(sub-config-azure-cloud-test-resources) + value: ${{ parameters.SubscriptionConfiguration }} - name: ArmTemplateParameters - value: '@{}' + value: ${{ parameters.ArmTemplateParameters }} + - name: Location + value: ${{ parameters.Location }} strategy: matrix: ${{ parameters.Matrix }} @@ -85,6 +90,7 @@ jobs: ServiceDirectory: '${{ parameters.ServiceDirectory }}' SubscriptionConfiguration: $(SubscriptionConfiguration) ArmTemplateParameters: $(ArmTemplateParameters) + Location: $(Location) - ${{ parameters.PreRunSteps }} From 07d229101f31c82809ccbade2cf24c5206ca22de Mon Sep 17 00:00:00 2001 From: Jianghao Lu Date: Thu, 2 Jul 2020 14:37:21 -0700 Subject: [PATCH 004/129] Regenerate LUIS authoring (#12744) --- eng/versioning/version_data.txt | 2 +- .../ms-azure-cs-luis-authoring/pom.xml | 2 +- .../language/luis/authoring/Apps.java | 177 +++++ .../luis/authoring/AzureAccounts.java | 150 ++++- .../language/luis/authoring/Examples.java | 195 +++++- .../luis/authoring/LUISAuthoringClient.java | 6 - .../language/luis/authoring/Models.java | 14 + .../language/luis/authoring/Permissions.java | 316 --------- .../language/luis/authoring/Versions.java | 229 +++++++ .../authoring/implementation/AppsImpl.java | 315 +++++++++ .../implementation/AzureAccountsImpl.java | 219 +++++- .../implementation/ExamplesImpl.java | 253 ++++++- .../LUISAuthoringClientImpl.java | 15 - .../authoring/implementation/ModelsImpl.java | 42 +- .../implementation/PermissionsImpl.java | 624 ------------------ .../implementation/VersionsImpl.java | 444 +++++++++++++ .../models/AddExamplesOptionalParameter.java | 66 ++ .../models/AssignToAppOptionalParameter.java | 26 + ...meter.java => BatchOptionalParameter.java} | 30 +- .../luis/authoring/models/EntityLabel.java | 27 + .../authoring/models/EntityLabelObject.java | 27 + .../authoring/models/EntityPrediction.java | 27 + ...java => GetAssignedOptionalParameter.java} | 32 +- .../authoring/models/HierarchicalModelV2.java | 122 ++++ .../ImportLuFormatAppsOptionalParameter.java | 68 ++ ...portLuFormatVersionsOptionalParameter.java | 67 ++ .../ImportV2AppAppsOptionalParameter.java | 68 ++ ...ImportV2AppVersionsOptionalParameter.java} | 31 +- .../luis/authoring/models/JSONEntity.java | 27 + ...istEntitySuggestionsOptionalParameter.java | 25 + .../models/ListExamplesOptionalParameter.java | 25 + ...istIntentSuggestionsOptionalParameter.java | 25 + ...ListUserLUISAccountsOptionalParameter.java | 67 ++ .../luis/authoring/models/LuisAppV2.java | 460 +++++++++++++ .../models/ModelFeatureInformation.java | 26 + .../RemoveFromAppOptionalParameter.java | 26 + 36 files changed, 3189 insertions(+), 1086 deletions(-) delete mode 100644 sdk/cognitiveservices/ms-azure-cs-luis-authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/Permissions.java delete mode 100644 sdk/cognitiveservices/ms-azure-cs-luis-authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/PermissionsImpl.java create mode 100644 sdk/cognitiveservices/ms-azure-cs-luis-authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/models/AddExamplesOptionalParameter.java rename sdk/cognitiveservices/ms-azure-cs-luis-authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/models/{AddPermissionsOptionalParameter.java => BatchOptionalParameter.java} (55%) rename sdk/cognitiveservices/ms-azure-cs-luis-authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/models/{UpdatePermissionsOptionalParameter.java => GetAssignedOptionalParameter.java} (56%) create mode 100644 sdk/cognitiveservices/ms-azure-cs-luis-authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/models/HierarchicalModelV2.java create mode 100644 sdk/cognitiveservices/ms-azure-cs-luis-authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/models/ImportLuFormatAppsOptionalParameter.java create mode 100644 sdk/cognitiveservices/ms-azure-cs-luis-authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/models/ImportLuFormatVersionsOptionalParameter.java create mode 100644 sdk/cognitiveservices/ms-azure-cs-luis-authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/models/ImportV2AppAppsOptionalParameter.java rename sdk/cognitiveservices/ms-azure-cs-luis-authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/models/{DeletePermissionsOptionalParameter.java => ImportV2AppVersionsOptionalParameter.java} (54%) create mode 100644 sdk/cognitiveservices/ms-azure-cs-luis-authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/models/ListUserLUISAccountsOptionalParameter.java create mode 100644 sdk/cognitiveservices/ms-azure-cs-luis-authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/models/LuisAppV2.java diff --git a/eng/versioning/version_data.txt b/eng/versioning/version_data.txt index 79b463376dc81..74a67fd215147 100644 --- a/eng/versioning/version_data.txt +++ b/eng/versioning/version_data.txt @@ -8,7 +8,7 @@ com.microsoft.azure:azure-applicationinsights-query;1.0.0-beta-2;1.0.0-beta-2 com.microsoft.azure.cognitiveservices:azure-cognitiveservices-spellcheck;1.1.0-beta.1;1.1.0-beta.1 com.microsoft.azure.cognitiveservices:azure-cognitiveservices-textanalytics;1.1.0-beta.1;1.1.0-beta.1 com.microsoft.azure.cognitiveservices:azure-cognitiveservices-luis-runtime;1.1.0-beta.1;1.1.0-beta.1 -com.microsoft.azure.cognitiveservices:azure-cognitiveservices-luis-authoring;1.0.3-beta;1.0.3-beta +com.microsoft.azure.cognitiveservices:azure-cognitiveservices-luis-authoring;1.0.4-beta;1.0.4-beta com.microsoft.azure.cognitiveservices:azure-cognitiveservices-autosuggest;1.1.0-beta.1;1.1.0-beta.1 com.microsoft.azure.cognitiveservices:azure-cognitiveservices-customimagesearch;1.1.0-beta.1;1.1.0-beta.1 com.microsoft.azure.cognitiveservices:azure-cognitiveservices-customsearch;1.1.0-beta.1;1.1.0-beta.1 diff --git a/sdk/cognitiveservices/ms-azure-cs-luis-authoring/pom.xml b/sdk/cognitiveservices/ms-azure-cs-luis-authoring/pom.xml index 1ac80de0c8a9a..66234f34ad6bd 100644 --- a/sdk/cognitiveservices/ms-azure-cs-luis-authoring/pom.xml +++ b/sdk/cognitiveservices/ms-azure-cs-luis-authoring/pom.xml @@ -13,7 +13,7 @@ azure-cognitiveservices-luis-authoring com.microsoft.azure.cognitiveservices - 1.0.3-beta + 1.0.4-beta jar Microsoft Azure SDK for Cognitive Service Language Understanding (LUIS) This package contains Microsoft Cognitive Service Language Understanding (LUIS). diff --git a/sdk/cognitiveservices/ms-azure-cs-luis-authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/Apps.java b/sdk/cognitiveservices/ms-azure-cs-luis-authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/Apps.java index 75c31a678a27d..437eac841e16f 100644 --- a/sdk/cognitiveservices/ms-azure-cs-luis-authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/Apps.java +++ b/sdk/cognitiveservices/ms-azure-cs-luis-authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/Apps.java @@ -12,6 +12,8 @@ import com.microsoft.azure.cognitiveservices.language.luis.authoring.models.ImportMethodAppsOptionalParameter; import com.microsoft.azure.cognitiveservices.language.luis.authoring.models.DeleteAppsOptionalParameter; import com.microsoft.azure.cognitiveservices.language.luis.authoring.models.UpdateSettingsOptionalParameter; +import com.microsoft.azure.cognitiveservices.language.luis.authoring.models.ImportV2AppAppsOptionalParameter; +import com.microsoft.azure.cognitiveservices.language.luis.authoring.models.ImportLuFormatAppsOptionalParameter; import com.microsoft.azure.CloudException; import com.microsoft.azure.cognitiveservices.language.luis.authoring.models.ApplicationCreateObject; import com.microsoft.azure.cognitiveservices.language.luis.authoring.models.ApplicationInfoResponse; @@ -21,6 +23,7 @@ import com.microsoft.azure.cognitiveservices.language.luis.authoring.models.AvailableCulture; import com.microsoft.azure.cognitiveservices.language.luis.authoring.models.ErrorResponseException; import com.microsoft.azure.cognitiveservices.language.luis.authoring.models.LuisApp; +import com.microsoft.azure.cognitiveservices.language.luis.authoring.models.LuisAppV2; import com.microsoft.azure.cognitiveservices.language.luis.authoring.models.OperationStatus; import com.microsoft.azure.cognitiveservices.language.luis.authoring.models.PersonalAssistantsResponse; import com.microsoft.azure.cognitiveservices.language.luis.authoring.models.PrebuiltDomain; @@ -787,4 +790,178 @@ interface AppsUpdateSettingsDefinition extends Observable packageTrainedApplicationAsGzipAsync(UUID appId, String versionId); + /** + * Imports an application to LUIS, the application's structure is included in the request body. + * + * @param luisAppV2 A LUIS application structure. + * @param importV2AppOptionalParameter the object representing the optional parameters to be set before calling this API + * @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 UUID object if successful. + */ + UUID importV2App(LuisAppV2 luisAppV2, ImportV2AppAppsOptionalParameter importV2AppOptionalParameter); + + /** + * Imports an application to LUIS, the application's structure is included in the request body. + * + * @param luisAppV2 A LUIS application structure. + * @param importV2AppOptionalParameter the object representing the optional parameters to be set before calling this API + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the UUID object + */ + Observable importV2AppAsync(LuisAppV2 luisAppV2, ImportV2AppAppsOptionalParameter importV2AppOptionalParameter); + + /** + * Imports an application to LUIS, the application's structure is included in the request body. + * + * @return the first stage of the importV2App call + */ + AppsImportV2AppDefinitionStages.WithLuisAppV2 importV2App(); + + /** + * Grouping of importV2App definition stages. + */ + interface AppsImportV2AppDefinitionStages { + /** + * The stage of the definition to be specify luisAppV2. + */ + interface WithLuisAppV2 { + /** + * A LUIS application structure. + * + * @return next definition stage + */ + AppsImportV2AppDefinitionStages.WithExecute withLuisAppV2(LuisAppV2 luisAppV2); + } + + /** + * The stage of the definition which allows for any other optional settings to be specified. + */ + interface WithAllOptions { + /** + * The application name to create. If not specified, the application name will be read from the imported + * object. If the application name already exists, an error is returned. + * + * @return next definition stage + */ + AppsImportV2AppDefinitionStages.WithExecute withAppName(String appName); + + } + + /** + * The last stage of the definition which will make the operation call. + */ + interface WithExecute extends AppsImportV2AppDefinitionStages.WithAllOptions { + /** + * Execute the request. + * + * @return the UUID object if successful. + */ + UUID execute(); + + /** + * Execute the request asynchronously. + * + * @return the observable to the UUID object + */ + Observable executeAsync(); + } + } + + /** + * The entirety of importV2App definition. + */ + interface AppsImportV2AppDefinition extends + AppsImportV2AppDefinitionStages.WithLuisAppV2, + AppsImportV2AppDefinitionStages.WithExecute { + } + + /** + * Imports an application to LUIS, the application's structure is included in the request body. + * + * @param luisAppLu A LUIS application structure. + * @param importLuFormatOptionalParameter the object representing the optional parameters to be set before calling this API + * @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 UUID object if successful. + */ + UUID importLuFormat(String luisAppLu, ImportLuFormatAppsOptionalParameter importLuFormatOptionalParameter); + + /** + * Imports an application to LUIS, the application's structure is included in the request body. + * + * @param luisAppLu A LUIS application structure. + * @param importLuFormatOptionalParameter the object representing the optional parameters to be set before calling this API + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the UUID object + */ + Observable importLuFormatAsync(String luisAppLu, ImportLuFormatAppsOptionalParameter importLuFormatOptionalParameter); + + /** + * Imports an application to LUIS, the application's structure is included in the request body. + * + * @return the first stage of the importLuFormat call + */ + AppsImportLuFormatDefinitionStages.WithLuisAppLu importLuFormat(); + + /** + * Grouping of importLuFormat definition stages. + */ + interface AppsImportLuFormatDefinitionStages { + /** + * The stage of the definition to be specify luisAppLu. + */ + interface WithLuisAppLu { + /** + * A LUIS application structure. + * + * @return next definition stage + */ + AppsImportLuFormatDefinitionStages.WithExecute withLuisAppLu(String luisAppLu); + } + + /** + * The stage of the definition which allows for any other optional settings to be specified. + */ + interface WithAllOptions { + /** + * The application name to create. If not specified, the application name will be read from the imported + * object. If the application name already exists, an error is returned. + * + * @return next definition stage + */ + AppsImportLuFormatDefinitionStages.WithExecute withAppName(String appName); + + } + + /** + * The last stage of the definition which will make the operation call. + */ + interface WithExecute extends AppsImportLuFormatDefinitionStages.WithAllOptions { + /** + * Execute the request. + * + * @return the UUID object if successful. + */ + UUID execute(); + + /** + * Execute the request asynchronously. + * + * @return the observable to the UUID object + */ + Observable executeAsync(); + } + } + + /** + * The entirety of importLuFormat definition. + */ + interface AppsImportLuFormatDefinition extends + AppsImportLuFormatDefinitionStages.WithLuisAppLu, + AppsImportLuFormatDefinitionStages.WithExecute { + } + } diff --git a/sdk/cognitiveservices/ms-azure-cs-luis-authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/AzureAccounts.java b/sdk/cognitiveservices/ms-azure-cs-luis-authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/AzureAccounts.java index 0be16f7b1f68d..8880c1980c02c 100644 --- a/sdk/cognitiveservices/ms-azure-cs-luis-authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/AzureAccounts.java +++ b/sdk/cognitiveservices/ms-azure-cs-luis-authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/AzureAccounts.java @@ -9,7 +9,9 @@ package com.microsoft.azure.cognitiveservices.language.luis.authoring; import com.microsoft.azure.cognitiveservices.language.luis.authoring.models.AssignToAppOptionalParameter; +import com.microsoft.azure.cognitiveservices.language.luis.authoring.models.GetAssignedOptionalParameter; import com.microsoft.azure.cognitiveservices.language.luis.authoring.models.RemoveFromAppOptionalParameter; +import com.microsoft.azure.cognitiveservices.language.luis.authoring.models.ListUserLUISAccountsOptionalParameter; import com.microsoft.azure.cognitiveservices.language.luis.authoring.models.AzureAccountInfoObject; import com.microsoft.azure.cognitiveservices.language.luis.authoring.models.ErrorResponseException; import com.microsoft.azure.cognitiveservices.language.luis.authoring.models.OperationStatus; @@ -75,6 +77,14 @@ interface WithAppId { * The stage of the definition which allows for any other optional settings to be specified. */ interface WithAllOptions { + /** + * The custom arm token header to use; containing the user's ARM token used to validate azure accounts + * information. + * + * @return next definition stage + */ + AzureAccountsAssignToAppDefinitionStages.WithExecute withArmToken(String armToken); + /** * The Azure account information object. * @@ -112,29 +122,95 @@ interface AzureAccountsAssignToAppDefinition extends AzureAccountsAssignToAppDefinitionStages.WithExecute { } - /** * apps - Get LUIS Azure accounts assigned to the application. * Gets the LUIS Azure accounts assigned to the application for the user using his ARM token. * * @param appId The application ID. + * @param getAssignedOptionalParameter the object representing the optional parameters to be set before calling this API * @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<AzureAccountInfoObject> object if successful. */ - List getAssigned(UUID appId); + List getAssigned(UUID appId, GetAssignedOptionalParameter getAssignedOptionalParameter); /** * apps - Get LUIS Azure accounts assigned to the application. * Gets the LUIS Azure accounts assigned to the application for the user using his ARM token. * * @param appId The application ID. + * @param getAssignedOptionalParameter the object representing the optional parameters to be set before calling this API * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the List<AzureAccountInfoObject> object */ - Observable> getAssignedAsync(UUID appId); + Observable> getAssignedAsync(UUID appId, GetAssignedOptionalParameter getAssignedOptionalParameter); + + /** + * apps - Get LUIS Azure accounts assigned to the application. + * Gets the LUIS Azure accounts assigned to the application for the user using his ARM token. + * + * @return the first stage of the getAssigned call + */ + AzureAccountsGetAssignedDefinitionStages.WithAppId getAssigned(); + + /** + * Grouping of getAssigned definition stages. + */ + interface AzureAccountsGetAssignedDefinitionStages { + /** + * The stage of the definition to be specify appId. + */ + interface WithAppId { + /** + * The application ID. + * + * @return next definition stage + */ + AzureAccountsGetAssignedDefinitionStages.WithExecute withAppId(UUID appId); + } + + /** + * The stage of the definition which allows for any other optional settings to be specified. + */ + interface WithAllOptions { + /** + * The custom arm token header to use; containing the user's ARM token used to validate azure accounts + * information. + * + * @return next definition stage + */ + AzureAccountsGetAssignedDefinitionStages.WithExecute withArmToken(String armToken); + + } + + /** + * The last stage of the definition which will make the operation call. + */ + interface WithExecute extends AzureAccountsGetAssignedDefinitionStages.WithAllOptions { + /** + * Execute the request. + * + * @return the List<AzureAccountInfoObject> object if successful. + */ + List execute(); + + /** + * Execute the request asynchronously. + * + * @return the observable to the List<AzureAccountInfoObject> object + */ + Observable> executeAsync(); + } + } + /** + * The entirety of getAssigned definition. + */ + interface AzureAccountsGetAssignedDefinition extends + AzureAccountsGetAssignedDefinitionStages.WithAppId, + AzureAccountsGetAssignedDefinitionStages.WithExecute { + } /** * apps - Removes an assigned LUIS Azure account from an application. @@ -188,6 +264,14 @@ interface WithAppId { * The stage of the definition which allows for any other optional settings to be specified. */ interface WithAllOptions { + /** + * The custom arm token header to use; containing the user's ARM token used to validate azure accounts + * information. + * + * @return next definition stage + */ + AzureAccountsRemoveFromAppDefinitionStages.WithExecute withArmToken(String armToken); + /** * The Azure account information object. * @@ -225,26 +309,80 @@ interface AzureAccountsRemoveFromAppDefinition extends AzureAccountsRemoveFromAppDefinitionStages.WithExecute { } - /** * user - Get LUIS Azure accounts. * Gets the LUIS Azure accounts for the user using his ARM token. * + * @param listUserLUISAccountsOptionalParameter the object representing the optional parameters to be set before calling this API * @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<AzureAccountInfoObject> object if successful. */ - List listUserLUISAccounts(); + List listUserLUISAccounts(ListUserLUISAccountsOptionalParameter listUserLUISAccountsOptionalParameter); /** * user - Get LUIS Azure accounts. * Gets the LUIS Azure accounts for the user using his ARM token. * + * @param listUserLUISAccountsOptionalParameter the object representing the optional parameters to be set before calling this API * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the List<AzureAccountInfoObject> object */ - Observable> listUserLUISAccountsAsync(); + Observable> listUserLUISAccountsAsync(ListUserLUISAccountsOptionalParameter listUserLUISAccountsOptionalParameter); + /** + * user - Get LUIS Azure accounts. + * Gets the LUIS Azure accounts for the user using his ARM token. + * + * @return the first stage of the listUserLUISAccounts call + */ + AzureAccountsListUserLUISAccountsDefinitionStages.WithExecute listUserLUISAccounts(); + + /** + * Grouping of listUserLUISAccounts definition stages. + */ + interface AzureAccountsListUserLUISAccountsDefinitionStages { + + /** + * The stage of the definition which allows for any other optional settings to be specified. + */ + interface WithAllOptions { + /** + * The custom arm token header to use; containing the user's ARM token used to validate azure accounts + * information. + * + * @return next definition stage + */ + AzureAccountsListUserLUISAccountsDefinitionStages.WithExecute withArmToken(String armToken); + + } + + /** + * The last stage of the definition which will make the operation call. + */ + interface WithExecute extends AzureAccountsListUserLUISAccountsDefinitionStages.WithAllOptions { + /** + * Execute the request. + * + * @return the List<AzureAccountInfoObject> object if successful. + */ + List execute(); + + /** + * Execute the request asynchronously. + * + * @return the observable to the List<AzureAccountInfoObject> object + */ + Observable> executeAsync(); + } + } + + /** + * The entirety of listUserLUISAccounts definition. + */ + interface AzureAccountsListUserLUISAccountsDefinition extends + AzureAccountsListUserLUISAccountsDefinitionStages.WithExecute { + } } diff --git a/sdk/cognitiveservices/ms-azure-cs-luis-authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/Examples.java b/sdk/cognitiveservices/ms-azure-cs-luis-authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/Examples.java index 902fd87508e88..e12e1493719bd 100644 --- a/sdk/cognitiveservices/ms-azure-cs-luis-authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/Examples.java +++ b/sdk/cognitiveservices/ms-azure-cs-luis-authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/Examples.java @@ -8,6 +8,8 @@ package com.microsoft.azure.cognitiveservices.language.luis.authoring; +import com.microsoft.azure.cognitiveservices.language.luis.authoring.models.AddExamplesOptionalParameter; +import com.microsoft.azure.cognitiveservices.language.luis.authoring.models.BatchOptionalParameter; import com.microsoft.azure.cognitiveservices.language.luis.authoring.models.ListExamplesOptionalParameter; import com.microsoft.azure.cognitiveservices.language.luis.authoring.models.BatchLabelExample; import com.microsoft.azure.cognitiveservices.language.luis.authoring.models.ErrorResponseException; @@ -25,19 +27,19 @@ * in Examples. */ public interface Examples { - /** * Adds a labeled example utterance in a version of the application. * * @param appId The application ID. * @param versionId The version ID. * @param exampleLabelObject A labeled example utterance with the expected intent and entities. + * @param addOptionalParameter the object representing the optional parameters to be set before calling this API * @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 LabelExampleResponse object if successful. */ - LabelExampleResponse add(UUID appId, String versionId, ExampleLabelObject exampleLabelObject); + LabelExampleResponse add(UUID appId, String versionId, ExampleLabelObject exampleLabelObject, AddExamplesOptionalParameter addOptionalParameter); /** * Adds a labeled example utterance in a version of the application. @@ -45,12 +47,99 @@ public interface Examples { * @param appId The application ID. * @param versionId The version ID. * @param exampleLabelObject A labeled example utterance with the expected intent and entities. + * @param addOptionalParameter the object representing the optional parameters to be set before calling this API * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the LabelExampleResponse object */ - Observable addAsync(UUID appId, String versionId, ExampleLabelObject exampleLabelObject); + Observable addAsync(UUID appId, String versionId, ExampleLabelObject exampleLabelObject, AddExamplesOptionalParameter addOptionalParameter); + + /** + * Adds a labeled example utterance in a version of the application. + * + * @return the first stage of the add call + */ + ExamplesAddDefinitionStages.WithAppId add(); + + /** + * Grouping of add definition stages. + */ + interface ExamplesAddDefinitionStages { + /** + * The stage of the definition to be specify appId. + */ + interface WithAppId { + /** + * The application ID. + * + * @return next definition stage + */ + WithVersionId withAppId(UUID appId); + } + /** + * The stage of the definition to be specify versionId. + */ + interface WithVersionId { + /** + * The version ID. + * + * @return next definition stage + */ + WithExampleLabelObject withVersionId(String versionId); + } + /** + * The stage of the definition to be specify exampleLabelObject. + */ + interface WithExampleLabelObject { + /** + * A labeled example utterance with the expected intent and entities. + * + * @return next definition stage + */ + ExamplesAddDefinitionStages.WithExecute withExampleLabelObject(ExampleLabelObject exampleLabelObject); + } + + /** + * The stage of the definition which allows for any other optional settings to be specified. + */ + interface WithAllOptions { + /** + * Toggles nested/flat format. + * + * @return next definition stage + */ + ExamplesAddDefinitionStages.WithExecute withEnableNestedChildren(Boolean enableNestedChildren); + + } + + /** + * The last stage of the definition which will make the operation call. + */ + interface WithExecute extends ExamplesAddDefinitionStages.WithAllOptions { + /** + * Execute the request. + * + * @return the LabelExampleResponse object if successful. + */ + LabelExampleResponse execute(); + /** + * Execute the request asynchronously. + * + * @return the observable to the LabelExampleResponse object + */ + Observable executeAsync(); + } + } + /** + * The entirety of add definition. + */ + interface ExamplesAddDefinition extends + ExamplesAddDefinitionStages.WithAppId, + ExamplesAddDefinitionStages.WithVersionId, + ExamplesAddDefinitionStages.WithExampleLabelObject, + ExamplesAddDefinitionStages.WithExecute { + } /** * Adds a batch of labeled example utterances to a version of the application. @@ -58,12 +147,13 @@ public interface Examples { * @param appId The application ID. * @param versionId The version ID. * @param exampleLabelObjectArray Array of example utterances. + * @param batchOptionalParameter the object representing the optional parameters to be set before calling this API * @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<BatchLabelExample> object if successful. */ - List batch(UUID appId, String versionId, List exampleLabelObjectArray); + List batch(UUID appId, String versionId, List exampleLabelObjectArray, BatchOptionalParameter batchOptionalParameter); /** * Adds a batch of labeled example utterances to a version of the application. @@ -71,11 +161,99 @@ public interface Examples { * @param appId The application ID. * @param versionId The version ID. * @param exampleLabelObjectArray Array of example utterances. + * @param batchOptionalParameter the object representing the optional parameters to be set before calling this API * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the List<BatchLabelExample> object */ - Observable> batchAsync(UUID appId, String versionId, List exampleLabelObjectArray); + Observable> batchAsync(UUID appId, String versionId, List exampleLabelObjectArray, BatchOptionalParameter batchOptionalParameter); + /** + * Adds a batch of labeled example utterances to a version of the application. + * + * @return the first stage of the batch call + */ + ExamplesBatchDefinitionStages.WithAppId batch(); + + /** + * Grouping of batch definition stages. + */ + interface ExamplesBatchDefinitionStages { + /** + * The stage of the definition to be specify appId. + */ + interface WithAppId { + /** + * The application ID. + * + * @return next definition stage + */ + WithVersionId withAppId(UUID appId); + } + /** + * The stage of the definition to be specify versionId. + */ + interface WithVersionId { + /** + * The version ID. + * + * @return next definition stage + */ + WithExampleLabelObjectArray withVersionId(String versionId); + } + /** + * The stage of the definition to be specify exampleLabelObjectArray. + */ + interface WithExampleLabelObjectArray { + /** + * Array of example utterances. + * + * @return next definition stage + */ + ExamplesBatchDefinitionStages.WithExecute withExampleLabelObjectArray(List exampleLabelObjectArray); + } + + /** + * The stage of the definition which allows for any other optional settings to be specified. + */ + interface WithAllOptions { + /** + * Toggles nested/flat format. + * + * @return next definition stage + */ + ExamplesBatchDefinitionStages.WithExecute withEnableNestedChildren(Boolean enableNestedChildren); + + } + + /** + * The last stage of the definition which will make the operation call. + */ + interface WithExecute extends ExamplesBatchDefinitionStages.WithAllOptions { + /** + * Execute the request. + * + * @return the List<BatchLabelExample> object if successful. + */ + List execute(); + + /** + * Execute the request asynchronously. + * + * @return the observable to the List<BatchLabelExample> object + */ + Observable> executeAsync(); + } + } + + /** + * The entirety of batch definition. + */ + interface ExamplesBatchDefinition extends + ExamplesBatchDefinitionStages.WithAppId, + ExamplesBatchDefinitionStages.WithVersionId, + ExamplesBatchDefinitionStages.WithExampleLabelObjectArray, + ExamplesBatchDefinitionStages.WithExecute { + } /** * Returns example utterances to be reviewed from a version of the application. @@ -153,6 +331,13 @@ interface WithAllOptions { */ ExamplesListDefinitionStages.WithExecute withTake(Integer take); + /** + * Toggles nested/flat format. + * + * @return next definition stage + */ + ExamplesListDefinitionStages.WithExecute withEnableNestedChildren(Boolean enableNestedChildren); + } /** diff --git a/sdk/cognitiveservices/ms-azure-cs-luis-authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/LUISAuthoringClient.java b/sdk/cognitiveservices/ms-azure-cs-luis-authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/LUISAuthoringClient.java index b885e4279516e..aaaba299df6c5 100644 --- a/sdk/cognitiveservices/ms-azure-cs-luis-authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/LUISAuthoringClient.java +++ b/sdk/cognitiveservices/ms-azure-cs-luis-authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/LUISAuthoringClient.java @@ -131,12 +131,6 @@ public interface LUISAuthoringClient { */ Trains trains(); - /** - * Gets the Permissions object to access its operations. - * @return the Permissions object. - */ - Permissions permissions(); - /** * Gets the Patterns object to access its operations. * @return the Patterns object. diff --git a/sdk/cognitiveservices/ms-azure-cs-luis-authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/Models.java b/sdk/cognitiveservices/ms-azure-cs-luis-authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/Models.java index 6480f63253c7f..167926fb6730c 100644 --- a/sdk/cognitiveservices/ms-azure-cs-luis-authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/Models.java +++ b/sdk/cognitiveservices/ms-azure-cs-luis-authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/Models.java @@ -2300,6 +2300,13 @@ interface WithAllOptions { */ ModelsListIntentSuggestionsDefinitionStages.WithExecute withTake(Integer take); + /** + * Toggles nested/flat format. + * + * @return next definition stage + */ + ModelsListIntentSuggestionsDefinitionStages.WithExecute withEnableNestedChildren(Boolean enableNestedChildren); + } /** @@ -2417,6 +2424,13 @@ interface WithAllOptions { */ ModelsListEntitySuggestionsDefinitionStages.WithExecute withTake(Integer take); + /** + * Toggles nested/flat format. + * + * @return next definition stage + */ + ModelsListEntitySuggestionsDefinitionStages.WithExecute withEnableNestedChildren(Boolean enableNestedChildren); + } /** diff --git a/sdk/cognitiveservices/ms-azure-cs-luis-authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/Permissions.java b/sdk/cognitiveservices/ms-azure-cs-luis-authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/Permissions.java deleted file mode 100644 index 66afaab66a661..0000000000000 --- a/sdk/cognitiveservices/ms-azure-cs-luis-authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/Permissions.java +++ /dev/null @@ -1,316 +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.cognitiveservices.language.luis.authoring; - -import com.microsoft.azure.cognitiveservices.language.luis.authoring.models.AddPermissionsOptionalParameter; -import com.microsoft.azure.cognitiveservices.language.luis.authoring.models.DeletePermissionsOptionalParameter; -import com.microsoft.azure.cognitiveservices.language.luis.authoring.models.UpdatePermissionsOptionalParameter; -import com.microsoft.azure.cognitiveservices.language.luis.authoring.models.ErrorResponseException; -import com.microsoft.azure.cognitiveservices.language.luis.authoring.models.OperationStatus; -import com.microsoft.azure.cognitiveservices.language.luis.authoring.models.UserAccessList; -import java.io.IOException; -import java.util.List; -import java.util.UUID; -import rx.Observable; - -/** - * An instance of this class provides access to all the operations defined - * in Permissions. - */ -public interface Permissions { - - /** - * Gets the list of user emails that have permissions to access your application. - * - * @param appId The application 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 UserAccessList object if successful. - */ - UserAccessList list(UUID appId); - - /** - * Gets the list of user emails that have permissions to access your application. - * - * @param appId The application ID. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the UserAccessList object - */ - Observable listAsync(UUID appId); - - - /** - * Adds a user to the allowed list of users to access this LUIS application. Users are added using their email - * address. - * - * @param appId The application ID. - * @param addOptionalParameter the object representing the optional parameters to be set before calling this API - * @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 OperationStatus object if successful. - */ - OperationStatus add(UUID appId, AddPermissionsOptionalParameter addOptionalParameter); - - /** - * Adds a user to the allowed list of users to access this LUIS application. Users are added using their email - * address. - * - * @param appId The application ID. - * @param addOptionalParameter the object representing the optional parameters to be set before calling this API - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the OperationStatus object - */ - Observable addAsync(UUID appId, AddPermissionsOptionalParameter addOptionalParameter); - - /** - * Adds a user to the allowed list of users to access this LUIS application. Users are added using their email - * address. - * - * @return the first stage of the add call - */ - PermissionsAddDefinitionStages.WithAppId add(); - - /** - * Grouping of add definition stages. - */ - interface PermissionsAddDefinitionStages { - /** - * The stage of the definition to be specify appId. - */ - interface WithAppId { - /** - * The application ID. - * - * @return next definition stage - */ - PermissionsAddDefinitionStages.WithExecute withAppId(UUID appId); - } - - /** - * The stage of the definition which allows for any other optional settings to be specified. - */ - interface WithAllOptions { - /** - * The email address of the user. - * - * @return next definition stage - */ - PermissionsAddDefinitionStages.WithExecute withEmail(String email); - - } - - /** - * The last stage of the definition which will make the operation call. - */ - interface WithExecute extends PermissionsAddDefinitionStages.WithAllOptions { - /** - * Execute the request. - * - * @return the OperationStatus object if successful. - */ - OperationStatus execute(); - - /** - * Execute the request asynchronously. - * - * @return the observable to the OperationStatus object - */ - Observable executeAsync(); - } - } - - /** - * The entirety of add definition. - */ - interface PermissionsAddDefinition extends - PermissionsAddDefinitionStages.WithAppId, - PermissionsAddDefinitionStages.WithExecute { - } - - /** - * Removes a user from the allowed list of users to access this LUIS application. Users are removed using their - * email address. - * - * @param appId The application ID. - * @param deleteOptionalParameter the object representing the optional parameters to be set before calling this API - * @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 OperationStatus object if successful. - */ - OperationStatus delete(UUID appId, DeletePermissionsOptionalParameter deleteOptionalParameter); - - /** - * Removes a user from the allowed list of users to access this LUIS application. Users are removed using their - * email address. - * - * @param appId The application ID. - * @param deleteOptionalParameter the object representing the optional parameters to be set before calling this API - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the OperationStatus object - */ - Observable deleteAsync(UUID appId, DeletePermissionsOptionalParameter deleteOptionalParameter); - - /** - * Removes a user from the allowed list of users to access this LUIS application. Users are removed using their - * email address. - * - * @return the first stage of the delete call - */ - PermissionsDeleteDefinitionStages.WithAppId delete(); - - /** - * Grouping of delete definition stages. - */ - interface PermissionsDeleteDefinitionStages { - /** - * The stage of the definition to be specify appId. - */ - interface WithAppId { - /** - * The application ID. - * - * @return next definition stage - */ - PermissionsDeleteDefinitionStages.WithExecute withAppId(UUID appId); - } - - /** - * The stage of the definition which allows for any other optional settings to be specified. - */ - interface WithAllOptions { - /** - * The email address of the user. - * - * @return next definition stage - */ - PermissionsDeleteDefinitionStages.WithExecute withEmail(String email); - - } - - /** - * The last stage of the definition which will make the operation call. - */ - interface WithExecute extends PermissionsDeleteDefinitionStages.WithAllOptions { - /** - * Execute the request. - * - * @return the OperationStatus object if successful. - */ - OperationStatus execute(); - - /** - * Execute the request asynchronously. - * - * @return the observable to the OperationStatus object - */ - Observable executeAsync(); - } - } - - /** - * The entirety of delete definition. - */ - interface PermissionsDeleteDefinition extends - PermissionsDeleteDefinitionStages.WithAppId, - PermissionsDeleteDefinitionStages.WithExecute { - } - - /** - * Replaces the current user access list with the new list sent in the body. If an empty list is sent, all - * access to other users will be removed. - * - * @param appId The application ID. - * @param updateOptionalParameter the object representing the optional parameters to be set before calling this API - * @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 OperationStatus object if successful. - */ - OperationStatus update(UUID appId, UpdatePermissionsOptionalParameter updateOptionalParameter); - - /** - * Replaces the current user access list with the new list sent in the body. If an empty list is sent, all - * access to other users will be removed. - * - * @param appId The application ID. - * @param updateOptionalParameter the object representing the optional parameters to be set before calling this API - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the OperationStatus object - */ - Observable updateAsync(UUID appId, UpdatePermissionsOptionalParameter updateOptionalParameter); - - /** - * Replaces the current user access list with the new list sent in the body. If an empty list is sent, all - * access to other users will be removed. - * - * @return the first stage of the update call - */ - PermissionsUpdateDefinitionStages.WithAppId update(); - - /** - * Grouping of update definition stages. - */ - interface PermissionsUpdateDefinitionStages { - /** - * The stage of the definition to be specify appId. - */ - interface WithAppId { - /** - * The application ID. - * - * @return next definition stage - */ - PermissionsUpdateDefinitionStages.WithExecute withAppId(UUID appId); - } - - /** - * The stage of the definition which allows for any other optional settings to be specified. - */ - interface WithAllOptions { - /** - * The email address of the users. - * - * @return next definition stage - */ - PermissionsUpdateDefinitionStages.WithExecute withEmails(List emails); - - } - - /** - * The last stage of the definition which will make the operation call. - */ - interface WithExecute extends PermissionsUpdateDefinitionStages.WithAllOptions { - /** - * Execute the request. - * - * @return the OperationStatus object if successful. - */ - OperationStatus execute(); - - /** - * Execute the request asynchronously. - * - * @return the observable to the OperationStatus object - */ - Observable executeAsync(); - } - } - - /** - * The entirety of update definition. - */ - interface PermissionsUpdateDefinition extends - PermissionsUpdateDefinitionStages.WithAppId, - PermissionsUpdateDefinitionStages.WithExecute { - } - -} diff --git a/sdk/cognitiveservices/ms-azure-cs-luis-authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/Versions.java b/sdk/cognitiveservices/ms-azure-cs-luis-authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/Versions.java index eb83d995d6178..86e957d9bd5a2 100644 --- a/sdk/cognitiveservices/ms-azure-cs-luis-authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/Versions.java +++ b/sdk/cognitiveservices/ms-azure-cs-luis-authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/Versions.java @@ -12,10 +12,15 @@ import com.microsoft.azure.cognitiveservices.language.luis.authoring.models.ListVersionsOptionalParameter; import com.microsoft.azure.cognitiveservices.language.luis.authoring.models.UpdateVersionsOptionalParameter; import com.microsoft.azure.cognitiveservices.language.luis.authoring.models.ImportMethodVersionsOptionalParameter; +import com.microsoft.azure.cognitiveservices.language.luis.authoring.models.ImportV2AppVersionsOptionalParameter; +import com.microsoft.azure.cognitiveservices.language.luis.authoring.models.ImportLuFormatVersionsOptionalParameter; +import com.microsoft.azure.CloudException; import com.microsoft.azure.cognitiveservices.language.luis.authoring.models.ErrorResponseException; import com.microsoft.azure.cognitiveservices.language.luis.authoring.models.LuisApp; +import com.microsoft.azure.cognitiveservices.language.luis.authoring.models.LuisAppV2; import com.microsoft.azure.cognitiveservices.language.luis.authoring.models.OperationStatus; import com.microsoft.azure.cognitiveservices.language.luis.authoring.models.VersionInfo; +import java.io.InputStream; import java.io.IOException; import java.util.List; import java.util.UUID; @@ -519,4 +524,228 @@ interface VersionsImportMethodDefinition extends Observable deleteUnlabelledUtteranceAsync(UUID appId, String versionId, String utterance); + /** + * Imports a new version into a LUIS application. + * + * @param appId The application ID. + * @param luisAppV2 A LUIS application structure. + * @param importV2AppOptionalParameter the object representing the optional parameters to be set before calling this API + * @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 String object if successful. + */ + String importV2App(UUID appId, LuisAppV2 luisAppV2, ImportV2AppVersionsOptionalParameter importV2AppOptionalParameter); + + /** + * Imports a new version into a LUIS application. + * + * @param appId The application ID. + * @param luisAppV2 A LUIS application structure. + * @param importV2AppOptionalParameter the object representing the optional parameters to be set before calling this API + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the String object + */ + Observable importV2AppAsync(UUID appId, LuisAppV2 luisAppV2, ImportV2AppVersionsOptionalParameter importV2AppOptionalParameter); + + /** + * Imports a new version into a LUIS application. + * + * @return the first stage of the importV2App call + */ + VersionsImportV2AppDefinitionStages.WithAppId importV2App(); + + /** + * Grouping of importV2App definition stages. + */ + interface VersionsImportV2AppDefinitionStages { + /** + * The stage of the definition to be specify appId. + */ + interface WithAppId { + /** + * The application ID. + * + * @return next definition stage + */ + WithLuisAppV2 withAppId(UUID appId); + } + /** + * The stage of the definition to be specify luisAppV2. + */ + interface WithLuisAppV2 { + /** + * A LUIS application structure. + * + * @return next definition stage + */ + VersionsImportV2AppDefinitionStages.WithExecute withLuisAppV2(LuisAppV2 luisAppV2); + } + + /** + * The stage of the definition which allows for any other optional settings to be specified. + */ + interface WithAllOptions { + /** + * The new versionId to import. If not specified, the versionId will be read from the imported object. + * + * @return next definition stage + */ + VersionsImportV2AppDefinitionStages.WithExecute withVersionId(String versionId); + + } + + /** + * The last stage of the definition which will make the operation call. + */ + interface WithExecute extends VersionsImportV2AppDefinitionStages.WithAllOptions { + /** + * Execute the request. + * + * @return the String object if successful. + */ + String execute(); + + /** + * Execute the request asynchronously. + * + * @return the observable to the String object + */ + Observable executeAsync(); + } + } + + /** + * The entirety of importV2App definition. + */ + interface VersionsImportV2AppDefinition extends + VersionsImportV2AppDefinitionStages.WithAppId, + VersionsImportV2AppDefinitionStages.WithLuisAppV2, + VersionsImportV2AppDefinitionStages.WithExecute { + } + + /** + * Imports a new version into a LUIS application. + * + * @param appId The application ID. + * @param luisAppLu An LU representing the LUIS application structure. + * @param importLuFormatOptionalParameter the object representing the optional parameters to be set before calling this API + * @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 String object if successful. + */ + String importLuFormat(UUID appId, String luisAppLu, ImportLuFormatVersionsOptionalParameter importLuFormatOptionalParameter); + + /** + * Imports a new version into a LUIS application. + * + * @param appId The application ID. + * @param luisAppLu An LU representing the LUIS application structure. + * @param importLuFormatOptionalParameter the object representing the optional parameters to be set before calling this API + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the String object + */ + Observable importLuFormatAsync(UUID appId, String luisAppLu, ImportLuFormatVersionsOptionalParameter importLuFormatOptionalParameter); + + /** + * Imports a new version into a LUIS application. + * + * @return the first stage of the importLuFormat call + */ + VersionsImportLuFormatDefinitionStages.WithAppId importLuFormat(); + + /** + * Grouping of importLuFormat definition stages. + */ + interface VersionsImportLuFormatDefinitionStages { + /** + * The stage of the definition to be specify appId. + */ + interface WithAppId { + /** + * The application ID. + * + * @return next definition stage + */ + WithLuisAppLu withAppId(UUID appId); + } + /** + * The stage of the definition to be specify luisAppLu. + */ + interface WithLuisAppLu { + /** + * An LU representing the LUIS application structure. + * + * @return next definition stage + */ + VersionsImportLuFormatDefinitionStages.WithExecute withLuisAppLu(String luisAppLu); + } + + /** + * The stage of the definition which allows for any other optional settings to be specified. + */ + interface WithAllOptions { + /** + * The new versionId to import. If not specified, the versionId will be read from the imported object. + * + * @return next definition stage + */ + VersionsImportLuFormatDefinitionStages.WithExecute withVersionId(String versionId); + + } + + /** + * The last stage of the definition which will make the operation call. + */ + interface WithExecute extends VersionsImportLuFormatDefinitionStages.WithAllOptions { + /** + * Execute the request. + * + * @return the String object if successful. + */ + String execute(); + + /** + * Execute the request asynchronously. + * + * @return the observable to the String object + */ + Observable executeAsync(); + } + } + + /** + * The entirety of importLuFormat definition. + */ + interface VersionsImportLuFormatDefinition extends + VersionsImportLuFormatDefinitionStages.WithAppId, + VersionsImportLuFormatDefinitionStages.WithLuisAppLu, + VersionsImportLuFormatDefinitionStages.WithExecute { + } + + + /** + * Exports a LUIS application to text format. + * + * @param appId The application ID. + * @param versionId The version 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 InputStream object if successful. + */ + InputStream exportLuFormat(UUID appId, String versionId); + + /** + * Exports a LUIS application to text format. + * + * @param appId The application ID. + * @param versionId The version ID. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the InputStream object + */ + Observable exportLuFormatAsync(UUID appId, String versionId); + + } diff --git a/sdk/cognitiveservices/ms-azure-cs-luis-authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/AppsImpl.java b/sdk/cognitiveservices/ms-azure-cs-luis-authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/AppsImpl.java index 3a50f9cefd9e5..2be40ce36b1cf 100644 --- a/sdk/cognitiveservices/ms-azure-cs-luis-authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/AppsImpl.java +++ b/sdk/cognitiveservices/ms-azure-cs-luis-authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/AppsImpl.java @@ -12,6 +12,8 @@ import com.microsoft.azure.cognitiveservices.language.luis.authoring.models.ImportMethodAppsOptionalParameter; import com.microsoft.azure.cognitiveservices.language.luis.authoring.models.DeleteAppsOptionalParameter; import com.microsoft.azure.cognitiveservices.language.luis.authoring.models.UpdateSettingsOptionalParameter; +import com.microsoft.azure.cognitiveservices.language.luis.authoring.models.ImportV2AppAppsOptionalParameter; +import com.microsoft.azure.cognitiveservices.language.luis.authoring.models.ImportLuFormatAppsOptionalParameter; import retrofit2.Retrofit; import com.microsoft.azure.cognitiveservices.language.luis.authoring.Apps; import com.google.common.base.Joiner; @@ -26,6 +28,7 @@ import com.microsoft.azure.cognitiveservices.language.luis.authoring.models.AvailableCulture; import com.microsoft.azure.cognitiveservices.language.luis.authoring.models.ErrorResponseException; import com.microsoft.azure.cognitiveservices.language.luis.authoring.models.LuisApp; +import com.microsoft.azure.cognitiveservices.language.luis.authoring.models.LuisAppV2; import com.microsoft.azure.cognitiveservices.language.luis.authoring.models.OperationStatus; import com.microsoft.azure.cognitiveservices.language.luis.authoring.models.PersonalAssistantsResponse; import com.microsoft.azure.cognitiveservices.language.luis.authoring.models.PrebuiltDomain; @@ -174,6 +177,14 @@ interface AppsService { @Streaming Observable> packageTrainedApplicationAsGzip(@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.Apps importV2App" }) + @POST("apps/import") + Observable> importV2App(@Query("appName") String appName, @Body LuisAppV2 luisAppV2, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: text/plain", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.language.luis.authoring.Apps importLuFormat" }) + @POST("apps/import") + Observable> importLuFormat(@Query("appName") String appName, @Body String luisAppLu, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + } /** @@ -2175,4 +2186,308 @@ private ServiceResponse packageTrainedApplicationAsGzipDelegate(Res .build(response); } + + /** + * Imports an application to LUIS, the application's structure is included in the request body. + * + * @param luisAppV2 A LUIS application structure. + * @param importV2AppOptionalParameter the object representing the optional parameters to be set before calling this API + * @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 UUID object if successful. + */ + public UUID importV2App(LuisAppV2 luisAppV2, ImportV2AppAppsOptionalParameter importV2AppOptionalParameter) { + return importV2AppWithServiceResponseAsync(luisAppV2, importV2AppOptionalParameter).toBlocking().single().body(); + } + + /** + * Imports an application to LUIS, the application's structure is included in the request body. + * + * @param luisAppV2 A LUIS application structure. + * @param importV2AppOptionalParameter the object representing the optional parameters to be set before calling this API + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture importV2AppAsync(LuisAppV2 luisAppV2, ImportV2AppAppsOptionalParameter importV2AppOptionalParameter, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(importV2AppWithServiceResponseAsync(luisAppV2, importV2AppOptionalParameter), serviceCallback); + } + + /** + * Imports an application to LUIS, the application's structure is included in the request body. + * + * @param luisAppV2 A LUIS application structure. + * @param importV2AppOptionalParameter the object representing the optional parameters to be set before calling this API + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the UUID object + */ + public Observable importV2AppAsync(LuisAppV2 luisAppV2, ImportV2AppAppsOptionalParameter importV2AppOptionalParameter) { + return importV2AppWithServiceResponseAsync(luisAppV2, importV2AppOptionalParameter).map(new Func1, UUID>() { + @Override + public UUID call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Imports an application to LUIS, the application's structure is included in the request body. + * + * @param luisAppV2 A LUIS application structure. + * @param importV2AppOptionalParameter the object representing the optional parameters to be set before calling this API + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the UUID object + */ + public Observable> importV2AppWithServiceResponseAsync(LuisAppV2 luisAppV2, ImportV2AppAppsOptionalParameter importV2AppOptionalParameter) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } + if (luisAppV2 == null) { + throw new IllegalArgumentException("Parameter luisAppV2 is required and cannot be null."); + } + Validator.validate(luisAppV2); + final String appName = importV2AppOptionalParameter != null ? importV2AppOptionalParameter.appName() : null; + + return importV2AppWithServiceResponseAsync(luisAppV2, appName); + } + + /** + * Imports an application to LUIS, the application's structure is included in the request body. + * + * @param luisAppV2 A LUIS application structure. + * @param appName The application name to create. If not specified, the application name will be read from the imported object. If the application name already exists, an error is returned. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the UUID object + */ + public Observable> importV2AppWithServiceResponseAsync(LuisAppV2 luisAppV2, String appName) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } + if (luisAppV2 == null) { + throw new IllegalArgumentException("Parameter luisAppV2 is required and cannot be null."); + } + Validator.validate(luisAppV2); + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); + return service.importV2App(appName, luisAppV2, this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = importV2AppDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse importV2AppDelegate(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); + } + + @Override + public AppsImportV2AppParameters importV2App() { + return new AppsImportV2AppParameters(this); + } + + /** + * Internal class implementing AppsImportV2AppDefinition. + */ + class AppsImportV2AppParameters implements AppsImportV2AppDefinition { + private AppsImpl parent; + private LuisAppV2 luisAppV2; + private String appName; + + /** + * Constructor. + * @param parent the parent object. + */ + AppsImportV2AppParameters(AppsImpl parent) { + this.parent = parent; + } + + @Override + public AppsImportV2AppParameters withLuisAppV2(LuisAppV2 luisAppV2) { + this.luisAppV2 = luisAppV2; + return this; + } + + @Override + public AppsImportV2AppParameters withAppName(String appName) { + this.appName = appName; + return this; + } + + @Override + public UUID execute() { + return importV2AppWithServiceResponseAsync(luisAppV2, appName).toBlocking().single().body(); + } + + @Override + public Observable executeAsync() { + return importV2AppWithServiceResponseAsync(luisAppV2, appName).map(new Func1, UUID>() { + @Override + public UUID call(ServiceResponse response) { + return response.body(); + } + }); + } + } + + + /** + * Imports an application to LUIS, the application's structure is included in the request body. + * + * @param luisAppLu A LUIS application structure. + * @param importLuFormatOptionalParameter the object representing the optional parameters to be set before calling this API + * @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 UUID object if successful. + */ + public UUID importLuFormat(String luisAppLu, ImportLuFormatAppsOptionalParameter importLuFormatOptionalParameter) { + return importLuFormatWithServiceResponseAsync(luisAppLu, importLuFormatOptionalParameter).toBlocking().single().body(); + } + + /** + * Imports an application to LUIS, the application's structure is included in the request body. + * + * @param luisAppLu A LUIS application structure. + * @param importLuFormatOptionalParameter the object representing the optional parameters to be set before calling this API + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture importLuFormatAsync(String luisAppLu, ImportLuFormatAppsOptionalParameter importLuFormatOptionalParameter, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(importLuFormatWithServiceResponseAsync(luisAppLu, importLuFormatOptionalParameter), serviceCallback); + } + + /** + * Imports an application to LUIS, the application's structure is included in the request body. + * + * @param luisAppLu A LUIS application structure. + * @param importLuFormatOptionalParameter the object representing the optional parameters to be set before calling this API + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the UUID object + */ + public Observable importLuFormatAsync(String luisAppLu, ImportLuFormatAppsOptionalParameter importLuFormatOptionalParameter) { + return importLuFormatWithServiceResponseAsync(luisAppLu, importLuFormatOptionalParameter).map(new Func1, UUID>() { + @Override + public UUID call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Imports an application to LUIS, the application's structure is included in the request body. + * + * @param luisAppLu A LUIS application structure. + * @param importLuFormatOptionalParameter the object representing the optional parameters to be set before calling this API + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the UUID object + */ + public Observable> importLuFormatWithServiceResponseAsync(String luisAppLu, ImportLuFormatAppsOptionalParameter importLuFormatOptionalParameter) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } + if (luisAppLu == null) { + throw new IllegalArgumentException("Parameter luisAppLu is required and cannot be null."); + } + final String appName = importLuFormatOptionalParameter != null ? importLuFormatOptionalParameter.appName() : null; + + return importLuFormatWithServiceResponseAsync(luisAppLu, appName); + } + + /** + * Imports an application to LUIS, the application's structure is included in the request body. + * + * @param luisAppLu A LUIS application structure. + * @param appName The application name to create. If not specified, the application name will be read from the imported object. If the application name already exists, an error is returned. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the UUID object + */ + public Observable> importLuFormatWithServiceResponseAsync(String luisAppLu, String appName) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } + if (luisAppLu == null) { + throw new IllegalArgumentException("Parameter luisAppLu is required and cannot be null."); + } + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); + return service.importLuFormat(appName, luisAppLu, this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = importLuFormatDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse importLuFormatDelegate(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); + } + + @Override + public AppsImportLuFormatParameters importLuFormat() { + return new AppsImportLuFormatParameters(this); + } + + /** + * Internal class implementing AppsImportLuFormatDefinition. + */ + class AppsImportLuFormatParameters implements AppsImportLuFormatDefinition { + private AppsImpl parent; + private String luisAppLu; + private String appName; + + /** + * Constructor. + * @param parent the parent object. + */ + AppsImportLuFormatParameters(AppsImpl parent) { + this.parent = parent; + } + + @Override + public AppsImportLuFormatParameters withLuisAppLu(String luisAppLu) { + this.luisAppLu = luisAppLu; + return this; + } + + @Override + public AppsImportLuFormatParameters withAppName(String appName) { + this.appName = appName; + return this; + } + + @Override + public UUID execute() { + return importLuFormatWithServiceResponseAsync(luisAppLu, appName).toBlocking().single().body(); + } + + @Override + public Observable executeAsync() { + return importLuFormatWithServiceResponseAsync(luisAppLu, appName).map(new Func1, UUID>() { + @Override + public UUID call(ServiceResponse response) { + return response.body(); + } + }); + } + } + } diff --git a/sdk/cognitiveservices/ms-azure-cs-luis-authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/AzureAccountsImpl.java b/sdk/cognitiveservices/ms-azure-cs-luis-authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/AzureAccountsImpl.java index 47faa2b5cb991..e2ab51362f0d8 100644 --- a/sdk/cognitiveservices/ms-azure-cs-luis-authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/AzureAccountsImpl.java +++ b/sdk/cognitiveservices/ms-azure-cs-luis-authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/AzureAccountsImpl.java @@ -9,7 +9,9 @@ package com.microsoft.azure.cognitiveservices.language.luis.authoring.implementation; import com.microsoft.azure.cognitiveservices.language.luis.authoring.models.AssignToAppOptionalParameter; +import com.microsoft.azure.cognitiveservices.language.luis.authoring.models.GetAssignedOptionalParameter; import com.microsoft.azure.cognitiveservices.language.luis.authoring.models.RemoveFromAppOptionalParameter; +import com.microsoft.azure.cognitiveservices.language.luis.authoring.models.ListUserLUISAccountsOptionalParameter; import retrofit2.Retrofit; import com.microsoft.azure.cognitiveservices.language.luis.authoring.AzureAccounts; import com.google.common.base.Joiner; @@ -64,19 +66,19 @@ public AzureAccountsImpl(Retrofit retrofit, LUISAuthoringClientImpl client) { interface AzureAccountsService { @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.language.luis.authoring.AzureAccounts assignToApp" }) @POST("apps/{appId}/azureaccounts") - Observable> assignToApp(@Path("appId") UUID appId, @Body AzureAccountInfoObject azureAccountInfoObject, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + Observable> assignToApp(@Path("appId") UUID appId, @Header("ArmToken") String armToken, @Body AzureAccountInfoObject azureAccountInfoObject, @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.AzureAccounts getAssigned" }) @GET("apps/{appId}/azureaccounts") - Observable> getAssigned(@Path("appId") UUID appId, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + Observable> getAssigned(@Path("appId") UUID appId, @Header("ArmToken") String armToken, @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.AzureAccounts removeFromApp" }) @HTTP(path = "apps/{appId}/azureaccounts", method = "DELETE", hasBody = true) - Observable> removeFromApp(@Path("appId") UUID appId, @Body AzureAccountInfoObject azureAccountInfoObject, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + Observable> removeFromApp(@Path("appId") UUID appId, @Header("ArmToken") String armToken, @Body AzureAccountInfoObject azureAccountInfoObject, @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.AzureAccounts listUserLUISAccounts" }) @GET("azureaccounts") - Observable> listUserLUISAccounts(@Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + Observable> listUserLUISAccounts(@Header("ArmToken") String armToken, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); } @@ -144,9 +146,10 @@ public Observable> assignToAppWithServiceRespon if (appId == null) { throw new IllegalArgumentException("Parameter appId is required and cannot be null."); } + final String armToken = assignToAppOptionalParameter != null ? assignToAppOptionalParameter.armToken() : null; final AzureAccountInfoObject azureAccountInfoObject = assignToAppOptionalParameter != null ? assignToAppOptionalParameter.azureAccountInfoObject() : null; - return assignToAppWithServiceResponseAsync(appId, azureAccountInfoObject); + return assignToAppWithServiceResponseAsync(appId, armToken, azureAccountInfoObject); } /** @@ -154,11 +157,12 @@ public Observable> assignToAppWithServiceRespon * Assigns an Azure account to the application. * * @param appId The application ID. + * @param armToken The custom arm token header to use; containing the user's ARM token used to validate azure accounts information. * @param azureAccountInfoObject The Azure account information object. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the OperationStatus object */ - public Observable> assignToAppWithServiceResponseAsync(UUID appId, AzureAccountInfoObject azureAccountInfoObject) { + public Observable> assignToAppWithServiceResponseAsync(UUID appId, String armToken, AzureAccountInfoObject azureAccountInfoObject) { if (this.client.endpoint() == null) { throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); } @@ -167,7 +171,7 @@ public Observable> assignToAppWithServiceRespon } Validator.validate(azureAccountInfoObject); String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); - return service.assignToApp(appId, azureAccountInfoObject, this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) + return service.assignToApp(appId, armToken, azureAccountInfoObject, this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { @@ -199,6 +203,7 @@ public AzureAccountsAssignToAppParameters assignToApp() { class AzureAccountsAssignToAppParameters implements AzureAccountsAssignToAppDefinition { private AzureAccountsImpl parent; private UUID appId; + private String armToken; private AzureAccountInfoObject azureAccountInfoObject; /** @@ -215,6 +220,12 @@ public AzureAccountsAssignToAppParameters withAppId(UUID appId) { return this; } + @Override + public AzureAccountsAssignToAppParameters withArmToken(String armToken) { + this.armToken = armToken; + return this; + } + @Override public AzureAccountsAssignToAppParameters withAzureAccountInfoObject(AzureAccountInfoObject azureAccountInfoObject) { this.azureAccountInfoObject = azureAccountInfoObject; @@ -223,12 +234,12 @@ public AzureAccountsAssignToAppParameters withAzureAccountInfoObject(AzureAccoun @Override public OperationStatus execute() { - return assignToAppWithServiceResponseAsync(appId, azureAccountInfoObject).toBlocking().single().body(); + return assignToAppWithServiceResponseAsync(appId, armToken, azureAccountInfoObject).toBlocking().single().body(); } @Override public Observable executeAsync() { - return assignToAppWithServiceResponseAsync(appId, azureAccountInfoObject).map(new Func1, OperationStatus>() { + return assignToAppWithServiceResponseAsync(appId, armToken, azureAccountInfoObject).map(new Func1, OperationStatus>() { @Override public OperationStatus call(ServiceResponse response) { return response.body(); @@ -237,18 +248,20 @@ public OperationStatus call(ServiceResponse response) { } } + /** * apps - Get LUIS Azure accounts assigned to the application. * Gets the LUIS Azure accounts assigned to the application for the user using his ARM token. * * @param appId The application ID. + * @param getAssignedOptionalParameter the object representing the optional parameters to be set before calling this API * @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<AzureAccountInfoObject> object if successful. */ - public List getAssigned(UUID appId) { - return getAssignedWithServiceResponseAsync(appId).toBlocking().single().body(); + public List getAssigned(UUID appId, GetAssignedOptionalParameter getAssignedOptionalParameter) { + return getAssignedWithServiceResponseAsync(appId, getAssignedOptionalParameter).toBlocking().single().body(); } /** @@ -256,12 +269,13 @@ public List getAssigned(UUID appId) { * Gets the LUIS Azure accounts assigned to the application for the user using his ARM token. * * @param appId The application ID. + * @param getAssignedOptionalParameter the object representing the optional parameters to be set before calling this API * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ - public ServiceFuture> getAssignedAsync(UUID appId, final ServiceCallback> serviceCallback) { - return ServiceFuture.fromResponse(getAssignedWithServiceResponseAsync(appId), serviceCallback); + public ServiceFuture> getAssignedAsync(UUID appId, GetAssignedOptionalParameter getAssignedOptionalParameter, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(getAssignedWithServiceResponseAsync(appId, getAssignedOptionalParameter), serviceCallback); } /** @@ -269,11 +283,12 @@ public ServiceFuture> getAssignedAsync(UUID appId, * Gets the LUIS Azure accounts assigned to the application for the user using his ARM token. * * @param appId The application ID. + * @param getAssignedOptionalParameter the object representing the optional parameters to be set before calling this API * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the List<AzureAccountInfoObject> object */ - public Observable> getAssignedAsync(UUID appId) { - return getAssignedWithServiceResponseAsync(appId).map(new Func1>, List>() { + public Observable> getAssignedAsync(UUID appId, GetAssignedOptionalParameter getAssignedOptionalParameter) { + return getAssignedWithServiceResponseAsync(appId, getAssignedOptionalParameter).map(new Func1>, List>() { @Override public List call(ServiceResponse> response) { return response.body(); @@ -286,10 +301,32 @@ public List call(ServiceResponse>> getAssignedWithServiceResponseAsync(UUID appId, GetAssignedOptionalParameter getAssignedOptionalParameter) { + 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."); + } + final String armToken = getAssignedOptionalParameter != null ? getAssignedOptionalParameter.armToken() : null; + + return getAssignedWithServiceResponseAsync(appId, armToken); + } + + /** + * apps - Get LUIS Azure accounts assigned to the application. + * Gets the LUIS Azure accounts assigned to the application for the user using his ARM token. + * + * @param appId The application ID. + * @param armToken The custom arm token header to use; containing the user's ARM token used to validate azure accounts information. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the List<AzureAccountInfoObject> object */ - public Observable>> getAssignedWithServiceResponseAsync(UUID appId) { + public Observable>> getAssignedWithServiceResponseAsync(UUID appId, String armToken) { if (this.client.endpoint() == null) { throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); } @@ -297,7 +334,7 @@ public Observable>> getAssignedWith throw new IllegalArgumentException("Parameter appId is required and cannot be null."); } String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); - return service.getAssigned(appId, this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) + return service.getAssigned(appId, armToken, this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) .flatMap(new Func1, Observable>>>() { @Override public Observable>> call(Response response) { @@ -318,6 +355,55 @@ private ServiceResponse> getAssignedDelegate(Respon .build(response); } + @Override + public AzureAccountsGetAssignedParameters getAssigned() { + return new AzureAccountsGetAssignedParameters(this); + } + + /** + * Internal class implementing AzureAccountsGetAssignedDefinition. + */ + class AzureAccountsGetAssignedParameters implements AzureAccountsGetAssignedDefinition { + private AzureAccountsImpl parent; + private UUID appId; + private String armToken; + + /** + * Constructor. + * @param parent the parent object. + */ + AzureAccountsGetAssignedParameters(AzureAccountsImpl parent) { + this.parent = parent; + } + + @Override + public AzureAccountsGetAssignedParameters withAppId(UUID appId) { + this.appId = appId; + return this; + } + + @Override + public AzureAccountsGetAssignedParameters withArmToken(String armToken) { + this.armToken = armToken; + return this; + } + + @Override + public List execute() { + return getAssignedWithServiceResponseAsync(appId, armToken).toBlocking().single().body(); + } + + @Override + public Observable> executeAsync() { + return getAssignedWithServiceResponseAsync(appId, armToken).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + } + /** * apps - Removes an assigned LUIS Azure account from an application. @@ -382,9 +468,10 @@ public Observable> removeFromAppWithServiceResp if (appId == null) { throw new IllegalArgumentException("Parameter appId is required and cannot be null."); } + final String armToken = removeFromAppOptionalParameter != null ? removeFromAppOptionalParameter.armToken() : null; final AzureAccountInfoObject azureAccountInfoObject = removeFromAppOptionalParameter != null ? removeFromAppOptionalParameter.azureAccountInfoObject() : null; - return removeFromAppWithServiceResponseAsync(appId, azureAccountInfoObject); + return removeFromAppWithServiceResponseAsync(appId, armToken, azureAccountInfoObject); } /** @@ -392,11 +479,12 @@ public Observable> removeFromAppWithServiceResp * Removes assigned Azure account from the application. * * @param appId The application ID. + * @param armToken The custom arm token header to use; containing the user's ARM token used to validate azure accounts information. * @param azureAccountInfoObject The Azure account information object. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the OperationStatus object */ - public Observable> removeFromAppWithServiceResponseAsync(UUID appId, AzureAccountInfoObject azureAccountInfoObject) { + public Observable> removeFromAppWithServiceResponseAsync(UUID appId, String armToken, AzureAccountInfoObject azureAccountInfoObject) { if (this.client.endpoint() == null) { throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); } @@ -405,7 +493,7 @@ public Observable> removeFromAppWithServiceResp } Validator.validate(azureAccountInfoObject); String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); - return service.removeFromApp(appId, azureAccountInfoObject, this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) + return service.removeFromApp(appId, armToken, azureAccountInfoObject, this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { @@ -437,6 +525,7 @@ public AzureAccountsRemoveFromAppParameters removeFromApp() { class AzureAccountsRemoveFromAppParameters implements AzureAccountsRemoveFromAppDefinition { private AzureAccountsImpl parent; private UUID appId; + private String armToken; private AzureAccountInfoObject azureAccountInfoObject; /** @@ -453,6 +542,12 @@ public AzureAccountsRemoveFromAppParameters withAppId(UUID appId) { return this; } + @Override + public AzureAccountsRemoveFromAppParameters withArmToken(String armToken) { + this.armToken = armToken; + return this; + } + @Override public AzureAccountsRemoveFromAppParameters withAzureAccountInfoObject(AzureAccountInfoObject azureAccountInfoObject) { this.azureAccountInfoObject = azureAccountInfoObject; @@ -461,12 +556,12 @@ public AzureAccountsRemoveFromAppParameters withAzureAccountInfoObject(AzureAcco @Override public OperationStatus execute() { - return removeFromAppWithServiceResponseAsync(appId, azureAccountInfoObject).toBlocking().single().body(); + return removeFromAppWithServiceResponseAsync(appId, armToken, azureAccountInfoObject).toBlocking().single().body(); } @Override public Observable executeAsync() { - return removeFromAppWithServiceResponseAsync(appId, azureAccountInfoObject).map(new Func1, OperationStatus>() { + return removeFromAppWithServiceResponseAsync(appId, armToken, azureAccountInfoObject).map(new Func1, OperationStatus>() { @Override public OperationStatus call(ServiceResponse response) { return response.body(); @@ -475,40 +570,44 @@ public OperationStatus call(ServiceResponse response) { } } + /** * user - Get LUIS Azure accounts. * Gets the LUIS Azure accounts for the user using his ARM token. * + * @param listUserLUISAccountsOptionalParameter the object representing the optional parameters to be set before calling this API * @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<AzureAccountInfoObject> object if successful. */ - public List listUserLUISAccounts() { - return listUserLUISAccountsWithServiceResponseAsync().toBlocking().single().body(); + public List listUserLUISAccounts(ListUserLUISAccountsOptionalParameter listUserLUISAccountsOptionalParameter) { + return listUserLUISAccountsWithServiceResponseAsync(listUserLUISAccountsOptionalParameter).toBlocking().single().body(); } /** * user - Get LUIS Azure accounts. * Gets the LUIS Azure accounts for the user using his ARM token. * + * @param listUserLUISAccountsOptionalParameter the object representing the optional parameters to be set before calling this API * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ - public ServiceFuture> listUserLUISAccountsAsync(final ServiceCallback> serviceCallback) { - return ServiceFuture.fromResponse(listUserLUISAccountsWithServiceResponseAsync(), serviceCallback); + public ServiceFuture> listUserLUISAccountsAsync(ListUserLUISAccountsOptionalParameter listUserLUISAccountsOptionalParameter, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listUserLUISAccountsWithServiceResponseAsync(listUserLUISAccountsOptionalParameter), serviceCallback); } /** * user - Get LUIS Azure accounts. * Gets the LUIS Azure accounts for the user using his ARM token. * + * @param listUserLUISAccountsOptionalParameter the object representing the optional parameters to be set before calling this API * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the List<AzureAccountInfoObject> object */ - public Observable> listUserLUISAccountsAsync() { - return listUserLUISAccountsWithServiceResponseAsync().map(new Func1>, List>() { + public Observable> listUserLUISAccountsAsync(ListUserLUISAccountsOptionalParameter listUserLUISAccountsOptionalParameter) { + return listUserLUISAccountsWithServiceResponseAsync(listUserLUISAccountsOptionalParameter).map(new Func1>, List>() { @Override public List call(ServiceResponse> response) { return response.body(); @@ -520,15 +619,33 @@ public List call(ServiceResponse>> listUserLUISAccountsWithServiceResponseAsync(ListUserLUISAccountsOptionalParameter listUserLUISAccountsOptionalParameter) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } + final String armToken = listUserLUISAccountsOptionalParameter != null ? listUserLUISAccountsOptionalParameter.armToken() : null; + + return listUserLUISAccountsWithServiceResponseAsync(armToken); + } + + /** + * user - Get LUIS Azure accounts. + * Gets the LUIS Azure accounts for the user using his ARM token. + * + * @param armToken The custom arm token header to use; containing the user's ARM token used to validate azure accounts information. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the List<AzureAccountInfoObject> object */ - public Observable>> listUserLUISAccountsWithServiceResponseAsync() { + public Observable>> listUserLUISAccountsWithServiceResponseAsync(String armToken) { 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.listUserLUISAccounts(this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) + return service.listUserLUISAccounts(armToken, this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) .flatMap(new Func1, Observable>>>() { @Override public Observable>> call(Response response) { @@ -549,4 +666,46 @@ private ServiceResponse> listUserLUISAccountsDelega .build(response); } + @Override + public AzureAccountsListUserLUISAccountsParameters listUserLUISAccounts() { + return new AzureAccountsListUserLUISAccountsParameters(this); + } + + /** + * Internal class implementing AzureAccountsListUserLUISAccountsDefinition. + */ + class AzureAccountsListUserLUISAccountsParameters implements AzureAccountsListUserLUISAccountsDefinition { + private AzureAccountsImpl parent; + private String armToken; + + /** + * Constructor. + * @param parent the parent object. + */ + AzureAccountsListUserLUISAccountsParameters(AzureAccountsImpl parent) { + this.parent = parent; + } + + @Override + public AzureAccountsListUserLUISAccountsParameters withArmToken(String armToken) { + this.armToken = armToken; + return this; + } + + @Override + public List execute() { + return listUserLUISAccountsWithServiceResponseAsync(armToken).toBlocking().single().body(); + } + + @Override + public Observable> executeAsync() { + return listUserLUISAccountsWithServiceResponseAsync(armToken).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + } + } diff --git a/sdk/cognitiveservices/ms-azure-cs-luis-authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/ExamplesImpl.java b/sdk/cognitiveservices/ms-azure-cs-luis-authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/ExamplesImpl.java index 7d8f8e02599f8..f89b5d714280c 100644 --- a/sdk/cognitiveservices/ms-azure-cs-luis-authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/ExamplesImpl.java +++ b/sdk/cognitiveservices/ms-azure-cs-luis-authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/ExamplesImpl.java @@ -8,6 +8,8 @@ package com.microsoft.azure.cognitiveservices.language.luis.authoring.implementation; +import com.microsoft.azure.cognitiveservices.language.luis.authoring.models.AddExamplesOptionalParameter; +import com.microsoft.azure.cognitiveservices.language.luis.authoring.models.BatchOptionalParameter; import com.microsoft.azure.cognitiveservices.language.luis.authoring.models.ListExamplesOptionalParameter; import retrofit2.Retrofit; import com.microsoft.azure.cognitiveservices.language.luis.authoring.Examples; @@ -67,15 +69,15 @@ 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("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + Observable> add(@Path("appId") UUID appId, @Path("versionId") String versionId, @Query("enableNestedChildren") Boolean enableNestedChildren, @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("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + Observable> batch(@Path("appId") UUID appId, @Path("versionId") String versionId, @Query("enableNestedChildren") Boolean enableNestedChildren, @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("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + Observable> list(@Path("appId") UUID appId, @Path("versionId") String versionId, @Query("skip") Integer skip, @Query("take") Integer take, @Query("enableNestedChildren") Boolean enableNestedChildren, @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) @@ -83,19 +85,21 @@ interface ExamplesService { } + /** * Adds a labeled example utterance in a version of the application. * * @param appId The application ID. * @param versionId The version ID. * @param exampleLabelObject A labeled example utterance with the expected intent and entities. + * @param addOptionalParameter the object representing the optional parameters to be set before calling this API * @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 LabelExampleResponse object if successful. */ - public LabelExampleResponse add(UUID appId, String versionId, ExampleLabelObject exampleLabelObject) { - return addWithServiceResponseAsync(appId, versionId, exampleLabelObject).toBlocking().single().body(); + public LabelExampleResponse add(UUID appId, String versionId, ExampleLabelObject exampleLabelObject, AddExamplesOptionalParameter addOptionalParameter) { + return addWithServiceResponseAsync(appId, versionId, exampleLabelObject, addOptionalParameter).toBlocking().single().body(); } /** @@ -104,12 +108,13 @@ public LabelExampleResponse add(UUID appId, String versionId, ExampleLabelObject * @param appId The application ID. * @param versionId The version ID. * @param exampleLabelObject A labeled example utterance with the expected intent and entities. + * @param addOptionalParameter the object representing the optional parameters to be set before calling this API * @param serviceCallback 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(UUID appId, String versionId, ExampleLabelObject exampleLabelObject, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(addWithServiceResponseAsync(appId, versionId, exampleLabelObject), serviceCallback); + public ServiceFuture addAsync(UUID appId, String versionId, ExampleLabelObject exampleLabelObject, AddExamplesOptionalParameter addOptionalParameter, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(addWithServiceResponseAsync(appId, versionId, exampleLabelObject, addOptionalParameter), serviceCallback); } /** @@ -118,11 +123,12 @@ public ServiceFuture addAsync(UUID appId, String versionId * @param appId The application ID. * @param versionId The version ID. * @param exampleLabelObject A labeled example utterance with the expected intent and entities. + * @param addOptionalParameter the object representing the optional parameters to be set before calling this API * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the LabelExampleResponse object */ - public Observable addAsync(UUID appId, String versionId, ExampleLabelObject exampleLabelObject) { - return addWithServiceResponseAsync(appId, versionId, exampleLabelObject).map(new Func1, LabelExampleResponse>() { + public Observable addAsync(UUID appId, String versionId, ExampleLabelObject exampleLabelObject, AddExamplesOptionalParameter addOptionalParameter) { + return addWithServiceResponseAsync(appId, versionId, exampleLabelObject, addOptionalParameter).map(new Func1, LabelExampleResponse>() { @Override public LabelExampleResponse call(ServiceResponse response) { return response.body(); @@ -136,10 +142,40 @@ public LabelExampleResponse call(ServiceResponse response) * @param appId The application ID. * @param versionId The version ID. * @param exampleLabelObject A labeled example utterance with the expected intent and entities. + * @param addOptionalParameter the object representing the optional parameters to be set before calling this API * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the LabelExampleResponse object */ - public Observable> addWithServiceResponseAsync(UUID appId, String versionId, ExampleLabelObject exampleLabelObject) { + public Observable> addWithServiceResponseAsync(UUID appId, String versionId, ExampleLabelObject exampleLabelObject, AddExamplesOptionalParameter 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."); + } + if (versionId == null) { + throw new IllegalArgumentException("Parameter versionId is required and cannot be null."); + } + if (exampleLabelObject == null) { + throw new IllegalArgumentException("Parameter exampleLabelObject is required and cannot be null."); + } + Validator.validate(exampleLabelObject); + final Boolean enableNestedChildren = addOptionalParameter != null ? addOptionalParameter.enableNestedChildren() : null; + + return addWithServiceResponseAsync(appId, versionId, exampleLabelObject, enableNestedChildren); + } + + /** + * Adds a labeled example utterance in a version of the application. + * + * @param appId The application ID. + * @param versionId The version ID. + * @param exampleLabelObject A labeled example utterance with the expected intent and entities. + * @param enableNestedChildren Toggles nested/flat format + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LabelExampleResponse object + */ + public Observable> addWithServiceResponseAsync(UUID appId, String versionId, ExampleLabelObject exampleLabelObject, Boolean enableNestedChildren) { if (this.client.endpoint() == null) { throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); } @@ -154,7 +190,7 @@ public Observable> addWithServiceResponseA } Validator.validate(exampleLabelObject); String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); - return service.add(appId, versionId, exampleLabelObject, this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) + return service.add(appId, versionId, enableNestedChildren, exampleLabelObject, this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { @@ -175,19 +211,84 @@ private ServiceResponse addDelegate(Response .build(response); } + @Override + public ExamplesAddParameters add() { + return new ExamplesAddParameters(this); + } + + /** + * Internal class implementing ExamplesAddDefinition. + */ + class ExamplesAddParameters implements ExamplesAddDefinition { + private ExamplesImpl parent; + private UUID appId; + private String versionId; + private ExampleLabelObject exampleLabelObject; + private Boolean enableNestedChildren; + + /** + * Constructor. + * @param parent the parent object. + */ + ExamplesAddParameters(ExamplesImpl parent) { + this.parent = parent; + } + + @Override + public ExamplesAddParameters withAppId(UUID appId) { + this.appId = appId; + return this; + } + + @Override + public ExamplesAddParameters withVersionId(String versionId) { + this.versionId = versionId; + return this; + } + + @Override + public ExamplesAddParameters withExampleLabelObject(ExampleLabelObject exampleLabelObject) { + this.exampleLabelObject = exampleLabelObject; + return this; + } + + @Override + public ExamplesAddParameters withEnableNestedChildren(Boolean enableNestedChildren) { + this.enableNestedChildren = enableNestedChildren; + return this; + } + + @Override + public LabelExampleResponse execute() { + return addWithServiceResponseAsync(appId, versionId, exampleLabelObject, enableNestedChildren).toBlocking().single().body(); + } + + @Override + public Observable executeAsync() { + return addWithServiceResponseAsync(appId, versionId, exampleLabelObject, enableNestedChildren).map(new Func1, LabelExampleResponse>() { + @Override + public LabelExampleResponse call(ServiceResponse response) { + return response.body(); + } + }); + } + } + + /** * Adds a batch of labeled example utterances to a version of the application. * * @param appId The application ID. * @param versionId The version ID. * @param exampleLabelObjectArray Array of example utterances. + * @param batchOptionalParameter the object representing the optional parameters to be set before calling this API * @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<BatchLabelExample> object if successful. */ - public List batch(UUID appId, String versionId, List exampleLabelObjectArray) { - return batchWithServiceResponseAsync(appId, versionId, exampleLabelObjectArray).toBlocking().single().body(); + public List batch(UUID appId, String versionId, List exampleLabelObjectArray, BatchOptionalParameter batchOptionalParameter) { + return batchWithServiceResponseAsync(appId, versionId, exampleLabelObjectArray, batchOptionalParameter).toBlocking().single().body(); } /** @@ -196,12 +297,13 @@ public List batch(UUID appId, String versionId, List> batchAsync(UUID appId, String versionId, List exampleLabelObjectArray, final ServiceCallback> serviceCallback) { - return ServiceFuture.fromResponse(batchWithServiceResponseAsync(appId, versionId, exampleLabelObjectArray), serviceCallback); + public ServiceFuture> batchAsync(UUID appId, String versionId, List exampleLabelObjectArray, BatchOptionalParameter batchOptionalParameter, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(batchWithServiceResponseAsync(appId, versionId, exampleLabelObjectArray, batchOptionalParameter), serviceCallback); } /** @@ -210,11 +312,12 @@ public ServiceFuture> batchAsync(UUID appId, String vers * @param appId The application ID. * @param versionId The version ID. * @param exampleLabelObjectArray Array of example utterances. + * @param batchOptionalParameter the object representing the optional parameters to be set before calling this API * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the List<BatchLabelExample> object */ - public Observable> batchAsync(UUID appId, String versionId, List exampleLabelObjectArray) { - return batchWithServiceResponseAsync(appId, versionId, exampleLabelObjectArray).map(new Func1>, List>() { + public Observable> batchAsync(UUID appId, String versionId, List exampleLabelObjectArray, BatchOptionalParameter batchOptionalParameter) { + return batchWithServiceResponseAsync(appId, versionId, exampleLabelObjectArray, batchOptionalParameter).map(new Func1>, List>() { @Override public List call(ServiceResponse> response) { return response.body(); @@ -228,10 +331,40 @@ public List call(ServiceResponse> res * @param appId The application ID. * @param versionId The version ID. * @param exampleLabelObjectArray Array of example utterances. + * @param batchOptionalParameter the object representing the optional parameters to be set before calling this API + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<BatchLabelExample> object + */ + public Observable>> batchWithServiceResponseAsync(UUID appId, String versionId, List exampleLabelObjectArray, BatchOptionalParameter batchOptionalParameter) { + 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."); + } + if (exampleLabelObjectArray == null) { + throw new IllegalArgumentException("Parameter exampleLabelObjectArray is required and cannot be null."); + } + Validator.validate(exampleLabelObjectArray); + final Boolean enableNestedChildren = batchOptionalParameter != null ? batchOptionalParameter.enableNestedChildren() : null; + + return batchWithServiceResponseAsync(appId, versionId, exampleLabelObjectArray, enableNestedChildren); + } + + /** + * Adds a batch of labeled example utterances to a version of the application. + * + * @param appId The application ID. + * @param versionId The version ID. + * @param exampleLabelObjectArray Array of example utterances. + * @param enableNestedChildren Toggles nested/flat format * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the List<BatchLabelExample> object */ - public Observable>> batchWithServiceResponseAsync(UUID appId, String versionId, List exampleLabelObjectArray) { + public Observable>> batchWithServiceResponseAsync(UUID appId, String versionId, List exampleLabelObjectArray, Boolean enableNestedChildren) { if (this.client.endpoint() == null) { throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); } @@ -246,7 +379,7 @@ public Observable>> batchWithServiceResp } Validator.validate(exampleLabelObjectArray); String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); - return service.batch(appId, versionId, exampleLabelObjectArray, this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) + return service.batch(appId, versionId, enableNestedChildren, exampleLabelObjectArray, this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) .flatMap(new Func1, Observable>>>() { @Override public Observable>> call(Response response) { @@ -268,6 +401,69 @@ private ServiceResponse> batchDelegate(Response exampleLabelObjectArray; + private Boolean enableNestedChildren; + + /** + * Constructor. + * @param parent the parent object. + */ + ExamplesBatchParameters(ExamplesImpl parent) { + this.parent = parent; + } + + @Override + public ExamplesBatchParameters withAppId(UUID appId) { + this.appId = appId; + return this; + } + + @Override + public ExamplesBatchParameters withVersionId(String versionId) { + this.versionId = versionId; + return this; + } + + @Override + public ExamplesBatchParameters withExampleLabelObjectArray(List exampleLabelObjectArray) { + this.exampleLabelObjectArray = exampleLabelObjectArray; + return this; + } + + @Override + public ExamplesBatchParameters withEnableNestedChildren(Boolean enableNestedChildren) { + this.enableNestedChildren = enableNestedChildren; + return this; + } + + @Override + public List execute() { + return batchWithServiceResponseAsync(appId, versionId, exampleLabelObjectArray, enableNestedChildren).toBlocking().single().body(); + } + + @Override + public Observable> executeAsync() { + return batchWithServiceResponseAsync(appId, versionId, exampleLabelObjectArray, enableNestedChildren).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + } + /** * Returns example utterances to be reviewed from a version of the application. @@ -337,8 +533,9 @@ public Observable>> listWithServiceRespon } final Integer skip = listOptionalParameter != null ? listOptionalParameter.skip() : null; final Integer take = listOptionalParameter != null ? listOptionalParameter.take() : null; + final Boolean enableNestedChildren = listOptionalParameter != null ? listOptionalParameter.enableNestedChildren() : null; - return listWithServiceResponseAsync(appId, versionId, skip, take); + return listWithServiceResponseAsync(appId, versionId, skip, take, enableNestedChildren); } /** @@ -348,10 +545,11 @@ public Observable>> listWithServiceRespon * @param versionId The version ID. * @param skip The number of entries to skip. Default value is 0. * @param take The number of entries to return. Maximum page size is 500. Default is 100. + * @param enableNestedChildren Toggles nested/flat format * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the List<LabeledUtterance> object */ - public Observable>> listWithServiceResponseAsync(UUID appId, String versionId, Integer skip, Integer take) { + public Observable>> listWithServiceResponseAsync(UUID appId, String versionId, Integer skip, Integer take, Boolean enableNestedChildren) { if (this.client.endpoint() == null) { throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); } @@ -362,7 +560,7 @@ public Observable>> listWithServiceRespon throw new IllegalArgumentException("Parameter versionId is required and cannot be null."); } String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); - return service.list(appId, versionId, skip, take, this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) + return service.list(appId, versionId, skip, take, enableNestedChildren, this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) .flatMap(new Func1, Observable>>>() { @Override public Observable>> call(Response response) { @@ -397,6 +595,7 @@ class ExamplesListParameters implements ExamplesListDefinition { private String versionId; private Integer skip; private Integer take; + private Boolean enableNestedChildren; /** * Constructor. @@ -430,14 +629,20 @@ public ExamplesListParameters withTake(Integer take) { return this; } + @Override + public ExamplesListParameters withEnableNestedChildren(Boolean enableNestedChildren) { + this.enableNestedChildren = enableNestedChildren; + return this; + } + @Override public List execute() { - return listWithServiceResponseAsync(appId, versionId, skip, take).toBlocking().single().body(); + return listWithServiceResponseAsync(appId, versionId, skip, take, enableNestedChildren).toBlocking().single().body(); } @Override public Observable> executeAsync() { - return listWithServiceResponseAsync(appId, versionId, skip, take).map(new Func1>, List>() { + return listWithServiceResponseAsync(appId, versionId, skip, take, enableNestedChildren).map(new Func1>, List>() { @Override public List call(ServiceResponse> response) { return response.body(); diff --git a/sdk/cognitiveservices/ms-azure-cs-luis-authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/LUISAuthoringClientImpl.java b/sdk/cognitiveservices/ms-azure-cs-luis-authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/LUISAuthoringClientImpl.java index 9726d57b18fd6..80d7627006b48 100644 --- a/sdk/cognitiveservices/ms-azure-cs-luis-authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/LUISAuthoringClientImpl.java +++ b/sdk/cognitiveservices/ms-azure-cs-luis-authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/LUISAuthoringClientImpl.java @@ -17,7 +17,6 @@ import com.microsoft.azure.cognitiveservices.language.luis.authoring.LUISAuthoringClient; import com.microsoft.azure.cognitiveservices.language.luis.authoring.Models; import com.microsoft.azure.cognitiveservices.language.luis.authoring.Patterns; -import com.microsoft.azure.cognitiveservices.language.luis.authoring.Permissions; import com.microsoft.azure.cognitiveservices.language.luis.authoring.Settings; import com.microsoft.azure.cognitiveservices.language.luis.authoring.Trains; import com.microsoft.azure.cognitiveservices.language.luis.authoring.Versions; @@ -209,19 +208,6 @@ public Trains trains() { return this.trains; } - /** - * The Permissions object to access its operations. - */ - private Permissions permissions; - - /** - * Gets the Permissions object to access its operations. - * @return the Permissions object. - */ - public Permissions permissions() { - return this.permissions; - } - /** * The Patterns object to access its operations. */ @@ -301,7 +287,6 @@ protected void initialize() { this.apps = new AppsImpl(restClient().retrofit(), this); this.versions = new VersionsImpl(restClient().retrofit(), this); this.trains = new TrainsImpl(restClient().retrofit(), this); - this.permissions = new PermissionsImpl(restClient().retrofit(), this); this.patterns = new PatternsImpl(restClient().retrofit(), this); this.settings = new SettingsImpl(restClient().retrofit(), this); this.azureAccounts = new AzureAccountsImpl(restClient().retrofit(), this); diff --git a/sdk/cognitiveservices/ms-azure-cs-luis-authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/ModelsImpl.java b/sdk/cognitiveservices/ms-azure-cs-luis-authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/ModelsImpl.java index 37613297872a7..f0195c4b8223b 100644 --- a/sdk/cognitiveservices/ms-azure-cs-luis-authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/ModelsImpl.java +++ b/sdk/cognitiveservices/ms-azure-cs-luis-authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/ModelsImpl.java @@ -300,11 +300,11 @@ interface ModelsService { @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.language.luis.authoring.Models listIntentSuggestions" }) @GET("apps/{appId}/versions/{versionId}/intents/{intentId}/suggest") - Observable> listIntentSuggestions(@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); + Observable> listIntentSuggestions(@Path("appId") UUID appId, @Path("versionId") String versionId, @Path("intentId") UUID intentId, @Query("take") Integer take, @Query("enableNestedChildren") Boolean enableNestedChildren, @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 listEntitySuggestions" }) @GET("apps/{appId}/versions/{versionId}/entities/{entityId}/suggest") - Observable> listEntitySuggestions(@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); + Observable> listEntitySuggestions(@Path("appId") UUID appId, @Path("versionId") String versionId, @Path("entityId") UUID entityId, @Query("take") Integer take, @Query("enableNestedChildren") Boolean enableNestedChildren, @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") @@ -5461,8 +5461,9 @@ public Observable>> listIntentSug throw new IllegalArgumentException("Parameter intentId is required and cannot be null."); } final Integer take = listIntentSuggestionsOptionalParameter != null ? listIntentSuggestionsOptionalParameter.take() : null; + final Boolean enableNestedChildren = listIntentSuggestionsOptionalParameter != null ? listIntentSuggestionsOptionalParameter.enableNestedChildren() : null; - return listIntentSuggestionsWithServiceResponseAsync(appId, versionId, intentId, take); + return listIntentSuggestionsWithServiceResponseAsync(appId, versionId, intentId, take, enableNestedChildren); } /** @@ -5472,10 +5473,11 @@ public Observable>> listIntentSug * @param versionId The version ID. * @param intentId The intent classifier ID. * @param take The number of entries to return. Maximum page size is 500. Default is 100. + * @param enableNestedChildren Toggles nested/flat format * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the List<IntentsSuggestionExample> object */ - public Observable>> listIntentSuggestionsWithServiceResponseAsync(UUID appId, String versionId, UUID intentId, Integer take) { + public Observable>> listIntentSuggestionsWithServiceResponseAsync(UUID appId, String versionId, UUID intentId, Integer take, Boolean enableNestedChildren) { if (this.client.endpoint() == null) { throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); } @@ -5489,7 +5491,7 @@ public Observable>> listIntentSug throw new IllegalArgumentException("Parameter intentId is required and cannot be null."); } String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); - return service.listIntentSuggestions(appId, versionId, intentId, take, this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) + return service.listIntentSuggestions(appId, versionId, intentId, take, enableNestedChildren, this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) .flatMap(new Func1, Observable>>>() { @Override public Observable>> call(Response response) { @@ -5524,6 +5526,7 @@ class ModelsListIntentSuggestionsParameters implements ModelsListIntentSuggestio private String versionId; private UUID intentId; private Integer take; + private Boolean enableNestedChildren; /** * Constructor. @@ -5557,14 +5560,20 @@ public ModelsListIntentSuggestionsParameters withTake(Integer take) { return this; } + @Override + public ModelsListIntentSuggestionsParameters withEnableNestedChildren(Boolean enableNestedChildren) { + this.enableNestedChildren = enableNestedChildren; + return this; + } + @Override public List execute() { - return listIntentSuggestionsWithServiceResponseAsync(appId, versionId, intentId, take).toBlocking().single().body(); + return listIntentSuggestionsWithServiceResponseAsync(appId, versionId, intentId, take, enableNestedChildren).toBlocking().single().body(); } @Override public Observable> executeAsync() { - return listIntentSuggestionsWithServiceResponseAsync(appId, versionId, intentId, take).map(new Func1>, List>() { + return listIntentSuggestionsWithServiceResponseAsync(appId, versionId, intentId, take, enableNestedChildren).map(new Func1>, List>() { @Override public List call(ServiceResponse> response) { return response.body(); @@ -5648,8 +5657,9 @@ public Observable>> listEntitySu throw new IllegalArgumentException("Parameter entityId is required and cannot be null."); } final Integer take = listEntitySuggestionsOptionalParameter != null ? listEntitySuggestionsOptionalParameter.take() : null; + final Boolean enableNestedChildren = listEntitySuggestionsOptionalParameter != null ? listEntitySuggestionsOptionalParameter.enableNestedChildren() : null; - return listEntitySuggestionsWithServiceResponseAsync(appId, versionId, entityId, take); + return listEntitySuggestionsWithServiceResponseAsync(appId, versionId, entityId, take, enableNestedChildren); } /** @@ -5659,10 +5669,11 @@ public Observable>> listEntitySu * @param versionId The version ID. * @param entityId The target entity extractor model to enhance. * @param take The number of entries to return. Maximum page size is 500. Default is 100. + * @param enableNestedChildren Toggles nested/flat format * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the List<EntitiesSuggestionExample> object */ - public Observable>> listEntitySuggestionsWithServiceResponseAsync(UUID appId, String versionId, UUID entityId, Integer take) { + public Observable>> listEntitySuggestionsWithServiceResponseAsync(UUID appId, String versionId, UUID entityId, Integer take, Boolean enableNestedChildren) { if (this.client.endpoint() == null) { throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); } @@ -5676,7 +5687,7 @@ public Observable>> listEntitySu throw new IllegalArgumentException("Parameter entityId is required and cannot be null."); } String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); - return service.listEntitySuggestions(appId, versionId, entityId, take, this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) + return service.listEntitySuggestions(appId, versionId, entityId, take, enableNestedChildren, this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) .flatMap(new Func1, Observable>>>() { @Override public Observable>> call(Response response) { @@ -5711,6 +5722,7 @@ class ModelsListEntitySuggestionsParameters implements ModelsListEntitySuggestio private String versionId; private UUID entityId; private Integer take; + private Boolean enableNestedChildren; /** * Constructor. @@ -5744,14 +5756,20 @@ public ModelsListEntitySuggestionsParameters withTake(Integer take) { return this; } + @Override + public ModelsListEntitySuggestionsParameters withEnableNestedChildren(Boolean enableNestedChildren) { + this.enableNestedChildren = enableNestedChildren; + return this; + } + @Override public List execute() { - return listEntitySuggestionsWithServiceResponseAsync(appId, versionId, entityId, take).toBlocking().single().body(); + return listEntitySuggestionsWithServiceResponseAsync(appId, versionId, entityId, take, enableNestedChildren).toBlocking().single().body(); } @Override public Observable> executeAsync() { - return listEntitySuggestionsWithServiceResponseAsync(appId, versionId, entityId, take).map(new Func1>, List>() { + return listEntitySuggestionsWithServiceResponseAsync(appId, versionId, entityId, take, enableNestedChildren).map(new Func1>, List>() { @Override public List call(ServiceResponse> response) { return response.body(); diff --git a/sdk/cognitiveservices/ms-azure-cs-luis-authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/PermissionsImpl.java b/sdk/cognitiveservices/ms-azure-cs-luis-authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/PermissionsImpl.java deleted file mode 100644 index ab6b5936b570a..0000000000000 --- a/sdk/cognitiveservices/ms-azure-cs-luis-authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/PermissionsImpl.java +++ /dev/null @@ -1,624 +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.cognitiveservices.language.luis.authoring.implementation; - -import com.microsoft.azure.cognitiveservices.language.luis.authoring.models.AddPermissionsOptionalParameter; -import com.microsoft.azure.cognitiveservices.language.luis.authoring.models.DeletePermissionsOptionalParameter; -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; -import com.microsoft.azure.cognitiveservices.language.luis.authoring.models.OperationStatus; -import com.microsoft.azure.cognitiveservices.language.luis.authoring.models.UserAccessList; -import com.microsoft.azure.cognitiveservices.language.luis.authoring.models.UserCollaborator; -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.UUID; -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.Response; -import rx.functions.Func1; -import rx.Observable; - -/** - * An instance of this class provides access to all the operations defined - * in Permissions. - */ -public class PermissionsImpl implements Permissions { - /** The Retrofit service to perform REST calls. */ - private PermissionsService service; - /** The service client containing this operation class. */ - private LUISAuthoringClientImpl client; - - /** - * Initializes an instance of PermissionsImpl. - * - * @param retrofit the Retrofit instance built from a Retrofit Builder. - * @param client the instance of the service client containing this operation class. - */ - public PermissionsImpl(Retrofit retrofit, LUISAuthoringClientImpl 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.cognitiveservices.language.luis.authoring.Permissions list" }) - @GET("apps/{appId}/permissions") - 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("x-ms-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("x-ms-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("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); - - } - - /** - * Gets the list of user emails that have permissions to access your application. - * - * @param appId The application 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 UserAccessList object if successful. - */ - public UserAccessList list(UUID appId) { - return listWithServiceResponseAsync(appId).toBlocking().single().body(); - } - - /** - * Gets the list of user emails that have permissions to access your application. - * - * @param appId The application 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 listAsync(UUID appId, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(listWithServiceResponseAsync(appId), serviceCallback); - } - - /** - * Gets the list of user emails that have permissions to access your application. - * - * @param appId The application ID. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the UserAccessList object - */ - public Observable listAsync(UUID appId) { - return listWithServiceResponseAsync(appId).map(new Func1, UserAccessList>() { - @Override - public UserAccessList call(ServiceResponse response) { - return response.body(); - } - }); - } - - /** - * Gets the list of user emails that have permissions to access your application. - * - * @param appId The application ID. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @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."); - } - 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) { - try { - ServiceResponse clientResponse = listDelegate(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().newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken() { }.getType()) - .registerError(ErrorResponseException.class) - .build(response); - } - - - /** - * Adds a user to the allowed list of users to access this LUIS application. Users are added using their email address. - * - * @param appId The application ID. - * @param addOptionalParameter the object representing the optional parameters to be set before calling this API - * @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 OperationStatus object if successful. - */ - public OperationStatus add(UUID appId, AddPermissionsOptionalParameter addOptionalParameter) { - return addWithServiceResponseAsync(appId, addOptionalParameter).toBlocking().single().body(); - } - - /** - * Adds a user to the allowed list of users to access this LUIS application. Users are added using their email address. - * - * @param appId The application ID. - * @param addOptionalParameter the object representing the optional parameters to be set before calling this API - * @param serviceCallback 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(UUID appId, AddPermissionsOptionalParameter addOptionalParameter, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(addWithServiceResponseAsync(appId, addOptionalParameter), serviceCallback); - } - - /** - * Adds a user to the allowed list of users to access this LUIS application. Users are added using their email address. - * - * @param appId The application ID. - * @param addOptionalParameter the object representing the optional parameters to be set before calling this API - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the OperationStatus object - */ - public Observable addAsync(UUID appId, AddPermissionsOptionalParameter addOptionalParameter) { - return addWithServiceResponseAsync(appId, addOptionalParameter).map(new Func1, OperationStatus>() { - @Override - public OperationStatus call(ServiceResponse response) { - return response.body(); - } - }); - } - - /** - * Adds a user to the allowed list of users to access this LUIS application. Users are added using their email address. - * - * @param appId The application ID. - * @param addOptionalParameter the object representing the optional parameters to be set before calling this API - * @throws IllegalArgumentException thrown if parameters fail the validation - * @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."); - } - final String email = addOptionalParameter != null ? addOptionalParameter.email() : null; - - return addWithServiceResponseAsync(appId, email); - } - - /** - * Adds a user to the allowed list of users to access this LUIS application. Users are added using their email address. - * - * @param appId The application ID. - * @param email The email address of the user. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @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); - 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) { - try { - ServiceResponse clientResponse = addDelegate(response); - return Observable.just(clientResponse); - } catch (Throwable t) { - return Observable.error(t); - } - } - }); - } - - private ServiceResponse addDelegate(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); - } - - @Override - public PermissionsAddParameters add() { - return new PermissionsAddParameters(this); - } - - /** - * Internal class implementing PermissionsAddDefinition. - */ - class PermissionsAddParameters implements PermissionsAddDefinition { - private PermissionsImpl parent; - private UUID appId; - private String email; - - /** - * Constructor. - * @param parent the parent object. - */ - PermissionsAddParameters(PermissionsImpl parent) { - this.parent = parent; - } - - @Override - public PermissionsAddParameters withAppId(UUID appId) { - this.appId = appId; - return this; - } - - @Override - public PermissionsAddParameters withEmail(String email) { - this.email = email; - return this; - } - - @Override - public OperationStatus execute() { - return addWithServiceResponseAsync(appId, email).toBlocking().single().body(); - } - - @Override - public Observable executeAsync() { - return addWithServiceResponseAsync(appId, email).map(new Func1, OperationStatus>() { - @Override - public OperationStatus call(ServiceResponse response) { - return response.body(); - } - }); - } - } - - - /** - * Removes a user from the allowed list of users to access this LUIS application. Users are removed using their email address. - * - * @param appId The application ID. - * @param deleteOptionalParameter the object representing the optional parameters to be set before calling this API - * @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 OperationStatus object if successful. - */ - public OperationStatus delete(UUID appId, DeletePermissionsOptionalParameter deleteOptionalParameter) { - return deleteWithServiceResponseAsync(appId, deleteOptionalParameter).toBlocking().single().body(); - } - - /** - * Removes a user from the allowed list of users to access this LUIS application. Users are removed using their email address. - * - * @param appId The application ID. - * @param deleteOptionalParameter the object representing the optional parameters to be set before calling this API - * @param serviceCallback 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(UUID appId, DeletePermissionsOptionalParameter deleteOptionalParameter, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(appId, deleteOptionalParameter), serviceCallback); - } - - /** - * Removes a user from the allowed list of users to access this LUIS application. Users are removed using their email address. - * - * @param appId The application ID. - * @param deleteOptionalParameter the object representing the optional parameters to be set before calling this API - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the OperationStatus object - */ - public Observable deleteAsync(UUID appId, DeletePermissionsOptionalParameter deleteOptionalParameter) { - return deleteWithServiceResponseAsync(appId, deleteOptionalParameter).map(new Func1, OperationStatus>() { - @Override - public OperationStatus call(ServiceResponse response) { - return response.body(); - } - }); - } - - /** - * Removes a user from the allowed list of users to access this LUIS application. Users are removed using their email address. - * - * @param appId The application ID. - * @param deleteOptionalParameter the object representing the optional parameters to be set before calling this API - * @throws IllegalArgumentException thrown if parameters fail the validation - * @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."); - } - final String email = deleteOptionalParameter != null ? deleteOptionalParameter.email() : null; - - return deleteWithServiceResponseAsync(appId, email); - } - - /** - * Removes a user from the allowed list of users to access this LUIS application. Users are removed using their email address. - * - * @param appId The application ID. - * @param email The email address of the user. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @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); - 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) { - 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); - } - - @Override - public PermissionsDeleteParameters delete() { - return new PermissionsDeleteParameters(this); - } - - /** - * Internal class implementing PermissionsDeleteDefinition. - */ - class PermissionsDeleteParameters implements PermissionsDeleteDefinition { - private PermissionsImpl parent; - private UUID appId; - private String email; - - /** - * Constructor. - * @param parent the parent object. - */ - PermissionsDeleteParameters(PermissionsImpl parent) { - this.parent = parent; - } - - @Override - public PermissionsDeleteParameters withAppId(UUID appId) { - this.appId = appId; - return this; - } - - @Override - public PermissionsDeleteParameters withEmail(String email) { - this.email = email; - return this; - } - - @Override - public OperationStatus execute() { - return deleteWithServiceResponseAsync(appId, email).toBlocking().single().body(); - } - - @Override - public Observable executeAsync() { - return deleteWithServiceResponseAsync(appId, email).map(new Func1, OperationStatus>() { - @Override - public OperationStatus call(ServiceResponse response) { - return response.body(); - } - }); - } - } - - - /** - * Replaces the current user access list with the new list sent in the body. If an empty list is sent, all access to other users will be removed. - * - * @param appId The application ID. - * @param updateOptionalParameter the object representing the optional parameters to be set before calling this API - * @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 OperationStatus object if successful. - */ - public OperationStatus update(UUID appId, UpdatePermissionsOptionalParameter updateOptionalParameter) { - return updateWithServiceResponseAsync(appId, updateOptionalParameter).toBlocking().single().body(); - } - - /** - * Replaces the current user access list with the new list sent in the body. If an empty list is sent, all access to other users will be removed. - * - * @param appId The application ID. - * @param updateOptionalParameter the object representing the optional parameters to be set before calling this API - * @param serviceCallback 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(UUID appId, UpdatePermissionsOptionalParameter updateOptionalParameter, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(updateWithServiceResponseAsync(appId, updateOptionalParameter), serviceCallback); - } - - /** - * Replaces the current user access list with the new list sent in the body. If an empty list is sent, all access to other users will be removed. - * - * @param appId The application ID. - * @param updateOptionalParameter the object representing the optional parameters to be set before calling this API - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the OperationStatus object - */ - public Observable updateAsync(UUID appId, UpdatePermissionsOptionalParameter updateOptionalParameter) { - return updateWithServiceResponseAsync(appId, updateOptionalParameter).map(new Func1, OperationStatus>() { - @Override - public OperationStatus call(ServiceResponse response) { - return response.body(); - } - }); - } - - /** - * Replaces the current user access list with the new list sent in the body. If an empty list is sent, all access to other users will be removed. - * - * @param appId The application ID. - * @param updateOptionalParameter the object representing the optional parameters to be set before calling this API - * @throws IllegalArgumentException thrown if parameters fail the validation - * @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."); - } - final List emails = updateOptionalParameter != null ? updateOptionalParameter.emails() : null; - - return updateWithServiceResponseAsync(appId, emails); - } - - /** - * Replaces the current user access list with the new list sent in the body. If an empty list is sent, all access to other users will be removed. - * - * @param appId The application ID. - * @param emails The email address of the users. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @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); - 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) { - 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); - } - - @Override - public PermissionsUpdateParameters update() { - return new PermissionsUpdateParameters(this); - } - - /** - * Internal class implementing PermissionsUpdateDefinition. - */ - class PermissionsUpdateParameters implements PermissionsUpdateDefinition { - private PermissionsImpl parent; - private UUID appId; - private List emails; - - /** - * Constructor. - * @param parent the parent object. - */ - PermissionsUpdateParameters(PermissionsImpl parent) { - this.parent = parent; - } - - @Override - public PermissionsUpdateParameters withAppId(UUID appId) { - this.appId = appId; - return this; - } - - @Override - public PermissionsUpdateParameters withEmails(List emails) { - this.emails = emails; - return this; - } - - @Override - public OperationStatus execute() { - return updateWithServiceResponseAsync(appId, emails).toBlocking().single().body(); - } - - @Override - public Observable executeAsync() { - return updateWithServiceResponseAsync(appId, emails).map(new Func1, OperationStatus>() { - @Override - public OperationStatus call(ServiceResponse response) { - return response.body(); - } - }); - } - } - -} diff --git a/sdk/cognitiveservices/ms-azure-cs-luis-authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/VersionsImpl.java b/sdk/cognitiveservices/ms-azure-cs-luis-authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/VersionsImpl.java index 75f64839b1beb..40510311294bc 100644 --- a/sdk/cognitiveservices/ms-azure-cs-luis-authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/VersionsImpl.java +++ b/sdk/cognitiveservices/ms-azure-cs-luis-authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/VersionsImpl.java @@ -12,12 +12,16 @@ import com.microsoft.azure.cognitiveservices.language.luis.authoring.models.ListVersionsOptionalParameter; import com.microsoft.azure.cognitiveservices.language.luis.authoring.models.UpdateVersionsOptionalParameter; import com.microsoft.azure.cognitiveservices.language.luis.authoring.models.ImportMethodVersionsOptionalParameter; +import com.microsoft.azure.cognitiveservices.language.luis.authoring.models.ImportV2AppVersionsOptionalParameter; +import com.microsoft.azure.cognitiveservices.language.luis.authoring.models.ImportLuFormatVersionsOptionalParameter; 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.CloudException; import com.microsoft.azure.cognitiveservices.language.luis.authoring.models.ErrorResponseException; import com.microsoft.azure.cognitiveservices.language.luis.authoring.models.LuisApp; +import com.microsoft.azure.cognitiveservices.language.luis.authoring.models.LuisAppV2; import com.microsoft.azure.cognitiveservices.language.luis.authoring.models.OperationStatus; import com.microsoft.azure.cognitiveservices.language.luis.authoring.models.TaskUpdateObject; import com.microsoft.azure.cognitiveservices.language.luis.authoring.models.VersionInfo; @@ -25,6 +29,7 @@ import com.microsoft.rest.ServiceFuture; import com.microsoft.rest.ServiceResponse; import com.microsoft.rest.Validator; +import java.io.InputStream; import java.io.IOException; import java.util.List; import java.util.UUID; @@ -38,6 +43,7 @@ import retrofit2.http.POST; import retrofit2.http.PUT; import retrofit2.http.Query; +import retrofit2.http.Streaming; import retrofit2.Response; import rx.functions.Func1; import rx.Observable; @@ -100,6 +106,19 @@ interface VersionsService { @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("x-ms-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 importV2App" }) + @POST("apps/{appId}/versions/import") + Observable> importV2App(@Path("appId") UUID appId, @Query("versionId") String versionId, @Body LuisAppV2 luisAppV2, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: text/plain", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.language.luis.authoring.Versions importLuFormat" }) + @POST("apps/{appId}/versions/import") + Observable> importLuFormat(@Path("appId") UUID appId, @Query("versionId") String versionId, @Body String luisAppLu, @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 exportLuFormat" }) + @GET("apps/{appId}/versions/{versionId}/export") + @Streaming + Observable> exportLuFormat(@Path("appId") UUID appId, @Path("versionId") String versionId, @Query("format") String format, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + } @@ -1118,4 +1137,429 @@ private ServiceResponse deleteUnlabelledUtteranceDelegate(Respo .build(response); } + + /** + * Imports a new version into a LUIS application. + * + * @param appId The application ID. + * @param luisAppV2 A LUIS application structure. + * @param importV2AppOptionalParameter the object representing the optional parameters to be set before calling this API + * @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 String object if successful. + */ + public String importV2App(UUID appId, LuisAppV2 luisAppV2, ImportV2AppVersionsOptionalParameter importV2AppOptionalParameter) { + return importV2AppWithServiceResponseAsync(appId, luisAppV2, importV2AppOptionalParameter).toBlocking().single().body(); + } + + /** + * Imports a new version into a LUIS application. + * + * @param appId The application ID. + * @param luisAppV2 A LUIS application structure. + * @param importV2AppOptionalParameter the object representing the optional parameters to be set before calling this API + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture importV2AppAsync(UUID appId, LuisAppV2 luisAppV2, ImportV2AppVersionsOptionalParameter importV2AppOptionalParameter, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(importV2AppWithServiceResponseAsync(appId, luisAppV2, importV2AppOptionalParameter), serviceCallback); + } + + /** + * Imports a new version into a LUIS application. + * + * @param appId The application ID. + * @param luisAppV2 A LUIS application structure. + * @param importV2AppOptionalParameter the object representing the optional parameters to be set before calling this API + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the String object + */ + public Observable importV2AppAsync(UUID appId, LuisAppV2 luisAppV2, ImportV2AppVersionsOptionalParameter importV2AppOptionalParameter) { + return importV2AppWithServiceResponseAsync(appId, luisAppV2, importV2AppOptionalParameter).map(new Func1, String>() { + @Override + public String call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Imports a new version into a LUIS application. + * + * @param appId The application ID. + * @param luisAppV2 A LUIS application structure. + * @param importV2AppOptionalParameter the object representing the optional parameters to be set before calling this API + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the String object + */ + public Observable> importV2AppWithServiceResponseAsync(UUID appId, LuisAppV2 luisAppV2, ImportV2AppVersionsOptionalParameter importV2AppOptionalParameter) { + 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 (luisAppV2 == null) { + throw new IllegalArgumentException("Parameter luisAppV2 is required and cannot be null."); + } + Validator.validate(luisAppV2); + final String versionId = importV2AppOptionalParameter != null ? importV2AppOptionalParameter.versionId() : null; + + return importV2AppWithServiceResponseAsync(appId, luisAppV2, versionId); + } + + /** + * Imports a new version into a LUIS application. + * + * @param appId The application ID. + * @param luisAppV2 A LUIS application structure. + * @param versionId The new versionId to import. If not specified, the versionId will be read from the imported object. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the String object + */ + public Observable> importV2AppWithServiceResponseAsync(UUID appId, LuisAppV2 luisAppV2, 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 (luisAppV2 == null) { + throw new IllegalArgumentException("Parameter luisAppV2 is required and cannot be null."); + } + Validator.validate(luisAppV2); + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); + return service.importV2App(appId, versionId, luisAppV2, this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = importV2AppDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse importV2AppDelegate(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); + } + + @Override + public VersionsImportV2AppParameters importV2App() { + return new VersionsImportV2AppParameters(this); + } + + /** + * Internal class implementing VersionsImportV2AppDefinition. + */ + class VersionsImportV2AppParameters implements VersionsImportV2AppDefinition { + private VersionsImpl parent; + private UUID appId; + private LuisAppV2 luisAppV2; + private String versionId; + + /** + * Constructor. + * @param parent the parent object. + */ + VersionsImportV2AppParameters(VersionsImpl parent) { + this.parent = parent; + } + + @Override + public VersionsImportV2AppParameters withAppId(UUID appId) { + this.appId = appId; + return this; + } + + @Override + public VersionsImportV2AppParameters withLuisAppV2(LuisAppV2 luisAppV2) { + this.luisAppV2 = luisAppV2; + return this; + } + + @Override + public VersionsImportV2AppParameters withVersionId(String versionId) { + this.versionId = versionId; + return this; + } + + @Override + public String execute() { + return importV2AppWithServiceResponseAsync(appId, luisAppV2, versionId).toBlocking().single().body(); + } + + @Override + public Observable executeAsync() { + return importV2AppWithServiceResponseAsync(appId, luisAppV2, versionId).map(new Func1, String>() { + @Override + public String call(ServiceResponse response) { + return response.body(); + } + }); + } + } + + + /** + * Imports a new version into a LUIS application. + * + * @param appId The application ID. + * @param luisAppLu An LU representing the LUIS application structure. + * @param importLuFormatOptionalParameter the object representing the optional parameters to be set before calling this API + * @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 String object if successful. + */ + public String importLuFormat(UUID appId, String luisAppLu, ImportLuFormatVersionsOptionalParameter importLuFormatOptionalParameter) { + return importLuFormatWithServiceResponseAsync(appId, luisAppLu, importLuFormatOptionalParameter).toBlocking().single().body(); + } + + /** + * Imports a new version into a LUIS application. + * + * @param appId The application ID. + * @param luisAppLu An LU representing the LUIS application structure. + * @param importLuFormatOptionalParameter the object representing the optional parameters to be set before calling this API + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture importLuFormatAsync(UUID appId, String luisAppLu, ImportLuFormatVersionsOptionalParameter importLuFormatOptionalParameter, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(importLuFormatWithServiceResponseAsync(appId, luisAppLu, importLuFormatOptionalParameter), serviceCallback); + } + + /** + * Imports a new version into a LUIS application. + * + * @param appId The application ID. + * @param luisAppLu An LU representing the LUIS application structure. + * @param importLuFormatOptionalParameter the object representing the optional parameters to be set before calling this API + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the String object + */ + public Observable importLuFormatAsync(UUID appId, String luisAppLu, ImportLuFormatVersionsOptionalParameter importLuFormatOptionalParameter) { + return importLuFormatWithServiceResponseAsync(appId, luisAppLu, importLuFormatOptionalParameter).map(new Func1, String>() { + @Override + public String call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Imports a new version into a LUIS application. + * + * @param appId The application ID. + * @param luisAppLu An LU representing the LUIS application structure. + * @param importLuFormatOptionalParameter the object representing the optional parameters to be set before calling this API + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the String object + */ + public Observable> importLuFormatWithServiceResponseAsync(UUID appId, String luisAppLu, ImportLuFormatVersionsOptionalParameter importLuFormatOptionalParameter) { + 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 (luisAppLu == null) { + throw new IllegalArgumentException("Parameter luisAppLu is required and cannot be null."); + } + final String versionId = importLuFormatOptionalParameter != null ? importLuFormatOptionalParameter.versionId() : null; + + return importLuFormatWithServiceResponseAsync(appId, luisAppLu, versionId); + } + + /** + * Imports a new version into a LUIS application. + * + * @param appId The application ID. + * @param luisAppLu An LU representing the LUIS application structure. + * @param versionId The new versionId to import. If not specified, the versionId will be read from the imported object. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the String object + */ + public Observable> importLuFormatWithServiceResponseAsync(UUID appId, String luisAppLu, 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 (luisAppLu == null) { + throw new IllegalArgumentException("Parameter luisAppLu is required and cannot be null."); + } + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); + return service.importLuFormat(appId, versionId, luisAppLu, this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = importLuFormatDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse importLuFormatDelegate(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); + } + + @Override + public VersionsImportLuFormatParameters importLuFormat() { + return new VersionsImportLuFormatParameters(this); + } + + /** + * Internal class implementing VersionsImportLuFormatDefinition. + */ + class VersionsImportLuFormatParameters implements VersionsImportLuFormatDefinition { + private VersionsImpl parent; + private UUID appId; + private String luisAppLu; + private String versionId; + + /** + * Constructor. + * @param parent the parent object. + */ + VersionsImportLuFormatParameters(VersionsImpl parent) { + this.parent = parent; + } + + @Override + public VersionsImportLuFormatParameters withAppId(UUID appId) { + this.appId = appId; + return this; + } + + @Override + public VersionsImportLuFormatParameters withLuisAppLu(String luisAppLu) { + this.luisAppLu = luisAppLu; + return this; + } + + @Override + public VersionsImportLuFormatParameters withVersionId(String versionId) { + this.versionId = versionId; + return this; + } + + @Override + public String execute() { + return importLuFormatWithServiceResponseAsync(appId, luisAppLu, versionId).toBlocking().single().body(); + } + + @Override + public Observable executeAsync() { + return importLuFormatWithServiceResponseAsync(appId, luisAppLu, versionId).map(new Func1, String>() { + @Override + public String call(ServiceResponse response) { + return response.body(); + } + }); + } + } + + /** + * Exports a LUIS application to text format. + * + * @param appId The application ID. + * @param versionId The version 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 InputStream object if successful. + */ + public InputStream exportLuFormat(UUID appId, String versionId) { + return exportLuFormatWithServiceResponseAsync(appId, versionId).toBlocking().single().body(); + } + + /** + * Exports a LUIS application to text format. + * + * @param appId The application ID. + * @param versionId The version 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 exportLuFormatAsync(UUID appId, String versionId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(exportLuFormatWithServiceResponseAsync(appId, versionId), serviceCallback); + } + + /** + * Exports a LUIS application to text format. + * + * @param appId The application ID. + * @param versionId The version ID. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the InputStream object + */ + public Observable exportLuFormatAsync(UUID appId, String versionId) { + return exportLuFormatWithServiceResponseAsync(appId, versionId).map(new Func1, InputStream>() { + @Override + public InputStream call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Exports a LUIS application to text format. + * + * @param appId The application ID. + * @param versionId The version ID. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the InputStream object + */ + public Observable> exportLuFormatWithServiceResponseAsync(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."); + } + final String format = "lu"; + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); + return service.exportLuFormat(appId, versionId, format, this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = exportLuFormatDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse exportLuFormatDelegate(Response 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/sdk/cognitiveservices/ms-azure-cs-luis-authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/models/AddExamplesOptionalParameter.java b/sdk/cognitiveservices/ms-azure-cs-luis-authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/models/AddExamplesOptionalParameter.java new file mode 100644 index 0000000000000..9aea3c7e774d6 --- /dev/null +++ b/sdk/cognitiveservices/ms-azure-cs-luis-authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/models/AddExamplesOptionalParameter.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.cognitiveservices.language.luis.authoring.models; + + +/** + * The AddExamplesOptionalParameter model. + */ +public class AddExamplesOptionalParameter { + /** + * Toggles nested/flat format. + */ + private Boolean enableNestedChildren; + + /** + * Gets or sets the preferred language for the response. + */ + private String thisclientacceptLanguage; + + /** + * Get the enableNestedChildren value. + * + * @return the enableNestedChildren value + */ + public Boolean enableNestedChildren() { + return this.enableNestedChildren; + } + + /** + * Set the enableNestedChildren value. + * + * @param enableNestedChildren the enableNestedChildren value to set + * @return the AddExamplesOptionalParameter object itself. + */ + public AddExamplesOptionalParameter withEnableNestedChildren(Boolean enableNestedChildren) { + this.enableNestedChildren = enableNestedChildren; + return this; + } + + /** + * Get the thisclientacceptLanguage value. + * + * @return the thisclientacceptLanguage value + */ + public String thisclientacceptLanguage() { + return this.thisclientacceptLanguage; + } + + /** + * Set the thisclientacceptLanguage value. + * + * @param thisclientacceptLanguage the thisclientacceptLanguage value to set + * @return the AddExamplesOptionalParameter object itself. + */ + public AddExamplesOptionalParameter withThisclientacceptLanguage(String thisclientacceptLanguage) { + this.thisclientacceptLanguage = thisclientacceptLanguage; + return this; + } + +} diff --git a/sdk/cognitiveservices/ms-azure-cs-luis-authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/models/AssignToAppOptionalParameter.java b/sdk/cognitiveservices/ms-azure-cs-luis-authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/models/AssignToAppOptionalParameter.java index 0a897c13e56d3..048d66a78154b 100644 --- a/sdk/cognitiveservices/ms-azure-cs-luis-authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/models/AssignToAppOptionalParameter.java +++ b/sdk/cognitiveservices/ms-azure-cs-luis-authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/models/AssignToAppOptionalParameter.java @@ -13,6 +13,12 @@ * The AssignToAppOptionalParameter model. */ public class AssignToAppOptionalParameter { + /** + * The custom arm token header to use; containing the user's ARM token used + * to validate azure accounts information. + */ + private String armToken; + /** * The Azure account information object. */ @@ -23,6 +29,26 @@ public class AssignToAppOptionalParameter { */ private String thisclientacceptLanguage; + /** + * Get the armToken value. + * + * @return the armToken value + */ + public String armToken() { + return this.armToken; + } + + /** + * Set the armToken value. + * + * @param armToken the armToken value to set + * @return the AssignToAppOptionalParameter object itself. + */ + public AssignToAppOptionalParameter withArmToken(String armToken) { + this.armToken = armToken; + return this; + } + /** * Get the azureAccountInfoObject value. * diff --git a/sdk/cognitiveservices/ms-azure-cs-luis-authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/models/AddPermissionsOptionalParameter.java b/sdk/cognitiveservices/ms-azure-cs-luis-authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/models/BatchOptionalParameter.java similarity index 55% rename from sdk/cognitiveservices/ms-azure-cs-luis-authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/models/AddPermissionsOptionalParameter.java rename to sdk/cognitiveservices/ms-azure-cs-luis-authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/models/BatchOptionalParameter.java index 0424a87d774df..b32a010ad6818 100644 --- a/sdk/cognitiveservices/ms-azure-cs-luis-authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/models/AddPermissionsOptionalParameter.java +++ b/sdk/cognitiveservices/ms-azure-cs-luis-authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/models/BatchOptionalParameter.java @@ -10,13 +10,13 @@ /** - * The AddPermissionsOptionalParameter model. + * The BatchOptionalParameter model. */ -public class AddPermissionsOptionalParameter { +public class BatchOptionalParameter { /** - * The email address of the user. + * Toggles nested/flat format. */ - private String email; + private Boolean enableNestedChildren; /** * Gets or sets the preferred language for the response. @@ -24,22 +24,22 @@ public class AddPermissionsOptionalParameter { private String thisclientacceptLanguage; /** - * Get the email value. + * Get the enableNestedChildren value. * - * @return the email value + * @return the enableNestedChildren value */ - public String email() { - return this.email; + public Boolean enableNestedChildren() { + return this.enableNestedChildren; } /** - * Set the email value. + * Set the enableNestedChildren value. * - * @param email the email value to set - * @return the AddPermissionsOptionalParameter object itself. + * @param enableNestedChildren the enableNestedChildren value to set + * @return the BatchOptionalParameter object itself. */ - public AddPermissionsOptionalParameter withEmail(String email) { - this.email = email; + public BatchOptionalParameter withEnableNestedChildren(Boolean enableNestedChildren) { + this.enableNestedChildren = enableNestedChildren; return this; } @@ -56,9 +56,9 @@ public String thisclientacceptLanguage() { * Set the thisclientacceptLanguage value. * * @param thisclientacceptLanguage the thisclientacceptLanguage value to set - * @return the AddPermissionsOptionalParameter object itself. + * @return the BatchOptionalParameter object itself. */ - public AddPermissionsOptionalParameter withThisclientacceptLanguage(String thisclientacceptLanguage) { + public BatchOptionalParameter withThisclientacceptLanguage(String thisclientacceptLanguage) { this.thisclientacceptLanguage = thisclientacceptLanguage; return this; } diff --git a/sdk/cognitiveservices/ms-azure-cs-luis-authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/models/EntityLabel.java b/sdk/cognitiveservices/ms-azure-cs-luis-authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/models/EntityLabel.java index 0306e6e3f98db..9b90a977d2738 100644 --- a/sdk/cognitiveservices/ms-azure-cs-luis-authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/models/EntityLabel.java +++ b/sdk/cognitiveservices/ms-azure-cs-luis-authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/models/EntityLabel.java @@ -9,6 +9,7 @@ package com.microsoft.azure.cognitiveservices.language.luis.authoring.models; import java.util.UUID; +import java.util.List; import com.fasterxml.jackson.annotation.JsonProperty; /** @@ -46,6 +47,12 @@ public class EntityLabel { @JsonProperty(value = "roleId") private UUID roleId; + /** + * The children property. + */ + @JsonProperty(value = "children") + private List children; + /** * Get the entityName value. * @@ -146,4 +153,24 @@ public EntityLabel withRoleId(UUID roleId) { return this; } + /** + * Get the children value. + * + * @return the children value + */ + public List children() { + return this.children; + } + + /** + * Set the children value. + * + * @param children the children value to set + * @return the EntityLabel object itself. + */ + public EntityLabel withChildren(List children) { + this.children = children; + return this; + } + } diff --git a/sdk/cognitiveservices/ms-azure-cs-luis-authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/models/EntityLabelObject.java b/sdk/cognitiveservices/ms-azure-cs-luis-authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/models/EntityLabelObject.java index 53852d97ebb5b..32446cae013ac 100644 --- a/sdk/cognitiveservices/ms-azure-cs-luis-authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/models/EntityLabelObject.java +++ b/sdk/cognitiveservices/ms-azure-cs-luis-authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/models/EntityLabelObject.java @@ -8,6 +8,7 @@ package com.microsoft.azure.cognitiveservices.language.luis.authoring.models; +import java.util.List; import com.fasterxml.jackson.annotation.JsonProperty; /** @@ -39,6 +40,12 @@ public class EntityLabelObject { @JsonProperty(value = "role") private String role; + /** + * The identified entities within the example utterance. + */ + @JsonProperty(value = "children") + private List children; + /** * Get the entityName value. * @@ -119,4 +126,24 @@ public EntityLabelObject withRole(String role) { return this; } + /** + * Get the children value. + * + * @return the children value + */ + public List children() { + return this.children; + } + + /** + * Set the children value. + * + * @param children the children value to set + * @return the EntityLabelObject object itself. + */ + public EntityLabelObject withChildren(List children) { + this.children = children; + return this; + } + } diff --git a/sdk/cognitiveservices/ms-azure-cs-luis-authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/models/EntityPrediction.java b/sdk/cognitiveservices/ms-azure-cs-luis-authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/models/EntityPrediction.java index d88e2626d282a..7360dabf7cf26 100644 --- a/sdk/cognitiveservices/ms-azure-cs-luis-authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/models/EntityPrediction.java +++ b/sdk/cognitiveservices/ms-azure-cs-luis-authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/models/EntityPrediction.java @@ -8,6 +8,7 @@ package com.microsoft.azure.cognitiveservices.language.luis.authoring.models; +import java.util.List; import com.fasterxml.jackson.annotation.JsonProperty; /** @@ -38,6 +39,12 @@ public class EntityPrediction { @JsonProperty(value = "phrase", required = true) private String phrase; + /** + * The children property. + */ + @JsonProperty(value = "children") + private List children; + /** * Get the entityName value. * @@ -118,4 +125,24 @@ public EntityPrediction withPhrase(String phrase) { return this; } + /** + * Get the children value. + * + * @return the children value + */ + public List children() { + return this.children; + } + + /** + * Set the children value. + * + * @param children the children value to set + * @return the EntityPrediction object itself. + */ + public EntityPrediction withChildren(List children) { + this.children = children; + return this; + } + } diff --git a/sdk/cognitiveservices/ms-azure-cs-luis-authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/models/UpdatePermissionsOptionalParameter.java b/sdk/cognitiveservices/ms-azure-cs-luis-authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/models/GetAssignedOptionalParameter.java similarity index 56% rename from sdk/cognitiveservices/ms-azure-cs-luis-authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/models/UpdatePermissionsOptionalParameter.java rename to sdk/cognitiveservices/ms-azure-cs-luis-authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/models/GetAssignedOptionalParameter.java index 7a4fb63113a46..30b764ce239e0 100644 --- a/sdk/cognitiveservices/ms-azure-cs-luis-authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/models/UpdatePermissionsOptionalParameter.java +++ b/sdk/cognitiveservices/ms-azure-cs-luis-authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/models/GetAssignedOptionalParameter.java @@ -8,16 +8,16 @@ package com.microsoft.azure.cognitiveservices.language.luis.authoring.models; -import java.util.List; /** - * The UpdatePermissionsOptionalParameter model. + * The GetAssignedOptionalParameter model. */ -public class UpdatePermissionsOptionalParameter { +public class GetAssignedOptionalParameter { /** - * The email address of the users. + * The custom arm token header to use; containing the user's ARM token used + * to validate azure accounts information. */ - private List emails; + private String armToken; /** * Gets or sets the preferred language for the response. @@ -25,22 +25,22 @@ public class UpdatePermissionsOptionalParameter { private String thisclientacceptLanguage; /** - * Get the emails value. + * Get the armToken value. * - * @return the emails value + * @return the armToken value */ - public List emails() { - return this.emails; + public String armToken() { + return this.armToken; } /** - * Set the emails value. + * Set the armToken value. * - * @param emails the emails value to set - * @return the UpdatePermissionsOptionalParameter object itself. + * @param armToken the armToken value to set + * @return the GetAssignedOptionalParameter object itself. */ - public UpdatePermissionsOptionalParameter withEmails(List emails) { - this.emails = emails; + public GetAssignedOptionalParameter withArmToken(String armToken) { + this.armToken = armToken; return this; } @@ -57,9 +57,9 @@ public String thisclientacceptLanguage() { * Set the thisclientacceptLanguage value. * * @param thisclientacceptLanguage the thisclientacceptLanguage value to set - * @return the UpdatePermissionsOptionalParameter object itself. + * @return the GetAssignedOptionalParameter object itself. */ - public UpdatePermissionsOptionalParameter withThisclientacceptLanguage(String thisclientacceptLanguage) { + public GetAssignedOptionalParameter withThisclientacceptLanguage(String thisclientacceptLanguage) { this.thisclientacceptLanguage = thisclientacceptLanguage; return this; } diff --git a/sdk/cognitiveservices/ms-azure-cs-luis-authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/models/HierarchicalModelV2.java b/sdk/cognitiveservices/ms-azure-cs-luis-authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/models/HierarchicalModelV2.java new file mode 100644 index 0000000000000..86801aefa0697 --- /dev/null +++ b/sdk/cognitiveservices/ms-azure-cs-luis-authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/models/HierarchicalModelV2.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.cognitiveservices.language.luis.authoring.models; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The HierarchicalModelV2 model. + */ +public class HierarchicalModelV2 { + /** + * The name property. + */ + @JsonProperty(value = "name") + private String name; + + /** + * The children property. + */ + @JsonProperty(value = "children") + private List children; + + /** + * The inherits property. + */ + @JsonProperty(value = "inherits") + private PrebuiltDomainObject inherits; + + /** + * The roles property. + */ + @JsonProperty(value = "roles") + private List roles; + + /** + * 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 HierarchicalModelV2 object itself. + */ + public HierarchicalModelV2 withName(String name) { + this.name = name; + return this; + } + + /** + * Get the children value. + * + * @return the children value + */ + public List children() { + return this.children; + } + + /** + * Set the children value. + * + * @param children the children value to set + * @return the HierarchicalModelV2 object itself. + */ + public HierarchicalModelV2 withChildren(List children) { + this.children = children; + return this; + } + + /** + * Get the inherits value. + * + * @return the inherits value + */ + public PrebuiltDomainObject inherits() { + return this.inherits; + } + + /** + * Set the inherits value. + * + * @param inherits the inherits value to set + * @return the HierarchicalModelV2 object itself. + */ + public HierarchicalModelV2 withInherits(PrebuiltDomainObject inherits) { + this.inherits = inherits; + return this; + } + + /** + * Get the roles value. + * + * @return the roles value + */ + public List roles() { + return this.roles; + } + + /** + * Set the roles value. + * + * @param roles the roles value to set + * @return the HierarchicalModelV2 object itself. + */ + public HierarchicalModelV2 withRoles(List roles) { + this.roles = roles; + return this; + } + +} diff --git a/sdk/cognitiveservices/ms-azure-cs-luis-authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/models/ImportLuFormatAppsOptionalParameter.java b/sdk/cognitiveservices/ms-azure-cs-luis-authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/models/ImportLuFormatAppsOptionalParameter.java new file mode 100644 index 0000000000000..de74298124b9f --- /dev/null +++ b/sdk/cognitiveservices/ms-azure-cs-luis-authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/models/ImportLuFormatAppsOptionalParameter.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.cognitiveservices.language.luis.authoring.models; + + +/** + * The ImportLuFormatAppsOptionalParameter model. + */ +public class ImportLuFormatAppsOptionalParameter { + /** + * The application name to create. If not specified, the application name + * will be read from the imported object. If the application name already + * exists, an error is returned. + */ + private String appName; + + /** + * Gets or sets the preferred language for the response. + */ + private String thisclientacceptLanguage; + + /** + * Get the appName value. + * + * @return the appName value + */ + public String appName() { + return this.appName; + } + + /** + * Set the appName value. + * + * @param appName the appName value to set + * @return the ImportLuFormatAppsOptionalParameter object itself. + */ + public ImportLuFormatAppsOptionalParameter withAppName(String appName) { + this.appName = appName; + return this; + } + + /** + * Get the thisclientacceptLanguage value. + * + * @return the thisclientacceptLanguage value + */ + public String thisclientacceptLanguage() { + return this.thisclientacceptLanguage; + } + + /** + * Set the thisclientacceptLanguage value. + * + * @param thisclientacceptLanguage the thisclientacceptLanguage value to set + * @return the ImportLuFormatAppsOptionalParameter object itself. + */ + public ImportLuFormatAppsOptionalParameter withThisclientacceptLanguage(String thisclientacceptLanguage) { + this.thisclientacceptLanguage = thisclientacceptLanguage; + return this; + } + +} diff --git a/sdk/cognitiveservices/ms-azure-cs-luis-authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/models/ImportLuFormatVersionsOptionalParameter.java b/sdk/cognitiveservices/ms-azure-cs-luis-authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/models/ImportLuFormatVersionsOptionalParameter.java new file mode 100644 index 0000000000000..e25d263e94ac0 --- /dev/null +++ b/sdk/cognitiveservices/ms-azure-cs-luis-authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/models/ImportLuFormatVersionsOptionalParameter.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.cognitiveservices.language.luis.authoring.models; + + +/** + * The ImportLuFormatVersionsOptionalParameter model. + */ +public class ImportLuFormatVersionsOptionalParameter { + /** + * The new versionId to import. If not specified, the versionId will be + * read from the imported object. + */ + private String versionId; + + /** + * Gets or sets the preferred language for the response. + */ + private String thisclientacceptLanguage; + + /** + * Get the versionId value. + * + * @return the versionId value + */ + public String versionId() { + return this.versionId; + } + + /** + * Set the versionId value. + * + * @param versionId the versionId value to set + * @return the ImportLuFormatVersionsOptionalParameter object itself. + */ + public ImportLuFormatVersionsOptionalParameter withVersionId(String versionId) { + this.versionId = versionId; + return this; + } + + /** + * Get the thisclientacceptLanguage value. + * + * @return the thisclientacceptLanguage value + */ + public String thisclientacceptLanguage() { + return this.thisclientacceptLanguage; + } + + /** + * Set the thisclientacceptLanguage value. + * + * @param thisclientacceptLanguage the thisclientacceptLanguage value to set + * @return the ImportLuFormatVersionsOptionalParameter object itself. + */ + public ImportLuFormatVersionsOptionalParameter withThisclientacceptLanguage(String thisclientacceptLanguage) { + this.thisclientacceptLanguage = thisclientacceptLanguage; + return this; + } + +} diff --git a/sdk/cognitiveservices/ms-azure-cs-luis-authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/models/ImportV2AppAppsOptionalParameter.java b/sdk/cognitiveservices/ms-azure-cs-luis-authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/models/ImportV2AppAppsOptionalParameter.java new file mode 100644 index 0000000000000..193d8f73abeef --- /dev/null +++ b/sdk/cognitiveservices/ms-azure-cs-luis-authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/models/ImportV2AppAppsOptionalParameter.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.cognitiveservices.language.luis.authoring.models; + + +/** + * The ImportV2AppAppsOptionalParameter model. + */ +public class ImportV2AppAppsOptionalParameter { + /** + * The application name to create. If not specified, the application name + * will be read from the imported object. If the application name already + * exists, an error is returned. + */ + private String appName; + + /** + * Gets or sets the preferred language for the response. + */ + private String thisclientacceptLanguage; + + /** + * Get the appName value. + * + * @return the appName value + */ + public String appName() { + return this.appName; + } + + /** + * Set the appName value. + * + * @param appName the appName value to set + * @return the ImportV2AppAppsOptionalParameter object itself. + */ + public ImportV2AppAppsOptionalParameter withAppName(String appName) { + this.appName = appName; + return this; + } + + /** + * Get the thisclientacceptLanguage value. + * + * @return the thisclientacceptLanguage value + */ + public String thisclientacceptLanguage() { + return this.thisclientacceptLanguage; + } + + /** + * Set the thisclientacceptLanguage value. + * + * @param thisclientacceptLanguage the thisclientacceptLanguage value to set + * @return the ImportV2AppAppsOptionalParameter object itself. + */ + public ImportV2AppAppsOptionalParameter withThisclientacceptLanguage(String thisclientacceptLanguage) { + this.thisclientacceptLanguage = thisclientacceptLanguage; + return this; + } + +} diff --git a/sdk/cognitiveservices/ms-azure-cs-luis-authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/models/DeletePermissionsOptionalParameter.java b/sdk/cognitiveservices/ms-azure-cs-luis-authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/models/ImportV2AppVersionsOptionalParameter.java similarity index 54% rename from sdk/cognitiveservices/ms-azure-cs-luis-authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/models/DeletePermissionsOptionalParameter.java rename to sdk/cognitiveservices/ms-azure-cs-luis-authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/models/ImportV2AppVersionsOptionalParameter.java index 0c466af99c86f..d951d710d40f4 100644 --- a/sdk/cognitiveservices/ms-azure-cs-luis-authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/models/DeletePermissionsOptionalParameter.java +++ b/sdk/cognitiveservices/ms-azure-cs-luis-authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/models/ImportV2AppVersionsOptionalParameter.java @@ -10,13 +10,14 @@ /** - * The DeletePermissionsOptionalParameter model. + * The ImportV2AppVersionsOptionalParameter model. */ -public class DeletePermissionsOptionalParameter { +public class ImportV2AppVersionsOptionalParameter { /** - * The email address of the user. + * The new versionId to import. If not specified, the versionId will be + * read from the imported object. */ - private String email; + private String versionId; /** * Gets or sets the preferred language for the response. @@ -24,22 +25,22 @@ public class DeletePermissionsOptionalParameter { private String thisclientacceptLanguage; /** - * Get the email value. + * Get the versionId value. * - * @return the email value + * @return the versionId value */ - public String email() { - return this.email; + public String versionId() { + return this.versionId; } /** - * Set the email value. + * Set the versionId value. * - * @param email the email value to set - * @return the DeletePermissionsOptionalParameter object itself. + * @param versionId the versionId value to set + * @return the ImportV2AppVersionsOptionalParameter object itself. */ - public DeletePermissionsOptionalParameter withEmail(String email) { - this.email = email; + public ImportV2AppVersionsOptionalParameter withVersionId(String versionId) { + this.versionId = versionId; return this; } @@ -56,9 +57,9 @@ public String thisclientacceptLanguage() { * Set the thisclientacceptLanguage value. * * @param thisclientacceptLanguage the thisclientacceptLanguage value to set - * @return the DeletePermissionsOptionalParameter object itself. + * @return the ImportV2AppVersionsOptionalParameter object itself. */ - public DeletePermissionsOptionalParameter withThisclientacceptLanguage(String thisclientacceptLanguage) { + public ImportV2AppVersionsOptionalParameter withThisclientacceptLanguage(String thisclientacceptLanguage) { this.thisclientacceptLanguage = thisclientacceptLanguage; return this; } diff --git a/sdk/cognitiveservices/ms-azure-cs-luis-authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/models/JSONEntity.java b/sdk/cognitiveservices/ms-azure-cs-luis-authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/models/JSONEntity.java index 94f41e21444ab..bbe7c98a226d9 100644 --- a/sdk/cognitiveservices/ms-azure-cs-luis-authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/models/JSONEntity.java +++ b/sdk/cognitiveservices/ms-azure-cs-luis-authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/models/JSONEntity.java @@ -8,6 +8,7 @@ package com.microsoft.azure.cognitiveservices.language.luis.authoring.models; +import java.util.List; import com.fasterxml.jackson.annotation.JsonProperty; /** @@ -38,6 +39,12 @@ public class JSONEntity { @JsonProperty(value = "role") private String role; + /** + * The children property. + */ + @JsonProperty(value = "children") + private List children; + /** * Get the startPos value. * @@ -118,4 +125,24 @@ public JSONEntity withRole(String role) { return this; } + /** + * Get the children value. + * + * @return the children value + */ + public List children() { + return this.children; + } + + /** + * Set the children value. + * + * @param children the children value to set + * @return the JSONEntity object itself. + */ + public JSONEntity withChildren(List children) { + this.children = children; + return this; + } + } diff --git a/sdk/cognitiveservices/ms-azure-cs-luis-authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/models/ListEntitySuggestionsOptionalParameter.java b/sdk/cognitiveservices/ms-azure-cs-luis-authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/models/ListEntitySuggestionsOptionalParameter.java index e8126e840eca2..795ff6e131c7b 100644 --- a/sdk/cognitiveservices/ms-azure-cs-luis-authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/models/ListEntitySuggestionsOptionalParameter.java +++ b/sdk/cognitiveservices/ms-azure-cs-luis-authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/models/ListEntitySuggestionsOptionalParameter.java @@ -19,6 +19,11 @@ public class ListEntitySuggestionsOptionalParameter { */ private Integer take; + /** + * Toggles nested/flat format. + */ + private Boolean enableNestedChildren; + /** * Gets or sets the preferred language for the response. */ @@ -44,6 +49,26 @@ public ListEntitySuggestionsOptionalParameter withTake(Integer take) { return this; } + /** + * Get the enableNestedChildren value. + * + * @return the enableNestedChildren value + */ + public Boolean enableNestedChildren() { + return this.enableNestedChildren; + } + + /** + * Set the enableNestedChildren value. + * + * @param enableNestedChildren the enableNestedChildren value to set + * @return the ListEntitySuggestionsOptionalParameter object itself. + */ + public ListEntitySuggestionsOptionalParameter withEnableNestedChildren(Boolean enableNestedChildren) { + this.enableNestedChildren = enableNestedChildren; + return this; + } + /** * Get the thisclientacceptLanguage value. * diff --git a/sdk/cognitiveservices/ms-azure-cs-luis-authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/models/ListExamplesOptionalParameter.java b/sdk/cognitiveservices/ms-azure-cs-luis-authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/models/ListExamplesOptionalParameter.java index 202dbe85aef66..0ecc5c9fd9afb 100644 --- a/sdk/cognitiveservices/ms-azure-cs-luis-authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/models/ListExamplesOptionalParameter.java +++ b/sdk/cognitiveservices/ms-azure-cs-luis-authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/models/ListExamplesOptionalParameter.java @@ -24,6 +24,11 @@ public class ListExamplesOptionalParameter { */ private Integer take; + /** + * Toggles nested/flat format. + */ + private Boolean enableNestedChildren; + /** * Gets or sets the preferred language for the response. */ @@ -69,6 +74,26 @@ public ListExamplesOptionalParameter withTake(Integer take) { return this; } + /** + * Get the enableNestedChildren value. + * + * @return the enableNestedChildren value + */ + public Boolean enableNestedChildren() { + return this.enableNestedChildren; + } + + /** + * Set the enableNestedChildren value. + * + * @param enableNestedChildren the enableNestedChildren value to set + * @return the ListExamplesOptionalParameter object itself. + */ + public ListExamplesOptionalParameter withEnableNestedChildren(Boolean enableNestedChildren) { + this.enableNestedChildren = enableNestedChildren; + return this; + } + /** * Get the thisclientacceptLanguage value. * diff --git a/sdk/cognitiveservices/ms-azure-cs-luis-authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/models/ListIntentSuggestionsOptionalParameter.java b/sdk/cognitiveservices/ms-azure-cs-luis-authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/models/ListIntentSuggestionsOptionalParameter.java index 5dd0e48b31b34..7521bf193604e 100644 --- a/sdk/cognitiveservices/ms-azure-cs-luis-authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/models/ListIntentSuggestionsOptionalParameter.java +++ b/sdk/cognitiveservices/ms-azure-cs-luis-authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/models/ListIntentSuggestionsOptionalParameter.java @@ -19,6 +19,11 @@ public class ListIntentSuggestionsOptionalParameter { */ private Integer take; + /** + * Toggles nested/flat format. + */ + private Boolean enableNestedChildren; + /** * Gets or sets the preferred language for the response. */ @@ -44,6 +49,26 @@ public ListIntentSuggestionsOptionalParameter withTake(Integer take) { return this; } + /** + * Get the enableNestedChildren value. + * + * @return the enableNestedChildren value + */ + public Boolean enableNestedChildren() { + return this.enableNestedChildren; + } + + /** + * Set the enableNestedChildren value. + * + * @param enableNestedChildren the enableNestedChildren value to set + * @return the ListIntentSuggestionsOptionalParameter object itself. + */ + public ListIntentSuggestionsOptionalParameter withEnableNestedChildren(Boolean enableNestedChildren) { + this.enableNestedChildren = enableNestedChildren; + return this; + } + /** * Get the thisclientacceptLanguage value. * diff --git a/sdk/cognitiveservices/ms-azure-cs-luis-authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/models/ListUserLUISAccountsOptionalParameter.java b/sdk/cognitiveservices/ms-azure-cs-luis-authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/models/ListUserLUISAccountsOptionalParameter.java new file mode 100644 index 0000000000000..0a22a1785eac1 --- /dev/null +++ b/sdk/cognitiveservices/ms-azure-cs-luis-authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/models/ListUserLUISAccountsOptionalParameter.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.cognitiveservices.language.luis.authoring.models; + + +/** + * The ListUserLUISAccountsOptionalParameter model. + */ +public class ListUserLUISAccountsOptionalParameter { + /** + * The custom arm token header to use; containing the user's ARM token used + * to validate azure accounts information. + */ + private String armToken; + + /** + * Gets or sets the preferred language for the response. + */ + private String thisclientacceptLanguage; + + /** + * Get the armToken value. + * + * @return the armToken value + */ + public String armToken() { + return this.armToken; + } + + /** + * Set the armToken value. + * + * @param armToken the armToken value to set + * @return the ListUserLUISAccountsOptionalParameter object itself. + */ + public ListUserLUISAccountsOptionalParameter withArmToken(String armToken) { + this.armToken = armToken; + return this; + } + + /** + * Get the thisclientacceptLanguage value. + * + * @return the thisclientacceptLanguage value + */ + public String thisclientacceptLanguage() { + return this.thisclientacceptLanguage; + } + + /** + * Set the thisclientacceptLanguage value. + * + * @param thisclientacceptLanguage the thisclientacceptLanguage value to set + * @return the ListUserLUISAccountsOptionalParameter object itself. + */ + public ListUserLUISAccountsOptionalParameter withThisclientacceptLanguage(String thisclientacceptLanguage) { + this.thisclientacceptLanguage = thisclientacceptLanguage; + return this; + } + +} diff --git a/sdk/cognitiveservices/ms-azure-cs-luis-authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/models/LuisAppV2.java b/sdk/cognitiveservices/ms-azure-cs-luis-authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/models/LuisAppV2.java new file mode 100644 index 0000000000000..bfc090ad41e5e --- /dev/null +++ b/sdk/cognitiveservices/ms-azure-cs-luis-authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/models/LuisAppV2.java @@ -0,0 +1,460 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.cognitiveservices.language.luis.authoring.models; + +import java.util.Map; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Exported Model - An exported LUIS Application. + */ +public class LuisAppV2 { + /** + * Unmatched properties from the message are deserialized this collection. + */ + private Map additionalProperties; + + /** + * Luis schema deserialization version. + */ + @JsonProperty(value = "luis_schema_version") + private String luisSchemaVersion; + + /** + * The name of the application. + */ + @JsonProperty(value = "name") + private String name; + + /** + * The version ID of the application that was exported. + */ + @JsonProperty(value = "versionId") + private String versionId; + + /** + * The description of the application. + */ + @JsonProperty(value = "desc") + private String desc; + + /** + * The culture of the application. E.g.: en-us. + */ + @JsonProperty(value = "culture") + private String culture; + + /** + * List of intents. + */ + @JsonProperty(value = "intents") + private List intents; + + /** + * List of entities. + */ + @JsonProperty(value = "entities") + private List entities; + + /** + * List of list entities. + */ + @JsonProperty(value = "closedLists") + private List closedLists; + + /** + * List of composite entities. + */ + @JsonProperty(value = "composites") + private List composites; + + /** + * List of Pattern.Any entities. + */ + @JsonProperty(value = "patternAnyEntities") + private List patternAnyEntities; + + /** + * List of regular expression entities. + */ + @JsonProperty(value = "regex_entities") + private List regexEntities; + + /** + * List of prebuilt entities. + */ + @JsonProperty(value = "prebuiltEntities") + private List prebuiltEntities; + + /** + * List of pattern features. + */ + @JsonProperty(value = "regex_features") + private List regexFeatures; + + /** + * List of model features. + */ + @JsonProperty(value = "model_features") + private List modelFeatures; + + /** + * List of patterns. + */ + @JsonProperty(value = "patterns") + private List patterns; + + /** + * List of example utterances. + */ + @JsonProperty(value = "utterances") + private List utterances; + + /** + * Get the additionalProperties value. + * + * @return the additionalProperties value + */ + public Map additionalProperties() { + return this.additionalProperties; + } + + /** + * Set the additionalProperties value. + * + * @param additionalProperties the additionalProperties value to set + * @return the LuisAppV2 object itself. + */ + public LuisAppV2 withAdditionalProperties(Map additionalProperties) { + this.additionalProperties = additionalProperties; + return this; + } + + /** + * Get the luisSchemaVersion value. + * + * @return the luisSchemaVersion value + */ + public String luisSchemaVersion() { + return this.luisSchemaVersion; + } + + /** + * Set the luisSchemaVersion value. + * + * @param luisSchemaVersion the luisSchemaVersion value to set + * @return the LuisAppV2 object itself. + */ + public LuisAppV2 withLuisSchemaVersion(String luisSchemaVersion) { + this.luisSchemaVersion = luisSchemaVersion; + 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 LuisAppV2 object itself. + */ + public LuisAppV2 withName(String name) { + this.name = name; + return this; + } + + /** + * Get the versionId value. + * + * @return the versionId value + */ + public String versionId() { + return this.versionId; + } + + /** + * Set the versionId value. + * + * @param versionId the versionId value to set + * @return the LuisAppV2 object itself. + */ + public LuisAppV2 withVersionId(String versionId) { + this.versionId = versionId; + return this; + } + + /** + * Get the desc value. + * + * @return the desc value + */ + public String desc() { + return this.desc; + } + + /** + * Set the desc value. + * + * @param desc the desc value to set + * @return the LuisAppV2 object itself. + */ + public LuisAppV2 withDesc(String desc) { + this.desc = desc; + return this; + } + + /** + * Get the culture value. + * + * @return the culture value + */ + public String culture() { + return this.culture; + } + + /** + * Set the culture value. + * + * @param culture the culture value to set + * @return the LuisAppV2 object itself. + */ + public LuisAppV2 withCulture(String culture) { + this.culture = culture; + return this; + } + + /** + * Get the intents value. + * + * @return the intents value + */ + public List intents() { + return this.intents; + } + + /** + * Set the intents value. + * + * @param intents the intents value to set + * @return the LuisAppV2 object itself. + */ + public LuisAppV2 withIntents(List intents) { + this.intents = intents; + return this; + } + + /** + * Get the entities value. + * + * @return the entities value + */ + public List entities() { + return this.entities; + } + + /** + * Set the entities value. + * + * @param entities the entities value to set + * @return the LuisAppV2 object itself. + */ + public LuisAppV2 withEntities(List entities) { + this.entities = entities; + return this; + } + + /** + * Get the closedLists value. + * + * @return the closedLists value + */ + public List closedLists() { + return this.closedLists; + } + + /** + * Set the closedLists value. + * + * @param closedLists the closedLists value to set + * @return the LuisAppV2 object itself. + */ + public LuisAppV2 withClosedLists(List closedLists) { + this.closedLists = closedLists; + return this; + } + + /** + * Get the composites value. + * + * @return the composites value + */ + public List composites() { + return this.composites; + } + + /** + * Set the composites value. + * + * @param composites the composites value to set + * @return the LuisAppV2 object itself. + */ + public LuisAppV2 withComposites(List composites) { + this.composites = composites; + return this; + } + + /** + * Get the patternAnyEntities value. + * + * @return the patternAnyEntities value + */ + public List patternAnyEntities() { + return this.patternAnyEntities; + } + + /** + * Set the patternAnyEntities value. + * + * @param patternAnyEntities the patternAnyEntities value to set + * @return the LuisAppV2 object itself. + */ + public LuisAppV2 withPatternAnyEntities(List patternAnyEntities) { + this.patternAnyEntities = patternAnyEntities; + return this; + } + + /** + * Get the regexEntities value. + * + * @return the regexEntities value + */ + public List regexEntities() { + return this.regexEntities; + } + + /** + * Set the regexEntities value. + * + * @param regexEntities the regexEntities value to set + * @return the LuisAppV2 object itself. + */ + public LuisAppV2 withRegexEntities(List regexEntities) { + this.regexEntities = regexEntities; + return this; + } + + /** + * Get the prebuiltEntities value. + * + * @return the prebuiltEntities value + */ + public List prebuiltEntities() { + return this.prebuiltEntities; + } + + /** + * Set the prebuiltEntities value. + * + * @param prebuiltEntities the prebuiltEntities value to set + * @return the LuisAppV2 object itself. + */ + public LuisAppV2 withPrebuiltEntities(List prebuiltEntities) { + this.prebuiltEntities = prebuiltEntities; + return this; + } + + /** + * Get the regexFeatures value. + * + * @return the regexFeatures value + */ + public List regexFeatures() { + return this.regexFeatures; + } + + /** + * Set the regexFeatures value. + * + * @param regexFeatures the regexFeatures value to set + * @return the LuisAppV2 object itself. + */ + public LuisAppV2 withRegexFeatures(List regexFeatures) { + this.regexFeatures = regexFeatures; + return this; + } + + /** + * Get the modelFeatures value. + * + * @return the modelFeatures value + */ + public List modelFeatures() { + return this.modelFeatures; + } + + /** + * Set the modelFeatures value. + * + * @param modelFeatures the modelFeatures value to set + * @return the LuisAppV2 object itself. + */ + public LuisAppV2 withModelFeatures(List modelFeatures) { + this.modelFeatures = modelFeatures; + return this; + } + + /** + * Get the patterns value. + * + * @return the patterns value + */ + public List patterns() { + return this.patterns; + } + + /** + * Set the patterns value. + * + * @param patterns the patterns value to set + * @return the LuisAppV2 object itself. + */ + public LuisAppV2 withPatterns(List patterns) { + this.patterns = patterns; + return this; + } + + /** + * Get the utterances value. + * + * @return the utterances value + */ + public List utterances() { + return this.utterances; + } + + /** + * Set the utterances value. + * + * @param utterances the utterances value to set + * @return the LuisAppV2 object itself. + */ + public LuisAppV2 withUtterances(List utterances) { + this.utterances = utterances; + return this; + } + +} diff --git a/sdk/cognitiveservices/ms-azure-cs-luis-authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/models/ModelFeatureInformation.java b/sdk/cognitiveservices/ms-azure-cs-luis-authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/models/ModelFeatureInformation.java index 89447db268aa8..ed83bcdc739b9 100644 --- a/sdk/cognitiveservices/ms-azure-cs-luis-authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/models/ModelFeatureInformation.java +++ b/sdk/cognitiveservices/ms-azure-cs-luis-authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/models/ModelFeatureInformation.java @@ -27,6 +27,12 @@ public class ModelFeatureInformation { @JsonProperty(value = "featureName") private String featureName; + /** + * The isRequired property. + */ + @JsonProperty(value = "isRequired") + private Boolean isRequired; + /** * Get the modelName value. * @@ -67,4 +73,24 @@ public ModelFeatureInformation withFeatureName(String featureName) { return this; } + /** + * Get the isRequired value. + * + * @return the isRequired value + */ + public Boolean isRequired() { + return this.isRequired; + } + + /** + * Set the isRequired value. + * + * @param isRequired the isRequired value to set + * @return the ModelFeatureInformation object itself. + */ + public ModelFeatureInformation withIsRequired(Boolean isRequired) { + this.isRequired = isRequired; + return this; + } + } diff --git a/sdk/cognitiveservices/ms-azure-cs-luis-authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/models/RemoveFromAppOptionalParameter.java b/sdk/cognitiveservices/ms-azure-cs-luis-authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/models/RemoveFromAppOptionalParameter.java index beedbe2d3b838..148846fa49769 100644 --- a/sdk/cognitiveservices/ms-azure-cs-luis-authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/models/RemoveFromAppOptionalParameter.java +++ b/sdk/cognitiveservices/ms-azure-cs-luis-authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/models/RemoveFromAppOptionalParameter.java @@ -13,6 +13,12 @@ * The RemoveFromAppOptionalParameter model. */ public class RemoveFromAppOptionalParameter { + /** + * The custom arm token header to use; containing the user's ARM token used + * to validate azure accounts information. + */ + private String armToken; + /** * The Azure account information object. */ @@ -23,6 +29,26 @@ public class RemoveFromAppOptionalParameter { */ private String thisclientacceptLanguage; + /** + * Get the armToken value. + * + * @return the armToken value + */ + public String armToken() { + return this.armToken; + } + + /** + * Set the armToken value. + * + * @param armToken the armToken value to set + * @return the RemoveFromAppOptionalParameter object itself. + */ + public RemoveFromAppOptionalParameter withArmToken(String armToken) { + this.armToken = armToken; + return this; + } + /** * Get the azureAccountInfoObject value. * From f794b2cf7b48584181e7da5f66ca7f0deb1a5ded Mon Sep 17 00:00:00 2001 From: Sameeksha Vaity Date: Thu, 2 Jul 2020 16:17:09 -0700 Subject: [PATCH 005/129] Update RecognizeOptions to take only optional params (#12625) --- .../azure-ai-formrecognizer/CHANGELOG.md | 2 +- .../azure-ai-formrecognizer/README.md | 28 +- .../FormRecognizerAsyncClient.java | 255 ++++++----- .../formrecognizer/FormRecognizerClient.java | 156 +++++-- .../models/RecognizeCustomFormsOptions.java | 81 ---- .../models/RecognizeOptions.java | 95 +--- .../AdvancedDiffLabeledUnlabeledData.java | 19 +- ...AdvancedDiffLabeledUnlabeledDataAsync.java | 17 +- ...ognizerAsyncClientJavaDocCodeSnippets.java | 430 +++++++++++------- ...rmRecognizerClientJavaDocCodeSnippets.java | 174 +++++-- .../ai/formrecognizer/GetBoundingBoxes.java | 6 +- .../formrecognizer/GetBoundingBoxesAsync.java | 6 +- .../ai/formrecognizer/ReadmeSamples.java | 7 +- .../ai/formrecognizer/RecognizeContent.java | 3 +- .../RecognizeCustomFormsAsync.java | 4 +- .../ai/formrecognizer/RecognizeReceipts.java | 3 +- .../RecognizeReceiptsAsync.java | 3 +- .../FormRecognizerAsyncClientTest.java | 208 +++++---- .../FormRecognizerClientTest.java | 222 ++++----- .../FormRecognizerClientTestBase.java | 30 +- .../FormTrainingAsyncClientTest.java | 7 +- .../FormTrainingClientTest.java | 4 +- ...mFormLabeledDataExcludeFieldElements.json} | 0 ...FormUnlabeledDataIncludeFieldElements.json | 164 +++++++ ...omFormUnlabeledDataIncludeTextDetails.json | 144 ------ ...rmUrlLabeledDataIncludeFieldElements.json} | 0 ...UrlUnlabeledDataIncludeFieldElements.json} | 0 ...ormUrlUnlabeledDataIncludeTextContent.json | 184 -------- ...gnizeReceiptDataIncludeFieldElements.json} | 0 ...zeReceiptFromUrlIncludeFieldElements.json} | 0 30 files changed, 1130 insertions(+), 1122 deletions(-) delete mode 100644 sdk/formrecognizer/azure-ai-formrecognizer/src/main/java/com/azure/ai/formrecognizer/models/RecognizeCustomFormsOptions.java rename sdk/formrecognizer/azure-ai-formrecognizer/src/test/resources/session-records/{recognizeCustomFormLabeledDataExcludeTextContent.json => recognizeCustomFormLabeledDataExcludeFieldElements.json} (100%) create mode 100644 sdk/formrecognizer/azure-ai-formrecognizer/src/test/resources/session-records/recognizeCustomFormUnlabeledDataIncludeFieldElements.json delete mode 100644 sdk/formrecognizer/azure-ai-formrecognizer/src/test/resources/session-records/recognizeCustomFormUnlabeledDataIncludeTextDetails.json rename sdk/formrecognizer/azure-ai-formrecognizer/src/test/resources/session-records/{recognizeCustomFormUrlLabeledDataIncludeTextContent.json => recognizeCustomFormUrlLabeledDataIncludeFieldElements.json} (100%) rename sdk/formrecognizer/azure-ai-formrecognizer/src/test/resources/session-records/{recognizeCustomFormUnlabeledDataIncludeTextContent.json => recognizeCustomFormUrlUnlabeledDataIncludeFieldElements.json} (100%) delete mode 100644 sdk/formrecognizer/azure-ai-formrecognizer/src/test/resources/session-records/recognizeCustomFormUrlUnlabeledDataIncludeTextContent.json rename sdk/formrecognizer/azure-ai-formrecognizer/src/test/resources/session-records/{recognizeReceiptDataTextDetails.json => recognizeReceiptDataIncludeFieldElements.json} (100%) rename sdk/formrecognizer/azure-ai-formrecognizer/src/test/resources/session-records/{recognizeReceiptFromUrlTextContent.json => recognizeReceiptFromUrlIncludeFieldElements.json} (100%) diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/CHANGELOG.md b/sdk/formrecognizer/azure-ai-formrecognizer/CHANGELOG.md index 4abe95988a933..162ff520b38fa 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/CHANGELOG.md +++ b/sdk/formrecognizer/azure-ai-formrecognizer/CHANGELOG.md @@ -9,7 +9,7 @@ - Throw `HttpResponseException` instead of `ErrorResponseException` to model service side exceptions `CustomFormModel` and `CustomFormModelInfo`. - Changed `CopyAuthorization.getExpiresOn()` to return a `OffsetDateTime` instead of a `long` value -- Added `RecognizeOptions` and `RecognizeCustomFormOptions` to pass configurable options when using recognize APIs on FormRecognizerClient. +- Added `RecognizeOptions` to pass configurable options when using recognize APIs on FormRecognizerClient. - Changed `submodels` property on `CustomFormModel` to return a `List` instead of `IterableStream` - Renamed `fieldMap` property to `fields` on `CustomFormSubmodel` model - Renamed `elements` property on model `FormTableCell` to `textContent` diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/README.md b/sdk/formrecognizer/azure-ai-formrecognizer/README.md index 41e36fcbba798..1ba2bd54919b9 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/README.md +++ b/sdk/formrecognizer/azure-ai-formrecognizer/README.md @@ -81,14 +81,14 @@ resource, or by running the following Azure CLI command to get the key from the az cognitiveservices account keys list --resource-group --name ``` Use the API key as the credential parameter to authenticate the client: - + ```java FormRecognizerClient formRecognizerClient = new FormRecognizerClientBuilder() .credential(new AzureKeyCredential("{key}")) .endpoint("{endpoint}") .buildClient(); ``` - + ```java FormTrainingClient formTrainingClient = new FormTrainingClientBuilder() .credential(new AzureKeyCredential("{key}")) @@ -98,7 +98,7 @@ FormTrainingClient formTrainingClient = new FormTrainingClientBuilder() The Azure Form Recognizer client library provides a way to **rotate the existing key**. - + ```java AzureKeyCredential credential = new AzureKeyCredential("{key}"); FormRecognizerClient formRecognizerClient = new FormRecognizerClientBuilder() @@ -137,7 +137,7 @@ Authorization is easiest using [DefaultAzureCredential][wiki_identity]. It finds running environment. For more information about using Azure Active Directory authorization with Form Recognizer, please refer to [the associated documentation][aad_authorization]. - + ```java TokenCredential credential = new DefaultAzureCredentialBuilder().build(); FormRecognizerClient formRecognizerClient = new FormRecognizerClientBuilder() @@ -195,7 +195,7 @@ The following section provides several code snippets covering some of the most c ### Recognize Forms Using a Custom Model Recognize name/value pairs and table data from forms. These models are trained with your own data, so they're tailored to your forms. You should only recognize forms of the same form type that the custom model was trained on. - + ```java String formUrl = "{form_url}"; String modelId = "{custom_trained_model_id}"; @@ -219,15 +219,15 @@ for (int i = 0; i < recognizedForms.size(); i++) { ### Recognize Content Recognize text and table structures, along with their bounding box coordinates, from documents. - + ```java // recognize form content using file input stream -File sourceFile = new File("local/file_path/filename.png"); -byte[] fileContent = Files.readAllBytes(sourceFile.toPath()); +File form = new File("local/file_path/filename.png"); +byte[] fileContent = Files.readAllBytes(form.toPath()); InputStream inputStream = new ByteArrayInputStream(fileContent); SyncPoller> recognizeContentPoller = - formRecognizerClient.beginRecognizeContent(inputStream, sourceFile.length(), FormContentType.IMAGE_PNG); + formRecognizerClient.beginRecognizeContent(inputStream, form.length()); List contentPageResults = recognizeContentPoller.getFinalResult(); @@ -252,7 +252,7 @@ for (int i = 0; i < contentPageResults.size(); i++) { ### Recognize receipts Recognize data from a USA sales receipts using a prebuilt model. [Here][service_recognize_receipt] are the fields the service returns for a recognized receipt. - + ```java String receiptUrl = "https://docs.microsoft.com/en-us/azure/cognitive-services/form-recognizer/media" + "/contoso-allinone.jpg"; @@ -307,7 +307,7 @@ for (int i = 0; i < receiptPageResults.size(); i++) { Train a machine-learned model on your own form type. The resulting model will be able to recognize values from the types of forms it was trained on. Provide a container SAS url to your Azure Storage Blob container where you're storing the training documents. See details on setting this up in the [service quickstart documentation][quickstart_training]. - + ```java String trainingFilesUrl = "{SAS-URL-of-your-container-in-blob-storage}"; SyncPoller trainingPoller = @@ -334,7 +334,7 @@ customFormModel.getSubmodels().forEach(customFormSubmodel -> { ### Manage your models Manage the custom models attached to your account. - + ```java AtomicReference modelId = new AtomicReference<>(); // First, we see how many custom models we have, and what our limit is @@ -376,7 +376,7 @@ to provide an invalid file source URL an `HttpResponseException` would be raised In the following code snippet, the error is handled gracefully by catching the exception and display the additional information about the error. - + ```java try { formRecognizerClient.beginRecognizeContentFromUrl("invalidSourceUrl"); @@ -414,7 +414,7 @@ These code samples show common scenario operations with the Azure Form Recognize #### Async APIs All the examples shown so far have been using synchronous APIs, but we provide full support for async APIs as well. You'll need to use `FormRecognizerAsyncClient` - + ```java FormRecognizerAsyncClient formRecognizerAsyncClient = new FormRecognizerClientBuilder() .credential(new AzureKeyCredential("{key}")) diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/src/main/java/com/azure/ai/formrecognizer/FormRecognizerAsyncClient.java b/sdk/formrecognizer/azure-ai-formrecognizer/src/main/java/com/azure/ai/formrecognizer/FormRecognizerAsyncClient.java index 569bb285f3468..6f35bf31af369 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/src/main/java/com/azure/ai/formrecognizer/FormRecognizerAsyncClient.java +++ b/sdk/formrecognizer/azure-ai-formrecognizer/src/main/java/com/azure/ai/formrecognizer/FormRecognizerAsyncClient.java @@ -14,7 +14,6 @@ import com.azure.ai.formrecognizer.models.FormPage; import com.azure.ai.formrecognizer.models.FormRecognizerException; import com.azure.ai.formrecognizer.models.OperationResult; -import com.azure.ai.formrecognizer.models.RecognizeCustomFormsOptions; import com.azure.ai.formrecognizer.models.RecognizeOptions; import com.azure.ai.formrecognizer.models.RecognizedForm; import com.azure.ai.formrecognizer.models.RecognizedReceipt; @@ -33,7 +32,6 @@ import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; -import java.io.InputStream; import java.nio.ByteBuffer; import java.util.List; import java.util.Objects; @@ -96,22 +94,40 @@ public final class FormRecognizerAsyncClient { @ServiceMethod(returns = ReturnType.COLLECTION) public PollerFlux> beginRecognizeCustomFormsFromUrl(String formUrl, String modelId) { - return beginRecognizeCustomFormsFromUrl(new RecognizeCustomFormsOptions(formUrl, modelId)); + return beginRecognizeCustomFormsFromUrl(formUrl, modelId, null); } - PollerFlux> - beginRecognizeCustomFormsFromUrl(RecognizeCustomFormsOptions recognizeCustomFormsOptions) { + /** + * Recognizes form data from documents using optical character recognition (OCR) and a custom trained + * model. + *

The service does not support cancellation of the long running operation and returns with an + * error message indicating absence of cancellation support.

+ * + *

Code sample

+ * {@codesnippet com.azure.ai.formrecognizer.FormRecognizerAsyncClient.beginRecognizeCustomFormsFromUrl#string-string-recognizeOptions} + * + * @param formUrl The source URL to the input form. + * @param modelId The UUID string format custom trained model Id to be used. + * @param recognizeOptions The additional configurable {@link RecognizeOptions options} that may be passed when + * recognizing custom form. + * + * @return A {@link PollerFlux} that polls the recognize custom form operation until it has completed, has failed, + * or has been cancelled. The completed operation returns a List of {@link RecognizedForm}. + * @throws FormRecognizerException If recognize operation fails and the {@link AnalyzeOperationResult} returned with + * an {@link OperationStatus#FAILED}. + * @throws NullPointerException If {@code formUrl}, {@code modelId} is {@code null}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PollerFlux> + beginRecognizeCustomFormsFromUrl(String formUrl, String modelId, RecognizeOptions recognizeOptions) { try { - Objects.requireNonNull(recognizeCustomFormsOptions, - "'recognizeCustomFormsOptions' is required and cannot be null."); - final String modelId = recognizeCustomFormsOptions.getModelId(); + recognizeOptions = getRecognizeOptionsProperties(recognizeOptions); return new PollerFlux>( - recognizeCustomFormsOptions.getPollInterval(), - analyzeFormActivationOperation(recognizeCustomFormsOptions.getFormUrl(), modelId, - recognizeCustomFormsOptions.isIncludeFieldElements()), + recognizeOptions.getPollInterval(), + analyzeFormActivationOperation(formUrl, modelId, recognizeOptions.isIncludeFieldElements()), createAnalyzeFormPollOperation(modelId), (activationResponse, context) -> Mono.error(new RuntimeException("Cancellation is not supported")), - fetchAnalyzeFormResultOperation(modelId, recognizeCustomFormsOptions.isIncludeFieldElements())); + fetchAnalyzeFormResultOperation(modelId, recognizeOptions.isIncludeFieldElements())); } catch (RuntimeException ex) { return PollerFlux.error(ex); } @@ -127,13 +143,11 @@ public final class FormRecognizerAsyncClient { * {@code Flux} must produce the same data each time it is subscribed to. * *

Code sample

- * {@codesnippet com.azure.ai.formrecognizer.FormRecognizerAsyncClient.beginRecognizeCustomForms#Flux-long-string-FormContentType} + * {@codesnippet com.azure.ai.formrecognizer.FormRecognizerAsyncClient.beginRecognizeCustomForms#Flux-long-string} * * @param form The data of the form to recognize form information from. * @param length The exact length of the data. * @param modelId The UUID string format custom trained model Id to be used. - * @param formContentType The type of the provided form. Supported Media types including .pdf, .jpg, .png or - * .tiff type file stream. Content-type is auto-detected and could be {@code null}. * * @return A {@link PollerFlux} that polls the recognize custom form operation until it has completed, has failed, * or has been cancelled. The completed operation returns a List of {@link RecognizedForm}. @@ -143,9 +157,8 @@ public final class FormRecognizerAsyncClient { */ @ServiceMethod(returns = ReturnType.COLLECTION) public PollerFlux> - beginRecognizeCustomForms(Flux form, long length, String modelId, FormContentType formContentType) { - return beginRecognizeCustomForms(new RecognizeCustomFormsOptions(form, length, modelId) - .setFormContentType(formContentType)); + beginRecognizeCustomForms(Flux form, long length, String modelId) { + return beginRecognizeCustomForms(form, length, modelId, null); } /** @@ -158,10 +171,13 @@ public final class FormRecognizerAsyncClient { * {@code Flux} must produce the same data each time it is subscribed to. * *

Code sample

- * {@codesnippet com.azure.ai.formrecognizer.FormRecognizerAsyncClient.beginRecognizeCustomForms#recognizeCustomFormsOptions} + * {@codesnippet com.azure.ai.formrecognizer.FormRecognizerAsyncClient.beginRecognizeCustomForms#Flux-long-string-recognizeOptions} * - * @param recognizeCustomFormsOptions The configurable {@code RecognizeCustomFormsOptions options} that may be - * passed when recognizing custom form. + * @param form The data of the form to recognize form information from. + * @param length The exact length of the data. + * @param modelId The UUID string format custom trained model Id to be used. + * @param recognizeOptions The additional configurable {@link RecognizeOptions options} that may be passed when + * recognizing custom form. * * @return A {@link PollerFlux} that polls the recognize custom form operation until it has completed, has failed, * or has been cancelled. The completed operation returns a List of {@link RecognizedForm}. @@ -171,24 +187,18 @@ public final class FormRecognizerAsyncClient { */ @ServiceMethod(returns = ReturnType.COLLECTION) public PollerFlux> - beginRecognizeCustomForms(RecognizeCustomFormsOptions recognizeCustomFormsOptions) { + beginRecognizeCustomForms(Flux form, long length, String modelId, + RecognizeOptions recognizeOptions) { try { - Objects.requireNonNull(recognizeCustomFormsOptions, - "'recognizeCustomFormsOptions' is required and cannot be null."); - if (recognizeCustomFormsOptions.getFormUrl() != null) { - return beginRecognizeCustomFormsFromUrl(recognizeCustomFormsOptions); - } - final String modelId = recognizeCustomFormsOptions.getModelId(); - Flux buffer = getByteBufferFlux(recognizeCustomFormsOptions.getForm(), - recognizeCustomFormsOptions.getFormData()); + recognizeOptions = getRecognizeOptionsProperties(recognizeOptions); return new PollerFlux>( - recognizeCustomFormsOptions.getPollInterval(), - analyzeFormStreamActivationOperation(buffer, modelId, - recognizeCustomFormsOptions.getLength(), recognizeCustomFormsOptions.getFormContentType(), - recognizeCustomFormsOptions.isIncludeFieldElements()), + recognizeOptions.getPollInterval(), + analyzeFormStreamActivationOperation(form, modelId, length, + recognizeOptions.getContentType(), + recognizeOptions.isIncludeFieldElements()), createAnalyzeFormPollOperation(modelId), (activationResponse, context) -> Mono.error(new RuntimeException("Cancellation is not supported")), - fetchAnalyzeFormResultOperation(modelId, recognizeCustomFormsOptions.isIncludeFieldElements())); + fetchAnalyzeFormResultOperation(modelId, recognizeOptions.isIncludeFieldElements())); } catch (RuntimeException ex) { return PollerFlux.error(ex); } @@ -212,19 +222,39 @@ public final class FormRecognizerAsyncClient { */ @ServiceMethod(returns = ReturnType.COLLECTION) public PollerFlux> beginRecognizeContentFromUrl(String formUrl) { - return beginRecognizeContentFromUrl(new RecognizeOptions(formUrl)); + return beginRecognizeContentFromUrl(formUrl, null); } - PollerFlux> - beginRecognizeContentFromUrl(RecognizeOptions recognizeOptions) { + /** + * Recognizes layout data from documents using optical character recognition (OCR) and a custom trained + * model. + *

The service does not support cancellation of the long running operation and returns with an + * error message indicating absence of cancellation support.

+ * + *

Code sample

+ * {@codesnippet com.azure.ai.formrecognizer.FormRecognizerAsyncClient.beginRecognizeContentFromUrl#string-recognizeOptions} + * + * @param formUrl The source URL to the input form. + * @param recognizeOptions The additional configurable {@link RecognizeOptions options} that may be passed when + * recognizing content/layout on a form. + * + * @return A {@link PollerFlux} that polls the recognized content/layout operation until it has completed, + * has failed, or has been cancelled. The completed operation returns a List of {@link FormPage}. + * @throws FormRecognizerException If recognize operation fails and the {@link AnalyzeOperationResult} returned with + * an {@link OperationStatus#FAILED}. + * @throws NullPointerException If {@code formUrl} is {@code null}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PollerFlux> + beginRecognizeContentFromUrl(String formUrl, RecognizeOptions recognizeOptions) { try { - Objects.requireNonNull(recognizeOptions, - "'recognizeOptions' is required and cannot be null."); - return new PollerFlux>(recognizeOptions.getPollInterval(), - contentAnalyzeActivationOperation(recognizeOptions.getFormUrl()), + recognizeOptions = getRecognizeOptionsProperties(recognizeOptions); + return new PollerFlux>( + recognizeOptions.getPollInterval(), + contentAnalyzeActivationOperation(formUrl), extractContentPollOperation(), - (activationResponse, context) -> monoError(logger, - new RuntimeException("Cancellation is not supported")), + (activationResponse, context) -> + monoError(logger, new RuntimeException("Cancellation is not supported")), fetchExtractContentResult()); } catch (RuntimeException ex) { return PollerFlux.error(ex); @@ -240,12 +270,10 @@ public PollerFlux> beginRecognizeContentFromUrl( * {@code Flux} must produce the same data each time it is subscribed to. * *

Code sample

- * {@codesnippet com.azure.ai.formrecognizer.FormRecognizerAsyncClient.beginRecognizeContent#Flux-long-FormContentType} + * {@codesnippet com.azure.ai.formrecognizer.FormRecognizerAsyncClient.beginRecognizeContent#Flux-long} * * @param form The data of the form to recognize content information from. * @param length The exact length of the data. - * @param formContentType The type of the provided form. Supported Media types including .pdf, .jpg, .png or - * .tiff type file stream. Content-type is auto-detected and could be {@code null}. * * @return A {@link PollerFlux} polls the recognize content operation until it has completed, has failed, or has * been cancelled. The completed operation returns a List of {@link FormPage}. @@ -255,8 +283,8 @@ public PollerFlux> beginRecognizeContentFromUrl( */ @ServiceMethod(returns = ReturnType.COLLECTION) public PollerFlux> beginRecognizeContent( - Flux form, long length, FormContentType formContentType) { - return beginRecognizeContent(new RecognizeOptions(form, length).setFormContentType(formContentType)); + Flux form, long length) { + return beginRecognizeContent(form, length, null); } /** @@ -268,10 +296,12 @@ public PollerFlux> beginRecognizeContent( * {@code Flux} must produce the same data each time it is subscribed to. * *

Code sample

- * {@codesnippet com.azure.ai.formrecognizer.FormRecognizerAsyncClient.beginRecognizeContent#recognizeOptions} + * {@codesnippet com.azure.ai.formrecognizer.FormRecognizerAsyncClient.beginRecognizeContent#Flux-long-recognizeOptions} * - * @param recognizeOptions The configurable {@code RecognizeOptions options} that may be passed when recognizing - * content on a form. + * @param form The data of the form to recognize content information from. + * @param length The exact length of the data. + * @param recognizeOptions The additional configurable {@link RecognizeOptions options} that may be passed when + * recognizing content/layout on a form. * * @return A {@link PollerFlux} polls the recognize content operation until it has completed, has failed, or has * been cancelled. The completed operation returns a List of {@link FormPage}. @@ -280,18 +310,13 @@ public PollerFlux> beginRecognizeContent( * @throws NullPointerException If {@code recognizeOptions} is {@code null}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PollerFlux> beginRecognizeContent(RecognizeOptions recognizeOptions) { + public PollerFlux> beginRecognizeContent(Flux form, long length, + RecognizeOptions recognizeOptions) { try { - Objects.requireNonNull(recognizeOptions, - "'recognizeOptions' is required and cannot be null."); - if (recognizeOptions.getFormUrl() != null) { - return beginRecognizeContentFromUrl(recognizeOptions); - } - Flux buffer = getByteBufferFlux(recognizeOptions.getForm(), recognizeOptions.getFormData()); + recognizeOptions = getRecognizeOptionsProperties(recognizeOptions); return new PollerFlux<>( recognizeOptions.getPollInterval(), - contentStreamActivationOperation(buffer, recognizeOptions.getLength(), - recognizeOptions.getFormContentType()), + contentStreamActivationOperation(form, length, recognizeOptions.getContentType()), extractContentPollOperation(), (activationResponse, context) -> monoError(logger, new RuntimeException("Cancellation is not supported")), @@ -322,17 +347,36 @@ public PollerFlux> beginRecognizeContent(Recogni @ServiceMethod(returns = ReturnType.COLLECTION) public PollerFlux> beginRecognizeReceiptsFromUrl(String receiptUrl) { - return beginRecognizeReceiptsFromUrl(new RecognizeOptions(receiptUrl)); + return beginRecognizeReceiptsFromUrl(receiptUrl, null); } - PollerFlux> - beginRecognizeReceiptsFromUrl(RecognizeOptions recognizeOptions) { + /** + * Recognizes receipt data using optical character recognition (OCR) and a prebuilt receipt trained + * model. + *

The service does not support cancellation of the long running operation and returns with an + * error message indicating absence of cancellation support.

+ * + *

Code sample

+ * {@codesnippet com.azure.ai.formrecognizer.FormRecognizerAsyncClient.beginRecognizeReceiptsFromUrl#string-recognizeOptions} + * + * @param receiptUrl The source URL to the input receipt. + * @param recognizeOptions The additional configurable {@link RecognizeOptions options} that may be passed when + * analyzing a receipt. + * + * @return A {@link PollerFlux} that polls the recognize receipt operation until it has completed, has failed, + * or has been cancelled. The completed operation returns a List of {@link RecognizedReceipt}. + * @throws FormRecognizerException If recognize operation fails and the {@link AnalyzeOperationResult} returned with + * an {@link OperationStatus#FAILED}. + * @throws NullPointerException If {@code receiptUrl} is {@code null}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PollerFlux> + beginRecognizeReceiptsFromUrl(String receiptUrl, RecognizeOptions recognizeOptions) { try { - Objects.requireNonNull(recognizeOptions, - "'recognizeOptions' is required and cannot be null."); - return new PollerFlux>(recognizeOptions.getPollInterval(), - receiptAnalyzeActivationOperation(recognizeOptions.getFormUrl(), - recognizeOptions.isIncludeFieldElements()), + recognizeOptions = getRecognizeOptionsProperties(recognizeOptions); + return new PollerFlux>( + recognizeOptions.getPollInterval(), + receiptAnalyzeActivationOperation(receiptUrl, recognizeOptions.isIncludeFieldElements()), extractReceiptPollOperation(), (activationResponse, context) -> monoError(logger, new RuntimeException("Cancellation is not supported")), @@ -353,12 +397,10 @@ public PollerFlux> beginRecognizeContent(Recogni * {@code Flux} must produce the same data each time it is subscribed to. * *

Code sample

- * {@codesnippet com.azure.ai.formrecognizer.FormRecognizerAsyncClient.beginRecognizeReceipts#Flux-long-FormContentType} + * {@codesnippet com.azure.ai.formrecognizer.FormRecognizerAsyncClient.beginRecognizeReceipts#Flux-long} * - * @param receipt The data/stream of the document to recognize receipt information from. + * @param receipt The data of the document to recognize receipt information from. * @param length The exact length of the data. - * @param formContentType The type of the provided form. Supported Media types including .pdf, .jpg, .png or - * .tiff type file stream. Content-type is auto-detected and could be {@code null}. * * @return A {@link PollerFlux} that polls the recognize receipt operation until it has completed, has failed, * or has been cancelled. The completed operation returns a List of {@link RecognizedReceipt}. @@ -368,8 +410,8 @@ public PollerFlux> beginRecognizeContent(Recogni */ @ServiceMethod(returns = ReturnType.COLLECTION) public PollerFlux> beginRecognizeReceipts( - Flux receipt, long length, FormContentType formContentType) { - return beginRecognizeReceipts(new RecognizeOptions(receipt, length).setFormContentType(formContentType)); + Flux receipt, long length) { + return beginRecognizeReceipts(receipt, length, null); } /** @@ -383,10 +425,12 @@ public PollerFlux> beginRecognizeReceip * {@code Flux} must produce the same data each time it is subscribed to. * *

Code sample

- * {@codesnippet com.azure.ai.formrecognizer.FormRecognizerAsyncClient.beginRecognizeReceipts#recognizeOptions} + * {@codesnippet com.azure.ai.formrecognizer.FormRecognizerAsyncClient.beginRecognizeReceipts#Flux-long-recognizeOptions} * - * @param recognizeOptions The configurable {@code RecognizeOptions options} that may be passed when recognizing - * receipt data on the provided receipt document. + * @param receipt The data of the document to recognize receipt information from. + * @param length The exact length of the data. + * @param recognizeOptions The additional configurable {@link RecognizeOptions options} that may be passed when + * analyzing a receipt. * * @return A {@link PollerFlux} that polls the recognize receipt operation until it has completed, has failed, * or has been cancelled. The completed operation returns a List of {@link RecognizedReceipt}. @@ -396,18 +440,13 @@ public PollerFlux> beginRecognizeReceip */ @ServiceMethod(returns = ReturnType.COLLECTION) public PollerFlux> - beginRecognizeReceipts(RecognizeOptions recognizeOptions) { + beginRecognizeReceipts(Flux receipt, long length, RecognizeOptions recognizeOptions) { try { - Objects.requireNonNull(recognizeOptions, - "'recognizeOptions' is required and cannot be null."); - if (recognizeOptions.getFormUrl() != null) { - return beginRecognizeReceiptsFromUrl(recognizeOptions); - } - Flux buffer = getByteBufferFlux(recognizeOptions.getForm(), recognizeOptions.getFormData()); + recognizeOptions = getRecognizeOptionsProperties(recognizeOptions); return new PollerFlux<>( recognizeOptions.getPollInterval(), - receiptStreamActivationOperation(buffer, recognizeOptions.getLength(), - recognizeOptions.getFormContentType(), recognizeOptions.isIncludeFieldElements()), + receiptStreamActivationOperation(receipt, length, + recognizeOptions.getContentType(), recognizeOptions.isIncludeFieldElements()), extractReceiptPollOperation(), (activationResponse, context) -> monoError(logger, new RuntimeException("Cancellation is not supported")), @@ -434,20 +473,20 @@ private Function, Mono> receipt } private Function, Mono> receiptStreamActivationOperation( - Flux form, long length, FormContentType formContentType, boolean includeFieldElements) { + Flux form, long length, FormContentType contentType, boolean includeFieldElements) { return pollingContext -> { try { Objects.requireNonNull(form, "'form' is required and cannot be null."); - if (formContentType != null) { + if (contentType != null) { return service.analyzeReceiptAsyncWithResponseAsync( - ContentType.fromString(formContentType.toString()), form, length, includeFieldElements) + ContentType.fromString(contentType.toString()), form, length, includeFieldElements) .map(response -> new OperationResult( parseModelId(response.getDeserializedHeaders().getOperationLocation()))) .onErrorMap(throwable -> throwable); } else { return detectContentType(form) - .flatMap(contentType -> - service.analyzeReceiptAsyncWithResponseAsync(contentType, form, length, + .flatMap(detectedContentType -> + service.analyzeReceiptAsyncWithResponseAsync(detectedContentType, form, length, includeFieldElements) .map(response -> new OperationResult( parseModelId(response.getDeserializedHeaders().getOperationLocation())))) @@ -508,20 +547,20 @@ private Function, Mono> content } private Function, Mono> contentStreamActivationOperation( - Flux form, long length, FormContentType formContentType) { + Flux form, long length, FormContentType contentType) { return pollingContext -> { try { Objects.requireNonNull(form, "'form' is required and cannot be null."); - if (formContentType != null) { + if (contentType != null) { return service.analyzeLayoutAsyncWithResponseAsync( - ContentType.fromString(formContentType.toString()), form, length) + ContentType.fromString(contentType.toString()), form, length) .map(response -> new OperationResult(parseModelId( response.getDeserializedHeaders().getOperationLocation()))) .onErrorMap(Utility::mapToHttpResponseExceptionIfExist); } else { return detectContentType(form) - .flatMap(contentType -> - service.analyzeLayoutAsyncWithResponseAsync(contentType, form, length) + .flatMap(detectedContentType -> + service.analyzeLayoutAsyncWithResponseAsync(detectedContentType, form, length) .map(response -> new OperationResult( parseModelId(response.getDeserializedHeaders().getOperationLocation())))) .onErrorMap(Utility::mapToHttpResponseExceptionIfExist); @@ -638,24 +677,24 @@ private Function, Mono> analyze } private Function, Mono> analyzeFormStreamActivationOperation( - Flux form, String modelId, long length, FormContentType formContentType, + Flux form, String modelId, long length, FormContentType contentType, boolean includeFieldElements) { return pollingContext -> { try { Objects.requireNonNull(form, "'form' is required and cannot be null."); Objects.requireNonNull(modelId, "'modelId' is required and cannot be null."); - if (formContentType != null) { + if (contentType != null) { return service.analyzeWithCustomModelWithResponseAsync(UUID.fromString(modelId), - ContentType.fromString(formContentType.toString()), form, length, includeFieldElements) + ContentType.fromString(contentType.toString()), form, length, includeFieldElements) .map(response -> new OperationResult(parseModelId( response.getDeserializedHeaders().getOperationLocation()))) .onErrorMap(Utility::mapToHttpResponseExceptionIfExist); } else { return detectContentType(form) - .flatMap(contentType -> - service.analyzeWithCustomModelWithResponseAsync(UUID.fromString(modelId), contentType, form, - length, includeFieldElements) + .flatMap(detectedContentType -> + service.analyzeWithCustomModelWithResponseAsync(UUID.fromString(modelId), + detectedContentType, form, length, includeFieldElements) .map(response -> new OperationResult( parseModelId(response.getDeserializedHeaders().getOperationLocation())))) .onErrorMap(Utility::mapToHttpResponseExceptionIfExist); @@ -689,13 +728,11 @@ private static Mono> processAnalyzeModelResponse( return Mono.just(new PollResponse<>(status, operationResultPollResponse.getValue())); } - private static Flux getByteBufferFlux(InputStream form, Flux formData) { - Flux buffer; - if (form != null) { - buffer = Utility.toFluxByteBuffer(form); + private RecognizeOptions getRecognizeOptionsProperties(RecognizeOptions userProvidedOptions) { + if (userProvidedOptions != null) { + return userProvidedOptions; } else { - buffer = formData; + return new RecognizeOptions(); } - return buffer; } } diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/src/main/java/com/azure/ai/formrecognizer/FormRecognizerClient.java b/sdk/formrecognizer/azure-ai-formrecognizer/src/main/java/com/azure/ai/formrecognizer/FormRecognizerClient.java index 6e0254f7be9e0..2d0fcb6f8d425 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/src/main/java/com/azure/ai/formrecognizer/FormRecognizerClient.java +++ b/sdk/formrecognizer/azure-ai-formrecognizer/src/main/java/com/azure/ai/formrecognizer/FormRecognizerClient.java @@ -3,13 +3,12 @@ package com.azure.ai.formrecognizer; +import com.azure.ai.formrecognizer.implementation.Utility; import com.azure.ai.formrecognizer.implementation.models.AnalyzeOperationResult; import com.azure.ai.formrecognizer.implementation.models.OperationStatus; -import com.azure.ai.formrecognizer.models.FormContentType; import com.azure.ai.formrecognizer.models.FormPage; import com.azure.ai.formrecognizer.models.FormRecognizerException; import com.azure.ai.formrecognizer.models.OperationResult; -import com.azure.ai.formrecognizer.models.RecognizeCustomFormsOptions; import com.azure.ai.formrecognizer.models.RecognizeOptions; import com.azure.ai.formrecognizer.models.RecognizedForm; import com.azure.ai.formrecognizer.models.RecognizedReceipt; @@ -17,8 +16,10 @@ import com.azure.core.annotation.ServiceClient; import com.azure.core.annotation.ServiceMethod; import com.azure.core.util.polling.SyncPoller; +import reactor.core.publisher.Flux; import java.io.InputStream; +import java.nio.ByteBuffer; import java.util.List; /** @@ -66,8 +67,33 @@ public final class FormRecognizerClient { @ServiceMethod(returns = ReturnType.COLLECTION) public SyncPoller> beginRecognizeCustomFormsFromUrl(String formUrl, String modelId) { - return client.beginRecognizeCustomFormsFromUrl(new RecognizeCustomFormsOptions(formUrl, modelId)) - .getSyncPoller(); + return beginRecognizeCustomFormsFromUrl(formUrl, modelId, null); + } + + /** + * Recognizes receipt data from documents using optical character recognition (OCR) + * and a custom trained model. + *

The service does not support cancellation of the long running operation and returns with an + * error message indicating absence of cancellation support

+ * + *

Code sample

+ * {@codesnippet com.azure.ai.formrecognizer.FormRecognizerClient.beginRecognizeCustomFormsFromUrl#string-string-recognizeOptions} + * + * @param formUrl The source URL to the input form. + * @param modelId The UUID string format custom trained model Id to be used. + * @param recognizeOptions The additional configurable {@link RecognizeOptions options} that may be passed when + * recognizing custom form. + * + * @return A {@link SyncPoller} to poll the progress of the recognize custom form operation until it has completed, + * has failed, or has been cancelled. The completed operation returns a List of {@link RecognizedForm}. + * @throws FormRecognizerException If recognize operation fails and the {@link AnalyzeOperationResult} returned with + * an {@link OperationStatus#FAILED}. + * @throws NullPointerException If {@code formUrl}, {@code modelId} is {@code null}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public SyncPoller> + beginRecognizeCustomFormsFromUrl(String formUrl, String modelId, RecognizeOptions recognizeOptions) { + return client.beginRecognizeCustomFormsFromUrl(formUrl, modelId, recognizeOptions).getSyncPoller(); } /** @@ -77,13 +103,11 @@ public final class FormRecognizerClient { * error message indicating absence of cancellation support.

* *

Code sample

- * {@codesnippet com.azure.ai.formrecognizer.FormRecognizerClient.beginRecognizeCustomForms#InputStream-long-string-FormContentType} + * {@codesnippet com.azure.ai.formrecognizer.FormRecognizerClient.beginRecognizeCustomForms#InputStream-long-string} * * @param form The data of the form to recognize form information from. * @param length The exact length of the data. * @param modelId The UUID string format custom trained model Id to be used. - * @param formContentType The media type of the provided form. Supported Media types including .pdf, .jpg, .png or - * .tiff type file stream. Content-type is auto-detected and could be {@code null}. * * @return A {@link SyncPoller} that polls the recognize custom form operation until it has completed, * has failed, or has been cancelled. The completed operation returns a List of {@link RecognizedForm}. @@ -93,9 +117,8 @@ public final class FormRecognizerClient { */ @ServiceMethod(returns = ReturnType.COLLECTION) public SyncPoller> - beginRecognizeCustomForms(InputStream form, long length, String modelId, FormContentType formContentType) { - return beginRecognizeCustomForms(new RecognizeCustomFormsOptions(form, length, modelId) - .setFormContentType(formContentType)); + beginRecognizeCustomForms(InputStream form, long length, String modelId) { + return beginRecognizeCustomForms(form, length, modelId, null); } /** @@ -105,20 +128,25 @@ public final class FormRecognizerClient { * error message indicating absence of cancellation support.

* *

Code sample

- * {@codesnippet com.azure.ai.formrecognizer.FormRecognizerClient.beginRecognizeCustomForms#recognizeCustomFormsOptions} + * {@codesnippet com.azure.ai.formrecognizer.FormRecognizerClient.beginRecognizeCustomForms#InputStream-long-string-recognizeOptions} * - * @param recognizeCustomFormsOptions The data of the form to recognize form information from. + * @param form The data of the form to recognize form information from. + * @param length The exact length of the data. + * @param modelId The UUID string format custom trained model Id to be used. + * @param recognizeOptions The additional configurable {@link RecognizeOptions options} that may be passed when + * recognizing custom form. * * @return A {@link SyncPoller} that polls the recognize custom form operation until it has completed, * has failed, or has been cancelled. The completed operation returns a List of {@link RecognizedForm}. * @throws FormRecognizerException If recognize operation fails and the {@link AnalyzeOperationResult} returned with * an {@link OperationStatus#FAILED}. - * @throws NullPointerException If {@code recognizeCustomFormsOptions} is {@code null}. + * @throws NullPointerException If {@code recognizeOptions} is {@code null}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public SyncPoller> - beginRecognizeCustomForms(RecognizeCustomFormsOptions recognizeCustomFormsOptions) { - return client.beginRecognizeCustomForms(recognizeCustomFormsOptions).getSyncPoller(); + beginRecognizeCustomForms(InputStream form, long length, String modelId, RecognizeOptions recognizeOptions) { + Flux buffer = Utility.toFluxByteBuffer(form); + return client.beginRecognizeCustomForms(buffer, length, modelId, recognizeOptions).getSyncPoller(); } /** @@ -139,7 +167,7 @@ public final class FormRecognizerClient { */ @ServiceMethod(returns = ReturnType.COLLECTION) public SyncPoller> beginRecognizeContentFromUrl(String formUrl) { - return client.beginRecognizeContentFromUrl(new RecognizeOptions(formUrl)).getSyncPoller(); + return beginRecognizeContentFromUrl(formUrl, null); } /** @@ -148,12 +176,34 @@ public SyncPoller> beginRecognizeContentFromUrl( * error message indicating absence of cancellation support.

* *

Code sample

- * {@codesnippet com.azure.ai.formrecognizer.FormRecognizerClient.beginRecognizeContent#InputStream-long-FormContentType} + * {@codesnippet com.azure.ai.formrecognizer.FormRecognizerClient.beginRecognizeContentFromUrl#string-recognizeOptions} + * + * @param formUrl The source URL to the input form. + * @param recognizeOptions The additional configurable {@link RecognizeOptions options} that may be passed when + * recognizing content/layout on a form. + * + * @return A {@link SyncPoller} that polls the recognize layout operation until it has completed, has + * failed, or has been cancelled. The completed operation returns a List of {@link FormPage}. + * @throws FormRecognizerException If recognize operation fails and the {@link AnalyzeOperationResult} returned with + * an {@link OperationStatus#FAILED}. + * @throws NullPointerException If {@code formUrl} is {@code null}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public SyncPoller> + beginRecognizeContentFromUrl(String formUrl, RecognizeOptions recognizeOptions) { + return client.beginRecognizeContentFromUrl(formUrl, recognizeOptions).getSyncPoller(); + } + + /** + * Recognizes layout data using optical character recognition (OCR) and a custom trained model. + *

The service does not support cancellation of the long running operation and returns with an + * error message indicating absence of cancellation support.

+ * + *

Code sample

+ * {@codesnippet com.azure.ai.formrecognizer.FormRecognizerClient.beginRecognizeContent#InputStream-long} * * @param form The data of the form to recognize content information from. * @param length The exact length of the data. - * @param formContentType The media type of the provided form. Supported Media types including .pdf, .jpg, - * .png or .tiff type file stream. Content-type is auto-detected and could be {@code null}. * * @return A {@link SyncPoller} that polls the recognize content operation until it has completed, has failed, * or has been cancelled. The completed operation returns a List of {@link FormPage}. @@ -163,8 +213,8 @@ public SyncPoller> beginRecognizeContentFromUrl( */ @ServiceMethod(returns = ReturnType.COLLECTION) public SyncPoller> - beginRecognizeContent(InputStream form, long length, FormContentType formContentType) { - return beginRecognizeContent(new RecognizeOptions(form, length).setFormContentType(formContentType)); + beginRecognizeContent(InputStream form, long length) { + return beginRecognizeContent(form, length, null); } /** @@ -173,9 +223,12 @@ public SyncPoller> beginRecognizeContentFromUrl( * error message indicating absence of cancellation support

* *

Code sample

- * {@codesnippet com.azure.ai.formrecognizer.FormRecognizerClient.beginRecognizeContent#recognizeOptions} + * {@codesnippet com.azure.ai.formrecognizer.FormRecognizerClient.beginRecognizeContent#InputStream-long-recognizeOptions} * - * @param recognizeOptions The configurable {@code RecognizeOptions options} that may be passed when recognizing + * @param form The data of the form to recognize content information from. + * @param length The exact length of the data. + * @param recognizeOptions The additional configurable {@link RecognizeOptions options} that may be passed when + * analyzing a receipt. The configurable {@code RecognizeOptions options} that may be passed when recognizing * content on a form. * * @return A {@link SyncPoller} that polls the recognize content operation until it has completed, @@ -185,8 +238,10 @@ public SyncPoller> beginRecognizeContentFromUrl( * @throws NullPointerException If {@code recognizeOptions} is {@code null}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public SyncPoller> beginRecognizeContent(RecognizeOptions recognizeOptions) { - return client.beginRecognizeContent(recognizeOptions).getSyncPoller(); + public SyncPoller> beginRecognizeContent(InputStream form, long length, + RecognizeOptions recognizeOptions) { + Flux buffer = Utility.toFluxByteBuffer(form); + return client.beginRecognizeContent(buffer, length, recognizeOptions).getSyncPoller(); } /** @@ -209,7 +264,32 @@ public SyncPoller> beginRecognizeContent(Recogni */ @ServiceMethod(returns = ReturnType.COLLECTION) public SyncPoller> beginRecognizeReceiptsFromUrl(String receiptUrl) { - return client.beginRecognizeReceiptsFromUrl(new RecognizeOptions(receiptUrl)).getSyncPoller(); + return beginRecognizeReceiptsFromUrl(receiptUrl, null); + } + + /** + * Recognizes receipt data from documents using optical character recognition (OCR) and a + * prebuilt receipt trained model. + *

The service does not support cancellation of the long running operation and returns with an + * error message indicating absence of cancellation support

+ * + *

Code sample

+ * {@codesnippet com.azure.ai.formrecognizer.FormRecognizerClient.beginRecognizeReceiptsFromUrl#string-recognizeOptions} + * + * @param receiptUrl The source URL to the input receipt. + * @param recognizeOptions The additional configurable {@link RecognizeOptions options} that may be passed when + * analyzing a receipt. Include text lines and element references in the result. + * + * @return A {@link SyncPoller} to poll the progress of the recognize receipt operation until it has completed, + * has failed, or has been cancelled. The completed operation returns a List of {@link RecognizedReceipt}. + * @throws FormRecognizerException If recognize operation fails and the {@link AnalyzeOperationResult} returned with + * an {@link OperationStatus#FAILED}. + * @throws NullPointerException If {@code receiptUrl} is {@code null}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public SyncPoller> + beginRecognizeReceiptsFromUrl(String receiptUrl, RecognizeOptions recognizeOptions) { + return client.beginRecognizeReceiptsFromUrl(receiptUrl, recognizeOptions).getSyncPoller(); } /** @@ -220,12 +300,10 @@ public SyncPoller> beginRecognizeReceip * See here for fields found on a receipt. * *

Code sample

- * {@codesnippet com.azure.ai.formrecognizer.FormRecognizerClient.beginRecognizeReceipts#InputStream-long-FormContentType} + * {@codesnippet com.azure.ai.formrecognizer.FormRecognizerClient.beginRecognizeReceipts#InputStream-long} * - * @param receipt The data/stream of the receipt to recognize receipt information from. + * @param receipt The data of the receipt to recognize receipt information from. * @param length The exact length of the data. - * @param formContentType The media type of the provided form. Supported Media types including .pdf, .jpg, .png - * or .tiff type file stream. Content-type is auto-detected and could be {@code null}. * * @return A {@link SyncPoller} that polls the recognize receipt operation until it has completed, * has failed, or has been cancelled. The completed operation returns a List of {@link RecognizedReceipt}. @@ -235,9 +313,8 @@ public SyncPoller> beginRecognizeReceip */ @ServiceMethod(returns = ReturnType.COLLECTION) public SyncPoller> - beginRecognizeReceipts(InputStream receipt, long length, FormContentType formContentType) { - return beginRecognizeReceipts(new RecognizeOptions(receipt, length) - .setFormContentType(formContentType)); + beginRecognizeReceipts(InputStream receipt, long length) { + return beginRecognizeReceipts(receipt, length, null); } /** @@ -248,10 +325,12 @@ public SyncPoller> beginRecognizeReceip * See here for fields found on a receipt. * *

Code sample

- * {@codesnippet com.azure.ai.formrecognizer.FormRecognizerClient.beginRecognizeReceipts#recognizeOptions} + * {@codesnippet com.azure.ai.formrecognizer.FormRecognizerClient.beginRecognizeReceipts#InputStream-long-recognizeOptions} * - * @param recognizeOptions The configurable {@code RecognizeOptions options} that may be passed when recognizing - * receipt data on the provided receipt document. + * @param receipt The data of the receipt to recognize receipt information from. + * @param length The exact length of the data. + * @param recognizeOptions The additional configurable {@link RecognizeOptions options} that may be passed when + * analyzing a receipt. * * @return A {@link SyncPoller} that polls the recognize receipt operation until it has completed, has failed, * or has been cancelled. The completed operation returns a List of {@link RecognizedReceipt}. @@ -261,7 +340,8 @@ public SyncPoller> beginRecognizeReceip */ @ServiceMethod(returns = ReturnType.COLLECTION) public SyncPoller> - beginRecognizeReceipts(RecognizeOptions recognizeOptions) { - return client.beginRecognizeReceipts(recognizeOptions).getSyncPoller(); + beginRecognizeReceipts(InputStream receipt, long length, RecognizeOptions recognizeOptions) { + Flux buffer = Utility.toFluxByteBuffer(receipt); + return client.beginRecognizeReceipts(buffer, length, recognizeOptions).getSyncPoller(); } } diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/src/main/java/com/azure/ai/formrecognizer/models/RecognizeCustomFormsOptions.java b/sdk/formrecognizer/azure-ai-formrecognizer/src/main/java/com/azure/ai/formrecognizer/models/RecognizeCustomFormsOptions.java deleted file mode 100644 index fef10340d2146..0000000000000 --- a/sdk/formrecognizer/azure-ai-formrecognizer/src/main/java/com/azure/ai/formrecognizer/models/RecognizeCustomFormsOptions.java +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.ai.formrecognizer.models; - -import com.azure.core.annotation.Fluent; -import reactor.core.publisher.Flux; - -import java.io.InputStream; -import java.nio.ByteBuffer; -import java.time.Duration; - -/** - * Extended options that may be passed when recognizing custom form on Form Recognizer client. - */ -@Fluent -public class RecognizeCustomFormsOptions extends RecognizeOptions { - private final String modelId; - - /** - * Create a {@code RecognizeCustomFormsOptions option} object - * - * @param form The {@code InputStream data} of the form to recognize form information from. - * @param length the exact length of the provided form data. - * @param modelId The UUID string format custom trained model Id to be used. - */ - public RecognizeCustomFormsOptions(final InputStream form, final long length, final String modelId) { - super(form, length); - this.modelId = modelId; - } - - /** - * Create a {@code RecognizeCustomFormsOptions option} object - * - * @param formData The {@code ByteBuffer data} of the form to recognize form information from. - * @param length The exact length of the provided form data - * @param modelId The UUID string format custom trained model Id to be used. - */ - public RecognizeCustomFormsOptions(final Flux formData, final long length, final String modelId) { - super(formData, length); - this.modelId = modelId; - } - - /** - * Create a {@code RecognizeCustomFormsOptions option} object - * - * @param formUrl The source URL to the input form. - * @param modelId The UUID string format custom trained model Id to be used. - */ - public RecognizeCustomFormsOptions(final String formUrl, final String modelId) { - super(formUrl); - this.modelId = modelId; - } - - /** - * Get the UUID string format custom trained model Id to be used. - * - * @return the {@code modelId} value - */ - public String getModelId() { - return modelId; - } - - - @Override - public RecognizeCustomFormsOptions setFormContentType(FormContentType formContentType) { - super.setFormContentType(formContentType); - return this; - } - - @Override - public RecognizeCustomFormsOptions setIncludeFieldElements(boolean includeFieldElements) { - super.setIncludeFieldElements(includeFieldElements); - return this; - } - - @Override - public RecognizeCustomFormsOptions setPollInterval(Duration pollInterval) { - super.setPollInterval(pollInterval); - return this; - } -} diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/src/main/java/com/azure/ai/formrecognizer/models/RecognizeOptions.java b/sdk/formrecognizer/azure-ai-formrecognizer/src/main/java/com/azure/ai/formrecognizer/models/RecognizeOptions.java index 117cb802d1a14..9c270c0acb60a 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/src/main/java/com/azure/ai/formrecognizer/models/RecognizeOptions.java +++ b/sdk/formrecognizer/azure-ai-formrecognizer/src/main/java/com/azure/ai/formrecognizer/models/RecognizeOptions.java @@ -3,10 +3,7 @@ package com.azure.ai.formrecognizer.models; import com.azure.core.annotation.Fluent; -import reactor.core.publisher.Flux; -import java.io.InputStream; -import java.nio.ByteBuffer; import java.time.Duration; /** @@ -14,60 +11,18 @@ */ @Fluent public class RecognizeOptions { - private final InputStream form; - private final Flux formData; - private final long length; - private final String formUrl; - private FormContentType formContentType; + private FormContentType contentType; private boolean includeFieldElements; private Duration pollInterval = DEFAULT_POLL_INTERVAL; private static final Duration DEFAULT_POLL_INTERVAL = Duration.ofSeconds(5); - /** - * Create a {@code RecognizeOptions option} object. - * - * @param form The {@code InputStream data} of the form to recognize form information from. - * @param length the exact length of the provided form data. - */ - public RecognizeOptions(final InputStream form, final long length) { - this.form = form; - this.length = length; - this.formData = null; - this.formUrl = null; - } - - /** - * Create a {@code RecognizeOptions option} object. - * - * @param formData The {@code ByteBuffer data} of the form to recognize form information from. - * @param length the exact length of the provided form data. - */ - public RecognizeOptions(final Flux formData, final long length) { - this.formData = formData; - this.length = length; - this.form = null; - this.formUrl = null; - } - - /** - * Create a {@code RecognizeOptions option} object. - * - * @param formUrl The source URL to the input form. - */ - public RecognizeOptions(final String formUrl) { - this.formUrl = formUrl; - this.form = null; - this.formData = null; - this.length = 0; - } - /** * Get the type of the form. Supported Media types including .pdf, .jpg, .png or .tiff type file stream. * - * @return the {@code formContentType} value. + * @return the {@code contentType} value. */ - public FormContentType getFormContentType() { - return formContentType; + public FormContentType getContentType() { + return contentType; } /** @@ -89,51 +44,15 @@ public Duration getPollInterval() { return pollInterval; } - /** - * Get the {@code InputStream data} of the form to recognize form information from. - * - * @return the {@code form} value. - */ - public InputStream getForm() { - return form; - } - - /** - * Get the the source URL to the input form. - * - * @return the {@code formUrl} value. - */ - public String getFormUrl() { - return formUrl; - } - - /** - * Get the exact length of the provided form data. Size of the file must be less than 50 MB. - * - * @return the {@code length} value. - */ - public long getLength() { - return length; - } - - /** - * Get the {@code ByteBuffer data} of the form to recognize form information from. - * - * @return the {@code formData} value. - */ - public Flux getFormData() { - return formData; - } - /** * Set the type of the form. Supported Media types including .pdf, .jpg, .png or .tiff type file stream. * - * @param formContentType the provided form content type. + * @param contentType the provided form content type. * * @return the updated {@code RecognizeOptions} value. */ - public RecognizeOptions setFormContentType(final FormContentType formContentType) { - this.formContentType = formContentType; + public RecognizeOptions setContentType(final FormContentType contentType) { + this.contentType = contentType; return this; } diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/src/samples/java/com/azure/ai/formrecognizer/AdvancedDiffLabeledUnlabeledData.java b/sdk/formrecognizer/azure-ai-formrecognizer/src/samples/java/com/azure/ai/formrecognizer/AdvancedDiffLabeledUnlabeledData.java index 6ca6b42b5ec33..e380fce535a96 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/src/samples/java/com/azure/ai/formrecognizer/AdvancedDiffLabeledUnlabeledData.java +++ b/sdk/formrecognizer/azure-ai-formrecognizer/src/samples/java/com/azure/ai/formrecognizer/AdvancedDiffLabeledUnlabeledData.java @@ -4,7 +4,7 @@ package com.azure.ai.formrecognizer; import com.azure.ai.formrecognizer.models.FormContentType; -import com.azure.ai.formrecognizer.models.RecognizeCustomFormsOptions; +import com.azure.ai.formrecognizer.models.RecognizeOptions; import com.azure.ai.formrecognizer.models.RecognizedForm; import com.azure.core.credential.AzureKeyCredential; @@ -48,13 +48,20 @@ public static void main(String[] args) throws IOException { List formsWithLabeledModel = client.beginRecognizeCustomForms( - new RecognizeCustomFormsOptions(new FileInputStream(analyzeFile), analyzeFile.length(), - "{labeled_model_Id}").setFormContentType(FormContentType.APPLICATION_PDF) - .setIncludeFieldElements(true).setPollInterval(Duration.ofSeconds(5))).getFinalResult(); + new FileInputStream(analyzeFile), analyzeFile.length(), + "{labeled_model_Id}", new RecognizeOptions() + .setContentType(FormContentType.APPLICATION_PDF) + .setIncludeFieldElements(true) + .setPollInterval(Duration.ofSeconds(5))) + .getFinalResult(); + List formsWithUnlabeledModel = client.beginRecognizeCustomForms(new FileInputStream(analyzeFile), analyzeFile.length(), - "{unlabeled_model_Id}", - FormContentType.APPLICATION_PDF).getFinalResult(); + "{unlabeled_model_Id}", new RecognizeOptions() + .setContentType(FormContentType.APPLICATION_PDF) + .setIncludeFieldElements(true) + .setPollInterval(Duration.ofSeconds(5))) + .getFinalResult(); System.out.println("--------Recognizing forms with labeled custom model--------"); diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/src/samples/java/com/azure/ai/formrecognizer/AdvancedDiffLabeledUnlabeledDataAsync.java b/sdk/formrecognizer/azure-ai-formrecognizer/src/samples/java/com/azure/ai/formrecognizer/AdvancedDiffLabeledUnlabeledDataAsync.java index 98958ab596036..f5e14b6167076 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/src/samples/java/com/azure/ai/formrecognizer/AdvancedDiffLabeledUnlabeledDataAsync.java +++ b/sdk/formrecognizer/azure-ai-formrecognizer/src/samples/java/com/azure/ai/formrecognizer/AdvancedDiffLabeledUnlabeledDataAsync.java @@ -5,7 +5,7 @@ import com.azure.ai.formrecognizer.models.FormContentType; import com.azure.ai.formrecognizer.models.OperationResult; -import com.azure.ai.formrecognizer.models.RecognizeCustomFormsOptions; +import com.azure.ai.formrecognizer.models.RecognizeOptions; import com.azure.ai.formrecognizer.models.RecognizedForm; import com.azure.core.credential.AzureKeyCredential; import com.azure.core.util.polling.PollerFlux; @@ -55,14 +55,19 @@ public static void main(String[] args) throws IOException { byte[] fileContent = Files.readAllBytes(analyzeFile.toPath()); PollerFlux> labeledCustomFormPoller = - client.beginRecognizeCustomForms(new RecognizeCustomFormsOptions( - toFluxByteBuffer(new ByteArrayInputStream(fileContent)), analyzeFile.length(), "{labeled_model_Id}") - .setFormContentType(FormContentType.APPLICATION_PDF).setIncludeFieldElements(true) - .setPollInterval(Duration.ofSeconds(5))); + client.beginRecognizeCustomForms(toFluxByteBuffer(new ByteArrayInputStream(fileContent)), + analyzeFile.length(), "{labeled_model_Id}", new RecognizeOptions() + .setContentType(FormContentType.APPLICATION_PDF) + .setIncludeFieldElements(true) + .setPollInterval(Duration.ofSeconds(5))); PollerFlux> unlabeledCustomFormPoller = client.beginRecognizeCustomForms(toFluxByteBuffer(new ByteArrayInputStream(fileContent)), - analyzeFile.length(), "{unlabeled_model_Id}", FormContentType.APPLICATION_PDF); + analyzeFile.length(), "{unlabeled_model_Id}", + new RecognizeOptions() + .setContentType(FormContentType.APPLICATION_PDF) + .setIncludeFieldElements(true) + .setPollInterval(Duration.ofSeconds(5))); Mono> labeledDataResult = labeledCustomFormPoller .last() diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/src/samples/java/com/azure/ai/formrecognizer/FormRecognizerAsyncClientJavaDocCodeSnippets.java b/sdk/formrecognizer/azure-ai-formrecognizer/src/samples/java/com/azure/ai/formrecognizer/FormRecognizerAsyncClientJavaDocCodeSnippets.java index 4aafaa0f9dc32..ab23ef74d3c29 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/src/samples/java/com/azure/ai/formrecognizer/FormRecognizerAsyncClientJavaDocCodeSnippets.java +++ b/sdk/formrecognizer/azure-ai-formrecognizer/src/samples/java/com/azure/ai/formrecognizer/FormRecognizerAsyncClientJavaDocCodeSnippets.java @@ -6,7 +6,6 @@ import com.azure.ai.formrecognizer.models.FieldValueType; import com.azure.ai.formrecognizer.models.FormContentType; import com.azure.ai.formrecognizer.models.FormField; -import com.azure.ai.formrecognizer.models.RecognizeCustomFormsOptions; import com.azure.ai.formrecognizer.models.RecognizeOptions; import com.azure.ai.formrecognizer.models.RecognizedReceipt; import com.azure.core.credential.AzureKeyCredential; @@ -70,76 +69,104 @@ public void beginRecognizeCustomFormsFromUrl() { String formUrl = "{form_url}"; String modelId = "{custom_trained_model_id}"; - formRecognizerAsyncClient.beginRecognizeCustomFormsFromUrl(formUrl, modelId).subscribe( + formRecognizerAsyncClient.beginRecognizeCustomFormsFromUrl(formUrl, modelId).flatMap( recognizePollingOperation -> // if training polling operation completed, retrieve the final result. - recognizePollingOperation.getFinalResult().subscribe(recognizedForms -> { - recognizedForms.forEach(recognizedForm -> recognizedForm.getFields().forEach((fieldText, - fieldValue) -> { - System.out.printf("Field text: %s%n", fieldText); - System.out.printf("Field value: %s%n", fieldValue.getFieldValue()); - System.out.printf("Confidence score: %.2f%n", fieldValue.getConfidence()); + recognizePollingOperation.getFinalResult()).subscribe(recognizedForms -> + recognizedForms.forEach(recognizedForm -> { + recognizedForm.getFields().forEach((fieldText, fieldValue) -> { + System.out.printf("Field text: %s%n", fieldText); + System.out.printf("Field value: %s%n", fieldValue.getFieldValue()); + System.out.printf("Confidence score: %.2f%n", fieldValue.getConfidence()); + }); })); - })); // END: com.azure.ai.formrecognizer.FormRecognizerAsyncClient.beginRecognizeCustomFormsFromUrl#string-string } + /** + * Code snippet for + * {@link FormRecognizerAsyncClient#beginRecognizeCustomFormsFromUrl(String, String, RecognizeOptions)} with options + */ + public void beginRecognizeCustomFormsFromUrlWithOptions() { + // BEGIN: com.azure.ai.formrecognizer.FormRecognizerAsyncClient.beginRecognizeCustomFormsFromUrl#string-string-recognizeOptions + String formUrl = "{formUrl}"; + String modelId = "{model_id}"; + boolean includeTextContent = true; + + formRecognizerAsyncClient.beginRecognizeCustomFormsFromUrl(formUrl, modelId, + new RecognizeOptions() + .setIncludeFieldElements(includeTextContent) + .setPollInterval(Duration.ofSeconds(10))) + .flatMap(recognizePollingOperation -> + // if training polling operation completed, retrieve the final result. + recognizePollingOperation.getFinalResult()).subscribe(recognizedForms -> + recognizedForms.forEach(recognizedForm -> { + recognizedForm.getFields().forEach((fieldText, fieldValue) -> { + System.out.printf("Field text: %s%n", fieldText); + System.out.printf("Field value: %s%n", fieldValue.getFieldValue()); + System.out.printf("Confidence score: %.2f%n", fieldValue.getConfidence()); + }); + })); + // END: com.azure.ai.formrecognizer.FormRecognizerAsyncClient.beginRecognizeCustomFormsFromUrl#string-string-recognizeOptions + } + /** * Code snippet for {@link FormRecognizerAsyncClient#beginRecognizeCustomForms} * * @throws IOException Exception thrown when there is an error in reading all the bytes from the File. */ public void beginRecognizeCustomForms() throws IOException { - // BEGIN: com.azure.ai.formrecognizer.FormRecognizerAsyncClient.beginRecognizeCustomForms#Flux-long-string-FormContentType + // BEGIN: com.azure.ai.formrecognizer.FormRecognizerAsyncClient.beginRecognizeCustomForms#Flux-long-string File form = new File("{local/file_path/fileName.jpg}"); String modelId = "{custom_trained_model_id}"; // Utility method to convert input stream to Byte buffer Flux buffer = toFluxByteBuffer(new ByteArrayInputStream(Files.readAllBytes(form.toPath()))); - formRecognizerAsyncClient.beginRecognizeCustomForms(buffer, form.length(), modelId, - FormContentType.IMAGE_JPEG).subscribe(recognizePollingOperation -> - // if training polling operation completed, retrieve the final result. - recognizePollingOperation.getFinalResult().subscribe(recognizedForms -> { - recognizedForms.forEach(recognizedForm -> recognizedForm.getFields().forEach((fieldText, - fieldValue) -> { - System.out.printf("Field text: %s%n", fieldText); - System.out.printf("Field value: %s%n", fieldValue.getFieldValue()); - System.out.printf("Confidence score: %.2f%n", fieldValue.getConfidence()); - })); - })); - // END: com.azure.ai.formrecognizer.FormRecognizerAsyncClient.beginRecognizeCustomForms#Flux-long-string-FormContentType + formRecognizerAsyncClient.beginRecognizeCustomForms(buffer, form.length(), modelId) + .flatMap(recognizePollingOperation -> + // if training polling operation completed, retrieve the final result. + recognizePollingOperation.getFinalResult()).subscribe(recognizedForms -> + recognizedForms.forEach(recognizedForm -> { + recognizedForm.getFields().forEach((fieldText, fieldValue) -> { + System.out.printf("Field text: %s%n", fieldText); + System.out.printf("Field value: %s%n", fieldValue.getFieldValue()); + System.out.printf("Confidence score: %.2f%n", fieldValue.getConfidence()); + }); + })); + // END: com.azure.ai.formrecognizer.FormRecognizerAsyncClient.beginRecognizeCustomForms#Flux-long-string } /** - * Code snippet for {@link FormRecognizerAsyncClient#beginRecognizeCustomFormsFromUrl(RecognizeCustomFormsOptions)} + * Code snippet for + * {@link FormRecognizerAsyncClient#beginRecognizeCustomForms(Flux, long, String, RecognizeOptions)} * with options * * @throws IOException Exception thrown when there is an error in reading all the bytes from the File. */ public void beginRecognizeCustomFormsWithOptions() throws IOException { - // BEGIN: com.azure.ai.formrecognizer.FormRecognizerAsyncClient.beginRecognizeCustomForms#recognizeCustomFormsOptions + // BEGIN: com.azure.ai.formrecognizer.FormRecognizerAsyncClient.beginRecognizeCustomForms#Flux-long-string-recognizeOptions File form = new File("{local/file_path/fileName.jpg}"); String modelId = "{custom_trained_model_id}"; boolean includeFieldElements = true; // Utility method to convert input stream to Byte buffer Flux buffer = toFluxByteBuffer(new ByteArrayInputStream(Files.readAllBytes(form.toPath()))); - formRecognizerAsyncClient.beginRecognizeCustomForms( - new RecognizeCustomFormsOptions(buffer, form.length(), modelId) - .setFormContentType(FormContentType.IMAGE_JPEG) + formRecognizerAsyncClient.beginRecognizeCustomForms(buffer, form.length(), modelId, + new RecognizeOptions() + .setContentType(FormContentType.IMAGE_JPEG) .setIncludeFieldElements(includeFieldElements) .setPollInterval(Duration.ofSeconds(5))) - .subscribe(recognizePollingOperation -> + .flatMap(recognizePollingOperation -> // if training polling operation completed, retrieve the final result. - recognizePollingOperation.getFinalResult().subscribe(recognizedForms -> { - recognizedForms.forEach(recognizedForm -> recognizedForm.getFields().forEach((fieldText, - fieldValue) -> { - System.out.printf("Field text: %s%n", fieldText); - System.out.printf("Field value: %s%n", fieldValue.getFieldValue()); - System.out.printf("Confidence score: %.2f%n", fieldValue.getConfidence()); + recognizePollingOperation.getFinalResult()).subscribe(recognizedForms -> + recognizedForms.forEach(recognizedForm -> { + recognizedForm.getFields().forEach((fieldText, fieldValue) -> { + System.out.printf("Field text: %s%n", fieldText); + System.out.printf("Field value: %s%n", fieldValue.getFieldValue()); + System.out.printf("Confidence score: %.2f%n", fieldValue.getConfidence()); + }); })); - })); - // END: com.azure.ai.formrecognizer.FormRecognizerAsyncClient.beginRecognizeCustomForms#recognizeCustomFormsOptions + // END: com.azure.ai.formrecognizer.FormRecognizerAsyncClient.beginRecognizeCustomForms#Flux-long-string-recognizeOptions } // Recognize Content @@ -149,20 +176,45 @@ public void beginRecognizeCustomFormsWithOptions() throws IOException { */ public void beginRecognizeContentFromUrl() { // BEGIN: com.azure.ai.formrecognizer.FormRecognizerAsyncClient.beginRecognizeContentFromUrl#string - String formUrl = "{form_url}"; - formRecognizerAsyncClient.beginRecognizeContentFromUrl(formUrl).subscribe( - recognizePollingOperation -> recognizePollingOperation.getFinalResult().subscribe(contentPageResult -> { - // Table information + String formUrl = "{formUrl}"; + formRecognizerAsyncClient.beginRecognizeContentFromUrl(formUrl).flatMap( + recognizePollingOperation -> + recognizePollingOperation.getFinalResult()).subscribe(layoutPageResults -> + layoutPageResults.forEach(recognizedForm -> { + System.out.printf("Page Angle: %s%n", recognizedForm.getTextAngle()); + System.out.printf("Page Dimension unit: %s%n", recognizedForm.getUnit()); + // Table information + System.out.println("Recognized Tables: "); + recognizedForm.getTables().forEach(formTable -> + formTable.getCells().forEach(recognizedTableCell -> + System.out.printf("%s ", recognizedTableCell.getText()))); + })); + // END: com.azure.ai.formrecognizer.FormRecognizerAsyncClient.beginRecognizeContentFromUrl#string + } + + /** + * Code snippet for {@link FormRecognizerAsyncClient#beginRecognizeContentFromUrl(String, RecognizeOptions)} with + * options + */ + public void beginRecognizeContentFromUrlWithOptions() { + // BEGIN: com.azure.ai.formrecognizer.FormRecognizerAsyncClient.beginRecognizeContentFromUrl#string-recognizeOptions + String formUrl = "{formUrl}"; + formRecognizerAsyncClient.beginRecognizeContentFromUrl(formUrl, + new RecognizeOptions().setPollInterval(Duration.ofSeconds(5))) + .flatMap(recognizePollingOperation -> + // if training polling operation completed, retrieve the final result. + recognizePollingOperation.getFinalResult()) + .subscribe(contentPageResult -> contentPageResult.forEach(recognizedForm -> { - System.out.printf("Text angle: %s%n", recognizedForm.getTextAngle()); + System.out.printf("Page Angle: %s%n", recognizedForm.getTextAngle()); System.out.printf("Page Dimension unit: %s%n", recognizedForm.getUnit()); + // Table information System.out.println("Recognized Tables: "); recognizedForm.getTables().forEach(formTable -> formTable.getCells().forEach(recognizedTableCell -> System.out.printf("%s ", recognizedTableCell.getText()))); - }); - })); - // END: com.azure.ai.formrecognizer.FormRecognizerAsyncClient.beginRecognizeContentFromUrl#string + })); + // END: com.azure.ai.formrecognizer.FormRecognizerAsyncClient.beginRecognizeContentFromUrl#string-recognizeOptions } /** @@ -171,51 +223,56 @@ public void beginRecognizeContentFromUrl() { * @throws IOException Exception thrown when there is an error in reading all the bytes from the File. */ public void beginRecognizeContent() throws IOException { - // BEGIN: com.azure.ai.formrecognizer.FormRecognizerAsyncClient.beginRecognizeContent#Flux-long-FormContentType + // BEGIN: com.azure.ai.formrecognizer.FormRecognizerAsyncClient.beginRecognizeContent#Flux-long File form = new File("{local/file_path/fileName.jpg}"); // Utility method to convert input stream to Byte buffer Flux buffer = toFluxByteBuffer(new ByteArrayInputStream(Files.readAllBytes(form.toPath()))); - formRecognizerAsyncClient.beginRecognizeContent(buffer, form.length(), FormContentType.APPLICATION_PDF) - .subscribe(recognizePollingOperation -> - recognizePollingOperation.getFinalResult().subscribe(contentPageResult -> - contentPageResult.forEach(recognizedForm -> { - System.out.printf("Page Angle: %s%n", recognizedForm.getTextAngle()); - System.out.printf("Page Dimension unit: %s%n", recognizedForm.getUnit()); - // Table information - System.out.println("Recognized Tables: "); - recognizedForm.getTables().forEach(formTable -> - formTable.getCells().forEach(recognizedTableCell -> - System.out.printf("%s ", recognizedTableCell.getText()))); - }) - )); - // END: com.azure.ai.formrecognizer.FormRecognizerAsyncClient.beginRecognizeContent#Flux-long-FormContentType + formRecognizerAsyncClient.beginRecognizeContent(buffer, form.length()) + .flatMap(recognizePollingOperation -> + // if training polling operation completed, retrieve the final result. + recognizePollingOperation.getFinalResult()) + .subscribe(contentPageResult -> + contentPageResult.forEach(formPage -> { + System.out.printf("Page Angle: %s%n", formPage.getTextAngle()); + System.out.printf("Page Dimension unit: %s%n", formPage.getUnit()); + // Table information + System.out.println("Recognized Tables: "); + formPage.getTables().forEach(formTable -> + formTable.getCells().forEach(recognizedTableCell -> + System.out.printf("%s ", recognizedTableCell.getText()))); + })); + // END: com.azure.ai.formrecognizer.FormRecognizerAsyncClient.beginRecognizeContent#Flux-long } /** - * Code snippet for {@link FormRecognizerAsyncClient#beginRecognizeContent(RecognizeOptions)} with options + * Code snippet for {@link FormRecognizerAsyncClient#beginRecognizeContent(Flux, long, RecognizeOptions)} with + * options * * @throws IOException Exception thrown when there is an error in reading all the bytes from the File. */ public void beginRecognizeContentWithOptions() throws IOException { - // BEGIN: com.azure.ai.formrecognizer.FormRecognizerAsyncClient.beginRecognizeContent#recognizeOptions + // BEGIN: com.azure.ai.formrecognizer.FormRecognizerAsyncClient.beginRecognizeContent#Flux-long-recognizeOptions File form = new File("{local/file_path/fileName.jpg}"); // Utility method to convert input stream to Byte buffer Flux buffer = toFluxByteBuffer(new ByteArrayInputStream(Files.readAllBytes(form.toPath()))); - - formRecognizerAsyncClient.beginRecognizeContent(new RecognizeOptions(buffer, form.length()) - .setFormContentType(FormContentType.APPLICATION_PDF).setPollInterval(Duration.ofSeconds(5))) - .subscribe(recognizePollingOperation -> recognizePollingOperation.getFinalResult().subscribe( - layoutPageResults -> layoutPageResults.forEach(recognizedForm -> { - System.out.printf("Page Angle: %s%n", recognizedForm.getTextAngle()); - System.out.printf("Page Dimension unit: %s%n", recognizedForm.getUnit()); + formRecognizerAsyncClient.beginRecognizeContent(buffer, form.length(), + new RecognizeOptions() + .setContentType(FormContentType.APPLICATION_PDF) + .setPollInterval(Duration.ofSeconds(5))) + .flatMap(recognizePollingOperation -> + // if training polling operation completed, retrieve the final result. + recognizePollingOperation.getFinalResult()) + .subscribe(contentPageResult -> + contentPageResult.forEach(formPage -> { + System.out.printf("Page Angle: %s%n", formPage.getTextAngle()); + System.out.printf("Page Dimension unit: %s%n", formPage.getUnit()); // Table information System.out.println("Recognized Tables: "); - recognizedForm.getTables().forEach(formTable -> formTable.getCells().forEach(recognizedTableCell -> + formPage.getTables().forEach(formTable -> formTable.getCells().forEach(recognizedTableCell -> System.out.printf("%s ", recognizedTableCell.getText()))); - }) - )); - // END: com.azure.ai.formrecognizer.FormRecognizerAsyncClient.beginRecognizeContent#recognizeOptions + })); + // END: com.azure.ai.formrecognizer.FormRecognizerAsyncClient.beginRecognizeContent#Flux-long-recognizeOptions } // Recognize Receipts @@ -225,10 +282,12 @@ public void beginRecognizeContentWithOptions() throws IOException { */ public void beginRecognizeReceiptsFromUrl() { // BEGIN: com.azure.ai.formrecognizer.FormRecognizerAsyncClient.beginRecognizeReceiptsFromUrl#string - String receiptUrl = "{receipt_url}"; - formRecognizerAsyncClient.beginRecognizeReceiptsFromUrl(receiptUrl).subscribe(recognizePollingOperation -> { - // if training polling operation completed, retrieve the final result. - recognizePollingOperation.getFinalResult().subscribe(recognizedReceipts -> { + String receiptUrl = "{receiptUrl}"; + formRecognizerAsyncClient.beginRecognizeReceiptsFromUrl(receiptUrl) + .flatMap(recognizePollingOperation -> + // if training polling operation completed, retrieve the final result. + recognizePollingOperation.getFinalResult()) + .subscribe(recognizedReceipts -> { for (int i = 0; i < recognizedReceipts.size(); i++) { RecognizedReceipt recognizedReceipt = recognizedReceipts.get(i); Map recognizedFields = recognizedReceipt.getRecognizedForm().getFields(); @@ -264,115 +323,170 @@ public void beginRecognizeReceiptsFromUrl() { } } }); - }); // END: com.azure.ai.formrecognizer.FormRecognizerAsyncClient.beginRecognizeReceiptsFromUrl#string } /** - * Code snippet for {@link FormRecognizerAsyncClient#beginRecognizeReceipts(Flux, long, FormContentType)} + * Code snippet for {@link FormRecognizerAsyncClient#beginRecognizeReceiptsFromUrl(String, RecognizeOptions)} + */ + public void beginRecognizeReceiptsFromUrlWithOptions() { + // BEGIN: com.azure.ai.formrecognizer.FormRecognizerAsyncClient.beginRecognizeReceiptsFromUrl#string-recognizeOptions + String receiptUrl = "{receiptUrl}"; + boolean includeTextContent = true; + formRecognizerAsyncClient.beginRecognizeReceiptsFromUrl(receiptUrl, + new RecognizeOptions() + .setIncludeFieldElements(includeTextContent) + .setPollInterval(Duration.ofSeconds(5))) + .flatMap(recognizePollingOperation -> + // if training polling operation completed, retrieve the final result. + recognizePollingOperation.getFinalResult()) + .subscribe(recognizedReceipts -> { + for (int i = 0; i < recognizedReceipts.size(); i++) { + RecognizedReceipt recognizedReceipt = recognizedReceipts.get(i); + Map recognizedFields = recognizedReceipt.getRecognizedForm().getFields(); + System.out.printf("----------- Recognized Receipt page %s -----------%n", i); + FormField merchantNameField = recognizedFields.get("MerchantName"); + if (merchantNameField.getFieldValue().getType() == FieldValueType.STRING) { + System.out.printf("Merchant Name: %s, confidence: %.2f%n", + merchantNameField.getFieldValue().asString(), + merchantNameField.getConfidence()); + } + FormField transactionDateField = recognizedFields.get("TransactionDate"); + if (transactionDateField.getFieldValue().getType() == FieldValueType.DATE) { + System.out.printf("Transaction Date: %s, confidence: %.2f%n", + transactionDateField.getFieldValue().asDate(), + transactionDateField.getConfidence()); + } + FormField receiptItemsField = recognizedFields.get("Items"); + System.out.printf("Receipt Items: %n"); + if (receiptItemsField.getFieldValue().getType() == FieldValueType.LIST) { + List receiptItems = receiptItemsField.getFieldValue().asList(); + receiptItems.forEach(receiptItem -> { + if (receiptItem.getFieldValue().getType() == FieldValueType.MAP) { + receiptItem.getFieldValue().asMap().forEach((key, formField) -> { + if (key.equals("Quantity")) { + if (formField.getFieldValue().getType() == FieldValueType.INTEGER) { + System.out.printf("Quantity: %s, confidence: %.2f%n", + formField.getFieldValue().asInteger(), formField.getConfidence()); + } + } + }); + } + }); + } + } + }); + // END: com.azure.ai.formrecognizer.FormRecognizerAsyncClient.beginRecognizeReceiptsFromUrl#string-recognizeOptions + } + + /** + * Code snippet for {@link FormRecognizerAsyncClient#beginRecognizeReceipts(Flux, long)} * * @throws IOException Exception thrown when there is an error in reading all the bytes from the File. */ public void beginRecognizeReceipts() throws IOException { - // BEGIN: com.azure.ai.formrecognizer.FormRecognizerAsyncClient.beginRecognizeReceipts#Flux-long-FormContentType - File receipt = new File("{local/file_path/fileName.jpg}"); - // Utility method to convert input stream to Byte buffer + // BEGIN: com.azure.ai.formrecognizer.FormRecognizerAsyncClient.beginRecognizeReceipts#Flux-long + File receipt = new File("{file_source_url}"); Flux buffer = toFluxByteBuffer(new ByteArrayInputStream(Files.readAllBytes(receipt.toPath()))); - formRecognizerAsyncClient.beginRecognizeReceipts(buffer, receipt.length(), FormContentType.IMAGE_JPEG) - .subscribe(recognizePollingOperation -> { + formRecognizerAsyncClient.beginRecognizeReceipts(buffer, receipt.length()) + .flatMap(recognizePollingOperation -> // if training polling operation completed, retrieve the final result. - recognizePollingOperation.getFinalResult().subscribe(recognizedReceipts -> { - for (int i = 0; i < recognizedReceipts.size(); i++) { - RecognizedReceipt recognizedReceipt = recognizedReceipts.get(i); - Map recognizedFields = recognizedReceipt.getRecognizedForm().getFields(); - System.out.printf("----------- Recognized Receipt page %s -----------%n", i); - FormField merchantNameField = recognizedFields.get("MerchantName"); - if (merchantNameField.getFieldValue().getType() == FieldValueType.STRING) { - System.out.printf("Merchant Name: %s, confidence: %.2f%n", - merchantNameField.getFieldValue().asString(), - merchantNameField.getConfidence()); - } - FormField transactionDateField = recognizedFields.get("TransactionDate"); - if (transactionDateField.getFieldValue().getType() == FieldValueType.DATE) { - System.out.printf("Transaction Date: %s, confidence: %.2f%n", - transactionDateField.getFieldValue().asDate(), - transactionDateField.getConfidence()); - } - FormField receiptItemsField = recognizedFields.get("Items"); - System.out.printf("Receipt Items: %n"); - if (receiptItemsField.getFieldValue().getType() == FieldValueType.LIST) { - List receiptItems = receiptItemsField.getFieldValue().asList(); - receiptItems.forEach(receiptItem -> { - if (receiptItem.getFieldValue().getType() == FieldValueType.MAP) { - receiptItem.getFieldValue().asMap().forEach((key, formField) -> { - if (key.equals("Quantity")) { - if (formField.getFieldValue().getType() == FieldValueType.INTEGER) { - System.out.printf("Quantity: %s, confidence: %.2f%n", - formField.getFieldValue().asInteger(), formField.getConfidence()); - } + recognizePollingOperation.getFinalResult()) + .subscribe(recognizedReceipts -> { + for (int i = 0; i < recognizedReceipts.size(); i++) { + RecognizedReceipt recognizedReceipt = recognizedReceipts.get(i); + Map recognizedFields = recognizedReceipt.getRecognizedForm().getFields(); + System.out.printf("----------- Recognized Receipt page %s -----------%n", i); + FormField merchantNameField = recognizedFields.get("MerchantName"); + if (merchantNameField.getFieldValue().getType() == FieldValueType.STRING) { + System.out.printf("Merchant Name: %s, confidence: %.2f%n", + merchantNameField.getFieldValue().asString(), + merchantNameField.getConfidence()); + } + FormField transactionDateField = recognizedFields.get("TransactionDate"); + if (transactionDateField.getFieldValue().getType() == FieldValueType.DATE) { + System.out.printf("Transaction Date: %s, confidence: %.2f%n", + transactionDateField.getFieldValue().asDate(), + transactionDateField.getConfidence()); + } + FormField receiptItemsField = recognizedFields.get("Items"); + System.out.printf("Receipt Items: %n"); + if (receiptItemsField.getFieldValue().getType() == FieldValueType.LIST) { + List receiptItems = receiptItemsField.getFieldValue().asList(); + receiptItems.forEach(receiptItem -> { + if (receiptItem.getFieldValue().getType() == FieldValueType.MAP) { + receiptItem.getFieldValue().asMap().forEach((key, formField) -> { + if (key.equals("Quantity")) { + if (formField.getFieldValue().getType() == FieldValueType.INTEGER) { + System.out.printf("Quantity: %s, confidence: %.2f%n", + formField.getFieldValue().asInteger(), formField.getConfidence()); } - }); - } - }); - } + } + }); + } + }); } - }); + } }); - // END: com.azure.ai.formrecognizer.FormRecognizerAsyncClient.beginRecognizeReceipts#Flux-long-FormContentType + // END: com.azure.ai.formrecognizer.FormRecognizerAsyncClient.beginRecognizeReceipts#Flux-long } /** - * Code snippet for {@link FormRecognizerAsyncClient#beginRecognizeReceipts(RecognizeOptions)} with options + * Code snippet for {@link FormRecognizerAsyncClient#beginRecognizeReceipts(Flux, long, RecognizeOptions)} with + * options * * @throws IOException Exception thrown when there is an error in reading all the bytes from the File. */ public void beginRecognizeReceiptsWithOptions() throws IOException { - // BEGIN: com.azure.ai.formrecognizer.FormRecognizerAsyncClient.beginRecognizeReceipts#recognizeOptions + // BEGIN: com.azure.ai.formrecognizer.FormRecognizerAsyncClient.beginRecognizeReceipts#Flux-long-recognizeOptions File receipt = new File("{local/file_path/fileName.jpg}"); boolean includeFieldElements = true; // Utility method to convert input stream to Byte buffer Flux buffer = toFluxByteBuffer(new ByteArrayInputStream(Files.readAllBytes(receipt.toPath()))); - formRecognizerAsyncClient.beginRecognizeReceipts(new RecognizeOptions(buffer, receipt.length()) - .setFormContentType(FormContentType.IMAGE_JPEG).setIncludeFieldElements(includeFieldElements) - .setPollInterval(Duration.ofSeconds(5))).subscribe(recognizePollingOperation -> { + formRecognizerAsyncClient.beginRecognizeReceipts(buffer, receipt.length(), + new RecognizeOptions() + .setContentType(FormContentType.IMAGE_JPEG) + .setIncludeFieldElements(includeFieldElements) + .setPollInterval(Duration.ofSeconds(5))) + .flatMap(recognizePollingOperation -> // if training polling operation completed, retrieve the final result. - recognizePollingOperation.getFinalResult().subscribe(recognizedReceipts -> { - for (int i = 0; i < recognizedReceipts.size(); i++) { - RecognizedReceipt recognizedReceipt = recognizedReceipts.get(i); - Map recognizedFields = recognizedReceipt.getRecognizedForm().getFields(); - System.out.printf("----------- Recognized Receipt page %s -----------%n", i); - FormField merchantNameField = recognizedFields.get("MerchantName"); - if (merchantNameField.getFieldValue().getType() == FieldValueType.STRING) { - System.out.printf("Merchant Name: %s, confidence: %.2f%n", - merchantNameField.getFieldValue().asString(), - merchantNameField.getConfidence()); - } - FormField transactionDateField = recognizedFields.get("TransactionDate"); - if (transactionDateField.getFieldValue().getType() == FieldValueType.DATE) { - System.out.printf("Transaction Date: %s, confidence: %.2f%n", - transactionDateField.getFieldValue().asDate(), - transactionDateField.getConfidence()); - } - FormField receiptItemsField = recognizedFields.get("Items"); - System.out.printf("Receipt Items: %n"); - if (receiptItemsField.getFieldValue().getType() == FieldValueType.LIST) { - List receiptItems = receiptItemsField.getFieldValue().asList(); - receiptItems.forEach(receiptItem -> { - if (receiptItem.getFieldValue().getType() == FieldValueType.MAP) { - receiptItem.getFieldValue().asMap().forEach((key, formField) -> { - if (key.equals("Quantity")) { - if (formField.getFieldValue().getType() == FieldValueType.INTEGER) { - System.out.printf("Quantity: %s, confidence: %.2f%n", - formField.getFieldValue().asInteger(), formField.getConfidence()); - } + recognizePollingOperation.getFinalResult()) + .subscribe(recognizedReceipts -> { + for (int i = 0; i < recognizedReceipts.size(); i++) { + RecognizedReceipt recognizedReceipt = recognizedReceipts.get(i); + Map recognizedFields = recognizedReceipt.getRecognizedForm().getFields(); + System.out.printf("----------- Recognized Receipt page %s -----------%n", i); + FormField merchantNameField = recognizedFields.get("MerchantName"); + if (merchantNameField.getFieldValue().getType() == FieldValueType.STRING) { + System.out.printf("Merchant Name: %s, confidence: %.2f%n", + merchantNameField.getFieldValue().asString(), + merchantNameField.getConfidence()); + } + FormField transactionDateField = recognizedFields.get("TransactionDate"); + if (transactionDateField.getFieldValue().getType() == FieldValueType.DATE) { + System.out.printf("Transaction Date: %s, confidence: %.2f%n", + transactionDateField.getFieldValue().asDate(), + transactionDateField.getConfidence()); + } + FormField receiptItemsField = recognizedFields.get("Items"); + System.out.printf("Receipt Items: %n"); + if (receiptItemsField.getFieldValue().getType() == FieldValueType.LIST) { + List receiptItems = receiptItemsField.getFieldValue().asList(); + receiptItems.forEach(receiptItem -> { + if (receiptItem.getFieldValue().getType() == FieldValueType.MAP) { + receiptItem.getFieldValue().asMap().forEach((key, formField) -> { + if (key.equals("Quantity")) { + if (formField.getFieldValue().getType() == FieldValueType.INTEGER) { + System.out.printf("Quantity: %s, confidence: %.2f%n", + formField.getFieldValue().asInteger(), formField.getConfidence()); } - }); - } - }); - } + } + }); + } + }); } - }); + } }); - // END: com.azure.ai.formrecognizer.FormRecognizerAsyncClient.beginRecognizeReceipts#recognizeOptions + // END: com.azure.ai.formrecognizer.FormRecognizerAsyncClient.beginRecognizeReceipts#Flux-long-recognizeOptions } } diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/src/samples/java/com/azure/ai/formrecognizer/FormRecognizerClientJavaDocCodeSnippets.java b/sdk/formrecognizer/azure-ai-formrecognizer/src/samples/java/com/azure/ai/formrecognizer/FormRecognizerClientJavaDocCodeSnippets.java index 2d4373eadb348..f1aa02207094a 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/src/samples/java/com/azure/ai/formrecognizer/FormRecognizerClientJavaDocCodeSnippets.java +++ b/sdk/formrecognizer/azure-ai-formrecognizer/src/samples/java/com/azure/ai/formrecognizer/FormRecognizerClientJavaDocCodeSnippets.java @@ -6,7 +6,6 @@ import com.azure.ai.formrecognizer.models.FieldValueType; import com.azure.ai.formrecognizer.models.FormContentType; import com.azure.ai.formrecognizer.models.FormField; -import com.azure.ai.formrecognizer.models.RecognizeCustomFormsOptions; import com.azure.ai.formrecognizer.models.RecognizeOptions; import com.azure.core.credential.AzureKeyCredential; import com.azure.core.http.HttpPipeline; @@ -78,38 +77,59 @@ public void beginRecognizeCustomFormsFromUrl() { // END: com.azure.ai.formrecognizer.FormRecognizerClient.beginRecognizeCustomFormsFromUrl#string-string } + /** + * Code snippet for {@link FormRecognizerClient#beginRecognizeCustomFormsFromUrl(String, String, RecognizeOptions)} + */ + public void beginRecognizeCustomFormsFromUrlWithOptions() { + // BEGIN: com.azure.ai.formrecognizer.FormRecognizerClient.beginRecognizeCustomFormsFromUrl#string-string-recognizeOptions + String analyzeFilePath = "{file_source_url}"; + String modelId = "{model_id}"; + boolean includeFieldElements = true; + + formRecognizerClient.beginRecognizeCustomFormsFromUrl(analyzeFilePath, modelId, + new RecognizeOptions() + .setContentType(FormContentType.IMAGE_JPEG) + .setIncludeFieldElements(includeFieldElements) + .setPollInterval(Duration.ofSeconds(10))) + .getFinalResult() + .forEach(recognizedForm -> recognizedForm.getFields().forEach((fieldText, fieldValue) -> { + System.out.printf("Field text: %s%n", fieldText); + System.out.printf("Field value: %s%n", fieldValue.getFieldValue()); + System.out.printf("Confidence score: %.2f%n", fieldValue.getConfidence()); + })); + // END: com.azure.ai.formrecognizer.FormRecognizerClient.beginRecognizeCustomFormsFromUrl#string-string-recognizeOptions + } + /** * Code snippet for - * {@link FormRecognizerClient#beginRecognizeCustomForms(InputStream, long, String, FormContentType)} + * {@link FormRecognizerClient#beginRecognizeCustomForms(InputStream, long, String)} * * @throws IOException Exception thrown when there is an error in reading all the bytes from the File. */ public void beginRecognizeCustomForms() throws IOException { - // BEGIN: com.azure.ai.formrecognizer.FormRecognizerClient.beginRecognizeCustomForms#InputStream-long-string-FormContentType + // BEGIN: com.azure.ai.formrecognizer.FormRecognizerClient.beginRecognizeCustomForms#InputStream-long-string File form = new File("{local/file_path/fileName.jpg}"); String modelId = "{custom_trained_model_id}"; byte[] fileContent = Files.readAllBytes(form.toPath()); InputStream targetStream = new ByteArrayInputStream(fileContent); - formRecognizerClient.beginRecognizeCustomForms(targetStream, form.length(), modelId, - FormContentType.IMAGE_JPEG).getFinalResult().forEach(recognizedForm -> - recognizedForm.getFields().entrySet().forEach(entry -> { - String fieldText = entry.getKey(); - FormField fieldValue = entry.getValue(); + formRecognizerClient.beginRecognizeCustomForms(targetStream, form.length(), modelId).getFinalResult() + .forEach(recognizedForm -> recognizedForm.getFields().forEach((fieldText, fieldValue) -> { System.out.printf("Field text: %s%n", fieldText); System.out.printf("Field value: %s%n", fieldValue.getFieldValue()); System.out.printf("Confidence score: %.2f%n", fieldValue.getConfidence()); })); - // END: com.azure.ai.formrecognizer.FormRecognizerClient.beginRecognizeCustomForms#InputStream-long-string-FormContentType + // END: com.azure.ai.formrecognizer.FormRecognizerClient.beginRecognizeCustomForms#InputStream-long-string } /** - * Code snippet for {@link FormRecognizerClient#beginRecognizeCustomForms(RecognizeCustomFormsOptions)} with options + * Code snippet for + * {@link FormRecognizerClient#beginRecognizeCustomForms(InputStream, long, String, RecognizeOptions)} with options * * @throws IOException Exception thrown when there is an error in reading all the bytes from the File. */ public void beginRecognizeCustomFormsWithOptions() throws IOException { - // BEGIN: com.azure.ai.formrecognizer.FormRecognizerClient.beginRecognizeCustomForms#recognizeCustomFormsOptions + // BEGIN: com.azure.ai.formrecognizer.FormRecognizerClient.beginRecognizeCustomForms#InputStream-long-string-recognizeOptions File form = new File("{local/file_path/fileName.jpg}"); String modelId = "{custom_trained_model_id}"; boolean includeFieldElements = true; @@ -117,17 +137,18 @@ public void beginRecognizeCustomFormsWithOptions() throws IOException { byte[] fileContent = Files.readAllBytes(form.toPath()); InputStream targetStream = new ByteArrayInputStream(fileContent); - formRecognizerClient.beginRecognizeCustomForms(new RecognizeCustomFormsOptions(targetStream, - form.length(), modelId).setFormContentType(FormContentType.IMAGE_JPEG) - .setIncludeFieldElements(includeFieldElements).setPollInterval(Duration.ofSeconds(5))).getFinalResult() - .forEach(recognizedForm -> recognizedForm.getFields().entrySet().forEach(entry -> { - String fieldText = entry.getKey(); - FormField fieldValue = entry.getValue(); + formRecognizerClient.beginRecognizeCustomForms(targetStream, form.length(), modelId, + new RecognizeOptions() + .setContentType(FormContentType.IMAGE_JPEG) + .setIncludeFieldElements(includeFieldElements) + .setPollInterval(Duration.ofSeconds(10))) + .getFinalResult() + .forEach(recognizedForm -> recognizedForm.getFields().forEach((fieldText, fieldValue) -> { System.out.printf("Field text: %s%n", fieldText); System.out.printf("Field value: %s%n", fieldValue.getFieldValue()); System.out.printf("Confidence score: %.2f%n", fieldValue.getConfidence()); })); - // END: com.azure.ai.formrecognizer.FormRecognizerClient.beginRecognizeCustomForms#recognizeCustomFormsOptions + // END: com.azure.ai.formrecognizer.FormRecognizerClient.beginRecognizeCustomForms#InputStream-long-string-recognizeOptions } // Recognize Content @@ -150,42 +171,63 @@ public void beginRecognizeContentFromUrl() { } /** - * Code snippet for {@link FormRecognizerClient#beginRecognizeContent(InputStream, long, FormContentType)} + * Code snippet for {@link FormRecognizerClient#beginRecognizeContentFromUrl(String, RecognizeOptions)} with + * options. + */ + public void beginRecognizeContentFromUrlWithOptions() { + // BEGIN: com.azure.ai.formrecognizer.FormRecognizerClient.beginRecognizeContentFromUrl#string-recognizeOptions + String formPath = "{file_source_url}"; + formRecognizerClient.beginRecognizeContentFromUrl(formPath, + new RecognizeOptions() + .setPollInterval(Duration.ofSeconds(5))) + .getFinalResult() + .forEach(recognizedForm -> { + System.out.printf("Page Angle: %s%n", recognizedForm.getTextAngle()); + System.out.printf("Page Dimension unit: %s%n", recognizedForm.getUnit()); + // Table information + System.out.println("Recognized Tables: "); + recognizedForm.getTables().forEach(formTable -> + formTable.getCells().forEach(recognizedTableCell -> + System.out.printf("%s ", recognizedTableCell.getText()))); + }); + // END: com.azure.ai.formrecognizer.FormRecognizerClient.beginRecognizeContentFromUrl#string-recognizeOptions + } + + /** + * Code snippet for {@link FormRecognizerClient#beginRecognizeContent(InputStream, long)} * * @throws IOException Exception thrown when there is an error in reading all the bytes from the File. */ public void beginRecognizeContent() throws IOException { - // BEGIN: com.azure.ai.formrecognizer.FormRecognizerClient.beginRecognizeContent#InputStream-long-FormContentType + // BEGIN: com.azure.ai.formrecognizer.FormRecognizerClient.beginRecognizeContent#InputStream-long File form = new File("{local/file_path/fileName.pdf}"); byte[] fileContent = Files.readAllBytes(form.toPath()); InputStream targetStream = new ByteArrayInputStream(fileContent); - - // Table information - formRecognizerClient.beginRecognizeContent(targetStream, form.length(), FormContentType.APPLICATION_PDF) - .getFinalResult().forEach(recognizedForm -> { + formRecognizerClient.beginRecognizeContent(targetStream, form.length()).getFinalResult() + .forEach(recognizedForm -> { System.out.printf("Page Angle: %f%n", recognizedForm.getTextAngle()); System.out.printf("Page Dimension unit: %s%n", recognizedForm.getUnit()); System.out.println("Recognized Tables: "); recognizedForm.getTables().forEach(formTable -> formTable.getCells().forEach(recognizedTableCell -> System.out.printf("%s ", recognizedTableCell.getText()))); }); - // END: com.azure.ai.formrecognizer.FormRecognizerClient.beginRecognizeContent#InputStream-long-FormContentType + // END: com.azure.ai.formrecognizer.FormRecognizerClient.beginRecognizeContent#InputStream-long } /** - * Code snippet for {@link FormRecognizerClient#beginRecognizeContent(RecognizeOptions)} with options + * Code snippet for {@link FormRecognizerClient#beginRecognizeContent(InputStream, long, RecognizeOptions)} with + * options. * * @throws IOException Exception thrown when there is an error in reading all the bytes from the File. */ public void beginRecognizeContentWithOptions() throws IOException { - // BEGIN: com.azure.ai.formrecognizer.FormRecognizerClient.beginRecognizeContent#recognizeOptions + // BEGIN: com.azure.ai.formrecognizer.FormRecognizerClient.beginRecognizeContent#InputStream-long-recognizeOptions File form = new File("{file_source_url}"); byte[] fileContent = Files.readAllBytes(form.toPath()); InputStream targetStream = new ByteArrayInputStream(fileContent); - formRecognizerClient.beginRecognizeContent( - new RecognizeOptions(targetStream, form.length()) - .setFormContentType(FormContentType.APPLICATION_PDF) + formRecognizerClient.beginRecognizeContent(targetStream, form.length(), + new RecognizeOptions() .setPollInterval(Duration.ofSeconds(5))) .getFinalResult().forEach(recognizedForm -> { System.out.printf("Page Angle: %f%n", recognizedForm.getTextAngle()); @@ -195,7 +237,7 @@ public void beginRecognizeContentWithOptions() throws IOException { recognizedForm.getTables().forEach(formTable -> formTable.getCells().forEach(recognizedTableCell -> System.out.printf("%s ", recognizedTableCell.getText()))); }); - // END: com.azure.ai.formrecognizer.FormRecognizerClient.beginRecognizeContent#recognizeOptions + // END: com.azure.ai.formrecognizer.FormRecognizerClient.beginRecognizeContent#InputStream-long-recognizeOptions } // Recognize Receipts @@ -243,16 +285,59 @@ public void beginRecognizeReceiptsFromUrl() { } /** - * Code snippet for {@link FormRecognizerClient#beginRecognizeReceipts(InputStream, long, FormContentType)} + * Code snippet for {@link FormRecognizerClient#beginRecognizeReceiptsFromUrl(String, RecognizeOptions)} + */ + public void beginRecognizeReceiptsFromUrlWithOptions() { + // BEGIN: com.azure.ai.formrecognizer.FormRecognizerClient.beginRecognizeReceiptsFromUrl#string-recognizeOptions + String receiptUrl = "{file_source_url}"; + formRecognizerClient.beginRecognizeReceiptsFromUrl(receiptUrl).getFinalResult() + .forEach(recognizedReceipt -> { + Map recognizedFields = recognizedReceipt.getRecognizedForm().getFields(); + FormField merchantNameField = recognizedFields.get("MerchantName"); + if (merchantNameField.getFieldValue().getType() == FieldValueType.STRING) { + System.out.printf("Merchant Name: %s, confidence: %.2f%n", + merchantNameField.getFieldValue().asString(), + merchantNameField.getConfidence()); + } + FormField transactionDateField = recognizedFields.get("TransactionDate"); + if (transactionDateField.getFieldValue().getType() == FieldValueType.DATE) { + System.out.printf("Transaction Date: %s, confidence: %.2f%n", + transactionDateField.getFieldValue().asDate(), + transactionDateField.getConfidence()); + } + FormField receiptItemsField = recognizedFields.get("Items"); + System.out.printf("Receipt Items: %n"); + if (receiptItemsField.getFieldValue().getType() == FieldValueType.LIST) { + List receiptItems = receiptItemsField.getFieldValue().asList(); + receiptItems.forEach(receiptItem -> { + if (receiptItem.getFieldValue().getType() == FieldValueType.MAP) { + receiptItem.getFieldValue().asMap().forEach((key, formField) -> { + if (key.equals("Quantity")) { + if (formField.getFieldValue().getType() == FieldValueType.INTEGER) { + System.out.printf("Quantity: %s, confidence: %.2f%n", + formField.getFieldValue().asInteger(), formField.getConfidence()); + } + } + }); + } + }); + } + }); + // END: com.azure.ai.formrecognizer.FormRecognizerClient.beginRecognizeReceiptsFromUrl#string-recognizeOptions + } + + /** + * Code snippet for {@link FormRecognizerClient#beginRecognizeReceipts(InputStream, long)} * * @throws IOException Exception thrown when there is an error in reading all the bytes from the File. */ public void beginRecognizeReceipts() throws IOException { - // BEGIN: com.azure.ai.formrecognizer.FormRecognizerClient.beginRecognizeReceipts#InputStream-long-FormContentType + // BEGIN: com.azure.ai.formrecognizer.FormRecognizerClient.beginRecognizeReceipts#InputStream-long File receipt = new File("{file_source_url}"); byte[] fileContent = Files.readAllBytes(receipt.toPath()); InputStream targetStream = new ByteArrayInputStream(fileContent); - formRecognizerClient.beginRecognizeReceipts(targetStream, receipt.length(), FormContentType.IMAGE_JPEG) + + formRecognizerClient.beginRecognizeReceipts(targetStream, receipt.length()) .getFinalResult().forEach(recognizedReceipt -> { Map recognizedFields = recognizedReceipt.getRecognizedForm().getFields(); FormField merchantNameField = recognizedFields.get("MerchantName"); @@ -285,25 +370,28 @@ public void beginRecognizeReceipts() throws IOException { }); } }); - // END: com.azure.ai.formrecognizer.FormRecognizerClient.beginRecognizeReceipts#InputStream-long-FormContentType + // END: com.azure.ai.formrecognizer.FormRecognizerClient.beginRecognizeReceipts#InputStream-long } /** - * Code snippet for {@link FormRecognizerClient#beginRecognizeReceipts(RecognizeOptions)} with options + * Code snippet for {@link FormRecognizerClient#beginRecognizeReceipts(InputStream, long, RecognizeOptions)} + * with options * * @throws IOException Exception thrown when there is an error in reading all the bytes from the File. */ public void beginRecognizeReceiptsWithOptions() throws IOException { - // BEGIN: com.azure.ai.formrecognizer.FormRecognizerClient.beginRecognizeReceipts#recognizeOptions + + // BEGIN: com.azure.ai.formrecognizer.FormRecognizerClient.beginRecognizeReceipts#InputStream-long-recognizeOptions File receipt = new File("{local/file_path/fileName.jpg}"); boolean includeFieldElements = true; byte[] fileContent = Files.readAllBytes(receipt.toPath()); InputStream targetStream = new ByteArrayInputStream(fileContent); - formRecognizerClient.beginRecognizeReceipts(new RecognizeOptions(targetStream, receipt.length()) - .setFormContentType(FormContentType.IMAGE_JPEG) - .setIncludeFieldElements(includeFieldElements) - .setPollInterval(Duration.ofSeconds(5))).getFinalResult() - .forEach(recognizedReceipt -> { + formRecognizerClient.beginRecognizeReceipts(targetStream, receipt.length(), + new RecognizeOptions() + .setContentType(FormContentType.IMAGE_JPEG) + .setIncludeFieldElements(includeFieldElements) + .setPollInterval(Duration.ofSeconds(5))) + .getFinalResult().forEach(recognizedReceipt -> { Map recognizedFields = recognizedReceipt.getRecognizedForm().getFields(); FormField merchantNameField = recognizedFields.get("MerchantName"); if (merchantNameField.getFieldValue().getType() == FieldValueType.STRING) { @@ -335,6 +423,6 @@ public void beginRecognizeReceiptsWithOptions() throws IOException { }); } }); - // END: com.azure.ai.formrecognizer.FormRecognizerClient.beginRecognizeReceipts#recognizeOptions + // END: com.azure.ai.formrecognizer.FormRecognizerClient.beginRecognizeReceipts#InputStream-long-recognizeOptions } } diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/src/samples/java/com/azure/ai/formrecognizer/GetBoundingBoxes.java b/sdk/formrecognizer/azure-ai-formrecognizer/src/samples/java/com/azure/ai/formrecognizer/GetBoundingBoxes.java index 84e79ed5b3a9e..ed281654cad82 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/src/samples/java/com/azure/ai/formrecognizer/GetBoundingBoxes.java +++ b/sdk/formrecognizer/azure-ai-formrecognizer/src/samples/java/com/azure/ai/formrecognizer/GetBoundingBoxes.java @@ -7,7 +7,7 @@ import com.azure.ai.formrecognizer.models.FormTable; import com.azure.ai.formrecognizer.models.FormWord; import com.azure.ai.formrecognizer.models.OperationResult; -import com.azure.ai.formrecognizer.models.RecognizeCustomFormsOptions; +import com.azure.ai.formrecognizer.models.RecognizeOptions; import com.azure.ai.formrecognizer.models.RecognizedForm; import com.azure.core.credential.AzureKeyCredential; import com.azure.core.util.polling.SyncPoller; @@ -33,9 +33,9 @@ public static void main(String[] args) { .buildClient(); String modelId = "{model_Id}"; - String filePath = "{analyze_file_path}"; + String formUrl = "{form_url}"; SyncPoller> recognizeFormPoller = - client.beginRecognizeCustomForms(new RecognizeCustomFormsOptions(filePath, modelId) + client.beginRecognizeCustomFormsFromUrl(formUrl, modelId, new RecognizeOptions() .setIncludeFieldElements(true)); List recognizedForms = recognizeFormPoller.getFinalResult(); diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/src/samples/java/com/azure/ai/formrecognizer/GetBoundingBoxesAsync.java b/sdk/formrecognizer/azure-ai-formrecognizer/src/samples/java/com/azure/ai/formrecognizer/GetBoundingBoxesAsync.java index a6934c85fbeba..c8931c16ab2ac 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/src/samples/java/com/azure/ai/formrecognizer/GetBoundingBoxesAsync.java +++ b/sdk/formrecognizer/azure-ai-formrecognizer/src/samples/java/com/azure/ai/formrecognizer/GetBoundingBoxesAsync.java @@ -7,7 +7,7 @@ import com.azure.ai.formrecognizer.models.FormTable; import com.azure.ai.formrecognizer.models.FormWord; import com.azure.ai.formrecognizer.models.OperationResult; -import com.azure.ai.formrecognizer.models.RecognizeCustomFormsOptions; +import com.azure.ai.formrecognizer.models.RecognizeOptions; import com.azure.ai.formrecognizer.models.RecognizedForm; import com.azure.core.credential.AzureKeyCredential; import com.azure.core.util.polling.PollerFlux; @@ -35,9 +35,9 @@ public static void main(String[] args) { .buildAsyncClient(); String modelId = "{model_Id}"; - String filePath = "{file_source_url}"; + String formUrl = "{form_url}"; PollerFlux> recognizeFormPoller = - client.beginRecognizeCustomFormsFromUrl(new RecognizeCustomFormsOptions(filePath, modelId) + client.beginRecognizeCustomFormsFromUrl(formUrl, modelId, new RecognizeOptions() .setIncludeFieldElements(true)); Mono> recognizeFormResult = recognizeFormPoller diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/src/samples/java/com/azure/ai/formrecognizer/ReadmeSamples.java b/sdk/formrecognizer/azure-ai-formrecognizer/src/samples/java/com/azure/ai/formrecognizer/ReadmeSamples.java index 1527fb6760e4a..d58e884434b32 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/src/samples/java/com/azure/ai/formrecognizer/ReadmeSamples.java +++ b/sdk/formrecognizer/azure-ai-formrecognizer/src/samples/java/com/azure/ai/formrecognizer/ReadmeSamples.java @@ -7,7 +7,6 @@ import com.azure.ai.formrecognizer.models.CustomFormModel; import com.azure.ai.formrecognizer.models.CustomFormModelInfo; import com.azure.ai.formrecognizer.models.FieldValueType; -import com.azure.ai.formrecognizer.models.FormContentType; import com.azure.ai.formrecognizer.models.FormField; import com.azure.ai.formrecognizer.models.FormPage; import com.azure.ai.formrecognizer.models.OperationResult; @@ -114,12 +113,12 @@ public void recognizeCustomForm() { */ public void recognizeContent() throws IOException { // recognize form content using file input stream - File sourceFile = new File("local/file_path/filename.png"); - byte[] fileContent = Files.readAllBytes(sourceFile.toPath()); + File form = new File("local/file_path/filename.png"); + byte[] fileContent = Files.readAllBytes(form.toPath()); InputStream inputStream = new ByteArrayInputStream(fileContent); SyncPoller> recognizeContentPoller = - formRecognizerClient.beginRecognizeContent(inputStream, sourceFile.length(), FormContentType.IMAGE_PNG); + formRecognizerClient.beginRecognizeContent(inputStream, form.length()); List contentPageResults = recognizeContentPoller.getFinalResult(); diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/src/samples/java/com/azure/ai/formrecognizer/RecognizeContent.java b/sdk/formrecognizer/azure-ai-formrecognizer/src/samples/java/com/azure/ai/formrecognizer/RecognizeContent.java index f76ac27f5df53..2aced3ff91fea 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/src/samples/java/com/azure/ai/formrecognizer/RecognizeContent.java +++ b/sdk/formrecognizer/azure-ai-formrecognizer/src/samples/java/com/azure/ai/formrecognizer/RecognizeContent.java @@ -3,7 +3,6 @@ package com.azure.ai.formrecognizer; -import com.azure.ai.formrecognizer.models.FormContentType; import com.azure.ai.formrecognizer.models.FormPage; import com.azure.ai.formrecognizer.models.FormTable; import com.azure.ai.formrecognizer.models.OperationResult; @@ -43,7 +42,7 @@ public static void main(final String[] args) throws IOException { InputStream targetStream = new ByteArrayInputStream(fileContent); SyncPoller> recognizeContentPoller = - client.beginRecognizeContent(targetStream, sourceFile.length(), FormContentType.IMAGE_JPEG); + client.beginRecognizeContent(targetStream, sourceFile.length()); List contentPageResults = recognizeContentPoller.getFinalResult(); diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/src/samples/java/com/azure/ai/formrecognizer/RecognizeCustomFormsAsync.java b/sdk/formrecognizer/azure-ai-formrecognizer/src/samples/java/com/azure/ai/formrecognizer/RecognizeCustomFormsAsync.java index dfd71a16f35bc..a2391e3763f0f 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/src/samples/java/com/azure/ai/formrecognizer/RecognizeCustomFormsAsync.java +++ b/sdk/formrecognizer/azure-ai-formrecognizer/src/samples/java/com/azure/ai/formrecognizer/RecognizeCustomFormsAsync.java @@ -3,7 +3,6 @@ package com.azure.ai.formrecognizer; -import com.azure.ai.formrecognizer.models.FormContentType; import com.azure.ai.formrecognizer.models.OperationResult; import com.azure.ai.formrecognizer.models.RecognizedForm; import com.azure.core.credential.AzureKeyCredential; @@ -48,8 +47,7 @@ public static void main(String[] args) throws IOException { String modelId = "{modelId}"; PollerFlux> recognizeFormPoller = - client.beginRecognizeCustomForms(toFluxByteBuffer(targetStream), sourceFile.length(), modelId, - FormContentType.APPLICATION_PDF); + client.beginRecognizeCustomForms(toFluxByteBuffer(targetStream), sourceFile.length(), modelId); Mono> recognizeFormResult = recognizeFormPoller .last() diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/src/samples/java/com/azure/ai/formrecognizer/RecognizeReceipts.java b/sdk/formrecognizer/azure-ai-formrecognizer/src/samples/java/com/azure/ai/formrecognizer/RecognizeReceipts.java index 7879d174b9906..da6871ca95b87 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/src/samples/java/com/azure/ai/formrecognizer/RecognizeReceipts.java +++ b/sdk/formrecognizer/azure-ai-formrecognizer/src/samples/java/com/azure/ai/formrecognizer/RecognizeReceipts.java @@ -4,7 +4,6 @@ package com.azure.ai.formrecognizer; import com.azure.ai.formrecognizer.models.FieldValueType; -import com.azure.ai.formrecognizer.models.FormContentType; import com.azure.ai.formrecognizer.models.FormField; import com.azure.ai.formrecognizer.models.OperationResult; import com.azure.ai.formrecognizer.models.RecognizedReceipt; @@ -44,7 +43,7 @@ public static void main(final String[] args) throws IOException { InputStream targetStream = new ByteArrayInputStream(fileContent); SyncPoller> analyzeReceiptPoller = - client.beginRecognizeReceipts(targetStream, sourceFile.length(), FormContentType.IMAGE_JPEG); + client.beginRecognizeReceipts(targetStream, sourceFile.length()); List receiptPageResults = analyzeReceiptPoller.getFinalResult(); diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/src/samples/java/com/azure/ai/formrecognizer/RecognizeReceiptsAsync.java b/sdk/formrecognizer/azure-ai-formrecognizer/src/samples/java/com/azure/ai/formrecognizer/RecognizeReceiptsAsync.java index 86aa524967fe6..f59aeb97cb60e 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/src/samples/java/com/azure/ai/formrecognizer/RecognizeReceiptsAsync.java +++ b/sdk/formrecognizer/azure-ai-formrecognizer/src/samples/java/com/azure/ai/formrecognizer/RecognizeReceiptsAsync.java @@ -4,7 +4,6 @@ package com.azure.ai.formrecognizer; import com.azure.ai.formrecognizer.models.FieldValueType; -import com.azure.ai.formrecognizer.models.FormContentType; import com.azure.ai.formrecognizer.models.FormField; import com.azure.ai.formrecognizer.models.OperationResult; import com.azure.ai.formrecognizer.models.RecognizedReceipt; @@ -48,7 +47,7 @@ public static void main(final String[] args) throws IOException { PollerFlux> analyzeReceiptPoller = client.beginRecognizeReceipts(toFluxByteBuffer(targetStream), - sourceFile.length(), FormContentType.IMAGE_JPEG); + sourceFile.length()); Mono> receiptPageResultsMono = analyzeReceiptPoller .last() diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/src/test/java/com/azure/ai/formrecognizer/FormRecognizerAsyncClientTest.java b/sdk/formrecognizer/azure-ai-formrecognizer/src/test/java/com/azure/ai/formrecognizer/FormRecognizerAsyncClientTest.java index b8e42b0ead8f3..4a63846663ef5 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/src/test/java/com/azure/ai/formrecognizer/FormRecognizerAsyncClientTest.java +++ b/sdk/formrecognizer/azure-ai-formrecognizer/src/test/java/com/azure/ai/formrecognizer/FormRecognizerAsyncClientTest.java @@ -9,7 +9,6 @@ import com.azure.ai.formrecognizer.models.FormPage; import com.azure.ai.formrecognizer.models.FormRecognizerException; import com.azure.ai.formrecognizer.models.OperationResult; -import com.azure.ai.formrecognizer.models.RecognizeCustomFormsOptions; import com.azure.ai.formrecognizer.models.RecognizeOptions; import com.azure.ai.formrecognizer.models.RecognizedForm; import com.azure.ai.formrecognizer.models.RecognizedReceipt; @@ -23,7 +22,6 @@ import org.junit.jupiter.params.provider.MethodSource; import reactor.test.StepVerifier; -import java.io.InputStream; import java.time.Duration; import java.util.List; @@ -81,7 +79,8 @@ public void recognizeReceiptData(HttpClient httpClient, FormRecognizerServiceVer client = getFormRecognizerAsyncClient(httpClient, serviceVersion); receiptDataRunner((data, dataLength) -> { SyncPoller> syncPoller = - client.beginRecognizeReceipts(toFluxByteBuffer(data), dataLength, FormContentType.IMAGE_JPEG) + client.beginRecognizeReceipts(toFluxByteBuffer(data), dataLength, new RecognizeOptions() + .setContentType(FormContentType.IMAGE_JPEG).setPollInterval(durationTestMode)) .getSyncPoller(); syncPoller.waitForCompletion(); validateReceiptResultData(syncPoller.getFinalResult(), false); @@ -96,8 +95,8 @@ public void recognizeReceiptData(HttpClient httpClient, FormRecognizerServiceVer public void recognizeReceiptDataNullData(HttpClient httpClient, FormRecognizerServiceVersion serviceVersion) { client = getFormRecognizerAsyncClient(httpClient, serviceVersion); - assertThrows(RuntimeException.class, () -> client.beginRecognizeReceipts(null, RECEIPT_FILE_LENGTH, - FormContentType.IMAGE_JPEG).getSyncPoller()); + assertThrows(RuntimeException.class, () -> client.beginRecognizeReceipts(null, RECEIPT_FILE_LENGTH) + .getSyncPoller()); } /** @@ -110,7 +109,7 @@ public void recognizeReceiptDataWithContentTypeAutoDetection(HttpClient httpClie client = getFormRecognizerAsyncClient(httpClient, serviceVersion); SyncPoller> syncPoller = client.beginRecognizeReceipts( - new RecognizeOptions(getReplayableBufferData(RECEIPT_LOCAL_URL), RECEIPT_FILE_LENGTH) + getReplayableBufferData(RECEIPT_LOCAL_URL), RECEIPT_FILE_LENGTH, new RecognizeOptions() .setPollInterval(durationTestMode)).getSyncPoller(); syncPoller.waitForCompletion(); @@ -118,16 +117,16 @@ public void recognizeReceiptDataWithContentTypeAutoDetection(HttpClient httpClie } /** - * Verifies receipt data from a document using file data as source and including text content details. + * Verifies receipt data from a document using file data as source and including element reference details. */ @ParameterizedTest(name = DISPLAY_NAME_WITH_ARGUMENTS) @MethodSource("com.azure.ai.formrecognizer.TestUtils#getTestParameters") - public void recognizeReceiptDataTextDetails(HttpClient httpClient, FormRecognizerServiceVersion serviceVersion) { + public void recognizeReceiptDataIncludeFieldElements(HttpClient httpClient, FormRecognizerServiceVersion serviceVersion) { client = getFormRecognizerAsyncClient(httpClient, serviceVersion); - receiptDataRunnerTextDetails((data, includeFieldElements) -> { + receiptDataRunnerFieldElements((data, includeFieldElements) -> { SyncPoller> syncPoller = client.beginRecognizeReceipts( - new RecognizeOptions(toFluxByteBuffer(data), RECEIPT_FILE_LENGTH) - .setFormContentType(FormContentType.IMAGE_JPEG).setIncludeFieldElements(includeFieldElements) + toFluxByteBuffer(data), RECEIPT_FILE_LENGTH, new RecognizeOptions() + .setContentType(FormContentType.IMAGE_JPEG).setIncludeFieldElements(includeFieldElements) .setPollInterval(durationTestMode)).getSyncPoller(); syncPoller.waitForCompletion(); validateReceiptResultData(syncPoller.getFinalResult(), includeFieldElements); @@ -135,17 +134,17 @@ public void recognizeReceiptDataTextDetails(HttpClient httpClient, FormRecognize } /** - * Verifies receipt data from a document using PNG file data as source and including text content details. + * Verifies receipt data from a document using PNG file data as source and including element reference details. */ @ParameterizedTest(name = DISPLAY_NAME_WITH_ARGUMENTS) @MethodSource("com.azure.ai.formrecognizer.TestUtils#getTestParameters") public void recognizeReceiptDataWithPngFile(HttpClient httpClient, FormRecognizerServiceVersion serviceVersion) { client = getFormRecognizerAsyncClient(httpClient, serviceVersion); - receiptPngDataRunnerTextDetails((data, includeFieldElements) -> { + receiptPngDataRunnerFieldElements((data, includeFieldElements) -> { SyncPoller> syncPoller = - client.beginRecognizeReceipts(new RecognizeOptions(toFluxByteBuffer(data), RECEIPT_PNG_FILE_LENGTH) - .setFormContentType(FormContentType.IMAGE_PNG).setIncludeFieldElements(includeFieldElements) + client.beginRecognizeReceipts(toFluxByteBuffer(data), RECEIPT_PNG_FILE_LENGTH, new RecognizeOptions() + .setContentType(FormContentType.IMAGE_PNG).setIncludeFieldElements(includeFieldElements) .setPollInterval(durationTestMode)).getSyncPoller(); syncPoller.waitForCompletion(); validateReceiptResultData(syncPoller.getFinalResult(), true); @@ -162,8 +161,8 @@ public void recognizeReceiptDataWithBlankPdf(HttpClient httpClient, client = getFormRecognizerAsyncClient(httpClient, serviceVersion); blankPdfDataRunner((data, dataLength) -> { SyncPoller> syncPoller = - client.beginRecognizeReceipts(new RecognizeOptions(toFluxByteBuffer(data), dataLength) - .setFormContentType(FormContentType.APPLICATION_PDF).setPollInterval(durationTestMode)) + client.beginRecognizeReceipts(toFluxByteBuffer(data), dataLength, new RecognizeOptions() + .setContentType(FormContentType.APPLICATION_PDF).setPollInterval(durationTestMode)) .getSyncPoller(); syncPoller.waitForCompletion(); validateBlankPdfResultData(syncPoller.getFinalResult()); @@ -176,8 +175,8 @@ public void recognizeReceiptFromDataMultiPage(HttpClient httpClient, FormRecogni client = getFormRecognizerAsyncClient(httpClient, serviceVersion); multipageFromDataRunner((data, dataLength) -> { SyncPoller> syncPoller = client.beginRecognizeReceipts( - new RecognizeOptions(toFluxByteBuffer(data), dataLength) - .setFormContentType(FormContentType.APPLICATION_PDF).setPollInterval(durationTestMode)) + toFluxByteBuffer(data), dataLength, new RecognizeOptions() + .setContentType(FormContentType.APPLICATION_PDF).setPollInterval(durationTestMode)) .getSyncPoller(); syncPoller.waitForCompletion(); validateMultipageReceiptData(syncPoller.getFinalResult()); @@ -210,7 +209,7 @@ public void recognizeReceiptInvalidSourceUrl(HttpClient httpClient, FormRecogniz client = getFormRecognizerAsyncClient(httpClient, serviceVersion); invalidSourceUrlRunner((invalidSourceUrl) -> { HttpResponseException errorResponseException = assertThrows(HttpResponseException.class, - () -> client.beginRecognizeReceiptsFromUrl(new RecognizeOptions(invalidSourceUrl) + () -> client.beginRecognizeReceiptsFromUrl(invalidSourceUrl, new RecognizeOptions() .setPollInterval(durationTestMode)).getSyncPoller().getFinalResult()); ErrorInformation errorInformation = (ErrorInformation) errorResponseException.getValue(); assertEquals(INVALID_IMAGE_URL_ERROR_CODE, errorInformation.getCode()); @@ -224,12 +223,12 @@ public void recognizeReceiptInvalidSourceUrl(HttpClient httpClient, FormRecogniz */ @ParameterizedTest(name = DISPLAY_NAME_WITH_ARGUMENTS) @MethodSource("com.azure.ai.formrecognizer.TestUtils#getTestParameters") - public void recognizeReceiptFromUrlTextContent(HttpClient httpClient, + public void recognizeReceiptFromUrlIncludeFieldElements(HttpClient httpClient, FormRecognizerServiceVersion serviceVersion) { client = getFormRecognizerAsyncClient(httpClient, serviceVersion); - receiptSourceUrlRunnerTextDetails((sourceUrl, includeFieldElements) -> { + receiptSourceUrlRunnerFieldElements((sourceUrl, includeFieldElements) -> { SyncPoller> syncPoller = client.beginRecognizeReceiptsFromUrl( - new RecognizeOptions(sourceUrl).setIncludeFieldElements(includeFieldElements) + sourceUrl, new RecognizeOptions().setIncludeFieldElements(includeFieldElements) .setPollInterval(durationTestMode)).getSyncPoller(); syncPoller.waitForCompletion(); validateReceiptResultData(syncPoller.getFinalResult(), includeFieldElements); @@ -237,17 +236,17 @@ public void recognizeReceiptFromUrlTextContent(HttpClient httpClient, } /** - * Verifies receipt data for a document using source as PNG file url and include content when includeFieldElements is - * true. + * Verifies receipt data for a document using source as PNG file url and include element references when + * includeFieldElements is true. */ @ParameterizedTest(name = DISPLAY_NAME_WITH_ARGUMENTS) @MethodSource("com.azure.ai.formrecognizer.TestUtils#getTestParameters") public void recognizeReceiptSourceUrlWithPngFile(HttpClient httpClient, FormRecognizerServiceVersion serviceVersion) { client = getFormRecognizerAsyncClient(httpClient, serviceVersion); - receiptPngSourceUrlRunnerTextDetails((sourceUrl, includeFieldElements) -> { + receiptPngSourceUrlRunnerFieldElements((sourceUrl, includeFieldElements) -> { SyncPoller> syncPoller = client.beginRecognizeReceiptsFromUrl( - new RecognizeOptions(sourceUrl).setIncludeFieldElements(includeFieldElements) + sourceUrl, new RecognizeOptions().setIncludeFieldElements(includeFieldElements) .setPollInterval(durationTestMode)) .getSyncPoller(); syncPoller.waitForCompletion(); @@ -260,8 +259,8 @@ public void recognizeReceiptSourceUrlWithPngFile(HttpClient httpClient, public void recognizeReceiptFromUrlMultiPage(HttpClient httpClient, FormRecognizerServiceVersion serviceVersion) { client = getFormRecognizerAsyncClient(httpClient, serviceVersion); multipageFromUrlRunner(fileUrl -> { - SyncPoller> syncPoller = client.beginRecognizeReceipts( - new RecognizeOptions(fileUrl).setPollInterval(durationTestMode)).getSyncPoller(); + SyncPoller> syncPoller = client.beginRecognizeReceiptsFromUrl( + fileUrl, new RecognizeOptions().setPollInterval(durationTestMode)).getSyncPoller(); syncPoller.waitForCompletion(); validateMultipageReceiptData(syncPoller.getFinalResult()); }); @@ -280,7 +279,9 @@ public void recognizeContent(HttpClient httpClient, FormRecognizerServiceVersion client = getFormRecognizerAsyncClient(httpClient, serviceVersion); contentFromDataRunner((data, dataLength) -> { SyncPoller> syncPoller = client.beginRecognizeContent( - toFluxByteBuffer(data), dataLength, FormContentType.IMAGE_JPEG).getSyncPoller(); + toFluxByteBuffer(data), dataLength, new RecognizeOptions() + .setContentType(FormContentType.IMAGE_JPEG).setPollInterval(durationTestMode)) + .getSyncPoller(); syncPoller.waitForCompletion(); validateContentResultData(syncPoller.getFinalResult(), false); }); @@ -292,8 +293,8 @@ public void recognizeContent(HttpClient httpClient, FormRecognizerServiceVersion @ParameterizedTest(name = DISPLAY_NAME_WITH_ARGUMENTS) @MethodSource("com.azure.ai.formrecognizer.TestUtils#getTestParameters") public void recognizeContentResultWithNullData(HttpClient httpClient, FormRecognizerServiceVersion serviceVersion) { - assertThrows(RuntimeException.class, () -> client.beginRecognizeContent(null, LAYOUT_FILE_LENGTH, - FormContentType.IMAGE_JPEG).getSyncPoller()); + assertThrows(RuntimeException.class, () -> client.beginRecognizeContent(null, LAYOUT_FILE_LENGTH) + .getSyncPoller()); } /** @@ -306,7 +307,7 @@ public void recognizeContentResultWithContentTypeAutoDetection(HttpClient httpCl client = getFormRecognizerAsyncClient(httpClient, serviceVersion); contentFromDataRunner((data, dataLength) -> { SyncPoller> syncPoller = client.beginRecognizeContent( - new RecognizeOptions(getReplayableBufferData(LAYOUT_LOCAL_URL), dataLength) + getReplayableBufferData(LAYOUT_LOCAL_URL), dataLength, new RecognizeOptions() .setPollInterval(durationTestMode)).getSyncPoller(); syncPoller.waitForCompletion(); validateContentResultData(syncPoller.getFinalResult(), false); @@ -322,8 +323,8 @@ public void recognizeContentResultWithBlankPdf(HttpClient httpClient, FormRecogn client = getFormRecognizerAsyncClient(httpClient, serviceVersion); blankPdfDataRunner((data, dataLength) -> { SyncPoller> syncPoller = client.beginRecognizeContent( - new RecognizeOptions(toFluxByteBuffer(data), dataLength) - .setFormContentType(FormContentType.APPLICATION_PDF).setPollInterval(durationTestMode)) + toFluxByteBuffer(data), dataLength, new RecognizeOptions() + .setContentType(FormContentType.APPLICATION_PDF).setPollInterval(durationTestMode)) .getSyncPoller(); syncPoller.waitForCompletion(); validateContentResultData(syncPoller.getFinalResult(), false); @@ -336,8 +337,8 @@ public void recognizeContentFromDataMultiPage(HttpClient httpClient, FormRecogni client = getFormRecognizerAsyncClient(httpClient, serviceVersion); multipageFromDataRunner((data, dataLength) -> { SyncPoller> syncPoller = client.beginRecognizeContent( - new RecognizeOptions(toFluxByteBuffer(data), dataLength) - .setFormContentType(FormContentType.APPLICATION_PDF).setPollInterval(durationTestMode)) + toFluxByteBuffer(data), dataLength, new RecognizeOptions() + .setContentType(FormContentType.APPLICATION_PDF).setPollInterval(durationTestMode)) .getSyncPoller(); syncPoller.waitForCompletion(); validateContentResultData(syncPoller.getFinalResult(), false); @@ -370,7 +371,7 @@ public void recognizeContentFromUrlWithPdf(HttpClient httpClient, FormRecognizer client = getFormRecognizerAsyncClient(httpClient, serviceVersion); pdfContentFromUrlRunner(sourceUrl -> { SyncPoller> syncPoller = - client.beginRecognizeContent(new RecognizeOptions(sourceUrl).setPollInterval(durationTestMode)) + client.beginRecognizeContentFromUrl(sourceUrl, new RecognizeOptions().setPollInterval(durationTestMode)) .getSyncPoller(); syncPoller.waitForCompletion(); validateContentResultData(syncPoller.getFinalResult(), false); @@ -386,7 +387,7 @@ public void recognizeContentInvalidSourceUrl(HttpClient httpClient, FormRecogniz client = getFormRecognizerAsyncClient(httpClient, serviceVersion); invalidSourceUrlRunner((invalidSourceUrl) -> { HttpResponseException errorResponseException = assertThrows(HttpResponseException.class, - () -> client.beginRecognizeContent(new RecognizeOptions(invalidSourceUrl) + () -> client.beginRecognizeContentFromUrl(invalidSourceUrl, new RecognizeOptions() .setPollInterval(durationTestMode)).getSyncPoller().getFinalResult()); ErrorInformation errorInformation = (ErrorInformation) errorResponseException.getValue(); assertEquals(INVALID_IMAGE_URL_ERROR_CODE, errorInformation.getCode()); @@ -398,9 +399,9 @@ public void recognizeContentInvalidSourceUrl(HttpClient httpClient, FormRecogniz @MethodSource("com.azure.ai.formrecognizer.TestUtils#getTestParameters") public void recognizeContentFromUrlMultiPage(HttpClient httpClient, FormRecognizerServiceVersion serviceVersion) { client = getFormRecognizerAsyncClient(httpClient, serviceVersion); - multipageFromUrlRunner((fileUrl) -> { - SyncPoller> syncPoller = client.beginRecognizeContent( - new RecognizeOptions(fileUrl).setPollInterval(durationTestMode)).getSyncPoller(); + multipageFromUrlRunner((formUrl) -> { + SyncPoller> syncPoller = client.beginRecognizeContentFromUrl( + formUrl, new RecognizeOptions().setPollInterval(durationTestMode)).getSyncPoller(); syncPoller.waitForCompletion(); validateContentResultData(syncPoller.getFinalResult(), false); }); @@ -425,9 +426,9 @@ public void recognizeCustomFormLabeledData(HttpClient httpClient, FormRecognizer trainingPoller.waitForCompletion(); SyncPoller> syncPoller = - client.beginRecognizeCustomForms(new RecognizeCustomFormsOptions(toFluxByteBuffer(data), - dataLength, trainingPoller.getFinalResult().getModelId()) - .setFormContentType(FormContentType.APPLICATION_PDF).setIncludeFieldElements(true) + client.beginRecognizeCustomForms(toFluxByteBuffer(data), + dataLength, trainingPoller.getFinalResult().getModelId(), new RecognizeOptions() + .setContentType(FormContentType.APPLICATION_PDF).setIncludeFieldElements(true) .setPollInterval(durationTestMode)).getSyncPoller(); syncPoller.waitForCompletion(); validateRecognizedResult(syncPoller.getFinalResult(), true, true); @@ -450,8 +451,9 @@ public void recognizeCustomFormLabeledDataWithJpgContentType(HttpClient httpClie trainingPoller.waitForCompletion(); SyncPoller> syncPoller = client.beginRecognizeCustomForms( - new RecognizeCustomFormsOptions(toFluxByteBuffer(data), dataLength, - trainingPoller.getFinalResult().getModelId()).setFormContentType(FormContentType.IMAGE_JPEG) + toFluxByteBuffer(data), dataLength, + trainingPoller.getFinalResult().getModelId(), new RecognizeOptions() + .setContentType(FormContentType.IMAGE_JPEG) .setPollInterval(durationTestMode)).getSyncPoller(); syncPoller.waitForCompletion(); validateRecognizedResult(syncPoller.getFinalResult(), false, true); @@ -474,8 +476,9 @@ public void recognizeCustomFormLabeledDataWithBlankPdfContentType(HttpClient htt trainingPoller.waitForCompletion(); SyncPoller> syncPoller = client.beginRecognizeCustomForms( - new RecognizeCustomFormsOptions(toFluxByteBuffer(data), dataLength, - trainingPoller.getFinalResult().getModelId()).setFormContentType(FormContentType.APPLICATION_PDF) + toFluxByteBuffer(data), dataLength, + trainingPoller.getFinalResult().getModelId(), new RecognizeOptions() + .setContentType(FormContentType.APPLICATION_PDF) .setPollInterval(durationTestMode)).getSyncPoller(); syncPoller.waitForCompletion(); validateRecognizedResult(syncPoller.getFinalResult(), false, true); @@ -484,11 +487,11 @@ public void recognizeCustomFormLabeledDataWithBlankPdfContentType(HttpClient htt /** * Verifies custom form data for a document using source as input stream data and valid labeled model Id, - * excluding text content. + * excluding element references. */ @ParameterizedTest(name = DISPLAY_NAME_WITH_ARGUMENTS) @MethodSource("com.azure.ai.formrecognizer.TestUtils#getTestParameters") - public void recognizeCustomFormLabeledDataExcludeTextContent(HttpClient httpClient, + public void recognizeCustomFormLabeledDataExcludeFieldElements(HttpClient httpClient, FormRecognizerServiceVersion serviceVersion) { client = getFormRecognizerAsyncClient(httpClient, serviceVersion); customFormDataRunner((data, dataLength) -> @@ -499,8 +502,9 @@ public void recognizeCustomFormLabeledDataExcludeTextContent(HttpClient httpClie trainingPoller.waitForCompletion(); SyncPoller> syncPoller = client.beginRecognizeCustomForms( - new RecognizeCustomFormsOptions(toFluxByteBuffer(data), dataLength, - trainingPoller.getFinalResult().getModelId()).setFormContentType(FormContentType.APPLICATION_PDF) + toFluxByteBuffer(data), dataLength, + trainingPoller.getFinalResult().getModelId(), new RecognizeOptions() + .setContentType(FormContentType.APPLICATION_PDF) .setPollInterval(durationTestMode)).getSyncPoller(); syncPoller.waitForCompletion(); validateRecognizedResult(syncPoller.getFinalResult(), false, true); @@ -523,9 +527,10 @@ public void recognizeCustomFormLabeledDataWithNullFormData(HttpClient httpClient syncPoller.waitForCompletion(); assertThrows(RuntimeException.class, () -> client.beginRecognizeCustomForms( - new RecognizeCustomFormsOptions((InputStream) null, dataLength, - syncPoller.getFinalResult().getModelId()).setFormContentType(FormContentType.APPLICATION_PDF) - .setIncludeFieldElements(true).setPollInterval(durationTestMode)).getSyncPoller()); + null, dataLength, + syncPoller.getFinalResult().getModelId(), new RecognizeOptions() + .setContentType(FormContentType.APPLICATION_PDF) + .setIncludeFieldElements(true).setPollInterval(durationTestMode)).getSyncPoller()); })); } @@ -539,8 +544,8 @@ public void recognizeCustomFormLabeledDataWithNullModelId(HttpClient httpClient, client = getFormRecognizerAsyncClient(httpClient, serviceVersion); customFormDataRunner((data, dataLength) -> { Exception ex = assertThrows(RuntimeException.class, () -> client.beginRecognizeCustomForms( - new RecognizeCustomFormsOptions(toFluxByteBuffer(data), dataLength, - null).setFormContentType(FormContentType.APPLICATION_PDF).setIncludeFieldElements(true) + toFluxByteBuffer(data), dataLength, + null, new RecognizeOptions().setContentType(FormContentType.APPLICATION_PDF).setIncludeFieldElements(true) .setPollInterval(durationTestMode)).getSyncPoller()); assertEquals(EXPECTED_MODEL_ID_IS_REQUIRED_EXCEPTION_MESSAGE, ex.getMessage()); }); @@ -556,8 +561,8 @@ public void recognizeCustomFormLabeledDataWithEmptyModelId(HttpClient httpClient client = getFormRecognizerAsyncClient(httpClient, serviceVersion); customFormDataRunner((data, dataLength) -> { Exception ex = assertThrows(RuntimeException.class, () -> client.beginRecognizeCustomForms( - new RecognizeCustomFormsOptions(toFluxByteBuffer(data), dataLength, "") - .setFormContentType(FormContentType.APPLICATION_PDF).setIncludeFieldElements(true) + toFluxByteBuffer(data), dataLength, "", new RecognizeOptions() + .setContentType(FormContentType.APPLICATION_PDF).setIncludeFieldElements(true) .setPollInterval(durationTestMode)).getSyncPoller()); assertEquals(EXPECTED_INVALID_UUID_EXCEPTION_MESSAGE, ex.getMessage()); }); @@ -575,8 +580,9 @@ public void recognizeCustomFormInvalidStatus(HttpClient httpClient, FormRecogniz syncPoller.waitForCompletion(); CustomFormModel createdModel = syncPoller.getFinalResult(); FormRecognizerException formRecognizerException = assertThrows(FormRecognizerException.class, - () -> client.beginRecognizeCustomForms(new RecognizeCustomFormsOptions( - invalidSourceUrl, createdModel.getModelId()).setPollInterval(durationTestMode)) + () -> client.beginRecognizeCustomFormsFromUrl( + invalidSourceUrl, createdModel.getModelId(), new RecognizeOptions() + .setPollInterval(durationTestMode)) .getSyncPoller().getFinalResult()); ErrorInformation errorInformation = formRecognizerException.getErrorInformation().get(0); // TODO: Service bug https://github.com/Azure/azure-sdk-for-java/issues/12046 @@ -602,8 +608,8 @@ public void recognizeCustomFormLabeledDataWithContentTypeAutoDetection(HttpClien trainingPoller.waitForCompletion(); SyncPoller> syncPoller = client.beginRecognizeCustomForms( - new RecognizeCustomFormsOptions(getReplayableBufferData(FORM_LOCAL_URL), dataLength, - trainingPoller.getFinalResult().getModelId()) + getReplayableBufferData(FORM_LOCAL_URL), dataLength, + trainingPoller.getFinalResult().getModelId(), new RecognizeOptions() .setIncludeFieldElements(true).setPollInterval(durationTestMode)).getSyncPoller(); syncPoller.waitForCompletion(); validateRecognizedResult(syncPoller.getFinalResult(), true, true); @@ -626,9 +632,9 @@ public void recognizeCustomFormMultiPageLabeled(HttpClient httpClient, trainingPoller.waitForCompletion(); SyncPoller> syncPoller = client.beginRecognizeCustomForms( - new RecognizeCustomFormsOptions(toFluxByteBuffer(data), dataLength, - trainingPoller.getFinalResult().getModelId()) - .setFormContentType(FormContentType.APPLICATION_PDF).setPollInterval(durationTestMode)) + toFluxByteBuffer(data), dataLength, + trainingPoller.getFinalResult().getModelId(), new RecognizeOptions() + .setContentType(FormContentType.APPLICATION_PDF).setPollInterval(durationTestMode)) .getSyncPoller(); syncPoller.waitForCompletion(); validateMultiPageDataLabeled(syncPoller.getFinalResult()); @@ -652,21 +658,20 @@ public void recognizeCustomFormUnlabeledData(HttpClient httpClient, FormRecogniz trainingPoller.waitForCompletion(); SyncPoller> syncPoller = client.beginRecognizeCustomForms( - new RecognizeCustomFormsOptions(toFluxByteBuffer(data), dataLength, - trainingPoller.getFinalResult().getModelId()) - .setFormContentType(FormContentType.APPLICATION_PDF).setPollInterval(durationTestMode)) + toFluxByteBuffer(data), dataLength, + trainingPoller.getFinalResult().getModelId(), new RecognizeOptions() + .setContentType(FormContentType.APPLICATION_PDF).setPollInterval(durationTestMode)) .getSyncPoller(); syncPoller.waitForCompletion(); validateRecognizedResult(syncPoller.getFinalResult(), false, false); })); } - /** * Verifies custom form data for a document using source as input stream data and valid include text content */ @ParameterizedTest(name = DISPLAY_NAME_WITH_ARGUMENTS) @MethodSource("com.azure.ai.formrecognizer.TestUtils#getTestParameters") - public void recognizeCustomFormUnlabeledDataIncludeTextContent(HttpClient httpClient, + public void recognizeCustomFormUnlabeledDataIncludeFieldElements(HttpClient httpClient, FormRecognizerServiceVersion serviceVersion) { client = getFormRecognizerAsyncClient(httpClient, serviceVersion); customFormDataRunner((data, dataLength) -> @@ -677,9 +682,9 @@ public void recognizeCustomFormUnlabeledDataIncludeTextContent(HttpClient httpCl trainingPoller.waitForCompletion(); SyncPoller> syncPoller = client.beginRecognizeCustomForms( - new RecognizeCustomFormsOptions(toFluxByteBuffer(data), dataLength, - trainingPoller.getFinalResult().getModelId()) - .setFormContentType(FormContentType.APPLICATION_PDF) + toFluxByteBuffer(data), dataLength, + trainingPoller.getFinalResult().getModelId(), new RecognizeOptions() + .setContentType(FormContentType.APPLICATION_PDF) .setIncludeFieldElements(true).setPollInterval(durationTestMode)).getSyncPoller(); syncPoller.waitForCompletion(); validateRecognizedResult(syncPoller.getFinalResult(), true, false); @@ -703,9 +708,9 @@ public void recognizeCustomFormMultiPageUnlabeled(HttpClient httpClient, trainingPoller.waitForCompletion(); SyncPoller> syncPoller = client.beginRecognizeCustomForms( - new RecognizeCustomFormsOptions(toFluxByteBuffer(data), dataLength, - trainingPoller.getFinalResult().getModelId()) - .setFormContentType(FormContentType.APPLICATION_PDF).setPollInterval(durationTestMode)) + toFluxByteBuffer(data), dataLength, + trainingPoller.getFinalResult().getModelId(), new RecognizeOptions() + .setContentType(FormContentType.APPLICATION_PDF).setPollInterval(durationTestMode)) .getSyncPoller(); syncPoller.waitForCompletion(); validateMultiPageDataUnlabeled(syncPoller.getFinalResult()); @@ -729,8 +734,9 @@ public void recognizeCustomFormUnlabeledDataWithJpgContentType(HttpClient httpCl trainingPoller.waitForCompletion(); SyncPoller> syncPoller = client.beginRecognizeCustomForms( - new RecognizeCustomFormsOptions(toFluxByteBuffer(data), dataLength, - trainingPoller.getFinalResult().getModelId()).setFormContentType(FormContentType.IMAGE_JPEG) + toFluxByteBuffer(data), dataLength, + trainingPoller.getFinalResult().getModelId(), new RecognizeOptions() + .setContentType(FormContentType.IMAGE_JPEG) .setPollInterval(durationTestMode)).getSyncPoller(); syncPoller.waitForCompletion(); validateRecognizedResult(syncPoller.getFinalResult(), false, false); @@ -753,9 +759,9 @@ public void recognizeCustomFormUnlabeledDataWithBlankPdfContentType(HttpClient h trainingPoller.waitForCompletion(); SyncPoller> syncPoller = client.beginRecognizeCustomForms( - new RecognizeCustomFormsOptions(toFluxByteBuffer(data), dataLength, - trainingPoller.getFinalResult().getModelId()) - .setFormContentType(FormContentType.APPLICATION_PDF).setPollInterval(durationTestMode)) + toFluxByteBuffer(data), dataLength, + trainingPoller.getFinalResult().getModelId(), new RecognizeOptions() + .setContentType(FormContentType.APPLICATION_PDF).setPollInterval(durationTestMode)) .getSyncPoller(); syncPoller.waitForCompletion(); validateRecognizedResult(syncPoller.getFinalResult(), false, false); @@ -780,8 +786,8 @@ public void recognizeCustomFormUrlUnlabeledData(HttpClient httpClient, useTrainingLabels, null, durationTestMode).getSyncPoller(); trainingPoller.waitForCompletion(); - SyncPoller> syncPoller = client.beginRecognizeCustomForms( - new RecognizeCustomFormsOptions(fileUrl, trainingPoller.getFinalResult().getModelId()) + SyncPoller> syncPoller = client.beginRecognizeCustomFormsFromUrl( + fileUrl, trainingPoller.getFinalResult().getModelId(), new RecognizeOptions() .setPollInterval(durationTestMode)).getSyncPoller(); syncPoller.waitForCompletion(); validateRecognizedResult(syncPoller.getFinalResult(), false, false); @@ -789,11 +795,11 @@ public void recognizeCustomFormUrlUnlabeledData(HttpClient httpClient, } /** - * Verifies custom form data for an URL document data without labeled data and include text content + * Verifies custom form data for an URL document data without labeled data and include element references. */ @ParameterizedTest(name = DISPLAY_NAME_WITH_ARGUMENTS) @MethodSource("com.azure.ai.formrecognizer.TestUtils#getTestParameters") - public void recognizeCustomFormUrlUnlabeledDataIncludeTextContent(HttpClient httpClient, + public void recognizeCustomFormUrlUnlabeledDataIncludeFieldElements(HttpClient httpClient, FormRecognizerServiceVersion serviceVersion) { client = getFormRecognizerAsyncClient(httpClient, serviceVersion); urlRunner(fileUrl -> @@ -803,8 +809,8 @@ public void recognizeCustomFormUrlUnlabeledDataIncludeTextContent(HttpClient htt useTrainingLabels, null, durationTestMode).getSyncPoller(); trainingPoller.waitForCompletion(); - SyncPoller> syncPoller = client.beginRecognizeCustomForms( - new RecognizeCustomFormsOptions(fileUrl, trainingPoller.getFinalResult().getModelId()) + SyncPoller> syncPoller = client.beginRecognizeCustomFormsFromUrl( + fileUrl, trainingPoller.getFinalResult().getModelId(), new RecognizeOptions() .setIncludeFieldElements(true).setPollInterval(durationTestMode)).getSyncPoller(); syncPoller.waitForCompletion(); validateRecognizedResult(syncPoller.getFinalResult(), true, false); @@ -826,8 +832,8 @@ public void recognizeCustomFormUrlMultiPageUnlabeled(HttpClient httpClient, false, null, durationTestMode).getSyncPoller(); trainingPoller.waitForCompletion(); - SyncPoller> syncPoller = client.beginRecognizeCustomForms( - new RecognizeCustomFormsOptions(fileUrl, trainingPoller.getFinalResult().getModelId()) + SyncPoller> syncPoller = client.beginRecognizeCustomFormsFromUrl( + fileUrl, trainingPoller.getFinalResult().getModelId(), new RecognizeOptions() .setPollInterval(durationTestMode)).getSyncPoller(); syncPoller.waitForCompletion(); validateMultiPageDataUnlabeled(syncPoller.getFinalResult()); @@ -865,7 +871,7 @@ public void recognizeCustomFormFromUrlLabeledDataWithNullModelId(HttpClient http client = getFormRecognizerAsyncClient(httpClient, serviceVersion); multipageFromUrlRunner(fileUrl -> { Exception ex = assertThrows(RuntimeException.class, () -> - client.beginRecognizeCustomForms(new RecognizeCustomFormsOptions(fileUrl, null) + client.beginRecognizeCustomFormsFromUrl(fileUrl, null, new RecognizeOptions() .setPollInterval(durationTestMode)).getSyncPoller()); assertEquals(EXPECTED_MODEL_ID_IS_REQUIRED_EXCEPTION_MESSAGE, ex.getMessage()); }); @@ -881,7 +887,7 @@ public void recognizeCustomFormFromUrlLabeledDataWithEmptyModelId(HttpClient htt client = getFormRecognizerAsyncClient(httpClient, serviceVersion); multipageFromUrlRunner(fileUrl -> { Exception ex = assertThrows(RuntimeException.class, () -> - client.beginRecognizeCustomForms(new RecognizeCustomFormsOptions(fileUrl, "") + client.beginRecognizeCustomFormsFromUrl(fileUrl, "", new RecognizeOptions() .setPollInterval(durationTestMode)).getSyncPoller()); assertEquals(EXPECTED_INVALID_UUID_EXCEPTION_MESSAGE, ex.getMessage()); }); @@ -901,8 +907,8 @@ public void recognizeCustomFormUrlLabeledData(HttpClient httpClient, FormRecogni useTrainingLabels, null, durationTestMode).getSyncPoller(); trainingPoller.waitForCompletion(); - SyncPoller> syncPoller = client.beginRecognizeCustomForms( - new RecognizeCustomFormsOptions(fileUrl, trainingPoller.getFinalResult().getModelId()) + SyncPoller> syncPoller = client.beginRecognizeCustomFormsFromUrl( + fileUrl, trainingPoller.getFinalResult().getModelId(), new RecognizeOptions() .setPollInterval(durationTestMode)).getSyncPoller(); syncPoller.waitForCompletion(); validateRecognizedResult(syncPoller.getFinalResult(), false, true); @@ -910,11 +916,11 @@ public void recognizeCustomFormUrlLabeledData(HttpClient httpClient, FormRecogni } /** - * Verifies custom form data for an URL document data with labeled data and include text content + * Verifies custom form data for an URL document data with labeled data and include element references. */ @ParameterizedTest(name = DISPLAY_NAME_WITH_ARGUMENTS) @MethodSource("com.azure.ai.formrecognizer.TestUtils#getTestParameters") - public void recognizeCustomFormUrlLabeledDataIncludeTextContent(HttpClient httpClient, + public void recognizeCustomFormUrlLabeledDataIncludeFieldElements(HttpClient httpClient, FormRecognizerServiceVersion serviceVersion) { client = getFormRecognizerAsyncClient(httpClient, serviceVersion); urlRunner(fileUrl -> @@ -924,8 +930,8 @@ public void recognizeCustomFormUrlLabeledDataIncludeTextContent(HttpClient httpC useTrainingLabels, null, durationTestMode).getSyncPoller(); trainingPoller.waitForCompletion(); - SyncPoller> syncPoller = client.beginRecognizeCustomForms( - new RecognizeCustomFormsOptions(fileUrl, trainingPoller.getFinalResult().getModelId()) + SyncPoller> syncPoller = client.beginRecognizeCustomFormsFromUrl( + fileUrl, trainingPoller.getFinalResult().getModelId(), new RecognizeOptions() .setIncludeFieldElements(true).setPollInterval(durationTestMode)).getSyncPoller(); syncPoller.waitForCompletion(); validateRecognizedResult(syncPoller.getFinalResult(), true, true); @@ -947,8 +953,8 @@ public void recognizeCustomFormUrlMultiPageLabeled(HttpClient httpClient, .beginTraining(trainingFilesUrl, true, null, durationTestMode).getSyncPoller(); trainingPoller.waitForCompletion(); - SyncPoller> syncPoller = client.beginRecognizeCustomForms( - new RecognizeCustomFormsOptions(fileUrl, trainingPoller.getFinalResult().getModelId()) + SyncPoller> syncPoller = client.beginRecognizeCustomFormsFromUrl( + fileUrl, trainingPoller.getFinalResult().getModelId(), new RecognizeOptions() .setPollInterval(durationTestMode)).getSyncPoller(); syncPoller.waitForCompletion(); validateMultiPageDataLabeled(syncPoller.getFinalResult()); diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/src/test/java/com/azure/ai/formrecognizer/FormRecognizerClientTest.java b/sdk/formrecognizer/azure-ai-formrecognizer/src/test/java/com/azure/ai/formrecognizer/FormRecognizerClientTest.java index fe792ae7f5318..860e06541abfb 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/src/test/java/com/azure/ai/formrecognizer/FormRecognizerClientTest.java +++ b/sdk/formrecognizer/azure-ai-formrecognizer/src/test/java/com/azure/ai/formrecognizer/FormRecognizerClientTest.java @@ -9,7 +9,6 @@ import com.azure.ai.formrecognizer.models.FormPage; import com.azure.ai.formrecognizer.models.FormRecognizerException; import com.azure.ai.formrecognizer.models.OperationResult; -import com.azure.ai.formrecognizer.models.RecognizeCustomFormsOptions; import com.azure.ai.formrecognizer.models.RecognizeOptions; import com.azure.ai.formrecognizer.models.RecognizedForm; import com.azure.ai.formrecognizer.models.RecognizedReceipt; @@ -65,7 +64,8 @@ public void recognizeReceiptData(HttpClient httpClient, FormRecognizerServiceVer client = getFormRecognizerClient(httpClient, serviceVersion); receiptDataRunner((data, dataLength) -> { SyncPoller> syncPoller = - client.beginRecognizeReceipts(data, dataLength, FormContentType.IMAGE_JPEG); + client.beginRecognizeReceipts(data, dataLength, new RecognizeOptions() + .setContentType(FormContentType.IMAGE_JPEG).setPollInterval(durationTestMode)); syncPoller.waitForCompletion(); validateReceiptResultData(syncPoller.getFinalResult(), false); }); @@ -80,7 +80,7 @@ public void recognizeReceiptDataNullData(HttpClient httpClient, FormRecognizerServiceVersion serviceVersion) { client = getFormRecognizerClient(httpClient, serviceVersion); assertThrows(RuntimeException.class, () -> - client.beginRecognizeReceipts(null, RECEIPT_FILE_LENGTH, FormContentType.IMAGE_JPEG)); + client.beginRecognizeReceipts(null, RECEIPT_FILE_LENGTH)); } /** @@ -92,7 +92,7 @@ public void recognizeReceiptDataWithContentTypeAutoDetection(HttpClient httpClie FormRecognizerServiceVersion serviceVersion) { client = getFormRecognizerClient(httpClient, serviceVersion); SyncPoller> syncPoller = client.beginRecognizeReceipts( - new RecognizeOptions(getContentDetectionFileData(RECEIPT_LOCAL_URL), RECEIPT_FILE_LENGTH) + getContentDetectionFileData(RECEIPT_LOCAL_URL), RECEIPT_FILE_LENGTH, new RecognizeOptions() .setPollInterval(durationTestMode)); syncPoller.waitForCompletion(); validateReceiptResultData(syncPoller.getFinalResult(), false); @@ -104,11 +104,11 @@ public void recognizeReceiptDataWithContentTypeAutoDetection(HttpClient httpClie */ @ParameterizedTest(name = DISPLAY_NAME_WITH_ARGUMENTS) @MethodSource("com.azure.ai.formrecognizer.TestUtils#getTestParameters") - public void recognizeReceiptDataTextDetails(HttpClient httpClient, FormRecognizerServiceVersion serviceVersion) { + public void recognizeReceiptDataIncludeFieldElements(HttpClient httpClient, FormRecognizerServiceVersion serviceVersion) { client = getFormRecognizerClient(httpClient, serviceVersion); - receiptDataRunnerTextDetails((data, includeFieldElements) -> { + receiptDataRunnerFieldElements((data, includeFieldElements) -> { SyncPoller> syncPoller = client.beginRecognizeReceipts( - new RecognizeOptions(data, RECEIPT_FILE_LENGTH).setFormContentType(FormContentType.IMAGE_JPEG) + data, RECEIPT_FILE_LENGTH, new RecognizeOptions().setContentType(FormContentType.IMAGE_JPEG) .setIncludeFieldElements(includeFieldElements).setPollInterval(durationTestMode)); syncPoller.waitForCompletion(); validateReceiptResultData(syncPoller.getFinalResult(), includeFieldElements); @@ -123,9 +123,9 @@ public void recognizeReceiptDataTextDetails(HttpClient httpClient, FormRecognize public void recognizeReceiptDataWithPngFile(HttpClient httpClient, FormRecognizerServiceVersion serviceVersion) { client = getFormRecognizerClient(httpClient, serviceVersion); - receiptPngDataRunnerTextDetails((data, includeFieldElements) -> { + receiptPngDataRunnerFieldElements((data, includeFieldElements) -> { SyncPoller> syncPoller = - client.beginRecognizeReceipts(new RecognizeOptions(data, RECEIPT_PNG_FILE_LENGTH).setFormContentType( + client.beginRecognizeReceipts(data, RECEIPT_PNG_FILE_LENGTH, new RecognizeOptions().setContentType( FormContentType.IMAGE_PNG).setIncludeFieldElements(includeFieldElements) .setPollInterval(durationTestMode)); syncPoller.waitForCompletion(); @@ -143,7 +143,7 @@ public void recognizeReceiptDataWithBlankPdf(HttpClient httpClient, client = getFormRecognizerClient(httpClient, serviceVersion); blankPdfDataRunner((data, dataLength) -> { SyncPoller> syncPoller = client.beginRecognizeReceipts( - new RecognizeOptions(data, dataLength).setFormContentType(FormContentType.APPLICATION_PDF) + data, dataLength, new RecognizeOptions().setContentType(FormContentType.APPLICATION_PDF) .setPollInterval(durationTestMode)); syncPoller.waitForCompletion(); validateBlankPdfResultData(syncPoller.getFinalResult()); @@ -156,7 +156,7 @@ public void recognizeReceiptFromDataMultiPage(HttpClient httpClient, FormRecogni client = getFormRecognizerClient(httpClient, serviceVersion); multipageFromDataRunner((data, dataLength) -> { SyncPoller> syncPoller = client.beginRecognizeReceipts( - new RecognizeOptions(data, dataLength).setFormContentType(FormContentType.APPLICATION_PDF) + data, dataLength, new RecognizeOptions().setContentType(FormContentType.APPLICATION_PDF) .setPollInterval(durationTestMode)); syncPoller.waitForCompletion(); validateMultipageReceiptData(syncPoller.getFinalResult()); @@ -188,22 +188,22 @@ public void recognizeReceiptSourceUrl(HttpClient httpClient, FormRecognizerServi public void recognizeReceiptInvalidSourceUrl(HttpClient httpClient, FormRecognizerServiceVersion serviceVersion) { client = getFormRecognizerClient(httpClient, serviceVersion); invalidSourceUrlRunner((sourceUrl) -> - assertThrows(HttpResponseException.class, () -> client.beginRecognizeReceipts( - new RecognizeOptions(sourceUrl).setPollInterval(durationTestMode)))); + assertThrows(HttpResponseException.class, () -> client.beginRecognizeReceiptsFromUrl(sourceUrl, + new RecognizeOptions().setPollInterval(durationTestMode)))); } /** - * Verifies receipt data for a document using source as file url and include content when includeFieldElements is - * true. + * Verifies receipt data for a document using source as file url and include form element references + * when includeFieldElements is true. */ @ParameterizedTest(name = DISPLAY_NAME_WITH_ARGUMENTS) @MethodSource("com.azure.ai.formrecognizer.TestUtils#getTestParameters") - public void recognizeReceiptFromUrlTextContent(HttpClient httpClient, + public void recognizeReceiptFromUrlIncludeFieldElements(HttpClient httpClient, FormRecognizerServiceVersion serviceVersion) { client = getFormRecognizerClient(httpClient, serviceVersion); - receiptSourceUrlRunnerTextDetails((sourceUrl, includeFieldElements) -> { - SyncPoller> syncPoller = client.beginRecognizeReceipts( - new RecognizeOptions(sourceUrl).setIncludeFieldElements(includeFieldElements) + receiptSourceUrlRunnerFieldElements((sourceUrl, includeFieldElements) -> { + SyncPoller> syncPoller = client.beginRecognizeReceiptsFromUrl( + sourceUrl, new RecognizeOptions().setIncludeFieldElements(includeFieldElements) .setPollInterval(durationTestMode)); syncPoller.waitForCompletion(); validateReceiptResultData(syncPoller.getFinalResult(), includeFieldElements); @@ -211,17 +211,18 @@ public void recognizeReceiptFromUrlTextContent(HttpClient httpClient, } /** - * Verifies receipt data for a document using source as PNG file url and include content when includeFieldElements is - * true. + * Verifies receipt data for a document using source as PNG file url and include form element references + * when includeFieldElements is true. */ @ParameterizedTest(name = DISPLAY_NAME_WITH_ARGUMENTS) @MethodSource("com.azure.ai.formrecognizer.TestUtils#getTestParameters") public void recognizeReceiptSourceUrlWithPngFile(HttpClient httpClient, FormRecognizerServiceVersion serviceVersion) { client = getFormRecognizerClient(httpClient, serviceVersion); - receiptPngSourceUrlRunnerTextDetails((sourceUrl, includeFieldElements) -> { - SyncPoller> syncPoller = client.beginRecognizeReceipts( - new RecognizeOptions(sourceUrl).setIncludeFieldElements(includeFieldElements) + receiptPngSourceUrlRunnerFieldElements((sourceUrl, includeFieldElements) -> { + SyncPoller> syncPoller = client.beginRecognizeReceiptsFromUrl( + sourceUrl, + new RecognizeOptions().setIncludeFieldElements(includeFieldElements) .setPollInterval(durationTestMode)); syncPoller.waitForCompletion(); validateReceiptResultData(syncPoller.getFinalResult(), includeFieldElements); @@ -232,9 +233,9 @@ public void recognizeReceiptSourceUrlWithPngFile(HttpClient httpClient, @MethodSource("com.azure.ai.formrecognizer.TestUtils#getTestParameters") public void recognizeReceiptFromUrlMultiPage(HttpClient httpClient, FormRecognizerServiceVersion serviceVersion) { client = getFormRecognizerClient(httpClient, serviceVersion); - multipageFromUrlRunner(fileUrl -> { - SyncPoller> syncPoller = client.beginRecognizeReceipts( - new RecognizeOptions(fileUrl).setPollInterval(durationTestMode)); + multipageFromUrlRunner(receiptUrl -> { + SyncPoller> syncPoller = client.beginRecognizeReceiptsFromUrl( + receiptUrl, new RecognizeOptions().setPollInterval(durationTestMode)); syncPoller.waitForCompletion(); validateMultipageReceiptData(syncPoller.getFinalResult()); }); @@ -253,7 +254,8 @@ public void recognizeContent(HttpClient httpClient, FormRecognizerServiceVersion client = getFormRecognizerClient(httpClient, serviceVersion); contentFromDataRunner((data, dataLength) -> { SyncPoller> syncPoller = - client.beginRecognizeContent(data, dataLength, FormContentType.IMAGE_PNG); + client.beginRecognizeContent(data, dataLength, new RecognizeOptions() + .setContentType(FormContentType.IMAGE_JPEG).setPollInterval(durationTestMode)); syncPoller.waitForCompletion(); validateContentResultData(syncPoller.getFinalResult(), false); }); @@ -267,8 +269,8 @@ public void recognizeContent(HttpClient httpClient, FormRecognizerServiceVersion public void recognizeContentResultWithNullData(HttpClient httpClient, FormRecognizerServiceVersion serviceVersion) { client = getFormRecognizerClient(httpClient, serviceVersion); assertThrows(RuntimeException.class, () -> - client.beginRecognizeContent(new RecognizeOptions((InputStream) null, LAYOUT_FILE_LENGTH) - .setFormContentType(FormContentType.IMAGE_JPEG).setPollInterval(durationTestMode))); + client.beginRecognizeContent(null, LAYOUT_FILE_LENGTH, new RecognizeOptions() + .setContentType(FormContentType.IMAGE_JPEG).setPollInterval(durationTestMode))); } /** @@ -280,8 +282,8 @@ public void recognizeContentResultWithContentTypeAutoDetection(HttpClient httpCl FormRecognizerServiceVersion serviceVersion) { client = getFormRecognizerClient(httpClient, serviceVersion); SyncPoller> syncPoller = client.beginRecognizeContent( - new RecognizeOptions(getContentDetectionFileData(LAYOUT_LOCAL_URL), LAYOUT_FILE_LENGTH) - .setFormContentType(null).setPollInterval(durationTestMode)); + getContentDetectionFileData(LAYOUT_LOCAL_URL), LAYOUT_FILE_LENGTH, new RecognizeOptions() + .setContentType(null).setPollInterval(durationTestMode)); syncPoller.waitForCompletion(); validateContentResultData(syncPoller.getFinalResult(), false); @@ -297,8 +299,8 @@ public void recognizeContentResultWithBlankPdf(HttpClient httpClient, FormRecogn client = getFormRecognizerClient(httpClient, serviceVersion); blankPdfDataRunner((data, dataLength) -> { SyncPoller> syncPoller = - client.beginRecognizeContent(new RecognizeOptions(data, dataLength) - .setFormContentType(FormContentType.APPLICATION_PDF).setPollInterval(durationTestMode)); + client.beginRecognizeContent(data, dataLength, new RecognizeOptions() + .setContentType(FormContentType.APPLICATION_PDF).setPollInterval(durationTestMode)); syncPoller.waitForCompletion(); validateContentResultData(syncPoller.getFinalResult(), false); }); @@ -310,8 +312,8 @@ public void recognizeContentFromDataMultiPage(HttpClient httpClient, FormRecogni client = getFormRecognizerClient(httpClient, serviceVersion); multipageFromDataRunner((data, dataLength) -> { SyncPoller> syncPoller = - client.beginRecognizeContent(new RecognizeOptions(data, dataLength) - .setFormContentType(FormContentType.APPLICATION_PDF).setPollInterval(durationTestMode)); + client.beginRecognizeContent(data, dataLength, new RecognizeOptions() + .setContentType(FormContentType.APPLICATION_PDF).setPollInterval(durationTestMode)); syncPoller.waitForCompletion(); validateContentResultData(syncPoller.getFinalResult(), false); }); @@ -338,15 +340,15 @@ public void recognizeContentFromUrl(HttpClient httpClient, FormRecognizerService public void recognizeContentFromUrlWithPdf(HttpClient httpClient, FormRecognizerServiceVersion serviceVersion) { client = getFormRecognizerClient(httpClient, serviceVersion); pdfContentFromUrlRunner(sourceUrl -> { - SyncPoller> syncPoller = client.beginRecognizeContent( - new RecognizeOptions(sourceUrl).setPollInterval(durationTestMode)); + SyncPoller> syncPoller = client.beginRecognizeContentFromUrl(sourceUrl, + new RecognizeOptions().setPollInterval(durationTestMode)); syncPoller.waitForCompletion(); validateContentResultData(syncPoller.getFinalResult(), false); }); } /** - * Verifies that an exception is thrown for invalid source url for recognizing content information. + * Verifies that an exception is thrown for invalid source url for recognizing content/layout information. */ @ParameterizedTest(name = DISPLAY_NAME_WITH_ARGUMENTS) @MethodSource("com.azure.ai.formrecognizer.TestUtils#getTestParameters") @@ -354,16 +356,17 @@ public void recognizeContentInvalidSourceUrl(HttpClient httpClient, FormRecogniz client = getFormRecognizerClient(httpClient, serviceVersion); invalidSourceUrlRunner((invalidSourceUrl) -> assertThrows( HttpResponseException.class, () -> - client.beginRecognizeContent(new RecognizeOptions(invalidSourceUrl).setPollInterval(durationTestMode)))); + client.beginRecognizeContentFromUrl(invalidSourceUrl, + new RecognizeOptions().setPollInterval(durationTestMode)))); } @ParameterizedTest(name = DISPLAY_NAME_WITH_ARGUMENTS) @MethodSource("com.azure.ai.formrecognizer.TestUtils#getTestParameters") public void recognizeContentFromUrlMultiPage(HttpClient httpClient, FormRecognizerServiceVersion serviceVersion) { client = getFormRecognizerClient(httpClient, serviceVersion); - multipageFromUrlRunner((fileUrl) -> { + multipageFromUrlRunner((formUrl) -> { SyncPoller> syncPoller = - client.beginRecognizeContent(new RecognizeOptions(fileUrl).setPollInterval(durationTestMode)); + client.beginRecognizeContentFromUrl(formUrl, new RecognizeOptions().setPollInterval(durationTestMode)); syncPoller.waitForCompletion(); validateContentResultData(syncPoller.getFinalResult(), false); }); @@ -388,8 +391,8 @@ public void recognizeCustomFormLabeledData(HttpClient httpClient, FormRecognizer trainingPoller.waitForCompletion(); SyncPoller> syncPoller = client.beginRecognizeCustomForms( - new RecognizeCustomFormsOptions(data, dataLength, trainingPoller.getFinalResult().getModelId()) - .setFormContentType(FormContentType.APPLICATION_PDF).setIncludeFieldElements(true) + data, dataLength, trainingPoller.getFinalResult().getModelId(), new RecognizeOptions() + .setContentType(FormContentType.APPLICATION_PDF).setIncludeFieldElements(true) .setPollInterval(durationTestMode)); syncPoller.waitForCompletion(); validateRecognizedResult(syncPoller.getFinalResult(), true, true); @@ -412,8 +415,8 @@ public void recognizeCustomFormLabeledDataWithJpgContentType(HttpClient httpClie trainingPoller.waitForCompletion(); SyncPoller> syncPoller = client.beginRecognizeCustomForms( - new RecognizeCustomFormsOptions(data, dataLength, trainingPoller.getFinalResult().getModelId()) - .setFormContentType(FormContentType.IMAGE_JPEG).setPollInterval(durationTestMode)); + data, dataLength, trainingPoller.getFinalResult().getModelId(), new RecognizeOptions() + .setContentType(FormContentType.IMAGE_JPEG).setPollInterval(durationTestMode)); syncPoller.waitForCompletion(); validateRecognizedResult(syncPoller.getFinalResult(), false, true); })); @@ -434,8 +437,8 @@ public void recognizeCustomFormLabeledDataWithBlankPdfContentType(HttpClient htt trainingPoller.waitForCompletion(); SyncPoller> syncPoller = client.beginRecognizeCustomForms( - new RecognizeCustomFormsOptions(data, dataLength, trainingPoller.getFinalResult().getModelId()) - .setFormContentType(FormContentType.APPLICATION_PDF).setPollInterval(durationTestMode)); + data, dataLength, trainingPoller.getFinalResult().getModelId(), new RecognizeOptions() + .setContentType(FormContentType.APPLICATION_PDF).setPollInterval(durationTestMode)); syncPoller.waitForCompletion(); validateRecognizedResult(syncPoller.getFinalResult(), false, true); })); @@ -443,11 +446,11 @@ public void recognizeCustomFormLabeledDataWithBlankPdfContentType(HttpClient htt /** * Verifies custom form data for a document using source as input stream data and valid labeled model Id, - * excluding text content. + * excluding field elements. */ @ParameterizedTest(name = DISPLAY_NAME_WITH_ARGUMENTS) @MethodSource("com.azure.ai.formrecognizer.TestUtils#getTestParameters") - public void recognizeCustomFormLabeledDataExcludeTextContent(HttpClient httpClient, + public void recognizeCustomFormLabeledDataExcludeFieldElements(HttpClient httpClient, FormRecognizerServiceVersion serviceVersion) { client = getFormRecognizerClient(httpClient, serviceVersion); customFormDataRunner((data, dataLength) -> beginTrainingLabeledRunner((trainingFilesUrl, useTrainingLabels) -> { @@ -457,8 +460,8 @@ public void recognizeCustomFormLabeledDataExcludeTextContent(HttpClient httpClie trainingPoller.waitForCompletion(); SyncPoller> syncPoller = client.beginRecognizeCustomForms( - new RecognizeCustomFormsOptions(data, dataLength, trainingPoller.getFinalResult().getModelId()) - .setFormContentType(FormContentType.APPLICATION_PDF).setPollInterval(durationTestMode)); + data, dataLength, trainingPoller.getFinalResult().getModelId(), new RecognizeOptions() + .setContentType(FormContentType.APPLICATION_PDF).setPollInterval(durationTestMode)); syncPoller.waitForCompletion(); validateRecognizedResult(syncPoller.getFinalResult(), false, true); })); @@ -480,9 +483,8 @@ public void recognizeCustomFormLabeledDataWithNullFormData(HttpClient httpClient syncPoller.waitForCompletion(); assertThrows(RuntimeException.class, () -> client.beginRecognizeCustomForms( - new RecognizeCustomFormsOptions((InputStream) null, dataLength, - syncPoller.getFinalResult().getModelId()) - .setFormContentType(FormContentType.APPLICATION_PDF).setIncludeFieldElements(true) + (InputStream) null, dataLength, syncPoller.getFinalResult().getModelId(), new RecognizeOptions() + .setContentType(FormContentType.APPLICATION_PDF).setIncludeFieldElements(true) .setPollInterval(durationTestMode))); }) ); @@ -498,8 +500,8 @@ public void recognizeCustomFormLabeledDataWithNullModelId(HttpClient httpClient, client = getFormRecognizerClient(httpClient, serviceVersion); customFormDataRunner((data, dataLength) -> { Exception ex = assertThrows(RuntimeException.class, () -> client.beginRecognizeCustomForms( - new RecognizeCustomFormsOptions(data, dataLength, null) - .setFormContentType(FormContentType.APPLICATION_PDF).setIncludeFieldElements(true) + data, dataLength, null, new RecognizeOptions() + .setContentType(FormContentType.APPLICATION_PDF).setIncludeFieldElements(true) .setPollInterval(durationTestMode))); assertEquals(EXPECTED_MODEL_ID_IS_REQUIRED_EXCEPTION_MESSAGE, ex.getMessage()); }); @@ -516,8 +518,8 @@ public void recognizeCustomFormLabeledDataWithEmptyModelId(HttpClient httpClient customFormDataRunner((data, dataLength) -> { Exception ex = assertThrows(RuntimeException.class, () -> client.beginRecognizeCustomForms( - new RecognizeCustomFormsOptions(data, dataLength, "") - .setFormContentType(FormContentType.APPLICATION_PDF).setIncludeFieldElements(true) + data, dataLength, "", new RecognizeOptions() + .setContentType(FormContentType.APPLICATION_PDF).setIncludeFieldElements(true) .setPollInterval(durationTestMode))); assertEquals(EXPECTED_INVALID_UUID_EXCEPTION_MESSAGE, ex.getMessage()); }); @@ -535,8 +537,8 @@ public void recognizeCustomFormInvalidStatus(HttpClient httpClient, FormRecogniz syncPoller.waitForCompletion(); CustomFormModel createdModel = syncPoller.getFinalResult(); FormRecognizerException formRecognizerException = assertThrows(FormRecognizerException.class, - () -> client.beginRecognizeCustomForms(new RecognizeCustomFormsOptions(invalidSourceUrl, - createdModel.getModelId()).setPollInterval(durationTestMode)).getFinalResult()); + () -> client.beginRecognizeCustomFormsFromUrl(invalidSourceUrl, + createdModel.getModelId(), new RecognizeOptions().setPollInterval(durationTestMode)).getFinalResult()); ErrorInformation errorInformation = formRecognizerException.getErrorInformation().get(0); // TODO: Service bug https://github.com/Azure/azure-sdk-for-java/issues/12046 // assertEquals(EXPECTED_INVALID_URL_ERROR_CODE, errorInformation.getCode()); @@ -561,8 +563,8 @@ public void recognizeCustomFormLabeledDataWithContentTypeAutoDetection(HttpClien trainingPoller.waitForCompletion(); SyncPoller> syncPoller = client.beginRecognizeCustomForms( - new RecognizeCustomFormsOptions(getContentDetectionFileData(FORM_LOCAL_URL), - CUSTOM_FORM_FILE_LENGTH, trainingPoller.getFinalResult().getModelId()) + getContentDetectionFileData(FORM_LOCAL_URL), + CUSTOM_FORM_FILE_LENGTH, trainingPoller.getFinalResult().getModelId(), new RecognizeOptions() .setIncludeFieldElements(true).setPollInterval(durationTestMode)); syncPoller.waitForCompletion(); validateRecognizedResult(syncPoller.getFinalResult(), true, true); @@ -581,8 +583,8 @@ public void recognizeCustomFormMultiPageLabeled(HttpClient httpClient, trainingPoller.waitForCompletion(); SyncPoller> syncPoller = client.beginRecognizeCustomForms( - new RecognizeCustomFormsOptions(data, dataLength, trainingPoller.getFinalResult().getModelId()) - .setFormContentType(FormContentType.APPLICATION_PDF).setPollInterval(durationTestMode)); + data, dataLength, trainingPoller.getFinalResult().getModelId(), new RecognizeOptions() + .setContentType(FormContentType.APPLICATION_PDF).setPollInterval(durationTestMode)); syncPoller.waitForCompletion(); validateMultiPageDataLabeled(syncPoller.getFinalResult()); })); @@ -605,19 +607,19 @@ public void recognizeCustomFormUnlabeledData(HttpClient httpClient, FormRecogniz trainingPoller.waitForCompletion(); SyncPoller> syncPoller = client.beginRecognizeCustomForms( - new RecognizeCustomFormsOptions(data, dataLength, trainingPoller.getFinalResult().getModelId()) - .setFormContentType(FormContentType.APPLICATION_PDF).setPollInterval(durationTestMode)); + data, dataLength, trainingPoller.getFinalResult().getModelId(), new RecognizeOptions() + .setContentType(FormContentType.APPLICATION_PDF).setPollInterval(durationTestMode)); syncPoller.waitForCompletion(); validateRecognizedResult(syncPoller.getFinalResult(), false, false); })); } /** - * Verifies custom form data for a document using source as input stream data and valid include text content + * Verifies custom form data for a document using source as input stream data and valid include element references */ @ParameterizedTest(name = DISPLAY_NAME_WITH_ARGUMENTS) @MethodSource("com.azure.ai.formrecognizer.TestUtils#getTestParameters") - public void recognizeCustomFormUnlabeledDataIncludeTextContent(HttpClient httpClient, + public void recognizeCustomFormUnlabeledDataIncludeFieldElements(HttpClient httpClient, FormRecognizerServiceVersion serviceVersion) { client = getFormRecognizerClient(httpClient, serviceVersion); @@ -628,8 +630,8 @@ public void recognizeCustomFormUnlabeledDataIncludeTextContent(HttpClient httpCl trainingPoller.waitForCompletion(); SyncPoller> syncPoller = client.beginRecognizeCustomForms( - new RecognizeCustomFormsOptions(data, dataLength, trainingPoller.getFinalResult().getModelId()) - .setFormContentType(FormContentType.APPLICATION_PDF).setIncludeFieldElements(true) + data, dataLength, trainingPoller.getFinalResult().getModelId(), new RecognizeOptions() + .setContentType(FormContentType.APPLICATION_PDF).setIncludeFieldElements(true) .setPollInterval(durationTestMode)); syncPoller.waitForCompletion(); validateRecognizedResult(syncPoller.getFinalResult(), true, false); @@ -648,8 +650,8 @@ public void recognizeCustomFormMultiPageUnlabeled(HttpClient httpClient, trainingPoller.waitForCompletion(); SyncPoller> syncPoller = client.beginRecognizeCustomForms( - new RecognizeCustomFormsOptions(data, dataLength, trainingPoller.getFinalResult().getModelId()) - .setFormContentType(FormContentType.APPLICATION_PDF).setPollInterval(durationTestMode)); + data, dataLength, trainingPoller.getFinalResult().getModelId(), new RecognizeOptions() + .setContentType(FormContentType.APPLICATION_PDF).setPollInterval(durationTestMode)); syncPoller.waitForCompletion(); validateMultiPageDataUnlabeled(syncPoller.getFinalResult()); })); @@ -671,8 +673,8 @@ public void recognizeCustomFormUnlabeledDataWithJpgContentType(HttpClient httpCl trainingPoller.waitForCompletion(); SyncPoller> syncPoller = client.beginRecognizeCustomForms( - new RecognizeCustomFormsOptions(data, dataLength, trainingPoller.getFinalResult().getModelId()) - .setFormContentType(FormContentType.IMAGE_JPEG).setPollInterval(durationTestMode)); + data, dataLength, trainingPoller.getFinalResult().getModelId(), new RecognizeOptions() + .setContentType(FormContentType.IMAGE_JPEG).setPollInterval(durationTestMode)); syncPoller.waitForCompletion(); validateRecognizedResult(syncPoller.getFinalResult(), false, false); })); @@ -693,8 +695,8 @@ public void recognizeCustomFormUnlabeledDataWithBlankPdfContentType(HttpClient h trainingPoller.waitForCompletion(); SyncPoller> syncPoller = client.beginRecognizeCustomForms( - new RecognizeCustomFormsOptions(data, dataLength, trainingPoller.getFinalResult().getModelId()) - .setFormContentType(FormContentType.APPLICATION_PDF).setPollInterval(durationTestMode)); + data, dataLength, trainingPoller.getFinalResult().getModelId(), new RecognizeOptions() + .setContentType(FormContentType.APPLICATION_PDF).setPollInterval(durationTestMode)); syncPoller.waitForCompletion(); validateRecognizedResult(syncPoller.getFinalResult(), false, false); })); @@ -716,8 +718,8 @@ public void recognizeCustomFormUrlUnlabeledData(HttpClient httpClient, null, durationTestMode); trainingPoller.waitForCompletion(); - SyncPoller> syncPoller = client.beginRecognizeCustomForms( - new RecognizeCustomFormsOptions(fileUrl, trainingPoller.getFinalResult().getModelId()) + SyncPoller> syncPoller = client.beginRecognizeCustomFormsFromUrl( + fileUrl, trainingPoller.getFinalResult().getModelId(), new RecognizeOptions() .setPollInterval(durationTestMode)); syncPoller.waitForCompletion(); validateRecognizedResult(syncPoller.getFinalResult(), false, false); @@ -725,11 +727,11 @@ public void recognizeCustomFormUrlUnlabeledData(HttpClient httpClient, } /** - * Verifies custom form data for an URL document data without labeled data and include text content + * Verifies custom form data for an URL document data without labeled data and include element references */ @ParameterizedTest(name = DISPLAY_NAME_WITH_ARGUMENTS) @MethodSource("com.azure.ai.formrecognizer.TestUtils#getTestParameters") - public void recognizeCustomFormUrlUnlabeledDataIncludeTextContent(HttpClient httpClient, + public void recognizeCustomFormUrlUnlabeledDataIncludeFieldElements(HttpClient httpClient, FormRecognizerServiceVersion serviceVersion) { client = getFormRecognizerClient(httpClient, serviceVersion); urlRunner(fileUrl -> beginTrainingUnlabeledRunner((trainingFilesUrl, useTrainingLabels) -> { @@ -738,8 +740,8 @@ public void recognizeCustomFormUrlUnlabeledDataIncludeTextContent(HttpClient htt null, durationTestMode); trainingPoller.waitForCompletion(); - SyncPoller> syncPoller = client.beginRecognizeCustomForms( - new RecognizeCustomFormsOptions(fileUrl, trainingPoller.getFinalResult().getModelId()) + SyncPoller> syncPoller = client.beginRecognizeCustomFormsFromUrl( + fileUrl, trainingPoller.getFinalResult().getModelId(), new RecognizeOptions() .setIncludeFieldElements(true).setPollInterval(durationTestMode)); syncPoller.waitForCompletion(); validateRecognizedResult(syncPoller.getFinalResult(), true, false); @@ -757,8 +759,8 @@ public void recognizeCustomFormUrlMultiPageUnlabeled(HttpClient httpClient, null, durationTestMode); trainingPoller.waitForCompletion(); - SyncPoller> syncPoller = client.beginRecognizeCustomForms( - new RecognizeCustomFormsOptions(fileUrl, trainingPoller.getFinalResult().getModelId()) + SyncPoller> syncPoller = client.beginRecognizeCustomFormsFromUrl( + fileUrl, trainingPoller.getFinalResult().getModelId(), new RecognizeOptions() .setPollInterval(durationTestMode)); syncPoller.waitForCompletion(); validateMultiPageDataUnlabeled(syncPoller.getFinalResult()); @@ -782,8 +784,8 @@ public void recognizeCustomFormInvalidSourceUrl(HttpClient httpClient, syncPoller.waitForCompletion(); CustomFormModel createdModel = syncPoller.getFinalResult(); HttpResponseException httpResponseException = assertThrows( - HttpResponseException.class, () -> client.beginRecognizeCustomForms( - new RecognizeCustomFormsOptions(INVALID_URL, createdModel.getModelId()) + HttpResponseException.class, () -> client.beginRecognizeCustomFormsFromUrl( + INVALID_URL, createdModel.getModelId(), new RecognizeOptions() .setPollInterval(durationTestMode)).getFinalResult()); assertEquals(httpResponseException.getMessage(), (INVALID_SOURCE_URL_ERROR)); }); @@ -798,8 +800,8 @@ public void recognizeCustomFormFromUrlLabeledDataWithNullModelId(HttpClient http FormRecognizerServiceVersion serviceVersion) { client = getFormRecognizerClient(httpClient, serviceVersion); multipageFromUrlRunner(fileUrl -> { - Exception ex = assertThrows(RuntimeException.class, () -> client.beginRecognizeCustomForms( - new RecognizeCustomFormsOptions(fileUrl, null).setPollInterval(durationTestMode))); + Exception ex = assertThrows(RuntimeException.class, () -> client.beginRecognizeCustomFormsFromUrl( + fileUrl, null, new RecognizeOptions().setPollInterval(durationTestMode))); assertEquals(EXPECTED_MODEL_ID_IS_REQUIRED_EXCEPTION_MESSAGE, ex.getMessage()); }); } @@ -813,54 +815,54 @@ public void recognizeCustomFormFromUrlLabeledDataWithEmptyModelId(HttpClient htt FormRecognizerServiceVersion serviceVersion) { client = getFormRecognizerClient(httpClient, serviceVersion); multipageFromUrlRunner(fileUrl -> beginTrainingMultipageRunner((trainingFilesUrl) -> { - Exception ex = assertThrows(RuntimeException.class, () -> client.beginRecognizeCustomForms( - new RecognizeCustomFormsOptions(fileUrl, "").setPollInterval(durationTestMode))); + Exception ex = assertThrows(RuntimeException.class, () -> client.beginRecognizeCustomFormsFromUrl( + fileUrl, "", new RecognizeOptions().setPollInterval(durationTestMode))); assertEquals(EXPECTED_INVALID_UUID_EXCEPTION_MESSAGE, ex.getMessage()); })); } /** - * Verifies custom form data for an URL document data with labeled data + * Verifies custom form data for an URL document data with labeled data and include element references */ @ParameterizedTest(name = DISPLAY_NAME_WITH_ARGUMENTS) @MethodSource("com.azure.ai.formrecognizer.TestUtils#getTestParameters") - public void recognizeCustomFormUrlLabeledData(HttpClient httpClient, FormRecognizerServiceVersion serviceVersion) { - urlRunner(fileUrl -> beginTrainingLabeledRunner((trainingFilesUrl, useTrainingLabels) -> { - client = getFormRecognizerClient(httpClient, serviceVersion); + public void recognizeCustomFormUrlLabeledDataIncludeFieldElements(HttpClient httpClient, + FormRecognizerServiceVersion serviceVersion) { + client = getFormRecognizerClient(httpClient, serviceVersion); + urlRunner(fileUrl -> beginTrainingLabeledRunner((trainingFilesUrl, useTrainingLabels) -> { SyncPoller trainingPoller = getFormTrainingClient(httpClient, serviceVersion).beginTraining(trainingFilesUrl, useTrainingLabels, null, durationTestMode); trainingPoller.waitForCompletion(); - SyncPoller> syncPoller = client.beginRecognizeCustomForms( - new RecognizeCustomFormsOptions(fileUrl, trainingPoller.getFinalResult().getModelId()) - .setPollInterval(durationTestMode)); + SyncPoller> syncPoller = client.beginRecognizeCustomFormsFromUrl( + fileUrl, trainingPoller.getFinalResult().getModelId(), new RecognizeOptions() + .setIncludeFieldElements(true).setPollInterval(durationTestMode)); syncPoller.waitForCompletion(); - validateRecognizedResult(syncPoller.getFinalResult(), false, true); + validateRecognizedResult(syncPoller.getFinalResult(), true, true); }), FORM_JPG); } /** - * Verifies custom form data for an URL document data with labeled data and include text content + * Verifies custom form data for an URL document data with labeled data */ @ParameterizedTest(name = DISPLAY_NAME_WITH_ARGUMENTS) @MethodSource("com.azure.ai.formrecognizer.TestUtils#getTestParameters") - public void recognizeCustomFormUrlLabeledDataIncludeTextContent(HttpClient httpClient, - FormRecognizerServiceVersion serviceVersion) { - client = getFormRecognizerClient(httpClient, serviceVersion); - + public void recognizeCustomFormUrlLabeledData(HttpClient httpClient, FormRecognizerServiceVersion serviceVersion) { urlRunner(fileUrl -> beginTrainingLabeledRunner((trainingFilesUrl, useTrainingLabels) -> { + client = getFormRecognizerClient(httpClient, serviceVersion); + SyncPoller trainingPoller = getFormTrainingClient(httpClient, serviceVersion).beginTraining(trainingFilesUrl, useTrainingLabels, null, durationTestMode); trainingPoller.waitForCompletion(); - SyncPoller> syncPoller = client.beginRecognizeCustomForms( - new RecognizeCustomFormsOptions(fileUrl, trainingPoller.getFinalResult().getModelId()) - .setIncludeFieldElements(true).setPollInterval(durationTestMode)); + SyncPoller> syncPoller = client.beginRecognizeCustomFormsFromUrl( + fileUrl, trainingPoller.getFinalResult().getModelId(), new RecognizeOptions() + .setPollInterval(durationTestMode)); syncPoller.waitForCompletion(); - validateRecognizedResult(syncPoller.getFinalResult(), true, true); + validateRecognizedResult(syncPoller.getFinalResult(), false, true); }), FORM_JPG); } @@ -878,8 +880,8 @@ public void recognizeCustomFormUrlMultiPageLabeled(HttpClient httpClient, null, durationTestMode); trainingPoller.waitForCompletion(); - SyncPoller> syncPoller = client.beginRecognizeCustomForms( - new RecognizeCustomFormsOptions(fileUrl, trainingPoller.getFinalResult().getModelId()) + SyncPoller> syncPoller = client.beginRecognizeCustomFormsFromUrl( + fileUrl, trainingPoller.getFinalResult().getModelId(), new RecognizeOptions() .setPollInterval(durationTestMode)); syncPoller.waitForCompletion(); validateMultiPageDataLabeled(syncPoller.getFinalResult()); diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/src/test/java/com/azure/ai/formrecognizer/FormRecognizerClientTestBase.java b/sdk/formrecognizer/azure-ai-formrecognizer/src/test/java/com/azure/ai/formrecognizer/FormRecognizerClientTestBase.java index 8b83ac31a0334..31c0cf01d6330 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/src/test/java/com/azure/ai/formrecognizer/FormRecognizerClientTestBase.java +++ b/sdk/formrecognizer/azure-ai-formrecognizer/src/test/java/com/azure/ai/formrecognizer/FormRecognizerClientTestBase.java @@ -170,14 +170,14 @@ private static void validateReferenceElementsData(List expectedElements, FormLine actualFormLine = (FormLine) actualFormElementList.get(i); validateFormWordData(expectedTextLine.getWords(), actualFormLine.getFormWords()); } - FormWord actualFormContent = (FormWord) actualFormElementList.get(i); - assertEquals(expectedTextWord.getText(), actualFormContent.getText()); + FormWord actualFormWord = (FormWord) actualFormElementList.get(i); + assertEquals(expectedTextWord.getText(), actualFormWord.getText()); if (expectedTextWord.getConfidence() != null) { - assertEquals(expectedTextWord.getConfidence(), actualFormContent.getConfidence()); + assertEquals(expectedTextWord.getConfidence(), actualFormWord.getConfidence()); } else { - assertEquals(1.0f, actualFormContent.getConfidence()); + assertEquals(1.0f, actualFormWord.getConfidence()); } - validateBoundingBoxData(expectedTextWord.getBoundingBox(), actualFormContent.getBoundingBox()); + validateBoundingBoxData(expectedTextWord.getBoundingBox(), actualFormWord.getBoundingBox()); } } } @@ -323,7 +323,7 @@ abstract void recognizeReceiptDataWithContentTypeAutoDetection(HttpClient httpCl FormRecognizerServiceVersion serviceVersion); @Test - abstract void recognizeReceiptDataTextDetails(HttpClient httpClient, FormRecognizerServiceVersion serviceVersion); + abstract void recognizeReceiptDataIncludeFieldElements(HttpClient httpClient, FormRecognizerServiceVersion serviceVersion); @Test abstract void recognizeReceiptDataWithPngFile(HttpClient httpClient, @@ -345,7 +345,7 @@ abstract void recognizeReceiptDataWithBlankPdf(HttpClient httpClient, abstract void recognizeReceiptInvalidSourceUrl(HttpClient httpClient, FormRecognizerServiceVersion serviceVersion); @Test - abstract void recognizeReceiptFromUrlTextContent(HttpClient httpClient, + abstract void recognizeReceiptFromUrlIncludeFieldElements(HttpClient httpClient, FormRecognizerServiceVersion serviceVersion); @Test @@ -407,7 +407,7 @@ abstract void recognizeCustomFormLabeledDataWithBlankPdfContentType(HttpClient h FormRecognizerServiceVersion serviceVersion); @Test - abstract void recognizeCustomFormLabeledDataExcludeTextContent(HttpClient httpClient, + abstract void recognizeCustomFormLabeledDataExcludeFieldElements(HttpClient httpClient, FormRecognizerServiceVersion serviceVersion); @Test @@ -438,7 +438,7 @@ abstract void recognizeCustomFormMultiPageLabeled(HttpClient httpClient, abstract void recognizeCustomFormUnlabeledData(HttpClient httpClient, FormRecognizerServiceVersion serviceVersion); @Test - abstract void recognizeCustomFormUnlabeledDataIncludeTextContent(HttpClient httpClient, + abstract void recognizeCustomFormUnlabeledDataIncludeFieldElements(HttpClient httpClient, FormRecognizerServiceVersion serviceVersion); @Test @@ -459,7 +459,7 @@ abstract void recognizeCustomFormUnlabeledDataWithBlankPdfContentType(HttpClient abstract void recognizeCustomFormUrlUnlabeledData(HttpClient httpClient, FormRecognizerServiceVersion serviceVersion); @Test - abstract void recognizeCustomFormUrlUnlabeledDataIncludeTextContent(HttpClient httpClient, + abstract void recognizeCustomFormUrlUnlabeledDataIncludeFieldElements(HttpClient httpClient, FormRecognizerServiceVersion serviceVersion); @Test @@ -484,7 +484,7 @@ abstract void recognizeCustomFormFromUrlLabeledDataWithEmptyModelId(HttpClient h abstract void recognizeCustomFormUrlLabeledData(HttpClient httpClient, FormRecognizerServiceVersion serviceVersion); @Test - abstract void recognizeCustomFormUrlLabeledDataIncludeTextContent(HttpClient httpClient, + abstract void recognizeCustomFormUrlLabeledDataIncludeFieldElements(HttpClient httpClient, FormRecognizerServiceVersion serviceVersion); @Test @@ -584,11 +584,11 @@ void receiptSourceUrlRunner(Consumer testRunner) { testRunner.accept(getStorageTestingFileUrl(RECEIPT_CONTOSO_JPG)); } - void receiptSourceUrlRunnerTextDetails(BiConsumer testRunner) { + void receiptSourceUrlRunnerFieldElements(BiConsumer testRunner) { testRunner.accept(getStorageTestingFileUrl(RECEIPT_CONTOSO_JPG), true); } - void receiptPngSourceUrlRunnerTextDetails(BiConsumer testRunner) { + void receiptPngSourceUrlRunnerFieldElements(BiConsumer testRunner) { testRunner.accept(getStorageTestingFileUrl(RECEIPT_CONTOSO_PNG), true); } @@ -600,7 +600,7 @@ void receiptDataRunner(BiConsumer testRunner) { } } - void receiptDataRunnerTextDetails(BiConsumer testRunner) { + void receiptDataRunnerFieldElements(BiConsumer testRunner) { if (interceptorManager.isPlaybackMode()) { testRunner.accept(new ByteArrayInputStream(IS_PLAYBACK_MODE.getBytes(StandardCharsets.UTF_8)), true); } else { @@ -608,7 +608,7 @@ void receiptDataRunnerTextDetails(BiConsumer testRunner) { } } - void receiptPngDataRunnerTextDetails(BiConsumer testRunner) { + void receiptPngDataRunnerFieldElements(BiConsumer testRunner) { if (interceptorManager.isPlaybackMode()) { testRunner.accept(new ByteArrayInputStream(IS_PLAYBACK_MODE.getBytes(StandardCharsets.UTF_8)), true); } else { diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/src/test/java/com/azure/ai/formrecognizer/FormTrainingAsyncClientTest.java b/sdk/formrecognizer/azure-ai-formrecognizer/src/test/java/com/azure/ai/formrecognizer/FormTrainingAsyncClientTest.java index 12abde6de3d71..7d660cffb838b 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/src/test/java/com/azure/ai/formrecognizer/FormTrainingAsyncClientTest.java +++ b/sdk/formrecognizer/azure-ai-formrecognizer/src/test/java/com/azure/ai/formrecognizer/FormTrainingAsyncClientTest.java @@ -71,9 +71,10 @@ void getFormRecognizerClientAndValidate(HttpClient httpClient, FormRecognizerSer .getFormRecognizerAsyncClient(); blankPdfDataRunner(data -> { SyncPoller> syncPoller = - formRecognizerClient.beginRecognizeReceipts( - new RecognizeOptions(toFluxByteBuffer(data), BLANK_FORM_FILE_LENGTH) - .setFormContentType(FormContentType.APPLICATION_PDF).setPollInterval(durationTestMode)) + formRecognizerClient.beginRecognizeReceipts(toFluxByteBuffer(data), BLANK_FORM_FILE_LENGTH, + new RecognizeOptions() + .setContentType(FormContentType.APPLICATION_PDF) + .setPollInterval(durationTestMode)) .getSyncPoller(); syncPoller.waitForCompletion(); validateBlankPdfResultData(syncPoller.getFinalResult()); diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/src/test/java/com/azure/ai/formrecognizer/FormTrainingClientTest.java b/sdk/formrecognizer/azure-ai-formrecognizer/src/test/java/com/azure/ai/formrecognizer/FormTrainingClientTest.java index d6aed3e81c94a..beb6aa4bd0fd6 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/src/test/java/com/azure/ai/formrecognizer/FormTrainingClientTest.java +++ b/sdk/formrecognizer/azure-ai-formrecognizer/src/test/java/com/azure/ai/formrecognizer/FormTrainingClientTest.java @@ -56,8 +56,8 @@ public void getFormRecognizerClientAndValidate(HttpClient httpClient, FormRecogn .getFormRecognizerClient(); blankPdfDataRunner(data -> { SyncPoller> syncPoller = - formRecognizerClient.beginRecognizeReceipts(new RecognizeOptions(data, BLANK_FORM_FILE_LENGTH) - .setFormContentType(FormContentType.APPLICATION_PDF).setPollInterval(durationTestMode)); + formRecognizerClient.beginRecognizeReceipts(data, BLANK_FORM_FILE_LENGTH, new RecognizeOptions() + .setContentType(FormContentType.APPLICATION_PDF).setPollInterval(durationTestMode)); syncPoller.waitForCompletion(); validateBlankPdfResultData(syncPoller.getFinalResult()); }); diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/src/test/resources/session-records/recognizeCustomFormLabeledDataExcludeTextContent.json b/sdk/formrecognizer/azure-ai-formrecognizer/src/test/resources/session-records/recognizeCustomFormLabeledDataExcludeFieldElements.json similarity index 100% rename from sdk/formrecognizer/azure-ai-formrecognizer/src/test/resources/session-records/recognizeCustomFormLabeledDataExcludeTextContent.json rename to sdk/formrecognizer/azure-ai-formrecognizer/src/test/resources/session-records/recognizeCustomFormLabeledDataExcludeFieldElements.json diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/src/test/resources/session-records/recognizeCustomFormUnlabeledDataIncludeFieldElements.json b/sdk/formrecognizer/azure-ai-formrecognizer/src/test/resources/session-records/recognizeCustomFormUnlabeledDataIncludeFieldElements.json new file mode 100644 index 0000000000000..639cd43c82428 --- /dev/null +++ b/sdk/formrecognizer/azure-ai-formrecognizer/src/test/resources/session-records/recognizeCustomFormUnlabeledDataIncludeFieldElements.json @@ -0,0 +1,164 @@ +{ + "networkCallRecords" : [ { + "Method" : "POST", + "Uri" : "https://REDACTED.cognitiveservices.azure.com/formrecognizer/v2.0-preview//custom/models", + "Headers" : { + "User-Agent" : "azsdk-java-azure-ai-formrecognizer/1.0.0-beta.4 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "d98e70ad-18c0-40b0-80ef-1686e705438e", + "Content-Type" : "application/json" + }, + "Response" : { + "x-envoy-upstream-service-time" : "98", + "Strict-Transport-Security" : "max-age=31536000; includeSubDomains; preload", + "x-content-type-options" : "nosniff", + "apim-request-id" : "f99282c1-1599-403e-b164-509a80a1992f", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "201", + "Date" : "Tue, 23 Jun 2020 00:48:36 GMT", + "Location" : "https://savaity-formrecognizer.cognitiveservices.azure.com/formrecognizer/v2.0-preview/custom/models/06bf79f3-c38e-4189-90ed-2da0b1be643c" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.cognitiveservices.azure.com/formrecognizer/v2.0-preview//custom/models/06bf79f3-c38e-4189-90ed-2da0b1be643c?includeKeys=true", + "Headers" : { + "User-Agent" : "azsdk-java-azure-ai-formrecognizer/1.0.0-beta.4 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "50d35523-1be4-46ae-9ab1-1f391520885f" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-envoy-upstream-service-time" : "24", + "Strict-Transport-Security" : "max-age=31536000; includeSubDomains; preload", + "x-content-type-options" : "nosniff", + "apim-request-id" : "7b00fa18-ac29-401d-a77d-9fc1dc21ddd2", + "retry-after" : "0", + "StatusCode" : "200", + "Body" : "{\"modelInfo\":{\"modelId\":\"06bf79f3-c38e-4189-90ed-2da0b1be643c\",\"status\":\"creating\",\"createdDateTime\":\"2020-06-23T00:48:36Z\",\"lastUpdatedDateTime\":\"2020-06-23T00:48:36Z\"}}", + "Date" : "Tue, 23 Jun 2020 00:48:42 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.cognitiveservices.azure.com/formrecognizer/v2.0-preview//custom/models/06bf79f3-c38e-4189-90ed-2da0b1be643c?includeKeys=true", + "Headers" : { + "User-Agent" : "azsdk-java-azure-ai-formrecognizer/1.0.0-beta.4 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "a28cc635-9d25-4aed-a1a3-f0a1fce1f23f" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-envoy-upstream-service-time" : "29", + "Strict-Transport-Security" : "max-age=31536000; includeSubDomains; preload", + "x-content-type-options" : "nosniff", + "apim-request-id" : "e7a5fc32-8cd4-40bb-9a93-8e9cfc5ad333", + "retry-after" : "0", + "StatusCode" : "200", + "Body" : "{\"modelInfo\":{\"modelId\":\"06bf79f3-c38e-4189-90ed-2da0b1be643c\",\"status\":\"creating\",\"createdDateTime\":\"2020-06-23T00:48:36Z\",\"lastUpdatedDateTime\":\"2020-06-23T00:48:36Z\"}}", + "Date" : "Tue, 23 Jun 2020 00:48:47 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.cognitiveservices.azure.com/formrecognizer/v2.0-preview//custom/models/06bf79f3-c38e-4189-90ed-2da0b1be643c?includeKeys=true", + "Headers" : { + "User-Agent" : "azsdk-java-azure-ai-formrecognizer/1.0.0-beta.4 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "4c2d1a9f-7d25-4414-b815-4d2d18aa1827" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-envoy-upstream-service-time" : "64", + "Strict-Transport-Security" : "max-age=31536000; includeSubDomains; preload", + "x-content-type-options" : "nosniff", + "apim-request-id" : "45fa6393-652c-4c7e-b2d7-df37663b6097", + "retry-after" : "0", + "StatusCode" : "200", + "Body" : "{\"modelInfo\":{\"modelId\":\"06bf79f3-c38e-4189-90ed-2da0b1be643c\",\"status\":\"ready\",\"createdDateTime\":\"2020-06-23T00:48:36Z\",\"lastUpdatedDateTime\":\"2020-06-23T00:48:47Z\"},\"keys\":{\"clusters\":{\"0\":[\"Additional Notes:\",\"Address:\",\"Company Name:\",\"Company Phone:\",\"Dated As:\",\"Details\",\"Email:\",\"Hero Limited\",\"Name:\",\"Phone:\",\"Purchase Order\",\"Purchase Order #:\",\"Quantity\",\"SUBTOTAL\",\"Seattle, WA 93849 Phone:\",\"Shipped From\",\"Shipped To\",\"TAX\",\"TOTAL\",\"Total\",\"Unit Price\",\"Vendor Name:\",\"Website:\"]}},\"trainResult\":{\"trainingDocuments\":[{\"documentName\":\"Form_1.jpg\",\"pages\":1,\"errors\":[],\"status\":\"succeeded\"},{\"documentName\":\"Form_2.jpg\",\"pages\":1,\"errors\":[],\"status\":\"succeeded\"},{\"documentName\":\"Form_3.jpg\",\"pages\":1,\"errors\":[],\"status\":\"succeeded\"},{\"documentName\":\"Form_4.jpg\",\"pages\":1,\"errors\":[],\"status\":\"succeeded\"},{\"documentName\":\"Form_5.jpg\",\"pages\":1,\"errors\":[],\"status\":\"succeeded\"}],\"errors\":[]}}", + "Date" : "Tue, 23 Jun 2020 00:48:52 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.cognitiveservices.azure.com/formrecognizer/v2.0-preview//custom/models/06bf79f3-c38e-4189-90ed-2da0b1be643c?includeKeys=true", + "Headers" : { + "User-Agent" : "azsdk-java-azure-ai-formrecognizer/1.0.0-beta.4 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "dbce2936-0252-4351-a2a2-c2d87fe13fec" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-envoy-upstream-service-time" : "28", + "Strict-Transport-Security" : "max-age=31536000; includeSubDomains; preload", + "x-content-type-options" : "nosniff", + "apim-request-id" : "f1ef37f3-edea-4353-a429-ec393b839c0e", + "retry-after" : "0", + "StatusCode" : "200", + "Body" : "{\"modelInfo\":{\"modelId\":\"06bf79f3-c38e-4189-90ed-2da0b1be643c\",\"status\":\"ready\",\"createdDateTime\":\"2020-06-23T00:48:36Z\",\"lastUpdatedDateTime\":\"2020-06-23T00:48:47Z\"},\"keys\":{\"clusters\":{\"0\":[\"Additional Notes:\",\"Address:\",\"Company Name:\",\"Company Phone:\",\"Dated As:\",\"Details\",\"Email:\",\"Hero Limited\",\"Name:\",\"Phone:\",\"Purchase Order\",\"Purchase Order #:\",\"Quantity\",\"SUBTOTAL\",\"Seattle, WA 93849 Phone:\",\"Shipped From\",\"Shipped To\",\"TAX\",\"TOTAL\",\"Total\",\"Unit Price\",\"Vendor Name:\",\"Website:\"]}},\"trainResult\":{\"trainingDocuments\":[{\"documentName\":\"Form_1.jpg\",\"pages\":1,\"errors\":[],\"status\":\"succeeded\"},{\"documentName\":\"Form_2.jpg\",\"pages\":1,\"errors\":[],\"status\":\"succeeded\"},{\"documentName\":\"Form_3.jpg\",\"pages\":1,\"errors\":[],\"status\":\"succeeded\"},{\"documentName\":\"Form_4.jpg\",\"pages\":1,\"errors\":[],\"status\":\"succeeded\"},{\"documentName\":\"Form_5.jpg\",\"pages\":1,\"errors\":[],\"status\":\"succeeded\"}],\"errors\":[]}}", + "Date" : "Tue, 23 Jun 2020 00:48:52 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "POST", + "Uri" : "https://REDACTED.cognitiveservices.azure.com/formrecognizer/v2.0-preview//custom/models/06bf79f3-c38e-4189-90ed-2da0b1be643c/analyze?includeTextDetails=true", + "Headers" : { + "User-Agent" : "azsdk-java-azure-ai-formrecognizer/1.0.0-beta.4 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "374d525c-8761-43a1-947d-27e87766fd48", + "Content-Type" : "application/pdf" + }, + "Response" : { + "x-envoy-upstream-service-time" : "3415", + "Strict-Transport-Security" : "max-age=31536000; includeSubDomains; preload", + "x-content-type-options" : "nosniff", + "apim-request-id" : "685e637a-0262-41d2-89ef-56c55ed05ca7", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "202", + "Operation-Location" : "https://savaity-formrecognizer.cognitiveservices.azure.com/formrecognizer/v2.0-preview/custom/models/06bf79f3-c38e-4189-90ed-2da0b1be643c/analyzeresults/9f40b08b-c0b0-4f93-8b79-bae5ba42ea4d", + "Date" : "Tue, 23 Jun 2020 00:48:56 GMT" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.cognitiveservices.azure.com/formrecognizer/v2.0-preview//custom/models/06bf79f3-c38e-4189-90ed-2da0b1be643c/analyzeResults/9f40b08b-c0b0-4f93-8b79-bae5ba42ea4d", + "Headers" : { + "User-Agent" : "azsdk-java-azure-ai-formrecognizer/1.0.0-beta.4 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "25b3eb59-f040-4dd4-9c3a-bf8a86a4c340" + }, + "Response" : { + "x-envoy-upstream-service-time" : "43", + "Strict-Transport-Security" : "max-age=31536000; includeSubDomains; preload", + "x-content-type-options" : "nosniff", + "apim-request-id" : "4c7951ab-22e1-4862-925d-4691cdb48720", + "retry-after" : "0", + "Content-Length" : "13864", + "StatusCode" : "200", + "Body" : "{\"status\": \"succeeded\", \"createdDateTime\": \"2020-06-23T00:48:57Z\", \"lastUpdatedDateTime\": \"2020-06-23T00:49:01Z\", \"analyzeResult\": {\"version\": \"2.0.0\", \"readResults\": [{\"page\": 1, \"angle\": 0, \"width\": 8.5, \"height\": 11.0, \"unit\": \"inch\", \"lines\": [{\"text\": \"Contoso Suites\", \"boundingBox\": [0.5278, 1.0528, 2.6111, 1.0528, 2.6111, 1.4667, 0.5278, 1.4667], \"words\": [{\"text\": \"Contoso\", \"boundingBox\": [0.5278, 1.0528, 1.6667, 1.0528, 1.6667, 1.4667, 0.5278, 1.4667]}, {\"text\": \"Suites\", \"boundingBox\": [1.7486, 1.0528, 2.6111, 1.0528, 2.6111, 1.4667, 1.7486, 1.4667]}]}, {\"text\": \"Address:\", \"boundingBox\": [0.7958, 1.5139, 1.3958, 1.5139, 1.3958, 1.6431, 0.7958, 1.6431], \"words\": [{\"text\": \"Address:\", \"boundingBox\": [0.7958, 1.5139, 1.3958, 1.5139, 1.3958, 1.6431, 0.7958, 1.6431]}]}, {\"text\": \"Invoice For:\", \"boundingBox\": [4.3903, 1.5125, 5.1139, 1.5125, 5.1139, 1.6431, 4.3903, 1.6431], \"words\": [{\"text\": \"Invoice\", \"boundingBox\": [4.3903, 1.5125, 4.8292, 1.5125, 4.8292, 1.6431, 4.3903, 1.6431]}, {\"text\": \"For:\", \"boundingBox\": [4.8681, 1.5125, 5.1139, 1.5125, 5.1139, 1.6431, 4.8681, 1.6431]}]}, {\"text\": \"First Up Consultants\", \"boundingBox\": [5.1944, 1.4681, 6.5556, 1.4681, 6.5556, 1.6653, 5.1944, 1.6653], \"words\": [{\"text\": \"First\", \"boundingBox\": [5.1944, 1.4681, 5.4944, 1.4681, 5.4944, 1.6653, 5.1944, 1.6653]}, {\"text\": \"Up\", \"boundingBox\": [5.5333, 1.4681, 5.7167, 1.4681, 5.7167, 1.6653, 5.5333, 1.6653]}, {\"text\": \"Consultants\", \"boundingBox\": [5.7556, 1.4681, 6.5556, 1.4681, 6.5556, 1.6653, 5.7556, 1.6653]}]}, {\"text\": \"14564 Main St.\", \"boundingBox\": [0.7958, 1.6625, 1.7264, 1.6625, 1.7264, 1.8514, 0.7958, 1.8514], \"words\": [{\"text\": \"14564\", \"boundingBox\": [0.7958, 1.6625, 1.1806, 1.6625, 1.1806, 1.8514, 0.7958, 1.8514]}, {\"text\": \"Main\", \"boundingBox\": [1.2181, 1.6625, 1.5181, 1.6625, 1.5181, 1.8514, 1.2181, 1.8514]}, {\"text\": \"St.\", \"boundingBox\": [1.5569, 1.6625, 1.7264, 1.6625, 1.7264, 1.8514, 1.5569, 1.8514]}]}, {\"text\": \"1234 King St\", \"boundingBox\": [5.1931, 1.6694, 6.0236, 1.6694, 6.0236, 1.8681, 5.1931, 1.8681], \"words\": [{\"text\": \"1234\", \"boundingBox\": [5.1931, 1.6694, 5.5014, 1.6694, 5.5014, 1.8681, 5.1931, 1.8681]}, {\"text\": \"King\", \"boundingBox\": [5.5389, 1.6694, 5.8472, 1.6694, 5.8472, 1.8681, 5.5389, 1.8681]}, {\"text\": \"St\", \"boundingBox\": [5.8847, 1.6694, 6.0236, 1.6694, 6.0236, 1.8681, 5.8847, 1.8681]}]}, {\"text\": \"Saratoga, CA 94588\", \"boundingBox\": [0.7958, 1.8632, 2.0458, 1.8632, 2.0458, 2.0395, 0.7958, 2.0395], \"words\": [{\"text\": \"Saratoga,\", \"boundingBox\": [0.7958, 1.8542, 1.3958, 1.8542, 1.3958, 2.0431, 0.7958, 2.0431]}, {\"text\": \"CA\", \"boundingBox\": [1.4319, 1.8972, 1.6236, 1.8972, 1.6236, 2.0431, 1.4319, 2.0431]}, {\"text\": \"94588\", \"boundingBox\": [1.6625, 1.8542, 2.0458, 1.8542, 2.0458, 2.0264, 1.6625, 2.0264]}]}, {\"text\": \"Redmond, WA 97624\", \"boundingBox\": [5.1917, 1.8597, 6.5597, 1.8597, 6.5597, 2.0569, 5.1917, 2.0569], \"words\": [{\"text\": \"Redmond,\", \"boundingBox\": [5.1917, 1.8597, 5.8681, 1.8597, 5.8681, 2.0569, 5.1917, 2.0569]}, {\"text\": \"WA\", \"boundingBox\": [5.9069, 1.8597, 6.1375, 1.8597, 6.1375, 2.0569, 5.9069, 2.0569]}, {\"text\": \"97624\", \"boundingBox\": [6.175, 1.8597, 6.5597, 1.8597, 6.5597, 2.0569, 6.175, 2.0569]}]}, {\"text\": \"Invoice Number\", \"boundingBox\": [0.5347, 2.8722, 1.575, 2.8722, 1.575, 3.0028, 0.5347, 3.0028], \"words\": [{\"text\": \"Invoice\", \"boundingBox\": [0.5347, 2.8722, 1.0139, 2.8722, 1.0139, 3.0028, 0.5347, 3.0028]}, {\"text\": \"Number\", \"boundingBox\": [1.0514, 2.8722, 1.575, 2.8722, 1.575, 3.0028, 1.0514, 3.0028]}]}, {\"text\": \"Invoice Date\", \"boundingBox\": [1.9403, 2.8722, 2.7569, 2.8722, 2.7569, 3.0028, 1.9403, 3.0028], \"words\": [{\"text\": \"Invoice\", \"boundingBox\": [1.9403, 2.8722, 2.4194, 2.8722, 2.4194, 3.0028, 1.9403, 3.0028]}, {\"text\": \"Date\", \"boundingBox\": [2.4569, 2.8722, 2.7569, 2.8722, 2.7569, 3.0028, 2.4569, 3.0028]}]}, {\"text\": \"Invoice Due Date\", \"boundingBox\": [3.3403, 2.8722, 4.4583, 2.8722, 4.4583, 3.0028, 3.3403, 3.0028], \"words\": [{\"text\": \"Invoice\", \"boundingBox\": [3.3403, 2.8722, 3.8194, 2.8722, 3.8194, 3.0028, 3.3403, 3.0028]}, {\"text\": \"Due\", \"boundingBox\": [3.8569, 2.8722, 4.1194, 2.8722, 4.1194, 3.0028, 3.8569, 3.0028]}, {\"text\": \"Date\", \"boundingBox\": [4.1569, 2.8722, 4.4583, 2.8722, 4.4583, 3.0028, 4.1569, 3.0028]}]}, {\"text\": \"Charges\", \"boundingBox\": [4.7403, 2.8722, 5.2944, 2.8722, 5.2944, 3.0028, 4.7403, 3.0028], \"words\": [{\"text\": \"Charges\", \"boundingBox\": [4.7403, 2.8722, 5.2944, 2.8722, 5.2944, 3.0028, 4.7403, 3.0028]}]}, {\"text\": \"VAT ID\", \"boundingBox\": [6.1403, 2.8278, 6.5944, 2.8278, 6.5944, 3.025, 6.1403, 3.025], \"words\": [{\"text\": \"VAT\", \"boundingBox\": [6.1403, 2.8278, 6.4181, 2.8278, 6.4181, 3.025, 6.1403, 3.025]}, {\"text\": \"ID\", \"boundingBox\": [6.4556, 2.8278, 6.5944, 2.8278, 6.5944, 3.025, 6.4556, 3.025]}]}, {\"text\": \"7689302\", \"boundingBox\": [0.5347, 3.3681, 1.0736, 3.3681, 1.0736, 3.5569, 0.5347, 3.5569], \"words\": [{\"text\": \"7689302\", \"boundingBox\": [0.5347, 3.3681, 1.0736, 3.3681, 1.0736, 3.5569, 0.5347, 3.5569]}]}, {\"text\": \"3/09/2015\", \"boundingBox\": [1.9403, 3.3853, 2.5556, 3.3853, 2.5556, 3.5508, 1.9403, 3.5508], \"words\": [{\"text\": \"3/09/2015\", \"boundingBox\": [1.9403, 3.3681, 2.5556, 3.3681, 2.5556, 3.5569, 1.9403, 3.5569]}]}, {\"text\": \"6/29/2016\", \"boundingBox\": [3.3403, 3.3776, 3.9556, 3.3776, 3.9556, 3.5535, 3.3403, 3.5535], \"words\": [{\"text\": \"6/29/2016\", \"boundingBox\": [3.3403, 3.3681, 3.9556, 3.3681, 3.9556, 3.5569, 3.3403, 3.5569]}]}, {\"text\": \"$22,123.24\", \"boundingBox\": [5.2861, 3.3879, 5.9792, 3.3879, 5.9792, 3.5589, 5.2861, 3.5589], \"words\": [{\"text\": \"$22,123.24\", \"boundingBox\": [5.2861, 3.4181, 5.9792, 3.4181, 5.9792, 3.5472, 5.2861, 3.5472]}]}, {\"text\": \"QR\", \"boundingBox\": [6.2181, 3.3681, 6.425, 3.3681, 6.425, 3.5569, 6.2181, 3.5569], \"words\": [{\"text\": \"QR\", \"boundingBox\": [6.2181, 3.3681, 6.425, 3.3681, 6.425, 3.5569, 6.2181, 3.5569]}]}, {\"text\": \"Page\", \"boundingBox\": [6.2306, 9.6653, 6.5542, 9.6653, 6.5542, 9.7958, 6.2306, 9.7958], \"words\": [{\"text\": \"Page\", \"boundingBox\": [6.2306, 9.6653, 6.5542, 9.6653, 6.5542, 9.7958, 6.2306, 9.7958]}]}, {\"text\": \"1 of\", \"boundingBox\": [6.8319, 9.6653, 7.0611, 9.6653, 7.0611, 9.7958, 6.8319, 9.7958], \"words\": [{\"text\": \"1\", \"boundingBox\": [6.8319, 9.6653, 6.9083, 9.6653, 6.9083, 9.7958, 6.8319, 9.7958]}, {\"text\": \"of\", \"boundingBox\": [6.9458, 9.6653, 7.0611, 9.6653, 7.0611, 9.7958, 6.9458, 9.7958]}]}, {\"text\": \"1\", \"boundingBox\": [7.3986, 9.6653, 7.475, 9.6653, 7.475, 9.7958, 7.3986, 9.7958], \"words\": [{\"text\": \"1\", \"boundingBox\": [7.3986, 9.6653, 7.475, 9.6653, 7.475, 9.7958, 7.3986, 9.7958]}]}]}], \"pageResults\": [{\"page\": 1, \"keyValuePairs\": [{\"key\": {\"text\": \"Address:\", \"boundingBox\": [0.7958, 1.5139, 1.3958, 1.5139, 1.3958, 1.6431, 0.7958, 1.6431], \"elements\": [\"#/readResults/0/lines/1/words/0\"]}, \"value\": {\"text\": \"14564 Main St. Saratoga, CA 94588\", \"boundingBox\": [0.7958, 1.6625, 2.0458, 1.6625, 2.0458, 2.0395, 0.7958, 2.0395], \"elements\": [\"#/readResults/0/lines/4/words/0\", \"#/readResults/0/lines/4/words/1\", \"#/readResults/0/lines/4/words/2\", \"#/readResults/0/lines/6/words/0\", \"#/readResults/0/lines/6/words/1\", \"#/readResults/0/lines/6/words/2\"]}, \"confidence\": 1.0}, {\"key\": {\"text\": \"Invoice For:\", \"boundingBox\": [4.3903, 1.5125, 5.1139, 1.5125, 5.1139, 1.6431, 4.3903, 1.6431], \"elements\": [\"#/readResults/0/lines/2/words/0\", \"#/readResults/0/lines/2/words/1\"]}, \"value\": {\"text\": \"First Up Consultants 1234 King St Redmond, WA 97624\", \"boundingBox\": [5.1917, 1.4681, 6.5597, 1.4681, 6.5597, 2.0569, 5.1917, 2.0569], \"elements\": [\"#/readResults/0/lines/3/words/0\", \"#/readResults/0/lines/3/words/1\", \"#/readResults/0/lines/3/words/2\", \"#/readResults/0/lines/5/words/0\", \"#/readResults/0/lines/5/words/1\", \"#/readResults/0/lines/5/words/2\", \"#/readResults/0/lines/7/words/0\", \"#/readResults/0/lines/7/words/1\", \"#/readResults/0/lines/7/words/2\"]}, \"confidence\": 1.0}, {\"key\": {\"text\": \"Invoice Number\", \"boundingBox\": [0.5347, 2.8722, 1.575, 2.8722, 1.575, 3.0028, 0.5347, 3.0028], \"elements\": [\"#/readResults/0/lines/8/words/0\", \"#/readResults/0/lines/8/words/1\"]}, \"value\": {\"text\": \"7689302\", \"boundingBox\": [0.5347, 3.3681, 1.0736, 3.3681, 1.0736, 3.5569, 0.5347, 3.5569], \"elements\": [\"#/readResults/0/lines/13/words/0\"]}, \"confidence\": 1.0}, {\"key\": {\"text\": \"Invoice Date\", \"boundingBox\": [1.9403, 2.8722, 2.7569, 2.8722, 2.7569, 3.0028, 1.9403, 3.0028], \"elements\": [\"#/readResults/0/lines/9/words/0\", \"#/readResults/0/lines/9/words/1\"]}, \"value\": {\"text\": \"3/09/2015\", \"boundingBox\": [1.9403, 3.3853, 2.5556, 3.3853, 2.5556, 3.5508, 1.9403, 3.5508], \"elements\": [\"#/readResults/0/lines/14/words/0\"]}, \"confidence\": 1.0}, {\"key\": {\"text\": \"Invoice Due Date\", \"boundingBox\": [3.3403, 2.8722, 4.4583, 2.8722, 4.4583, 3.0028, 3.3403, 3.0028], \"elements\": [\"#/readResults/0/lines/10/words/0\", \"#/readResults/0/lines/10/words/1\", \"#/readResults/0/lines/10/words/2\"]}, \"value\": {\"text\": \"6/29/2016\", \"boundingBox\": [3.3403, 3.3776, 3.9556, 3.3776, 3.9556, 3.5535, 3.3403, 3.5535], \"elements\": [\"#/readResults/0/lines/15/words/0\"]}, \"confidence\": 1.0}, {\"key\": {\"text\": \"Charges\", \"boundingBox\": [4.7403, 2.8722, 5.2944, 2.8722, 5.2944, 3.0028, 4.7403, 3.0028], \"elements\": [\"#/readResults/0/lines/11/words/0\"]}, \"value\": {\"text\": \"$22,123.24\", \"boundingBox\": [5.2861, 3.3879, 5.9792, 3.3879, 5.9792, 3.5589, 5.2861, 3.5589], \"elements\": [\"#/readResults/0/lines/16/words/0\"]}, \"confidence\": 1.0}, {\"key\": {\"text\": \"VAT ID\", \"boundingBox\": [6.1403, 2.8278, 6.5944, 2.8278, 6.5944, 3.025, 6.1403, 3.025], \"elements\": [\"#/readResults/0/lines/12/words/0\", \"#/readResults/0/lines/12/words/1\"]}, \"value\": {\"text\": \"QR\", \"boundingBox\": [6.2181, 3.3681, 6.425, 3.3681, 6.425, 3.5569, 6.2181, 3.5569], \"elements\": [\"#/readResults/0/lines/17/words/0\"]}, \"confidence\": 1.0}, {\"key\": {\"text\": \"__Tokens__1\", \"boundingBox\": null, \"elements\": null}, \"value\": {\"text\": \"Contoso Suites\", \"boundingBox\": [0.5278, 1.0528, 2.6111, 1.0528, 2.6111, 1.4667, 0.5278, 1.4667], \"elements\": [\"#/readResults/0/lines/0/words/0\", \"#/readResults/0/lines/0/words/1\"]}, \"confidence\": 1.0}, {\"key\": {\"text\": \"__Tokens__2\", \"boundingBox\": null, \"elements\": null}, \"value\": {\"text\": \"Page\", \"boundingBox\": [6.2306, 9.6653, 6.5542, 9.6653, 6.5542, 9.7958, 6.2306, 9.7958], \"elements\": [\"#/readResults/0/lines/18/words/0\"]}, \"confidence\": 1.0}, {\"key\": {\"text\": \"__Tokens__3\", \"boundingBox\": null, \"elements\": null}, \"value\": {\"text\": \"1 of\", \"boundingBox\": [6.8319, 9.6653, 7.0611, 9.6653, 7.0611, 9.7958, 6.8319, 9.7958], \"elements\": [\"#/readResults/0/lines/19/words/0\", \"#/readResults/0/lines/19/words/1\"]}, \"confidence\": 1.0}, {\"key\": {\"text\": \"__Tokens__4\", \"boundingBox\": null, \"elements\": null}, \"value\": {\"text\": \"1\", \"boundingBox\": [7.3986, 9.6653, 7.475, 9.6653, 7.475, 9.7958, 7.3986, 9.7958], \"elements\": [\"#/readResults/0/lines/20/words/0\"]}, \"confidence\": 1.0}], \"tables\": [{\"rows\": 2, \"columns\": 5, \"cells\": [{\"text\": \"Invoice Number\", \"rowIndex\": 0, \"columnIndex\": 0, \"boundingBox\": [0.5347, 2.8722, 1.575, 2.8722, 1.575, 3.0028, 0.5347, 3.0028], \"confidence\": 0.0, \"rowSpan\": 1, \"columnSpan\": 1, \"elements\": [\"#/readResults/0/lines/8/words/0\", \"#/readResults/0/lines/8/words/1\"], \"isHeader\": true, \"isFooter\": false}, {\"text\": \"Invoice Date\", \"rowIndex\": 0, \"columnIndex\": 1, \"boundingBox\": [1.9403, 2.8722, 2.7569, 2.8722, 2.7569, 3.0028, 1.9403, 3.0028], \"confidence\": 0.0, \"rowSpan\": 1, \"columnSpan\": 1, \"elements\": [\"#/readResults/0/lines/9/words/0\", \"#/readResults/0/lines/9/words/1\"], \"isHeader\": true, \"isFooter\": false}, {\"text\": \"Invoice Due Date\", \"rowIndex\": 0, \"columnIndex\": 2, \"boundingBox\": [3.3403, 2.8722, 4.4583, 2.8722, 4.4583, 3.0028, 3.3403, 3.0028], \"confidence\": 0.0, \"rowSpan\": 1, \"columnSpan\": 1, \"elements\": [\"#/readResults/0/lines/10/words/0\", \"#/readResults/0/lines/10/words/1\", \"#/readResults/0/lines/10/words/2\"], \"isHeader\": true, \"isFooter\": false}, {\"text\": \"Charges\", \"rowIndex\": 0, \"columnIndex\": 3, \"boundingBox\": [4.7403, 2.8722, 5.2944, 2.8722, 5.2944, 3.0028, 4.7403, 3.0028], \"confidence\": 0.0, \"rowSpan\": 1, \"columnSpan\": 1, \"elements\": [\"#/readResults/0/lines/11/words/0\"], \"isHeader\": true, \"isFooter\": false}, {\"text\": \"VAT ID\", \"rowIndex\": 0, \"columnIndex\": 4, \"boundingBox\": [6.1403, 2.8278, 6.5944, 2.8278, 6.5944, 3.025, 6.1403, 3.025], \"confidence\": 0.0, \"rowSpan\": 1, \"columnSpan\": 1, \"elements\": [\"#/readResults/0/lines/12/words/0\", \"#/readResults/0/lines/12/words/1\"], \"isHeader\": true, \"isFooter\": false}, {\"text\": \"7689302\", \"rowIndex\": 1, \"columnIndex\": 0, \"boundingBox\": [0.5347, 3.3681, 1.0736, 3.3681, 1.0736, 3.5569, 0.5347, 3.5569], \"confidence\": 0.0, \"rowSpan\": 1, \"columnSpan\": 1, \"elements\": [\"#/readResults/0/lines/13/words/0\"], \"isHeader\": false, \"isFooter\": false}, {\"text\": \"3/09/2015\", \"rowIndex\": 1, \"columnIndex\": 1, \"boundingBox\": [1.9403, 3.3853, 2.5556, 3.3853, 2.5556, 3.5508, 1.9403, 3.5508], \"confidence\": 0.0, \"rowSpan\": 1, \"columnSpan\": 1, \"elements\": [\"#/readResults/0/lines/14/words/0\"], \"isHeader\": false, \"isFooter\": false}, {\"text\": \"6/29/2016\", \"rowIndex\": 1, \"columnIndex\": 2, \"boundingBox\": [3.3403, 3.3776, 3.9556, 3.3776, 3.9556, 3.5535, 3.3403, 3.5535], \"confidence\": 0.0, \"rowSpan\": 1, \"columnSpan\": 1, \"elements\": [\"#/readResults/0/lines/15/words/0\"], \"isHeader\": false, \"isFooter\": false}, {\"text\": \"$22,123.24\", \"rowIndex\": 1, \"columnIndex\": 3, \"boundingBox\": [5.2861, 3.3879, 5.9792, 3.3879, 5.9792, 3.5589, 5.2861, 3.5589], \"confidence\": 0.0, \"rowSpan\": 1, \"columnSpan\": 1, \"elements\": [\"#/readResults/0/lines/16/words/0\"], \"isHeader\": false, \"isFooter\": false}, {\"text\": \"QR\", \"rowIndex\": 1, \"columnIndex\": 4, \"boundingBox\": [6.2181, 3.3681, 6.425, 3.3681, 6.425, 3.5569, 6.2181, 3.5569], \"confidence\": 0.0, \"rowSpan\": 1, \"columnSpan\": 1, \"elements\": [\"#/readResults/0/lines/17/words/0\"], \"isHeader\": false, \"isFooter\": false}]}], \"clusterId\": null}], \"documentResults\": [], \"errors\": []}}", + "Date" : "Tue, 23 Jun 2020 00:49:02 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.cognitiveservices.azure.com/formrecognizer/v2.0-preview//custom/models/06bf79f3-c38e-4189-90ed-2da0b1be643c/analyzeResults/9f40b08b-c0b0-4f93-8b79-bae5ba42ea4d", + "Headers" : { + "User-Agent" : "azsdk-java-azure-ai-formrecognizer/1.0.0-beta.4 (11.0.5; Windows 10 10.0)", + "x-ms-client- request-id" : "55acd602-67fc-4e9d-85b1-bb89c213f148" + }, + "Response" : { + "x-envoy-upstream-service-time" : "30", + "Strict-Transport-Security" : "max-age=31536000; includeSubDomains; preload", + "x-content-type-options" : "nosniff", + "apim-request-id" : "57224bce-5d32-4321-8592-fcfc73e3f39c", + "retry-after" : "0", + "Content-Length" : "13864", + "StatusCode" : "200", + "Body" : "{\"status\": \"succeeded\", \"createdDateTime\": \"2020-06-23T00:48:57Z\", \"lastUpdatedDateTime\": \"2020-06-23T00:49:01Z\", \"analyzeResult\": {\"version\": \"2.0.0\", \"readResults\": [{\"page\": 1, \"angle\": 0, \"width\": 8.5, \"height\": 11.0, \"unit\": \"inch\", \"lines\": [{\"text\": \"Contoso Suites\", \"boundingBox\": [0.5278, 1.0528, 2.6111, 1.0528, 2.6111, 1.4667, 0.5278, 1.4667], \"words\": [{\"text\": \"Contoso\", \"boundingBox\": [0.5278, 1.0528, 1.6667, 1.0528, 1.6667, 1.4667, 0.5278, 1.4667]}, {\"text\": \"Suites\", \"boundingBox\": [1.7486, 1.0528, 2.6111, 1.0528, 2.6111, 1.4667, 1.7486, 1.4667]}]}, {\"text\": \"Address:\", \"boundingBox\": [0.7958, 1.5139, 1.3958, 1.5139, 1.3958, 1.6431, 0.7958, 1.6431], \"words\": [{\"text\": \"Address:\", \"boundingBox\": [0.7958, 1.5139, 1.3958, 1.5139, 1.3958, 1.6431, 0.7958, 1.6431]}]}, {\"text\": \"Invoice For:\", \"boundingBox\": [4.3903, 1.5125, 5.1139, 1.5125, 5.1139, 1.6431, 4.3903, 1.6431], \"words\": [{\"text\": \"Invoice\", \"boundingBox\": [4.3903, 1.5125, 4.8292, 1.5125, 4.8292, 1.6431, 4.3903, 1.6431]}, {\"text\": \"For:\", \"boundingBox\": [4.8681, 1.5125, 5.1139, 1.5125, 5.1139, 1.6431, 4.8681, 1.6431]}]}, {\"text\": \"First Up Consultants\", \"boundingBox\": [5.1944, 1.4681, 6.5556, 1.4681, 6.5556, 1.6653, 5.1944, 1.6653], \"words\": [{\"text\": \"First\", \"boundingBox\": [5.1944, 1.4681, 5.4944, 1.4681, 5.4944, 1.6653, 5.1944, 1.6653]}, {\"text\": \"Up\", \"boundingBox\": [5.5333, 1.4681, 5.7167, 1.4681, 5.7167, 1.6653, 5.5333, 1.6653]}, {\"text\": \"Consultants\", \"boundingBox\": [5.7556, 1.4681, 6.5556, 1.4681, 6.5556, 1.6653, 5.7556, 1.6653]}]}, {\"text\": \"14564 Main St.\", \"boundingBox\": [0.7958, 1.6625, 1.7264, 1.6625, 1.7264, 1.8514, 0.7958, 1.8514], \"words\": [{\"text\": \"14564\", \"boundingBox\": [0.7958, 1.6625, 1.1806, 1.6625, 1.1806, 1.8514, 0.7958, 1.8514]}, {\"text\": \"Main\", \"boundingBox\": [1.2181, 1.6625, 1.5181, 1.6625, 1.5181, 1.8514, 1.2181, 1.8514]}, {\"text\": \"St.\", \"boundingBox\": [1.5569, 1.6625, 1.7264, 1.6625, 1.7264, 1.8514, 1.5569, 1.8514]}]}, {\"text\": \"1234 King St\", \"boundingBox\": [5.1931, 1.6694, 6.0236, 1.6694, 6.0236, 1.8681, 5.1931, 1.8681], \"words\": [{\"text\": \"1234\", \"boundingBox\": [5.1931, 1.6694, 5.5014, 1.6694, 5.5014, 1.8681, 5.1931, 1.8681]}, {\"text\": \"King\", \"boundingBox\": [5.5389, 1.6694, 5.8472, 1.6694, 5.8472, 1.8681, 5.5389, 1.8681]}, {\"text\": \"St\", \"boundingBox\": [5.8847, 1.6694, 6.0236, 1.6694, 6.0236, 1.8681, 5.8847, 1.8681]}]}, {\"text\": \"Saratoga, CA 94588\", \"boundingBox\": [0.7958, 1.8632, 2.0458, 1.8632, 2.0458, 2.0395, 0.7958, 2.0395], \"words\": [{\"text\": \"Saratoga,\", \"boundingBox\": [0.7958, 1.8542, 1.3958, 1.8542, 1.3958, 2.0431, 0.7958, 2.0431]}, {\"text\": \"CA\", \"boundingBox\": [1.4319, 1.8972, 1.6236, 1.8972, 1.6236, 2.0431, 1.4319, 2.0431]}, {\"text\": \"94588\", \"boundingBox\": [1.6625, 1.8542, 2.0458, 1.8542, 2.0458, 2.0264, 1.6625, 2.0264]}]}, {\"text\": \"Redmond, WA 97624\", \"boundingBox\": [5.1917, 1.8597, 6.5597, 1.8597, 6.5597, 2.0569, 5.1917, 2.0569], \"words\": [{\"text\": \"Redmond,\", \"boundingBox\": [5.1917, 1.8597, 5.8681, 1.8597, 5.8681, 2.0569, 5.1917, 2.0569]}, {\"text\": \"WA\", \"boundingBox\": [5.9069, 1.8597, 6.1375, 1.8597, 6.1375, 2.0569, 5.9069, 2.0569]}, {\"text\": \"97624\", \"boundingBox\": [6.175, 1.8597, 6.5597, 1.8597, 6.5597, 2.0569, 6.175, 2.0569]}]}, {\"text\": \"Invoice Number\", \"boundingBox\": [0.5347, 2.8722, 1.575, 2.8722, 1.575, 3.0028, 0.5347, 3.0028], \"words\": [{\"text\": \"Invoice\", \"boundingBox\": [0.5347, 2.8722, 1.0139, 2.8722, 1.0139, 3.0028, 0.5347, 3.0028]}, {\"text\": \"Number\", \"boundingBox\": [1.0514, 2.8722, 1.575, 2.8722, 1.575, 3.0028, 1.0514, 3.0028]}]}, {\"text\": \"Invoice Date\", \"boundingBox\": [1.9403, 2.8722, 2.7569, 2.8722, 2.7569, 3.0028, 1.9403, 3.0028], \"words\": [{\"text\": \"Invoice\", \"boundingBox\": [1.9403, 2.8722, 2.4194, 2.8722, 2.4194, 3.0028, 1.9403, 3.0028]}, {\"text\": \"Date\", \"boundingBox\": [2.4569, 2.8722, 2.7569, 2.8722, 2.7569, 3.0028, 2.4569, 3.0028]}]}, {\"text\": \"Invoice Due Date\", \"boundingBox\": [3.3403, 2.8722, 4.4583, 2.8722, 4.4583, 3.0028, 3.3403, 3.0028], \"words\": [{\"text\": \"Invoice\", \"boundingBox\": [3.3403, 2.8722, 3.8194, 2.8722, 3.8194, 3.0028, 3.3403, 3.0028]}, {\"text\": \"Due\", \"boundingBox\": [3.8569, 2.8722, 4.1194, 2.8722, 4.1194, 3.0028, 3.8569, 3.0028]}, {\"text\": \"Date\", \"boundingBox\": [4.1569, 2.8722, 4.4583, 2.8722, 4.4583, 3.0028, 4.1569, 3.0028]}]}, {\"text\": \"Charges\", \"boundingBox\": [4.7403, 2.8722, 5.2944, 2.8722, 5.2944, 3.0028, 4.7403, 3.0028], \"words\": [{\"text\": \"Charges\", \"boundingBox\": [4.7403, 2.8722, 5.2944, 2.8722, 5.2944, 3.0028, 4.7403, 3.0028]}]}, {\"text\": \"VAT ID\", \"boundingBox\": [6.1403, 2.8278, 6.5944, 2.8278, 6.5944, 3.025, 6.1403, 3.025], \"words\": [{\"text\": \"VAT\", \"boundingBox\": [6.1403, 2.8278, 6.4181, 2.8278, 6.4181, 3.025, 6.1403, 3.025]}, {\"text\": \"ID\", \"boundingBox\": [6.4556, 2.8278, 6.5944, 2.8278, 6.5944, 3.025, 6.4556, 3.025]}]}, {\"text\": \"7689302\", \"boundingBox\": [0.5347, 3.3681, 1.0736, 3.3681, 1.0736, 3.5569, 0.5347, 3.5569], \"words\": [{\"text\": \"7689302\", \"boundingBox\": [0.5347, 3.3681, 1.0736, 3.3681, 1.0736, 3.5569, 0.5347, 3.5569]}]}, {\"text\": \"3/09/2015\", \"boundingBox\": [1.9403, 3.3853, 2.5556, 3.3853, 2.5556, 3.5508, 1.9403, 3.5508], \"words\": [{\"text\": \"3/09/2015\", \"boundingBox\": [1.9403, 3.3681, 2.5556, 3.3681, 2.5556, 3.5569, 1.9403, 3.5569]}]}, {\"text\": \"6/29/2016\", \"boundingBox\": [3.3403, 3.3776, 3.9556, 3.3776, 3.9556, 3.5535, 3.3403, 3.5535], \"words\": [{\"text\": \"6/29/2016\", \"boundingBox\": [3.3403, 3.3681, 3.9556, 3.3681, 3.9556, 3.5569, 3.3403, 3.5569]}]}, {\"text\": \"$22,123.24\", \"boundingBox\": [5.2861, 3.3879, 5.9792, 3.3879, 5.9792, 3.5589, 5.2861, 3.5589], \"words\": [{\"text\": \"$22,123.24\", \"boundingBox\": [5.2861, 3.4181, 5.9792, 3.4181, 5.9792, 3.5472, 5.2861, 3.5472]}]}, {\"text\": \"QR\", \"boundingBox\": [6.2181, 3.3681, 6.425, 3.3681, 6.425, 3.5569, 6.2181, 3.5569], \"words\": [{\"text\": \"QR\", \"boundingBox\": [6.2181, 3.3681, 6.425, 3.3681, 6.425, 3.5569, 6.2181, 3.5569]}]}, {\"text\": \"Page\", \"boundingBox\": [6.2306, 9.6653, 6.5542, 9.6653, 6.5542, 9.7958, 6.2306, 9.7958], \"words\": [{\"text\": \"Page\", \"boundingBox\": [6.2306, 9.6653, 6.5542, 9.6653, 6.5542, 9.7958, 6.2306, 9.7958]}]}, {\"text\": \"1 of\", \"boundingBox\": [6.8319, 9.6653, 7.0611, 9.6653, 7.0611, 9.7958, 6.8319, 9.7958], \"words\": [{\"text\": \"1\", \"boundingBox\": [6.8319, 9.6653, 6.9083, 9.6653, 6.9083, 9.7958, 6.8319, 9.7958]}, {\"text\": \"of\", \"boundingBox\": [6.9458, 9.6653, 7.0611, 9.6653, 7.0611, 9.7958, 6.9458, 9.7958]}]}, {\"text\": \"1\", \"boundingBox\": [7.3986, 9.6653, 7.475, 9.6653, 7.475, 9.7958, 7.3986, 9.7958], \"words\": [{\"text\": \"1\", \"boundingBox\": [7.3986, 9.6653, 7.475, 9.6653, 7.475, 9.7958, 7.3986, 9.7958]}]}]}], \"pageResults\": [{\"page\": 1, \"keyValuePairs\": [{\"key\": {\"text\": \"Address:\", \"boundingBox\": [0.7958, 1.5139, 1.3958, 1.5139, 1.3958, 1.6431, 0.7958, 1.6431], \"elements\": [\"#/readResults/0/lines/1/words/0\"]}, \"value\": {\"text\": \"14564 Main St. Saratoga, CA 94588\", \"boundingBox\": [0.7958, 1.6625, 2.0458, 1.6625, 2.0458, 2.0395, 0.7958, 2.0395], \"elements\": [\"#/readResults/0/lines/4/words/0\", \"#/readResults/0/lines/4/words/1\", \"#/readResults/0/lines/4/words/2\", \"#/readResults/0/lines/6/words/0\", \"#/readResults/0/lines/6/words/1\", \"#/readResults/0/lines/6/words/2\"]}, \"confidence\": 1.0}, {\"key\": {\"text\": \"Invoice For:\", \"boundingBox\": [4.3903, 1.5125, 5.1139, 1.5125, 5.1139, 1.6431, 4.3903, 1.6431], \"elements\": [\"#/readResults/0/lines/2/words/0\", \"#/readResults/0/lines/2/words/1\"]}, \"value\": {\"text\": \"First Up Consultants 1234 King St Redmond, WA 97624\", \"boundingBox\": [5.1917, 1.4681, 6.5597, 1.4681, 6.5597, 2.0569, 5.1917, 2.0569], \"elements\": [\"#/readResults/0/lines/3/words/0\", \"#/readResults/0/lines/3/words/1\", \"#/readResults/0/lines/3/words/2\", \"#/readResults/0/lines/5/words/0\", \"#/readResults/0/lines/5/words/1\", \"#/readResults/0/lines/5/words/2\", \"#/readResults/0/lines/7/words/0\", \"#/readResults/0/lines/7/words/1\", \"#/readResults/0/lines/7/words/2\"]}, \"confidence\": 1.0}, {\"key\": {\"text\": \"Invoice Number\", \"boundingBox\": [0.5347, 2.8722, 1.575, 2.8722, 1.575, 3.0028, 0.5347, 3.0028], \"elements\": [\"#/readResults/0/lines/8/words/0\", \"#/readResults/0/lines/8/words/1\"]}, \"value\": {\"text\": \"7689302\", \"boundingBox\": [0.5347, 3.3681, 1.0736, 3.3681, 1.0736, 3.5569, 0.5347, 3.5569], \"elements\": [\"#/readResults/0/lines/13/words/0\"]}, \"confidence\": 1.0}, {\"key\": {\"text\": \"Invoice Date\", \"boundingBox\": [1.9403, 2.8722, 2.7569, 2.8722, 2.7569, 3.0028, 1.9403, 3.0028], \"elements\": [\"#/readResults/0/lines/9/words/0\", \"#/readResults/0/lines/9/words/1\"]}, \"value\": {\"text\": \"3/09/2015\", \"boundingBox\": [1.9403, 3.3853, 2.5556, 3.3853, 2.5556, 3.5508, 1.9403, 3.5508], \"elements\": [\"#/readResults/0/lines/14/words/0\"]}, \"confidence\": 1.0}, {\"key\": {\"text\": \"Invoice Due Date\", \"boundingBox\": [3.3403, 2.8722, 4.4583, 2.8722, 4.4583, 3.0028, 3.3403, 3.0028], \"elements\": [\"#/readResults/0/lines/10/words/0\", \"#/readResults/0/lines/10/words/1\", \"#/readResults/0/lines/10/words/2\"]}, \"value\": {\"text\": \"6/29/2016\", \"boundingBox\": [3.3403, 3.3776, 3.9556, 3.3776, 3.9556, 3.5535, 3.3403, 3.5535], \"elements\": [\"#/readResults/0/lines/15/words/0\"]}, \"confidence\": 1.0}, {\"key\": {\"text\": \"Charges\", \"boundingBox\": [4.7403, 2.8722, 5.2944, 2.8722, 5.2944, 3.0028, 4.7403, 3.0028], \"elements\": [\"#/readResults/0/lines/11/words/0\"]}, \"value\": {\"text\": \"$22,123.24\", \"boundingBox\": [5.2861, 3.3879, 5.9792, 3.3879, 5.9792, 3.5589, 5.2861, 3.5589], \"elements\": [\"#/readResults/0/lines/16/words/0\"]}, \"confidence\": 1.0}, {\"key\": {\"text\": \"VAT ID\", \"boundingBox\": [6.1403, 2.8278, 6.5944, 2.8278, 6.5944, 3.025, 6.1403, 3.025], \"elements\": [\"#/readResults/0/lines/12/words/0\", \"#/readResults/0/lines/12/words/1\"]}, \"value\": {\"text\": \"QR\", \"boundingBox\": [6.2181, 3.3681, 6.425, 3.3681, 6.425, 3.5569, 6.2181, 3.5569], \"elements\": [\"#/readResults/0/lines/17/words/0\"]}, \"confidence\": 1.0}, {\"key\": {\"text\": \"__Tokens__1\", \"boundingBox\": null, \"elements\": null}, \"value\": {\"text\": \"Contoso Suites\", \"boundingBox\": [0.5278, 1.0528, 2.6111, 1.0528, 2.6111, 1.4667, 0.5278, 1.4667], \"elements\": [\"#/readResults/0/lines/0/words/0\", \"#/readResults/0/lines/0/words/1\"]}, \"confidence\": 1.0}, {\"key\": {\"text\": \"__Tokens__2\", \"boundingBox\": null, \"elements\": null}, \"value\": {\"text\": \"Page\", \"boundingBox\": [6.2306, 9.6653, 6.5542, 9.6653, 6.5542, 9.7958, 6.2306, 9.7958], \"elements\": [\"#/readResults/0/lines/18/words/0\"]}, \"confidence\": 1.0}, {\"key\": {\"text\": \"__Tokens__3\", \"boundingBox\": null, \"elements\": null}, \"value\": {\"text\": \"1 of\", \"boundingBox\": [6.8319, 9.6653, 7.0611, 9.6653, 7.0611, 9.7958, 6.8319, 9.7958], \"elements\": [\"#/readResults/0/lines/19/words/0\", \"#/readResults/0/lines/19/words/1\"]}, \"confidence\": 1.0}, {\"key\": {\"text\": \"__Tokens__4\", \"boundingBox\": null, \"elements\": null}, \"value\": {\"text\": \"1\", \"boundingBox\": [7.3986, 9.6653, 7.475, 9.6653, 7.475, 9.7958, 7.3986, 9.7958], \"elements\": [\"#/readResults/0/lines/20/words/0\"]}, \"confidence\": 1.0}], \"tables\": [{\"rows\": 2, \"columns\": 5, \"cells\": [{\"text\": \"Invoice Number\", \"rowIndex\": 0, \"columnIndex\": 0, \"boundingBox\": [0.5347, 2.8722, 1.575, 2.8722, 1.575, 3.0028, 0.5347, 3.0028], \"confidence\": 0.0, \"rowSpan\": 1, \"columnSpan\": 1, \"elements\": [\"#/readResults/0/lines/8/words/0\", \"#/readResults/0/lines/8/words/1\"], \"isHeader\": true, \"isFooter\": false}, {\"text\": \"Invoice Date\", \"rowIndex\": 0, \"columnIndex\": 1, \"boundingBox\": [1.9403, 2.8722, 2.7569, 2.8722, 2.7569, 3.0028, 1.9403, 3.0028], \"confidence\": 0.0, \"rowSpan\": 1, \"columnSpan\": 1, \"elements\": [\"#/readResults/0/lines/9/words/0\", \"#/readResults/0/lines/9/words/1\"], \"isHeader\": true, \"isFooter\": false}, {\"text\": \"Invoice Due Date\", \"rowIndex\": 0, \"columnIndex\": 2, \"boundingBox\": [3.3403, 2.8722, 4.4583, 2.8722, 4.4583, 3.0028, 3.3403, 3.0028], \"confidence\": 0.0, \"rowSpan\": 1, \"columnSpan\": 1, \"elements\": [\"#/readResults/0/lines/10/words/0\", \"#/readResults/0/lines/10/words/1\", \"#/readResults/0/lines/10/words/2\"], \"isHeader\": true, \"isFooter\": false}, {\"text\": \"Charges\", \"rowIndex\": 0, \"columnIndex\": 3, \"boundingBox\": [4.7403, 2.8722, 5.2944, 2.8722, 5.2944, 3.0028, 4.7403, 3.0028], \"confidence\": 0.0, \"rowSpan\": 1, \"columnSpan\": 1, \"elements\": [\"#/readResults/0/lines/11/words/0\"], \"isHeader\": true, \"isFooter\": false}, {\"text\": \"VAT ID\", \"rowIndex\": 0, \"columnIndex\": 4, \"boundingBox\": [6.1403, 2.8278, 6.5944, 2.8278, 6.5944, 3.025, 6.1403, 3.025], \"confidence\": 0.0, \"rowSpan\": 1, \"columnSpan\": 1, \"elements\": [\"#/readResults/0/lines/12/words/0\", \"#/readResults/0/lines/12/words/1\"], \"isHeader\": true, \"isFooter\": false}, {\"text\": \"7689302\", \"rowIndex\": 1, \"columnIndex\": 0, \"boundingBox\": [0.5347, 3.3681, 1.0736, 3.3681, 1.0736, 3.5569, 0.5347, 3.5569], \"confidence\": 0.0, \"rowSpan\": 1, \"columnSpan\": 1, \"elements\": [\"#/readResults/0/lines/13/words/0\"], \"isHeader\": false, \"isFooter\": false}, {\"text\": \"3/09/2015\", \"rowIndex\": 1, \"columnIndex\": 1, \"boundingBox\": [1.9403, 3.3853, 2.5556, 3.3853, 2.5556, 3.5508, 1.9403, 3.5508], \"confidence\": 0.0, \"rowSpan\": 1, \"columnSpan\": 1, \"elements\": [\"#/readResults/0/lines/14/words/0\"], \"isHeader\": false, \"isFooter\": false}, {\"text\": \"6/29/2016\", \"rowIndex\": 1, \"columnIndex\": 2, \"boundingBox\": [3.3403, 3.3776, 3.9556, 3.3776, 3.9556, 3.5535, 3.3403, 3.5535], \"confidence\": 0.0, \"rowSpan\": 1, \"columnSpan\": 1, \"elements\": [\"#/readResults/0/lines/15/words/0\"], \"isHeader\": false, \"isFooter\": false}, {\"text\": \"$22,123.24\", \"rowIndex\": 1, \"columnIndex\": 3, \"boundingBox\": [5.2861, 3.3879, 5.9792, 3.3879, 5.9792, 3.5589, 5.2861, 3.5589], \"confidence\": 0.0, \"rowSpan\": 1, \"columnSpan\": 1, \"elements\": [\"#/readResults/0/lines/16/words/0\"], \"isHeader\": false, \"isFooter\": false}, {\"text\": \"QR\", \"rowIndex\": 1, \"columnIndex\": 4, \"boundingBox\": [6.2181, 3.3681, 6.425, 3.3681, 6.425, 3.5569, 6.2181, 3.5569], \"confidence\": 0.0, \"rowSpan\": 1, \"columnSpan\": 1, \"elements\": [\"#/readResults/0/lines/17/words/0\"], \"isHeader\": false, \"isFooter\": false}]}], \"clusterId\": null}], \"documentResults\": [], \"errors\": []}}", + "Date" : "Tue, 23 Jun 2020 00:49:02 GMT", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + } ], + "variables" : [ ] +} diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/src/test/resources/session-records/recognizeCustomFormUnlabeledDataIncludeTextDetails.json b/sdk/formrecognizer/azure-ai-formrecognizer/src/test/resources/session-records/recognizeCustomFormUnlabeledDataIncludeTextDetails.json deleted file mode 100644 index 79eae94e1237c..0000000000000 --- a/sdk/formrecognizer/azure-ai-formrecognizer/src/test/resources/session-records/recognizeCustomFormUnlabeledDataIncludeTextDetails.json +++ /dev/null @@ -1,144 +0,0 @@ -{ - "networkCallRecords" : [ { - "Method" : "POST", - "Uri" : "https://javaformrecognizertestresource.cognitiveservices.azure.com/formrecognizer/v2.0-preview//custom/models", - "Headers" : { - "User-Agent" : "azsdk-java-azure-ai-formrecognizer/1.0.0-beta.1 (11.0.5; Windows 10 10.0)", - "x-ms-client-request-id" : "7483be38-e2a3-478e-a880-851e6d61e5e8", - "Content-Type" : "application/json" - }, - "Response" : { - "x-envoy-upstream-service-time" : "52", - "Strict-Transport-Security" : "max-age=31536000; includeSubDomains; preload", - "x-content-type-options" : "nosniff", - "apim-request-id" : "100e81ed-20aa-4a90-b1f9-0241edc16ae6", - "retry-after" : "0", - "Content-Length" : "0", - "StatusCode" : "201", - "Date" : "Wed, 29 Apr 2020 19:02:19 GMT", - "Location" : "https://javaformrecognizertestresource.cognitiveservices.azure.com/formrecognizer/v2.0-preview/custom/models/88c3a891-fd00-4f08-a25a-96ea767bd036" - }, - "Exception" : null - }, { - "Method" : "GET", - "Uri" : "https://javaformrecognizertestresource.cognitiveservices.azure.com/formrecognizer/v2.0-preview//custom/models/88c3a891-fd00-4f08-a25a-96ea767bd036?includeKeys=true", - "Headers" : { - "User-Agent" : "azsdk-java-azure-ai-formrecognizer/1.0.0-beta.1 (11.0.5; Windows 10 10.0)", - "x-ms-client-request-id" : "fbd3088e-c518-4c70-b343-e5ca81301434" - }, - "Response" : { - "Transfer-Encoding" : "chunked", - "x-envoy-upstream-service-time" : "26", - "Strict-Transport-Security" : "max-age=31536000; includeSubDomains; preload", - "x-content-type-options" : "nosniff", - "apim-request-id" : "eeabc406-4d93-49ff-9606-0a546ccd568d", - "retry-after" : "0", - "StatusCode" : "200", - "Body" : "{\"modelInfo\":{\"modelId\":\"88c3a891-fd00-4f08-a25a-96ea767bd036\",\"status\":\"creating\",\"createdDateTime\":\"2020-04-29T19:02:20Z\",\"lastUpdatedDateTime\":\"2020-04-29T19:02:20Z\"}}", - "Date" : "Wed, 29 Apr 2020 19:02:26 GMT", - "Content-Type" : "application/json; charset=utf-8" - }, - "Exception" : null - }, { - "Method" : "GET", - "Uri" : "https://javaformrecognizertestresource.cognitiveservices.azure.com/formrecognizer/v2.0-preview//custom/models/88c3a891-fd00-4f08-a25a-96ea767bd036?includeKeys=true", - "Headers" : { - "User-Agent" : "azsdk-java-azure-ai-formrecognizer/1.0.0-beta.1 (11.0.5; Windows 10 10.0)", - "x-ms-client-request-id" : "294d1689-98c6-4de4-9e8e-f730efea0d01" - }, - "Response" : { - "Transfer-Encoding" : "chunked", - "x-envoy-upstream-service-time" : "24", - "Strict-Transport-Security" : "max-age=31536000; includeSubDomains; preload", - "x-content-type-options" : "nosniff", - "apim-request-id" : "33bf2e96-fcb4-4f52-885c-feee3b1f4b06", - "retry-after" : "0", - "StatusCode" : "200", - "Body" : "{\"modelInfo\":{\"modelId\":\"88c3a891-fd00-4f08-a25a-96ea767bd036\",\"status\":\"ready\",\"createdDateTime\":\"2020-04-29T19:02:20Z\",\"lastUpdatedDateTime\":\"2020-04-29T19:02:29Z\"},\"keys\":{\"clusters\":{\"0\":[\"Address:\",\"Charges\",\"Invoice Date\",\"Invoice Due Date\",\"Invoice For:\",\"Invoice Number\",\"Microsoft\",\"Page\",\"VAT ID\"]}},\"trainResult\":{\"trainingDocuments\":[{\"documentName\":\"Invoice_1.pdf\",\"pages\":1,\"errors\":[],\"status\":\"succeeded\"},{\"documentName\":\"Invoice_2.pdf\",\"pages\":1,\"errors\":[],\"status\":\"succeeded\"},{\"documentName\":\"Invoice_3.pdf\",\"pages\":1,\"errors\":[],\"status\":\"succeeded\"},{\"documentName\":\"Invoice_4.pdf\",\"pages\":1,\"errors\":[],\"status\":\"succeeded\"},{\"documentName\":\"Invoice_5.pdf\",\"pages\":1,\"errors\":[],\"status\":\"succeeded\"}],\"errors\":[]}}", - "Date" : "Wed, 29 Apr 2020 19:02:31 GMT", - "Content-Type" : "application/json; charset=utf-8" - }, - "Exception" : null - }, { - "Method" : "GET", - "Uri" : "https://javaformrecognizertestresource.cognitiveservices.azure.com/formrecognizer/v2.0-preview//custom/models/88c3a891-fd00-4f08-a25a-96ea767bd036?includeKeys=true", - "Headers" : { - "User-Agent" : "azsdk-java-azure-ai-formrecognizer/1.0.0-beta.1 (11.0.5; Windows 10 10.0)", - "x-ms-client-request-id" : "4f300546-d079-4e51-b3ea-d6694533086a" - }, - "Response" : { - "Transfer-Encoding" : "chunked", - "x-envoy-upstream-service-time" : "15", - "Strict-Transport-Security" : "max-age=31536000; includeSubDomains; preload", - "x-content-type-options" : "nosniff", - "apim-request-id" : "7e7de5a8-eb95-499d-935e-dc332900d055", - "retry-after" : "0", - "StatusCode" : "200", - "Body" : "{\"modelInfo\":{\"modelId\":\"88c3a891-fd00-4f08-a25a-96ea767bd036\",\"status\":\"ready\",\"createdDateTime\":\"2020-04-29T19:02:20Z\",\"lastUpdatedDateTime\":\"2020-04-29T19:02:29Z\"},\"keys\":{\"clusters\":{\"0\":[\"Address:\",\"Charges\",\"Invoice Date\",\"Invoice Due Date\",\"Invoice For:\",\"Invoice Number\",\"Microsoft\",\"Page\",\"VAT ID\"]}},\"trainResult\":{\"trainingDocuments\":[{\"documentName\":\"Invoice_1.pdf\",\"pages\":1,\"errors\":[],\"status\":\"succeeded\"},{\"documentName\":\"Invoice_2.pdf\",\"pages\":1,\"errors\":[],\"status\":\"succeeded\"},{\"documentName\":\"Invoice_3.pdf\",\"pages\":1,\"errors\":[],\"status\":\"succeeded\"},{\"documentName\":\"Invoice_4.pdf\",\"pages\":1,\"errors\":[],\"status\":\"succeeded\"},{\"documentName\":\"Invoice_5.pdf\",\"pages\":1,\"errors\":[],\"status\":\"succeeded\"}],\"errors\":[]}}", - "Date" : "Wed, 29 Apr 2020 19:02:31 GMT", - "Content-Type" : "application/json; charset=utf-8" - }, - "Exception" : null - }, { - "Method" : "POST", - "Uri" : "https://javaformrecognizertestresource.cognitiveservices.azure.com/formrecognizer/v2.0-preview//custom/models/88c3a891-fd00-4f08-a25a-96ea767bd036/analyze?includeTextDetails=true", - "Headers" : { - "User-Agent" : "azsdk-java-azure-ai-formrecognizer/1.0.0-beta.1 (11.0.5; Windows 10 10.0)", - "x-ms-client-request-id" : "b8dabcad-80f0-4f27-8503-260df4c57439", - "Content-Type" : "application/pdf" - }, - "Response" : { - "x-envoy-upstream-service-time" : "51", - "Strict-Transport-Security" : "max-age=31536000; includeSubDomains; preload", - "x-content-type-options" : "nosniff", - "apim-request-id" : "dc19b1da-16fb-4ff5-9023-30576df37717", - "retry-after" : "0", - "Content-Length" : "0", - "StatusCode" : "202", - "Operation-Location" : "https://javaformrecognizertestresource.cognitiveservices.azure.com/formrecognizer/v2.0-preview/custom/models/88c3a891-fd00-4f08-a25a-96ea767bd036/analyzeresults/596b3e4c-23f3-44c1-a4e5-56f5c21e59b4", - "Date" : "Wed, 29 Apr 2020 19:02:33 GMT" - }, - "Exception" : null - }, { - "Method" : "GET", - "Uri" : "https://javaformrecognizertestresource.cognitiveservices.azure.com/formrecognizer/v2.0-preview//custom/models/88c3a891-fd00-4f08-a25a-96ea767bd036/analyzeResults/596b3e4c-23f3-44c1-a4e5-56f5c21e59b4", - "Headers" : { - "User-Agent" : "azsdk-java-azure-ai-formrecognizer/1.0.0-beta.1 (11.0.5; Windows 10 10.0)", - "x-ms-client-request-id" : "8e69536a-8354-4721-9dd0-07d93345d6a5" - }, - "Response" : { - "Transfer-Encoding" : "chunked", - "x-envoy-upstream-service-time" : "16", - "Strict-Transport-Security" : "max-age=31536000; includeSubDomains; preload", - "x-content-type-options" : "nosniff", - "apim-request-id" : "ad8f765c-cec2-4c37-a809-5de9551099df", - "retry-after" : "0", - "StatusCode" : "200", - "Body" : "{\"status\":\"succeeded\",\"createdDateTime\":\"2020-04-29T19:02:33Z\",\"lastUpdatedDateTime\":\"2020-04-29T19:02:35Z\",\"analyzeResult\":{\"version\":\"2.0.0\",\"readResults\":[{\"page\":1,\"angle\":0,\"width\":8.5,\"height\":11.0,\"unit\":\"inch\",\"lines\":[{\"text\":\"Contoso Suites\",\"boundingBox\":[0.5278,1.0528,2.6111,1.0528,2.6111,1.4667,0.5278,1.4667],\"words\":[{\"text\":\"Contoso\",\"boundingBox\":[0.5278,1.0528,1.6667,1.0528,1.6667,1.4667,0.5278,1.4667]},{\"text\":\"Suites\",\"boundingBox\":[1.7486,1.0528,2.6111,1.0528,2.6111,1.4667,1.7486,1.4667]}]},{\"text\":\"Address:\",\"boundingBox\":[0.7958,1.5139,1.3958,1.5139,1.3958,1.6431,0.7958,1.6431],\"words\":[{\"text\":\"Address:\",\"boundingBox\":[0.7958,1.5139,1.3958,1.5139,1.3958,1.6431,0.7958,1.6431]}]},{\"text\":\"Invoice For:\",\"boundingBox\":[4.3903,1.5125,5.1139,1.5125,5.1139,1.6431,4.3903,1.6431],\"words\":[{\"text\":\"Invoice\",\"boundingBox\":[4.3903,1.5125,4.8292,1.5125,4.8292,1.6431,4.3903,1.6431]},{\"text\":\"For:\",\"boundingBox\":[4.8681,1.5125,5.1139,1.5125,5.1139,1.6431,4.8681,1.6431]}]},{\"text\":\"First Up Consultants\",\"boundingBox\":[5.1944,1.4681,6.5556,1.4681,6.5556,1.6653,5.1944,1.6653],\"words\":[{\"text\":\"First\",\"boundingBox\":[5.1944,1.4681,5.4944,1.4681,5.4944,1.6653,5.1944,1.6653]},{\"text\":\"Up\",\"boundingBox\":[5.5333,1.4681,5.7167,1.4681,5.7167,1.6653,5.5333,1.6653]},{\"text\":\"Consultants\",\"boundingBox\":[5.7556,1.4681,6.5556,1.4681,6.5556,1.6653,5.7556,1.6653]}]},{\"text\":\"14564 Main St.\",\"boundingBox\":[0.7958,1.6625,1.7264,1.6625,1.7264,1.8514,0.7958,1.8514],\"words\":[{\"text\":\"14564\",\"boundingBox\":[0.7958,1.6625,1.1806,1.6625,1.1806,1.8514,0.7958,1.8514]},{\"text\":\"Main\",\"boundingBox\":[1.2181,1.6625,1.5181,1.6625,1.5181,1.8514,1.2181,1.8514]},{\"text\":\"St.\",\"boundingBox\":[1.5569,1.6625,1.7264,1.6625,1.7264,1.8514,1.5569,1.8514]}]},{\"text\":\"1234 King St\",\"boundingBox\":[5.1931,1.6694,6.0236,1.6694,6.0236,1.8681,5.1931,1.8681],\"words\":[{\"text\":\"1234\",\"boundingBox\":[5.1931,1.6694,5.5014,1.6694,5.5014,1.8681,5.1931,1.8681]},{\"text\":\"King\",\"boundingBox\":[5.5389,1.6694,5.8472,1.6694,5.8472,1.8681,5.5389,1.8681]},{\"text\":\"St\",\"boundingBox\":[5.8847,1.6694,6.0236,1.6694,6.0236,1.8681,5.8847,1.8681]}]},{\"text\":\"Saratoga, CA 94588\",\"boundingBox\":[0.7958,1.8632,2.0458,1.8632,2.0458,2.0395,0.7958,2.0395],\"words\":[{\"text\":\"Saratoga,\",\"boundingBox\":[0.7958,1.8542,1.3958,1.8542,1.3958,2.0431,0.7958,2.0431]},{\"text\":\"CA\",\"boundingBox\":[1.4319,1.8972,1.6236,1.8972,1.6236,2.0431,1.4319,2.0431]},{\"text\":\"94588\",\"boundingBox\":[1.6625,1.8542,2.0458,1.8542,2.0458,2.0264,1.6625,2.0264]}]},{\"text\":\"Redmond, WA 97624\",\"boundingBox\":[5.1917,1.8597,6.5597,1.8597,6.5597,2.0569,5.1917,2.0569],\"words\":[{\"text\":\"Redmond,\",\"boundingBox\":[5.1917,1.8597,5.8681,1.8597,5.8681,2.0569,5.1917,2.0569]},{\"text\":\"WA\",\"boundingBox\":[5.9069,1.8597,6.1375,1.8597,6.1375,2.0569,5.9069,2.0569]},{\"text\":\"97624\",\"boundingBox\":[6.175,1.8597,6.5597,1.8597,6.5597,2.0569,6.175,2.0569]}]},{\"text\":\"Invoice Number\",\"boundingBox\":[0.5347,2.8722,1.575,2.8722,1.575,3.0028,0.5347,3.0028],\"words\":[{\"text\":\"Invoice\",\"boundingBox\":[0.5347,2.8722,1.0139,2.8722,1.0139,3.0028,0.5347,3.0028]},{\"text\":\"Number\",\"boundingBox\":[1.0514,2.8722,1.575,2.8722,1.575,3.0028,1.0514,3.0028]}]},{\"text\":\"Invoice Date\",\"boundingBox\":[1.9403,2.8722,2.7569,2.8722,2.7569,3.0028,1.9403,3.0028],\"words\":[{\"text\":\"Invoice\",\"boundingBox\":[1.9403,2.8722,2.4194,2.8722,2.4194,3.0028,1.9403,3.0028]},{\"text\":\"Date\",\"boundingBox\":[2.4569,2.8722,2.7569,2.8722,2.7569,3.0028,2.4569,3.0028]}]},{\"text\":\"Invoice Due Date\",\"boundingBox\":[3.3403,2.8722,4.4583,2.8722,4.4583,3.0028,3.3403,3.0028],\"words\":[{\"text\":\"Invoice\",\"boundingBox\":[3.3403,2.8722,3.8194,2.8722,3.8194,3.0028,3.3403,3.0028]},{\"text\":\"Due\",\"boundingBox\":[3.8569,2.8722,4.1194,2.8722,4.1194,3.0028,3.8569,3.0028]},{\"text\":\"Date\",\"boundingBox\":[4.1569,2.8722,4.4583,2.8722,4.4583,3.0028,4.1569,3.0028]}]},{\"text\":\"Charges\",\"boundingBox\":[4.7403,2.8722,5.2944,2.8722,5.2944,3.0028,4.7403,3.0028],\"words\":[{\"text\":\"Charges\",\"boundingBox\":[4.7403,2.8722,5.2944,2.8722,5.2944,3.0028,4.7403,3.0028]}]},{\"text\":\"VAT ID\",\"boundingBox\":[6.1403,2.8278,6.5944,2.8278,6.5944,3.025,6.1403,3.025],\"words\":[{\"text\":\"VAT\",\"boundingBox\":[6.1403,2.8278,6.4181,2.8278,6.4181,3.025,6.1403,3.025]},{\"text\":\"ID\",\"boundingBox\":[6.4556,2.8278,6.5944,2.8278,6.5944,3.025,6.4556,3.025]}]},{\"text\":\"7689302\",\"boundingBox\":[0.5347,3.3681,1.0736,3.3681,1.0736,3.5569,0.5347,3.5569],\"words\":[{\"text\":\"7689302\",\"boundingBox\":[0.5347,3.3681,1.0736,3.3681,1.0736,3.5569,0.5347,3.5569]}]},{\"text\":\"3/09/2015\",\"boundingBox\":[1.9403,3.3853,2.5556,3.3853,2.5556,3.5508,1.9403,3.5508],\"words\":[{\"text\":\"3/09/2015\",\"boundingBox\":[1.9403,3.3681,2.5556,3.3681,2.5556,3.5569,1.9403,3.5569]}]},{\"text\":\"6/29/2016\",\"boundingBox\":[3.3403,3.3776,3.9556,3.3776,3.9556,3.5535,3.3403,3.5535],\"words\":[{\"text\":\"6/29/2016\",\"boundingBox\":[3.3403,3.3681,3.9556,3.3681,3.9556,3.5569,3.3403,3.5569]}]},{\"text\":\"$22,123.24\",\"boundingBox\":[5.2861,3.3907,5.9792,3.3907,5.9792,3.5578,5.2861,3.5578],\"words\":[{\"text\":\"$22,123.24\",\"boundingBox\":[5.2861,3.4181,5.9792,3.4181,5.9792,3.5472,5.2861,3.5472]}]},{\"text\":\"QR\",\"boundingBox\":[6.2181,3.3681,6.425,3.3681,6.425,3.5569,6.2181,3.5569],\"words\":[{\"text\":\"QR\",\"boundingBox\":[6.2181,3.3681,6.425,3.3681,6.425,3.5569,6.2181,3.5569]}]},{\"text\":\"Page\",\"boundingBox\":[6.2306,9.6653,6.5542,9.6653,6.5542,9.7958,6.2306,9.7958],\"words\":[{\"text\":\"Page\",\"boundingBox\":[6.2306,9.6653,6.5542,9.6653,6.5542,9.7958,6.2306,9.7958]}]},{\"text\":\"1 of\",\"boundingBox\":[6.8319,9.6653,7.0611,9.6653,7.0611,9.7958,6.8319,9.7958],\"words\":[{\"text\":\"1\",\"boundingBox\":[6.8319,9.6653,6.9083,9.6653,6.9083,9.7958,6.8319,9.7958]},{\"text\":\"of\",\"boundingBox\":[6.9458,9.6653,7.0611,9.6653,7.0611,9.7958,6.9458,9.7958]}]},{\"text\":\"1\",\"boundingBox\":[7.3986,9.6653,7.475,9.6653,7.475,9.7958,7.3986,9.7958],\"words\":[{\"text\":\"1\",\"boundingBox\":[7.3986,9.6653,7.475,9.6653,7.475,9.7958,7.3986,9.7958]}]}]}],\"pageResults\":[{\"page\":1,\"keyValuePairs\":[{\"key\":{\"text\":\"Address:\",\"boundingBox\":[0.7958,1.5139,1.3958,1.5139,1.3958,1.6431,0.7958,1.6431],\"elements\":[\"#/readResults/0/lines/1/words/0\"]},\"value\":{\"text\":\"14564 Main St. Saratoga, CA 94588\",\"boundingBox\":[0.7958,1.6625,2.0458,1.6625,2.0458,2.0395,0.7958,2.0395],\"elements\":[\"#/readResults/0/lines/4/words/0\",\"#/readResults/0/lines/4/words/1\",\"#/readResults/0/lines/4/words/2\",\"#/readResults/0/lines/6/words/0\",\"#/readResults/0/lines/6/words/1\",\"#/readResults/0/lines/6/words/2\"]},\"confidence\":0.86},{\"key\":{\"text\":\"Invoice For:\",\"boundingBox\":[4.3903,1.5125,5.1139,1.5125,5.1139,1.6431,4.3903,1.6431],\"elements\":[\"#/readResults/0/lines/2/words/0\",\"#/readResults/0/lines/2/words/1\"]},\"value\":{\"text\":\"First Up Consultants 1234 King St Redmond, WA 97624\",\"boundingBox\":[5.1917,1.4681,6.5597,1.4681,6.5597,2.0569,5.1917,2.0569],\"elements\":[\"#/readResults/0/lines/3/words/0\",\"#/readResults/0/lines/3/words/1\",\"#/readResults/0/lines/3/words/2\",\"#/readResults/0/lines/5/words/0\",\"#/readResults/0/lines/5/words/1\",\"#/readResults/0/lines/5/words/2\",\"#/readResults/0/lines/7/words/0\",\"#/readResults/0/lines/7/words/1\",\"#/readResults/0/lines/7/words/2\"]},\"confidence\":1.0},{\"key\":{\"text\":\"Invoice Number\",\"boundingBox\":[0.5347,2.8722,1.575,2.8722,1.575,3.0028,0.5347,3.0028],\"elements\":[\"#/readResults/0/lines/8/words/0\",\"#/readResults/0/lines/8/words/1\"]},\"value\":{\"text\":\"7689302\",\"boundingBox\":[0.5347,3.3681,1.0736,3.3681,1.0736,3.5569,0.5347,3.5569],\"elements\":[\"#/readResults/0/lines/13/words/0\"]},\"confidence\":1.0},{\"key\":{\"text\":\"Invoice Date\",\"boundingBox\":[1.9403,2.8722,2.7569,2.8722,2.7569,3.0028,1.9403,3.0028],\"elements\":[\"#/readResults/0/lines/9/words/0\",\"#/readResults/0/lines/9/words/1\"]},\"value\":{\"text\":\"3/09/2015\",\"boundingBox\":[1.9403,3.3853,2.5556,3.3853,2.5556,3.5508,1.9403,3.5508],\"elements\":[\"#/readResults/0/lines/14/words/0\"]},\"confidence\":1.0},{\"key\":{\"text\":\"Invoice Due Date\",\"boundingBox\":[3.3403,2.8722,4.4583,2.8722,4.4583,3.0028,3.3403,3.0028],\"elements\":[\"#/readResults/0/lines/10/words/0\",\"#/readResults/0/lines/10/words/1\",\"#/readResults/0/lines/10/words/2\"]},\"value\":{\"text\":\"6/29/2016\",\"boundingBox\":[3.3403,3.3776,3.9556,3.3776,3.9556,3.5535,3.3403,3.5535],\"elements\":[\"#/readResults/0/lines/15/words/0\"]},\"confidence\":1.0},{\"key\":{\"text\":\"Charges\",\"boundingBox\":[4.7403,2.8722,5.2944,2.8722,5.2944,3.0028,4.7403,3.0028],\"elements\":[\"#/readResults/0/lines/11/words/0\"]},\"value\":{\"text\":\"$22,123.24\",\"boundingBox\":[5.2861,3.3907,5.9792,3.3907,5.9792,3.5578,5.2861,3.5578],\"elements\":[\"#/readResults/0/lines/16/words/0\"]},\"confidence\":1.0},{\"key\":{\"text\":\"VAT ID\",\"boundingBox\":[6.1403,2.8278,6.5944,2.8278,6.5944,3.025,6.1403,3.025],\"elements\":[\"#/readResults/0/lines/12/words/0\",\"#/readResults/0/lines/12/words/1\"]},\"value\":{\"text\":\"QR\",\"boundingBox\":[6.2181,3.3681,6.425,3.3681,6.425,3.5569,6.2181,3.5569],\"elements\":[\"#/readResults/0/lines/17/words/0\"]},\"confidence\":1.0},{\"key\":{\"text\":\"Page\",\"boundingBox\":[6.2306,9.6653,6.5542,9.6653,6.5542,9.7958,6.2306,9.7958],\"elements\":[\"#/readResults/0/lines/18/words/0\"]},\"value\":{\"text\":\"1 of\",\"boundingBox\":[6.8319,9.6653,7.0611,9.6653,7.0611,9.7958,6.8319,9.7958],\"elements\":[\"#/readResults/0/lines/19/words/0\",\"#/readResults/0/lines/19/words/1\"]},\"confidence\":0.86},{\"key\":{\"text\":\"__Tokens__1\",\"boundingBox\":null,\"elements\":null},\"value\":{\"text\":\"Contoso Suites\",\"boundingBox\":[0.5278,1.0528,2.6111,1.0528,2.6111,1.4667,0.5278,1.4667],\"elements\":[\"#/readResults/0/lines/0/words/0\",\"#/readResults/0/lines/0/words/1\"]},\"confidence\":1.0},{\"key\":{\"text\":\"__Tokens__2\",\"boundingBox\":null,\"elements\":null},\"value\":{\"text\":\"1\",\"boundingBox\":[7.3986,9.6653,7.475,9.6653,7.475,9.7958,7.3986,9.7958],\"elements\":[\"#/readResults/0/lines/20/words/0\"]},\"confidence\":1.0}],\"tables\":[{\"rows\":2,\"columns\":5,\"cells\":[{\"text\":\"Invoice Number\",\"rowIndex\":0,\"columnIndex\":0,\"boundingBox\":[0.5347,2.8722,1.575,2.8722,1.575,3.0028,0.5347,3.0028],\"confidence\":1.0,\"rowSpan\":1,\"columnSpan\":1,\"elements\":[\"#/readResults/0/lines/8/words/0\",\"#/readResults/0/lines/8/words/1\"],\"isHeader\":true,\"isFooter\":false},{\"text\":\"Invoice Date\",\"rowIndex\":0,\"columnIndex\":1,\"boundingBox\":[1.9403,2.8722,2.7569,2.8722,2.7569,3.0028,1.9403,3.0028],\"confidence\":1.0,\"rowSpan\":1,\"columnSpan\":1,\"elements\":[\"#/readResults/0/lines/9/words/0\",\"#/readResults/0/lines/9/words/1\"],\"isHeader\":true,\"isFooter\":false},{\"text\":\"Invoice Due Date\",\"rowIndex\":0,\"columnIndex\":2,\"boundingBox\":[3.3403,2.8722,4.4583,2.8722,4.4583,3.0028,3.3403,3.0028],\"confidence\":1.0,\"rowSpan\":1,\"columnSpan\":1,\"elements\":[\"#/readResults/0/lines/10/words/0\",\"#/readResults/0/lines/10/words/1\",\"#/readResults/0/lines/10/words/2\"],\"isHeader\":true,\"isFooter\":false},{\"text\":\"Charges\",\"rowIndex\":0,\"columnIndex\":3,\"boundingBox\":[4.7403,2.8722,5.2944,2.8722,5.2944,3.0028,4.7403,3.0028],\"confidence\":1.0,\"rowSpan\":1,\"columnSpan\":1,\"elements\":[\"#/readResults/0/lines/11/words/0\"],\"isHeader\":true,\"isFooter\":false},{\"text\":\"VAT ID\",\"rowIndex\":0,\"columnIndex\":4,\"boundingBox\":[6.1403,2.8278,6.5944,2.8278,6.5944,3.025,6.1403,3.025],\"confidence\":1.0,\"rowSpan\":1,\"columnSpan\":1,\"elements\":[\"#/readResults/0/lines/12/words/0\",\"#/readResults/0/lines/12/words/1\"],\"isHeader\":true,\"isFooter\":false},{\"text\":\"7689302\",\"rowIndex\":1,\"columnIndex\":0,\"boundingBox\":[0.5347,3.3681,1.0736,3.3681,1.0736,3.5569,0.5347,3.5569],\"confidence\":1.0,\"rowSpan\":1,\"columnSpan\":1,\"elements\":[\"#/readResults/0/lines/13/words/0\"],\"isHeader\":false,\"isFooter\":false},{\"text\":\"3/09/2015\",\"rowIndex\":1,\"columnIndex\":1,\"boundingBox\":[1.9403,3.3853,2.5556,3.3853,2.5556,3.5508,1.9403,3.5508],\"confidence\":1.0,\"rowSpan\":1,\"columnSpan\":1,\"elements\":[\"#/readResults/0/lines/14/words/0\"],\"isHeader\":false,\"isFooter\":false},{\"text\":\"6/29/2016\",\"rowIndex\":1,\"columnIndex\":2,\"boundingBox\":[3.3403,3.3776,3.9556,3.3776,3.9556,3.5535,3.3403,3.5535],\"confidence\":1.0,\"rowSpan\":1,\"columnSpan\":1,\"elements\":[\"#/readResults/0/lines/15/words/0\"],\"isHeader\":false,\"isFooter\":false},{\"text\":\"$22,123.24\",\"rowIndex\":1,\"columnIndex\":3,\"boundingBox\":[5.2861,3.3907,5.9792,3.3907,5.9792,3.5578,5.2861,3.5578],\"confidence\":1.0,\"rowSpan\":1,\"columnSpan\":1,\"elements\":[\"#/readResults/0/lines/16/words/0\"],\"isHeader\":false,\"isFooter\":false},{\"text\":\"QR\",\"rowIndex\":1,\"columnIndex\":4,\"boundingBox\":[6.2181,3.3681,6.425,3.3681,6.425,3.5569,6.2181,3.5569],\"confidence\":1.0,\"rowSpan\":1,\"columnSpan\":1,\"elements\":[\"#/readResults/0/lines/17/words/0\"],\"isHeader\":false,\"isFooter\":false}]}],\"clusterId\":0}],\"documentResults\":[],\"errors\":[]}}", - "Date" : "Wed, 29 Apr 2020 19:02:39 GMT", - "Content-Type" : "application/json; charset=utf-8" - }, - "Exception" : null - }, { - "Method" : "GET", - "Uri" : "https://javaformrecognizertestresource.cognitiveservices.azure.com/formrecognizer/v2.0-preview//custom/models/88c3a891-fd00-4f08-a25a-96ea767bd036/analyzeResults/596b3e4c-23f3-44c1-a4e5-56f5c21e59b4", - "Headers" : { - "User-Agent" : "azsdk-java-azure-ai-formrecognizer/1.0.0-beta.1 (11.0.5; Windows 10 10.0)", - "x-ms-client-request-id" : "35c15ce2-d2c3-4169-b051-e1f66e0a6e13" - }, - "Response" : { - "Transfer-Encoding" : "chunked", - "x-envoy-upstream-service-time" : "56", - "Strict-Transport-Security" : "max-age=31536000; includeSubDomains; preload", - "x-content-type-options" : "nosniff", - "apim-request-id" : "dc3b53d6-73c8-439f-b7ec-af2ef040cc07", - "retry-after" : "0", - "StatusCode" : "200", - "Body" : "{\"status\":\"succeeded\",\"createdDateTime\":\"2020-04-29T19:02:33Z\",\"lastUpdatedDateTime\":\"2020-04-29T19:02:35Z\",\"analyzeResult\":{\"version\":\"2.0.0\",\"readResults\":[{\"page\":1,\"angle\":0,\"width\":8.5,\"height\":11.0,\"unit\":\"inch\",\"lines\":[{\"text\":\"Contoso Suites\",\"boundingBox\":[0.5278,1.0528,2.6111,1.0528,2.6111,1.4667,0.5278,1.4667],\"words\":[{\"text\":\"Contoso\",\"boundingBox\":[0.5278,1.0528,1.6667,1.0528,1.6667,1.4667,0.5278,1.4667]},{\"text\":\"Suites\",\"boundingBox\":[1.7486,1.0528,2.6111,1.0528,2.6111,1.4667,1.7486,1.4667]}]},{\"text\":\"Address:\",\"boundingBox\":[0.7958,1.5139,1.3958,1.5139,1.3958,1.6431,0.7958,1.6431],\"words\":[{\"text\":\"Address:\",\"boundingBox\":[0.7958,1.5139,1.3958,1.5139,1.3958,1.6431,0.7958,1.6431]}]},{\"text\":\"Invoice For:\",\"boundingBox\":[4.3903,1.5125,5.1139,1.5125,5.1139,1.6431,4.3903,1.6431],\"words\":[{\"text\":\"Invoice\",\"boundingBox\":[4.3903,1.5125,4.8292,1.5125,4.8292,1.6431,4.3903,1.6431]},{\"text\":\"For:\",\"boundingBox\":[4.8681,1.5125,5.1139,1.5125,5.1139,1.6431,4.8681,1.6431]}]},{\"text\":\"First Up Consultants\",\"boundingBox\":[5.1944,1.4681,6.5556,1.4681,6.5556,1.6653,5.1944,1.6653],\"words\":[{\"text\":\"First\",\"boundingBox\":[5.1944,1.4681,5.4944,1.4681,5.4944,1.6653,5.1944,1.6653]},{\"text\":\"Up\",\"boundingBox\":[5.5333,1.4681,5.7167,1.4681,5.7167,1.6653,5.5333,1.6653]},{\"text\":\"Consultants\",\"boundingBox\":[5.7556,1.4681,6.5556,1.4681,6.5556,1.6653,5.7556,1.6653]}]},{\"text\":\"14564 Main St.\",\"boundingBox\":[0.7958,1.6625,1.7264,1.6625,1.7264,1.8514,0.7958,1.8514],\"words\":[{\"text\":\"14564\",\"boundingBox\":[0.7958,1.6625,1.1806,1.6625,1.1806,1.8514,0.7958,1.8514]},{\"text\":\"Main\",\"boundingBox\":[1.2181,1.6625,1.5181,1.6625,1.5181,1.8514,1.2181,1.8514]},{\"text\":\"St.\",\"boundingBox\":[1.5569,1.6625,1.7264,1.6625,1.7264,1.8514,1.5569,1.8514]}]},{\"text\":\"1234 King St\",\"boundingBox\":[5.1931,1.6694,6.0236,1.6694,6.0236,1.8681,5.1931,1.8681],\"words\":[{\"text\":\"1234\",\"boundingBox\":[5.1931,1.6694,5.5014,1.6694,5.5014,1.8681,5.1931,1.8681]},{\"text\":\"King\",\"boundingBox\":[5.5389,1.6694,5.8472,1.6694,5.8472,1.8681,5.5389,1.8681]},{\"text\":\"St\",\"boundingBox\":[5.8847,1.6694,6.0236,1.6694,6.0236,1.8681,5.8847,1.8681]}]},{\"text\":\"Saratoga, CA 94588\",\"boundingBox\":[0.7958,1.8632,2.0458,1.8632,2.0458,2.0395,0.7958,2.0395],\"words\":[{\"text\":\"Saratoga,\",\"boundingBox\":[0.7958,1.8542,1.3958,1.8542,1.3958,2.0431,0.7958,2.0431]},{\"text\":\"CA\",\"boundingBox\":[1.4319,1.8972,1.6236,1.8972,1.6236,2.0431,1.4319,2.0431]},{\"text\":\"94588\",\"boundingBox\":[1.6625,1.8542,2.0458,1.8542,2.0458,2.0264,1.6625,2.0264]}]},{\"text\":\"Redmond, WA 97624\",\"boundingBox\":[5.1917,1.8597,6.5597,1.8597,6.5597,2.0569,5.1917,2.0569],\"words\":[{\"text\":\"Redmond,\",\"boundingBox\":[5.1917,1.8597,5.8681,1.8597,5.8681,2.0569,5.1917,2.0569]},{\"text\":\"WA\",\"boundingBox\":[5.9069,1.8597,6.1375,1.8597,6.1375,2.0569,5.9069,2.0569]},{\"text\":\"97624\",\"boundingBox\":[6.175,1.8597,6.5597,1.8597,6.5597,2.0569,6.175,2.0569]}]},{\"text\":\"Invoice Number\",\"boundingBox\":[0.5347,2.8722,1.575,2.8722,1.575,3.0028,0.5347,3.0028],\"words\":[{\"text\":\"Invoice\",\"boundingBox\":[0.5347,2.8722,1.0139,2.8722,1.0139,3.0028,0.5347,3.0028]},{\"text\":\"Number\",\"boundingBox\":[1.0514,2.8722,1.575,2.8722,1.575,3.0028,1.0514,3.0028]}]},{\"text\":\"Invoice Date\",\"boundingBox\":[1.9403,2.8722,2.7569,2.8722,2.7569,3.0028,1.9403,3.0028],\"words\":[{\"text\":\"Invoice\",\"boundingBox\":[1.9403,2.8722,2.4194,2.8722,2.4194,3.0028,1.9403,3.0028]},{\"text\":\"Date\",\"boundingBox\":[2.4569,2.8722,2.7569,2.8722,2.7569,3.0028,2.4569,3.0028]}]},{\"text\":\"Invoice Due Date\",\"boundingBox\":[3.3403,2.8722,4.4583,2.8722,4.4583,3.0028,3.3403,3.0028],\"words\":[{\"text\":\"Invoice\",\"boundingBox\":[3.3403,2.8722,3.8194,2.8722,3.8194,3.0028,3.3403,3.0028]},{\"text\":\"Due\",\"boundingBox\":[3.8569,2.8722,4.1194,2.8722,4.1194,3.0028,3.8569,3.0028]},{\"text\":\"Date\",\"boundingBox\":[4.1569,2.8722,4.4583,2.8722,4.4583,3.0028,4.1569,3.0028]}]},{\"text\":\"Charges\",\"boundingBox\":[4.7403,2.8722,5.2944,2.8722,5.2944,3.0028,4.7403,3.0028],\"words\":[{\"text\":\"Charges\",\"boundingBox\":[4.7403,2.8722,5.2944,2.8722,5.2944,3.0028,4.7403,3.0028]}]},{\"text\":\"VAT ID\",\"boundingBox\":[6.1403,2.8278,6.5944,2.8278,6.5944,3.025,6.1403,3.025],\"words\":[{\"text\":\"VAT\",\"boundingBox\":[6.1403,2.8278,6.4181,2.8278,6.4181,3.025,6.1403,3.025]},{\"text\":\"ID\",\"boundingBox\":[6.4556,2.8278,6.5944,2.8278,6.5944,3.025,6.4556,3.025]}]},{\"text\":\"7689302\",\"boundingBox\":[0.5347,3.3681,1.0736,3.3681,1.0736,3.5569,0.5347,3.5569],\"words\":[{\"text\":\"7689302\",\"boundingBox\":[0.5347,3.3681,1.0736,3.3681,1.0736,3.5569,0.5347,3.5569]}]},{\"text\":\"3/09/2015\",\"boundingBox\":[1.9403,3.3853,2.5556,3.3853,2.5556,3.5508,1.9403,3.5508],\"words\":[{\"text\":\"3/09/2015\",\"boundingBox\":[1.9403,3.3681,2.5556,3.3681,2.5556,3.5569,1.9403,3.5569]}]},{\"text\":\"6/29/2016\",\"boundingBox\":[3.3403,3.3776,3.9556,3.3776,3.9556,3.5535,3.3403,3.5535],\"words\":[{\"text\":\"6/29/2016\",\"boundingBox\":[3.3403,3.3681,3.9556,3.3681,3.9556,3.5569,3.3403,3.5569]}]},{\"text\":\"$22,123.24\",\"boundingBox\":[5.2861,3.3907,5.9792,3.3907,5.9792,3.5578,5.2861,3.5578],\"words\":[{\"text\":\"$22,123.24\",\"boundingBox\":[5.2861,3.4181,5.9792,3.4181,5.9792,3.5472,5.2861,3.5472]}]},{\"text\":\"QR\",\"boundingBox\":[6.2181,3.3681,6.425,3.3681,6.425,3.5569,6.2181,3.5569],\"words\":[{\"text\":\"QR\",\"boundingBox\":[6.2181,3.3681,6.425,3.3681,6.425,3.5569,6.2181,3.5569]}]},{\"text\":\"Page\",\"boundingBox\":[6.2306,9.6653,6.5542,9.6653,6.5542,9.7958,6.2306,9.7958],\"words\":[{\"text\":\"Page\",\"boundingBox\":[6.2306,9.6653,6.5542,9.6653,6.5542,9.7958,6.2306,9.7958]}]},{\"text\":\"1 of\",\"boundingBox\":[6.8319,9.6653,7.0611,9.6653,7.0611,9.7958,6.8319,9.7958],\"words\":[{\"text\":\"1\",\"boundingBox\":[6.8319,9.6653,6.9083,9.6653,6.9083,9.7958,6.8319,9.7958]},{\"text\":\"of\",\"boundingBox\":[6.9458,9.6653,7.0611,9.6653,7.0611,9.7958,6.9458,9.7958]}]},{\"text\":\"1\",\"boundingBox\":[7.3986,9.6653,7.475,9.6653,7.475,9.7958,7.3986,9.7958],\"words\":[{\"text\":\"1\",\"boundingBox\":[7.3986,9.6653,7.475,9.6653,7.475,9.7958,7.3986,9.7958]}]}]}],\"pageResults\":[{\"page\":1,\"keyValuePairs\":[{\"key\":{\"text\":\"Address:\",\"boundingBox\":[0.7958,1.5139,1.3958,1.5139,1.3958,1.6431,0.7958,1.6431],\"elements\":[\"#/readResults/0/lines/1/words/0\"]},\"value\":{\"text\":\"14564 Main St. Saratoga, CA 94588\",\"boundingBox\":[0.7958,1.6625,2.0458,1.6625,2.0458,2.0395,0.7958,2.0395],\"elements\":[\"#/readResults/0/lines/4/words/0\",\"#/readResults/0/lines/4/words/1\",\"#/readResults/0/lines/4/words/2\",\"#/readResults/0/lines/6/words/0\",\"#/readResults/0/lines/6/words/1\",\"#/readResults/0/lines/6/words/2\"]},\"confidence\":0.86},{\"key\":{\"text\":\"Invoice For:\",\"boundingBox\":[4.3903,1.5125,5.1139,1.5125,5.1139,1.6431,4.3903,1.6431],\"elements\":[\"#/readResults/0/lines/2/words/0\",\"#/readResults/0/lines/2/words/1\"]},\"value\":{\"text\":\"First Up Consultants 1234 King St Redmond, WA 97624\",\"boundingBox\":[5.1917,1.4681,6.5597,1.4681,6.5597,2.0569,5.1917,2.0569],\"elements\":[\"#/readResults/0/lines/3/words/0\",\"#/readResults/0/lines/3/words/1\",\"#/readResults/0/lines/3/words/2\",\"#/readResults/0/lines/5/words/0\",\"#/readResults/0/lines/5/words/1\",\"#/readResults/0/lines/5/words/2\",\"#/readResults/0/lines/7/words/0\",\"#/readResults/0/lines/7/words/1\",\"#/readResults/0/lines/7/words/2\"]},\"confidence\":1.0},{\"key\":{\"text\":\"Invoice Number\",\"boundingBox\":[0.5347,2.8722,1.575,2.8722,1.575,3.0028,0.5347,3.0028],\"elements\":[\"#/readResults/0/lines/8/words/0\",\"#/readResults/0/lines/8/words/1\"]},\"value\":{\"text\":\"7689302\",\"boundingBox\":[0.5347,3.3681,1.0736,3.3681,1.0736,3.5569,0.5347,3.5569],\"elements\":[\"#/readResults/0/lines/13/words/0\"]},\"confidence\":1.0},{\"key\":{\"text\":\"Invoice Date\",\"boundingBox\":[1.9403,2.8722,2.7569,2.8722,2.7569,3.0028,1.9403,3.0028],\"elements\":[\"#/readResults/0/lines/9/words/0\",\"#/readResults/0/lines/9/words/1\"]},\"value\":{\"text\":\"3/09/2015\",\"boundingBox\":[1.9403,3.3853,2.5556,3.3853,2.5556,3.5508,1.9403,3.5508],\"elements\":[\"#/readResults/0/lines/14/words/0\"]},\"confidence\":1.0},{\"key\":{\"text\":\"Invoice Due Date\",\"boundingBox\":[3.3403,2.8722,4.4583,2.8722,4.4583,3.0028,3.3403,3.0028],\"elements\":[\"#/readResults/0/lines/10/words/0\",\"#/readResults/0/lines/10/words/1\",\"#/readResults/0/lines/10/words/2\"]},\"value\":{\"text\":\"6/29/2016\",\"boundingBox\":[3.3403,3.3776,3.9556,3.3776,3.9556,3.5535,3.3403,3.5535],\"elements\":[\"#/readResults/0/lines/15/words/0\"]},\"confidence\":1.0},{\"key\":{\"text\":\"Charges\",\"boundingBox\":[4.7403,2.8722,5.2944,2.8722,5.2944,3.0028,4.7403,3.0028],\"elements\":[\"#/readResults/0/lines/11/words/0\"]},\"value\":{\"text\":\"$22,123.24\",\"boundingBox\":[5.2861,3.3907,5.9792,3.3907,5.9792,3.5578,5.2861,3.5578],\"elements\":[\"#/readResults/0/lines/16/words/0\"]},\"confidence\":1.0},{\"key\":{\"text\":\"VAT ID\",\"boundingBox\":[6.1403,2.8278,6.5944,2.8278,6.5944,3.025,6.1403,3.025],\"elements\":[\"#/readResults/0/lines/12/words/0\",\"#/readResults/0/lines/12/words/1\"]},\"value\":{\"text\":\"QR\",\"boundingBox\":[6.2181,3.3681,6.425,3.3681,6.425,3.5569,6.2181,3.5569],\"elements\":[\"#/readResults/0/lines/17/words/0\"]},\"confidence\":1.0},{\"key\":{\"text\":\"Page\",\"boundingBox\":[6.2306,9.6653,6.5542,9.6653,6.5542,9.7958,6.2306,9.7958],\"elements\":[\"#/readResults/0/lines/18/words/0\"]},\"value\":{\"text\":\"1 of\",\"boundingBox\":[6.8319,9.6653,7.0611,9.6653,7.0611,9.7958,6.8319,9.7958],\"elements\":[\"#/readResults/0/lines/19/words/0\",\"#/readResults/0/lines/19/words/1\"]},\"confidence\":0.86},{\"key\":{\"text\":\"__Tokens__1\",\"boundingBox\":null,\"elements\":null},\"value\":{\"text\":\"Contoso Suites\",\"boundingBox\":[0.5278,1.0528,2.6111,1.0528,2.6111,1.4667,0.5278,1.4667],\"elements\":[\"#/readResults/0/lines/0/words/0\",\"#/readResults/0/lines/0/words/1\"]},\"confidence\":1.0},{\"key\":{\"text\":\"__Tokens__2\",\"boundingBox\":null,\"elements\":null},\"value\":{\"text\":\"1\",\"boundingBox\":[7.3986,9.6653,7.475,9.6653,7.475,9.7958,7.3986,9.7958],\"elements\":[\"#/readResults/0/lines/20/words/0\"]},\"confidence\":1.0}],\"tables\":[{\"rows\":2,\"columns\":5,\"cells\":[{\"text\":\"Invoice Number\",\"rowIndex\":0,\"columnIndex\":0,\"boundingBox\":[0.5347,2.8722,1.575,2.8722,1.575,3.0028,0.5347,3.0028],\"confidence\":1.0,\"rowSpan\":1,\"columnSpan\":1,\"elements\":[\"#/readResults/0/lines/8/words/0\",\"#/readResults/0/lines/8/words/1\"],\"isHeader\":true,\"isFooter\":false},{\"text\":\"Invoice Date\",\"rowIndex\":0,\"columnIndex\":1,\"boundingBox\":[1.9403,2.8722,2.7569,2.8722,2.7569,3.0028,1.9403,3.0028],\"confidence\":1.0,\"rowSpan\":1,\"columnSpan\":1,\"elements\":[\"#/readResults/0/lines/9/words/0\",\"#/readResults/0/lines/9/words/1\"],\"isHeader\":true,\"isFooter\":false},{\"text\":\"Invoice Due Date\",\"rowIndex\":0,\"columnIndex\":2,\"boundingBox\":[3.3403,2.8722,4.4583,2.8722,4.4583,3.0028,3.3403,3.0028],\"confidence\":1.0,\"rowSpan\":1,\"columnSpan\":1,\"elements\":[\"#/readResults/0/lines/10/words/0\",\"#/readResults/0/lines/10/words/1\",\"#/readResults/0/lines/10/words/2\"],\"isHeader\":true,\"isFooter\":false},{\"text\":\"Charges\",\"rowIndex\":0,\"columnIndex\":3,\"boundingBox\":[4.7403,2.8722,5.2944,2.8722,5.2944,3.0028,4.7403,3.0028],\"confidence\":1.0,\"rowSpan\":1,\"columnSpan\":1,\"elements\":[\"#/readResults/0/lines/11/words/0\"],\"isHeader\":true,\"isFooter\":false},{\"text\":\"VAT ID\",\"rowIndex\":0,\"columnIndex\":4,\"boundingBox\":[6.1403,2.8278,6.5944,2.8278,6.5944,3.025,6.1403,3.025],\"confidence\":1.0,\"rowSpan\":1,\"columnSpan\":1,\"elements\":[\"#/readResults/0/lines/12/words/0\",\"#/readResults/0/lines/12/words/1\"],\"isHeader\":true,\"isFooter\":false},{\"text\":\"7689302\",\"rowIndex\":1,\"columnIndex\":0,\"boundingBox\":[0.5347,3.3681,1.0736,3.3681,1.0736,3.5569,0.5347,3.5569],\"confidence\":1.0,\"rowSpan\":1,\"columnSpan\":1,\"elements\":[\"#/readResults/0/lines/13/words/0\"],\"isHeader\":false,\"isFooter\":false},{\"text\":\"3/09/2015\",\"rowIndex\":1,\"columnIndex\":1,\"boundingBox\":[1.9403,3.3853,2.5556,3.3853,2.5556,3.5508,1.9403,3.5508],\"confidence\":1.0,\"rowSpan\":1,\"columnSpan\":1,\"elements\":[\"#/readResults/0/lines/14/words/0\"],\"isHeader\":false,\"isFooter\":false},{\"text\":\"6/29/2016\",\"rowIndex\":1,\"columnIndex\":2,\"boundingBox\":[3.3403,3.3776,3.9556,3.3776,3.9556,3.5535,3.3403,3.5535],\"confidence\":1.0,\"rowSpan\":1,\"columnSpan\":1,\"elements\":[\"#/readResults/0/lines/15/words/0\"],\"isHeader\":false,\"isFooter\":false},{\"text\":\"$22,123.24\",\"rowIndex\":1,\"columnIndex\":3,\"boundingBox\":[5.2861,3.3907,5.9792,3.3907,5.9792,3.5578,5.2861,3.5578],\"confidence\":1.0,\"rowSpan\":1,\"columnSpan\":1,\"elements\":[\"#/readResults/0/lines/16/words/0\"],\"isHeader\":false,\"isFooter\":false},{\"text\":\"QR\",\"rowIndex\":1,\"columnIndex\":4,\"boundingBox\":[6.2181,3.3681,6.425,3.3681,6.425,3.5569,6.2181,3.5569],\"confidence\":1.0,\"rowSpan\":1,\"columnSpan\":1,\"elements\":[\"#/readResults/0/lines/17/words/0\"],\"isHeader\":false,\"isFooter\":false}]}],\"clusterId\":0}],\"documentResults\":[],\"errors\":[]}}", - "Date" : "Wed, 29 Apr 2020 19:02:40 GMT", - "Content-Type" : "application/json; charset=utf-8" - }, - "Exception" : null - } ], - "variables" : [ "testfr27587d7" ] -} \ No newline at end of file diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/src/test/resources/session-records/recognizeCustomFormUrlLabeledDataIncludeTextContent.json b/sdk/formrecognizer/azure-ai-formrecognizer/src/test/resources/session-records/recognizeCustomFormUrlLabeledDataIncludeFieldElements.json similarity index 100% rename from sdk/formrecognizer/azure-ai-formrecognizer/src/test/resources/session-records/recognizeCustomFormUrlLabeledDataIncludeTextContent.json rename to sdk/formrecognizer/azure-ai-formrecognizer/src/test/resources/session-records/recognizeCustomFormUrlLabeledDataIncludeFieldElements.json diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/src/test/resources/session-records/recognizeCustomFormUnlabeledDataIncludeTextContent.json b/sdk/formrecognizer/azure-ai-formrecognizer/src/test/resources/session-records/recognizeCustomFormUrlUnlabeledDataIncludeFieldElements.json similarity index 100% rename from sdk/formrecognizer/azure-ai-formrecognizer/src/test/resources/session-records/recognizeCustomFormUnlabeledDataIncludeTextContent.json rename to sdk/formrecognizer/azure-ai-formrecognizer/src/test/resources/session-records/recognizeCustomFormUrlUnlabeledDataIncludeFieldElements.json diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/src/test/resources/session-records/recognizeCustomFormUrlUnlabeledDataIncludeTextContent.json b/sdk/formrecognizer/azure-ai-formrecognizer/src/test/resources/session-records/recognizeCustomFormUrlUnlabeledDataIncludeTextContent.json deleted file mode 100644 index 6e3f8f857b508..0000000000000 --- a/sdk/formrecognizer/azure-ai-formrecognizer/src/test/resources/session-records/recognizeCustomFormUrlUnlabeledDataIncludeTextContent.json +++ /dev/null @@ -1,184 +0,0 @@ -{ - "networkCallRecords" : [ { - "Method" : "POST", - "Uri" : "https://REDACTED.cognitiveservices.azure.com/formrecognizer/v2.0-preview//custom/models", - "Headers" : { - "User-Agent" : "azsdk-java-azure-ai-formrecognizer/1.0.0-beta.4 (11.0.5; Windows 10 10.0)", - "x-ms-client-request-id" : "af5220de-9b7c-4994-8750-1d3500c0c057", - "Content-Type" : "application/json" - }, - "Response" : { - "x-envoy-upstream-service-time" : "346", - "Strict-Transport-Security" : "max-age=31536000; includeSubDomains; preload", - "x-content-type-options" : "nosniff", - "apim-request-id" : "d6e60d11-554d-4e5a-b25c-db29f0d5f77d", - "retry-after" : "0", - "Content-Length" : "0", - "StatusCode" : "201", - "Date" : "Tue, 23 Jun 2020 00:38:24 GMT", - "Location" : "https://savaity-formrecognizer.cognitiveservices.azure.com/formrecognizer/v2.0-preview/custom/models/0fe3e66e-3f33-47ed-be20-98f211248b31" - }, - "Exception" : null - }, { - "Method" : "GET", - "Uri" : "https://REDACTED.cognitiveservices.azure.com/formrecognizer/v2.0-preview//custom/models/0fe3e66e-3f33-47ed-be20-98f211248b31?includeKeys=true", - "Headers" : { - "User-Agent" : "azsdk-java-azure-ai-formrecognizer/1.0.0-beta.4 (11.0.5; Windows 10 10.0)", - "x-ms-client-request-id" : "8998c699-a34a-4f22-86c2-7e7333d20d84" - }, - "Response" : { - "Transfer-Encoding" : "chunked", - "x-envoy-upstream-service-time" : "168", - "Strict-Transport-Security" : "max-age=31536000; includeSubDomains; preload", - "x-content-type-options" : "nosniff", - "apim-request-id" : "1011eaa7-3bad-4eb6-92fe-73ae0a552f2d", - "retry-after" : "0", - "StatusCode" : "200", - "Body" : "{\"modelInfo\":{\"modelId\":\"0fe3e66e-3f33-47ed-be20-98f211248b31\",\"status\":\"creating\",\"createdDateTime\":\"2020-06-23T00:38:24Z\",\"lastUpdatedDateTime\":\"2020-06-23T00:38:24Z\"}}", - "Date" : "Tue, 23 Jun 2020 00:38:30 GMT", - "Content-Type" : "application/json; charset=utf-8" - }, - "Exception" : null - }, { - "Method" : "GET", - "Uri" : "https://REDACTED.cognitiveservices.azure.com/formrecognizer/v2.0-preview//custom/models/0fe3e66e-3f33-47ed-be20-98f211248b31?includeKeys=true", - "Headers" : { - "User-Agent" : "azsdk-java-azure-ai-formrecognizer/1.0.0-beta.4 (11.0.5; Windows 10 10.0)", - "x-ms-client-request-id" : "90a90a58-b391-4776-9cf9-acabc0aff132" - }, - "Response" : { - "Transfer-Encoding" : "chunked", - "x-envoy-upstream-service-time" : "254", - "Strict-Transport-Security" : "max-age=31536000; includeSubDomains; preload", - "x-content-type-options" : "nosniff", - "apim-request-id" : "a7cfc610-1dcc-432b-96a9-636f9afbd7a2", - "retry-after" : "0", - "StatusCode" : "200", - "Body" : "{\"modelInfo\":{\"modelId\":\"0fe3e66e-3f33-47ed-be20-98f211248b31\",\"status\":\"creating\",\"createdDateTime\":\"2020-06-23T00:38:24Z\",\"lastUpdatedDateTime\":\"2020-06-23T00:38:24Z\"}}", - "Date" : "Tue, 23 Jun 2020 00:38:35 GMT", - "Content-Type" : "application/json; charset=utf-8" - }, - "Exception" : null - }, { - "Method" : "GET", - "Uri" : "https://REDACTED.cognitiveservices.azure.com/formrecognizer/v2.0-preview//custom/models/0fe3e66e-3f33-47ed-be20-98f211248b31?includeKeys=true", - "Headers" : { - "User-Agent" : "azsdk-java-azure-ai-formrecognizer/1.0.0-beta.4 (11.0.5; Windows 10 10.0)", - "x-ms-client-request-id" : "d10472c8-b8a2-4b33-b3cd-1cb40aefd71f" - }, - "Response" : { - "Transfer-Encoding" : "chunked", - "x-envoy-upstream-service-time" : "126", - "Strict-Transport-Security" : "max-age=31536000; includeSubDomains; preload", - "x-content-type-options" : "nosniff", - "apim-request-id" : "9ebf754c-677e-41e7-b813-0e5798605bbb", - "retry-after" : "0", - "StatusCode" : "200", - "Body" : "{\"modelInfo\":{\"modelId\":\"0fe3e66e-3f33-47ed-be20-98f211248b31\",\"status\":\"ready\",\"createdDateTime\":\"2020-06-23T00:38:24Z\",\"lastUpdatedDateTime\":\"2020-06-23T00:38:37Z\"},\"keys\":{\"clusters\":{\"0\":[\"Additional Notes:\",\"Address:\",\"Company Name:\",\"Company Phone:\",\"Dated As:\",\"Details\",\"Email:\",\"Hero Limited\",\"Name:\",\"Phone:\",\"Purchase Order\",\"Purchase Order #:\",\"Quantity\",\"SUBTOTAL\",\"Seattle, WA 93849 Phone:\",\"Shipped From\",\"Shipped To\",\"TAX\",\"TOTAL\",\"Total\",\"Unit Price\",\"Vendor Name:\",\"Website:\"]}},\"trainResult\":{\"trainingDocuments\":[{\"documentName\":\"Form_1.jpg\",\"pages\":1,\"errors\":[],\"status\":\"succeeded\"},{\"documentName\":\"Form_2.jpg\",\"pages\":1,\"errors\":[],\"status\":\"succeeded\"},{\"documentName\":\"Form_3.jpg\",\"pages\":1,\"errors\":[],\"status\":\"succeeded\"},{\"documentName\":\"Form_4.jpg\",\"pages\":1,\"errors\":[],\"status\":\"succeeded\"},{\"documentName\":\"Form_5.jpg\",\"pages\":1,\"errors\":[],\"status\":\"succeeded\"}],\"errors\":[]}}", - "Date" : "Tue, 23 Jun 2020 00:38:40 GMT", - "Content-Type" : "application/json; charset=utf-8" - }, - "Exception" : null - }, { - "Method" : "GET", - "Uri" : "https://REDACTED.cognitiveservices.azure.com/formrecognizer/v2.0-preview//custom/models/0fe3e66e-3f33-47ed-be20-98f211248b31?includeKeys=true", - "Headers" : { - "User-Agent" : "azsdk-java-azure-ai-formrecognizer/1.0.0-beta.4 (11.0.5; Windows 10 10.0)", - "x-ms-client-request-id" : "38e78dbb-faff-40fc-8f13-dc51b00051a2" - }, - "Response" : { - "Transfer-Encoding" : "chunked", - "x-envoy-upstream-service-time" : "42", - "Strict-Transport-Security" : "max-age=31536000; includeSubDomains; preload", - "x-content-type-options" : "nosniff", - "apim-request-id" : "99a955b1-6d40-4401-ac59-06c1d41605ff", - "retry-after" : "0", - "StatusCode" : "200", - "Body" : "{\"modelInfo\":{\"modelId\":\"0fe3e66e-3f33-47ed-be20-98f211248b31\",\"status\":\"ready\",\"createdDateTime\":\"2020-06-23T00:38:24Z\",\"lastUpdatedDateTime\":\"2020-06-23T00:38:37Z\"},\"keys\":{\"clusters\":{\"0\":[\"Additional Notes:\",\"Address:\",\"Company Name:\",\"Company Phone:\",\"Dated As:\",\"Details\",\"Email:\",\"Hero Limited\",\"Name:\",\"Phone:\",\"Purchase Order\",\"Purchase Order #:\",\"Quantity\",\"SUBTOTAL\",\"Seattle, WA 93849 Phone:\",\"Shipped From\",\"Shipped To\",\"TAX\",\"TOTAL\",\"Total\",\"Unit Price\",\"Vendor Name:\",\"Website:\"]}},\"trainResult\":{\"trainingDocuments\":[{\"documentName\":\"Form_1.jpg\",\"pages\":1,\"errors\":[],\"status\":\"succeeded\"},{\"documentName\":\"Form_2.jpg\",\"pages\":1,\"errors\":[],\"status\":\"succeeded\"},{\"documentName\":\"Form_3.jpg\",\"pages\":1,\"errors\":[],\"status\":\"succeeded\"},{\"documentName\":\"Form_4.jpg\",\"pages\":1,\"errors\":[],\"status\":\"succeeded\"},{\"documentName\":\"Form_5.jpg\",\"pages\":1,\"errors\":[],\"status\":\"succeeded\"}],\"errors\":[]}}", - "Date" : "Tue, 23 Jun 2020 00:38:40 GMT", - "Content-Type" : "application/json; charset=utf-8" - }, - "Exception" : null - }, { - "Method" : "POST", - "Uri" : "https://REDACTED.cognitiveservices.azure.com/formrecognizer/v2.0-preview//custom/models/0fe3e66e-3f33-47ed-be20-98f211248b31/analyze?includeTextDetails=true", - "Headers" : { - "User-Agent" : "azsdk-java-azure-ai-formrecognizer/1.0.0-beta.4 (11.0.5; Windows 10 10.0)", - "x-ms-client-request-id" : "485284a0-fa17-491c-a806-267a0169d27c", - "Content-Type" : "application/json" - }, - "Response" : { - "x-envoy-upstream-service-time" : "214", - "Strict-Transport-Security" : "max-age=31536000; includeSubDomains; preload", - "x-content-type-options" : "nosniff", - "apim-request-id" : "7e00e65e-5f71-4a4d-8fff-6b6aef637bbb", - "retry-after" : "0", - "Content-Length" : "0", - "StatusCode" : "202", - "Operation-Location" : "https://savaity-formrecognizer.cognitiveservices.azure.com/formrecognizer/v2.0-preview/custom/models/0fe3e66e-3f33-47ed-be20-98f211248b31/analyzeresults/4aaf66b9-ce9c-43b8-bd48-0112c78908eb", - "Date" : "Tue, 23 Jun 2020 00:38:41 GMT" - }, - "Exception" : null - }, { - "Method" : "GET", - "Uri" : "https://REDACTED.cognitiveservices.azure.com/formrecognizer/v2.0-preview//custom/models/0fe3e66e-3f33-47ed-be20-98f211248b31/analyzeResults/4aaf66b9-ce9c-43b8-bd48-0112c78908eb", - "Headers" : { - "User-Agent" : "azsdk-java-azure-ai-formrecognizer/1.0.0-beta.4 (11.0.5; Windows 10 10.0)", - "x-ms-client-request-id" : "b4ef9320-b605-49fa-8832-621dc243db5b" - }, - "Response" : { - "x-envoy-upstream-service-time" : "106", - "Strict-Transport-Security" : "max-age=31536000; includeSubDomains; preload", - "x-content-type-options" : "nosniff", - "apim-request-id" : "399be130-5ce7-436d-aba6-c2c85b81bd0e", - "retry-after" : "0", - "Content-Length" : "134", - "StatusCode" : "200", - "Body" : "{\"status\": \"running\", \"createdDateTime\": \"2020-06-23T00:38:42Z\", \"lastUpdatedDateTime\": \"2020-06-23T00:38:43Z\", \"analyzeResult\": null}", - "Date" : "Tue, 23 Jun 2020 00:38:47 GMT", - "Content-Type" : "application/json; charset=utf-8" - }, - "Exception" : null - }, { - "Method" : "GET", - "Uri" : "https://REDACTED.cognitiveservices.azure.com/formrecognizer/v2.0-preview//custom/models/0fe3e66e-3f33-47ed-be20-98f211248b31/analyzeResults/4aaf66b9-ce9c-43b8-bd48-0112c78908eb", - "Headers" : { - "User-Agent" : "azsdk-java-azure-ai-formrecognizer/1.0.0-beta.4 (11.0.5; Windows 10 10.0)", - "x-ms-client-request-id" : "ccc21f9b-ac85-453f-a211-7da2b21a94f5" - }, - "Response" : { - "x-envoy-upstream-service-time" : "144", - "Strict-Transport-Security" : "max-age=31536000; includeSubDomains; preload", - "x-content-type-options" : "nosniff", - "apim-request-id" : "ed2133c8-8d28-45dc-910f-dfd3eeae0fc6", - "retry-after" : "0", - "Content-Length" : "36450", - "StatusCode" : "200", - "Body" : "{\"status\": \"succeeded\", \"createdDateTime\": \"2020-06-23T00:38:42Z\", \"lastUpdatedDateTime\": \"2020-06-23T00:38:48Z\", \"analyzeResult\": {\"version\": \"2.0.0\", \"readResults\": [{\"page\": 1, \"angle\": 0.16, \"width\": 1700, \"height\": 2200, \"unit\": \"pixel\", \"lines\": [{\"text\": \"Purchase Order\", \"boundingBox\": [141.0, 140.0, 348.0, 140.0, 348.0, 168.0, 141.0, 168.0], \"words\": [{\"text\": \"Purchase\", \"boundingBox\": [141.0, 140.0, 267.0, 140.0, 267.0, 168.0, 141.0, 168.0]}, {\"text\": \"Order\", \"boundingBox\": [273.0, 140.0, 348.0, 140.0, 348.0, 168.0, 273.0, 168.0]}]}, {\"text\": \"Hero Limited\", \"boundingBox\": [620.0, 203.0, 1078.0, 203.0, 1078.0, 271.0, 620.0, 271.0], \"words\": [{\"text\": \"Hero\", \"boundingBox\": [620.0, 203.0, 793.0, 203.0, 793.0, 271.0, 620.0, 271.0]}, {\"text\": \"Limited\", \"boundingBox\": [811.0, 203.0, 1078.0, 203.0, 1078.0, 271.0, 811.0, 271.0]}]}, {\"text\": \"Purchase Order\", \"boundingBox\": [1117.0, 319.0, 1551.0, 319.0, 1551.0, 372.0, 1117.0, 372.0], \"words\": [{\"text\": \"Purchase\", \"boundingBox\": [1117.0, 319.0, 1380.0, 319.0, 1380.0, 372.0, 1117.0, 372.0]}, {\"text\": \"Order\", \"boundingBox\": [1397.0, 319.0, 1551.0, 319.0, 1551.0, 372.0, 1397.0, 372.0]}]}, {\"text\": \"Company Phone:\", \"boundingBox\": [167.0, 351.0, 365.0, 351.0, 365.0, 381.0, 167.0, 381.0], \"words\": [{\"text\": \"Company\", \"boundingBox\": [167.0, 351.0, 276.0, 351.0, 276.0, 381.0, 167.0, 381.0]}, {\"text\": \"Phone:\", \"boundingBox\": [283.0, 351.0, 365.0, 351.0, 365.0, 381.0, 283.0, 381.0]}]}, {\"text\": \"555-348-6512\", \"boundingBox\": [371.0, 351.0, 528.0, 351.0, 528.0, 381.0, 371.0, 381.0], \"words\": [{\"text\": \"555-348-6512\", \"boundingBox\": [371.0, 351.0, 528.0, 351.0, 528.0, 381.0, 371.0, 381.0]}]}, {\"text\": \"Website:\", \"boundingBox\": [167.0, 392.0, 271.0, 392.0, 271.0, 420.0, 167.0, 420.0], \"words\": [{\"text\": \"Website:\", \"boundingBox\": [167.0, 392.0, 271.0, 392.0, 271.0, 420.0, 167.0, 420.0]}]}, {\"text\": \"www.herolimited.com\", \"boundingBox\": [277.0, 392.0, 530.0, 392.0, 530.0, 420.0, 277.0, 420.0], \"words\": [{\"text\": \"www.herolimited.com\", \"boundingBox\": [277.0, 392.0, 530.0, 392.0, 530.0, 420.0, 277.0, 420.0]}]}, {\"text\": \"Dated As:\", \"boundingBox\": [1025.0, 418.0, 1161.0, 418.0, 1161.0, 451.0, 1025.0, 451.0], \"words\": [{\"text\": \"Dated\", \"boundingBox\": [1025.0, 418.0, 1111.0, 418.0, 1111.0, 451.0, 1025.0, 451.0]}, {\"text\": \"As:\", \"boundingBox\": [1117.0, 418.0, 1161.0, 418.0, 1161.0, 451.0, 1117.0, 451.0]}]}, {\"text\": \"12/20/2020\", \"boundingBox\": [1168.0, 418.0, 1319.0, 418.0, 1319.0, 451.0, 1168.0, 451.0], \"words\": [{\"text\": \"12/20/2020\", \"boundingBox\": [1168.0, 418.0, 1319.0, 418.0, 1319.0, 451.0, 1168.0, 451.0]}]}, {\"text\": \"Email:\", \"boundingBox\": [167.0, 431.0, 240.0, 431.0, 240.0, 458.0, 167.0, 458.0], \"words\": [{\"text\": \"Email:\", \"boundingBox\": [167.0, 431.0, 240.0, 431.0, 240.0, 458.0, 167.0, 458.0]}]}, {\"text\": \"Purchase Order #:\", \"boundingBox\": [1027.0, 460.0, 1275.0, 460.0, 1275.0, 491.0, 1027.0, 491.0], \"words\": [{\"text\": \"Purchase\", \"boundingBox\": [1027.0, 460.0, 1153.0, 460.0, 1153.0, 491.0, 1027.0, 491.0]}, {\"text\": \"Order\", \"boundingBox\": [1160.0, 460.0, 1241.0, 460.0, 1241.0, 491.0, 1160.0, 491.0]}, {\"text\": \"#:\", \"boundingBox\": [1248.0, 460.0, 1275.0, 460.0, 1275.0, 491.0, 1248.0, 491.0]}]}, {\"text\": \"948284\", \"boundingBox\": [1282.0, 460.0, 1376.0, 460.0, 1376.0, 491.0, 1282.0, 491.0], \"words\": [{\"text\": \"948284\", \"boundingBox\": [1282.0, 460.0, 1376.0, 460.0, 1376.0, 491.0, 1282.0, 491.0]}]}, {\"text\": \"accounts@herolimited.com\", \"boundingBox\": [168.0, 480.0, 476.0, 480.0, 476.0, 505.0, 168.0, 505.0], \"words\": [{\"text\": \"accounts@herolimited.com\", \"boundingBox\": [168.0, 480.0, 476.0, 480.0, 476.0, 505.0, 168.0, 505.0]}]}, {\"text\": \"Shipped To\", \"boundingBox\": [170.0, 546.0, 398.0, 546.0, 398.0, 592.0, 170.0, 592.0], \"words\": [{\"text\": \"Shipped\", \"boundingBox\": [170.0, 546.0, 343.0, 546.0, 343.0, 592.0, 170.0, 592.0]}, {\"text\": \"To\", \"boundingBox\": [352.0, 546.0, 398.0, 546.0, 398.0, 592.0, 352.0, 592.0]}]}, {\"text\": \"Vendor Name:\", \"boundingBox\": [162.0, 610.0, 346.0, 610.0, 346.0, 640.0, 162.0, 640.0], \"words\": [{\"text\": \"Vendor\", \"boundingBox\": [162.0, 610.0, 256.0, 610.0, 256.0, 640.0, 162.0, 640.0]}, {\"text\": \"Name:\", \"boundingBox\": [262.0, 610.0, 346.0, 610.0, 346.0, 640.0, 262.0, 640.0]}]}, {\"text\": \"Hillary Swank\", \"boundingBox\": [352.0, 610.0, 519.0, 610.0, 519.0, 640.0, 352.0, 640.0], \"words\": [{\"text\": \"Hillary\", \"boundingBox\": [352.0, 610.0, 435.0, 610.0, 435.0, 640.0, 352.0, 640.0]}, {\"text\": \"Swank\", \"boundingBox\": [441.0, 610.0, 519.0, 610.0, 519.0, 640.0, 441.0, 640.0]}]}, {\"text\": \"Company Name:\", \"boundingBox\": [162.0, 646.0, 373.0, 646.0, 373.0, 678.0, 162.0, 678.0], \"words\": [{\"text\": \"Company\", \"boundingBox\": [162.0, 646.0, 283.0, 646.0, 283.0, 678.0, 162.0, 678.0]}, {\"text\": \"Name:\", \"boundingBox\": [289.0, 646.0, 373.0, 646.0, 373.0, 678.0, 289.0, 678.0]}]}, {\"text\": \"Higgly Wiggly Books\", \"boundingBox\": [379.0, 646.0, 628.0, 646.0, 628.0, 678.0, 379.0, 678.0], \"words\": [{\"text\": \"Higgly\", \"boundingBox\": [379.0, 646.0, 457.0, 646.0, 457.0, 678.0, 379.0, 678.0]}, {\"text\": \"Wiggly\", \"boundingBox\": [463.0, 646.0, 549.0, 646.0, 549.0, 678.0, 463.0, 678.0]}, {\"text\": \"Books\", \"boundingBox\": [555.0, 646.0, 628.0, 646.0, 628.0, 678.0, 555.0, 678.0]}]}, {\"text\": \"Address:\", \"boundingBox\": [162.0, 684.0, 272.0, 684.0, 272.0, 715.0, 162.0, 715.0], \"words\": [{\"text\": \"Address:\", \"boundingBox\": [162.0, 684.0, 272.0, 684.0, 272.0, 715.0, 162.0, 715.0]}]}, {\"text\": \"938 NE Burner Road\", \"boundingBox\": [279.0, 684.0, 526.0, 684.0, 526.0, 715.0, 279.0, 715.0], \"words\": [{\"text\": \"938\", \"boundingBox\": [279.0, 684.0, 326.0, 684.0, 326.0, 715.0, 279.0, 715.0]}, {\"text\": \"NE\", \"boundingBox\": [332.0, 684.0, 366.0, 684.0, 366.0, 715.0, 332.0, 715.0]}, {\"text\": \"Burner\", \"boundingBox\": [372.0, 684.0, 458.0, 684.0, 458.0, 715.0, 372.0, 715.0]}, {\"text\": \"Road\", \"boundingBox\": [464.0, 684.0, 526.0, 684.0, 526.0, 715.0, 464.0, 715.0]}]}, {\"text\": \"Boulder City, CO 92848\", \"boundingBox\": [283.0, 720.0, 569.0, 720.0, 569.0, 752.0, 283.0, 752.0], \"words\": [{\"text\": \"Boulder\", \"boundingBox\": [283.0, 720.0, 377.0, 720.0, 377.0, 752.0, 283.0, 752.0]}, {\"text\": \"City,\", \"boundingBox\": [384.0, 720.0, 437.0, 720.0, 437.0, 752.0, 384.0, 752.0]}, {\"text\": \"CO\", \"boundingBox\": [443.0, 720.0, 482.0, 720.0, 482.0, 752.0, 443.0, 752.0]}, {\"text\": \"92848\", \"boundingBox\": [489.0, 720.0, 569.0, 720.0, 569.0, 752.0, 489.0, 752.0]}]}, {\"text\": \"Phone:\", \"boundingBox\": [615.0, 723.0, 707.0, 723.0, 707.0, 752.0, 615.0, 752.0], \"words\": [{\"text\": \"Phone:\", \"boundingBox\": [615.0, 723.0, 707.0, 723.0, 707.0, 752.0, 615.0, 752.0]}]}, {\"text\": \"938-294-2949\", \"boundingBox\": [713.0, 723.0, 884.0, 723.0, 884.0, 752.0, 713.0, 752.0], \"words\": [{\"text\": \"938-294-2949\", \"boundingBox\": [713.0, 723.0, 884.0, 723.0, 884.0, 752.0, 713.0, 752.0]}]}, {\"text\": \"Shipped From\", \"boundingBox\": [169.0, 784.0, 445.0, 784.0, 445.0, 831.0, 169.0, 831.0], \"words\": [{\"text\": \"Shipped\", \"boundingBox\": [169.0, 784.0, 335.0, 784.0, 335.0, 831.0, 169.0, 831.0]}, {\"text\": \"From\", \"boundingBox\": [345.0, 784.0, 445.0, 784.0, 445.0, 831.0, 345.0, 831.0]}]}, {\"text\": \"Name:\", \"boundingBox\": [166.0, 852.0, 253.0, 852.0, 253.0, 881.0, 166.0, 881.0], \"words\": [{\"text\": \"Name:\", \"boundingBox\": [166.0, 852.0, 253.0, 852.0, 253.0, 881.0, 166.0, 881.0]}]}, {\"text\": \"Bernie Sanders\", \"boundingBox\": [258.0, 852.0, 445.0, 852.0, 445.0, 881.0, 258.0, 881.0], \"words\": [{\"text\": \"Bernie\", \"boundingBox\": [258.0, 852.0, 341.0, 852.0, 341.0, 881.0, 258.0, 881.0]}, {\"text\": \"Sanders\", \"boundingBox\": [347.0, 852.0, 445.0, 852.0, 445.0, 881.0, 347.0, 881.0]}]}, {\"text\": \"Company Name:\", \"boundingBox\": [169.0, 888.0, 378.0, 888.0, 378.0, 919.0, 169.0, 919.0], \"words\": [{\"text\": \"Company\", \"boundingBox\": [169.0, 888.0, 286.0, 888.0, 286.0, 919.0, 169.0, 919.0]}, {\"text\": \"Name:\", \"boundingBox\": [292.0, 888.0, 378.0, 888.0, 378.0, 919.0, 292.0, 919.0]}]}, {\"text\": \"Jupiter Book Supply\", \"boundingBox\": [385.0, 888.0, 624.0, 888.0, 624.0, 919.0, 385.0, 919.0], \"words\": [{\"text\": \"Jupiter\", \"boundingBox\": [385.0, 888.0, 470.0, 888.0, 470.0, 919.0, 385.0, 919.0]}, {\"text\": \"Book\", \"boundingBox\": [477.0, 888.0, 541.0, 888.0, 541.0, 919.0, 477.0, 919.0]}, {\"text\": \"Supply\", \"boundingBox\": [547.0, 888.0, 624.0, 888.0, 624.0, 919.0, 547.0, 919.0]}]}, {\"text\": \"Address:\", \"boundingBox\": [168.0, 924.0, 276.0, 924.0, 276.0, 954.0, 168.0, 954.0], \"words\": [{\"text\": \"Address:\", \"boundingBox\": [168.0, 924.0, 276.0, 924.0, 276.0, 954.0, 168.0, 954.0]}]}, {\"text\": \"383 N Kinnick Road\", \"boundingBox\": [283.0, 924.0, 524.0, 924.0, 524.0, 954.0, 283.0, 954.0], \"words\": [{\"text\": \"383\", \"boundingBox\": [283.0, 924.0, 328.0, 924.0, 328.0, 954.0, 283.0, 954.0]}, {\"text\": \"N\", \"boundingBox\": [335.0, 924.0, 355.0, 924.0, 355.0, 954.0, 335.0, 954.0]}, {\"text\": \"Kinnick\", \"boundingBox\": [362.0, 924.0, 451.0, 924.0, 451.0, 954.0, 362.0, 954.0]}, {\"text\": \"Road\", \"boundingBox\": [457.0, 924.0, 524.0, 924.0, 524.0, 954.0, 457.0, 954.0]}]}, {\"text\": \"Seattle, WA 38383\", \"boundingBox\": [285.0, 962.0, 515.0, 962.0, 515.0, 992.0, 285.0, 992.0], \"words\": [{\"text\": \"Seattle,\", \"boundingBox\": [285.0, 962.0, 380.0, 962.0, 380.0, 992.0, 285.0, 992.0]}, {\"text\": \"WA\", \"boundingBox\": [386.0, 962.0, 432.0, 962.0, 432.0, 992.0, 386.0, 992.0]}, {\"text\": \"38383\", \"boundingBox\": [438.0, 962.0, 515.0, 962.0, 515.0, 992.0, 438.0, 992.0]}]}, {\"text\": \"Phone:\", \"boundingBox\": [760.0, 964.0, 852.0, 964.0, 852.0, 992.0, 760.0, 992.0], \"words\": [{\"text\": \"Phone:\", \"boundingBox\": [760.0, 964.0, 852.0, 964.0, 852.0, 992.0, 760.0, 992.0]}]}, {\"text\": \"932-299-0292\", \"boundingBox\": [857.0, 964.0, 1032.0, 964.0, 1032.0, 992.0, 857.0, 992.0], \"words\": [{\"text\": \"932-299-0292\", \"boundingBox\": [857.0, 964.0, 1032.0, 964.0, 1032.0, 992.0, 857.0, 992.0]}]}, {\"text\": \"Details\", \"boundingBox\": [447.0, 1047.0, 551.0, 1047.0, 551.0, 1080.0, 447.0, 1080.0], \"words\": [{\"text\": \"Details\", \"boundingBox\": [447.0, 1047.0, 551.0, 1047.0, 551.0, 1080.0, 447.0, 1080.0]}]}, {\"text\": \"Quantity\", \"boundingBox\": [890.0, 1048.0, 1028.0, 1048.0, 1028.0, 1080.0, 890.0, 1080.0], \"words\": [{\"text\": \"Quantity\", \"boundingBox\": [890.0, 1048.0, 1028.0, 1048.0, 1028.0, 1080.0, 890.0, 1080.0]}]}, {\"text\": \"Unit Price\", \"boundingBox\": [1113.0, 1045.0, 1267.0, 1045.0, 1267.0, 1080.0, 1113.0, 1080.0], \"words\": [{\"text\": \"Unit\", \"boundingBox\": [1113.0, 1045.0, 1184.0, 1045.0, 1184.0, 1080.0, 1113.0, 1080.0]}, {\"text\": \"Price\", \"boundingBox\": [1191.0, 1045.0, 1267.0, 1045.0, 1267.0, 1080.0, 1191.0, 1080.0]}]}, {\"text\": \"Total\", \"boundingBox\": [1389.0, 1046.0, 1466.0, 1046.0, 1466.0, 1080.0, 1389.0, 1080.0], \"words\": [{\"text\": \"Total\", \"boundingBox\": [1389.0, 1046.0, 1466.0, 1046.0, 1466.0, 1080.0, 1389.0, 1080.0]}]}, {\"text\": \"Bindings\", \"boundingBox\": [173.0, 1094.0, 282.0, 1094.0, 282.0, 1122.0, 173.0, 1122.0], \"words\": [{\"text\": \"Bindings\", \"boundingBox\": [173.0, 1094.0, 282.0, 1094.0, 282.0, 1122.0, 173.0, 1122.0]}]}, {\"text\": \"20\", \"boundingBox\": [863.0, 1098.0, 889.0, 1098.0, 889.0, 1122.0, 863.0, 1122.0], \"words\": [{\"text\": \"20\", \"boundingBox\": [863.0, 1098.0, 889.0, 1098.0, 889.0, 1122.0, 863.0, 1122.0]}]}, {\"text\": \"1.00\", \"boundingBox\": [1243.0, 1096.0, 1297.0, 1096.0, 1297.0, 1122.0, 1243.0, 1122.0], \"words\": [{\"text\": \"1.00\", \"boundingBox\": [1243.0, 1096.0, 1297.0, 1096.0, 1297.0, 1122.0, 1243.0, 1122.0]}]}, {\"text\": \"20.00\", \"boundingBox\": [1466.0, 1098.0, 1531.0, 1098.0, 1531.0, 1122.0, 1466.0, 1122.0], \"words\": [{\"text\": \"20.00\", \"boundingBox\": [1466.0, 1098.0, 1531.0, 1098.0, 1531.0, 1122.0, 1466.0, 1122.0]}]}, {\"text\": \"Covers Small\", \"boundingBox\": [172.0, 1136.0, 331.0, 1136.0, 331.0, 1162.0, 172.0, 1162.0], \"words\": [{\"text\": \"Covers\", \"boundingBox\": [172.0, 1136.0, 257.0, 1136.0, 257.0, 1162.0, 172.0, 1162.0]}, {\"text\": \"Small\", \"boundingBox\": [262.0, 1136.0, 331.0, 1136.0, 331.0, 1162.0, 262.0, 1162.0]}]}, {\"text\": \"20\", \"boundingBox\": [862.0, 1137.0, 889.0, 1137.0, 889.0, 1162.0, 862.0, 1162.0], \"words\": [{\"text\": \"20\", \"boundingBox\": [862.0, 1137.0, 889.0, 1137.0, 889.0, 1162.0, 862.0, 1162.0]}]}, {\"text\": \"1.00\", \"boundingBox\": [1243.0, 1134.0, 1292.0, 1134.0, 1292.0, 1162.0, 1243.0, 1162.0], \"words\": [{\"text\": \"1.00\", \"boundingBox\": [1243.0, 1134.0, 1292.0, 1134.0, 1292.0, 1162.0, 1243.0, 1162.0]}]}, {\"text\": \"20.00\", \"boundingBox\": [1464.0, 1138.0, 1531.0, 1138.0, 1531.0, 1162.0, 1464.0, 1162.0], \"words\": [{\"text\": \"20.00\", \"boundingBox\": [1464.0, 1138.0, 1531.0, 1138.0, 1531.0, 1162.0, 1464.0, 1162.0]}]}, {\"text\": \"Feather Bookmark\", \"boundingBox\": [172.0, 1179.0, 404.0, 1179.0, 404.0, 1205.0, 172.0, 1205.0], \"words\": [{\"text\": \"Feather\", \"boundingBox\": [172.0, 1179.0, 271.0, 1179.0, 271.0, 1205.0, 172.0, 1205.0]}, {\"text\": \"Bookmark\", \"boundingBox\": [276.0, 1179.0, 404.0, 1179.0, 404.0, 1205.0, 276.0, 1205.0]}]}, {\"text\": \"20\", \"boundingBox\": [863.0, 1177.0, 888.0, 1177.0, 888.0, 1199.0, 863.0, 1199.0], \"words\": [{\"text\": \"20\", \"boundingBox\": [863.0, 1177.0, 888.0, 1177.0, 888.0, 1199.0, 863.0, 1199.0]}]}, {\"text\": \"5.00\", \"boundingBox\": [1243.0, 1179.0, 1298.0, 1179.0, 1298.0, 1205.0, 1243.0, 1205.0], \"words\": [{\"text\": \"5.00\", \"boundingBox\": [1243.0, 1179.0, 1298.0, 1179.0, 1298.0, 1205.0, 1243.0, 1205.0]}]}, {\"text\": \"100.00\", \"boundingBox\": [1448.0, 1180.0, 1530.0, 1180.0, 1530.0, 1205.0, 1448.0, 1205.0], \"words\": [{\"text\": \"100.00\", \"boundingBox\": [1448.0, 1180.0, 1530.0, 1180.0, 1530.0, 1205.0, 1448.0, 1205.0]}]}, {\"text\": \"Copper Swirl Marker\", \"boundingBox\": [171.0, 1224.0, 426.0, 1224.0, 426.0, 1248.0, 171.0, 1248.0], \"words\": [{\"text\": \"Copper\", \"boundingBox\": [171.0, 1224.0, 265.0, 1224.0, 265.0, 1248.0, 171.0, 1248.0]}, {\"text\": \"Swirl\", \"boundingBox\": [270.0, 1224.0, 334.0, 1224.0, 334.0, 1248.0, 270.0, 1248.0]}, {\"text\": \"Marker\", \"boundingBox\": [339.0, 1224.0, 426.0, 1224.0, 426.0, 1248.0, 339.0, 1248.0]}]}, {\"text\": \"20\", \"boundingBox\": [864.0, 1221.0, 887.0, 1221.0, 887.0, 1244.0, 864.0, 1244.0], \"words\": [{\"text\": \"20\", \"boundingBox\": [864.0, 1221.0, 887.0, 1221.0, 887.0, 1244.0, 864.0, 1244.0]}]}, {\"text\": \"5.00\", \"boundingBox\": [1242.0, 1222.0, 1291.0, 1222.0, 1291.0, 1248.0, 1242.0, 1248.0], \"words\": [{\"text\": \"5.00\", \"boundingBox\": [1242.0, 1222.0, 1291.0, 1222.0, 1291.0, 1248.0, 1242.0, 1248.0]}]}, {\"text\": \"100.00\", \"boundingBox\": [1449.0, 1225.0, 1530.0, 1225.0, 1530.0, 1248.0, 1449.0, 1248.0], \"words\": [{\"text\": \"100.00\", \"boundingBox\": [1449.0, 1225.0, 1530.0, 1225.0, 1530.0, 1248.0, 1449.0, 1248.0]}]}, {\"text\": \"SUBTOTAL\", \"boundingBox\": [1156.0, 1571.0, 1298.0, 1571.0, 1298.0, 1599.0, 1156.0, 1599.0], \"words\": [{\"text\": \"SUBTOTAL\", \"boundingBox\": [1156.0, 1571.0, 1298.0, 1571.0, 1298.0, 1599.0, 1156.0, 1599.0]}]}, {\"text\": \"$140.00\", \"boundingBox\": [1434.0, 1574.0, 1530.0, 1574.0, 1530.0, 1599.0, 1434.0, 1599.0], \"words\": [{\"text\": \"$140.00\", \"boundingBox\": [1434.0, 1574.0, 1530.0, 1574.0, 1530.0, 1599.0, 1434.0, 1599.0]}]}, {\"text\": \"TAX\", \"boundingBox\": [1242.0, 1619.0, 1293.0, 1619.0, 1293.0, 1643.0, 1242.0, 1643.0], \"words\": [{\"text\": \"TAX\", \"boundingBox\": [1242.0, 1619.0, 1293.0, 1619.0, 1293.0, 1643.0, 1242.0, 1643.0]}]}, {\"text\": \"$4.00\", \"boundingBox\": [1462.0, 1615.0, 1532.0, 1615.0, 1532.0, 1640.0, 1462.0, 1640.0], \"words\": [{\"text\": \"$4.00\", \"boundingBox\": [1462.0, 1615.0, 1532.0, 1615.0, 1532.0, 1640.0, 1462.0, 1640.0]}]}, {\"text\": \"Bernie Sanders\", \"boundingBox\": [485.0, 1669.0, 766.0, 1669.0, 766.0, 1708.0, 485.0, 1708.0], \"words\": [{\"text\": \"Bernie\", \"boundingBox\": [485.0, 1669.0, 605.0, 1669.0, 605.0, 1708.0, 485.0, 1708.0]}, {\"text\": \"Sanders\", \"boundingBox\": [613.0, 1669.0, 766.0, 1669.0, 766.0, 1708.0, 613.0, 1708.0]}]}, {\"text\": \"TOTAL\", \"boundingBox\": [1206.0, 1674.0, 1298.0, 1674.0, 1298.0, 1700.0, 1206.0, 1700.0], \"words\": [{\"text\": \"TOTAL\", \"boundingBox\": [1206.0, 1674.0, 1298.0, 1674.0, 1298.0, 1700.0, 1206.0, 1700.0]}]}, {\"text\": \"$144.00\", \"boundingBox\": [1434.0, 1671.0, 1531.0, 1671.0, 1531.0, 1697.0, 1434.0, 1697.0], \"words\": [{\"text\": \"$144.00\", \"boundingBox\": [1434.0, 1671.0, 1531.0, 1671.0, 1531.0, 1697.0, 1434.0, 1697.0]}]}, {\"text\": \"Bernie Sanders\", \"boundingBox\": [544.0, 1717.0, 719.0, 1717.0, 719.0, 1743.0, 544.0, 1743.0], \"words\": [{\"text\": \"Bernie\", \"boundingBox\": [544.0, 1717.0, 622.0, 1717.0, 622.0, 1743.0, 544.0, 1743.0]}, {\"text\": \"Sanders\", \"boundingBox\": [627.0, 1717.0, 719.0, 1717.0, 719.0, 1743.0, 627.0, 1743.0]}]}, {\"text\": \"Manager\", \"boundingBox\": [579.0, 1752.0, 687.0, 1752.0, 687.0, 1777.0, 579.0, 1777.0], \"words\": [{\"text\": \"Manager\", \"boundingBox\": [579.0, 1752.0, 687.0, 1752.0, 687.0, 1777.0, 579.0, 1777.0]}]}, {\"text\": \"Additional Notes:\", \"boundingBox\": [175.0, 1797.0, 479.0, 1797.0, 479.0, 1834.0, 175.0, 1834.0], \"words\": [{\"text\": \"Additional\", \"boundingBox\": [175.0, 1797.0, 358.0, 1797.0, 358.0, 1834.0, 175.0, 1834.0]}, {\"text\": \"Notes:\", \"boundingBox\": [366.0, 1797.0, 479.0, 1797.0, 479.0, 1834.0, 366.0, 1834.0]}]}, {\"text\": \"Do not Jostle Box. Unpack carefully. Enjoy.\", \"boundingBox\": [176.0, 1880.0, 707.0, 1880.0, 707.0, 1910.0, 176.0, 1910.0], \"words\": [{\"text\": \"Do\", \"boundingBox\": [176.0, 1880.0, 208.0, 1880.0, 208.0, 1910.0, 176.0, 1910.0]}, {\"text\": \"not\", \"boundingBox\": [213.0, 1880.0, 258.0, 1880.0, 258.0, 1910.0, 213.0, 1910.0]}, {\"text\": \"Jostle\", \"boundingBox\": [264.0, 1880.0, 338.0, 1880.0, 338.0, 1910.0, 264.0, 1910.0]}, {\"text\": \"Box.\", \"boundingBox\": [343.0, 1880.0, 404.0, 1880.0, 404.0, 1910.0, 343.0, 1910.0]}, {\"text\": \"Unpack\", \"boundingBox\": [410.0, 1880.0, 503.0, 1880.0, 503.0, 1910.0, 410.0, 1910.0]}, {\"text\": \"carefully.\", \"boundingBox\": [509.0, 1880.0, 628.0, 1880.0, 628.0, 1910.0, 509.0, 1910.0]}, {\"text\": \"Enjoy.\", \"boundingBox\": [633.0, 1880.0, 707.0, 1880.0, 707.0, 1910.0, 633.0, 1910.0]}]}, {\"text\": \"Jupiter Book Supply will refund you 50% per book if returned within 60 days of reading and\", \"boundingBox\": [173.0, 1925.0, 1511.0, 1925.0, 1511.0, 1959.0, 173.0, 1959.0], \"words\": [{\"text\": \"Jupiter\", \"boundingBox\": [173.0, 1925.0, 274.0, 1925.0, 274.0, 1959.0, 173.0, 1959.0]}, {\"text\": \"Book\", \"boundingBox\": [280.0, 1925.0, 361.0, 1925.0, 361.0, 1959.0, 280.0, 1959.0]}, {\"text\": \"Supply\", \"boundingBox\": [367.0, 1925.0, 470.0, 1925.0, 470.0, 1959.0, 367.0, 1959.0]}, {\"text\": \"will\", \"boundingBox\": [477.0, 1925.0, 523.0, 1925.0, 523.0, 1959.0, 477.0, 1959.0]}, {\"text\": \"refund\", \"boundingBox\": [530.0, 1925.0, 628.0, 1925.0, 628.0, 1959.0, 530.0, 1959.0]}, {\"text\": \"you\", \"boundingBox\": [635.0, 1925.0, 693.0, 1925.0, 693.0, 1959.0, 635.0, 1959.0]}, {\"text\": \"50%\", \"boundingBox\": [699.0, 1925.0, 766.0, 1925.0, 766.0, 1959.0, 699.0, 1959.0]}, {\"text\": \"per\", \"boundingBox\": [773.0, 1925.0, 827.0, 1925.0, 827.0, 1959.0, 773.0, 1959.0]}, {\"text\": \"book\", \"boundingBox\": [833.0, 1925.0, 907.0, 1925.0, 907.0, 1959.0, 833.0, 1959.0]}, {\"text\": \"if\", \"boundingBox\": [913.0, 1925.0, 934.0, 1925.0, 934.0, 1959.0, 913.0, 1959.0]}, {\"text\": \"returned\", \"boundingBox\": [940.0, 1925.0, 1067.0, 1925.0, 1067.0, 1959.0, 940.0, 1959.0]}, {\"text\": \"within\", \"boundingBox\": [1074.0, 1925.0, 1161.0, 1925.0, 1161.0, 1959.0, 1074.0, 1959.0]}, {\"text\": \"60\", \"boundingBox\": [1168.0, 1925.0, 1210.0, 1925.0, 1210.0, 1959.0, 1168.0, 1959.0]}, {\"text\": \"days\", \"boundingBox\": [1219.0, 1925.0, 1288.0, 1925.0, 1288.0, 1959.0, 1219.0, 1959.0]}, {\"text\": \"of\", \"boundingBox\": [1295.0, 1925.0, 1324.0, 1925.0, 1324.0, 1959.0, 1295.0, 1959.0]}, {\"text\": \"reading\", \"boundingBox\": [1330.0, 1925.0, 1446.0, 1925.0, 1446.0, 1959.0, 1330.0, 1959.0]}, {\"text\": \"and\", \"boundingBox\": [1453.0, 1925.0, 1511.0, 1925.0, 1511.0, 1959.0, 1453.0, 1959.0]}]}, {\"text\": \"offer you 25% off you next total purchase.\", \"boundingBox\": [170.0, 1959.0, 782.0, 1959.0, 782.0, 1992.0, 170.0, 1992.0], \"words\": [{\"text\": \"offer\", \"boundingBox\": [170.0, 1959.0, 239.0, 1959.0, 239.0, 1992.0, 170.0, 1992.0]}, {\"text\": \"you\", \"boundingBox\": [246.0, 1959.0, 304.0, 1959.0, 304.0, 1992.0, 246.0, 1992.0]}, {\"text\": \"25%\", \"boundingBox\": [310.0, 1959.0, 379.0, 1959.0, 379.0, 1992.0, 310.0, 1992.0]}, {\"text\": \"off\", \"boundingBox\": [386.0, 1959.0, 425.0, 1959.0, 425.0, 1992.0, 386.0, 1992.0]}, {\"text\": \"you\", \"boundingBox\": [432.0, 1959.0, 490.0, 1959.0, 490.0, 1992.0, 432.0, 1992.0]}, {\"text\": \"next\", \"boundingBox\": [496.0, 1959.0, 561.0, 1959.0, 561.0, 1992.0, 496.0, 1992.0]}, {\"text\": \"total\", \"boundingBox\": [567.0, 1959.0, 634.0, 1959.0, 634.0, 1992.0, 567.0, 1992.0]}, {\"text\": \"purchase.\", \"boundingBox\": [641.0, 1959.0, 782.0, 1959.0, 782.0, 1992.0, 641.0, 1992.0]}]}]}], \"pageResults\": [{\"page\": 1, \"keyValuePairs\": [{\"key\": {\"text\": \"Hero Limited\", \"boundingBox\": [620.0, 203.0, 1078.0, 203.0, 1078.0, 271.0, 620.0, 271.0], \"elements\": [\"#/readResults/0/lines/1/words/0\", \"#/readResults/0/lines/1/words/1\"]}, \"value\": {\"text\": \"\", \"boundingBox\": null, \"elements\": null}, \"confidence\": 0.5}, {\"key\": {\"text\": \"Company Phone:\", \"boundingBox\": [167.0, 351.0, 365.0, 351.0, 365.0, 381.0, 167.0, 381.0], \"elements\": [\"#/readResults/0/lines/3/words/0\", \"#/readResults/0/lines/3/words/1\"]}, \"value\": {\"text\": \"555-348-6512\", \"boundingBox\": [371.0, 351.0, 528.0, 351.0, 528.0, 381.0, 371.0, 381.0], \"elements\": [\"#/readResults/0/lines/4/words/0\"]}, \"confidence\": 1.0}, {\"key\": {\"text\": \"Website:\", \"boundingBox\": [167.0, 392.0, 271.0, 392.0, 271.0, 420.0, 167.0, 420.0], \"elements\": [\"#/readResults/0/lines/5/words/0\"]}, \"value\": {\"text\": \"www.herolimited.com\", \"boundingBox\": [277.0, 392.0, 530.0, 392.0, 530.0, 420.0, 277.0, 420.0], \"elements\": [\"#/readResults/0/lines/6/words/0\"]}, \"confidence\": 1.0}, {\"key\": {\"text\": \"Dated As:\", \"boundingBox\": [1025.0, 418.0, 1161.0, 418.0, 1161.0, 451.0, 1025.0, 451.0], \"elements\": [\"#/readResults/0/lines/7/words/0\", \"#/readResults/0/lines/7/words/1\"]}, \"value\": {\"text\": \"12/20/2020\", \"boundingBox\": [1168.0, 418.0, 1319.0, 418.0, 1319.0, 451.0, 1168.0, 451.0], \"elements\": [\"#/readResults/0/lines/8/words/0\"]}, \"confidence\": 1.0}, {\"key\": {\"text\": \"Email:\", \"boundingBox\": [167.0, 431.0, 240.0, 431.0, 240.0, 458.0, 167.0, 458.0], \"elements\": [\"#/readResults/0/lines/9/words/0\"]}, \"value\": {\"text\": \"accounts@herolimited.com\", \"boundingBox\": [168.0, 480.0, 476.0, 480.0, 476.0, 505.0, 168.0, 505.0], \"elements\": [\"#/readResults/0/lines/12/words/0\"]}, \"confidence\": 1.0}, {\"key\": {\"text\": \"Purchase Order #:\", \"boundingBox\": [1027.0, 460.0, 1275.0, 460.0, 1275.0, 491.0, 1027.0, 491.0], \"elements\": [\"#/readResults/0/lines/10/words/0\", \"#/readResults/0/lines/10/words/1\", \"#/readResults/0/lines/10/words/2\"]}, \"value\": {\"text\": \"948284\", \"boundingBox\": [1282.0, 460.0, 1376.0, 460.0, 1376.0, 491.0, 1282.0, 491.0], \"elements\": [\"#/readResults/0/lines/11/words/0\"]}, \"confidence\": 1.0}, {\"key\": {\"text\": \"Vendor Name:\", \"boundingBox\": [162.0, 610.0, 346.0, 610.0, 346.0, 640.0, 162.0, 640.0], \"elements\": [\"#/readResults/0/lines/14/words/0\", \"#/readResults/0/lines/14/words/1\"]}, \"value\": {\"text\": \"Hillary Swank\", \"boundingBox\": [352.0, 610.0, 519.0, 610.0, 519.0, 640.0, 352.0, 640.0], \"elements\": [\"#/readResults/0/lines/15/words/0\", \"#/readResults/0/lines/15/words/1\"]}, \"confidence\": 0.7}, {\"key\": {\"text\": \"Company Name:\", \"boundingBox\": [162.0, 646.0, 373.0, 646.0, 373.0, 678.0, 162.0, 678.0], \"elements\": [\"#/readResults/0/lines/16/words/0\", \"#/readResults/0/lines/16/words/1\"]}, \"value\": {\"text\": \"Higgly Wiggly Books\", \"boundingBox\": [379.0, 646.0, 628.0, 646.0, 628.0, 678.0, 379.0, 678.0], \"elements\": [\"#/readResults/0/lines/17/words/0\", \"#/readResults/0/lines/17/words/1\", \"#/readResults/0/lines/17/words/2\"]}, \"confidence\": 1.0}, {\"key\": {\"text\": \"Address:\", \"boundingBox\": [162.0, 684.0, 272.0, 684.0, 272.0, 715.0, 162.0, 715.0], \"elements\": [\"#/readResults/0/lines/18/words/0\"]}, \"value\": {\"text\": \"938 NE Burner Road Boulder City, CO 92848\", \"boundingBox\": [279.0, 684.0, 569.0, 684.0, 569.0, 752.0, 279.0, 752.0], \"elements\": [\"#/readResults/0/lines/19/words/0\", \"#/readResults/0/lines/19/words/1\", \"#/readResults/0/lines/19/words/2\", \"#/readResults/0/lines/19/words/3\", \"#/readResults/0/lines/20/words/0\", \"#/readResults/0/lines/20/words/1\", \"#/readResults/0/lines/20/words/2\", \"#/readResults/0/lines/20/words/3\"]}, \"confidence\": 1.0}, {\"key\": {\"text\": \"Phone:\", \"boundingBox\": [615.0, 723.0, 707.0, 723.0, 707.0, 752.0, 615.0, 752.0], \"elements\": [\"#/readResults/0/lines/21/words/0\"]}, \"value\": {\"text\": \"938-294-2949\", \"boundingBox\": [713.0, 723.0, 884.0, 723.0, 884.0, 752.0, 713.0, 752.0], \"elements\": [\"#/readResults/0/lines/22/words/0\"]}, \"confidence\": 1.0}, {\"key\": {\"text\": \"Name:\", \"boundingBox\": [166.0, 852.0, 253.0, 852.0, 253.0, 881.0, 166.0, 881.0], \"elements\": [\"#/readResults/0/lines/24/words/0\"]}, \"value\": {\"text\": \"Bernie Sanders\", \"boundingBox\": [258.0, 852.0, 445.0, 852.0, 445.0, 881.0, 258.0, 881.0], \"elements\": [\"#/readResults/0/lines/25/words/0\", \"#/readResults/0/lines/25/words/1\"]}, \"confidence\": 0.53}, {\"key\": {\"text\": \"Company Name:\", \"boundingBox\": [169.0, 888.0, 378.0, 888.0, 378.0, 919.0, 169.0, 919.0], \"elements\": [\"#/readResults/0/lines/26/words/0\", \"#/readResults/0/lines/26/words/1\"]}, \"value\": {\"text\": \"Jupiter Book Supply\", \"boundingBox\": [385.0, 888.0, 624.0, 888.0, 624.0, 919.0, 385.0, 919.0], \"elements\": [\"#/readResults/0/lines/27/words/0\", \"#/readResults/0/lines/27/words/1\", \"#/readResults/0/lines/27/words/2\"]}, \"confidence\": 0.53}, {\"key\": {\"text\": \"Address:\", \"boundingBox\": [168.0, 924.0, 276.0, 924.0, 276.0, 954.0, 168.0, 954.0], \"elements\": [\"#/readResults/0/lines/28/words/0\"]}, \"value\": {\"text\": \"383 N Kinnick Road Seattle, WA 38383\", \"boundingBox\": [283.0, 924.0, 524.0, 924.0, 524.0, 992.0, 283.0, 992.0], \"elements\": [\"#/readResults/0/lines/29/words/0\", \"#/readResults/0/lines/29/words/1\", \"#/readResults/0/lines/29/words/2\", \"#/readResults/0/lines/29/words/3\", \"#/readResults/0/lines/30/words/0\", \"#/readResults/0/lines/30/words/1\", \"#/readResults/0/lines/30/words/2\"]}, \"confidence\": 1.0}, {\"key\": {\"text\": \"Phone:\", \"boundingBox\": [760.0, 964.0, 852.0, 964.0, 852.0, 992.0, 760.0, 992.0], \"elements\": [\"#/readResults/0/lines/31/words/0\"]}, \"value\": {\"text\": \"932-299-0292\", \"boundingBox\": [857.0, 964.0, 1032.0, 964.0, 1032.0, 992.0, 857.0, 992.0], \"elements\": [\"#/readResults/0/lines/32/words/0\"]}, \"confidence\": 1.0}, {\"key\": {\"text\": \"SUBTOTAL\", \"boundingBox\": [1156.0, 1571.0, 1298.0, 1571.0, 1298.0, 1599.0, 1156.0, 1599.0], \"elements\": [\"#/readResults/0/lines/53/words/0\"]}, \"value\": {\"text\": \"$140.00\", \"boundingBox\": [1434.0, 1574.0, 1530.0, 1574.0, 1530.0, 1599.0, 1434.0, 1599.0], \"elements\": [\"#/readResults/0/lines/54/words/0\"]}, \"confidence\": 1.0}, {\"key\": {\"text\": \"TAX\", \"boundingBox\": [1242.0, 1619.0, 1293.0, 1619.0, 1293.0, 1643.0, 1242.0, 1643.0], \"elements\": [\"#/readResults/0/lines/55/words/0\"]}, \"value\": {\"text\": \"$4.00\", \"boundingBox\": [1462.0, 1615.0, 1532.0, 1615.0, 1532.0, 1640.0, 1462.0, 1640.0], \"elements\": [\"#/readResults/0/lines/56/words/0\"]}, \"confidence\": 1.0}, {\"key\": {\"text\": \"TOTAL\", \"boundingBox\": [1206.0, 1674.0, 1298.0, 1674.0, 1298.0, 1700.0, 1206.0, 1700.0], \"elements\": [\"#/readResults/0/lines/58/words/0\"]}, \"value\": {\"text\": \"$144.00\", \"boundingBox\": [1434.0, 1671.0, 1531.0, 1671.0, 1531.0, 1697.0, 1434.0, 1697.0], \"elements\": [\"#/readResults/0/lines/59/words/0\"]}, \"confidence\": 1.0}, {\"key\": {\"text\": \"Additional Notes:\", \"boundingBox\": [175.0, 1797.0, 479.0, 1797.0, 479.0, 1834.0, 175.0, 1834.0], \"elements\": [\"#/readResults/0/lines/62/words/0\", \"#/readResults/0/lines/62/words/1\"]}, \"value\": {\"text\": \"Do not Jostle Box. Unpack carefully. Enjoy. Jupiter Book Supply will refund you 50% per book if returned within 60 days of reading and offer you 25% off you next total purchase.\", \"boundingBox\": [170.0, 1880.0, 1511.0, 1880.0, 1511.0, 1992.0, 170.0, 1992.0], \"elements\": [\"#/readResults/0/lines/63/words/0\", \"#/readResults/0/lines/63/words/1\", \"#/readResults/0/lines/63/words/2\", \"#/readResults/0/lines/63/words/3\", \"#/readResults/0/lines/63/words/4\", \"#/readResults/0/lines/63/words/5\", \"#/readResults/0/lines/63/words/6\", \"#/readResults/0/lines/64/words/0\", \"#/readResults/0/lines/64/words/1\", \"#/readResults/0/lines/64/words/2\", \"#/readResults/0/lines/64/words/3\", \"#/readResults/0/lines/64/words/4\", \"#/readResults/0/lines/64/words/5\", \"#/readResults/0/lines/64/words/6\", \"#/readResults/0/lines/64/words/7\", \"#/readResults/0/lines/64/words/8\", \"#/readResults/0/lines/64/words/9\", \"#/readResults/0/lines/64/words/10\", \"#/readResults/0/lines/64/words/11\", \"#/readResults/0/lines/64/words/12\", \"#/readResults/0/lines/64/words/13\", \"#/readResults/0/lines/64/words/14\", \"#/readResults/0/lines/64/words/15\", \"#/readResults/0/lines/64/words/16\", \"#/readResults/0/lines/65/words/0\", \"#/readResults/0/lines/65/words/1\", \"#/readResults/0/lines/65/words/2\", \"#/readResults/0/lines/65/words/3\", \"#/readResults/0/lines/65/words/4\", \"#/readResults/0/lines/65/words/5\", \"#/readResults/0/lines/65/words/6\", \"#/readResults/0/lines/65/words/7\"]}, \"confidence\": 0.53}, {\"key\": {\"text\": \"__Tokens__1\", \"boundingBox\": null, \"elements\": null}, \"value\": {\"text\": \"Purchase Order\", \"boundingBox\": [141.0, 140.0, 348.0, 140.0, 348.0, 168.0, 141.0, 168.0], \"elements\": [\"#/readResults/0/lines/0/words/0\", \"#/readResults/0/lines/0/words/1\"]}, \"confidence\": 1.0}, {\"key\": {\"text\": \"__Tokens__2\", \"boundingBox\": null, \"elements\": null}, \"value\": {\"text\": \"Purchase Order\", \"boundingBox\": [1117.0, 319.0, 1551.0, 319.0, 1551.0, 372.0, 1117.0, 372.0], \"elements\": [\"#/readResults/0/lines/2/words/0\", \"#/readResults/0/lines/2/words/1\"]}, \"confidence\": 1.0}, {\"key\": {\"text\": \"__Tokens__3\", \"boundingBox\": null, \"elements\": null}, \"value\": {\"text\": \"Shipped To\", \"boundingBox\": [170.0, 546.0, 398.0, 546.0, 398.0, 592.0, 170.0, 592.0], \"elements\": [\"#/readResults/0/lines/13/words/0\", \"#/readResults/0/lines/13/words/1\"]}, \"confidence\": 1.0}, {\"key\": {\"text\": \"__Tokens__4\", \"boundingBox\": null, \"elements\": null}, \"value\": {\"text\": \"Shipped From\", \"boundingBox\": [169.0, 784.0, 445.0, 784.0, 445.0, 831.0, 169.0, 831.0], \"elements\": [\"#/readResults/0/lines/23/words/0\", \"#/readResults/0/lines/23/words/1\"]}, \"confidence\": 1.0}, {\"key\": {\"text\": \"__Tokens__5\", \"boundingBox\": null, \"elements\": null}, \"value\": {\"text\": \"Bernie Sanders\", \"boundingBox\": [485.0, 1669.0, 766.0, 1669.0, 766.0, 1708.0, 485.0, 1708.0], \"elements\": [\"#/readResults/0/lines/57/words/0\", \"#/readResults/0/lines/57/words/1\"]}, \"confidence\": 1.0}, {\"key\": {\"text\": \"__Tokens__6\", \"boundingBox\": null, \"elements\": null}, \"value\": {\"text\": \"Bernie Sanders\", \"boundingBox\": [544.0, 1717.0, 719.0, 1717.0, 719.0, 1743.0, 544.0, 1743.0], \"elements\": [\"#/readResults/0/lines/60/words/0\", \"#/readResults/0/lines/60/words/1\"]}, \"confidence\": 1.0}, {\"key\": {\"text\": \"__Tokens__7\", \"boundingBox\": null, \"elements\": null}, \"value\": {\"text\": \"Manager\", \"boundingBox\": [579.0, 1752.0, 687.0, 1752.0, 687.0, 1777.0, 579.0, 1777.0], \"elements\": [\"#/readResults/0/lines/61/words/0\"]}, \"confidence\": 1.0}], \"tables\": [{\"rows\": 5, \"columns\": 4, \"cells\": [{\"text\": \"Details\", \"rowIndex\": 0, \"columnIndex\": 0, \"boundingBox\": [447.0, 1047.0, 551.0, 1047.0, 551.0, 1080.0, 447.0, 1080.0], \"confidence\": 1.0, \"rowSpan\": 1, \"columnSpan\": 1, \"elements\": [\"#/readResults/0/lines/33/words/0\"], \"isHeader\": true, \"isFooter\": false}, {\"text\": \"Quantity\", \"rowIndex\": 0, \"columnIndex\": 1, \"boundingBox\": [890.0, 1048.0, 1028.0, 1048.0, 1028.0, 1080.0, 890.0, 1080.0], \"confidence\": 1.0, \"rowSpan\": 1, \"columnSpan\": 1, \"elements\": [\"#/readResults/0/lines/34/words/0\"], \"isHeader\": true, \"isFooter\": false}, {\"text\": \"Unit Price\", \"rowIndex\": 0, \"columnIndex\": 2, \"boundingBox\": [1113.0, 1045.0, 1267.0, 1045.0, 1267.0, 1080.0, 1113.0, 1080.0], \"confidence\": 1.0, \"rowSpan\": 1, \"columnSpan\": 1, \"elements\": [\"#/readResults/0/lines/35/words/0\", \"#/readResults/0/lines/35/words/1\"], \"isHeader\": true, \"isFooter\": false}, {\"text\": \"Total\", \"rowIndex\": 0, \"columnIndex\": 3, \"boundingBox\": [1389.0, 1046.0, 1466.0, 1046.0, 1466.0, 1080.0, 1389.0, 1080.0], \"confidence\": 1.0, \"rowSpan\": 1, \"columnSpan\": 1, \"elements\": [\"#/readResults/0/lines/36/words/0\"], \"isHeader\": true, \"isFooter\": false}, {\"text\": \"Bindings\", \"rowIndex\": 1, \"columnIndex\": 0, \"boundingBox\": [173.0, 1094.0, 282.0, 1094.0, 282.0, 1122.0, 173.0, 1122.0], \"confidence\": 1.0, \"rowSpan\": 1, \"columnSpan\": 1, \"elements\": [\"#/readResults/0/lines/37/words/0\"], \"isHeader\": false, \"isFooter\": false}, {\"text\": \"20\", \"rowIndex\": 1, \"columnIndex\": 1, \"boundingBox\": [863.0, 1098.0, 889.0, 1098.0, 889.0, 1122.0, 863.0, 1122.0], \"confidence\": 1.0, \"rowSpan\": 1, \"columnSpan\": 1, \"elements\": [\"#/readResults/0/lines/38/words/0\"], \"isHeader\": false, \"isFooter\": false}, {\"text\": \"1.00\", \"rowIndex\": 1, \"columnIndex\": 2, \"boundingBox\": [1243.0, 1096.0, 1297.0, 1096.0, 1297.0, 1122.0, 1243.0, 1122.0], \"confidence\": 1.0, \"rowSpan\": 1, \"columnSpan\": 1, \"elements\": [\"#/readResults/0/lines/39/words/0\"], \"isHeader\": false, \"isFooter\": false}, {\"text\": \"20.00\", \"rowIndex\": 1, \"columnIndex\": 3, \"boundingBox\": [1466.0, 1098.0, 1531.0, 1098.0, 1531.0, 1122.0, 1466.0, 1122.0], \"confidence\": 1.0, \"rowSpan\": 1, \"columnSpan\": 1, \"elements\": [\"#/readResults/0/lines/40/words/0\"], \"isHeader\": false, \"isFooter\": false}, {\"text\": \"Covers Small\", \"rowIndex\": 2, \"columnIndex\": 0, \"boundingBox\": [172.0, 1136.0, 331.0, 1136.0, 331.0, 1162.0, 172.0, 1162.0], \"confidence\": 1.0, \"rowSpan\": 1, \"columnSpan\": 1, \"elements\": [\"#/readResults/0/lines/41/words/0\", \"#/readResults/0/lines/41/words/1\"], \"isHeader\": false, \"isFooter\": false}, {\"text\": \"20\", \"rowIndex\": 2, \"columnIndex\": 1, \"boundingBox\": [862.0, 1137.0, 889.0, 1137.0, 889.0, 1162.0, 862.0, 1162.0], \"confidence\": 1.0, \"rowSpan\": 1, \"columnSpan\": 1, \"elements\": [\"#/readResults/0/lines/42/words/0\"], \"isHeader\": false, \"isFooter\": false}, {\"text\": \"1.00\", \"rowIndex\": 2, \"columnIndex\": 2, \"boundingBox\": [1243.0, 1134.0, 1292.0, 1134.0, 1292.0, 1162.0, 1243.0, 1162.0], \"confidence\": 1.0, \"rowSpan\": 1, \"columnSpan\": 1, \"elements\": [\"#/readResults/0/lines/43/words/0\"], \"isHeader\": false, \"isFooter\": false}, {\"text\": \"20.00\", \"rowIndex\": 2, \"columnIndex\": 3, \"boundingBox\": [1464.0, 1138.0, 1531.0, 1138.0, 1531.0, 1162.0, 1464.0, 1162.0], \"confidence\": 1.0, \"rowSpan\": 1, \"columnSpan\": 1, \"elements\": [\"#/readResults/0/lines/44/words/0\"], \"isHeader\": false, \"isFooter\": false}, {\"text\": \"Feather Bookmark\", \"rowIndex\": 3, \"columnIndex\": 0, \"boundingBox\": [172.0, 1179.0, 404.0, 1179.0, 404.0, 1205.0, 172.0, 1205.0], \"confidence\": 1.0, \"rowSpan\": 1, \"columnSpan\": 1, \"elements\": [\"#/readResults/0/lines/45/words/0\", \"#/readResults/0/lines/45/words/1\"], \"isHeader\": false, \"isFooter\": false}, {\"text\": \"20\", \"rowIndex\": 3, \"columnIndex\": 1, \"boundingBox\": [863.0, 1177.0, 888.0, 1177.0, 888.0, 1199.0, 863.0, 1199.0], \"confidence\": 1.0, \"rowSpan\": 1, \"columnSpan\": 1, \"elements\": [\"#/readResults/0/lines/46/words/0\"], \"isHeader\": false, \"isFooter\": false}, {\"text\": \"5.00\", \"rowIndex\": 3, \"columnIndex\": 2, \"boundingBox\": [1243.0, 1179.0, 1298.0, 1179.0, 1298.0, 1205.0, 1243.0, 1205.0], \"confidence\": 1.0, \"rowSpan\": 1, \"columnSpan\": 1, \"elements\": [\"#/readResults/0/lines/47/words/0\"], \"isHeader\": false, \"isFooter\": false}, {\"text\": \"100.00\", \"rowIndex\": 3, \"columnIndex\": 3, \"boundingBox\": [1448.0, 1180.0, 1530.0, 1180.0, 1530.0, 1205.0, 1448.0, 1205.0], \"confidence\": 1.0, \"rowSpan\": 1, \"columnSpan\": 1, \"elements\": [\"#/readResults/0/lines/48/words/0\"], \"isHeader\": false, \"isFooter\": false}, {\"text\": \"Copper Swirl Marker\", \"rowIndex\": 4, \"columnIndex\": 0, \"boundingBox\": [171.0, 1224.0, 426.0, 1224.0, 426.0, 1248.0, 171.0, 1248.0], \"confidence\": 1.0, \"rowSpan\": 1, \"columnSpan\": 1, \"elements\": [\"#/readResults/0/lines/49/words/0\", \"#/readResults/0/lines/49/words/1\", \"#/readResults/0/lines/49/words/2\"], \"isHeader\": false, \"isFooter\": false}, {\"text\": \"20\", \"rowIndex\": 4, \"columnIndex\": 1, \"boundingBox\": [864.0, 1221.0, 887.0, 1221.0, 887.0, 1244.0, 864.0, 1244.0], \"confidence\": 1.0, \"rowSpan\": 1, \"columnSpan\": 1, \"elements\": [\"#/readResults/0/lines/50/words/0\"], \"isHeader\": false, \"isFooter\": false}, {\"text\": \"5.00\", \"rowIndex\": 4, \"columnIndex\": 2, \"boundingBox\": [1242.0, 1222.0, 1291.0, 1222.0, 1291.0, 1248.0, 1242.0, 1248.0], \"confidence\": 1.0, \"rowSpan\": 1, \"columnSpan\": 1, \"elements\": [\"#/readResults/0/lines/51/words/0\"], \"isHeader\": false, \"isFooter\": false}, {\"text\": \"100.00\", \"rowIndex\": 4, \"columnIndex\": 3, \"boundingBox\": [1449.0, 1225.0, 1530.0, 1225.0, 1530.0, 1248.0, 1449.0, 1248.0], \"confidence\": 1.0, \"rowSpan\": 1, \"columnSpan\": 1, \"elements\": [\"#/readResults/0/lines/52/words/0\"], \"isHeader\": false, \"isFooter\": false}]}], \"clusterId\": 0}], \"documentResults\": [], \"errors\": []}}", - "Date" : "Tue, 23 Jun 2020 00:38:52 GMT", - "Content-Type" : "application/json; charset=utf-8" - }, - "Exception" : null - }, { - "Method" : "GET", - "Uri" : "https://REDACTED.cognitiveservices.azure.com/formrecognizer/v2.0-preview//custom/models/0fe3e66e-3f33-47ed-be20-98f211248b31/analyzeResults/4aaf66b9-ce9c-43b8-bd48-0112c78908eb", - "Headers" : { - "User-Agent" : "azsdk-java-azure-ai-formrecognizer/1.0.0-beta.4 (11.0.5; Windows 10 10.0)", - "x-ms-client-request-id" : "913d679f-9896-4d4d-980e-5c1be04f5c61" - }, - "Response" : { - "x-envoy-upstream-service-time" : "123", - "Strict-Transport-Security" : "max-age=31536000; includeSubDomains; preload", - "x-content-type-options" : "nosniff", - "apim-request-id" : "7995670c-dab8-423d-8f39-35a2899e473d", - "retry-after" : "0", - "Content-Length" : "36450", - "StatusCode" : "200", - "Body" : "{\"status\": \"succeeded\", \"createdDateTime\": \"2020-06-23T00:38:42Z\", \"lastUpdatedDateTime\": \"2020-06-23T00:38:48Z\", \"analyzeResult\": {\"version\": \"2.0.0\", \"readResults\": [{\"page\": 1, \"angle\": 0.16, \"width\": 1700, \"height\": 2200, \"unit\": \"pixel\", \"lines\": [{\"text\": \"Purchase Order\", \"boundingBox\": [141.0, 140.0, 348.0, 140.0, 348.0, 168.0, 141.0, 168.0], \"words\": [{\"text\": \"Purchase\", \"boundingBox\": [141.0, 140.0, 267.0, 140.0, 267.0, 168.0, 141.0, 168.0]}, {\"text\": \"Order\", \"boundingBox\": [273.0, 140.0, 348.0, 140.0, 348.0, 168.0, 273.0, 168.0]}]}, {\"text\": \"Hero Limited\", \"boundingBox\": [620.0, 203.0, 1078.0, 203.0, 1078.0, 271.0, 620.0, 271.0], \"words\": [{\"text\": \"Hero\", \"boundingBox\": [620.0, 203.0, 793.0, 203.0, 793.0, 271.0, 620.0, 271.0]}, {\"text\": \"Limited\", \"boundingBox\": [811.0, 203.0, 1078.0, 203.0, 1078.0, 271.0, 811.0, 271.0]}]}, {\"text\": \"Purchase Order\", \"boundingBox\": [1117.0, 319.0, 1551.0, 319.0, 1551.0, 372.0, 1117.0, 372.0], \"words\": [{\"text\": \"Purchase\", \"boundingBox\": [1117.0, 319.0, 1380.0, 319.0, 1380.0, 372.0, 1117.0, 372.0]}, {\"text\": \"Order\", \"boundingBox\": [1397.0, 319.0, 1551.0, 319.0, 1551.0, 372.0, 1397.0, 372.0]}]}, {\"text\": \"Company Phone:\", \"boundingBox\": [167.0, 351.0, 365.0, 351.0, 365.0, 381.0, 167.0, 381.0], \"words\": [{\"text\": \"Company\", \"boundingBox\": [167.0, 351.0, 276.0, 351.0, 276.0, 381.0, 167.0, 381.0]}, {\"text\": \"Phone:\", \"boundingBox\": [283.0, 351.0, 365.0, 351.0, 365.0, 381.0, 283.0, 381.0]}]}, {\"text\": \"555-348-6512\", \"boundingBox\": [371.0, 351.0, 528.0, 351.0, 528.0, 381.0, 371.0, 381.0], \"words\": [{\"text\": \"555-348-6512\", \"boundingBox\": [371.0, 351.0, 528.0, 351.0, 528.0, 381.0, 371.0, 381.0]}]}, {\"text\": \"Website:\", \"boundingBox\": [167.0, 392.0, 271.0, 392.0, 271.0, 420.0, 167.0, 420.0], \"words\": [{\"text\": \"Website:\", \"boundingBox\": [167.0, 392.0, 271.0, 392.0, 271.0, 420.0, 167.0, 420.0]}]}, {\"text\": \"www.herolimited.com\", \"boundingBox\": [277.0, 392.0, 530.0, 392.0, 530.0, 420.0, 277.0, 420.0], \"words\": [{\"text\": \"www.herolimited.com\", \"boundingBox\": [277.0, 392.0, 530.0, 392.0, 530.0, 420.0, 277.0, 420.0]}]}, {\"text\": \"Dated As:\", \"boundingBox\": [1025.0, 418.0, 1161.0, 418.0, 1161.0, 451.0, 1025.0, 451.0], \"words\": [{\"text\": \"Dated\", \"boundingBox\": [1025.0, 418.0, 1111.0, 418.0, 1111.0, 451.0, 1025.0, 451.0]}, {\"text\": \"As:\", \"boundingBox\": [1117.0, 418.0, 1161.0, 418.0, 1161.0, 451.0, 1117.0, 451.0]}]}, {\"text\": \"12/20/2020\", \"boundingBox\": [1168.0, 418.0, 1319.0, 418.0, 1319.0, 451.0, 1168.0, 451.0], \"words\": [{\"text\": \"12/20/2020\", \"boundingBox\": [1168.0, 418.0, 1319.0, 418.0, 1319.0, 451.0, 1168.0, 451.0]}]}, {\"text\": \"Email:\", \"boundingBox\": [167.0, 431.0, 240.0, 431.0, 240.0, 458.0, 167.0, 458.0], \"words\": [{\"text\": \"Email:\", \"boundingBox\": [167.0, 431.0, 240.0, 431.0, 240.0, 458.0, 167.0, 458.0]}]}, {\"text\": \"Purchase Order #:\", \"boundingBox\": [1027.0, 460.0, 1275.0, 460.0, 1275.0, 491.0, 1027.0, 491.0], \"words\": [{\"text\": \"Purchase\", \"boundingBox\": [1027.0, 460.0, 1153.0, 460.0, 1153.0, 491.0, 1027.0, 491.0]}, {\"text\": \"Order\", \"boundingBox\": [1160.0, 460.0, 1241.0, 460.0, 1241.0, 491.0, 1160.0, 491.0]}, {\"text\": \"#:\", \"boundingBox\": [1248.0, 460.0, 1275.0, 460.0, 1275.0, 491.0, 1248.0, 491.0]}]}, {\"text\": \"948284\", \"boundingBox\": [1282.0, 460.0, 1376.0, 460.0, 1376.0, 491.0, 1282.0, 491.0], \"words\": [{\"text\": \"948284\", \"boundingBox\": [1282.0, 460.0, 1376.0, 460.0, 1376.0, 491.0, 1282.0, 491.0]}]}, {\"text\": \"accounts@herolimited.com\", \"boundingBox\": [168.0, 480.0, 476.0, 480.0, 476.0, 505.0, 168.0, 505.0], \"words\": [{\"text\": \"accounts@herolimited.com\", \"boundingBox\": [168.0, 480.0, 476.0, 480.0, 476.0, 505.0, 168.0, 505.0]}]}, {\"text\": \"Shipped To\", \"boundingBox\": [170.0, 546.0, 398.0, 546.0, 398.0, 592.0, 170.0, 592.0], \"words\": [{\"text\": \"Shipped\", \"boundingBox\": [170.0, 546.0, 343.0, 546.0, 343.0, 592.0, 170.0, 592.0]}, {\"text\": \"To\", \"boundingBox\": [352.0, 546.0, 398.0, 546.0, 398.0, 592.0, 352.0, 592.0]}]}, {\"text\": \"Vendor Name:\", \"boundingBox\": [162.0, 610.0, 346.0, 610.0, 346.0, 640.0, 162.0, 640.0], \"words\": [{\"text\": \"Vendor\", \"boundingBox\": [162.0, 610.0, 256.0, 610.0, 256.0, 640.0, 162.0, 640.0]}, {\"text\": \"Name:\", \"boundingBox\": [262.0, 610.0, 346.0, 610.0, 346.0, 640.0, 262.0, 640.0]}]}, {\"text\": \"Hillary Swank\", \"boundingBox\": [352.0, 610.0, 519.0, 610.0, 519.0, 640.0, 352.0, 640.0], \"words\": [{\"text\": \"Hillary\", \"boundingBox\": [352.0, 610.0, 435.0, 610.0, 435.0, 640.0, 352.0, 640.0]}, {\"text\": \"Swank\", \"boundingBox\": [441.0, 610.0, 519.0, 610.0, 519.0, 640.0, 441.0, 640.0]}]}, {\"text\": \"Company Name:\", \"boundingBox\": [162.0, 646.0, 373.0, 646.0, 373.0, 678.0, 162.0, 678.0], \"words\": [{\"text\": \"Company\", \"boundingBox\": [162.0, 646.0, 283.0, 646.0, 283.0, 678.0, 162.0, 678.0]}, {\"text\": \"Name:\", \"boundingBox\": [289.0, 646.0, 373.0, 646.0, 373.0, 678.0, 289.0, 678.0]}]}, {\"text\": \"Higgly Wiggly Books\", \"boundingBox\": [379.0, 646.0, 628.0, 646.0, 628.0, 678.0, 379.0, 678.0], \"words\": [{\"text\": \"Higgly\", \"boundingBox\": [379.0, 646.0, 457.0, 646.0, 457.0, 678.0, 379.0, 678.0]}, {\"text\": \"Wiggly\", \"boundingBox\": [463.0, 646.0, 549.0, 646.0, 549.0, 678.0, 463.0, 678.0]}, {\"text\": \"Books\", \"boundingBox\": [555.0, 646.0, 628.0, 646.0, 628.0, 678.0, 555.0, 678.0]}]}, {\"text\": \"Address:\", \"boundingBox\": [162.0, 684.0, 272.0, 684.0, 272.0, 715.0, 162.0, 715.0], \"words\": [{\"text\": \"Address:\", \"boundingBox\": [162.0, 684.0, 272.0, 684.0, 272.0, 715.0, 162.0, 715.0]}]}, {\"text\": \"938 NE Burner Road\", \"boundingBox\": [279.0, 684.0, 526.0, 684.0, 526.0, 715.0, 279.0, 715.0], \"words\": [{\"text\": \"938\", \"boundingBox\": [279.0, 684.0, 326.0, 684.0, 326.0, 715.0, 279.0, 715.0]}, {\"text\": \"NE\", \"boundingBox\": [332.0, 684.0, 366.0, 684.0, 366.0, 715.0, 332.0, 715.0]}, {\"text\": \"Burner\", \"boundingBox\": [372.0, 684.0, 458.0, 684.0, 458.0, 715.0, 372.0, 715.0]}, {\"text\": \"Road\", \"boundingBox\": [464.0, 684.0, 526.0, 684.0, 526.0, 715.0, 464.0, 715.0]}]}, {\"text\": \"Boulder City, CO 92848\", \"boundingBox\": [283.0, 720.0, 569.0, 720.0, 569.0, 752.0, 283.0, 752.0], \"words\": [{\"text\": \"Boulder\", \"boundingBox\": [283.0, 720.0, 377.0, 720.0, 377.0, 752.0, 283.0, 752.0]}, {\"text\": \"City,\", \"boundingBox\": [384.0, 720.0, 437.0, 720.0, 437.0, 752.0, 384.0, 752.0]}, {\"text\": \"CO\", \"boundingBox\": [443.0, 720.0, 482.0, 720.0, 482.0, 752.0, 443.0, 752.0]}, {\"text\": \"92848\", \"boundingBox\": [489.0, 720.0, 569.0, 720.0, 569.0, 752.0, 489.0, 752.0]}]}, {\"text\": \"Phone:\", \"boundingBox\": [615.0, 723.0, 707.0, 723.0, 707.0, 752.0, 615.0, 752.0], \"words\": [{\"text\": \"Phone:\", \"boundingBox\": [615.0, 723.0, 707.0, 723.0, 707.0, 752.0, 615.0, 752.0]}]}, {\"text\": \"938-294-2949\", \"boundingBox\": [713.0, 723.0, 884.0, 723.0, 884.0, 752.0, 713.0, 752.0], \"words\": [{\"text\": \"938-294-2949\", \"boundingBox\": [713.0, 723.0, 884.0, 723.0, 884.0, 752.0, 713.0, 752.0]}]}, {\"text\": \"Shipped From\", \"boundingBox\": [169.0, 784.0, 445.0, 784.0, 445.0, 831.0, 169.0, 831.0], \"words\": [{\"text\": \"Shipped\", \"boundingBox\": [169.0, 784.0, 335.0, 784.0, 335.0, 831.0, 169.0, 831.0]}, {\"text\": \"From\", \"boundingBox\": [345.0, 784.0, 445.0, 784.0, 445.0, 831.0, 345.0, 831.0]}]}, {\"text\": \"Name:\", \"boundingBox\": [166.0, 852.0, 253.0, 852.0, 253.0, 881.0, 166.0, 881.0], \"words\": [{\"text\": \"Name:\", \"boundingBox\": [166.0, 852.0, 253.0, 852.0, 253.0, 881.0, 166.0, 881.0]}]}, {\"text\": \"Bernie Sanders\", \"boundingBox\": [258.0, 852.0, 445.0, 852.0, 445.0, 881.0, 258.0, 881.0], \"words\": [{\"text\": \"Bernie\", \"boundingBox\": [258.0, 852.0, 341.0, 852.0, 341.0, 881.0, 258.0, 881.0]}, {\"text\": \"Sanders\", \"boundingBox\": [347.0, 852.0, 445.0, 852.0, 445.0, 881.0, 347.0, 881.0]}]}, {\"text\": \"Company Name:\", \"boundingBox\": [169.0, 888.0, 378.0, 888.0, 378.0, 919.0, 169.0, 919.0], \"words\": [{\"text\": \"Company\", \"boundingBox\": [169.0, 888.0, 286.0, 888.0, 286.0, 919.0, 169.0, 919.0]}, {\"text\": \"Name:\", \"boundingBox\": [292.0, 888.0, 378.0, 888.0, 378.0, 919.0, 292.0, 919.0]}]}, {\"text\": \"Jupiter Book Supply\", \"boundingBox\": [385.0, 888.0, 624.0, 888.0, 624.0, 919.0, 385.0, 919.0], \"words\": [{\"text\": \"Jupiter\", \"boundingBox\": [385.0, 888.0, 470.0, 888.0, 470.0, 919.0, 385.0, 919.0]}, {\"text\": \"Book\", \"boundingBox\": [477.0, 888.0, 541.0, 888.0, 541.0, 919.0, 477.0, 919.0]}, {\"text\": \"Supply\", \"boundingBox\": [547.0, 888.0, 624.0, 888.0, 624.0, 919.0, 547.0, 919.0]}]}, {\"text\": \"Address:\", \"boundingBox\": [168.0, 924.0, 276.0, 924.0, 276.0, 954.0, 168.0, 954.0], \"words\": [{\"text\": \"Address:\", \"boundingBox\": [168.0, 924.0, 276.0, 924.0, 276.0, 954.0, 168.0, 954.0]}]}, {\"text\": \"383 N Kinnick Road\", \"boundingBox\": [283.0, 924.0, 524.0, 924.0, 524.0, 954.0, 283.0, 954.0], \"words\": [{\"text\": \"383\", \"boundingBox\": [283.0, 924.0, 328.0, 924.0, 328.0, 954.0, 283.0, 954.0]}, {\"text\": \"N\", \"boundingBox\": [335.0, 924.0, 355.0, 924.0, 355.0, 954.0, 335.0, 954.0]}, {\"text\": \"Kinnick\", \"boundingBox\": [362.0, 924.0, 451.0, 924.0, 451.0, 954.0, 362.0, 954.0]}, {\"text\": \"Road\", \"boundingBox\": [457.0, 924.0, 524.0, 924.0, 524.0, 954.0, 457.0, 954.0]}]}, {\"text\": \"Seattle, WA 38383\", \"boundingBox\": [285.0, 962.0, 515.0, 962.0, 515.0, 992.0, 285.0, 992.0], \"words\": [{\"text\": \"Seattle,\", \"boundingBox\": [285.0, 962.0, 380.0, 962.0, 380.0, 992.0, 285.0, 992.0]}, {\"text\": \"WA\", \"boundingBox\": [386.0, 962.0, 432.0, 962.0, 432.0, 992.0, 386.0, 992.0]}, {\"text\": \"38383\", \"boundingBox\": [438.0, 962.0, 515.0, 962.0, 515.0, 992.0, 438.0, 992.0]}]}, {\"text\": \"Phone:\", \"boundingBox\": [760.0, 964.0, 852.0, 964.0, 852.0, 992.0, 760.0, 992.0], \"words\": [{\"text\": \"Phone:\", \"boundingBox\": [760.0, 964.0, 852.0, 964.0, 852.0, 992.0, 760.0, 992.0]}]}, {\"text\": \"932-299-0292\", \"boundingBox\": [857.0, 964.0, 1032.0, 964.0, 1032.0, 992.0, 857.0, 992.0], \"words\": [{\"text\": \"932-299-0292\", \"boundingBox\": [857.0, 964.0, 1032.0, 964.0, 1032.0, 992.0, 857.0, 992.0]}]}, {\"text\": \"Details\", \"boundingBox\": [447.0, 1047.0, 551.0, 1047.0, 551.0, 1080.0, 447.0, 1080.0], \"words\": [{\"text\": \"Details\", \"boundingBox\": [447.0, 1047.0, 551.0, 1047.0, 551.0, 1080.0, 447.0, 1080.0]}]}, {\"text\": \"Quantity\", \"boundingBox\": [890.0, 1048.0, 1028.0, 1048.0, 1028.0, 1080.0, 890.0, 1080.0], \"words\": [{\"text\": \"Quantity\", \"boundingBox\": [890.0, 1048.0, 1028.0, 1048.0, 1028.0, 1080.0, 890.0, 1080.0]}]}, {\"text\": \"Unit Price\", \"boundingBox\": [1113.0, 1045.0, 1267.0, 1045.0, 1267.0, 1080.0, 1113.0, 1080.0], \"words\": [{\"text\": \"Unit\", \"boundingBox\": [1113.0, 1045.0, 1184.0, 1045.0, 1184.0, 1080.0, 1113.0, 1080.0]}, {\"text\": \"Price\", \"boundingBox\": [1191.0, 1045.0, 1267.0, 1045.0, 1267.0, 1080.0, 1191.0, 1080.0]}]}, {\"text\": \"Total\", \"boundingBox\": [1389.0, 1046.0, 1466.0, 1046.0, 1466.0, 1080.0, 1389.0, 1080.0], \"words\": [{\"text\": \"Total\", \"boundingBox\": [1389.0, 1046.0, 1466.0, 1046.0, 1466.0, 1080.0, 1389.0, 1080.0]}]}, {\"text\": \"Bindings\", \"boundingBox\": [173.0, 1094.0, 282.0, 1094.0, 282.0, 1122.0, 173.0, 1122.0], \"words\": [{\"text\": \"Bindings\", \"boundingBox\": [173.0, 1094.0, 282.0, 1094.0, 282.0, 1122.0, 173.0, 1122.0]}]}, {\"text\": \"20\", \"boundingBox\": [863.0, 1098.0, 889.0, 1098.0, 889.0, 1122.0, 863.0, 1122.0], \"words\": [{\"text\": \"20\", \"boundingBox\": [863.0, 1098.0, 889.0, 1098.0, 889.0, 1122.0, 863.0, 1122.0]}]}, {\"text\": \"1.00\", \"boundingBox\": [1243.0, 1096.0, 1297.0, 1096.0, 1297.0, 1122.0, 1243.0, 1122.0], \"words\": [{\"text\": \"1.00\", \"boundingBox\": [1243.0, 1096.0, 1297.0, 1096.0, 1297.0, 1122.0, 1243.0, 1122.0]}]}, {\"text\": \"20.00\", \"boundingBox\": [1466.0, 1098.0, 1531.0, 1098.0, 1531.0, 1122.0, 1466.0, 1122.0], \"words\": [{\"text\": \"20.00\", \"boundingBox\": [1466.0, 1098.0, 1531.0, 1098.0, 1531.0, 1122.0, 1466.0, 1122.0]}]}, {\"text\": \"Covers Small\", \"boundingBox\": [172.0, 1136.0, 331.0, 1136.0, 331.0, 1162.0, 172.0, 1162.0], \"words\": [{\"text\": \"Covers\", \"boundingBox\": [172.0, 1136.0, 257.0, 1136.0, 257.0, 1162.0, 172.0, 1162.0]}, {\"text\": \"Small\", \"boundingBox\": [262.0, 1136.0, 331.0, 1136.0, 331.0, 1162.0, 262.0, 1162.0]}]}, {\"text\": \"20\", \"boundingBox\": [862.0, 1137.0, 889.0, 1137.0, 889.0, 1162.0, 862.0, 1162.0], \"words\": [{\"text\": \"20\", \"boundingBox\": [862.0, 1137.0, 889.0, 1137.0, 889.0, 1162.0, 862.0, 1162.0]}]}, {\"text\": \"1.00\", \"boundingBox\": [1243.0, 1134.0, 1292.0, 1134.0, 1292.0, 1162.0, 1243.0, 1162.0], \"words\": [{\"text\": \"1.00\", \"boundingBox\": [1243.0, 1134.0, 1292.0, 1134.0, 1292.0, 1162.0, 1243.0, 1162.0]}]}, {\"text\": \"20.00\", \"boundingBox\": [1464.0, 1138.0, 1531.0, 1138.0, 1531.0, 1162.0, 1464.0, 1162.0], \"words\": [{\"text\": \"20.00\", \"boundingBox\": [1464.0, 1138.0, 1531.0, 1138.0, 1531.0, 1162.0, 1464.0, 1162.0]}]}, {\"text\": \"Feather Bookmark\", \"boundingBox\": [172.0, 1179.0, 404.0, 1179.0, 404.0, 1205.0, 172.0, 1205.0], \"words\": [{\"text\": \"Feather\", \"boundingBox\": [172.0, 1179.0, 271.0, 1179.0, 271.0, 1205.0, 172.0, 1205.0]}, {\"text\": \"Bookmark\", \"boundingBox\": [276.0, 1179.0, 404.0, 1179.0, 404.0, 1205.0, 276.0, 1205.0]}]}, {\"text\": \"20\", \"boundingBox\": [863.0, 1177.0, 888.0, 1177.0, 888.0, 1199.0, 863.0, 1199.0], \"words\": [{\"text\": \"20\", \"boundingBox\": [863.0, 1177.0, 888.0, 1177.0, 888.0, 1199.0, 863.0, 1199.0]}]}, {\"text\": \"5.00\", \"boundingBox\": [1243.0, 1179.0, 1298.0, 1179.0, 1298.0, 1205.0, 1243.0, 1205.0], \"words\": [{\"text\": \"5.00\", \"boundingBox\": [1243.0, 1179.0, 1298.0, 1179.0, 1298.0, 1205.0, 1243.0, 1205.0]}]}, {\"text\": \"100.00\", \"boundingBox\": [1448.0, 1180.0, 1530.0, 1180.0, 1530.0, 1205.0, 1448.0, 1205.0], \"words\": [{\"text\": \"100.00\", \"boundingBox\": [1448.0, 1180.0, 1530.0, 1180.0, 1530.0, 1205.0, 1448.0, 1205.0]}]}, {\"text\": \"Copper Swirl Marker\", \"boundingBox\": [171.0, 1224.0, 426.0, 1224.0, 426.0, 1248.0, 171.0, 1248.0], \"words\": [{\"text\": \"Copper\", \"boundingBox\": [171.0, 1224.0, 265.0, 1224.0, 265.0, 1248.0, 171.0, 1248.0]}, {\"text\": \"Swirl\", \"boundingBox\": [270.0, 1224.0, 334.0, 1224.0, 334.0, 1248.0, 270.0, 1248.0]}, {\"text\": \"Marker\", \"boundingBox\": [339.0, 1224.0, 426.0, 1224.0, 426.0, 1248.0, 339.0, 1248.0]}]}, {\"text\": \"20\", \"boundingBox\": [864.0, 1221.0, 887.0, 1221.0, 887.0, 1244.0, 864.0, 1244.0], \"words\": [{\"text\": \"20\", \"boundingBox\": [864.0, 1221.0, 887.0, 1221.0, 887.0, 1244.0, 864.0, 1244.0]}]}, {\"text\": \"5.00\", \"boundingBox\": [1242.0, 1222.0, 1291.0, 1222.0, 1291.0, 1248.0, 1242.0, 1248.0], \"words\": [{\"text\": \"5.00\", \"boundingBox\": [1242.0, 1222.0, 1291.0, 1222.0, 1291.0, 1248.0, 1242.0, 1248.0]}]}, {\"text\": \"100.00\", \"boundingBox\": [1449.0, 1225.0, 1530.0, 1225.0, 1530.0, 1248.0, 1449.0, 1248.0], \"words\": [{\"text\": \"100.00\", \"boundingBox\": [1449.0, 1225.0, 1530.0, 1225.0, 1530.0, 1248.0, 1449.0, 1248.0]}]}, {\"text\": \"SUBTOTAL\", \"boundingBox\": [1156.0, 1571.0, 1298.0, 1571.0, 1298.0, 1599.0, 1156.0, 1599.0], \"words\": [{\"text\": \"SUBTOTAL\", \"boundingBox\": [1156.0, 1571.0, 1298.0, 1571.0, 1298.0, 1599.0, 1156.0, 1599.0]}]}, {\"text\": \"$140.00\", \"boundingBox\": [1434.0, 1574.0, 1530.0, 1574.0, 1530.0, 1599.0, 1434.0, 1599.0], \"words\": [{\"text\": \"$140.00\", \"boundingBox\": [1434.0, 1574.0, 1530.0, 1574.0, 1530.0, 1599.0, 1434.0, 1599.0]}]}, {\"text\": \"TAX\", \"boundingBox\": [1242.0, 1619.0, 1293.0, 1619.0, 1293.0, 1643.0, 1242.0, 1643.0], \"words\": [{\"text\": \"TAX\", \"boundingBox\": [1242.0, 1619.0, 1293.0, 1619.0, 1293.0, 1643.0, 1242.0, 1643.0]}]}, {\"text\": \"$4.00\", \"boundingBox\": [1462.0, 1615.0, 1532.0, 1615.0, 1532.0, 1640.0, 1462.0, 1640.0], \"words\": [{\"text\": \"$4.00\", \"boundingBox\": [1462.0, 1615.0, 1532.0, 1615.0, 1532.0, 1640.0, 1462.0, 1640.0]}]}, {\"text\": \"Bernie Sanders\", \"boundingBox\": [485.0, 1669.0, 766.0, 1669.0, 766.0, 1708.0, 485.0, 1708.0], \"words\": [{\"text\": \"Bernie\", \"boundingBox\": [485.0, 1669.0, 605.0, 1669.0, 605.0, 1708.0, 485.0, 1708.0]}, {\"text\": \"Sanders\", \"boundingBox\": [613.0, 1669.0, 766.0, 1669.0, 766.0, 1708.0, 613.0, 1708.0]}]}, {\"text\": \"TOTAL\", \"boundingBox\": [1206.0, 1674.0, 1298.0, 1674.0, 1298.0, 1700.0, 1206.0, 1700.0], \"words\": [{\"text\": \"TOTAL\", \"boundingBox\": [1206.0, 1674.0, 1298.0, 1674.0, 1298.0, 1700.0, 1206.0, 1700.0]}]}, {\"text\": \"$144.00\", \"boundingBox\": [1434.0, 1671.0, 1531.0, 1671.0, 1531.0, 1697.0, 1434.0, 1697.0], \"words\": [{\"text\": \"$144.00\", \"boundingBox\": [1434.0, 1671.0, 1531.0, 1671.0, 1531.0, 1697.0, 1434.0, 1697.0]}]}, {\"text\": \"Bernie Sanders\", \"boundingBox\": [544.0, 1717.0, 719.0, 1717.0, 719.0, 1743.0, 544.0, 1743.0], \"words\": [{\"text\": \"Bernie\", \"boundingBox\": [544.0, 1717.0, 622.0, 1717.0, 622.0, 1743.0, 544.0, 1743.0]}, {\"text\": \"Sanders\", \"boundingBox\": [627.0, 1717.0, 719.0, 1717.0, 719.0, 1743.0, 627.0, 1743.0]}]}, {\"text\": \"Manager\", \"boundingBox\": [579.0, 1752.0, 687.0, 1752.0, 687.0, 1777.0, 579.0, 1777.0], \"words\": [{\"text\": \"Manager\", \"boundingBox\": [579.0, 1752.0, 687.0, 1752.0, 687.0, 1777.0, 579.0, 1777.0]}]}, {\"text\": \"Additional Notes:\", \"boundingBox\": [175.0, 1797.0, 479.0, 1797.0, 479.0, 1834.0, 175.0, 1834.0], \"words\": [{\"text\": \"Additional\", \"boundingBox\": [175.0, 1797.0, 358.0, 1797.0, 358.0, 1834.0, 175.0, 1834.0]}, {\"text\": \"Notes:\", \"boundingBox\": [366.0, 1797.0, 479.0, 1797.0, 479.0, 1834.0, 366.0, 1834.0]}]}, {\"text\": \"Do not Jostle Box. Unpack carefully. Enjoy.\", \"boundingBox\": [176.0, 1880.0, 707.0, 1880.0, 707.0, 1910.0, 176.0, 1910.0], \"words\": [{\"text\": \"Do\", \"boundingBox\": [176.0, 1880.0, 208.0, 1880.0, 208.0, 1910.0, 176.0, 1910.0]}, {\"text\": \"not\", \"boundingBox\": [213.0, 1880.0, 258.0, 1880.0, 258.0, 1910.0, 213.0, 1910.0]}, {\"text\": \"Jostle\", \"boundingBox\": [264.0, 1880.0, 338.0, 1880.0, 338.0, 1910.0, 264.0, 1910.0]}, {\"text\": \"Box.\", \"boundingBox\": [343.0, 1880.0, 404.0, 1880.0, 404.0, 1910.0, 343.0, 1910.0]}, {\"text\": \"Unpack\", \"boundingBox\": [410.0, 1880.0, 503.0, 1880.0, 503.0, 1910.0, 410.0, 1910.0]}, {\"text\": \"carefully.\", \"boundingBox\": [509.0, 1880.0, 628.0, 1880.0, 628.0, 1910.0, 509.0, 1910.0]}, {\"text\": \"Enjoy.\", \"boundingBox\": [633.0, 1880.0, 707.0, 1880.0, 707.0, 1910.0, 633.0, 1910.0]}]}, {\"text\": \"Jupiter Book Supply will refund you 50% per book if returned within 60 days of reading and\", \"boundingBox\": [173.0, 1925.0, 1511.0, 1925.0, 1511.0, 1959.0, 173.0, 1959.0], \"words\": [{\"text\": \"Jupiter\", \"boundingBox\": [173.0, 1925.0, 274.0, 1925.0, 274.0, 1959.0, 173.0, 1959.0]}, {\"text\": \"Book\", \"boundingBox\": [280.0, 1925.0, 361.0, 1925.0, 361.0, 1959.0, 280.0, 1959.0]}, {\"text\": \"Supply\", \"boundingBox\": [367.0, 1925.0, 470.0, 1925.0, 470.0, 1959.0, 367.0, 1959.0]}, {\"text\": \"will\", \"boundingBox\": [477.0, 1925.0, 523.0, 1925.0, 523.0, 1959.0, 477.0, 1959.0]}, {\"text\": \"refund\", \"boundingBox\": [530.0, 1925.0, 628.0, 1925.0, 628.0, 1959.0, 530.0, 1959.0]}, {\"text\": \"you\", \"boundingBox\": [635.0, 1925.0, 693.0, 1925.0, 693.0, 1959.0, 635.0, 1959.0]}, {\"text\": \"50%\", \"boundingBox\": [699.0, 1925.0, 766.0, 1925.0, 766.0, 1959.0, 699.0, 1959.0]}, {\"text\": \"per\", \"boundingBox\": [773.0, 1925.0, 827.0, 1925.0, 827.0, 1959.0, 773.0, 1959.0]}, {\"text\": \"book\", \"boundingBox\": [833.0, 1925.0, 907.0, 1925.0, 907.0, 1959.0, 833.0, 1959.0]}, {\"text\": \"if\", \"boundingBox\": [913.0, 1925.0, 934.0, 1925.0, 934.0, 1959.0, 913.0, 1959.0]}, {\"text\": \"returned\", \"boundingBox\": [940.0, 1925.0, 1067.0, 1925.0, 1067.0, 1959.0, 940.0, 1959.0]}, {\"text\": \"within\", \"boundingBox\": [1074.0, 1925.0, 1161.0, 1925.0, 1161.0, 1959.0, 1074.0, 1959.0]}, {\"text\": \"60\", \"boundingBox\": [1168.0, 1925.0, 1210.0, 1925.0, 1210.0, 1959.0, 1168.0, 1959.0]}, {\"text\": \"days\", \"boundingBox\": [1219.0, 1925.0, 1288.0, 1925.0, 1288.0, 1959.0, 1219.0, 1959.0]}, {\"text\": \"of\", \"boundingBox\": [1295.0, 1925.0, 1324.0, 1925.0, 1324.0, 1959.0, 1295.0, 1959.0]}, {\"text\": \"reading\", \"boundingBox\": [1330.0, 1925.0, 1446.0, 1925.0, 1446.0, 1959.0, 1330.0, 1959.0]}, {\"text\": \"and\", \"boundingBox\": [1453.0, 1925.0, 1511.0, 1925.0, 1511.0, 1959.0, 1453.0, 1959.0]}]}, {\"text\": \"offer you 25% off you next total purchase.\", \"boundingBox\": [170.0, 1959.0, 782.0, 1959.0, 782.0, 1992.0, 170.0, 1992.0], \"words\": [{\"text\": \"offer\", \"boundingBox\": [170.0, 1959.0, 239.0, 1959.0, 239.0, 1992.0, 170.0, 1992.0]}, {\"text\": \"you\", \"boundingBox\": [246.0, 1959.0, 304.0, 1959.0, 304.0, 1992.0, 246.0, 1992.0]}, {\"text\": \"25%\", \"boundingBox\": [310.0, 1959.0, 379.0, 1959.0, 379.0, 1992.0, 310.0, 1992.0]}, {\"text\": \"off\", \"boundingBox\": [386.0, 1959.0, 425.0, 1959.0, 425.0, 1992.0, 386.0, 1992.0]}, {\"text\": \"you\", \"boundingBox\": [432.0, 1959.0, 490.0, 1959.0, 490.0, 1992.0, 432.0, 1992.0]}, {\"text\": \"next\", \"boundingBox\": [496.0, 1959.0, 561.0, 1959.0, 561.0, 1992.0, 496.0, 1992.0]}, {\"text\": \"total\", \"boundingBox\": [567.0, 1959.0, 634.0, 1959.0, 634.0, 1992.0, 567.0, 1992.0]}, {\"text\": \"purchase.\", \"boundingBox\": [641.0, 1959.0, 782.0, 1959.0, 782.0, 1992.0, 641.0, 1992.0]}]}]}], \"pageResults\": [{\"page\": 1, \"keyValuePairs\": [{\"key\": {\"text\": \"Hero Limited\", \"boundingBox\": [620.0, 203.0, 1078.0, 203.0, 1078.0, 271.0, 620.0, 271.0], \"elements\": [\"#/readResults/0/lines/1/words/0\", \"#/readResults/0/lines/1/words/1\"]}, \"value\": {\"text\": \"\", \"boundingBox\": null, \"elements\": null}, \"confidence\": 0.5}, {\"key\": {\"text\": \"Company Phone:\", \"boundingBox\": [167.0, 351.0, 365.0, 351.0, 365.0, 381.0, 167.0, 381.0], \"elements\": [\"#/readResults/0/lines/3/words/0\", \"#/readResults/0/lines/3/words/1\"]}, \"value\": {\"text\": \"555-348-6512\", \"boundingBox\": [371.0, 351.0, 528.0, 351.0, 528.0, 381.0, 371.0, 381.0], \"elements\": [\"#/readResults/0/lines/4/words/0\"]}, \"confidence\": 1.0}, {\"key\": {\"text\": \"Website:\", \"boundingBox\": [167.0, 392.0, 271.0, 392.0, 271.0, 420.0, 167.0, 420.0], \"elements\": [\"#/readResults/0/lines/5/words/0\"]}, \"value\": {\"text\": \"www.herolimited.com\", \"boundingBox\": [277.0, 392.0, 530.0, 392.0, 530.0, 420.0, 277.0, 420.0], \"elements\": [\"#/readResults/0/lines/6/words/0\"]}, \"confidence\": 1.0}, {\"key\": {\"text\": \"Dated As:\", \"boundingBox\": [1025.0, 418.0, 1161.0, 418.0, 1161.0, 451.0, 1025.0, 451.0], \"elements\": [\"#/readResults/0/lines/7/words/0\", \"#/readResults/0/lines/7/words/1\"]}, \"value\": {\"text\": \"12/20/2020\", \"boundingBox\": [1168.0, 418.0, 1319.0, 418.0, 1319.0, 451.0, 1168.0, 451.0], \"elements\": [\"#/readResults/0/lines/8/words/0\"]}, \"confidence\": 1.0}, {\"key\": {\"text\": \"Email:\", \"boundingBox\": [167.0, 431.0, 240.0, 431.0, 240.0, 458.0, 167.0, 458.0], \"elements\": [\"#/readResults/0/lines/9/words/0\"]}, \"value\": {\"text\": \"accounts@herolimited.com\", \"boundingBox\": [168.0, 480.0, 476.0, 480.0, 476.0, 505.0, 168.0, 505.0], \"elements\": [\"#/readResults/0/lines/12/words/0\"]}, \"confidence\": 1.0}, {\"key\": {\"text\": \"Purchase Order #:\", \"boundingBox\": [1027.0, 460.0, 1275.0, 460.0, 1275.0, 491.0, 1027.0, 491.0], \"elements\": [\"#/readResults/0/lines/10/words/0\", \"#/readResults/0/lines/10/words/1\", \"#/readResults/0/lines/10/words/2\"]}, \"value\": {\"text\": \"948284\", \"boundingBox\": [1282.0, 460.0, 1376.0, 460.0, 1376.0, 491.0, 1282.0, 491.0], \"elements\": [\"#/readResults/0/lines/11/words/0\"]}, \"confidence\": 1.0}, {\"key\": {\"text\": \"Vendor Name:\", \"boundingBox\": [162.0, 610.0, 346.0, 610.0, 346.0, 640.0, 162.0, 640.0], \"elements\": [\"#/readResults/0/lines/14/words/0\", \"#/readResults/0/lines/14/words/1\"]}, \"value\": {\"text\": \"Hillary Swank\", \"boundingBox\": [352.0, 610.0, 519.0, 610.0, 519.0, 640.0, 352.0, 640.0], \"elements\": [\"#/readResults/0/lines/15/words/0\", \"#/readResults/0/lines/15/words/1\"]}, \"confidence\": 0.7}, {\"key\": {\"text\": \"Company Name:\", \"boundingBox\": [162.0, 646.0, 373.0, 646.0, 373.0, 678.0, 162.0, 678.0], \"elements\": [\"#/readResults/0/lines/16/words/0\", \"#/readResults/0/lines/16/words/1\"]}, \"value\": {\"text\": \"Higgly Wiggly Books\", \"boundingBox\": [379.0, 646.0, 628.0, 646.0, 628.0, 678.0, 379.0, 678.0], \"elements\": [\"#/readResults/0/lines/17/words/0\", \"#/readResults/0/lines/17/words/1\", \"#/readResults/0/lines/17/words/2\"]}, \"confidence\": 1.0}, {\"key\": {\"text\": \"Address:\", \"boundingBox\": [162.0, 684.0, 272.0, 684.0, 272.0, 715.0, 162.0, 715.0], \"elements\": [\"#/readResults/0/lines/18/words/0\"]}, \"value\": {\"text\": \"938 NE Burner Road Boulder City, CO 92848\", \"boundingBox\": [279.0, 684.0, 569.0, 684.0, 569.0, 752.0, 279.0, 752.0], \"elements\": [\"#/readResults/0/lines/19/words/0\", \"#/readResults/0/lines/19/words/1\", \"#/readResults/0/lines/19/words/2\", \"#/readResults/0/lines/19/words/3\", \"#/readResults/0/lines/20/words/0\", \"#/readResults/0/lines/20/words/1\", \"#/readResults/0/lines/20/words/2\", \"#/readResults/0/lines/20/words/3\"]}, \"confidence\": 1.0}, {\"key\": {\"text\": \"Phone:\", \"boundingBox\": [615.0, 723.0, 707.0, 723.0, 707.0, 752.0, 615.0, 752.0], \"elements\": [\"#/readResults/0/lines/21/words/0\"]}, \"value\": {\"text\": \"938-294-2949\", \"boundingBox\": [713.0, 723.0, 884.0, 723.0, 884.0, 752.0, 713.0, 752.0], \"elements\": [\"#/readResults/0/lines/22/words/0\"]}, \"confidence\": 1.0}, {\"key\": {\"text\": \"Name:\", \"boundingBox\": [166.0, 852.0, 253.0, 852.0, 253.0, 881.0, 166.0, 881.0], \"elements\": [\"#/readResults/0/lines/24/words/0\"]}, \"value\": {\"text\": \"Bernie Sanders\", \"boundingBox\": [258.0, 852.0, 445.0, 852.0, 445.0, 881.0, 258.0, 881.0], \"elements\": [\"#/readResults/0/lines/25/words/0\", \"#/readResults/0/lines/25/words/1\"]}, \"confidence\": 0.53}, {\"key\": {\"text\": \"Company Name:\", \"boundingBox\": [169.0, 888.0, 378.0, 888.0, 378.0, 919.0, 169.0, 919.0], \"elements\": [\"#/readResults/0/lines/26/words/0\", \"#/readResults/0/lines/26/words/1\"]}, \"value\": {\"text\": \"Jupiter Book Supply\", \"boundingBox\": [385.0, 888.0, 624.0, 888.0, 624.0, 919.0, 385.0, 919.0], \"elements\": [\"#/readResults/0/lines/27/words/0\", \"#/readResults/0/lines/27/words/1\", \"#/readResults/0/lines/27/words/2\"]}, \"confidence\": 0.53}, {\"key\": {\"text\": \"Address:\", \"boundingBox\": [168.0, 924.0, 276.0, 924.0, 276.0, 954.0, 168.0, 954.0], \"elements\": [\"#/readResults/0/lines/28/words/0\"]}, \"value\": {\"text\": \"383 N Kinnick Road Seattle, WA 38383\", \"boundingBox\": [283.0, 924.0, 524.0, 924.0, 524.0, 992.0, 283.0, 992.0], \"elements\": [\"#/readResults/0/lines/29/words/0\", \"#/readResults/0/lines/29/words/1\", \"#/readResults/0/lines/29/words/2\", \"#/readResults/0/lines/29/words/3\", \"#/readResults/0/lines/30/words/0\", \"#/readResults/0/lines/30/words/1\", \"#/readResults/0/lines/30/words/2\"]}, \"confidence\": 1.0}, {\"key\": {\"text\": \"Phone:\", \"boundingBox\": [760.0, 964.0, 852.0, 964.0, 852.0, 992.0, 760.0, 992.0], \"elements\": [\"#/readResults/0/lines/31/words/0\"]}, \"value\": {\"text\": \"932-299-0292\", \"boundingBox\": [857.0, 964.0, 1032.0, 964.0, 1032.0, 992.0, 857.0, 992.0], \"elements\": [\"#/readResults/0/lines/32/words/0\"]}, \"confidence\": 1.0}, {\"key\": {\"text\": \"SUBTOTAL\", \"boundingBox\": [1156.0, 1571.0, 1298.0, 1571.0, 1298.0, 1599.0, 1156.0, 1599.0], \"elements\": [\"#/readResults/0/lines/53/words/0\"]}, \"value\": {\"text\": \"$140.00\", \"boundingBox\": [1434.0, 1574.0, 1530.0, 1574.0, 1530.0, 1599.0, 1434.0, 1599.0], \"elements\": [\"#/readResults/0/lines/54/words/0\"]}, \"confidence\": 1.0}, {\"key\": {\"text\": \"TAX\", \"boundingBox\": [1242.0, 1619.0, 1293.0, 1619.0, 1293.0, 1643.0, 1242.0, 1643.0], \"elements\": [\"#/readResults/0/lines/55/words/0\"]}, \"value\": {\"text\": \"$4.00\", \"boundingBox\": [1462.0, 1615.0, 1532.0, 1615.0, 1532.0, 1640.0, 1462.0, 1640.0], \"elements\": [\"#/readResults/0/lines/56/words/0\"]}, \"confidence\": 1.0}, {\"key\": {\"text\": \"TOTAL\", \"boundingBox\": [1206.0, 1674.0, 1298.0, 1674.0, 1298.0, 1700.0, 1206.0, 1700.0], \"elements\": [\"#/readResults/0/lines/58/words/0\"]}, \"value\": {\"text\": \"$144.00\", \"boundingBox\": [1434.0, 1671.0, 1531.0, 1671.0, 1531.0, 1697.0, 1434.0, 1697.0], \"elements\": [\"#/readResults/0/lines/59/words/0\"]}, \"confidence\": 1.0}, {\"key\": {\"text\": \"Additional Notes:\", \"boundingBox\": [175.0, 1797.0, 479.0, 1797.0, 479.0, 1834.0, 175.0, 1834.0], \"elements\": [\"#/readResults/0/lines/62/words/0\", \"#/readResults/0/lines/62/words/1\"]}, \"value\": {\"text\": \"Do not Jostle Box. Unpack carefully. Enjoy. Jupiter Book Supply will refund you 50% per book if returned within 60 days of reading and offer you 25% off you next total purchase.\", \"boundingBox\": [170.0, 1880.0, 1511.0, 1880.0, 1511.0, 1992.0, 170.0, 1992.0], \"elements\": [\"#/readResults/0/lines/63/words/0\", \"#/readResults/0/lines/63/words/1\", \"#/readResults/0/lines/63/words/2\", \"#/readResults/0/lines/63/words/3\", \"#/readResults/0/lines/63/words/4\", \"#/readResults/0/lines/63/words/5\", \"#/readResults/0/lines/63/words/6\", \"#/readResults/0/lines/64/words/0\", \"#/readResults/0/lines/64/words/1\", \"#/readResults/0/lines/64/words/2\", \"#/readResults/0/lines/64/words/3\", \"#/readResults/0/lines/64/words/4\", \"#/readResults/0/lines/64/words/5\", \"#/readResults/0/lines/64/words/6\", \"#/readResults/0/lines/64/words/7\", \"#/readResults/0/lines/64/words/8\", \"#/readResults/0/lines/64/words/9\", \"#/readResults/0/lines/64/words/10\", \"#/readResults/0/lines/64/words/11\", \"#/readResults/0/lines/64/words/12\", \"#/readResults/0/lines/64/words/13\", \"#/readResults/0/lines/64/words/14\", \"#/readResults/0/lines/64/words/15\", \"#/readResults/0/lines/64/words/16\", \"#/readResults/0/lines/65/words/0\", \"#/readResults/0/lines/65/words/1\", \"#/readResults/0/lines/65/words/2\", \"#/readResults/0/lines/65/words/3\", \"#/readResults/0/lines/65/words/4\", \"#/readResults/0/lines/65/words/5\", \"#/readResults/0/lines/65/words/6\", \"#/readResults/0/lines/65/words/7\"]}, \"confidence\": 0.53}, {\"key\": {\"text\": \"__Tokens__1\", \"boundingBox\": null, \"elements\": null}, \"value\": {\"text\": \"Purchase Order\", \"boundingBox\": [141.0, 140.0, 348.0, 140.0, 348.0, 168.0, 141.0, 168.0], \"elements\": [\"#/readResults/0/lines/0/words/0\", \"#/readResults/0/lines/0/words/1\"]}, \"confidence\": 1.0}, {\"key\": {\"text\": \"__Tokens__2\", \"boundingBox\": null, \"elements\": null}, \"value\": {\"text\": \"Purchase Order\", \"boundingBox\": [1117.0, 319.0, 1551.0, 319.0, 1551.0, 372.0, 1117.0, 372.0], \"elements\": [\"#/readResults/0/lines/2/words/0\", \"#/readResults/0/lines/2/words/1\"]}, \"confidence\": 1.0}, {\"key\": {\"text\": \"__Tokens__3\", \"boundingBox\": null, \"elements\": null}, \"value\": {\"text\": \"Shipped To\", \"boundingBox\": [170.0, 546.0, 398.0, 546.0, 398.0, 592.0, 170.0, 592.0], \"elements\": [\"#/readResults/0/lines/13/words/0\", \"#/readResults/0/lines/13/words/1\"]}, \"confidence\": 1.0}, {\"key\": {\"text\": \"__Tokens__4\", \"boundingBox\": null, \"elements\": null}, \"value\": {\"text\": \"Shipped From\", \"boundingBox\": [169.0, 784.0, 445.0, 784.0, 445.0, 831.0, 169.0, 831.0], \"elements\": [\"#/readResults/0/lines/23/words/0\", \"#/readResults/0/lines/23/words/1\"]}, \"confidence\": 1.0}, {\"key\": {\"text\": \"__Tokens__5\", \"boundingBox\": null, \"elements\": null}, \"value\": {\"text\": \"Bernie Sanders\", \"boundingBox\": [485.0, 1669.0, 766.0, 1669.0, 766.0, 1708.0, 485.0, 1708.0], \"elements\": [\"#/readResults/0/lines/57/words/0\", \"#/readResults/0/lines/57/words/1\"]}, \"confidence\": 1.0}, {\"key\": {\"text\": \"__Tokens__6\", \"boundingBox\": null, \"elements\": null}, \"value\": {\"text\": \"Bernie Sanders\", \"boundingBox\": [544.0, 1717.0, 719.0, 1717.0, 719.0, 1743.0, 544.0, 1743.0], \"elements\": [\"#/readResults/0/lines/60/words/0\", \"#/readResults/0/lines/60/words/1\"]}, \"confidence\": 1.0}, {\"key\": {\"text\": \"__Tokens__7\", \"boundingBox\": null, \"elements\": null}, \"value\": {\"text\": \"Manager\", \"boundingBox\": [579.0, 1752.0, 687.0, 1752.0, 687.0, 1777.0, 579.0, 1777.0], \"elements\": [\"#/readResults/0/lines/61/words/0\"]}, \"confidence\": 1.0}], \"tables\": [{\"rows\": 5, \"columns\": 4, \"cells\": [{\"text\": \"Details\", \"rowIndex\": 0, \"columnIndex\": 0, \"boundingBox\": [447.0, 1047.0, 551.0, 1047.0, 551.0, 1080.0, 447.0, 1080.0], \"confidence\": 1.0, \"rowSpan\": 1, \"columnSpan\": 1, \"elements\": [\"#/readResults/0/lines/33/words/0\"], \"isHeader\": true, \"isFooter\": false}, {\"text\": \"Quantity\", \"rowIndex\": 0, \"columnIndex\": 1, \"boundingBox\": [890.0, 1048.0, 1028.0, 1048.0, 1028.0, 1080.0, 890.0, 1080.0], \"confidence\": 1.0, \"rowSpan\": 1, \"columnSpan\": 1, \"elements\": [\"#/readResults/0/lines/34/words/0\"], \"isHeader\": true, \"isFooter\": false}, {\"text\": \"Unit Price\", \"rowIndex\": 0, \"columnIndex\": 2, \"boundingBox\": [1113.0, 1045.0, 1267.0, 1045.0, 1267.0, 1080.0, 1113.0, 1080.0], \"confidence\": 1.0, \"rowSpan\": 1, \"columnSpan\": 1, \"elements\": [\"#/readResults/0/lines/35/words/0\", \"#/readResults/0/lines/35/words/1\"], \"isHeader\": true, \"isFooter\": false}, {\"text\": \"Total\", \"rowIndex\": 0, \"columnIndex\": 3, \"boundingBox\": [1389.0, 1046.0, 1466.0, 1046.0, 1466.0, 1080.0, 1389.0, 1080.0], \"confidence\": 1.0, \"rowSpan\": 1, \"columnSpan\": 1, \"elements\": [\"#/readResults/0/lines/36/words/0\"], \"isHeader\": true, \"isFooter\": false}, {\"text\": \"Bindings\", \"rowIndex\": 1, \"columnIndex\": 0, \"boundingBox\": [173.0, 1094.0, 282.0, 1094.0, 282.0, 1122.0, 173.0, 1122.0], \"confidence\": 1.0, \"rowSpan\": 1, \"columnSpan\": 1, \"elements\": [\"#/readResults/0/lines/37/words/0\"], \"isHeader\": false, \"isFooter\": false}, {\"text\": \"20\", \"rowIndex\": 1, \"columnIndex\": 1, \"boundingBox\": [863.0, 1098.0, 889.0, 1098.0, 889.0, 1122.0, 863.0, 1122.0], \"confidence\": 1.0, \"rowSpan\": 1, \"columnSpan\": 1, \"elements\": [\"#/readResults/0/lines/38/words/0\"], \"isHeader\": false, \"isFooter\": false}, {\"text\": \"1.00\", \"rowIndex\": 1, \"columnIndex\": 2, \"boundingBox\": [1243.0, 1096.0, 1297.0, 1096.0, 1297.0, 1122.0, 1243.0, 1122.0], \"confidence\": 1.0, \"rowSpan\": 1, \"columnSpan\": 1, \"elements\": [\"#/readResults/0/lines/39/words/0\"], \"isHeader\": false, \"isFooter\": false}, {\"text\": \"20.00\", \"rowIndex\": 1, \"columnIndex\": 3, \"boundingBox\": [1466.0, 1098.0, 1531.0, 1098.0, 1531.0, 1122.0, 1466.0, 1122.0], \"confidence\": 1.0, \"rowSpan\": 1, \"columnSpan\": 1, \"elements\": [\"#/readResults/0/lines/40/words/0\"], \"isHeader\": false, \"isFooter\": false}, {\"text\": \"Covers Small\", \"rowIndex\": 2, \"columnIndex\": 0, \"boundingBox\": [172.0, 1136.0, 331.0, 1136.0, 331.0, 1162.0, 172.0, 1162.0], \"confidence\": 1.0, \"rowSpan\": 1, \"columnSpan\": 1, \"elements\": [\"#/readResults/0/lines/41/words/0\", \"#/readResults/0/lines/41/words/1\"], \"isHeader\": false, \"isFooter\": false}, {\"text\": \"20\", \"rowIndex\": 2, \"columnIndex\": 1, \"boundingBox\": [862.0, 1137.0, 889.0, 1137.0, 889.0, 1162.0, 862.0, 1162.0], \"confidence\": 1.0, \"rowSpan\": 1, \"columnSpan\": 1, \"elements\": [\"#/readResults/0/lines/42/words/0\"], \"isHeader\": false, \"isFooter\": false}, {\"text\": \"1.00\", \"rowIndex\": 2, \"columnIndex\": 2, \"boundingBox\": [1243.0, 1134.0, 1292.0, 1134.0, 1292.0, 1162.0, 1243.0, 1162.0], \"confidence\": 1.0, \"rowSpan\": 1, \"columnSpan\": 1, \"elements\": [\"#/readResults/0/lines/43/words/0\"], \"isHeader\": false, \"isFooter\": false}, {\"text\": \"20.00\", \"rowIndex\": 2, \"columnIndex\": 3, \"boundingBox\": [1464.0, 1138.0, 1531.0, 1138.0, 1531.0, 1162.0, 1464.0, 1162.0], \"confidence\": 1.0, \"rowSpan\": 1, \"columnSpan\": 1, \"elements\": [\"#/readResults/0/lines/44/words/0\"], \"isHeader\": false, \"isFooter\": false}, {\"text\": \"Feather Bookmark\", \"rowIndex\": 3, \"columnIndex\": 0, \"boundingBox\": [172.0, 1179.0, 404.0, 1179.0, 404.0, 1205.0, 172.0, 1205.0], \"confidence\": 1.0, \"rowSpan\": 1, \"columnSpan\": 1, \"elements\": [\"#/readResults/0/lines/45/words/0\", \"#/readResults/0/lines/45/words/1\"], \"isHeader\": false, \"isFooter\": false}, {\"text\": \"20\", \"rowIndex\": 3, \"columnIndex\": 1, \"boundingBox\": [863.0, 1177.0, 888.0, 1177.0, 888.0, 1199.0, 863.0, 1199.0], \"confidence\": 1.0, \"rowSpan\": 1, \"columnSpan\": 1, \"elements\": [\"#/readResults/0/lines/46/words/0\"], \"isHeader\": false, \"isFooter\": false}, {\"text\": \"5.00\", \"rowIndex\": 3, \"columnIndex\": 2, \"boundingBox\": [1243.0, 1179.0, 1298.0, 1179.0, 1298.0, 1205.0, 1243.0, 1205.0], \"confidence\": 1.0, \"rowSpan\": 1, \"columnSpan\": 1, \"elements\": [\"#/readResults/0/lines/47/words/0\"], \"isHeader\": false, \"isFooter\": false}, {\"text\": \"100.00\", \"rowIndex\": 3, \"columnIndex\": 3, \"boundingBox\": [1448.0, 1180.0, 1530.0, 1180.0, 1530.0, 1205.0, 1448.0, 1205.0], \"confidence\": 1.0, \"rowSpan\": 1, \"columnSpan\": 1, \"elements\": [\"#/readResults/0/lines/48/words/0\"], \"isHeader\": false, \"isFooter\": false}, {\"text\": \"Copper Swirl Marker\", \"rowIndex\": 4, \"columnIndex\": 0, \"boundingBox\": [171.0, 1224.0, 426.0, 1224.0, 426.0, 1248.0, 171.0, 1248.0], \"confidence\": 1.0, \"rowSpan\": 1, \"columnSpan\": 1, \"elements\": [\"#/readResults/0/lines/49/words/0\", \"#/readResults/0/lines/49/words/1\", \"#/readResults/0/lines/49/words/2\"], \"isHeader\": false, \"isFooter\": false}, {\"text\": \"20\", \"rowIndex\": 4, \"columnIndex\": 1, \"boundingBox\": [864.0, 1221.0, 887.0, 1221.0, 887.0, 1244.0, 864.0, 1244.0], \"confidence\": 1.0, \"rowSpan\": 1, \"columnSpan\": 1, \"elements\": [\"#/readResults/0/lines/50/words/0\"], \"isHeader\": false, \"isFooter\": false}, {\"text\": \"5.00\", \"rowIndex\": 4, \"columnIndex\": 2, \"boundingBox\": [1242.0, 1222.0, 1291.0, 1222.0, 1291.0, 1248.0, 1242.0, 1248.0], \"confidence\": 1.0, \"rowSpan\": 1, \"columnSpan\": 1, \"elements\": [\"#/readResults/0/lines/51/words/0\"], \"isHeader\": false, \"isFooter\": false}, {\"text\": \"100.00\", \"rowIndex\": 4, \"columnIndex\": 3, \"boundingBox\": [1449.0, 1225.0, 1530.0, 1225.0, 1530.0, 1248.0, 1449.0, 1248.0], \"confidence\": 1.0, \"rowSpan\": 1, \"columnSpan\": 1, \"elements\": [\"#/readResults/0/lines/52/words/0\"], \"isHeader\": false, \"isFooter\": false}]}], \"clusterId\": 0}], \"documentResults\": [], \"errors\": []}}", - "Date" : "Tue, 23 Jun 2020 00:38:52 GMT", - "Content-Type" : "application/json; charset=utf-8" - }, - "Exception" : null - } ], - "variables" : [ ] -} \ No newline at end of file diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/src/test/resources/session-records/recognizeReceiptDataTextDetails.json b/sdk/formrecognizer/azure-ai-formrecognizer/src/test/resources/session-records/recognizeReceiptDataIncludeFieldElements.json similarity index 100% rename from sdk/formrecognizer/azure-ai-formrecognizer/src/test/resources/session-records/recognizeReceiptDataTextDetails.json rename to sdk/formrecognizer/azure-ai-formrecognizer/src/test/resources/session-records/recognizeReceiptDataIncludeFieldElements.json diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/src/test/resources/session-records/recognizeReceiptFromUrlTextContent.json b/sdk/formrecognizer/azure-ai-formrecognizer/src/test/resources/session-records/recognizeReceiptFromUrlIncludeFieldElements.json similarity index 100% rename from sdk/formrecognizer/azure-ai-formrecognizer/src/test/resources/session-records/recognizeReceiptFromUrlTextContent.json rename to sdk/formrecognizer/azure-ai-formrecognizer/src/test/resources/session-records/recognizeReceiptFromUrlIncludeFieldElements.json From 7a45a5fe0d38d25a13c7f5fcdf8f003329c90c4a Mon Sep 17 00:00:00 2001 From: Azure SDK Bot <53356347+azure-sdk@users.noreply.github.com> Date: Thu, 2 Jul 2020 16:41:22 -0700 Subject: [PATCH 006/129] Increment version for core releases (#12785) * Increment package version after release of com.azure azure-core * Increment package version after release of com.azure azure-core-amqp * Increment package version after release of com.azure azure-core-http-okhttp * Increment package version after release of com.azure azure-core-http-netty * Increment package version after release of com.azure azure-core-test * Increment package version after release of com.azure azure-core-experimental * Remove unreleased tags Co-authored-by: alzimmermsft <48699787+alzimmermsft@users.noreply.github.com> --- common/perf-test-core/pom.xml | 2 +- eng/jacoco-test-coverage/pom.xml | 10 +++++----- eng/versioning/version_client.txt | 16 ++++++---------- .../azure-data-appconfiguration/pom.xml | 8 ++++---- sdk/core/azure-core-amqp/CHANGELOG.md | 3 +++ sdk/core/azure-core-amqp/pom.xml | 4 ++-- sdk/core/azure-core-experimental/CHANGELOG.md | 3 +++ sdk/core/azure-core-experimental/pom.xml | 4 ++-- sdk/core/azure-core-http-jdk-httpclient/pom.xml | 8 ++++---- sdk/core/azure-core-http-netty/CHANGELOG.md | 3 +++ sdk/core/azure-core-http-netty/pom.xml | 10 +++++----- sdk/core/azure-core-http-okhttp/CHANGELOG.md | 3 +++ sdk/core/azure-core-http-okhttp/pom.xml | 10 +++++----- sdk/core/azure-core-management/pom.xml | 6 +++--- .../azure-core-serializer-avro-apache/pom.xml | 4 ++-- .../azure-core-serializer-avro-jackson/pom.xml | 4 ++-- sdk/core/azure-core-serializer-json-gson/pom.xml | 4 ++-- .../azure-core-serializer-json-jackson/pom.xml | 4 ++-- sdk/core/azure-core-test/CHANGELOG.md | 3 +++ sdk/core/azure-core-test/pom.xml | 4 ++-- .../azure-core-tracing-opentelemetry/pom.xml | 4 ++-- sdk/core/azure-core/CHANGELOG.md | 3 +++ sdk/core/azure-core/pom.xml | 2 +- sdk/cosmos/azure-cosmos/pom.xml | 2 +- sdk/e2e/pom.xml | 6 +++--- sdk/eventhubs/azure-messaging-eventhubs/pom.xml | 6 +++--- .../azure-ai-formrecognizer/pom.xml | 8 ++++---- sdk/identity/azure-identity/pom.xml | 4 ++-- .../azure-security-keyvault-certificates/pom.xml | 8 ++++---- .../azure-security-keyvault-keys/pom.xml | 8 ++++---- .../azure-security-keyvault-secrets/pom.xml | 8 ++++---- .../microsoft-azure-loganalytics/pom.xml | 2 +- .../azure-data-schemaregistry/pom.xml | 4 ++-- sdk/search/azure-search-documents/pom.xml | 6 +++--- .../azure-messaging-servicebus/pom.xml | 10 +++++----- sdk/storage/azure-storage-blob-batch/pom.xml | 6 +++--- .../azure-storage-blob-changefeed/pom.xml | 6 +++--- .../azure-storage-blob-cryptography/pom.xml | 6 +++--- sdk/storage/azure-storage-blob-nio/pom.xml | 2 +- sdk/storage/azure-storage-blob/pom.xml | 6 +++--- sdk/storage/azure-storage-common/pom.xml | 6 +++--- sdk/storage/azure-storage-file-datalake/pom.xml | 4 ++-- sdk/storage/azure-storage-file-share/pom.xml | 4 ++-- sdk/storage/azure-storage-queue/pom.xml | 6 +++--- sdk/tables/azure-data-tables/pom.xml | 2 +- sdk/template/azure-sdk-template/pom.xml | 2 +- sdk/textanalytics/azure-ai-textanalytics/pom.xml | 8 ++++---- 47 files changed, 133 insertions(+), 119 deletions(-) diff --git a/common/perf-test-core/pom.xml b/common/perf-test-core/pom.xml index 381f9e0256e4f..6bf95f3b11408 100644 --- a/common/perf-test-core/pom.xml +++ b/common/perf-test-core/pom.xml @@ -78,7 +78,7 @@ com.azure azure-core-http-netty - 1.5.2 + 1.5.3 diff --git a/eng/jacoco-test-coverage/pom.xml b/eng/jacoco-test-coverage/pom.xml index edc34637ff9e4..b809161b44bf7 100644 --- a/eng/jacoco-test-coverage/pom.xml +++ b/eng/jacoco-test-coverage/pom.xml @@ -49,17 +49,17 @@ com.azure azure-core - 1.6.0 + 1.7.0-beta.1 com.azure azure-core-amqp - 1.3.0 + 1.4.0-beta.1 com.azure azure-core-experimental - 1.0.0-beta.1 + 1.0.0-beta.2 com.azure @@ -69,12 +69,12 @@ com.azure azure-core-http-netty - 1.5.3 + 1.6.0-beta.1 com.azure azure-core-http-okhttp - 1.2.4 + 1.3.0-beta.1 com.azure diff --git a/eng/versioning/version_client.txt b/eng/versioning/version_client.txt index 26dbd8065682a..aee302830657f 100644 --- a/eng/versioning/version_client.txt +++ b/eng/versioning/version_client.txt @@ -6,18 +6,18 @@ com.azure:azure-sdk-parent;1.6.0;1.6.0 com.azure:azure-client-sdk-parent;1.7.0;1.7.0 com.azure:azure-ai-formrecognizer;1.0.0-beta.3;1.0.0-beta.4 com.azure:azure-ai-textanalytics;1.0.0;1.1.0-beta.1 -com.azure:azure-core;1.5.1;1.6.0 -com.azure:azure-core-amqp;1.2.0;1.3.0 -com.azure:azure-core-experimental;1.0.0-beta.1;1.0.0-beta.1 +com.azure:azure-core;1.6.0;1.7.0-beta.1 +com.azure:azure-core-amqp;1.3.0;1.4.0-beta.1 +com.azure:azure-core-experimental;1.0.0-beta.1;1.0.0-beta.2 com.azure:azure-core-http-jdk-httpclient;1.0.0-beta.1;1.0.0-beta.1 -com.azure:azure-core-http-netty;1.5.2;1.5.3 -com.azure:azure-core-http-okhttp;1.2.3;1.2.4 +com.azure:azure-core-http-netty;1.5.3;1.6.0-beta.1 +com.azure:azure-core-http-okhttp;1.2.4;1.3.0-beta.1 com.azure:azure-core-management;1.0.0-beta.1;1.0.0-beta.2 com.azure:azure-core-serializer-avro-apache;1.0.0-beta.1;1.0.0-beta.1 com.azure:azure-core-serializer-avro-jackson;1.0.0-beta.1;1.0.0-beta.1 com.azure:azure-core-serializer-json-gson;1.0.0-beta.1;1.0.0-beta.2 com.azure:azure-core-serializer-json-jackson;1.0.0-beta.1;1.0.0-beta.2 -com.azure:azure-core-test;1.3.0;1.3.1 +com.azure:azure-core-test;1.3.1;1.4.0-beta.1 com.azure:azure-core-tracing-opentelemetry;1.0.0-beta.5;1.0.0-beta.6 com.azure:azure-cosmos;4.1.0;4.2.0-beta.1 com.azure:azure-cosmos-benchmark;4.0.1-beta.1;4.0.1-beta.1 @@ -68,10 +68,6 @@ com.microsoft.azure:spring-data-cosmosdb;2.3.0;2.3.1-beta.1 # unreleased_:;dependency-version # note: The unreleased dependencies will not be manipulated with the automatic PR creation code. -unreleased_com.azure:azure-core-amqp;1.3.0 -unreleased_com.azure:azure-core;1.6.0 -unreleased_com.azure:azure-core-test;1.3.1 -unreleased_com.azure:azure-core-http-netty;1.5.3 unreleased_com.azure:azure-messaging-servicebus;7.0.0-beta.4 # Released Beta dependencies: Copy the entry from above, prepend "beta_", remove the current diff --git a/sdk/appconfiguration/azure-data-appconfiguration/pom.xml b/sdk/appconfiguration/azure-data-appconfiguration/pom.xml index 4b2de23d5c20e..be05c61b3990a 100644 --- a/sdk/appconfiguration/azure-data-appconfiguration/pom.xml +++ b/sdk/appconfiguration/azure-data-appconfiguration/pom.xml @@ -36,25 +36,25 @@ com.azure azure-core - 1.5.1 + 1.6.0 com.azure azure-core-http-netty - 1.5.2 + 1.5.3 com.azure azure-core-test - 1.3.0 + 1.3.1 test com.azure azure-core-http-okhttp - 1.2.3 + 1.2.4 test diff --git a/sdk/core/azure-core-amqp/CHANGELOG.md b/sdk/core/azure-core-amqp/CHANGELOG.md index 63df0f8515f8e..b0587674855ad 100644 --- a/sdk/core/azure-core-amqp/CHANGELOG.md +++ b/sdk/core/azure-core-amqp/CHANGELOG.md @@ -1,5 +1,8 @@ # Release History +## 1.4.0-beta.1 (Unreleased) + + ## 1.3.0 (2020-07-02) - Added `createProducer` constructor which takes an additional parameter for link properties. diff --git a/sdk/core/azure-core-amqp/pom.xml b/sdk/core/azure-core-amqp/pom.xml index ea2103f5afdc8..a9161b7cdca29 100644 --- a/sdk/core/azure-core-amqp/pom.xml +++ b/sdk/core/azure-core-amqp/pom.xml @@ -14,7 +14,7 @@ com.azure azure-core-amqp - 1.3.0 + 1.4.0-beta.1 jar Microsoft Azure Java Core AMQP Library @@ -58,7 +58,7 @@ com.azure azure-core - 1.6.0 + 1.7.0-beta.1 com.microsoft.azure diff --git a/sdk/core/azure-core-experimental/CHANGELOG.md b/sdk/core/azure-core-experimental/CHANGELOG.md index f2fddf6c2c76a..5dffa739055a8 100644 --- a/sdk/core/azure-core-experimental/CHANGELOG.md +++ b/sdk/core/azure-core-experimental/CHANGELOG.md @@ -1,5 +1,8 @@ # Release History +## 1.0.0-beta.2 (Unreleased) + + ## 1.0.0-beta.1 (2020-07-02) - Added `ObjectSerializer` interface containing generic serializer APIs. diff --git a/sdk/core/azure-core-experimental/pom.xml b/sdk/core/azure-core-experimental/pom.xml index d8777487b9def..5f4a23951b9c7 100644 --- a/sdk/core/azure-core-experimental/pom.xml +++ b/sdk/core/azure-core-experimental/pom.xml @@ -15,7 +15,7 @@ com.azure azure-core-experimental jar - 1.0.0-beta.1 + 1.0.0-beta.2 Microsoft Azure Java Core Experimental Library This package contains experimental core types for Azure Java clients. @@ -58,7 +58,7 @@ com.azure azure-core - 1.6.0 + 1.7.0-beta.1 diff --git a/sdk/core/azure-core-http-jdk-httpclient/pom.xml b/sdk/core/azure-core-http-jdk-httpclient/pom.xml index 83cc3e9933926..e57873d883858 100644 --- a/sdk/core/azure-core-http-jdk-httpclient/pom.xml +++ b/sdk/core/azure-core-http-jdk-httpclient/pom.xml @@ -62,27 +62,27 @@ com.azure azure-core - 1.6.0 + 1.7.0-beta.1 com.azure azure-core - 1.6.0 + 1.7.0-beta.1 test-jar test com.azure azure-core-test - 1.3.1 + 1.4.0-beta.1 test com.azure azure-core-test - 1.3.1 + 1.4.0-beta.1 test-jar test diff --git a/sdk/core/azure-core-http-netty/CHANGELOG.md b/sdk/core/azure-core-http-netty/CHANGELOG.md index c3b7b0d7978b9..6d7fe3637c5bf 100644 --- a/sdk/core/azure-core-http-netty/CHANGELOG.md +++ b/sdk/core/azure-core-http-netty/CHANGELOG.md @@ -1,5 +1,8 @@ # Release History +## 1.6.0-beta.1 (Unreleased) + + ## 1.5.3 (2020-07-02) - Updated Azure Core dependency. diff --git a/sdk/core/azure-core-http-netty/pom.xml b/sdk/core/azure-core-http-netty/pom.xml index ade6ed8ac4981..1f42d05153771 100644 --- a/sdk/core/azure-core-http-netty/pom.xml +++ b/sdk/core/azure-core-http-netty/pom.xml @@ -15,7 +15,7 @@ com.azure azure-core-http-netty jar - 1.5.3 + 1.6.0-beta.1 Microsoft Azure Netty HTTP Client Library This package contains the Netty HTTP client plugin for azure-core. @@ -60,7 +60,7 @@ com.azure azure-core - 1.6.0 + 1.7.0-beta.1 @@ -117,20 +117,20 @@ com.azure azure-core - 1.6.0 + 1.7.0-beta.1 test-jar test com.azure azure-core-test - 1.3.1 + 1.4.0-beta.1 test com.azure azure-core-test - 1.3.1 + 1.4.0-beta.1 test-jar test diff --git a/sdk/core/azure-core-http-okhttp/CHANGELOG.md b/sdk/core/azure-core-http-okhttp/CHANGELOG.md index fe7089a1cc09c..5c94eac7bb96c 100644 --- a/sdk/core/azure-core-http-okhttp/CHANGELOG.md +++ b/sdk/core/azure-core-http-okhttp/CHANGELOG.md @@ -1,5 +1,8 @@ # Release History +## 1.3.0-beta.1 (Unreleased) + + ## 1.2.4 (2020-07-02) - Updated Azure Core dependency. diff --git a/sdk/core/azure-core-http-okhttp/pom.xml b/sdk/core/azure-core-http-okhttp/pom.xml index b16d739309bbe..d4abbfc69a89b 100644 --- a/sdk/core/azure-core-http-okhttp/pom.xml +++ b/sdk/core/azure-core-http-okhttp/pom.xml @@ -15,7 +15,7 @@ com.azure azure-core-http-okhttp jar - 1.2.4 + 1.3.0-beta.1 Microsoft Azure OkHttp HTTP Client Library This package contains the OkHttp HTTP client plugin for azure-core. @@ -60,7 +60,7 @@ com.azure azure-core - 1.6.0 + 1.7.0-beta.1 @@ -73,20 +73,20 @@ com.azure azure-core - 1.6.0 + 1.7.0-beta.1 test-jar test com.azure azure-core-test - 1.3.1 + 1.4.0-beta.1 test com.azure azure-core-test - 1.3.1 + 1.4.0-beta.1 test-jar test diff --git a/sdk/core/azure-core-management/pom.xml b/sdk/core/azure-core-management/pom.xml index b86d193ad736e..d289d4e28b1c1 100644 --- a/sdk/core/azure-core-management/pom.xml +++ b/sdk/core/azure-core-management/pom.xml @@ -59,7 +59,7 @@ com.azure azure-core - 1.6.0 + 1.7.0-beta.1 @@ -78,13 +78,13 @@ com.azure azure-core-test - 1.3.1 + 1.4.0-beta.1 test com.azure azure-core-http-netty - 1.5.3 + 1.6.0-beta.1 test diff --git a/sdk/core/azure-core-serializer-avro-apache/pom.xml b/sdk/core/azure-core-serializer-avro-apache/pom.xml index cc842249127aa..a5b115a6b4105 100644 --- a/sdk/core/azure-core-serializer-avro-apache/pom.xml +++ b/sdk/core/azure-core-serializer-avro-apache/pom.xml @@ -58,12 +58,12 @@ com.azure azure-core - 1.6.0 + 1.7.0-beta.1 com.azure azure-core-experimental - 1.0.0-beta.1 + 1.0.0-beta.2 diff --git a/sdk/core/azure-core-serializer-avro-jackson/pom.xml b/sdk/core/azure-core-serializer-avro-jackson/pom.xml index 9265ae68bc016..5c41d67aa0df9 100644 --- a/sdk/core/azure-core-serializer-avro-jackson/pom.xml +++ b/sdk/core/azure-core-serializer-avro-jackson/pom.xml @@ -58,12 +58,12 @@ com.azure azure-core - 1.6.0 + 1.7.0-beta.1 com.azure azure-core-experimental - 1.0.0-beta.1 + 1.0.0-beta.2 diff --git a/sdk/core/azure-core-serializer-json-gson/pom.xml b/sdk/core/azure-core-serializer-json-gson/pom.xml index 509ee42ff79ac..ec9d869d0b215 100644 --- a/sdk/core/azure-core-serializer-json-gson/pom.xml +++ b/sdk/core/azure-core-serializer-json-gson/pom.xml @@ -58,12 +58,12 @@ com.azure azure-core - 1.6.0 + 1.7.0-beta.1 com.azure azure-core-experimental - 1.0.0-beta.1 + 1.0.0-beta.2 diff --git a/sdk/core/azure-core-serializer-json-jackson/pom.xml b/sdk/core/azure-core-serializer-json-jackson/pom.xml index 42c6491fb50b6..137d27d00b1e5 100644 --- a/sdk/core/azure-core-serializer-json-jackson/pom.xml +++ b/sdk/core/azure-core-serializer-json-jackson/pom.xml @@ -58,12 +58,12 @@ com.azure azure-core - 1.6.0 + 1.7.0-beta.1 com.azure azure-core-experimental - 1.0.0-beta.1 + 1.0.0-beta.2 diff --git a/sdk/core/azure-core-test/CHANGELOG.md b/sdk/core/azure-core-test/CHANGELOG.md index 6ba372642e8fa..dbcec7c118158 100644 --- a/sdk/core/azure-core-test/CHANGELOG.md +++ b/sdk/core/azure-core-test/CHANGELOG.md @@ -1,5 +1,8 @@ # Release History +## 1.4.0-beta.1 (Unreleased) + + ## 1.3.1 (2020-07-02) - Updated Azure Core dependency. diff --git a/sdk/core/azure-core-test/pom.xml b/sdk/core/azure-core-test/pom.xml index 6314b68a4d93a..cdb3b25016ec1 100644 --- a/sdk/core/azure-core-test/pom.xml +++ b/sdk/core/azure-core-test/pom.xml @@ -13,7 +13,7 @@ com.azure azure-core-test jar - 1.3.1 + 1.4.0-beta.1 Microsoft Azure Java Core Test Library This package contains core test types for Azure Java clients. @@ -37,7 +37,7 @@ com.azure azure-core - 1.6.0 + 1.7.0-beta.1 diff --git a/sdk/core/azure-core-tracing-opentelemetry/pom.xml b/sdk/core/azure-core-tracing-opentelemetry/pom.xml index f210101f9fd29..3453676b9731a 100644 --- a/sdk/core/azure-core-tracing-opentelemetry/pom.xml +++ b/sdk/core/azure-core-tracing-opentelemetry/pom.xml @@ -40,7 +40,7 @@ com.azure azure-core - 1.6.0 + 1.7.0-beta.1 @@ -53,7 +53,7 @@ com.azure azure-core-http-netty - 1.5.3 + 1.6.0-beta.1 test diff --git a/sdk/core/azure-core/CHANGELOG.md b/sdk/core/azure-core/CHANGELOG.md index 2bdfb9af5a484..c3a2c734ee587 100644 --- a/sdk/core/azure-core/CHANGELOG.md +++ b/sdk/core/azure-core/CHANGELOG.md @@ -1,5 +1,8 @@ # Release History +## 1.7.0-beta.1 (Unreleased) + + ## 1.6.0 (2020-07-02) - Added utility class `UserAgentUtil` which constructs `User-Agent` headers following SDK guidelines. diff --git a/sdk/core/azure-core/pom.xml b/sdk/core/azure-core/pom.xml index 581c05d1345e2..258109d8751ad 100644 --- a/sdk/core/azure-core/pom.xml +++ b/sdk/core/azure-core/pom.xml @@ -15,7 +15,7 @@ com.azure azure-core jar - 1.6.0 + 1.7.0-beta.1 Microsoft Azure Java Core Library This package contains core types for Azure Java clients. diff --git a/sdk/cosmos/azure-cosmos/pom.xml b/sdk/cosmos/azure-cosmos/pom.xml index 5de9acfa30a04..049bb9b7fab02 100644 --- a/sdk/cosmos/azure-cosmos/pom.xml +++ b/sdk/cosmos/azure-cosmos/pom.xml @@ -120,7 +120,7 @@ Licensed under the MIT License. com.azure azure-core - 1.5.1 + 1.6.0 io.netty diff --git a/sdk/e2e/pom.xml b/sdk/e2e/pom.xml index 07a6378717886..9a6e3aaaf8966 100644 --- a/sdk/e2e/pom.xml +++ b/sdk/e2e/pom.xml @@ -23,12 +23,12 @@ com.azure azure-core - 1.6.0 + 1.7.0-beta.1 com.azure azure-core-http-netty - 1.5.3 + 1.6.0-beta.1 com.azure @@ -59,7 +59,7 @@ com.azure azure-core-test - 1.3.1 + 1.4.0-beta.1 test diff --git a/sdk/eventhubs/azure-messaging-eventhubs/pom.xml b/sdk/eventhubs/azure-messaging-eventhubs/pom.xml index 3cf3697fa5efe..c9200f744bac8 100644 --- a/sdk/eventhubs/azure-messaging-eventhubs/pom.xml +++ b/sdk/eventhubs/azure-messaging-eventhubs/pom.xml @@ -37,12 +37,12 @@ com.azure azure-core - 1.5.1 + 1.6.0 com.azure azure-core-amqp - 1.2.0 + 1.3.0 @@ -55,7 +55,7 @@ com.azure azure-core-test - 1.3.0 + 1.3.1 test diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/pom.xml b/sdk/formrecognizer/azure-ai-formrecognizer/pom.xml index 5f2d4fe2839b3..a6b6d4f43755d 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/pom.xml +++ b/sdk/formrecognizer/azure-ai-formrecognizer/pom.xml @@ -36,25 +36,25 @@ com.azure azure-core - 1.5.1 + 1.6.0 com.azure azure-core-http-netty - 1.5.2 + 1.5.3 com.azure azure-core-test - 1.3.0 + 1.3.1 test com.azure azure-core-http-okhttp - 1.2.3 + 1.2.4 test diff --git a/sdk/identity/azure-identity/pom.xml b/sdk/identity/azure-identity/pom.xml index 3525b441d2909..1ffe0f026ec9c 100644 --- a/sdk/identity/azure-identity/pom.xml +++ b/sdk/identity/azure-identity/pom.xml @@ -27,7 +27,7 @@ com.azure azure-core - 1.5.1 + 1.6.0 com.microsoft.azure @@ -88,7 +88,7 @@ com.azure azure-core-http-netty - 1.5.2 + 1.5.3 test diff --git a/sdk/keyvault/azure-security-keyvault-certificates/pom.xml b/sdk/keyvault/azure-security-keyvault-certificates/pom.xml index 5821ddd8263f1..91e062ccab1cd 100644 --- a/sdk/keyvault/azure-security-keyvault-certificates/pom.xml +++ b/sdk/keyvault/azure-security-keyvault-certificates/pom.xml @@ -36,13 +36,13 @@ com.azure azure-core - 1.5.1 + 1.6.0 com.azure azure-core-http-netty - 1.5.2 + 1.5.3 @@ -84,14 +84,14 @@ com.azure azure-core-test - 1.3.0 + 1.3.1 test com.azure azure-core-http-okhttp - 1.2.3 + 1.2.4 test diff --git a/sdk/keyvault/azure-security-keyvault-keys/pom.xml b/sdk/keyvault/azure-security-keyvault-keys/pom.xml index ae9477d8ba083..598fcabd84ef6 100644 --- a/sdk/keyvault/azure-security-keyvault-keys/pom.xml +++ b/sdk/keyvault/azure-security-keyvault-keys/pom.xml @@ -50,13 +50,13 @@ com.azure azure-core - 1.5.1 + 1.6.0 com.azure azure-core-http-netty - 1.5.2 + 1.5.3 @@ -93,13 +93,13 @@ com.azure azure-core-test - 1.3.0 + 1.3.1 test com.azure azure-core-http-okhttp - 1.2.3 + 1.2.4 test diff --git a/sdk/keyvault/azure-security-keyvault-secrets/pom.xml b/sdk/keyvault/azure-security-keyvault-secrets/pom.xml index c82768896ec83..7ae99e90d3b2e 100644 --- a/sdk/keyvault/azure-security-keyvault-secrets/pom.xml +++ b/sdk/keyvault/azure-security-keyvault-secrets/pom.xml @@ -47,20 +47,20 @@ com.azure azure-core - 1.5.1 + 1.6.0 com.azure azure-core-http-netty - 1.5.2 + 1.5.3 com.azure azure-core-http-okhttp - 1.2.3 + 1.2.4 test @@ -98,7 +98,7 @@ com.azure azure-core-test - 1.3.0 + 1.3.1 test diff --git a/sdk/loganalytics/microsoft-azure-loganalytics/pom.xml b/sdk/loganalytics/microsoft-azure-loganalytics/pom.xml index f8d2f243ce515..3b0ffa86d91fa 100644 --- a/sdk/loganalytics/microsoft-azure-loganalytics/pom.xml +++ b/sdk/loganalytics/microsoft-azure-loganalytics/pom.xml @@ -71,7 +71,7 @@ com.azure azure-core-test - 1.3.0 + 1.3.1 test diff --git a/sdk/schemaregistry/azure-data-schemaregistry/pom.xml b/sdk/schemaregistry/azure-data-schemaregistry/pom.xml index 8cc94434cf450..4adb5d427f246 100644 --- a/sdk/schemaregistry/azure-data-schemaregistry/pom.xml +++ b/sdk/schemaregistry/azure-data-schemaregistry/pom.xml @@ -47,12 +47,12 @@ com.azure azure-core - 1.5.1 + 1.6.0 com.azure azure-core-http-netty - 1.5.2 + 1.5.3 diff --git a/sdk/search/azure-search-documents/pom.xml b/sdk/search/azure-search-documents/pom.xml index efc7575d15f36..41d86df154d40 100644 --- a/sdk/search/azure-search-documents/pom.xml +++ b/sdk/search/azure-search-documents/pom.xml @@ -28,12 +28,12 @@ com.azure azure-core - 1.6.0 + 1.6.0 com.azure azure-core-http-netty - 1.5.3 + 1.5.3 + 1.3.1 test diff --git a/sdk/servicebus/azure-messaging-servicebus/pom.xml b/sdk/servicebus/azure-messaging-servicebus/pom.xml index e2f9887d0c8d8..d89741dde4f13 100644 --- a/sdk/servicebus/azure-messaging-servicebus/pom.xml +++ b/sdk/servicebus/azure-messaging-servicebus/pom.xml @@ -42,30 +42,30 @@ com.azure azure-core - 1.6.0 + 1.6.0 com.azure azure-core-amqp - 1.3.0 + 1.3.0 com.azure azure-core-http-netty - 1.5.2 + 1.5.3 com.azure azure-core-test - 1.3.0 + 1.3.1 test com.azure azure-core-http-okhttp - 1.2.3 + 1.2.4 test diff --git a/sdk/storage/azure-storage-blob-batch/pom.xml b/sdk/storage/azure-storage-blob-batch/pom.xml index 1d3bb7881dce5..9834337dc64cf 100644 --- a/sdk/storage/azure-storage-blob-batch/pom.xml +++ b/sdk/storage/azure-storage-blob-batch/pom.xml @@ -55,12 +55,12 @@ com.azure azure-core - 1.5.1 + 1.6.0 com.azure azure-core-http-netty - 1.5.2 + 1.5.3 com.azure @@ -81,7 +81,7 @@ com.azure azure-core-test - 1.3.0 + 1.3.1 test diff --git a/sdk/storage/azure-storage-blob-changefeed/pom.xml b/sdk/storage/azure-storage-blob-changefeed/pom.xml index 3005adc67544e..7cfe14796bbb3 100644 --- a/sdk/storage/azure-storage-blob-changefeed/pom.xml +++ b/sdk/storage/azure-storage-blob-changefeed/pom.xml @@ -55,12 +55,12 @@ com.azure azure-core - 1.5.1 + 1.6.0 com.azure azure-core-http-netty - 1.5.2 + 1.5.3 com.azure @@ -81,7 +81,7 @@ com.azure azure-core-test - 1.3.0 + 1.3.1 test diff --git a/sdk/storage/azure-storage-blob-cryptography/pom.xml b/sdk/storage/azure-storage-blob-cryptography/pom.xml index b0afb4e5027b1..cf6cc2e0eb7de 100644 --- a/sdk/storage/azure-storage-blob-cryptography/pom.xml +++ b/sdk/storage/azure-storage-blob-cryptography/pom.xml @@ -41,12 +41,12 @@ com.azure azure-core - 1.5.1 + 1.6.0 com.azure azure-core-http-netty - 1.5.2 + 1.5.3 com.azure @@ -56,7 +56,7 @@ com.azure azure-core-test - 1.3.0 + 1.3.1 test diff --git a/sdk/storage/azure-storage-blob-nio/pom.xml b/sdk/storage/azure-storage-blob-nio/pom.xml index f0c31091d0b89..2d88682682454 100644 --- a/sdk/storage/azure-storage-blob-nio/pom.xml +++ b/sdk/storage/azure-storage-blob-nio/pom.xml @@ -60,7 +60,7 @@ com.azure azure-core-test - 1.3.0 + 1.3.1 test diff --git a/sdk/storage/azure-storage-blob/pom.xml b/sdk/storage/azure-storage-blob/pom.xml index fe82d1d9b0489..90a19dbf5006e 100644 --- a/sdk/storage/azure-storage-blob/pom.xml +++ b/sdk/storage/azure-storage-blob/pom.xml @@ -55,7 +55,7 @@ com.azure azure-core - 1.5.1 + 1.6.0 com.azure @@ -80,13 +80,13 @@ com.azure azure-core-test - 1.3.0 + 1.3.1 test com.azure azure-core-http-netty - 1.5.2 + 1.5.3 test diff --git a/sdk/storage/azure-storage-common/pom.xml b/sdk/storage/azure-storage-common/pom.xml index fdd350a7bec68..a3503e01608ca 100644 --- a/sdk/storage/azure-storage-common/pom.xml +++ b/sdk/storage/azure-storage-common/pom.xml @@ -41,12 +41,12 @@ com.azure azure-core - 1.5.1 + 1.6.0 com.azure azure-core-http-netty - 1.5.2 + 1.5.3 + 1.3.1 test diff --git a/sdk/storage/azure-storage-file-datalake/pom.xml b/sdk/storage/azure-storage-file-datalake/pom.xml index f8aaeb505feac..588d783e12022 100644 --- a/sdk/storage/azure-storage-file-datalake/pom.xml +++ b/sdk/storage/azure-storage-file-datalake/pom.xml @@ -71,13 +71,13 @@ com.azure azure-core-test - 1.3.0 + 1.3.1 test com.azure azure-core-http-netty - 1.5.2 + 1.5.3 test diff --git a/sdk/storage/azure-storage-file-share/pom.xml b/sdk/storage/azure-storage-file-share/pom.xml index e1ecf77055806..65406ba22e7f2 100644 --- a/sdk/storage/azure-storage-file-share/pom.xml +++ b/sdk/storage/azure-storage-file-share/pom.xml @@ -52,13 +52,13 @@ com.azure azure-core-test - 1.3.0 + 1.3.1 test com.azure azure-core-http-netty - 1.5.2 + 1.5.3 test diff --git a/sdk/storage/azure-storage-queue/pom.xml b/sdk/storage/azure-storage-queue/pom.xml index daee8d1677480..2d73948453510 100644 --- a/sdk/storage/azure-storage-queue/pom.xml +++ b/sdk/storage/azure-storage-queue/pom.xml @@ -36,7 +36,7 @@ com.azure azure-core - 1.5.1 + 1.6.0 com.azure @@ -46,13 +46,13 @@ com.azure azure-core-test - 1.3.0 + 1.3.1 test com.azure azure-core-http-netty - 1.5.2 + 1.5.3 test diff --git a/sdk/tables/azure-data-tables/pom.xml b/sdk/tables/azure-data-tables/pom.xml index ffc93c5d4d888..4fb23afccc726 100644 --- a/sdk/tables/azure-data-tables/pom.xml +++ b/sdk/tables/azure-data-tables/pom.xml @@ -40,7 +40,7 @@ Licensed under the MIT License. com.azure azure-core - 1.5.1 + 1.6.0 diff --git a/sdk/template/azure-sdk-template/pom.xml b/sdk/template/azure-sdk-template/pom.xml index 4c2215e462bd6..a8087f8d000be 100644 --- a/sdk/template/azure-sdk-template/pom.xml +++ b/sdk/template/azure-sdk-template/pom.xml @@ -31,7 +31,7 @@ com.azure azure-core - 1.5.1 + 1.6.0 junit diff --git a/sdk/textanalytics/azure-ai-textanalytics/pom.xml b/sdk/textanalytics/azure-ai-textanalytics/pom.xml index 6b2b24c81cd6e..e4fe82eec1f4c 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/pom.xml +++ b/sdk/textanalytics/azure-ai-textanalytics/pom.xml @@ -36,12 +36,12 @@ com.azure azure-core - 1.5.1 + 1.6.0 com.azure azure-core-http-netty - 1.5.2 + 1.5.3 + 1.3.1 test com.azure azure-core-http-okhttp - 1.2.3 + 1.2.4 test From d0150c8324ae97d9133139eee4c0d140e9dfdcce Mon Sep 17 00:00:00 2001 From: James Suplizio Date: Thu, 2 Jul 2020 16:53:33 -0700 Subject: [PATCH 007/129] Skip Changelog processing for data track (#12787) * Skip Changelog processing for data track * Fix condition * Update luis-authoring version from release --- .../templates/stages/archetype-java-release.yml | 15 ++++++++------- eng/versioning/version_data.txt | 2 +- .../ms-azure-cs-luis-authoring/pom.xml | 2 +- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/eng/pipelines/templates/stages/archetype-java-release.yml b/eng/pipelines/templates/stages/archetype-java-release.yml index 5f001f020e676..75d2006a8d744 100644 --- a/eng/pipelines/templates/stages/archetype-java-release.yml +++ b/eng/pipelines/templates/stages/archetype-java-release.yml @@ -75,11 +75,12 @@ stages: $(Build.SourcesDirectory)/eng/versioning/scan_for_unreleased_dependencies.ps1 ${{artifact.groupId}} ${{artifact.name}} $(Build.SourcesDirectory)/sdk/${{parameters.ServiceDirectory}} displayName: "Verify no unreleased dependencies" - - template: /eng/common/pipelines/templates/steps/verify-changelog.yml - parameters: - PackageName: ${{artifact.name}} - ServiceName: ${{parameters.ServiceDirectory}} - ForRelease: true + - ${{if ne(parameters.SDKType, 'data')}}: + - template: /eng/common/pipelines/templates/steps/verify-changelog.yml + parameters: + PackageName: ${{artifact.name}} + ServiceName: ${{parameters.ServiceDirectory}} + ForRelease: true - deployment: TagRepository @@ -181,8 +182,8 @@ stages: PRBranchName: 'smoke-test-rdme' ArtifactName: ${{parameters.ArtifactName}} Language: 'java' - DocRepoDestinationPath: 'docs-ref-services/' - + DocRepoDestinationPath: 'docs-ref-services/' + - ${{if ne(artifact.options.skipPublishDocs, 'true')}}: - deployment: PublishDocs displayName: Publish Docs to GitHubIO Blob Storage diff --git a/eng/versioning/version_data.txt b/eng/versioning/version_data.txt index 74a67fd215147..66633f0b3a968 100644 --- a/eng/versioning/version_data.txt +++ b/eng/versioning/version_data.txt @@ -8,7 +8,7 @@ com.microsoft.azure:azure-applicationinsights-query;1.0.0-beta-2;1.0.0-beta-2 com.microsoft.azure.cognitiveservices:azure-cognitiveservices-spellcheck;1.1.0-beta.1;1.1.0-beta.1 com.microsoft.azure.cognitiveservices:azure-cognitiveservices-textanalytics;1.1.0-beta.1;1.1.0-beta.1 com.microsoft.azure.cognitiveservices:azure-cognitiveservices-luis-runtime;1.1.0-beta.1;1.1.0-beta.1 -com.microsoft.azure.cognitiveservices:azure-cognitiveservices-luis-authoring;1.0.4-beta;1.0.4-beta +com.microsoft.azure.cognitiveservices:azure-cognitiveservices-luis-authoring;1.0.5-beta;1.0.5-beta com.microsoft.azure.cognitiveservices:azure-cognitiveservices-autosuggest;1.1.0-beta.1;1.1.0-beta.1 com.microsoft.azure.cognitiveservices:azure-cognitiveservices-customimagesearch;1.1.0-beta.1;1.1.0-beta.1 com.microsoft.azure.cognitiveservices:azure-cognitiveservices-customsearch;1.1.0-beta.1;1.1.0-beta.1 diff --git a/sdk/cognitiveservices/ms-azure-cs-luis-authoring/pom.xml b/sdk/cognitiveservices/ms-azure-cs-luis-authoring/pom.xml index 66234f34ad6bd..24e805f283849 100644 --- a/sdk/cognitiveservices/ms-azure-cs-luis-authoring/pom.xml +++ b/sdk/cognitiveservices/ms-azure-cs-luis-authoring/pom.xml @@ -13,7 +13,7 @@ azure-cognitiveservices-luis-authoring com.microsoft.azure.cognitiveservices - 1.0.4-beta + 1.0.5-beta jar Microsoft Azure SDK for Cognitive Service Language Understanding (LUIS) This package contains Microsoft Cognitive Service Language Understanding (LUIS). From 405219c495db81b8db9e1f87020dc8c8488b21c6 Mon Sep 17 00:00:00 2001 From: Annie Liang <64233642+xinlian12@users.noreply.github.com> Date: Thu, 2 Jul 2020 16:57:16 -0700 Subject: [PATCH 008/129] ClassCastExceptionForTopQueryWithAggregate (#12633) * FixForClassCastExceptionForTopDocumentQueryContext Co-authored-by: Annie Liang --- ...ggregateDocumentQueryExecutionContext.java | 27 ++-- ...DistinctDocumentQueryExecutionContext.java | 15 +- .../DocumentQueryExecutionContextFactory.java | 29 ++-- .../GroupByDocumentQueryExecutionContext.java | 9 +- .../OrderByDocumentQueryExecutionContext.java | 53 +++---- ...ParallelDocumentQueryExecutionContext.java | 50 +++---- ...ipelinedDocumentQueryExecutionContext.java | 131 +++++++++--------- .../query/PipelinedDocumentQueryParams.java | 117 ++++++++++++++++ .../SkipDocumentQueryExecutionContext.java | 9 +- .../TopDocumentQueryExecutionContext.java | 59 ++------ .../cosmos/rx/OffsetLimitQueryTests.java | 55 ++++++++ 11 files changed, 340 insertions(+), 214 deletions(-) create mode 100644 sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/PipelinedDocumentQueryParams.java diff --git a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/AggregateDocumentQueryExecutionContext.java b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/AggregateDocumentQueryExecutionContext.java index 6c253ba3857d4..bcb43e6a7ba6d 100644 --- a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/AggregateDocumentQueryExecutionContext.java +++ b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/AggregateDocumentQueryExecutionContext.java @@ -20,7 +20,7 @@ import java.util.Map; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentMap; -import java.util.function.Function; +import java.util.function.BiFunction; public class AggregateDocumentQueryExecutionContext implements IDocumentQueryExecutionComponent{ @@ -57,8 +57,8 @@ public Flux> drainAsync(int maxPageSize) { .map( superList -> { double requestCharge = 0; - List aggregateResults = new ArrayList(); - HashMap headers = new HashMap(); + List aggregateResults = new ArrayList<>(); + HashMap headers = new HashMap<>(); for(FeedResponse page : superList) { @@ -104,23 +104,22 @@ public Flux> drainAsync(int maxPageSize) { } public static Flux> createAsync( - Function>> createSourceComponentFunction, + BiFunction, Flux>> createSourceComponentFunction, Collection aggregates, Map groupByAliasToAggregateType, List groupByAliases, boolean hasSelectValue, - String continuationToken) { + String continuationToken, + PipelinedDocumentQueryParams documentQueryParams) { return createSourceComponentFunction - .apply(continuationToken) - .map(component -> { - return new AggregateDocumentQueryExecutionContext(component, - new ArrayList<>(aggregates), - groupByAliasToAggregateType, - groupByAliases, - hasSelectValue, - continuationToken); - }); + .apply(continuationToken, documentQueryParams) + .map(component -> new AggregateDocumentQueryExecutionContext(component, + new ArrayList<>(aggregates), + groupByAliasToAggregateType, + groupByAliases, + hasSelectValue, + continuationToken)); } public IDocumentQueryExecutionComponent getComponent() { diff --git a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/DistinctDocumentQueryExecutionContext.java b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/DistinctDocumentQueryExecutionContext.java index fa5ef23280bef..39e61580b2983 100644 --- a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/DistinctDocumentQueryExecutionContext.java +++ b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/DistinctDocumentQueryExecutionContext.java @@ -18,7 +18,7 @@ import java.util.List; import java.util.Map; import java.util.concurrent.atomic.AtomicReference; -import java.util.function.Function; +import java.util.function.BiFunction; public class DistinctDocumentQueryExecutionContext implements IDocumentQueryExecutionComponent { private final IDocumentQueryExecutionComponent component; @@ -43,9 +43,10 @@ private DistinctDocumentQueryExecutionContext( } public static Flux> createAsync( - Function>> createSourceComponentFunction, + BiFunction, Flux>> createSourceComponentFunction, DistinctQueryType distinctQueryType, - String continuationToken) { + String continuationToken, + PipelinedDocumentQueryParams documentQueryParams) { Utils.ValueHolder outDistinctcontinuationtoken = new Utils.ValueHolder<>(); DistinctContinuationToken distinctContinuationToken = new DistinctContinuationToken(null /*lasthash*/, @@ -70,11 +71,9 @@ public static Flux> cre final UInt128 continuationTokenLastHash = distinctContinuationToken.getLastHash(); - return createSourceComponentFunction.apply(distinctContinuationToken.getSourceToken()).map(component -> { - return new DistinctDocumentQueryExecutionContext(component, - distinctQueryType, - continuationTokenLastHash); - }); + return createSourceComponentFunction + .apply(distinctContinuationToken.getSourceToken(), documentQueryParams) + .map(component -> new DistinctDocumentQueryExecutionContext(component, distinctQueryType, continuationTokenLastHash)); } IDocumentQueryExecutionComponent getComponent() { diff --git a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/DocumentQueryExecutionContextFactory.java b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/DocumentQueryExecutionContextFactory.java index 41b48c65fb505..19b225bde665b 100644 --- a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/DocumentQueryExecutionContextFactory.java +++ b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/DocumentQueryExecutionContextFactory.java @@ -195,20 +195,21 @@ public static Flux documentQueryParams = new PipelinedDocumentQueryParams( + resourceTypeEnum, + resourceType, + query, + resourceLink, + collectionRid, + getLazyFeedResponse, + isContinuationExpected, + initialPageSize, + targetRanges, + partitionedQueryExecutionInfo.getQueryInfo(), + cosmosQueryRequestOptions, + correlatedActivityId); + + return PipelinedDocumentQueryExecutionContext.createAsync(client, documentQueryParams); } public static Flux> createReadManyQueryAsync( diff --git a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/GroupByDocumentQueryExecutionContext.java b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/GroupByDocumentQueryExecutionContext.java index 83bf12d464fd9..d9f63ba24e92f 100644 --- a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/GroupByDocumentQueryExecutionContext.java +++ b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/GroupByDocumentQueryExecutionContext.java @@ -19,7 +19,7 @@ import java.util.HashMap; import java.util.List; import java.util.Map; -import java.util.function.Function; +import java.util.function.BiFunction; public final class GroupByDocumentQueryExecutionContext implements IDocumentQueryExecutionComponent { @@ -40,11 +40,12 @@ public final class GroupByDocumentQueryExecutionContext impl } public static Flux> createAsync( - Function>> createSourceComponentFunction, + BiFunction, Flux>> createSourceComponentFunction, String continuationToken, Map groupByAliasToAggregateType, List orderedAliases, - boolean hasSelectValue) { + boolean hasSelectValue, + PipelinedDocumentQueryParams documentQueryParams) { if (continuationToken != null) { CosmosException dce = new BadRequestException(CONTINUATION_TOKEN_NOT_SUPPORTED_WITH_GROUP_BY); return Flux.error(dce); @@ -57,7 +58,7 @@ public static Flux> cre } GroupingTable table = new GroupingTable(groupByAliasToAggregateType, orderedAliases, hasSelectValue); // Have to pass non-null continuation token once supported - return createSourceComponentFunction.apply(null) + return createSourceComponentFunction.apply(null, documentQueryParams) .map(component -> new GroupByDocumentQueryExecutionContext<>(component, table)); } diff --git a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/OrderByDocumentQueryExecutionContext.java b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/OrderByDocumentQueryExecutionContext.java index 4786c7648ec69..623b5ea7c5ec8 100644 --- a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/OrderByDocumentQueryExecutionContext.java +++ b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/OrderByDocumentQueryExecutionContext.java @@ -77,39 +77,32 @@ private OrderByDocumentQueryExecutionContext( public static Flux> createAsync( IDocumentQueryClient client, - ResourceType resourceTypeEnum, - Class resourceType, - SqlQuerySpec expression, - CosmosQueryRequestOptions cosmosQueryRequestOptions, - String resourceLink, - String collectionRid, - PartitionedQueryExecutionInfo partitionedQueryExecutionInfo, - List partitionKeyRanges, - int initialPageSize, - boolean isContinuationExpected, - boolean getLazyFeedResponse, - UUID correlatedActivityId) { + PipelinedDocumentQueryParams initParams) { - OrderByDocumentQueryExecutionContext context = new OrderByDocumentQueryExecutionContext(client, - partitionKeyRanges, - resourceTypeEnum, - resourceType, - expression, - cosmosQueryRequestOptions, - resourceLink, - partitionedQueryExecutionInfo.getQueryInfo().getRewrittenQuery(), - isContinuationExpected, - getLazyFeedResponse, - new OrderbyRowComparer(partitionedQueryExecutionInfo.getQueryInfo().getOrderBy()), - collectionRid, - correlatedActivityId); + OrderByDocumentQueryExecutionContext context = new OrderByDocumentQueryExecutionContext( + client, + initParams.getPartitionKeyRanges(), + initParams.getResourceTypeEnum(), + initParams.getResourceType(), + initParams.getQuery(), + initParams.getCosmosQueryRequestOptions(), + initParams.getResourceLink(), + initParams.getQueryInfo().getRewrittenQuery(), + initParams.isContinuationExpected(), + initParams.isGetLazyResponseFeed(), + new OrderbyRowComparer(initParams.getQueryInfo().getOrderBy()), + initParams.getCollectionRid(), + initParams.getCorrelatedActivityId()); + + context.setTop(initParams.getTop()); try { - context.initialize(partitionKeyRanges, - partitionedQueryExecutionInfo.getQueryInfo().getOrderBy(), - partitionedQueryExecutionInfo.getQueryInfo().getOrderByExpressions(), - initialPageSize, - ModelBridgeInternal.getRequestContinuationFromQueryRequestOptions(cosmosQueryRequestOptions)); + context.initialize( + initParams.getPartitionKeyRanges(), + initParams.getQueryInfo().getOrderBy(), + initParams.getQueryInfo().getOrderByExpressions(), + initParams.getInitialPageSize(), + ModelBridgeInternal.getRequestContinuationFromQueryRequestOptions(initParams.getCosmosQueryRequestOptions())); return Flux.just(context); } catch (CosmosException dce) { diff --git a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/ParallelDocumentQueryExecutionContext.java b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/ParallelDocumentQueryExecutionContext.java index 30e1d3636e40e..e80b277aa4fc1 100644 --- a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/ParallelDocumentQueryExecutionContext.java +++ b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/ParallelDocumentQueryExecutionContext.java @@ -60,37 +60,29 @@ private ParallelDocumentQueryExecutionContext( public static Flux> createAsync( IDocumentQueryClient client, - ResourceType resourceTypeEnum, - Class resourceType, - SqlQuerySpec query, - CosmosQueryRequestOptions cosmosQueryRequestOptions, - String resourceLink, - String collectionRid, - PartitionedQueryExecutionInfo partitionedQueryExecutionInfo, - List targetRanges, - int initialPageSize, - boolean isContinuationExpected, - boolean getLazyFeedResponse, - UUID correlatedActivityId) { - - ParallelDocumentQueryExecutionContext context = new ParallelDocumentQueryExecutionContext(client, - targetRanges, - resourceTypeEnum, - resourceType, - query, - cosmosQueryRequestOptions, - resourceLink, - partitionedQueryExecutionInfo.getQueryInfo().getRewrittenQuery(), - collectionRid, - isContinuationExpected, - getLazyFeedResponse, - correlatedActivityId); + PipelinedDocumentQueryParams initParams) { + + ParallelDocumentQueryExecutionContext context = new ParallelDocumentQueryExecutionContext( + client, + initParams.getPartitionKeyRanges(), + initParams.getResourceTypeEnum(), + initParams.getResourceType(), + initParams.getQuery(), + initParams.getCosmosQueryRequestOptions(), + initParams.getResourceLink(), + initParams.getQueryInfo().getRewrittenQuery(), + initParams.getCollectionRid(), + initParams.isContinuationExpected(), + initParams.isGetLazyResponseFeed(), + initParams.getCorrelatedActivityId()); + context.setTop(initParams.getTop()); try { - context.initialize(collectionRid, - targetRanges, - initialPageSize, - ModelBridgeInternal.getRequestContinuationFromQueryRequestOptions(cosmosQueryRequestOptions)); + context.initialize( + initParams.getCollectionRid(), + initParams.getPartitionKeyRanges(), + initParams.getInitialPageSize(), + ModelBridgeInternal.getRequestContinuationFromQueryRequestOptions(initParams.getCosmosQueryRequestOptions())); return Flux.just(context); } catch (CosmosException dce) { return Flux.error(dce); diff --git a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/PipelinedDocumentQueryExecutionContext.java b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/PipelinedDocumentQueryExecutionContext.java index 7be73c08e7bfd..1b8269440cfda 100644 --- a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/PipelinedDocumentQueryExecutionContext.java +++ b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/PipelinedDocumentQueryExecutionContext.java @@ -2,20 +2,19 @@ // Licensed under the MIT License. package com.azure.cosmos.implementation.query; +import com.azure.cosmos.implementation.PartitionKeyRange; +import com.azure.cosmos.implementation.Resource; +import com.azure.cosmos.implementation.ResourceType; +import com.azure.cosmos.implementation.Utils; import com.azure.cosmos.models.CosmosQueryRequestOptions; import com.azure.cosmos.models.FeedResponse; import com.azure.cosmos.models.ModelBridgeInternal; -import com.azure.cosmos.implementation.Resource; import com.azure.cosmos.models.SqlQuerySpec; -import com.azure.cosmos.implementation.PartitionKeyRange; -import com.azure.cosmos.implementation.ResourceType; -import com.azure.cosmos.implementation.Utils; import reactor.core.publisher.Flux; -import java.util.List; import java.util.Map; import java.util.UUID; -import java.util.function.Function; +import java.util.function.BiFunction; /** * While this class is public, but it is not part of our published public APIs. @@ -46,105 +45,113 @@ private PipelinedDocumentQueryExecutionContext(IDocumentQueryExecutionComponent< } public static Flux> createAsync( - IDocumentQueryClient client, ResourceType resourceTypeEnum, Class resourceType, SqlQuerySpec expression, - CosmosQueryRequestOptions cosmosQueryRequestOptions, String resourceLink, String collectionRid, - PartitionedQueryExecutionInfo partitionedQueryExecutionInfo, List targetRanges, - int initialPageSize, boolean isContinuationExpected, boolean getLazyFeedResponse, - UUID correlatedActivityId) { - // Use nested callback pattern to unwrap the continuation token at each level. - Function>> createBaseComponentFunction; + IDocumentQueryClient client, + PipelinedDocumentQueryParams initParams) { - QueryInfo queryInfo = partitionedQueryExecutionInfo.getQueryInfo(); + // Use nested callback pattern to unwrap the continuation token and query params at each level. + BiFunction, Flux>> createBaseComponentFunction; + + QueryInfo queryInfo = initParams.getQueryInfo(); + UUID correlatedActivityId = initParams.getCorrelatedActivityId(); + CosmosQueryRequestOptions cosmosQueryRequestOptions = initParams.getCosmosQueryRequestOptions(); if (queryInfo.hasOrderBy()) { - createBaseComponentFunction = (continuationToken) -> { + createBaseComponentFunction = (continuationToken, documentQueryParams) -> { CosmosQueryRequestOptions orderByCosmosQueryRequestOptions = ModelBridgeInternal.createQueryRequestOptions(cosmosQueryRequestOptions); ModelBridgeInternal.setQueryRequestOptionsContinuationToken(orderByCosmosQueryRequestOptions, continuationToken); - return OrderByDocumentQueryExecutionContext.createAsync(client, resourceTypeEnum, resourceType, - expression, orderByCosmosQueryRequestOptions, resourceLink, collectionRid, partitionedQueryExecutionInfo, - targetRanges, initialPageSize, isContinuationExpected, getLazyFeedResponse, - correlatedActivityId); + initParams.setCosmosQueryRequestOptions(orderByCosmosQueryRequestOptions); + + return OrderByDocumentQueryExecutionContext.createAsync(client, documentQueryParams); }; } else { - createBaseComponentFunction = (continuationToken) -> { + createBaseComponentFunction = (continuationToken, documentQueryParams) -> { CosmosQueryRequestOptions parallelCosmosQueryRequestOptions = ModelBridgeInternal.createQueryRequestOptions(cosmosQueryRequestOptions); ModelBridgeInternal.setQueryRequestOptionsContinuationToken(parallelCosmosQueryRequestOptions, continuationToken); - return ParallelDocumentQueryExecutionContext.createAsync(client, resourceTypeEnum, resourceType, - expression, parallelCosmosQueryRequestOptions, resourceLink, collectionRid, partitionedQueryExecutionInfo, - targetRanges, initialPageSize, isContinuationExpected, getLazyFeedResponse, - correlatedActivityId); + initParams.setCosmosQueryRequestOptions(parallelCosmosQueryRequestOptions); + + return ParallelDocumentQueryExecutionContext.createAsync(client, documentQueryParams); }; } - Function>> createAggregateComponentFunction; + BiFunction, Flux>> createAggregateComponentFunction; if (queryInfo.hasAggregates() && !queryInfo.hasGroupBy()) { - createAggregateComponentFunction = (continuationToken) -> { - return AggregateDocumentQueryExecutionContext.createAsync(createBaseComponentFunction, - queryInfo.getAggregates(), - queryInfo.getGroupByAliasToAggregateType(), - queryInfo.getGroupByAliases(), - queryInfo.hasSelectValue(), - continuationToken); - }; + createAggregateComponentFunction = + (continuationToken, documentQueryParams) -> + AggregateDocumentQueryExecutionContext.createAsync(createBaseComponentFunction, + queryInfo.getAggregates(), + queryInfo.getGroupByAliasToAggregateType(), + queryInfo.getGroupByAliases(), + queryInfo.hasSelectValue(), + continuationToken, + documentQueryParams); } else { createAggregateComponentFunction = createBaseComponentFunction; } - Function>> createDistinctComponentFunction; + BiFunction, Flux>> createDistinctComponentFunction; if (queryInfo.hasDistinct()) { - createDistinctComponentFunction = (continuationToken) -> { - return DistinctDocumentQueryExecutionContext.createAsync(createAggregateComponentFunction, - queryInfo.getDistinctQueryType(), continuationToken); - }; + createDistinctComponentFunction = + (continuationToken, documentQueryParams) -> + DistinctDocumentQueryExecutionContext.createAsync(createAggregateComponentFunction, + queryInfo.getDistinctQueryType(), + continuationToken, + documentQueryParams); } else { createDistinctComponentFunction = createAggregateComponentFunction; } - Function>> createGroupByComponentFunction; + BiFunction, Flux>> createGroupByComponentFunction; if (queryInfo.hasGroupBy()) { - createGroupByComponentFunction = (continuationToken) -> { - return GroupByDocumentQueryExecutionContext.createAsync(createDistinctComponentFunction, - continuationToken, - queryInfo.getGroupByAliasToAggregateType(), - queryInfo.getGroupByAliases(), - queryInfo.hasSelectValue()); - }; + createGroupByComponentFunction = + (continuationToken, documentQueryParams) -> + GroupByDocumentQueryExecutionContext.createAsync(createDistinctComponentFunction, + continuationToken, + queryInfo.getGroupByAliasToAggregateType(), + queryInfo.getGroupByAliases(), + queryInfo.hasSelectValue(), + documentQueryParams); } else{ createGroupByComponentFunction = createDistinctComponentFunction; } - Function>> createSkipComponentFunction; + BiFunction, Flux>> createSkipComponentFunction; if (queryInfo.hasOffset()) { - createSkipComponentFunction = (continuationToken) -> { - return SkipDocumentQueryExecutionContext.createAsync(createGroupByComponentFunction, - queryInfo.getOffset(), - continuationToken); - }; + createSkipComponentFunction = + (continuationToken, documentQueryParams) -> + SkipDocumentQueryExecutionContext.createAsync(createGroupByComponentFunction, + queryInfo.getOffset(), + continuationToken, + documentQueryParams); } else { createSkipComponentFunction = createGroupByComponentFunction; } - Function>> createTopComponentFunction; + BiFunction, Flux>> createTopComponentFunction; if (queryInfo.hasTop()) { - createTopComponentFunction = (continuationToken) -> { - return TopDocumentQueryExecutionContext.createAsync(createSkipComponentFunction, - queryInfo.getTop(), queryInfo.getTop(), continuationToken); - }; + createTopComponentFunction = + (continuationToken, documentQueryParams) -> + TopDocumentQueryExecutionContext.createAsync(createSkipComponentFunction, + queryInfo.getTop(), + queryInfo.getTop(), + continuationToken, + documentQueryParams); } else { createTopComponentFunction = createSkipComponentFunction; } - Function>> createTakeComponentFunction; + BiFunction, Flux>> createTakeComponentFunction; if (queryInfo.hasLimit()) { - createTakeComponentFunction = (continuationToken) -> { + createTakeComponentFunction = (continuationToken, documentQueryParams) -> { int totalLimit = queryInfo.getLimit(); if (queryInfo.hasOffset()) { // This is being done to match the limit from rewritten query totalLimit = queryInfo.getOffset() + queryInfo.getLimit(); } return TopDocumentQueryExecutionContext.createAsync(createTopComponentFunction, - queryInfo.getLimit(), totalLimit, - continuationToken); + queryInfo.getLimit(), + totalLimit, + continuationToken, + documentQueryParams); }; } else { createTakeComponentFunction = createTopComponentFunction; @@ -158,7 +165,7 @@ public static Flux new PipelinedDocumentQueryExecutionContext<>(c, pageSize, correlatedActivityId, queryInfo)); } diff --git a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/PipelinedDocumentQueryParams.java b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/PipelinedDocumentQueryParams.java new file mode 100644 index 0000000000000..f9b256d5482a0 --- /dev/null +++ b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/PipelinedDocumentQueryParams.java @@ -0,0 +1,117 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.cosmos.implementation.query; + +import com.azure.cosmos.implementation.PartitionKeyRange; +import com.azure.cosmos.implementation.Resource; +import com.azure.cosmos.implementation.ResourceType; +import com.azure.cosmos.models.CosmosQueryRequestOptions; +import com.azure.cosmos.models.SqlQuerySpec; + +import java.util.List; +import java.util.UUID; + +public class PipelinedDocumentQueryParams { + private int top = -1; + private final int initialPageSize; + private final boolean isContinuationExpected; + private final boolean getLazyResponseFeed; + private final String collectionRid; + private final ResourceType resourceTypeEnum; + private final Class resourceType; + private final SqlQuerySpec query; + private final String resourceLink; + private final UUID correlatedActivityId; + private CosmosQueryRequestOptions cosmosQueryRequestOptions; + private final List partitionKeyRanges; + private final QueryInfo queryInfo; + + public PipelinedDocumentQueryParams( + ResourceType resourceTypeEnum, + Class resourceType, + SqlQuerySpec query, + String resourceLink, + String collectionRid, + boolean getLazyResponseFeed, + boolean isContinuationExpected, + int initialPageSize, + List partitionKeyRanges, + QueryInfo queryInfo, + CosmosQueryRequestOptions cosmosQueryRequestOptions, + UUID correlatedActivityId) { + + this.resourceTypeEnum = resourceTypeEnum; + this.resourceType = resourceType; + this.query = query; + this.resourceLink = resourceLink; + this.collectionRid = collectionRid; + this.getLazyResponseFeed = getLazyResponseFeed; + this.isContinuationExpected = isContinuationExpected; + this.initialPageSize = initialPageSize; + this.correlatedActivityId = correlatedActivityId; + this.partitionKeyRanges = partitionKeyRanges; + this.queryInfo = queryInfo; + this.cosmosQueryRequestOptions = cosmosQueryRequestOptions; + } + + public int getTop() { + return top; + } + + public void setTop(int top) { + this.top = top; + } + + public int getInitialPageSize() { + return initialPageSize; + } + + public boolean isContinuationExpected() { + return isContinuationExpected; + } + + public boolean isGetLazyResponseFeed() { + return getLazyResponseFeed; + } + + public String getCollectionRid() { + return collectionRid; + } + + public ResourceType getResourceTypeEnum() { + return resourceTypeEnum; + } + + public Class getResourceType() { + return resourceType; + } + + public SqlQuerySpec getQuery() { + return query; + } + + public String getResourceLink() { + return resourceLink; + } + + public UUID getCorrelatedActivityId() { + return correlatedActivityId; + } + + public CosmosQueryRequestOptions getCosmosQueryRequestOptions() { + return cosmosQueryRequestOptions; + } + + public void setCosmosQueryRequestOptions(CosmosQueryRequestOptions cosmosQueryRequestOptions) { + this.cosmosQueryRequestOptions = cosmosQueryRequestOptions; + } + + public List getPartitionKeyRanges() { + return partitionKeyRanges; + } + + public QueryInfo getQueryInfo() { + return queryInfo; + } +} diff --git a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/SkipDocumentQueryExecutionContext.java b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/SkipDocumentQueryExecutionContext.java index 0c4e559d17de7..741a20cd64e36 100644 --- a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/SkipDocumentQueryExecutionContext.java +++ b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/SkipDocumentQueryExecutionContext.java @@ -14,7 +14,7 @@ import java.util.HashMap; import java.util.List; import java.util.Map; -import java.util.function.Function; +import java.util.function.BiFunction; import java.util.stream.Collectors; public final class SkipDocumentQueryExecutionContext implements IDocumentQueryExecutionComponent { @@ -31,9 +31,10 @@ public final class SkipDocumentQueryExecutionContext impleme } public static Flux> createAsync( - Function>> createSourceComponentFunction, + BiFunction, Flux>> createSourceComponentFunction, int skipCount, - String continuationToken) { + String continuationToken, + PipelinedDocumentQueryParams documentQueryParams) { OffsetContinuationToken offsetContinuationToken; Utils.ValueHolder outOffsetContinuationToken = new Utils.ValueHolder<>(); if (continuationToken != null) { @@ -51,7 +52,7 @@ public static Flux> cre offsetContinuationToken = new OffsetContinuationToken(skipCount, null); } - return createSourceComponentFunction.apply(offsetContinuationToken.getSourceToken()) + return createSourceComponentFunction.apply(offsetContinuationToken.getSourceToken(), documentQueryParams) .map(component -> new SkipDocumentQueryExecutionContext<>(component, offsetContinuationToken.getOffset())); } diff --git a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/TopDocumentQueryExecutionContext.java b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/TopDocumentQueryExecutionContext.java index 43ca0baafa444..e3a61abe74745 100644 --- a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/TopDocumentQueryExecutionContext.java +++ b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/query/TopDocumentQueryExecutionContext.java @@ -13,6 +13,7 @@ import java.util.HashMap; import java.util.Map; +import java.util.function.BiFunction; import java.util.function.Function; import java.util.function.Predicate; @@ -30,8 +31,11 @@ public TopDocumentQueryExecutionContext(IDocumentQueryExecutionComponent comp } public static Flux> createAsync( - Function>> createSourceComponentFunction, - int topCount, int limit, String topContinuationToken) { + BiFunction, Flux>> createSourceComponentFunction, + int topCount, + int limit, + String topContinuationToken, + PipelinedDocumentQueryParams documentQueryParams) { TakeContinuationToken takeContinuationToken; if (topContinuationToken == null) { @@ -57,19 +61,17 @@ public static Flux> cre return Flux.error(dce); } + // The top value setting here will be propagated down to document producer. + documentQueryParams.setTop(limit); + return createSourceComponentFunction - .apply(takeContinuationToken.getSourceToken()) + .apply(takeContinuationToken.getSourceToken(), documentQueryParams) .map(component -> new TopDocumentQueryExecutionContext<>(component, takeContinuationToken.getTakeCount(), limit)); } @Override public Flux> drainAsync(int maxPageSize) { - ParallelDocumentQueryExecutionContextBase context; - // These checks below are getting messier. Needs redesign - context = getContextFromComponent(); - - context.setTop(this.limit); return this.component.drainAsync(maxPageSize).takeUntil(new Predicate>() { @@ -124,45 +126,4 @@ public FeedResponse apply(FeedResponse t) { } }); } - - // TODO: This could be restructured eventually with better design to avoid these many checks - private ParallelDocumentQueryExecutionContextBase getContextFromComponent() { - ParallelDocumentQueryExecutionContextBase context; - if (this.component instanceof GroupByDocumentQueryExecutionContext) { - context = - (ParallelDocumentQueryExecutionContextBase) ((GroupByDocumentQueryExecutionContext) this.component) - .getComponent(); - } else if (this.component instanceof DistinctDocumentQueryExecutionContext) { - context = - (ParallelDocumentQueryExecutionContextBase) ((DistinctDocumentQueryExecutionContext) this.component) - .getComponent(); - } else if (this.component instanceof AggregateDocumentQueryExecutionContext) { - context = - (ParallelDocumentQueryExecutionContextBase) ((AggregateDocumentQueryExecutionContext) this.component) - .getComponent(); - } else if (this.component instanceof SkipDocumentQueryExecutionContext) { - - IDocumentQueryExecutionComponent component = ((SkipDocumentQueryExecutionContext) this.component) - .getComponent(); - if (component instanceof DistinctDocumentQueryExecutionContext) { - context = - (ParallelDocumentQueryExecutionContextBase) ((DistinctDocumentQueryExecutionContext) component) - .getComponent(); - } else if (component instanceof AggregateDocumentQueryExecutionContext) { - context = - (ParallelDocumentQueryExecutionContextBase) ((AggregateDocumentQueryExecutionContext) component) - .getComponent(); - } else if (component instanceof GroupByDocumentQueryExecutionContext) { - context = - (ParallelDocumentQueryExecutionContextBase) ((GroupByDocumentQueryExecutionContext) component) - .getComponent(); - } else { - context = - (ParallelDocumentQueryExecutionContextBase) component; - } - } else { - context = (ParallelDocumentQueryExecutionContextBase) this.component; - } - return context; - } } diff --git a/sdk/cosmos/azure-cosmos/src/test/java/com/azure/cosmos/rx/OffsetLimitQueryTests.java b/sdk/cosmos/azure-cosmos/src/test/java/com/azure/cosmos/rx/OffsetLimitQueryTests.java index 2b96d2ff8b8bc..84d4612ea6d3f 100644 --- a/sdk/cosmos/azure-cosmos/src/test/java/com/azure/cosmos/rx/OffsetLimitQueryTests.java +++ b/sdk/cosmos/azure-cosmos/src/test/java/com/azure/cosmos/rx/OffsetLimitQueryTests.java @@ -8,6 +8,8 @@ import com.azure.cosmos.CosmosAsyncContainer; import com.azure.cosmos.CosmosAsyncDatabase; import com.azure.cosmos.CosmosClientBuilder; +import com.azure.cosmos.implementation.Resource; +import com.azure.cosmos.models.ModelBridgeInternal; import com.azure.cosmos.util.CosmosPagedFlux; import com.azure.cosmos.implementation.InternalObjectNode; import com.azure.cosmos.models.CosmosQueryRequestOptions; @@ -16,6 +18,7 @@ import com.azure.cosmos.implementation.FeedResponseValidator; import com.azure.cosmos.implementation.Utils; import com.azure.cosmos.implementation.query.OffsetContinuationToken; +import com.fasterxml.jackson.databind.JsonNode; import io.reactivex.subscribers.TestSubscriber; import org.testng.annotations.AfterClass; import org.testng.annotations.BeforeClass; @@ -23,11 +26,13 @@ import org.testng.annotations.Test; import java.util.ArrayList; +import java.util.Comparator; import java.util.HashSet; import java.util.Iterator; import java.util.List; import java.util.Set; import java.util.concurrent.TimeUnit; +import java.util.stream.Collectors; import static org.assertj.core.api.Assertions.assertThat; @@ -130,6 +135,56 @@ public void queryDocumentsWithOffsetContinuationTokens() { this.queryWithContinuationTokensAndPageSizes(query, new int[] {1, 5, 15}, takeCount); } + @Test(groups = {"simple"}, timeOut = TIMEOUT, dataProvider = "queryMetricsArgProvider") + public void queryDocumentsWithDistinct(boolean qmEnabled) { + int skipCount = 4; + int takeCount = 10; + String query = + String.format("SELECT DISTINCT c.id from c OFFSET %s LIMIT %s", skipCount, takeCount); + CosmosQueryRequestOptions options = new CosmosQueryRequestOptions(); + options.setQueryMetricsEnabled(qmEnabled); + options.setMaxDegreeOfParallelism(2); + CosmosPagedFlux queryObservable = createdCollection.queryItems(query, options, InternalObjectNode.class); + + List expectedIds = + docs.stream().skip(4).limit(10).map(doc -> doc.getResourceId()).collect(Collectors.toList()); + + FeedResponseListValidator validator = + new FeedResponseListValidator.Builder() + .containsExactly(expectedIds) + .numberOfPages(3) + .hasValidQueryMetrics(qmEnabled) + .build(); + + validateQuerySuccess(queryObservable.byPage(5), validator, TIMEOUT); + } + + @Test(groups = {"simple"}, timeOut = TIMEOUT, dataProvider = "queryMetricsArgProvider") + public void queryDocumentsWithAggregate(boolean qmEnabled) { + int skipCount = 0; + int takeCount = 10; + String query = + String.format("SELECT VALUE MAX(c.%s) from c OFFSET %s LIMIT %s", field, skipCount, takeCount); + CosmosQueryRequestOptions options = new CosmosQueryRequestOptions(); + options.setQueryMetricsEnabled(qmEnabled); + CosmosPagedFlux queryObservable = createdCollection.queryItems(query, options, JsonNode.class); + + // The pipeline execution sequence is Aggregrate, skip, and top/limit, hence finding the max from among the docs + InternalObjectNode expectedDoc = docs + .stream() + .max(Comparator.comparing(r -> ModelBridgeInternal.getIntFromJsonSerializable(r, field))) + .get(); + + FeedResponseListValidator validator = + new FeedResponseListValidator.Builder() + .withAggregateValue(ModelBridgeInternal.getIntFromJsonSerializable(expectedDoc, field)) + .numberOfPages(1) + .hasValidQueryMetrics(qmEnabled) + .build(); + + validateQuerySuccess(queryObservable.byPage(5), validator, TIMEOUT); + } + private void queryWithContinuationTokensAndPageSizes(String query, int[] pageSizes, int takeCount) { for (int pageSize : pageSizes) { List receivedDocuments = this.queryWithContinuationTokens(query, pageSize); From c39454c4884c03c91618fe736380217627ec100e Mon Sep 17 00:00:00 2001 From: Connie Yau Date: Thu, 2 Jul 2020 18:44:12 -0700 Subject: [PATCH 009/129] Adding namespace and missing exists methods (#12780) * Add exists functionality. * Add tests for existence. * Add support for namespace operations. * Add check for context. * Fix test cases to use new test resources. --- .../ServiceBusManagementAsyncClient.java | 183 +++++++++++++++++- .../ServiceBusManagementClient.java | 167 +++++++++++++++- .../ServiceBusManagementSerializer.java | 10 +- .../models/NamespaceProperties.java | 12 +- ...sManagementAsyncClientIntegrationTest.java | 169 +++++++++++++--- .../azure/messaging/servicebus/TestUtils.java | 9 - .../ServiceBusManagementSerializerTest.java | 37 ++++ .../session-records/createQueue.json | 10 +- .../createQueueExistingName.json | 8 +- .../session-records/createSubscription.json | 12 +- .../createSubscriptionExistingName.json | 10 +- .../createTopicWithResponse.json | 10 +- .../session-records/deleteQueue.json | 18 +- .../session-records/deleteSubscription.json | 28 +-- .../session-records/deleteTopic.json | 18 +- .../session-records/getNamespace.json | 20 ++ .../resources/session-records/getQueue.json | 8 +- .../session-records/getQueueDoesNotExist.json | 10 +- .../session-records/getQueueExists.json | 22 +++ .../session-records/getQueueExistsFalse.json | 21 ++ .../session-records/getQueueRuntimeInfo.json | 8 +- .../session-records/getSubscription.json | 10 +- .../getSubscriptionDoesNotExist.json | 10 +- .../getSubscriptionExists.json | 22 +++ .../getSubscriptionExistsFalse.json | 22 +++ .../getSubscriptionRuntimeInfo.json | 10 +- .../resources/session-records/getTopic.json | 10 +- .../session-records/getTopicDoesNotExist.json | 10 +- .../session-records/getTopicExists.json | 22 +++ .../session-records/getTopicExistsFalse.json | 21 ++ .../session-records/getTopicRuntimeInfo.json | 10 +- .../resources/session-records/listQueues.json | 8 +- .../session-records/listSubscriptions.json | 10 +- .../resources/session-records/listTopics.json | 8 +- .../src/test/resources/xml/NamespaceEntry.xml | 21 ++ 35 files changed, 814 insertions(+), 170 deletions(-) create mode 100644 sdk/servicebus/azure-messaging-servicebus/src/test/resources/session-records/getNamespace.json create mode 100644 sdk/servicebus/azure-messaging-servicebus/src/test/resources/session-records/getQueueExists.json create mode 100644 sdk/servicebus/azure-messaging-servicebus/src/test/resources/session-records/getQueueExistsFalse.json create mode 100644 sdk/servicebus/azure-messaging-servicebus/src/test/resources/session-records/getSubscriptionExists.json create mode 100644 sdk/servicebus/azure-messaging-servicebus/src/test/resources/session-records/getSubscriptionExistsFalse.json create mode 100644 sdk/servicebus/azure-messaging-servicebus/src/test/resources/session-records/getTopicExists.json create mode 100644 sdk/servicebus/azure-messaging-servicebus/src/test/resources/session-records/getTopicExistsFalse.json create mode 100644 sdk/servicebus/azure-messaging-servicebus/src/test/resources/xml/NamespaceEntry.xml diff --git a/sdk/servicebus/azure-messaging-servicebus/src/main/java/com/azure/messaging/servicebus/ServiceBusManagementAsyncClient.java b/sdk/servicebus/azure-messaging-servicebus/src/main/java/com/azure/messaging/servicebus/ServiceBusManagementAsyncClient.java index 28be13b846f48..b0d698269c94f 100644 --- a/sdk/servicebus/azure-messaging-servicebus/src/main/java/com/azure/messaging/servicebus/ServiceBusManagementAsyncClient.java +++ b/sdk/servicebus/azure-messaging-servicebus/src/main/java/com/azure/messaging/servicebus/ServiceBusManagementAsyncClient.java @@ -6,6 +6,7 @@ import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceClient; import com.azure.core.annotation.ServiceMethod; +import com.azure.core.exception.AzureException; import com.azure.core.exception.ClientAuthenticationException; import com.azure.core.exception.HttpResponseException; import com.azure.core.exception.ResourceExistsException; @@ -31,6 +32,7 @@ import com.azure.messaging.servicebus.implementation.models.CreateSubscriptionBodyContent; import com.azure.messaging.servicebus.implementation.models.CreateTopicBody; import com.azure.messaging.servicebus.implementation.models.CreateTopicBodyContent; +import com.azure.messaging.servicebus.implementation.models.NamespacePropertiesEntry; import com.azure.messaging.servicebus.implementation.models.QueueDescriptionEntry; import com.azure.messaging.servicebus.implementation.models.QueueDescriptionFeed; import com.azure.messaging.servicebus.implementation.models.ResponseLink; @@ -40,6 +42,7 @@ import com.azure.messaging.servicebus.implementation.models.SubscriptionDescriptionFeed; import com.azure.messaging.servicebus.implementation.models.TopicDescriptionEntry; import com.azure.messaging.servicebus.implementation.models.TopicDescriptionFeed; +import com.azure.messaging.servicebus.models.NamespaceProperties; import com.azure.messaging.servicebus.models.QueueDescription; import com.azure.messaging.servicebus.models.QueueRuntimeInfo; import com.azure.messaging.servicebus.models.SubscriptionDescription; @@ -457,6 +460,40 @@ public Mono> getQueueWithResponse(String queueName) { return withContext(context -> getQueueWithResponse(queueName, context, Function.identity())); } + /** + * Gets whether or not a queue with {@code queueName} exists in the Service Bus namespace. + * + * @param queueName Name of the queue. + * + * @return A Mono that completes indicating whether or not the queue exists. + * @throws ClientAuthenticationException if the client's credentials do not have access to modify the + * namespace. + * @throws HttpResponseException If error occurred processing the request. + * @throws IllegalArgumentException if {@code queueName} is an empty string. + * @throws NullPointerException if {@code queueName} is null. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getQueueExists(String queueName) { + return getQueueExistsWithResponse(queueName).map(Response::getValue); + } + + /** + * Gets whether or not a queue with {@code queueName} exists in the Service Bus namespace. + * + * @param queueName Name of the queue. + * + * @return A Mono that completes indicating whether or not the queue exists along with its HTTP response. + * @throws ClientAuthenticationException if the client's credentials do not have access to modify the + * namespace. + * @throws HttpResponseException If error occurred processing the request. + * @throws IllegalArgumentException if {@code queueName} is an empty string. + * @throws NullPointerException if {@code queueName} is null. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getQueueExistsWithResponse(String queueName) { + return getEntityExistsWithResponse(getQueueWithResponse(queueName)); + } + /** * Gets runtime information about the queue. * @@ -495,6 +532,31 @@ public Mono> getQueueRuntimeInfoWithResponse(String q return withContext(context -> getQueueWithResponse(queueName, context, QueueRuntimeInfo::new)); } + /** + * Gets information about the Service Bus namespace. + * + * @return A Mono that completes with information about the Service Bus namespace. + * @throws ClientAuthenticationException if the client's credentials do not have access to the namespace. + * @throws HttpResponseException If error occurred processing the request. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getNamespaceProperties() { + return getNamespacePropertiesWithResponse().map(Response::getValue); + } + + /** + * Gets information about the Service Bus namespace along with its HTTP response. + * + * @return A Mono that completes with information about the namespace and the associated HTTP response. + * @throws ClientAuthenticationException if the client's credentials do not have access to modify the + * namespace. + * @throws HttpResponseException If error occurred processing the request. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getNamespacePropertiesWithResponse() { + return withContext(this::getNamespacePropertiesWithResponse); + } + /** * Gets information about the queue. * @@ -537,6 +599,42 @@ public Mono> getSubscriptionWithResponse(Strin Function.identity())); } + /** + * Gets whether or not a subscription within a topic exists. + * + * @param topicName Name of topic associated with subscription. + * @param subscriptionName Name of the subscription. + * + * @return A Mono that completes indicating whether or not the subscription exists. + * @throws ClientAuthenticationException if the client's credentials do not have access to modify the + * namespace. + * @throws HttpResponseException If error occurred processing the request. + * @throws IllegalArgumentException if {@code subscriptionName} is an empty string. + * @throws NullPointerException if {@code subscriptionName} is null. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getSubscriptionExists(String topicName, String subscriptionName) { + return getSubscriptionExistsWithResponse(topicName, subscriptionName).map(Response::getValue); + } + + /** + * Gets whether or not a subscription within a topic exists. + * + * @param topicName Name of topic associated with subscription. + * @param subscriptionName Name of the subscription. + * + * @return A Mono that completes indicating whether or not the subscription exists along with its HTTP response. + * @throws ClientAuthenticationException if the client's credentials do not have access to modify the + * namespace. + * @throws HttpResponseException If error occurred processing the request. + * @throws IllegalArgumentException if {@code subscriptionName} is an empty string. + * @throws NullPointerException if {@code subscriptionName} is null. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getSubscriptionExistsWithResponse(String topicName, String subscriptionName) { + return getEntityExistsWithResponse(getSubscriptionWithResponse(topicName, subscriptionName)); + } + /** * Gets runtime information about the subscription. * @@ -619,6 +717,40 @@ public Mono> getTopicWithResponse(String topicName) { return withContext(context -> getTopicWithResponse(topicName, context, Function.identity())); } + /** + * Gets whether or not a topic with {@code topicName} exists in the Service Bus namespace. + * + * @param topicName Name of the topic. + * + * @return A Mono that completes indicating whether or not the topic exists. + * @throws ClientAuthenticationException if the client's credentials do not have access to modify the + * namespace. + * @throws HttpResponseException If error occurred processing the request. + * @throws IllegalArgumentException if {@code topicName} is an empty string. + * @throws NullPointerException if {@code topicName} is null. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getTopicExists(String topicName) { + return getTopicExistsWithResponse(topicName).map(Response::getValue); + } + + /** + * Gets whether or not a topic with {@code topicName} exists in the Service Bus namespace. + * + * @param topicName Name of the topic. + * + * @return A Mono that completes indicating whether or not the topic exists along with its HTTP response. + * @throws ClientAuthenticationException if the client's credentials do not have access to modify the + * namespace. + * @throws HttpResponseException If error occurred processing the request. + * @throws IllegalArgumentException if {@code topicName} is an empty string. + * @throws NullPointerException if {@code topicName} is null. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getTopicExistsWithResponse(String topicName) { + return getEntityExistsWithResponse(getTopicWithResponse(topicName)); + } + /** * Gets runtime information about the topic. * @@ -1135,6 +1267,31 @@ Mono> deleteTopicWithResponse(String topicName, Context context) } } + /** + * Gets whether an entity exists. + * + * @param getEntityOperation Operation to get information about entity. If {@link ResourceNotFoundException} is + * thrown, then it is mapped to false. + * @param Entity type. + * + * @return True if the entity exists, false otherwise. + */ + Mono> getEntityExistsWithResponse(Mono> getEntityOperation) { + return getEntityOperation.map(response -> { + // When an entity does not exist, it does not have any description object in it. + final boolean exists = response.getValue() != null; + return (Response) new SimpleResponse<>(response.getRequest(), response.getStatusCode(), + response.getHeaders(), exists); + }) + .onErrorResume(ResourceNotFoundException.class, exception -> { + final HttpResponse response = exception.getResponse(); + final Response result = new SimpleResponse<>(response.getRequest(), response.getStatusCode(), + response.getHeaders(), false); + + return Mono.just(result); + }); + } + /** * Gets a queue with its context. * @@ -1226,6 +1383,30 @@ Mono> getSubscriptionWithResponse(String topicName, String subsc } } + /** + * Gets the namespace properties with its context. + * + * @param context Context to pass into request. + * + * @return A Mono that completes with the {@link NamespaceProperties}. + */ + Mono> getNamespacePropertiesWithResponse(Context context) { + return managementClient.getNamespaces().getWithResponseAsync(context).handle((response, sink) -> { + final NamespacePropertiesEntry entry = response.getValue(); + if (entry == null || entry.getContent() == null) { + sink.error(new AzureException( + "There was no content inside namespace response. Entry: " + response)); + return; + } + + final NamespaceProperties namespaceProperties = entry.getContent().getNamespaceProperties(); + final Response result = new SimpleResponse<>(response.getRequest(), + response.getStatusCode(), response.getHeaders(), namespaceProperties); + + sink.next(result); + }); + } + /** * Gets a topic with its context. * @@ -1541,7 +1722,7 @@ private Response deserializeQueue(Response response) { if (entry == null) { return new SimpleResponse<>(response.getRequest(), response.getStatusCode(), response.getHeaders(), null); } else if (entry.getContent() == null) { - logger.info("entry.getContent() is null. There should have been content returned. Entry: {}", entry); + logger.info("entry.getContent() is null. The entity may not exist. {}", entry); return new SimpleResponse<>(response.getRequest(), response.getStatusCode(), response.getHeaders(), null); } diff --git a/sdk/servicebus/azure-messaging-servicebus/src/main/java/com/azure/messaging/servicebus/ServiceBusManagementClient.java b/sdk/servicebus/azure-messaging-servicebus/src/main/java/com/azure/messaging/servicebus/ServiceBusManagementClient.java index da1e5096a4711..bfd9dcea008f2 100644 --- a/sdk/servicebus/azure-messaging-servicebus/src/main/java/com/azure/messaging/servicebus/ServiceBusManagementClient.java +++ b/sdk/servicebus/azure-messaging-servicebus/src/main/java/com/azure/messaging/servicebus/ServiceBusManagementClient.java @@ -14,12 +14,14 @@ import com.azure.core.http.rest.PagedIterable; import com.azure.core.http.rest.Response; import com.azure.core.util.Context; +import com.azure.messaging.servicebus.models.NamespaceProperties; import com.azure.messaging.servicebus.models.QueueDescription; import com.azure.messaging.servicebus.models.QueueRuntimeInfo; import com.azure.messaging.servicebus.models.SubscriptionDescription; import com.azure.messaging.servicebus.models.SubscriptionRuntimeInfo; import com.azure.messaging.servicebus.models.TopicDescription; import com.azure.messaging.servicebus.models.TopicRuntimeInfo; +import reactor.core.publisher.Mono; import java.time.Duration; import java.util.Objects; @@ -382,7 +384,46 @@ public QueueDescription getQueue(String queueName) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getQueueWithResponse(String queueName, Context context) { - return asyncClient.getQueueWithResponse(queueName, context, Function.identity()).block(); + return asyncClient.getQueueWithResponse(queueName, context != null ? context : Context.NONE, + Function.identity()).block(); + } + + /** + * Gets whether or not a queue with {@code queueName} exists in the Service Bus namespace. + * + * @param queueName Name of the queue. + * + * @return {@code true} if the queue exists; otherwise {@code false}. + * @throws ClientAuthenticationException if the client's credentials do not have access to modify the + * namespace. + * @throws HttpResponseException If error occurred processing the request. + * @throws IllegalArgumentException if {@code queueName} is an empty string. + * @throws NullPointerException if {@code queueName} is null. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public boolean getQueueExists(String queueName) { + final Boolean exists = asyncClient.getQueueExists(queueName).block(); + return exists != null && exists; + } + + /** + * Gets whether or not a queue with {@code queueName} exists in the Service Bus namespace. + * + * @param queueName Name of the queue. + * @param context Additional context that is passed through the HTTP pipeline during the service call. + * + * @return The HTTP response and {@code true} if the queue exists; otherwise {@code false}. + * @throws ClientAuthenticationException if the client's credentials do not have access to modify the + * namespace. + * @throws HttpResponseException If error occurred processing the request. + * @throws IllegalArgumentException if {@code queueName} is an empty string. + * @throws NullPointerException if {@code queueName} is null. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getQueueExistsWithResponse(String queueName, Context context) { + final Mono> queueWithResponse = + asyncClient.getQueueWithResponse(queueName, context != null ? context : Context.NONE, Function.identity()); + return asyncClient.getEntityExistsWithResponse(queueWithResponse).block(); } /** @@ -421,7 +462,35 @@ public QueueRuntimeInfo getQueueRuntimeInfo(String queueName) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getQueueRuntimeInfoWithResponse(String queueName, Context context) { - return asyncClient.getQueueWithResponse(queueName, context, QueueRuntimeInfo::new).block(); + return asyncClient.getQueueWithResponse(queueName, context != null ? context : Context.NONE, + QueueRuntimeInfo::new).block(); + } + + /** + * Gets information about the Service Bus namespace. + * + * @return A Mono that completes with information about the Service Bus namespace. + * @throws ClientAuthenticationException if the client's credentials do not have access to the namespace. + * @throws HttpResponseException If error occurred processing the request. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NamespaceProperties getNamespaceProperties() { + return asyncClient.getNamespaceProperties().block(); + } + + /** + * Gets information about the Service Bus namespace along with its HTTP response. + * + * @param context Additional context that is passed through the HTTP pipeline during the service call. + * + * @return A Mono that completes with information about the namespace and the associated HTTP response. + * @throws ClientAuthenticationException if the client's credentials do not have access to modify the + * namespace. + * @throws HttpResponseException If error occurred processing the request. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getNamespacePropertiesWithResponse(Context context) { + return asyncClient.getNamespacePropertiesWithResponse(context).block(); } /** @@ -463,8 +532,50 @@ public SubscriptionDescription getSubscription(String topicName, String subscrip @ServiceMethod(returns = ReturnType.SINGLE) public Response getSubscriptionWithResponse(String topicName, String subscriptionName, Context context) { - return asyncClient.getSubscriptionWithResponse(topicName, subscriptionName, context, - Function.identity()).block(); + return asyncClient.getSubscriptionWithResponse(topicName, subscriptionName, + context != null ? context : Context.NONE, Function.identity()).block(); + } + + /** + * Gets whether or not a subscription within a topic exists. + * + * @param topicName Name of topic associated with subscription. + * @param subscriptionName Name of the subscription. + * + * @return {@code true} if the subscription exists. + * @throws ClientAuthenticationException if the client's credentials do not have access to modify the + * namespace. + * @throws HttpResponseException If error occurred processing the request. + * @throws IllegalArgumentException if {@code subscriptionName} is an empty string. + * @throws NullPointerException if {@code subscriptionName} is null. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public boolean getSubscriptionExists(String topicName, String subscriptionName) { + final Boolean exists = asyncClient.getSubscriptionExists(topicName, subscriptionName).block(); + return exists != null && exists; + } + + /** + * Gets whether or not a subscription within a topic exists. + * + * @param topicName Name of topic associated with subscription. + * @param subscriptionName Name of the subscription. + * @param context Additional context that is passed through the HTTP pipeline during the service call. + * + * @return The HTTP response and {@code true} if the subscription exists; otherwise {@code false}. + * @throws ClientAuthenticationException if the client's credentials do not have access to modify the + * namespace. + * @throws HttpResponseException If error occurred processing the request. + * @throws IllegalArgumentException if {@code subscriptionName} is an empty string. + * @throws NullPointerException if {@code subscriptionName} is null. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getSubscriptionExistsWithResponse(String topicName, String subscriptionName, + Context context) { + final Mono> subscriptionWithResponse = + asyncClient.getSubscriptionWithResponse(topicName, subscriptionName, + context != null ? context : Context.NONE, Function.identity()); + return asyncClient.getEntityExistsWithResponse(subscriptionWithResponse).block(); } /** @@ -506,8 +617,8 @@ public SubscriptionRuntimeInfo getSubscriptionRuntimeInfo(String topicName, Stri @ServiceMethod(returns = ReturnType.SINGLE) public Response getSubscriptionRuntimeInfoWithResponse(String topicName, String subscriptionName, Context context) { - return asyncClient.getSubscriptionWithResponse(topicName, subscriptionName, context, - SubscriptionRuntimeInfo::new).block(); + return asyncClient.getSubscriptionWithResponse(topicName, subscriptionName, + context != null ? context : Context.NONE, SubscriptionRuntimeInfo::new).block(); } /** @@ -546,7 +657,46 @@ public TopicDescription getTopic(String topicName) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getTopicWithResponse(String topicName, Context context) { - return asyncClient.getTopicWithResponse(topicName, context, Function.identity()).block(); + return asyncClient.getTopicWithResponse(topicName, context != null ? context : Context.NONE, + Function.identity()).block(); + } + + /** + * Gets whether or not a topic with {@code topicName} exists in the Service Bus namespace. + * + * @param topicName Name of the topic. + * + * @return {@code true} if the topic exists. + * @throws ClientAuthenticationException if the client's credentials do not have access to modify the + * namespace. + * @throws HttpResponseException If error occurred processing the request. + * @throws IllegalArgumentException if {@code topicName} is an empty string. + * @throws NullPointerException if {@code topicName} is null. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public boolean getTopicExists(String topicName) { + final Boolean exists = asyncClient.getTopicExists(topicName).block(); + return exists != null && exists; + } + + /** + * Gets whether or not a topic with {@code topicName} exists in the Service Bus namespace. + * + * @param topicName Name of the topic. + * @param context Additional context that is passed through the HTTP pipeline during the service call. + * + * @return The HTTP response and {@code true} if the topic exists; otherwise {@code false}. + * @throws ClientAuthenticationException if the client's credentials do not have access to modify the + * namespace. + * @throws HttpResponseException If error occurred processing the request. + * @throws IllegalArgumentException if {@code topicName} is an empty string. + * @throws NullPointerException if {@code topicName} is null. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getTopicExistsWithResponse(String topicName, Context context) { + final Mono> topicWithResponse = + asyncClient.getTopicWithResponse(topicName, context != null ? context : Context.NONE, Function.identity()); + return asyncClient.getEntityExistsWithResponse(topicWithResponse).block(); } /** @@ -585,7 +735,8 @@ public TopicRuntimeInfo getTopicRuntimeInfo(String topicName) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getTopicRuntimeInfoWithResponse(String topicName, Context context) { - return asyncClient.getTopicWithResponse(topicName, context, TopicRuntimeInfo::new).block(); + return asyncClient.getTopicWithResponse(topicName, context != null ? context : Context.NONE, + TopicRuntimeInfo::new).block(); } /** diff --git a/sdk/servicebus/azure-messaging-servicebus/src/main/java/com/azure/messaging/servicebus/implementation/ServiceBusManagementSerializer.java b/sdk/servicebus/azure-messaging-servicebus/src/main/java/com/azure/messaging/servicebus/implementation/ServiceBusManagementSerializer.java index 883a11d1db3de..33910011c7826 100644 --- a/sdk/servicebus/azure-messaging-servicebus/src/main/java/com/azure/messaging/servicebus/implementation/ServiceBusManagementSerializer.java +++ b/sdk/servicebus/azure-messaging-servicebus/src/main/java/com/azure/messaging/servicebus/implementation/ServiceBusManagementSerializer.java @@ -9,7 +9,6 @@ import com.azure.core.util.serializer.JacksonAdapter; import com.azure.core.util.serializer.SerializerAdapter; import com.azure.core.util.serializer.SerializerEncoding; -import com.azure.messaging.servicebus.implementation.models.ServiceBusManagementError; import java.io.IOException; import java.lang.reflect.Type; @@ -66,12 +65,11 @@ public T deserialize(String value, Type type, SerializerEncoding encoding) t return jacksonAdapter.deserialize(value, type, encoding); } - if (ServiceBusManagementError.class == type) { - final ServiceBusManagementError error = deserialize(value, type); - return (T) error; + if (Object.class == type) { + return (T) value; + } else { + return (T) deserialize(value, type); } - - return (T) value; } @Override diff --git a/sdk/servicebus/azure-messaging-servicebus/src/main/java/com/azure/messaging/servicebus/models/NamespaceProperties.java b/sdk/servicebus/azure-messaging-servicebus/src/main/java/com/azure/messaging/servicebus/models/NamespaceProperties.java index e6046d8031c58..6d13a2560d5b3 100644 --- a/sdk/servicebus/azure-messaging-servicebus/src/main/java/com/azure/messaging/servicebus/models/NamespaceProperties.java +++ b/sdk/servicebus/azure-messaging-servicebus/src/main/java/com/azure/messaging/servicebus/models/NamespaceProperties.java @@ -87,7 +87,7 @@ public String getAlias() { * @param alias the alias value to set. * @return the NamespaceProperties object itself. */ - public NamespaceProperties setAlias(String alias) { + NamespaceProperties setAlias(String alias) { this.alias = alias; return this; } @@ -107,7 +107,7 @@ public OffsetDateTime getCreatedTime() { * @param createdTime the createdTime value to set. * @return the NamespaceProperties object itself. */ - public NamespaceProperties setCreatedTime(OffsetDateTime createdTime) { + NamespaceProperties setCreatedTime(OffsetDateTime createdTime) { this.createdTime = createdTime; return this; } @@ -127,7 +127,7 @@ public MessagingSku getMessagingSku() { * @param messagingSku the messagingSku value to set. * @return the NamespaceProperties object itself. */ - public NamespaceProperties setMessagingSku(MessagingSku messagingSku) { + NamespaceProperties setMessagingSku(MessagingSku messagingSku) { this.messagingSku = messagingSku; return this; } @@ -147,7 +147,7 @@ public Integer getMessagingUnits() { * @param messagingUnits the messagingUnits value to set. * @return the NamespaceProperties object itself. */ - public NamespaceProperties setMessagingUnits(Integer messagingUnits) { + NamespaceProperties setMessagingUnits(Integer messagingUnits) { this.messagingUnits = messagingUnits; return this; } @@ -167,7 +167,7 @@ public OffsetDateTime getModifiedTime() { * @param modifiedTime the modifiedTime value to set. * @return the NamespaceProperties object itself. */ - public NamespaceProperties setModifiedTime(OffsetDateTime modifiedTime) { + NamespaceProperties setModifiedTime(OffsetDateTime modifiedTime) { this.modifiedTime = modifiedTime; return this; } @@ -187,7 +187,7 @@ public String getName() { * @param name the name value to set. * @return the NamespaceProperties object itself. */ - public NamespaceProperties setName(String name) { + NamespaceProperties setName(String name) { this.name = name; return this; } diff --git a/sdk/servicebus/azure-messaging-servicebus/src/test/java/com/azure/messaging/servicebus/ServiceBusManagementAsyncClientIntegrationTest.java b/sdk/servicebus/azure-messaging-servicebus/src/test/java/com/azure/messaging/servicebus/ServiceBusManagementAsyncClientIntegrationTest.java index db02d20dac630..69dd1facf15ae 100644 --- a/sdk/servicebus/azure-messaging-servicebus/src/test/java/com/azure/messaging/servicebus/ServiceBusManagementAsyncClientIntegrationTest.java +++ b/sdk/servicebus/azure-messaging-servicebus/src/test/java/com/azure/messaging/servicebus/ServiceBusManagementAsyncClientIntegrationTest.java @@ -11,6 +11,7 @@ import com.azure.core.http.policy.HttpLogOptions; import com.azure.core.http.policy.RetryPolicy; import com.azure.core.test.TestBase; +import com.azure.messaging.servicebus.models.NamespaceType; import com.azure.messaging.servicebus.models.QueueDescription; import com.azure.messaging.servicebus.models.QueueRuntimeInfo; import com.azure.messaging.servicebus.models.SubscriptionDescription; @@ -19,6 +20,7 @@ import com.azure.messaging.servicebus.models.TopicRuntimeInfo; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Tag; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.MethodSource; @@ -29,6 +31,9 @@ import java.time.OffsetDateTime; import java.util.stream.Stream; +import static com.azure.messaging.servicebus.TestUtils.getEntityName; +import static com.azure.messaging.servicebus.TestUtils.getSessionSubscriptionBaseName; +import static com.azure.messaging.servicebus.TestUtils.getTopicBaseName; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertNotNull; @@ -37,6 +42,7 @@ /** * Tests {@link ServiceBusManagementAsyncClient}. */ +@Tag("integration") class ServiceBusManagementAsyncClientIntegrationTest extends TestBase { private static final Duration TIMEOUT = Duration.ofSeconds(20); @@ -60,7 +66,6 @@ void createQueue(HttpClient httpClient) { // Arrange final ServiceBusManagementAsyncClient client = createClient(httpClient); final String queueName = testResourceNamer.randomName("test", 10); - final OffsetDateTime nowUtc = OffsetDateTime.now(Clock.systemUTC()); final QueueDescription expected = new QueueDescription(queueName) .setMaxSizeInMegabytes(500) .setMaxDeliveryCount(7) @@ -90,7 +95,6 @@ void createQueue(HttpClient httpClient) { assertEquals(0, runtimeInfo.getMessageCount()); assertEquals(0, runtimeInfo.getSizeInBytes()); assertNotNull(runtimeInfo.getCreatedAt()); - assertTrue(nowUtc.isAfter(runtimeInfo.getCreatedAt())); }) .verifyComplete(); } @@ -101,7 +105,7 @@ void createQueueExistingName(HttpClient httpClient) { // Arrange final String queueName = interceptorManager.isPlaybackMode() ? "queue-5" - : TestUtils.getEntityName(TestUtils.getQueueBaseName(), 5); + : getEntityName(TestUtils.getQueueBaseName(), 5); final QueueDescription queueDescription = new QueueDescription(queueName); final ServiceBusManagementAsyncClient client = createClient(httpClient); @@ -117,8 +121,8 @@ void createSubscription(HttpClient httpClient) { // Arrange final ServiceBusManagementAsyncClient client = createClient(httpClient); final String topicName = interceptorManager.isPlaybackMode() - ? "topic" - : TestUtils.getTopicName(); + ? "topic-0" + : getEntityName(getTopicBaseName(), 0); final String subscriptionName = testResourceNamer.randomName("sub", 10); final SubscriptionDescription expected = new SubscriptionDescription(topicName, subscriptionName) .setMaxDeliveryCount(7) @@ -146,11 +150,11 @@ void createSubscription(HttpClient httpClient) { void createSubscriptionExistingName(HttpClient httpClient) { // Arrange final String topicName = interceptorManager.isPlaybackMode() - ? "topic" - : TestUtils.getTopicName(); + ? "topic-1" + : getEntityName(getTopicBaseName(), 1); final String subscriptionName = interceptorManager.isPlaybackMode() - ? "subscription-session-1" - : TestUtils.getEntityName(TestUtils.getSessionSubscriptionBaseName(), 1); + ? "subscription-session" + : getSessionSubscriptionBaseName(); final ServiceBusManagementAsyncClient client = createClient(httpClient); // Act & Assert @@ -165,7 +169,6 @@ void createTopicWithResponse(HttpClient httpClient) { // Arrange final ServiceBusManagementAsyncClient client = createClient(httpClient); final String topicName = testResourceNamer.randomName("test", 10); - final OffsetDateTime nowUtc = OffsetDateTime.now(Clock.systemUTC()); final TopicDescription expected = new TopicDescription(topicName) .setMaxSizeInMegabytes(2048L) .setRequiresDuplicateDetection(true) @@ -193,7 +196,6 @@ void createTopicWithResponse(HttpClient httpClient) { assertEquals(0, runtimeInfo.getSubscriptionCount()); assertEquals(0, runtimeInfo.getSizeInBytes()); assertNotNull(runtimeInfo.getCreatedAt()); - assertTrue(nowUtc.isAfter(runtimeInfo.getCreatedAt())); }) .verifyComplete(); } @@ -249,7 +251,7 @@ void getQueue(HttpClient httpClient) { final ServiceBusManagementAsyncClient client = createClient(httpClient); final String queueName = interceptorManager.isPlaybackMode() ? "queue-5" - : TestUtils.getEntityName(TestUtils.getQueueBaseName(), 5); + : getEntityName(TestUtils.getQueueBaseName(), 5); final OffsetDateTime nowUtc = OffsetDateTime.now(Clock.systemUTC()); // Act & Assert @@ -269,6 +271,28 @@ void getQueue(HttpClient httpClient) { .verifyComplete(); } + @ParameterizedTest + @MethodSource("createHttpClients") + void getNamespace(HttpClient httpClient) { + // Arrange + final ServiceBusManagementAsyncClient client = createClient(httpClient); + final String expectedName; + if (interceptorManager.isPlaybackMode()) { + expectedName = "ShivangiServiceBus"; + } else { + final String[] split = TestUtils.getFullyQualifiedDomainName().split("\\.", 2); + expectedName = split[0]; + } + + // Act & Assert + StepVerifier.create(client.getNamespaceProperties()) + .assertNext(properties -> { + assertEquals(NamespaceType.MESSAGING, properties.getNamespaceType()); + assertEquals(expectedName, properties.getName()); + }) + .verifyComplete(); + } + @ParameterizedTest @MethodSource("createHttpClients") void getQueueDoesNotExist(HttpClient httpClient) { @@ -282,6 +306,34 @@ void getQueueDoesNotExist(HttpClient httpClient) { .verify(); } + @ParameterizedTest + @MethodSource("createHttpClients") + void getQueueExists(HttpClient httpClient) { + // Arrange + final ServiceBusManagementAsyncClient client = createClient(httpClient); + final String queueName = interceptorManager.isPlaybackMode() + ? "queue-2" + : getEntityName(TestUtils.getQueueBaseName(), 2); + + // Act & Assert + StepVerifier.create(client.getQueueExists(queueName)) + .expectNext(true) + .verifyComplete(); + } + + @ParameterizedTest + @MethodSource("createHttpClients") + void getQueueExistsFalse(HttpClient httpClient) { + // Arrange + final ServiceBusManagementAsyncClient client = createClient(httpClient); + final String queueName = testResourceNamer.randomName("exist", 10); + + // Act & Assert + StepVerifier.create(client.getQueueExists(queueName)) + .expectNext(false) + .verifyComplete(); + } + @ParameterizedTest @MethodSource("createHttpClients") void getQueueRuntimeInfo(HttpClient httpClient) { @@ -289,7 +341,7 @@ void getQueueRuntimeInfo(HttpClient httpClient) { final ServiceBusManagementAsyncClient client = createClient(httpClient); final String queueName = interceptorManager.isPlaybackMode() ? "queue-2" - : TestUtils.getEntityName(TestUtils.getQueueBaseName(), 2); + : getEntityName(TestUtils.getQueueBaseName(), 2); final OffsetDateTime nowUtc = OffsetDateTime.now(Clock.systemUTC()); // Act & Assert @@ -309,10 +361,10 @@ void getQueueRuntimeInfo(HttpClient httpClient) { void getSubscription(HttpClient httpClient) { // Arrange final ServiceBusManagementAsyncClient client = createClient(httpClient); - final String topicName = interceptorManager.isPlaybackMode() ? "topic" : TestUtils.getTopicName(); + final String topicName = interceptorManager.isPlaybackMode() ? "topic-1" : getEntityName(getTopicBaseName(), 1); final String subscriptionName = interceptorManager.isPlaybackMode() - ? "subscription-session-1" - : TestUtils.getEntityName(TestUtils.getSessionSubscriptionBaseName(), 1); + ? "subscription-session" + : getSessionSubscriptionBaseName(); final OffsetDateTime nowUtc = OffsetDateTime.now(Clock.systemUTC()); // Act & Assert @@ -337,7 +389,7 @@ void getSubscription(HttpClient httpClient) { void getSubscriptionDoesNotExist(HttpClient httpClient) { // Arrange final ServiceBusManagementAsyncClient client = createClient(httpClient); - final String topicName = interceptorManager.isPlaybackMode() ? "topic" : TestUtils.getTopicName(); + final String topicName = interceptorManager.isPlaybackMode() ? "topic-1" : getEntityName(getTopicBaseName(), 1); final String subscriptionName = "subscription-session-not-exist"; // Act & Assert @@ -346,15 +398,47 @@ void getSubscriptionDoesNotExist(HttpClient httpClient) { .verify(); } + @ParameterizedTest + @MethodSource("createHttpClients") + void getSubscriptionExists(HttpClient httpClient) { + // Arrange + final ServiceBusManagementAsyncClient client = createClient(httpClient); + final String topicName = interceptorManager.isPlaybackMode() + ? "topic-1" + : getEntityName(getTopicBaseName(), 1); + final String subscriptionName = interceptorManager.isPlaybackMode() + ? "subscription-session" + : getSessionSubscriptionBaseName(); + + // Act & Assert + StepVerifier.create(client.getSubscriptionExists(topicName, subscriptionName)) + .expectNext(true) + .verifyComplete(); + } + + @ParameterizedTest + @MethodSource("createHttpClients") + void getSubscriptionExistsFalse(HttpClient httpClient) { + // Arrange + final ServiceBusManagementAsyncClient client = createClient(httpClient); + final String topicName = interceptorManager.isPlaybackMode() ? "topic-1" : getEntityName(getTopicBaseName(), 1); + final String subscriptionName = "subscription-session-not-exist"; + + // Act & Assert + StepVerifier.create(client.getSubscriptionExists(topicName, subscriptionName)) + .expectNext(false) + .verifyComplete(); + } + @ParameterizedTest @MethodSource("createHttpClients") void getSubscriptionRuntimeInfo(HttpClient httpClient) { // Arrange final ServiceBusManagementAsyncClient client = createClient(httpClient); - final String topicName = interceptorManager.isPlaybackMode() ? "topic" : TestUtils.getTopicName(); + final String topicName = interceptorManager.isPlaybackMode() ? "topic-1" : getEntityName(getTopicBaseName(), 1); final String subscriptionName = interceptorManager.isPlaybackMode() - ? "subscription-1" - : TestUtils.getEntityName(TestUtils.getSubscriptionBaseName(), 1); + ? "subscription-session" + : getSessionSubscriptionBaseName(); final OffsetDateTime nowUtc = OffsetDateTime.now(Clock.systemUTC()); // Act & Assert @@ -384,8 +468,8 @@ void getTopic(HttpClient httpClient) { // Arrange final ServiceBusManagementAsyncClient client = createClient(httpClient); final String topicName = interceptorManager.isPlaybackMode() - ? "topic" - : TestUtils.getTopicName(); + ? "topic-1" + : getEntityName(getTopicBaseName(), 1); final OffsetDateTime nowUtc = OffsetDateTime.now(Clock.systemUTC()); // Act & Assert @@ -430,14 +514,42 @@ void getTopicDoesNotExist(HttpClient httpClient) { .verify(); } + @ParameterizedTest + @MethodSource("createHttpClients") + void getTopicExists(HttpClient httpClient) { + // Arrange + final ServiceBusManagementAsyncClient client = createClient(httpClient); + final String topicName = interceptorManager.isPlaybackMode() + ? "topic-1" + : getEntityName(getTopicBaseName(), 1); + + // Act & Assert + StepVerifier.create(client.getTopicExists(topicName)) + .expectNext(true) + .verifyComplete(); + } + + @ParameterizedTest + @MethodSource("createHttpClients") + void getTopicExistsFalse(HttpClient httpClient) { + // Arrange + final ServiceBusManagementAsyncClient client = createClient(httpClient); + final String topicName = testResourceNamer.randomName("exists", 10); + + // Act & Assert + StepVerifier.create(client.getTopicExists(topicName)) + .expectNext(false) + .verifyComplete(); + } + @ParameterizedTest @MethodSource("createHttpClients") void getTopicRuntimeInfo(HttpClient httpClient) { // Arrange final ServiceBusManagementAsyncClient client = createClient(httpClient); final String topicName = interceptorManager.isPlaybackMode() - ? "topic" - : TestUtils.getTopicName(); + ? "topic-1" + : getEntityName(getTopicBaseName(), 1); final OffsetDateTime nowUtc = OffsetDateTime.now(Clock.systemUTC()); // Act & Assert @@ -446,7 +558,7 @@ void getTopicRuntimeInfo(HttpClient httpClient) { assertEquals(topicName, runtimeInfo.getName()); if (interceptorManager.isPlaybackMode()) { - assertEquals(22, runtimeInfo.getSubscriptionCount()); + assertEquals(3, runtimeInfo.getSubscriptionCount()); } else { assertTrue(runtimeInfo.getSubscriptionCount() > 1); } @@ -484,8 +596,8 @@ void listSubscriptions(HttpClient httpClient) { // Arrange final ServiceBusManagementAsyncClient client = createClient(httpClient); final String topicName = interceptorManager.isPlaybackMode() - ? "topic" - : TestUtils.getTopicName(); + ? "topic-1" + : getEntityName(getTopicBaseName(), 1); // Act & Assert StepVerifier.create(client.listSubscriptions(topicName)) @@ -526,6 +638,9 @@ private ServiceBusManagementAsyncClient createClient(HttpClient httpClient) { if (interceptorManager.isPlaybackMode()) { builder.httpClient(interceptorManager.getPlaybackClient()); + } else if (interceptorManager.isLiveMode()) { + builder.httpClient(httpClient) + .addPolicy(new RetryPolicy()); } else { builder.httpClient(httpClient) .addPolicy(interceptorManager.getRecordPolicy()) diff --git a/sdk/servicebus/azure-messaging-servicebus/src/test/java/com/azure/messaging/servicebus/TestUtils.java b/sdk/servicebus/azure-messaging-servicebus/src/test/java/com/azure/messaging/servicebus/TestUtils.java index 9e945b49236cb..3ceae34a1064f 100644 --- a/sdk/servicebus/azure-messaging-servicebus/src/test/java/com/azure/messaging/servicebus/TestUtils.java +++ b/sdk/servicebus/azure-messaging-servicebus/src/test/java/com/azure/messaging/servicebus/TestUtils.java @@ -99,15 +99,6 @@ public static String getSessionQueueBaseName() { return System.getenv("AZURE_SERVICEBUS_SESSION_QUEUE_NAME"); } - /** - * The Service Bus topic name. - * - * @return The Service bus topic name. - */ - public static String getTopicName() { - return System.getenv("AZURE_SERVICEBUS_TOPIC_NAME"); - } - /** * Gets the Service Bus subscription name (NOT session enabled) * diff --git a/sdk/servicebus/azure-messaging-servicebus/src/test/java/com/azure/messaging/servicebus/implementation/ServiceBusManagementSerializerTest.java b/sdk/servicebus/azure-messaging-servicebus/src/test/java/com/azure/messaging/servicebus/implementation/ServiceBusManagementSerializerTest.java index b0b193eb250fa..43180bf17d11c 100644 --- a/sdk/servicebus/azure-messaging-servicebus/src/test/java/com/azure/messaging/servicebus/implementation/ServiceBusManagementSerializerTest.java +++ b/sdk/servicebus/azure-messaging-servicebus/src/test/java/com/azure/messaging/servicebus/implementation/ServiceBusManagementSerializerTest.java @@ -3,6 +3,7 @@ package com.azure.messaging.servicebus.implementation; +import com.azure.messaging.servicebus.implementation.models.NamespacePropertiesEntry; import com.azure.messaging.servicebus.implementation.models.QueueDescriptionEntry; import com.azure.messaging.servicebus.implementation.models.QueueDescriptionEntryContent; import com.azure.messaging.servicebus.implementation.models.QueueDescriptionFeed; @@ -13,6 +14,9 @@ import com.azure.messaging.servicebus.implementation.models.SubscriptionDescriptionFeed; import com.azure.messaging.servicebus.models.EntityStatus; import com.azure.messaging.servicebus.models.MessageCountDetails; +import com.azure.messaging.servicebus.models.MessagingSku; +import com.azure.messaging.servicebus.models.NamespaceProperties; +import com.azure.messaging.servicebus.models.NamespaceType; import com.azure.messaging.servicebus.models.QueueDescription; import com.azure.messaging.servicebus.models.QueueRuntimeInfo; import com.azure.messaging.servicebus.models.SubscriptionDescription; @@ -225,6 +229,39 @@ void deserializeQueueDescriptionFeedPaged() throws IOException { } } + /** + * Verify we can deserialize XML from a GET namespace request. + */ + @Test + void deserializeNamespace() throws IOException { + // Arrange + final String contents = getContents("NamespaceEntry.xml"); + final String name = "ShivangiServiceBus"; + final String alias = "MyServiceBusFallback"; + final OffsetDateTime createdTime = OffsetDateTime.parse("2020-04-09T08:38:55.807Z"); + final OffsetDateTime modifiedTime = OffsetDateTime.parse("2020-06-12T06:34:38.383Z"); + final MessagingSku sku = MessagingSku.PREMIUM; + final NamespaceType namespaceType = NamespaceType.MESSAGING; + + // Act + final NamespacePropertiesEntry entry = serializer.deserialize(contents, NamespacePropertiesEntry.class); + + // Assert + assertNotNull(entry); + assertNotNull(entry.getContent()); + + // The entry title is the name of the queue. + assertTitle(name, entry.getTitle()); + + final NamespaceProperties actual = entry.getContent().getNamespaceProperties(); + assertEquals(name, actual.getName()); + assertEquals(alias, actual.getAlias()); + assertEquals(createdTime, actual.getCreatedTime()); + assertEquals(modifiedTime, actual.getModifiedTime()); + assertEquals(sku, actual.getMessagingSku()); + assertEquals(namespaceType, actual.getNamespaceType()); + } + /** * Verify we can deserialize XML from a GET subscription request. */ diff --git a/sdk/servicebus/azure-messaging-servicebus/src/test/resources/session-records/createQueue.json b/sdk/servicebus/azure-messaging-servicebus/src/test/resources/session-records/createQueue.json index 7c25385d381cb..3ace85d9edb25 100644 --- a/sdk/servicebus/azure-messaging-servicebus/src/test/resources/session-records/createQueue.json +++ b/sdk/servicebus/azure-messaging-servicebus/src/test/resources/session-records/createQueue.json @@ -1,9 +1,9 @@ { "networkCallRecords" : [ { "Method" : "PUT", - "Uri" : "https://REDACTED.servicebus.windows.net/test57869?api-version=2017-04", + "Uri" : "https://REDACTED.servicebus.windows.net/test18701?api-version=2017-04", "Headers" : { - "User-Agent" : "azsdk-java-azure-messaging-servicebus/7.0.0-beta.4 (11.0.5; Windows 10 10.0)", + "User-Agent" : "azsdk-java-azure-messaging-servicebus/7.0.0-beta.4 (11.0.5; Windows 10; 10.0)", "Content-Type" : "application/xml" }, "Response" : { @@ -12,11 +12,11 @@ "Server" : "Microsoft-HTTPAPI/2.0", "retry-after" : "0", "StatusCode" : "201", - "Body" : "https://sb-java-conniey-5.servicebus.windows.net/test57869?api-version=2017-04test578692020-06-30T23:20:51Z2020-06-30T23:20:51Zsb-java-conniey-5test57869PT1M1024falsefalseP10675199DT2H48M5.4775807SfalsePT10M10true00falseActive2020-06-30T23:20:51.81Z2020-06-30T23:20:51.897ZtrueP10675199DT2H48M5.477SP10675199DT2H48M5.477SfalsePT2MtruefalsePT45S7500truetruesome-metadata-for-testingAvailablefalse", - "Date" : "Tue, 30 Jun 2020 23:20:52 GMT", + "Body" : "https://sb-java-conniey-1.servicebus.windows.net/test18701?api-version=2017-04test187012020-07-02T22:49:08Z2020-07-02T22:49:08Zsb-java-conniey-1test18701PT1M1024falsefalseP10675199DT2H48M5.4775807SfalsePT10M10true00falseActive2020-07-02T22:49:08.847Z2020-07-02T22:49:08.88ZtrueP10675199DT2H48M5.477SP10675199DT2H48M5.477SfalsePT2MtruefalsePT45S7500truetruesome-metadata-for-testingAvailablefalse", + "Date" : "Thu, 02 Jul 2020 22:49:08 GMT", "Content-Type" : "application/atom+xml;type=entry;charset=utf-8" }, "Exception" : null } ], - "variables" : [ "test57869" ] + "variables" : [ "test18701" ] } \ No newline at end of file diff --git a/sdk/servicebus/azure-messaging-servicebus/src/test/resources/session-records/createQueueExistingName.json b/sdk/servicebus/azure-messaging-servicebus/src/test/resources/session-records/createQueueExistingName.json index 9606c67998d31..d2c3884b5c862 100644 --- a/sdk/servicebus/azure-messaging-servicebus/src/test/resources/session-records/createQueueExistingName.json +++ b/sdk/servicebus/azure-messaging-servicebus/src/test/resources/session-records/createQueueExistingName.json @@ -3,18 +3,18 @@ "Method" : "PUT", "Uri" : "https://REDACTED.servicebus.windows.net/queue-5?api-version=2017-04", "Headers" : { - "User-Agent" : "azsdk-java-azure-messaging-servicebus/7.0.0-beta.3 (11.0.5; Windows 10 10.0)", + "User-Agent" : "azsdk-java-azure-messaging-servicebus/7.0.0-beta.4 (11.0.5; Windows 10; 10.0)", "Content-Type" : "application/xml" }, "Response" : { "Transfer-Encoding" : "chunked", "Strict-Transport-Security" : "max-age=31536000", "Server" : "Microsoft-HTTPAPI/2.0", - "ETag" : "637271971426770000", + "ETag" : "637293228523600000", "retry-after" : "0", "StatusCode" : "409", - "Body" : "409SubCode=40900. Conflict. You're requesting an operation that isn't allowed in the resource's current state. To know more visit https://aka.ms/sbResourceMgrExceptions. . TrackingId:6b1c42e7-0272-4499-9848-fb60303c56a7_G0, SystemTracker:sb-java-conniey-4.servicebus.windows.net:queue-5, Timestamp:2020-06-08T07:14:45", - "Date" : "Mon, 08 Jun 2020 07:14:45 GMT", + "Body" : "409SubCode=40900. Conflict. You're requesting an operation that isn't allowed in the resource's current state. To know more visit https://aka.ms/sbResourceMgrExceptions. . TrackingId:65bf6389-d9e3-48db-a037-528c71f0fcfa_G4, SystemTracker:sb-java-conniey-1.servicebus.windows.net:queue-5, Timestamp:2020-07-02T22:49:02", + "Date" : "Thu, 02 Jul 2020 22:49:02 GMT", "Content-Type" : "application/xml; charset=utf-8" }, "Exception" : null diff --git a/sdk/servicebus/azure-messaging-servicebus/src/test/resources/session-records/createSubscription.json b/sdk/servicebus/azure-messaging-servicebus/src/test/resources/session-records/createSubscription.json index d47d25104e886..ee7686e6357d0 100644 --- a/sdk/servicebus/azure-messaging-servicebus/src/test/resources/session-records/createSubscription.json +++ b/sdk/servicebus/azure-messaging-servicebus/src/test/resources/session-records/createSubscription.json @@ -1,23 +1,23 @@ { "networkCallRecords" : [ { "Method" : "PUT", - "Uri" : "https://REDACTED.servicebus.windows.net/topic/subscriptions/sub042579?api-version=2017-04", + "Uri" : "https://REDACTED.servicebus.windows.net/topic-0/subscriptions/sub58016a?api-version=2017-04", "Headers" : { - "User-Agent" : "azsdk-java-azure-messaging-servicebus/7.0.0-beta.4 (11.0.5; Windows 10 10.0)", + "User-Agent" : "azsdk-java-azure-messaging-servicebus/7.0.0-beta.4 (11.0.5; Windows 10; 10.0)", "Content-Type" : "application/xml" }, "Response" : { "Transfer-Encoding" : "chunked", "Strict-Transport-Security" : "max-age=31536000", "Server" : "Microsoft-HTTPAPI/2.0", - "ETag" : "637284664716270000", + "ETag" : "637293228524970000", "retry-after" : "0", "StatusCode" : "201", - "Body" : "https://sb-java-conniey-5.servicebus.windows.net/topic/subscriptions/sub042579?api-version=2017-04sub0425792020-07-01T05:36:06Z2020-07-01T05:36:06ZPT45SfalseP10675199DT2H48M5.477Sfalsetrue07trueActive2020-07-01T05:36:06.6292417Z2020-07-01T05:36:06.6292417Z0001-01-01T00:00:00some-metadata-for-testing-subscriptionsP10675199DT2H48M5.477SAvailable", - "Date" : "Wed, 01 Jul 2020 05:36:08 GMT", + "Body" : "https://sb-java-conniey-1.servicebus.windows.net/topic-0/subscriptions/sub58016a?api-version=2017-04sub58016a2020-07-02T22:49:02Z2020-07-02T22:49:02ZPT45SfalseP10675199DT2H48M5.477Sfalsetrue07trueActive2020-07-02T22:49:02.1161757Z2020-07-02T22:49:02.1161757Z0001-01-01T00:00:00some-metadata-for-testing-subscriptionsP10675199DT2H48M5.477SAvailable", + "Date" : "Thu, 02 Jul 2020 22:49:01 GMT", "Content-Type" : "application/atom+xml;type=entry;charset=utf-8" }, "Exception" : null } ], - "variables" : [ "sub042579" ] + "variables" : [ "sub58016a" ] } \ No newline at end of file diff --git a/sdk/servicebus/azure-messaging-servicebus/src/test/resources/session-records/createSubscriptionExistingName.json b/sdk/servicebus/azure-messaging-servicebus/src/test/resources/session-records/createSubscriptionExistingName.json index cd6d4fbb0b91d..0749288c9b7cb 100644 --- a/sdk/servicebus/azure-messaging-servicebus/src/test/resources/session-records/createSubscriptionExistingName.json +++ b/sdk/servicebus/azure-messaging-servicebus/src/test/resources/session-records/createSubscriptionExistingName.json @@ -1,20 +1,20 @@ { "networkCallRecords" : [ { "Method" : "PUT", - "Uri" : "https://REDACTED.servicebus.windows.net/topic/subscriptions/subscription-session-1?api-version=2017-04", + "Uri" : "https://REDACTED.servicebus.windows.net/topic-1/subscriptions/subscription-session?api-version=2017-04", "Headers" : { - "User-Agent" : "azsdk-java-azure-messaging-servicebus/7.0.0-beta.4 (11.0.5; Windows 10 10.0)", + "User-Agent" : "azsdk-java-azure-messaging-servicebus/7.0.0-beta.4 (11.0.5; Windows 10; 10.0)", "Content-Type" : "application/xml" }, "Response" : { "Transfer-Encoding" : "chunked", "Strict-Transport-Security" : "max-age=31536000", "Server" : "Microsoft-HTTPAPI/2.0", - "ETag" : "637284664716270000", + "ETag" : "637293228523500000", "retry-after" : "0", "StatusCode" : "409", - "Body" : "409Entity 'sb-java-conniey-5:Topic:topic|subscription-session-1' already exists. TrackingId:d57d27d9-ce2a-4c8e-ad10-3c81cf96f556_G6_B4, SystemTracker:sb-java-conniey-5:Topic:topic|subscription-session-1, Timestamp:2020-07-01T08:02:23", - "Date" : "Wed, 01 Jul 2020 08:02:23 GMT", + "Body" : "409Entity 'sb-java-conniey-1:Topic:topic-1|subscription-session' already exists. TrackingId:01769f7c-52a6-4783-88c1-1d7d49027d9a_G25_B7, SystemTracker:sb-java-conniey-1:Topic:topic-1|subscription-session, Timestamp:2020-07-03T00:43:40", + "Date" : "Fri, 03 Jul 2020 00:43:41 GMT", "Content-Type" : "application/xml; charset=utf-8" }, "Exception" : null diff --git a/sdk/servicebus/azure-messaging-servicebus/src/test/resources/session-records/createTopicWithResponse.json b/sdk/servicebus/azure-messaging-servicebus/src/test/resources/session-records/createTopicWithResponse.json index d192d4a456af3..fd8af5149f18c 100644 --- a/sdk/servicebus/azure-messaging-servicebus/src/test/resources/session-records/createTopicWithResponse.json +++ b/sdk/servicebus/azure-messaging-servicebus/src/test/resources/session-records/createTopicWithResponse.json @@ -1,9 +1,9 @@ { "networkCallRecords" : [ { "Method" : "PUT", - "Uri" : "https://REDACTED.servicebus.windows.net/test23290?api-version=2017-04", + "Uri" : "https://REDACTED.servicebus.windows.net/test50863?api-version=2017-04", "Headers" : { - "User-Agent" : "azsdk-java-azure-messaging-servicebus/7.0.0-beta.4 (11.0.5; Windows 10 10.0)", + "User-Agent" : "azsdk-java-azure-messaging-servicebus/7.0.0-beta.4 (11.0.5; Windows 10; 10.0)", "Content-Type" : "application/xml" }, "Response" : { @@ -12,11 +12,11 @@ "Server" : "Microsoft-HTTPAPI/2.0", "retry-after" : "0", "StatusCode" : "201", - "Body" : "https://sb-java-conniey-5.servicebus.windows.net/test23290?api-version=2017-04test232902020-07-01T08:35:41Z2020-07-01T08:35:41Zsb-java-conniey-5test23290P10675199DT2H48M5.477S2048truePT2Mtrue0falsefalseActive2020-07-01T08:35:41.32Z2020-07-01T08:35:41.367ZfalseP10675199DT2H48M5.477Sfalsesome-metadata-for-testing-topicAvailablefalsefalse", - "Date" : "Wed, 01 Jul 2020 08:35:41 GMT", + "Body" : "https://sb-java-conniey-1.servicebus.windows.net/test50863?api-version=2017-04test508632020-07-02T22:49:12Z2020-07-02T22:49:12Zsb-java-conniey-1test50863P10675199DT2H48M5.477S2048truePT2Mtrue0falsefalseActive2020-07-02T22:49:12.47Z2020-07-02T22:49:12.56ZfalseP10675199DT2H48M5.477Sfalsesome-metadata-for-testing-topicAvailablefalsefalse", + "Date" : "Thu, 02 Jul 2020 22:49:12 GMT", "Content-Type" : "application/atom+xml;type=entry;charset=utf-8" }, "Exception" : null } ], - "variables" : [ "test23290" ] + "variables" : [ "test50863" ] } \ No newline at end of file diff --git a/sdk/servicebus/azure-messaging-servicebus/src/test/resources/session-records/deleteQueue.json b/sdk/servicebus/azure-messaging-servicebus/src/test/resources/session-records/deleteQueue.json index 65feca32e72b5..b5ebc8f721287 100644 --- a/sdk/servicebus/azure-messaging-servicebus/src/test/resources/session-records/deleteQueue.json +++ b/sdk/servicebus/azure-messaging-servicebus/src/test/resources/session-records/deleteQueue.json @@ -1,9 +1,9 @@ { "networkCallRecords" : [ { "Method" : "PUT", - "Uri" : "https://REDACTED.servicebus.windows.net/sub535673?api-version=2017-04", + "Uri" : "https://REDACTED.servicebus.windows.net/sub389454?api-version=2017-04", "Headers" : { - "User-Agent" : "azsdk-java-azure-messaging-servicebus/7.0.0-beta.4 (11.0.5; Windows 10 10.0)", + "User-Agent" : "azsdk-java-azure-messaging-servicebus/7.0.0-beta.4 (11.0.5; Windows 10; 10.0)", "Content-Type" : "application/xml" }, "Response" : { @@ -12,27 +12,27 @@ "Server" : "Microsoft-HTTPAPI/2.0", "retry-after" : "0", "StatusCode" : "201", - "Body" : "https://sb-java-conniey-5.servicebus.windows.net/sub535673?api-version=2017-04sub5356732020-07-01T06:42:09Z2020-07-01T06:42:09Zsb-java-conniey-5sub535673PT1M1024falsefalseP10675199DT2H48M5.4775807SfalsePT10M10true00falseActive2020-07-01T06:42:09.16Z2020-07-01T06:42:09.233ZtrueP10675199DT2H48M5.477SP10675199DT2H48M5.477SfalsePT1MtruefalsePT1M101024falsefalseAvailablefalse", - "Date" : "Wed, 01 Jul 2020 06:42:09 GMT", + "Body" : "https://sb-java-conniey-1.servicebus.windows.net/sub389454?api-version=2017-04sub3894542020-07-02T22:49:03Z2020-07-02T22:49:03Zsb-java-conniey-1sub389454PT1M1024falsefalseP10675199DT2H48M5.4775807SfalsePT10M10true00falseActive2020-07-02T22:49:03.04Z2020-07-02T22:49:03.087ZtrueP10675199DT2H48M5.477SP10675199DT2H48M5.477SfalsePT1MtruefalsePT1M101024falsefalseAvailablefalse", + "Date" : "Thu, 02 Jul 2020 22:49:03 GMT", "Content-Type" : "application/atom+xml;type=entry;charset=utf-8" }, "Exception" : null }, { "Method" : "DELETE", - "Uri" : "https://REDACTED.servicebus.windows.net/sub535673?api-version=2017-04", + "Uri" : "https://REDACTED.servicebus.windows.net/sub389454?api-version=2017-04", "Headers" : { - "User-Agent" : "azsdk-java-azure-messaging-servicebus/7.0.0-beta.4 (11.0.5; Windows 10 10.0)" + "User-Agent" : "azsdk-java-azure-messaging-servicebus/7.0.0-beta.4 (11.0.5; Windows 10; 10.0)" }, "Response" : { "Strict-Transport-Security" : "max-age=31536000", "Server" : "Microsoft-HTTPAPI/2.0", - "ETag" : "637291825292330000", + "ETag" : "637293269430870000", "retry-after" : "0", "Content-Length" : "0", "StatusCode" : "200", - "Date" : "Wed, 01 Jul 2020 06:42:10 GMT" + "Date" : "Thu, 02 Jul 2020 22:49:03 GMT" }, "Exception" : null } ], - "variables" : [ "sub535673" ] + "variables" : [ "sub389454" ] } \ No newline at end of file diff --git a/sdk/servicebus/azure-messaging-servicebus/src/test/resources/session-records/deleteSubscription.json b/sdk/servicebus/azure-messaging-servicebus/src/test/resources/session-records/deleteSubscription.json index 6cc5ec4b3f841..19855ceb0f493 100644 --- a/sdk/servicebus/azure-messaging-servicebus/src/test/resources/session-records/deleteSubscription.json +++ b/sdk/servicebus/azure-messaging-servicebus/src/test/resources/session-records/deleteSubscription.json @@ -1,9 +1,9 @@ { "networkCallRecords" : [ { "Method" : "PUT", - "Uri" : "https://REDACTED.servicebus.windows.net/topic97369?api-version=2017-04", + "Uri" : "https://REDACTED.servicebus.windows.net/topic08886?api-version=2017-04", "Headers" : { - "User-Agent" : "azsdk-java-azure-messaging-servicebus/7.0.0-beta.4 (11.0.5; Windows 10 10.0)", + "User-Agent" : "azsdk-java-azure-messaging-servicebus/7.0.0-beta.4 (11.0.5; Windows 10; 10.0)", "Content-Type" : "application/xml" }, "Response" : { @@ -12,46 +12,46 @@ "Server" : "Microsoft-HTTPAPI/2.0", "retry-after" : "0", "StatusCode" : "201", - "Body" : "https://sb-java-conniey-5.servicebus.windows.net/topic97369?api-version=2017-04topic973692020-07-01T08:24:27Z2020-07-01T08:24:27Zsb-java-conniey-5topic97369P10675199DT2H48M5.477S1024falsePT1Mtrue0falsefalseActive2020-07-01T08:24:27.193Z2020-07-01T08:24:27.333ZfalseP10675199DT2H48M5.477SfalseAvailablefalsefalse", - "Date" : "Wed, 01 Jul 2020 08:24:27 GMT", + "Body" : "https://sb-java-conniey-1.servicebus.windows.net/topic08886?api-version=2017-04topic088862020-07-02T22:49:06Z2020-07-02T22:49:06Zsb-java-conniey-1topic08886P10675199DT2H48M5.477S1024falsePT1Mtrue0falsefalseActive2020-07-02T22:49:06.843Z2020-07-02T22:49:06.89ZfalseP10675199DT2H48M5.477SfalseAvailablefalsefalse", + "Date" : "Thu, 02 Jul 2020 22:49:06 GMT", "Content-Type" : "application/atom+xml;type=entry;charset=utf-8" }, "Exception" : null }, { "Method" : "PUT", - "Uri" : "https://REDACTED.servicebus.windows.net/topic97369/subscriptions/cc1d77b?api-version=2017-04", + "Uri" : "https://REDACTED.servicebus.windows.net/topic08886/subscriptions/5336d4f?api-version=2017-04", "Headers" : { - "User-Agent" : "azsdk-java-azure-messaging-servicebus/7.0.0-beta.4 (11.0.5; Windows 10 10.0)", + "User-Agent" : "azsdk-java-azure-messaging-servicebus/7.0.0-beta.4 (11.0.5; Windows 10; 10.0)", "Content-Type" : "application/xml" }, "Response" : { "Transfer-Encoding" : "chunked", "Strict-Transport-Security" : "max-age=31536000", "Server" : "Microsoft-HTTPAPI/2.0", - "ETag" : "637291886673330000", + "ETag" : "637293269468900000", "retry-after" : "0", "StatusCode" : "201", - "Body" : "https://sb-java-conniey-5.servicebus.windows.net/topic97369/subscriptions/cc1d77b?api-version=2017-04cc1d77b2020-07-01T08:24:27Z2020-07-01T08:24:27ZPT1MfalseP10675199DT2H48M5.477Sfalsetrue010trueActive2020-07-01T08:24:27.8665339Z2020-07-01T08:24:27.8665339Z0001-01-01T00:00:00P10675199DT2H48M5.477SAvailable", - "Date" : "Wed, 01 Jul 2020 08:24:27 GMT", + "Body" : "https://sb-java-conniey-1.servicebus.windows.net/topic08886/subscriptions/5336d4f?api-version=2017-045336d4f2020-07-02T22:49:07Z2020-07-02T22:49:07ZPT1MfalseP10675199DT2H48M5.477Sfalsetrue010trueActive2020-07-02T22:49:07.3503133Z2020-07-02T22:49:07.3503133Z0001-01-01T00:00:00P10675199DT2H48M5.477SAvailable", + "Date" : "Thu, 02 Jul 2020 22:49:06 GMT", "Content-Type" : "application/atom+xml;type=entry;charset=utf-8" }, "Exception" : null }, { "Method" : "DELETE", - "Uri" : "https://REDACTED.servicebus.windows.net/topic97369/subscriptions/cc1d77b?api-version=2017-04", + "Uri" : "https://REDACTED.servicebus.windows.net/topic08886/subscriptions/5336d4f?api-version=2017-04", "Headers" : { - "User-Agent" : "azsdk-java-azure-messaging-servicebus/7.0.0-beta.4 (11.0.5; Windows 10 10.0)" + "User-Agent" : "azsdk-java-azure-messaging-servicebus/7.0.0-beta.4 (11.0.5; Windows 10; 10.0)" }, "Response" : { "Strict-Transport-Security" : "max-age=31536000", "Server" : "Microsoft-HTTPAPI/2.0", - "ETag" : "637291886673330000", + "ETag" : "637293269468900000", "retry-after" : "0", "Content-Length" : "0", "StatusCode" : "200", - "Date" : "Wed, 01 Jul 2020 08:24:27 GMT" + "Date" : "Thu, 02 Jul 2020 22:49:07 GMT" }, "Exception" : null } ], - "variables" : [ "topic97369", "cc1d77b" ] + "variables" : [ "topic08886", "5336d4f" ] } \ No newline at end of file diff --git a/sdk/servicebus/azure-messaging-servicebus/src/test/resources/session-records/deleteTopic.json b/sdk/servicebus/azure-messaging-servicebus/src/test/resources/session-records/deleteTopic.json index ec5a0b577ef90..91e904d2e9ec7 100644 --- a/sdk/servicebus/azure-messaging-servicebus/src/test/resources/session-records/deleteTopic.json +++ b/sdk/servicebus/azure-messaging-servicebus/src/test/resources/session-records/deleteTopic.json @@ -1,9 +1,9 @@ { "networkCallRecords" : [ { "Method" : "PUT", - "Uri" : "https://REDACTED.servicebus.windows.net/topic50379?api-version=2017-04", + "Uri" : "https://REDACTED.servicebus.windows.net/topic00952?api-version=2017-04", "Headers" : { - "User-Agent" : "azsdk-java-azure-messaging-servicebus/7.0.0-beta.4 (11.0.5; Windows 10 10.0)", + "User-Agent" : "azsdk-java-azure-messaging-servicebus/7.0.0-beta.4 (11.0.5; Windows 10; 10.0)", "Content-Type" : "application/xml" }, "Response" : { @@ -12,27 +12,27 @@ "Server" : "Microsoft-HTTPAPI/2.0", "retry-after" : "0", "StatusCode" : "201", - "Body" : "https://sb-java-conniey-5.servicebus.windows.net/topic50379?api-version=2017-04topic503792020-07-01T08:24:37Z2020-07-01T08:24:37Zsb-java-conniey-5topic50379P10675199DT2H48M5.477S1024falsePT1Mtrue0falsefalseActive2020-07-01T08:24:37.21Z2020-07-01T08:24:37.25ZfalseP10675199DT2H48M5.477SfalseAvailablefalsefalse", - "Date" : "Wed, 01 Jul 2020 08:24:37 GMT", + "Body" : "https://sb-java-conniey-1.servicebus.windows.net/topic00952?api-version=2017-04topic009522020-07-02T22:49:04Z2020-07-02T22:49:04Zsb-java-conniey-1topic00952P10675199DT2H48M5.477S1024falsePT1Mtrue0falsefalseActive2020-07-02T22:49:04.55Z2020-07-02T22:49:04.583ZfalseP10675199DT2H48M5.477SfalseAvailablefalsefalse", + "Date" : "Thu, 02 Jul 2020 22:49:04 GMT", "Content-Type" : "application/atom+xml;type=entry;charset=utf-8" }, "Exception" : null }, { "Method" : "DELETE", - "Uri" : "https://REDACTED.servicebus.windows.net/topic50379?api-version=2017-04", + "Uri" : "https://REDACTED.servicebus.windows.net/topic00952?api-version=2017-04", "Headers" : { - "User-Agent" : "azsdk-java-azure-messaging-servicebus/7.0.0-beta.4 (11.0.5; Windows 10 10.0)" + "User-Agent" : "azsdk-java-azure-messaging-servicebus/7.0.0-beta.4 (11.0.5; Windows 10; 10.0)" }, "Response" : { "Strict-Transport-Security" : "max-age=31536000", "Server" : "Microsoft-HTTPAPI/2.0", - "ETag" : "637291886772500000", + "ETag" : "637293269445830000", "retry-after" : "0", "Content-Length" : "0", "StatusCode" : "200", - "Date" : "Wed, 01 Jul 2020 08:24:38 GMT" + "Date" : "Thu, 02 Jul 2020 22:49:05 GMT" }, "Exception" : null } ], - "variables" : [ "topic50379" ] + "variables" : [ "topic00952" ] } \ No newline at end of file diff --git a/sdk/servicebus/azure-messaging-servicebus/src/test/resources/session-records/getNamespace.json b/sdk/servicebus/azure-messaging-servicebus/src/test/resources/session-records/getNamespace.json new file mode 100644 index 0000000000000..73bafcec84766 --- /dev/null +++ b/sdk/servicebus/azure-messaging-servicebus/src/test/resources/session-records/getNamespace.json @@ -0,0 +1,20 @@ +{ + "networkCallRecords" : [ { + "Method" : "GET", + "Uri" : "https://REDACTED.servicebus.windows.net/$namespaceinfo?api-version=2017-04", + "Headers" : { + "User-Agent" : "azsdk-java-azure-messaging-servicebus/7.0.0-beta.4 (11.0.5; Windows 10; 10.0)" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "Server" : "Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "StatusCode" : "200", + "Body" : "https://shivangiservicebus.servicebus.windows.net/$namespaceinfo?api-version=2017-04ShivangiServiceBus2020-07-02T09:53:19ZShivangiServiceBusServiceBusFallback2020-04-09T08:38:55.807ZPremium12020-06-12T06:34:38.383ZShivangiServiceBusMessaging", + "Date" : "Thu, 02 Jul 2020 09:53:19 GMT", + "Content-Type" : "application/atom+xml;type=entry;charset=utf-8" + }, + "Exception" : null + } ], + "variables" : [ ] +} diff --git a/sdk/servicebus/azure-messaging-servicebus/src/test/resources/session-records/getQueue.json b/sdk/servicebus/azure-messaging-servicebus/src/test/resources/session-records/getQueue.json index 1d3e1e91689c2..eb1af06a5f43d 100644 --- a/sdk/servicebus/azure-messaging-servicebus/src/test/resources/session-records/getQueue.json +++ b/sdk/servicebus/azure-messaging-servicebus/src/test/resources/session-records/getQueue.json @@ -3,17 +3,17 @@ "Method" : "GET", "Uri" : "https://REDACTED.servicebus.windows.net/queue-5?enrich=true&api-version=2017-04", "Headers" : { - "User-Agent" : "azsdk-java-azure-messaging-servicebus/7.0.0-beta.3 (11.0.5; Windows 10 10.0)" + "User-Agent" : "azsdk-java-azure-messaging-servicebus/7.0.0-beta.4 (11.0.5; Windows 10; 10.0)" }, "Response" : { "Transfer-Encoding" : "chunked", "Strict-Transport-Security" : "max-age=31536000", "Server" : "Microsoft-HTTPAPI/2.0", - "ETag" : "637271971426770000", + "ETag" : "637293228523600000", "retry-after" : "0", "StatusCode" : "200", - "Body" : "https://sb-java-conniey-4.servicebus.windows.net/queue-5?enrich=true&api-version=2017-04queue-52020-06-08T07:12:22Z2020-06-08T07:12:22Zsb-java-conniey-4queue-5PT1M1024falsefalseP10675199DT2H48M5.4775807SfalsePT10M10true00falseActive2020-06-08T07:12:22.49067Z2020-06-08T07:12:22.49067Z0001-01-01T00:00:00Ztrue00000P10675199DT2H48M5.4775807SfalseAvailablefalse", - "Date" : "Mon, 08 Jun 2020 07:14:59 GMT", + "Body" : "https://sb-java-conniey-1.servicebus.windows.net/queue-5?enrich=true&api-version=2017-04queue-52020-07-02T21:40:52Z2020-07-02T21:40:52Zsb-java-conniey-1PT15S5120falsefalseP10675199DT2H48M5.4775807SfalsePT10M5true00falseActive2020-07-02T21:40:52.3370279Z2020-07-02T21:40:52.3370279Z0001-01-01T00:00:00Ztrue00000P10675199DT2H48M5.4775807SfalseAvailablefalse", + "Date" : "Thu, 02 Jul 2020 22:49:16 GMT", "Content-Type" : "application/atom+xml;type=entry;charset=utf-8" }, "Exception" : null diff --git a/sdk/servicebus/azure-messaging-servicebus/src/test/resources/session-records/getQueueDoesNotExist.json b/sdk/servicebus/azure-messaging-servicebus/src/test/resources/session-records/getQueueDoesNotExist.json index 89d8eaec52049..b97f5ee093ea7 100644 --- a/sdk/servicebus/azure-messaging-servicebus/src/test/resources/session-records/getQueueDoesNotExist.json +++ b/sdk/servicebus/azure-messaging-servicebus/src/test/resources/session-records/getQueueDoesNotExist.json @@ -1,9 +1,9 @@ { "networkCallRecords" : [ { "Method" : "GET", - "Uri" : "https://REDACTED.servicebus.windows.net/exist59740?enrich=true&api-version=2017-04", + "Uri" : "https://REDACTED.servicebus.windows.net/exist85316?enrich=true&api-version=2017-04", "Headers" : { - "User-Agent" : "azsdk-java-azure-messaging-servicebus/7.0.0-beta.4 (11.0.5; Windows 10 10.0)" + "User-Agent" : "azsdk-java-azure-messaging-servicebus/7.0.0-beta.4 (11.0.5; Windows 10; 10.0)" }, "Response" : { "Transfer-Encoding" : "chunked", @@ -11,11 +11,11 @@ "Server" : "Microsoft-HTTPAPI/2.0", "retry-after" : "0", "StatusCode" : "200", - "Body" : "Publicly Listed ServicesThis is the list of publicly-listed services currently available.uuid:d4b3e5c3-871a-4c95-8ef2-16f787517690;id=72842020-07-02T04:54:10ZService Bus 1.1", - "Date" : "Thu, 02 Jul 2020 04:54:10 GMT", + "Body" : "Publicly Listed ServicesThis is the list of publicly-listed services currently available.uuid:b2a5260d-7d50-405b-9cc5-d5e365e93c0b;id=44852020-07-02T22:49:06ZService Bus 1.1", + "Date" : "Thu, 02 Jul 2020 22:49:05 GMT", "Content-Type" : "application/atom+xml;type=feed;charset=utf-8" }, "Exception" : null } ], - "variables" : [ "exist59740" ] + "variables" : [ "exist85316" ] } \ No newline at end of file diff --git a/sdk/servicebus/azure-messaging-servicebus/src/test/resources/session-records/getQueueExists.json b/sdk/servicebus/azure-messaging-servicebus/src/test/resources/session-records/getQueueExists.json new file mode 100644 index 0000000000000..06b0cfaf56d92 --- /dev/null +++ b/sdk/servicebus/azure-messaging-servicebus/src/test/resources/session-records/getQueueExists.json @@ -0,0 +1,22 @@ +{ + "networkCallRecords" : [ { + "Method" : "GET", + "Uri" : "https://REDACTED.servicebus.windows.net/queue-2?enrich=true&api-version=2017-04", + "Headers" : { + "User-Agent" : "azsdk-java-azure-messaging-servicebus/7.0.0-beta.4 (11.0.5; Windows 10; 10.0)" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "Strict-Transport-Security" : "max-age=31536000", + "Server" : "Microsoft-HTTPAPI/2.0", + "ETag" : "637293228523500000", + "retry-after" : "0", + "StatusCode" : "200", + "Body" : "https://sb-java-conniey-1.servicebus.windows.net/queue-2?enrich=true&api-version=2017-04queue-22020-07-02T21:40:52Z2020-07-02T21:40:52Zsb-java-conniey-1PT15S5120falsefalseP10675199DT2H48M5.4775807SfalsePT10M5true00falseActive2020-07-02T21:40:52.24Z2020-07-02T21:40:52.35Z0001-01-01T00:00:00Ztrue00000P10675199DT2H48M5.4775807SfalseAvailablefalse", + "Date" : "Thu, 02 Jul 2020 22:49:02 GMT", + "Content-Type" : "application/atom+xml;type=entry;charset=utf-8" + }, + "Exception" : null + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/sdk/servicebus/azure-messaging-servicebus/src/test/resources/session-records/getQueueExistsFalse.json b/sdk/servicebus/azure-messaging-servicebus/src/test/resources/session-records/getQueueExistsFalse.json new file mode 100644 index 0000000000000..0beb821c5acbf --- /dev/null +++ b/sdk/servicebus/azure-messaging-servicebus/src/test/resources/session-records/getQueueExistsFalse.json @@ -0,0 +1,21 @@ +{ + "networkCallRecords" : [ { + "Method" : "GET", + "Uri" : "https://REDACTED.servicebus.windows.net/exist62239?enrich=true&api-version=2017-04", + "Headers" : { + "User-Agent" : "azsdk-java-azure-messaging-servicebus/7.0.0-beta.4 (11.0.5; Windows 10; 10.0)" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "Strict-Transport-Security" : "max-age=31536000", + "Server" : "Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "StatusCode" : "200", + "Body" : "Publicly Listed ServicesThis is the list of publicly-listed services currently available.uuid:b2a5260d-7d50-405b-9cc5-d5e365e93c0b;id=44872020-07-02T22:49:15ZService Bus 1.1", + "Date" : "Thu, 02 Jul 2020 22:49:15 GMT", + "Content-Type" : "application/atom+xml;type=feed;charset=utf-8" + }, + "Exception" : null + } ], + "variables" : [ "exist62239" ] +} \ No newline at end of file diff --git a/sdk/servicebus/azure-messaging-servicebus/src/test/resources/session-records/getQueueRuntimeInfo.json b/sdk/servicebus/azure-messaging-servicebus/src/test/resources/session-records/getQueueRuntimeInfo.json index 73b2425acac87..193cd5a28e544 100644 --- a/sdk/servicebus/azure-messaging-servicebus/src/test/resources/session-records/getQueueRuntimeInfo.json +++ b/sdk/servicebus/azure-messaging-servicebus/src/test/resources/session-records/getQueueRuntimeInfo.json @@ -3,17 +3,17 @@ "Method" : "GET", "Uri" : "https://REDACTED.servicebus.windows.net/queue-2?enrich=true&api-version=2017-04", "Headers" : { - "User-Agent" : "azsdk-java-azure-messaging-servicebus/7.0.0-beta.4 (11.0.5; Windows 10 10.0)" + "User-Agent" : "azsdk-java-azure-messaging-servicebus/7.0.0-beta.4 (11.0.5; Windows 10; 10.0)" }, "Response" : { "Transfer-Encoding" : "chunked", "Strict-Transport-Security" : "max-age=31536000", "Server" : "Microsoft-HTTPAPI/2.0", - "ETag" : "637284664716230000", + "ETag" : "637293228523500000", "retry-after" : "0", "StatusCode" : "200", - "Body" : "https://sb-java-conniey-5.servicebus.windows.net/queue-2?enrich=true&api-version=2017-04queue-22020-06-22T23:47:51Z2020-06-22T23:47:51Zsb-java-conniey-5PT15S5120falsefalseP10675199DT2H48M5.4775807SfalsePT10M5true00falseActive2020-06-22T23:47:51.59Z2020-06-22T23:47:51.623Z0001-01-01T00:00:00Ztrue00000P10675199DT2H48M5.4775807SfalseAvailablefalse", - "Date" : "Wed, 01 Jul 2020 05:31:41 GMT", + "Body" : "https://sb-java-conniey-1.servicebus.windows.net/queue-2?enrich=true&api-version=2017-04queue-22020-07-02T21:40:52Z2020-07-02T21:40:52Zsb-java-conniey-1PT15S5120falsefalseP10675199DT2H48M5.4775807SfalsePT10M5true00falseActive2020-07-02T21:40:52.24Z2020-07-02T21:40:52.35Z0001-01-01T00:00:00Ztrue00000P10675199DT2H48M5.4775807SfalseAvailablefalse", + "Date" : "Thu, 02 Jul 2020 22:49:11 GMT", "Content-Type" : "application/atom+xml;type=entry;charset=utf-8" }, "Exception" : null diff --git a/sdk/servicebus/azure-messaging-servicebus/src/test/resources/session-records/getSubscription.json b/sdk/servicebus/azure-messaging-servicebus/src/test/resources/session-records/getSubscription.json index 774a4b8bc2983..50e3c020ba9e7 100644 --- a/sdk/servicebus/azure-messaging-servicebus/src/test/resources/session-records/getSubscription.json +++ b/sdk/servicebus/azure-messaging-servicebus/src/test/resources/session-records/getSubscription.json @@ -1,19 +1,19 @@ { "networkCallRecords" : [ { "Method" : "GET", - "Uri" : "https://REDACTED.servicebus.windows.net/topic/subscriptions/subscription-session-1?enrich=true&api-version=2017-04", + "Uri" : "https://REDACTED.servicebus.windows.net/topic-1/subscriptions/subscription-session?enrich=true&api-version=2017-04", "Headers" : { - "User-Agent" : "azsdk-java-azure-messaging-servicebus/7.0.0-beta.4 (11.0.5; Windows 10 10.0)" + "User-Agent" : "azsdk-java-azure-messaging-servicebus/7.0.0-beta.4 (11.0.5; Windows 10; 10.0)" }, "Response" : { "Transfer-Encoding" : "chunked", "Strict-Transport-Security" : "max-age=31536000", "Server" : "Microsoft-HTTPAPI/2.0", - "ETag" : "637284664716270000", + "ETag" : "637293228523500000", "retry-after" : "0", "StatusCode" : "200", - "Body" : "sb://sb-java-conniey-5.servicebus.windows.net/topic/subscriptions/subscription-session-1?enrich=true&api-version=2017-04subscription-session-12020-06-22T23:47:54Z2020-06-22T23:47:54ZPT15StrueP10675199DT2H48M5.4775807Sfalsetrue05trueActive2020-06-22T23:47:54.0131447Z2020-06-22T23:47:54.0131447Z2020-06-22T23:47:54.013Z00000P10675199DT2H48M5.4775807SAvailable", - "Date" : "Tue, 30 Jun 2020 13:43:40 GMT", + "Body" : "sb://sb-java-conniey-1.servicebus.windows.net/topic-1/subscriptions/subscription-session?enrich=true&api-version=2017-04subscription-session2020-07-02T21:40:54Z2020-07-02T21:40:54ZPT15StrueP10675199DT2H48M5.4775807Sfalsetrue05trueActive2020-07-02T21:40:54.4327719Z2020-07-02T21:40:54.4327719Z2020-07-02T21:40:54.433Z00000P10675199DT2H48M5.4775807SAvailable", + "Date" : "Thu, 02 Jul 2020 22:49:16 GMT", "Content-Type" : "application/atom+xml;type=entry;charset=utf-8" }, "Exception" : null diff --git a/sdk/servicebus/azure-messaging-servicebus/src/test/resources/session-records/getSubscriptionDoesNotExist.json b/sdk/servicebus/azure-messaging-servicebus/src/test/resources/session-records/getSubscriptionDoesNotExist.json index 5a3f695505ae0..8e027fcb194aa 100644 --- a/sdk/servicebus/azure-messaging-servicebus/src/test/resources/session-records/getSubscriptionDoesNotExist.json +++ b/sdk/servicebus/azure-messaging-servicebus/src/test/resources/session-records/getSubscriptionDoesNotExist.json @@ -1,19 +1,19 @@ { "networkCallRecords" : [ { "Method" : "GET", - "Uri" : "https://REDACTED.servicebus.windows.net/topic/subscriptions/subscription-session-not-exist?enrich=true&api-version=2017-04", + "Uri" : "https://REDACTED.servicebus.windows.net/topic-1/subscriptions/subscription-session-not-exist?enrich=true&api-version=2017-04", "Headers" : { - "User-Agent" : "azsdk-java-azure-messaging-servicebus/7.0.0-beta.4 (11.0.5; Windows 10 10.0)" + "User-Agent" : "azsdk-java-azure-messaging-servicebus/7.0.0-beta.4 (11.0.5; Windows 10; 10.0)" }, "Response" : { "Transfer-Encoding" : "chunked", "Strict-Transport-Security" : "max-age=31536000", "Server" : "Microsoft-HTTPAPI/2.0", - "ETag" : "637284664716270000", + "ETag" : "637293228523500000", "retry-after" : "0", "StatusCode" : "404", - "Body" : "404Entity 'sb-java-conniey-5:Topic:topic|subscription-session-not-exist' was not found. To know more visit https://aka.ms/sbResourceMgrExceptions. TrackingId:58eae106-2499-454f-8fd7-748ef7803df4_B4, SystemTracker:NoSystemTracker, Timestamp:2020-06-30T13:47:32", - "Date" : "Tue, 30 Jun 2020 13:47:32 GMT", + "Body" : "404Entity 'sb-java-conniey-1:Topic:topic-1|subscription-session-not-exist' was not found. To know more visit https://aka.ms/sbResourceMgrExceptions. TrackingId:9a4e86d9-f739-40ec-b310-1b5cf6785c4c_B7, SystemTracker:NoSystemTracker, Timestamp:2020-07-02T22:49:10", + "Date" : "Thu, 02 Jul 2020 22:49:10 GMT", "Content-Type" : "application/xml; charset=utf-8" }, "Exception" : null diff --git a/sdk/servicebus/azure-messaging-servicebus/src/test/resources/session-records/getSubscriptionExists.json b/sdk/servicebus/azure-messaging-servicebus/src/test/resources/session-records/getSubscriptionExists.json new file mode 100644 index 0000000000000..553aee2e0bc69 --- /dev/null +++ b/sdk/servicebus/azure-messaging-servicebus/src/test/resources/session-records/getSubscriptionExists.json @@ -0,0 +1,22 @@ +{ + "networkCallRecords" : [ { + "Method" : "GET", + "Uri" : "https://REDACTED.servicebus.windows.net/topic-1/subscriptions/subscription-session?enrich=true&api-version=2017-04", + "Headers" : { + "User-Agent" : "azsdk-java-azure-messaging-servicebus/7.0.0-beta.4 (11.0.5; Windows 10; 10.0)" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "Strict-Transport-Security" : "max-age=31536000", + "Server" : "Microsoft-HTTPAPI/2.0", + "ETag" : "637293228523500000", + "retry-after" : "0", + "StatusCode" : "200", + "Body" : "sb://sb-java-conniey-1.servicebus.windows.net/topic-1/subscriptions/subscription-session?enrich=true&api-version=2017-04subscription-session2020-07-02T21:40:54Z2020-07-02T21:40:54ZPT15StrueP10675199DT2H48M5.4775807Sfalsetrue05trueActive2020-07-02T21:40:54.4327719Z2020-07-02T21:40:54.4327719Z2020-07-02T21:40:54.433Z00000P10675199DT2H48M5.4775807SAvailable", + "Date" : "Thu, 02 Jul 2020 22:49:02 GMT", + "Content-Type" : "application/atom+xml;type=entry;charset=utf-8" + }, + "Exception" : null + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/sdk/servicebus/azure-messaging-servicebus/src/test/resources/session-records/getSubscriptionExistsFalse.json b/sdk/servicebus/azure-messaging-servicebus/src/test/resources/session-records/getSubscriptionExistsFalse.json new file mode 100644 index 0000000000000..d7134c255b458 --- /dev/null +++ b/sdk/servicebus/azure-messaging-servicebus/src/test/resources/session-records/getSubscriptionExistsFalse.json @@ -0,0 +1,22 @@ +{ + "networkCallRecords" : [ { + "Method" : "GET", + "Uri" : "https://REDACTED.servicebus.windows.net/topic-1/subscriptions/subscription-session-not-exist?enrich=true&api-version=2017-04", + "Headers" : { + "User-Agent" : "azsdk-java-azure-messaging-servicebus/7.0.0-beta.4 (11.0.5; Windows 10; 10.0)" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "Strict-Transport-Security" : "max-age=31536000", + "Server" : "Microsoft-HTTPAPI/2.0", + "ETag" : "637293228523500000", + "retry-after" : "0", + "StatusCode" : "404", + "Body" : "404Entity 'sb-java-conniey-1:Topic:topic-1|subscription-session-not-exist' was not found. To know more visit https://aka.ms/sbResourceMgrExceptions. TrackingId:22b5c9e6-e962-4ba3-8a3b-078a4f7070ac_B7, SystemTracker:NoSystemTracker, Timestamp:2020-07-02T22:49:14", + "Date" : "Thu, 02 Jul 2020 22:49:14 GMT", + "Content-Type" : "application/xml; charset=utf-8" + }, + "Exception" : null + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/sdk/servicebus/azure-messaging-servicebus/src/test/resources/session-records/getSubscriptionRuntimeInfo.json b/sdk/servicebus/azure-messaging-servicebus/src/test/resources/session-records/getSubscriptionRuntimeInfo.json index 883e2cd490ed9..496404f7fd07c 100644 --- a/sdk/servicebus/azure-messaging-servicebus/src/test/resources/session-records/getSubscriptionRuntimeInfo.json +++ b/sdk/servicebus/azure-messaging-servicebus/src/test/resources/session-records/getSubscriptionRuntimeInfo.json @@ -1,19 +1,19 @@ { "networkCallRecords" : [ { "Method" : "GET", - "Uri" : "https://REDACTED.servicebus.windows.net/topic/subscriptions/subscription-1?enrich=true&api-version=2017-04", + "Uri" : "https://REDACTED.servicebus.windows.net/topic-1/subscriptions/subscription-session?enrich=true&api-version=2017-04", "Headers" : { - "User-Agent" : "azsdk-java-azure-messaging-servicebus/7.0.0-beta.4 (11.0.5; Windows 10 10.0)" + "User-Agent" : "azsdk-java-azure-messaging-servicebus/7.0.0-beta.4 (11.0.5; Windows 10; 10.0)" }, "Response" : { "Transfer-Encoding" : "chunked", "Strict-Transport-Security" : "max-age=31536000", "Server" : "Microsoft-HTTPAPI/2.0", - "ETag" : "637284664716270000", + "ETag" : "637293228523500000", "retry-after" : "0", "StatusCode" : "200", - "Body" : "sb://sb-java-conniey-5.servicebus.windows.net/topic/subscriptions/subscription-1?enrich=true&api-version=2017-04subscription-12020-06-22T23:47:53Z2020-06-22T23:47:53ZPT15SfalseP10675199DT2H48M5.4775807Sfalsetrue05trueActive2020-06-22T23:47:53.9193827Z2020-06-22T23:47:53.9193827Z2020-06-22T23:47:53.92Z00000P10675199DT2H48M5.4775807SAvailable", - "Date" : "Tue, 30 Jun 2020 13:52:14 GMT", + "Body" : "sb://sb-java-conniey-1.servicebus.windows.net/topic-1/subscriptions/subscription-session?enrich=true&api-version=2017-04subscription-session2020-07-02T21:40:54Z2020-07-02T21:40:54ZPT15StrueP10675199DT2H48M5.4775807Sfalsetrue05trueActive2020-07-02T21:40:54.4327719Z2020-07-02T21:40:54.4327719Z2020-07-02T21:40:54.433Z00000P10675199DT2H48M5.4775807SAvailable", + "Date" : "Thu, 02 Jul 2020 22:49:10 GMT", "Content-Type" : "application/atom+xml;type=entry;charset=utf-8" }, "Exception" : null diff --git a/sdk/servicebus/azure-messaging-servicebus/src/test/resources/session-records/getTopic.json b/sdk/servicebus/azure-messaging-servicebus/src/test/resources/session-records/getTopic.json index 3d3b412ba0034..b65dc0947dae2 100644 --- a/sdk/servicebus/azure-messaging-servicebus/src/test/resources/session-records/getTopic.json +++ b/sdk/servicebus/azure-messaging-servicebus/src/test/resources/session-records/getTopic.json @@ -1,19 +1,19 @@ { "networkCallRecords" : [ { "Method" : "GET", - "Uri" : "https://REDACTED.servicebus.windows.net/topic?enrich=true&api-version=2017-04", + "Uri" : "https://REDACTED.servicebus.windows.net/topic-1?enrich=true&api-version=2017-04", "Headers" : { - "User-Agent" : "azsdk-java-azure-messaging-servicebus/7.0.0-beta.4 (11.0.5; Windows 10 10.0)" + "User-Agent" : "azsdk-java-azure-messaging-servicebus/7.0.0-beta.4 (11.0.5; Windows 10; 10.0)" }, "Response" : { "Transfer-Encoding" : "chunked", "Strict-Transport-Security" : "max-age=31536000", "Server" : "Microsoft-HTTPAPI/2.0", - "ETag" : "637284664716270000", + "ETag" : "637293228523500000", "retry-after" : "0", "StatusCode" : "200", - "Body" : "https://sb-java-conniey-5.servicebus.windows.net/topic?enrich=true&api-version=2017-04topic2020-06-22T23:47:51Z2020-06-22T23:47:51Zsb-java-conniey-5P10675199DT2H48M5.4775807S1024falsePT10Mtrue0falsefalseActive2020-06-22T23:47:51.5889285Z2020-06-22T23:47:51.5889285Z2020-07-01T02:09:02.547Ztrue0000022P10675199DT2H48M5.4775807SfalseAvailablefalsefalse", - "Date" : "Wed, 01 Jul 2020 02:49:37 GMT", + "Body" : "https://sb-java-conniey-1.servicebus.windows.net/topic-1?enrich=true&api-version=2017-04topic-12020-07-02T21:40:52Z2020-07-02T21:40:52Zsb-java-conniey-1P10675199DT2H48M5.4775807S1024falsePT10Mtrue0falsefalseActive2020-07-02T21:40:52.3077409Z2020-07-02T21:40:52.3077409Z2020-07-02T22:46:04.6172301Ztrue000003P10675199DT2H48M5.4775807SfalseAvailablefalsefalse", + "Date" : "Thu, 02 Jul 2020 22:49:16 GMT", "Content-Type" : "application/atom+xml;type=entry;charset=utf-8" }, "Exception" : null diff --git a/sdk/servicebus/azure-messaging-servicebus/src/test/resources/session-records/getTopicDoesNotExist.json b/sdk/servicebus/azure-messaging-servicebus/src/test/resources/session-records/getTopicDoesNotExist.json index cf1b29bba1537..f8a17fbabe8a8 100644 --- a/sdk/servicebus/azure-messaging-servicebus/src/test/resources/session-records/getTopicDoesNotExist.json +++ b/sdk/servicebus/azure-messaging-servicebus/src/test/resources/session-records/getTopicDoesNotExist.json @@ -1,9 +1,9 @@ { "networkCallRecords" : [ { "Method" : "GET", - "Uri" : "https://REDACTED.servicebus.windows.net/9a4414fd96?enrich=true&api-version=2017-04", + "Uri" : "https://REDACTED.servicebus.windows.net/17d2b79d41?enrich=true&api-version=2017-04", "Headers" : { - "User-Agent" : "azsdk-java-azure-messaging-servicebus/7.0.0-beta.4 (11.0.5; Windows 10 10.0)" + "User-Agent" : "azsdk-java-azure-messaging-servicebus/7.0.0-beta.4 (11.0.5; Windows 10; 10.0)" }, "Response" : { "Transfer-Encoding" : "chunked", @@ -11,11 +11,11 @@ "Server" : "Microsoft-HTTPAPI/2.0", "retry-after" : "0", "StatusCode" : "200", - "Body" : "Publicly Listed ServicesThis is the list of publicly-listed services currently available.uuid:65633c11-6bf9-4e64-914e-1dcafd13339b;id=15972020-07-02T05:13:31ZService Bus 1.1", - "Date" : "Thu, 02 Jul 2020 05:13:30 GMT", + "Body" : "Publicly Listed ServicesThis is the list of publicly-listed services currently available.uuid:b2a5260d-7d50-405b-9cc5-d5e365e93c0b;id=44862020-07-02T22:49:08ZService Bus 1.1", + "Date" : "Thu, 02 Jul 2020 22:49:07 GMT", "Content-Type" : "application/atom+xml;type=feed;charset=utf-8" }, "Exception" : null } ], - "variables" : [ "9a4414fd96" ] + "variables" : [ "17d2b79d41" ] } \ No newline at end of file diff --git a/sdk/servicebus/azure-messaging-servicebus/src/test/resources/session-records/getTopicExists.json b/sdk/servicebus/azure-messaging-servicebus/src/test/resources/session-records/getTopicExists.json new file mode 100644 index 0000000000000..2ed7e3cb6f150 --- /dev/null +++ b/sdk/servicebus/azure-messaging-servicebus/src/test/resources/session-records/getTopicExists.json @@ -0,0 +1,22 @@ +{ + "networkCallRecords" : [ { + "Method" : "GET", + "Uri" : "https://REDACTED.servicebus.windows.net/topic-1?enrich=true&api-version=2017-04", + "Headers" : { + "User-Agent" : "azsdk-java-azure-messaging-servicebus/7.0.0-beta.4 (11.0.5; Windows 10; 10.0)" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "Strict-Transport-Security" : "max-age=31536000", + "Server" : "Microsoft-HTTPAPI/2.0", + "ETag" : "637293228523500000", + "retry-after" : "0", + "StatusCode" : "200", + "Body" : "https://sb-java-conniey-1.servicebus.windows.net/topic-1?enrich=true&api-version=2017-04topic-12020-07-02T21:40:52Z2020-07-02T21:40:52Zsb-java-conniey-1P10675199DT2H48M5.4775807S1024falsePT10Mtrue0falsefalseActive2020-07-02T21:40:52.3077409Z2020-07-02T21:40:52.3077409Z2020-07-02T22:46:04.6172301Ztrue000003P10675199DT2H48M5.4775807SfalseAvailablefalsefalse", + "Date" : "Thu, 02 Jul 2020 22:49:02 GMT", + "Content-Type" : "application/atom+xml;type=entry;charset=utf-8" + }, + "Exception" : null + } ], + "variables" : [ ] +} \ No newline at end of file diff --git a/sdk/servicebus/azure-messaging-servicebus/src/test/resources/session-records/getTopicExistsFalse.json b/sdk/servicebus/azure-messaging-servicebus/src/test/resources/session-records/getTopicExistsFalse.json new file mode 100644 index 0000000000000..2d54bf601dc5b --- /dev/null +++ b/sdk/servicebus/azure-messaging-servicebus/src/test/resources/session-records/getTopicExistsFalse.json @@ -0,0 +1,21 @@ +{ + "networkCallRecords" : [ { + "Method" : "GET", + "Uri" : "https://REDACTED.servicebus.windows.net/f930478c6f?enrich=true&api-version=2017-04", + "Headers" : { + "User-Agent" : "azsdk-java-azure-messaging-servicebus/7.0.0-beta.4 (11.0.5; Windows 10; 10.0)" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "Strict-Transport-Security" : "max-age=31536000", + "Server" : "Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "StatusCode" : "200", + "Body" : "Publicly Listed ServicesThis is the list of publicly-listed services currently available.uuid:b2a5260d-7d50-405b-9cc5-d5e365e93c0b;id=44882020-07-02T22:49:16ZService Bus 1.1", + "Date" : "Thu, 02 Jul 2020 22:49:16 GMT", + "Content-Type" : "application/atom+xml;type=feed;charset=utf-8" + }, + "Exception" : null + } ], + "variables" : [ "f930478c6f" ] +} \ No newline at end of file diff --git a/sdk/servicebus/azure-messaging-servicebus/src/test/resources/session-records/getTopicRuntimeInfo.json b/sdk/servicebus/azure-messaging-servicebus/src/test/resources/session-records/getTopicRuntimeInfo.json index a0a645bff3f7c..2f8a18b5cf1c3 100644 --- a/sdk/servicebus/azure-messaging-servicebus/src/test/resources/session-records/getTopicRuntimeInfo.json +++ b/sdk/servicebus/azure-messaging-servicebus/src/test/resources/session-records/getTopicRuntimeInfo.json @@ -1,19 +1,19 @@ { "networkCallRecords" : [ { "Method" : "GET", - "Uri" : "https://REDACTED.servicebus.windows.net/topic?enrich=true&api-version=2017-04", + "Uri" : "https://REDACTED.servicebus.windows.net/topic-1?enrich=true&api-version=2017-04", "Headers" : { - "User-Agent" : "azsdk-java-azure-messaging-servicebus/7.0.0-beta.4 (11.0.5; Windows 10 10.0)" + "User-Agent" : "azsdk-java-azure-messaging-servicebus/7.0.0-beta.4 (11.0.5; Windows 10; 10.0)" }, "Response" : { "Transfer-Encoding" : "chunked", "Strict-Transport-Security" : "max-age=31536000", "Server" : "Microsoft-HTTPAPI/2.0", - "ETag" : "637284664716270000", + "ETag" : "637293228523500000", "retry-after" : "0", "StatusCode" : "200", - "Body" : "https://sb-java-conniey-5.servicebus.windows.net/topic?enrich=true&api-version=2017-04topic2020-06-22T23:47:51Z2020-06-22T23:47:51Zsb-java-conniey-5P10675199DT2H48M5.4775807S1024falsePT10Mtrue0falsefalseActive2020-06-22T23:47:51.543Z2020-06-22T23:47:51.627Z2020-07-01T02:09:02.547Ztrue0000022P10675199DT2H48M5.4775807SfalseAvailablefalsefalse", - "Date" : "Wed, 01 Jul 2020 03:24:20 GMT", + "Body" : "https://sb-java-conniey-1.servicebus.windows.net/topic-1?enrich=true&api-version=2017-04topic-12020-07-02T21:40:52Z2020-07-02T21:40:52Zsb-java-conniey-1P10675199DT2H48M5.4775807S1024falsePT10Mtrue0falsefalseActive2020-07-02T21:40:52.3077409Z2020-07-02T21:40:52.3077409Z2020-07-02T22:46:04.6172301Ztrue000003P10675199DT2H48M5.4775807SfalseAvailablefalsefalse", + "Date" : "Thu, 02 Jul 2020 22:49:11 GMT", "Content-Type" : "application/atom+xml;type=entry;charset=utf-8" }, "Exception" : null diff --git a/sdk/servicebus/azure-messaging-servicebus/src/test/resources/session-records/listQueues.json b/sdk/servicebus/azure-messaging-servicebus/src/test/resources/session-records/listQueues.json index 801f5d5e6ae0f..56e90a977d161 100644 --- a/sdk/servicebus/azure-messaging-servicebus/src/test/resources/session-records/listQueues.json +++ b/sdk/servicebus/azure-messaging-servicebus/src/test/resources/session-records/listQueues.json @@ -3,18 +3,18 @@ "Method" : "GET", "Uri" : "https://REDACTED.servicebus.windows.net/$Resources/queues?$skip=0&$top=100&api-version=2017-04", "Headers" : { - "User-Agent" : "azsdk-java-azure-messaging-servicebus/7.0.0-beta.4 (11.0.5; Windows 10 10.0)" + "User-Agent" : "azsdk-java-azure-messaging-servicebus/7.0.0-beta.4 (11.0.5; Windows 10; 10.0)" }, "Response" : { "Transfer-Encoding" : "chunked", "Server" : "Microsoft-HTTPAPI/2.0", "retry-after" : "0", "StatusCode" : "200", - "Body" : "Queueshttps://sb-java-conniey-5.servicebus.windows.net/$Resources/queues?$skip=0&$top=10&api-version=2017-042020-07-01T08:42:23Zhttps://sb-java-conniey-5.servicebus.windows.net/queue-0?api-version=2017-04queue-02020-06-22T23:47:51Z2020-06-22T23:47:51Zsb-java-conniey-5PT15S5120falsefalseP10675199DT2H48M5.4775807SfalsePT10M5true00falseActive2020-06-22T23:47:51.53Z2020-06-22T23:47:51.577Z0001-01-01T00:00:00Ztrue00000P10675199DT2H48M5.4775807SfalseAvailablefalsehttps://sb-java-conniey-5.servicebus.windows.net/queue-1?api-version=2017-04queue-12020-06-22T23:47:51Z2020-06-22T23:47:51Zsb-java-conniey-5PT15S5120falsefalseP10675199DT2H48M5.4775807SfalsePT10M5true00falseActive2020-06-22T23:47:51.333Z2020-06-22T23:47:51.37Z0001-01-01T00:00:00Ztrue00000P10675199DT2H48M5.4775807SfalseAvailablefalsehttps://sb-java-conniey-5.servicebus.windows.net/queue-2?api-version=2017-04queue-22020-06-22T23:47:51Z2020-06-22T23:47:51Zsb-java-conniey-5PT15S5120falsefalseP10675199DT2H48M5.4775807SfalsePT10M5true00falseActive2020-06-22T23:47:51.59Z2020-06-22T23:47:51.623Z0001-01-01T00:00:00Ztrue00000P10675199DT2H48M5.4775807SfalseAvailablefalsehttps://sb-java-conniey-5.servicebus.windows.net/queue-3?api-version=2017-04queue-32020-06-22T23:47:51Z2020-06-22T23:47:51Zsb-java-conniey-5PT15S5120falsefalseP10675199DT2H48M5.4775807SfalsePT10M5true00falseActive2020-06-22T23:47:51.447Z2020-06-22T23:47:51.547Z0001-01-01T00:00:00Ztrue00000P10675199DT2H48M5.4775807SfalseAvailablefalsehttps://sb-java-conniey-5.servicebus.windows.net/queue-4?api-version=2017-04queue-42020-06-22T23:47:51Z2020-06-22T23:47:51Zsb-java-conniey-5PT15S5120falsefalseP10675199DT2H48M5.4775807SfalsePT10M5true00falseActive2020-06-22T23:47:51.513Z2020-06-22T23:47:51.59Z0001-01-01T00:00:00Ztrue00000P10675199DT2H48M5.4775807SfalseAvailablefalsehttps://sb-java-conniey-5.servicebus.windows.net/queue-5?api-version=2017-04queue-52020-06-22T23:47:51Z2020-06-22T23:47:51Zsb-java-conniey-5PT15S5120falsefalseP10675199DT2H48M5.4775807SfalsePT10M5true00falseActive2020-06-22T23:47:51.477Z2020-06-22T23:47:51.583Z0001-01-01T00:00:00Ztrue00000P10675199DT2H48M5.4775807SfalseAvailablefalsehttps://sb-java-conniey-5.servicebus.windows.net/queue-6?api-version=2017-04queue-62020-06-22T23:47:51Z2020-06-22T23:47:51Zsb-java-conniey-5PT15S5120falsefalseP10675199DT2H48M5.4775807SfalsePT10M5true00falseActive2020-06-22T23:47:51.65Z2020-06-22T23:47:51.737Z0001-01-01T00:00:00Ztrue00000P10675199DT2H48M5.4775807SfalseAvailablefalsehttps://sb-java-conniey-5.servicebus.windows.net/queue-7?api-version=2017-04queue-72020-06-22T23:47:51Z2020-06-22T23:47:51Zsb-java-conniey-5PT15S5120falsefalseP10675199DT2H48M5.4775807SfalsePT10M5true00falseActive2020-06-22T23:47:51.51Z2020-06-22T23:47:51.55Z0001-01-01T00:00:00Ztrue00000P10675199DT2H48M5.4775807SfalseAvailablefalsehttps://sb-java-conniey-5.servicebus.windows.net/queue-8?api-version=2017-04queue-82020-06-22T23:47:51Z2020-06-22T23:47:51Zsb-java-conniey-5PT15S5120falsefalseP10675199DT2H48M5.4775807SfalsePT10M5true00falseActive2020-06-22T23:47:51.49Z2020-06-22T23:47:51.517Z0001-01-01T00:00:00Ztrue00000P10675199DT2H48M5.4775807SfalseAvailablefalsehttps://sb-java-conniey-5.servicebus.windows.net/queue-9?api-version=2017-04queue-92020-06-22T23:47:51Z2020-06-22T23:47:51Zsb-java-conniey-5PT15S5120falsefalseP10675199DT2H48M5.4775807SfalsePT10M5true00falseActive2020-06-22T23:47:51.617Z2020-06-22T23:47:51.677Z0001-01-01T00:00:00Ztrue00000P10675199DT2H48M5.4775807SfalseAvailablefalse", - "Date" : "Wed, 01 Jul 2020 08:42:23 GMT", + "Body" : "Queueshttps://sb-java-conniey-1.servicebus.windows.net/$Resources/queues?$skip=0&$top=100&api-version=2017-042020-07-02T22:49:12Zhttps://sb-java-conniey-1.servicebus.windows.net/queue-0?api-version=2017-04queue-02020-07-02T21:40:52Z2020-07-02T21:40:52Zsb-java-conniey-1PT15S5120falsefalseP10675199DT2H48M5.4775807SfalsePT10M5true00falseActive2020-07-02T21:40:52.4796634Z2020-07-02T21:40:52.4796634Z0001-01-01T00:00:00Ztrue00000P10675199DT2H48M5.4775807SfalseAvailablefalsehttps://sb-java-conniey-1.servicebus.windows.net/queue-1?api-version=2017-04queue-12020-07-02T21:40:52Z2020-07-02T21:40:52Zsb-java-conniey-1PT15S5120falsefalseP10675199DT2H48M5.4775807SfalsePT10M5true00falseActive2020-07-02T21:40:52.6202434Z2020-07-02T21:40:52.6202434Z0001-01-01T00:00:00Ztrue00000P10675199DT2H48M5.4775807SfalseAvailablefalsehttps://sb-java-conniey-1.servicebus.windows.net/queue-10?api-version=2017-04queue-102020-07-02T21:40:52Z2020-07-02T21:40:52Zsb-java-conniey-1PT15S5120falsefalseP10675199DT2H48M5.4775807SfalsePT10M5true00falseActive2020-07-02T21:40:52.3885816Z2020-07-02T21:40:52.3885816Z0001-01-01T00:00:00Ztrue00000P10675199DT2H48M5.4775807SfalseAvailablefalsehttps://sb-java-conniey-1.servicebus.windows.net/queue-11?api-version=2017-04queue-112020-07-02T21:40:52Z2020-07-02T21:40:53Zsb-java-conniey-1PT15S5120falsefalseP10675199DT2H48M5.4775807SfalsePT10M5true00falseActive2020-07-02T21:40:52.4602371Z2020-07-02T21:40:52.4602371Z0001-01-01T00:00:00Ztrue00000P10675199DT2H48M5.4775807SfalseAvailablefalsehttps://sb-java-conniey-1.servicebus.windows.net/queue-12?api-version=2017-04queue-122020-07-02T21:40:52Z2020-07-02T21:40:52Zsb-java-conniey-1PT15S5120falsefalseP10675199DT2H48M5.4775807SfalsePT10M5true00falseActive2020-07-02T21:40:52.303Z2020-07-02T21:40:52.38Z0001-01-01T00:00:00Ztrue00000P10675199DT2H48M5.4775807SfalseAvailablefalsehttps://sb-java-conniey-1.servicebus.windows.net/queue-13?api-version=2017-04queue-132020-07-02T21:40:52Z2020-07-02T21:40:52Zsb-java-conniey-1PT15S5120falsefalseP10675199DT2H48M5.4775807SfalsePT10M5true00falseActive2020-07-02T21:40:52.3729319Z2020-07-02T21:40:52.3729319Z0001-01-01T00:00:00Ztrue00000P10675199DT2H48M5.4775807SfalseAvailablefalsehttps://sb-java-conniey-1.servicebus.windows.net/queue-14?api-version=2017-04queue-142020-07-02T21:40:52Z2020-07-02T21:40:52Zsb-java-conniey-1PT15S5120falsefalseP10675199DT2H48M5.4775807SfalsePT10M5true00falseActive2020-07-02T21:40:52.3858911Z2020-07-02T21:40:52.3858911Z0001-01-01T00:00:00Ztrue00000P10675199DT2H48M5.4775807SfalseAvailablefalsehttps://sb-java-conniey-1.servicebus.windows.net/queue-2?api-version=2017-04queue-22020-07-02T21:40:52Z2020-07-02T21:40:52Zsb-java-conniey-1PT15S5120falsefalseP10675199DT2H48M5.4775807SfalsePT10M5true00falseActive2020-07-02T21:40:52.24Z2020-07-02T21:40:52.35Z0001-01-01T00:00:00Ztrue00000P10675199DT2H48M5.4775807SfalseAvailablefalsehttps://sb-java-conniey-1.servicebus.windows.net/queue-3?api-version=2017-04queue-32020-07-02T21:40:52Z2020-07-02T21:40:52Zsb-java-conniey-1PT15S5120falsefalseP10675199DT2H48M5.4775807SfalsePT10M5true00falseActive2020-07-02T21:40:52.433Z2020-07-02T21:40:52.537Z0001-01-01T00:00:00Ztrue00000P10675199DT2H48M5.4775807SfalseAvailablefalsehttps://sb-java-conniey-1.servicebus.windows.net/queue-4?api-version=2017-04queue-42020-07-02T21:40:52Z2020-07-02T21:40:52Zsb-java-conniey-1PT15S5120falsefalseP10675199DT2H48M5.4775807SfalsePT10M5true00falseActive2020-07-02T21:40:52.1961838Z2020-07-02T21:40:52.1961838Z0001-01-01T00:00:00Ztrue00000P10675199DT2H48M5.4775807SfalseAvailablefalsehttps://sb-java-conniey-1.servicebus.windows.net/queue-5?api-version=2017-04queue-52020-07-02T21:40:52Z2020-07-02T21:40:52Zsb-java-conniey-1PT15S5120falsefalseP10675199DT2H48M5.4775807SfalsePT10M5true00falseActive2020-07-02T21:40:52.3370279Z2020-07-02T21:40:52.3370279Z0001-01-01T00:00:00Ztrue00000P10675199DT2H48M5.4775807SfalseAvailablefalsehttps://sb-java-conniey-1.servicebus.windows.net/queue-6?api-version=2017-04queue-62020-07-02T21:40:52Z2020-07-02T21:40:52Zsb-java-conniey-1PT15S5120falsefalseP10675199DT2H48M5.4775807SfalsePT10M5true00falseActive2020-07-02T21:40:52.1805873Z2020-07-02T21:40:52.1805873Z0001-01-01T00:00:00Ztrue00000P10675199DT2H48M5.4775807SfalseAvailablefalsehttps://sb-java-conniey-1.servicebus.windows.net/queue-7?api-version=2017-04queue-72020-07-02T21:40:52Z2020-07-02T21:40:52Zsb-java-conniey-1PT15S5120falsefalseP10675199DT2H48M5.4775807SfalsePT10M5true00falseActive2020-07-02T21:40:52.3504462Z2020-07-02T21:40:52.3504462Z0001-01-01T00:00:00Ztrue00000P10675199DT2H48M5.4775807SfalseAvailablefalsehttps://sb-java-conniey-1.servicebus.windows.net/queue-8?api-version=2017-04queue-82020-07-02T21:41:08Z2020-07-02T21:41:08Zsb-java-conniey-1PT15S5120falsefalseP10675199DT2H48M5.4775807SfalsePT10M5true00falseActive2020-07-02T21:41:08.377Z2020-07-02T21:41:08.657Z0001-01-01T00:00:00Ztrue00000P10675199DT2H48M5.4775807SfalseAvailablefalsehttps://sb-java-conniey-1.servicebus.windows.net/queue-9?api-version=2017-04queue-92020-07-02T21:40:52Z2020-07-02T21:40:52Zsb-java-conniey-1PT15S5120falsefalseP10675199DT2H48M5.4775807SfalsePT10M5true00falseActive2020-07-02T21:40:52.3077433Z2020-07-02T21:40:52.3077433Z0001-01-01T00:00:00Ztrue00000P10675199DT2H48M5.4775807SfalseAvailablefalsehttps://sb-java-conniey-1.servicebus.windows.net/queue-session-0?api-version=2017-04queue-session-02020-07-02T21:40:52Z2020-07-02T21:40:52Zsb-java-conniey-1PT15S5120falsetrueP10675199DT2H48M5.4775807SfalsePT10M5true00falseActive2020-07-02T21:40:52.3546567Z2020-07-02T21:40:52.3546567Z0001-01-01T00:00:00Ztrue00000P10675199DT2H48M5.4775807SfalseAvailablefalsehttps://sb-java-conniey-1.servicebus.windows.net/queue-session-1?api-version=2017-04queue-session-12020-07-02T21:40:52Z2020-07-02T21:40:52Zsb-java-conniey-1PT15S5120falsetrueP10675199DT2H48M5.4775807SfalsePT10M5true00falseActive2020-07-02T21:40:52.4600522Z2020-07-02T21:40:52.4600522Z0001-01-01T00:00:00Ztrue00000P10675199DT2H48M5.4775807SfalseAvailablefalsehttps://sb-java-conniey-1.servicebus.windows.net/queue-session-10?api-version=2017-04queue-session-102020-07-02T21:40:53Z2020-07-02T21:40:53Zsb-java-conniey-1PT15S5120falsetrueP10675199DT2H48M5.4775807SfalsePT10M5true00falseActive2020-07-02T21:40:53.35Z2020-07-02T21:40:53.527Z0001-01-01T00:00:00Ztrue00000P10675199DT2H48M5.4775807SfalseAvailablefalsehttps://sb-java-conniey-1.servicebus.windows.net/queue-session-11?api-version=2017-04queue-session-112020-07-02T21:40:52Z2020-07-02T21:40:52Zsb-java-conniey-1PT15S5120falsetrueP10675199DT2H48M5.4775807SfalsePT10M5true00falseActive2020-07-02T21:40:52.4444348Z2020-07-02T21:40:52.4444348Z0001-01-01T00:00:00Ztrue00000P10675199DT2H48M5.4775807SfalseAvailablefalsehttps://sb-java-conniey-1.servicebus.windows.net/queue-session-12?api-version=2017-04queue-session-122020-07-02T21:40:52Z2020-07-02T21:40:53Zsb-java-conniey-1PT15S5120falsetrueP10675199DT2H48M5.4775807SfalsePT10M5true00falseActive2020-07-02T21:40:52.203Z2020-07-02T21:40:53.55Z0001-01-01T00:00:00Ztrue00000P10675199DT2H48M5.4775807SfalseAvailablefalsehttps://sb-java-conniey-1.servicebus.windows.net/queue-session-13?api-version=2017-04queue-session-132020-07-02T21:40:52Z2020-07-02T21:40:52Zsb-java-conniey-1PT15S5120falsetrueP10675199DT2H48M5.4775807SfalsePT10M5true00falseActive2020-07-02T21:40:52.34Z2020-07-02T21:40:52.403Z0001-01-01T00:00:00Ztrue00000P10675199DT2H48M5.4775807SfalseAvailablefalsehttps://sb-java-conniey-1.servicebus.windows.net/queue-session-14?api-version=2017-04queue-session-142020-07-02T21:40:52Z2020-07-02T21:40:52Zsb-java-conniey-1PT15S5120falsetrueP10675199DT2H48M5.4775807SfalsePT10M5true00falseActive2020-07-02T21:40:52.4667131Z2020-07-02T21:40:52.4667131Z0001-01-01T00:00:00Ztrue00000P10675199DT2H48M5.4775807SfalseAvailablefalsehttps://sb-java-conniey-1.servicebus.windows.net/queue-session-2?api-version=2017-04queue-session-22020-07-02T21:41:08Z2020-07-02T21:41:08Zsb-java-conniey-1PT15S5120falsetrueP10675199DT2H48M5.4775807SfalsePT10M5true00falseActive2020-07-02T21:41:08.357Z2020-07-02T21:41:08.413Z0001-01-01T00:00:00Ztrue00000P10675199DT2H48M5.4775807SfalseAvailablefalsehttps://sb-java-conniey-1.servicebus.windows.net/queue-session-3?api-version=2017-04queue-session-32020-07-02T21:40:52Z2020-07-02T21:40:52Zsb-java-conniey-1PT15S5120falsetrueP10675199DT2H48M5.4775807SfalsePT10M5true00falseActive2020-07-02T21:40:52.495492Z2020-07-02T21:40:52.495492Z0001-01-01T00:00:00Ztrue00000P10675199DT2H48M5.4775807SfalseAvailablefalsehttps://sb-java-conniey-1.servicebus.windows.net/queue-session-4?api-version=2017-04queue-session-42020-07-02T21:40:52Z2020-07-02T21:40:52Zsb-java-conniey-1PT15S5120falsetrueP10675199DT2H48M5.4775807SfalsePT10M5true00falseActive2020-07-02T21:40:52.3389907Z2020-07-02T21:40:52.3389907Z0001-01-01T00:00:00Ztrue00000P10675199DT2H48M5.4775807SfalseAvailablefalsehttps://sb-java-conniey-1.servicebus.windows.net/queue-session-5?api-version=2017-04queue-session-52020-07-02T21:40:52Z2020-07-02T21:40:52Zsb-java-conniey-1PT15S5120falsetrueP10675199DT2H48M5.4775807SfalsePT10M5true00falseActive2020-07-02T21:40:52.3975343Z2020-07-02T21:40:52.3975343Z0001-01-01T00:00:00Ztrue00000P10675199DT2H48M5.4775807SfalseAvailablefalsehttps://sb-java-conniey-1.servicebus.windows.net/queue-session-6?api-version=2017-04queue-session-62020-07-02T21:40:52Z2020-07-02T21:40:52Zsb-java-conniey-1PT15S5120falsetrueP10675199DT2H48M5.4775807SfalsePT10M5true00falseActive2020-07-02T21:40:52.223Z2020-07-02T21:40:52.333Z0001-01-01T00:00:00Ztrue00000P10675199DT2H48M5.4775807SfalseAvailablefalsehttps://sb-java-conniey-1.servicebus.windows.net/queue-session-7?api-version=2017-04queue-session-72020-07-02T21:40:52Z2020-07-02T21:40:52Zsb-java-conniey-1PT15S5120falsetrueP10675199DT2H48M5.4775807SfalsePT10M5true00falseActive2020-07-02T21:40:52.3702406Z2020-07-02T21:40:52.3702406Z0001-01-01T00:00:00Ztrue00000P10675199DT2H48M5.4775807SfalseAvailablefalsehttps://sb-java-conniey-1.servicebus.windows.net/queue-session-8?api-version=2017-04queue-session-82020-07-02T21:40:52Z2020-07-02T21:40:52Zsb-java-conniey-1PT15S5120falsetrueP10675199DT2H48M5.4775807SfalsePT10M5true00falseActive2020-07-02T21:40:52.2693699Z2020-07-02T21:40:52.2693699Z0001-01-01T00:00:00Ztrue00000P10675199DT2H48M5.4775807SfalseAvailablefalsehttps://sb-java-conniey-1.servicebus.windows.net/queue-session-9?api-version=2017-04queue-session-92020-07-02T21:40:52Z2020-07-02T21:40:52Zsb-java-conniey-1PT15S5120falsetrueP10675199DT2H48M5.4775807SfalsePT10M5true00falseActive2020-07-02T21:40:52.3017253Z2020-07-02T21:40:52.3017253Z0001-01-01T00:00:00Ztrue00000P10675199DT2H48M5.4775807SfalseAvailablefalsehttps://sb-java-conniey-1.servicebus.windows.net/test18548?api-version=2017-04test185482020-07-02T22:46:50Z2020-07-02T22:46:50Zsb-java-conniey-1test18548PT1M1024falsefalseP10675199DT2H48M5.4775807SfalsePT10M10true00falseActive2020-07-02T22:46:50.3845816Z2020-07-02T22:46:50.3845816Z0001-01-01T00:00:00Ztrue00000P10675199DT2H48M5.477SP10675199DT2H48M5.477SfalsePT2MtruefalsePT45S7500truetruesome-metadata-for-testingAvailablefalsehttps://sb-java-conniey-1.servicebus.windows.net/test18701?api-version=2017-04test187012020-07-02T22:49:08Z2020-07-02T22:49:08Zsb-java-conniey-1test18701PT1M1024falsefalseP10675199DT2H48M5.4775807SfalsePT10M10true00falseActive2020-07-02T22:49:08.847Z2020-07-02T22:49:08.88Z0001-01-01T00:00:00Ztrue00000P10675199DT2H48M5.477SP10675199DT2H48M5.477SfalsePT2MtruefalsePT45S7500truetruesome-metadata-for-testingAvailablefalsehttps://sb-java-conniey-1.servicebus.windows.net/test19144?api-version=2017-04test191442020-07-02T21:56:09Z2020-07-02T21:56:09Zsb-java-conniey-1test19144PT1M1024falsefalseP10675199DT2H48M5.4775807SfalsePT10M10true00falseActive2020-07-02T21:56:09.6119571Z2020-07-02T21:56:09.6119571Z0001-01-01T00:00:00Ztrue00000P10675199DT2H48M5.477SP10675199DT2H48M5.477SfalsePT2MtruefalsePT45S7500truetruesome-metadata-for-testingAvailablefalsehttps://sb-java-conniey-1.servicebus.windows.net/test32991?api-version=2017-04test329912020-07-02T22:46:03Z2020-07-02T22:46:04Zsb-java-conniey-1test32991PT1M1024falsefalseP10675199DT2H48M5.4775807SfalsePT10M10true00falseActive2020-07-02T22:46:03.9926076Z2020-07-02T22:46:03.9926076Z0001-01-01T00:00:00Ztrue00000P10675199DT2H48M5.477SP10675199DT2H48M5.477SfalsePT2MtruefalsePT45S7500truetruesome-metadata-for-testingAvailablefalsehttps://sb-java-conniey-1.servicebus.windows.net/test71064?api-version=2017-04test710642020-07-02T22:40:12Z2020-07-02T22:40:12Zsb-java-conniey-1test71064PT1M1024falsefalseP10675199DT2H48M5.4775807SfalsePT10M10true00falseActive2020-07-02T22:40:12.35045Z2020-07-02T22:40:12.35045Z0001-01-01T00:00:00Ztrue00000P10675199DT2H48M5.477SP10675199DT2H48M5.477SfalsePT2MtruefalsePT45S7500truetruesome-metadata-for-testingAvailablefalse", + "Date" : "Thu, 02 Jul 2020 22:49:11 GMT", "Content-Type" : "application/atom+xml;type=feed;charset=utf-8" }, "Exception" : null } ], "variables" : [ ] -} +} \ No newline at end of file diff --git a/sdk/servicebus/azure-messaging-servicebus/src/test/resources/session-records/listSubscriptions.json b/sdk/servicebus/azure-messaging-servicebus/src/test/resources/session-records/listSubscriptions.json index cd281b8d123cc..e5724b9f690bf 100644 --- a/sdk/servicebus/azure-messaging-servicebus/src/test/resources/session-records/listSubscriptions.json +++ b/sdk/servicebus/azure-messaging-servicebus/src/test/resources/session-records/listSubscriptions.json @@ -1,19 +1,19 @@ { "networkCallRecords" : [ { "Method" : "GET", - "Uri" : "https://REDACTED.servicebus.windows.net/topic/subscriptions?$skip=0&$top=100&api-version=2017-04", + "Uri" : "https://REDACTED.servicebus.windows.net/topic-1/subscriptions?$skip=0&$top=100&api-version=2017-04", "Headers" : { - "User-Agent" : "azsdk-java-azure-messaging-servicebus/7.0.0-beta.4 (11.0.5; Windows 10 10.0)" + "User-Agent" : "azsdk-java-azure-messaging-servicebus/7.0.0-beta.4 (11.0.5; Windows 10; 10.0)" }, "Response" : { "Transfer-Encoding" : "chunked", "Strict-Transport-Security" : "max-age=31536000", "Server" : "Microsoft-HTTPAPI/2.0", - "ETag" : "637284664716270000", + "ETag" : "637293228523500000", "retry-after" : "0", "StatusCode" : "200", - "Body" : "Subscriptionshttps://sb-java-conniey-5.servicebus.windows.net/topic/subscriptions?$skip=0&$top=100&api-version=2017-042020-07-01T11:40:51Zhttps://sb-java-conniey-5.servicebus.windows.net/topic/subscriptions/sub042579?api-version=2017-04sub0425792020-07-01T05:36:06Z2020-07-01T05:36:06ZPT45SfalseP10675199DT2H48M5.477Sfalsetrue07trueActive2020-07-01T05:36:06.6410246Z2020-07-01T05:36:06.6410246Z2020-07-01T05:36:06.64Zsome-metadata-for-testing-subscriptions00000P10675199DT2H48M5SAvailablehttps://sb-java-conniey-5.servicebus.windows.net/topic/subscriptions/sub46850f?api-version=2017-04sub46850f2020-07-01T00:25:26Z2020-07-01T00:25:26ZPT45SfalseP10675199DT2H48M5.477Sfalsetrue07trueActive2020-07-01T00:25:26.8821527Z2020-07-01T00:25:26.8821527Z2020-07-01T00:25:26.883Zsome-metadata-for-testing-subscriptions00000P10675199DT2H48M5SAvailablehttps://sb-java-conniey-5.servicebus.windows.net/topic/subscriptions/sub679221?api-version=2017-04sub6792212020-07-01T02:09:02Z2020-07-01T02:09:02ZPT45SfalseP10675199DT2H48M5.477Sfalsetrue07trueActive2020-07-01T02:09:02.5454951Z2020-07-01T02:09:02.5454951Z2020-07-01T02:09:02.547Zsome-metadata-for-testing-subscriptions00000P10675199DT2H48M5SAvailablehttps://sb-java-conniey-5.servicebus.windows.net/topic/subscriptions/subscription-0?api-version=2017-04subscription-02020-06-22T23:47:53Z2020-06-22T23:47:53ZPT15SfalseP10675199DT2H48M5.4775807Sfalsetrue05trueActive2020-06-22T23:47:53.9193827Z2020-06-22T23:47:53.9193827Z2020-06-22T23:47:53.92Z00000P10675199DT2H48M5.4775807SAvailablehttps://sb-java-conniey-5.servicebus.windows.net/topic/subscriptions/subscription-1?api-version=2017-04subscription-12020-06-22T23:47:53Z2020-06-22T23:47:53ZPT15SfalseP10675199DT2H48M5.4775807Sfalsetrue05trueActive2020-06-22T23:47:53.9193827Z2020-06-22T23:47:53.9193827Z2020-06-22T23:47:53.92Z00000P10675199DT2H48M5.4775807SAvailablehttps://sb-java-conniey-5.servicebus.windows.net/topic/subscriptions/subscription-2?api-version=2017-04subscription-22020-06-22T23:47:53Z2020-06-22T23:47:53ZPT15SfalseP10675199DT2H48M5.4775807Sfalsetrue05trueActive2020-06-22T23:47:53.9037826Z2020-06-22T23:47:53.9037826Z2020-06-22T23:47:53.903Z00000P10675199DT2H48M5.4775807SAvailablehttps://sb-java-conniey-5.servicebus.windows.net/topic/subscriptions/subscription-3?api-version=2017-04subscription-32020-06-22T23:47:53Z2020-06-22T23:47:53ZPT15SfalseP10675199DT2H48M5.4775807Sfalsetrue05trueActive2020-06-22T23:47:53.8569185Z2020-06-22T23:47:53.8569185Z2020-06-22T23:47:53.857Z00000P10675199DT2H48M5.4775807SAvailablehttps://sb-java-conniey-5.servicebus.windows.net/topic/subscriptions/subscription-4?api-version=2017-04subscription-42020-06-22T23:47:54Z2020-06-22T23:47:54ZPT15SfalseP10675199DT2H48M5.4775807Sfalsetrue05trueActive2020-06-22T23:47:54.0131447Z2020-06-22T23:47:54.0131447Z2020-06-22T23:47:54.013Z00000P10675199DT2H48M5.4775807SAvailablehttps://sb-java-conniey-5.servicebus.windows.net/topic/subscriptions/subscription-5?api-version=2017-04subscription-52020-06-22T23:47:53Z2020-06-22T23:47:53ZPT15SfalseP10675199DT2H48M5.4775807Sfalsetrue05trueActive2020-06-22T23:47:53.7944244Z2020-06-22T23:47:53.7944244Z2020-06-22T23:47:53.793Z00000P10675199DT2H48M5.4775807SAvailablehttps://sb-java-conniey-5.servicebus.windows.net/topic/subscriptions/subscription-6?api-version=2017-04subscription-62020-06-22T23:47:53Z2020-06-22T23:47:53ZPT15SfalseP10675199DT2H48M5.4775807Sfalsetrue05trueActive2020-06-22T23:47:53.9193827Z2020-06-22T23:47:53.9193827Z2020-06-22T23:47:53.92Z00000P10675199DT2H48M5.4775807SAvailablehttps://sb-java-conniey-5.servicebus.windows.net/topic/subscriptions/subscription-7?api-version=2017-04subscription-72020-06-22T23:47:53Z2020-06-22T23:47:53ZPT15SfalseP10675199DT2H48M5.4775807Sfalsetrue05trueActive2020-06-22T23:47:53.8569185Z2020-06-22T23:47:53.8569185Z2020-06-22T23:47:53.857Z00000P10675199DT2H48M5.4775807SAvailablehttps://sb-java-conniey-5.servicebus.windows.net/topic/subscriptions/subscription-8?api-version=2017-04subscription-82020-06-22T23:47:53Z2020-06-22T23:47:53ZPT15SfalseP10675199DT2H48M5.4775807Sfalsetrue05trueActive2020-06-22T23:47:53.8412585Z2020-06-22T23:47:53.8412585Z2020-06-22T23:47:53.84Z00000P10675199DT2H48M5.4775807SAvailablehttps://sb-java-conniey-5.servicebus.windows.net/topic/subscriptions/subscription-9?api-version=2017-04subscription-92020-06-22T23:47:53Z2020-06-22T23:47:53ZPT15SfalseP10675199DT2H48M5.4775807Sfalsetrue05trueActive2020-06-22T23:47:53.8569185Z2020-06-22T23:47:53.8569185Z2020-06-22T23:47:53.857Z00000P10675199DT2H48M5.4775807SAvailablehttps://sb-java-conniey-5.servicebus.windows.net/topic/subscriptions/subscription-session-0?api-version=2017-04subscription-session-02020-06-22T23:47:53Z2020-06-22T23:47:53ZPT15StrueP10675199DT2H48M5.4775807Sfalsetrue05trueActive2020-06-22T23:47:53.9819204Z2020-06-22T23:47:53.9819204Z2020-06-22T23:47:53.983Z00000P10675199DT2H48M5.4775807SAvailablehttps://sb-java-conniey-5.servicebus.windows.net/topic/subscriptions/subscription-session-1?api-version=2017-04subscription-session-12020-06-22T23:47:54Z2020-06-22T23:47:54ZPT15StrueP10675199DT2H48M5.4775807Sfalsetrue05trueActive2020-06-22T23:47:54.0131447Z2020-06-22T23:47:54.0131447Z2020-06-22T23:47:54.013Z00000P10675199DT2H48M5.4775807SAvailablehttps://sb-java-conniey-5.servicebus.windows.net/topic/subscriptions/subscription-session-2?api-version=2017-04subscription-session-22020-06-22T23:47:53Z2020-06-22T23:47:53ZPT15StrueP10675199DT2H48M5.4775807Sfalsetrue05trueActive2020-06-22T23:47:53.7318796Z2020-06-22T23:47:53.7318796Z2020-06-22T23:47:53.733Z00000P10675199DT2H48M5.4775807SAvailablehttps://sb-java-conniey-5.servicebus.windows.net/topic/subscriptions/subscription-session-3?api-version=2017-04subscription-session-32020-06-22T23:47:53Z2020-06-22T23:47:53ZPT15StrueP10675199DT2H48M5.4775807Sfalsetrue05trueActive2020-06-22T23:47:53.7944244Z2020-06-22T23:47:53.7944244Z2020-06-22T23:47:53.793Z00000P10675199DT2H48M5.4775807SAvailablehttps://sb-java-conniey-5.servicebus.windows.net/topic/subscriptions/subscription-session-4?api-version=2017-04subscription-session-42020-06-22T23:47:53Z2020-06-22T23:47:53ZPT15StrueP10675199DT2H48M5.4775807Sfalsetrue05trueActive2020-06-22T23:47:53.8100058Z2020-06-22T23:47:53.8100058Z2020-06-22T23:47:53.81Z00000P10675199DT2H48M5.4775807SAvailablehttps://sb-java-conniey-5.servicebus.windows.net/topic/subscriptions/subscription-session-5?api-version=2017-04subscription-session-52020-06-22T23:47:53Z2020-06-22T23:47:53ZPT15StrueP10675199DT2H48M5.4775807Sfalsetrue05trueActive2020-06-22T23:47:53.9037826Z2020-06-22T23:47:53.9037826Z2020-06-22T23:47:53.903Z00000P10675199DT2H48M5.4775807SAvailablehttps://sb-java-conniey-5.servicebus.windows.net/topic/subscriptions/subscription-session-6?api-version=2017-04subscription-session-62020-06-22T23:47:53Z2020-06-22T23:47:53ZPT15StrueP10675199DT2H48M5.4775807Sfalsetrue05trueActive2020-06-22T23:47:53.8881314Z2020-06-22T23:47:53.8881314Z2020-06-22T23:47:53.887Z00000P10675199DT2H48M5.4775807SAvailablehttps://sb-java-conniey-5.servicebus.windows.net/topic/subscriptions/subscription-session-7?api-version=2017-04subscription-session-72020-06-22T23:47:53Z2020-06-22T23:47:53ZPT15StrueP10675199DT2H48M5.4775807Sfalsetrue05trueActive2020-06-22T23:47:53.8256302Z2020-06-22T23:47:53.8256302Z2020-06-22T23:47:53.827Z00000P10675199DT2H48M5.4775807SAvailablehttps://sb-java-conniey-5.servicebus.windows.net/topic/subscriptions/subscription-session-8?api-version=2017-04subscription-session-82020-06-22T23:47:53Z2020-06-22T23:47:53ZPT15StrueP10675199DT2H48M5.4775807Sfalsetrue05trueActive2020-06-22T23:47:53.8412585Z2020-06-22T23:47:53.8412585Z2020-06-22T23:47:53.84Z00000P10675199DT2H48M5.4775807SAvailablehttps://sb-java-conniey-5.servicebus.windows.net/topic/subscriptions/subscription-session-9?api-version=2017-04subscription-session-92020-06-22T23:47:54Z2020-06-22T23:47:54ZPT15StrueP10675199DT2H48M5.4775807Sfalsetrue05trueActive2020-06-22T23:47:54.0131447Z2020-06-22T23:47:54.0131447Z2020-06-22T23:47:54.013Z00000P10675199DT2H48M5.4775807SAvailable", - "Date" : "Wed, 01 Jul 2020 11:40:51 GMT", + "Body" : "Subscriptionshttps://sb-java-conniey-1.servicebus.windows.net/topic-1/subscriptions?$skip=0&$top=100&api-version=2017-042020-07-02T22:49:10Zhttps://sb-java-conniey-1.servicebus.windows.net/topic-1/subscriptions/subscription?api-version=2017-04subscription2020-07-02T21:40:54Z2020-07-02T21:40:54ZPT15SfalseP10675199DT2H48M5.4775807Sfalsetrue05trueActive2020-07-02T21:40:54.3702481Z2020-07-02T21:40:54.3702481Z2020-07-02T21:40:54.3702481Z00000P10675199DT2H48M5.4775807SAvailablehttps://sb-java-conniey-1.servicebus.windows.net/topic-1/subscriptions/subscription-session?api-version=2017-04subscription-session2020-07-02T21:40:54Z2020-07-02T21:40:54ZPT15StrueP10675199DT2H48M5.4775807Sfalsetrue05trueActive2020-07-02T21:40:54.4327719Z2020-07-02T21:40:54.4327719Z2020-07-02T21:40:54.433Z00000P10675199DT2H48M5.4775807SAvailablehttps://sb-java-conniey-1.servicebus.windows.net/topic-1/subscriptions/subscription-session-1?api-version=2017-04subscription-session-12020-07-02T22:46:04Z2020-07-02T22:46:04ZPT1MfalseP10675199DT2H48M5.477Sfalsetrue010trueActive2020-07-02T22:46:04.6172301Z2020-07-02T22:46:04.6172301Z2020-07-02T22:46:04.6172301Z00000P10675199DT2H48M5.477SAvailable", + "Date" : "Thu, 02 Jul 2020 22:49:09 GMT", "Content-Type" : "application/atom+xml;type=feed;charset=utf-8" }, "Exception" : null diff --git a/sdk/servicebus/azure-messaging-servicebus/src/test/resources/session-records/listTopics.json b/sdk/servicebus/azure-messaging-servicebus/src/test/resources/session-records/listTopics.json index 7a92f395c386b..5a354526242f1 100644 --- a/sdk/servicebus/azure-messaging-servicebus/src/test/resources/session-records/listTopics.json +++ b/sdk/servicebus/azure-messaging-servicebus/src/test/resources/session-records/listTopics.json @@ -3,18 +3,18 @@ "Method" : "GET", "Uri" : "https://REDACTED.servicebus.windows.net/$Resources/topics?$skip=0&$top=100&api-version=2017-04", "Headers" : { - "User-Agent" : "azsdk-java-azure-messaging-servicebus/7.0.0-beta.4 (11.0.5; Windows 10 10.0)" + "User-Agent" : "azsdk-java-azure-messaging-servicebus/7.0.0-beta.4 (11.0.5; Windows 10; 10.0)" }, "Response" : { "Transfer-Encoding" : "chunked", "Server" : "Microsoft-HTTPAPI/2.0", "retry-after" : "0", "StatusCode" : "200", - "Body" : "Topicshttps://sb-java-conniey-5.servicebus.windows.net/$Resources/topics?$skip=0&$top=10&api-version=2017-042020-07-01T11:20:41Zhttps://sb-java-conniey-5.servicebus.windows.net/test23290?api-version=2017-04test232902020-07-01T08:35:41Z2020-07-01T08:35:41Zsb-java-conniey-5test23290P10675199DT2H48M5.477S2048truePT2Mtrue0falsefalseActive2020-07-01T08:35:41.32Z2020-07-01T08:35:41.367Z0001-01-01T00:00:00Zfalse000000P10675199DT2H48M5.477Sfalsesome-metadata-for-testing-topicAvailablefalsefalsehttps://sb-java-conniey-5.servicebus.windows.net/topic?api-version=2017-04topic2020-06-22T23:47:51Z2020-06-22T23:47:51Zsb-java-conniey-5P10675199DT2H48M5.4775807S1024falsePT10Mtrue0falsefalseActive2020-06-22T23:47:51.543Z2020-06-22T23:47:51.627Z2020-07-01T05:36:06.6410246Ztrue0000023P10675199DT2H48M5.4775807SfalseAvailablefalsefalsehttps://sb-java-conniey-5.servicebus.windows.net/topic97369?api-version=2017-04topic973692020-07-01T08:24:27Z2020-07-01T08:24:27Zsb-java-conniey-5topic97369P10675199DT2H48M5.477S1024falsePT1Mtrue0falsefalseActive2020-07-01T08:24:27.193Z2020-07-01T08:24:27.333Z2020-07-01T08:24:28.1087177Zfalse000000P10675199DT2H48M5.477SfalseAvailablefalsefalse", - "Date" : "Wed, 01 Jul 2020 11:20:40 GMT", + "Body" : "Topicshttps://sb-java-conniey-1.servicebus.windows.net/$Resources/topics?$skip=0&$top=100&api-version=2017-042020-07-02T22:49:13Zhttps://sb-java-conniey-1.servicebus.windows.net/test00419?api-version=2017-04test004192020-07-02T22:46:54Z2020-07-02T22:46:54Zsb-java-conniey-1test00419P10675199DT2H48M5.477S2048truePT2Mtrue0falsefalseActive2020-07-02T22:46:54.6745275Z2020-07-02T22:46:54.6745275Z0001-01-01T00:00:00Zfalse000000P10675199DT2H48M5.477Sfalsesome-metadata-for-testing-topicAvailablefalsefalsehttps://sb-java-conniey-1.servicebus.windows.net/test27109?api-version=2017-04test271092020-07-02T22:46:08Z2020-07-02T22:46:08Zsb-java-conniey-1test27109P10675199DT2H48M5.477S2048truePT2Mtrue0falsefalseActive2020-07-02T22:46:08.047438Z2020-07-02T22:46:08.047438Z0001-01-01T00:00:00Zfalse000000P10675199DT2H48M5.477Sfalsesome-metadata-for-testing-topicAvailablefalsefalsehttps://sb-java-conniey-1.servicebus.windows.net/test50863?api-version=2017-04test508632020-07-02T22:49:12Z2020-07-02T22:49:12Zsb-java-conniey-1test50863P10675199DT2H48M5.477S2048truePT2Mtrue0falsefalseActive2020-07-02T22:49:12.47Z2020-07-02T22:49:12.56Z0001-01-01T00:00:00Zfalse000000P10675199DT2H48M5.477Sfalsesome-metadata-for-testing-topicAvailablefalsefalsehttps://sb-java-conniey-1.servicebus.windows.net/test53188?api-version=2017-04test531882020-07-02T21:56:16Z2020-07-02T21:56:17Zsb-java-conniey-1test53188P10675199DT2H48M5.477S2048truePT2Mtrue0falsefalseActive2020-07-02T21:56:16.8983363Z2020-07-02T21:56:16.8983363Z0001-01-01T00:00:00Zfalse000000P10675199DT2H48M5.477Sfalsesome-metadata-for-testing-topicAvailablefalsefalsehttps://sb-java-conniey-1.servicebus.windows.net/test99509?api-version=2017-04test995092020-07-02T22:40:21Z2020-07-02T22:40:21Zsb-java-conniey-1test99509P10675199DT2H48M5.477S2048truePT2Mtrue0falsefalseActive2020-07-02T22:40:21.8989155Z2020-07-02T22:40:21.8989155Z0001-01-01T00:00:00Zfalse000000P10675199DT2H48M5.477Sfalsesome-metadata-for-testing-topicAvailablefalsefalsehttps://sb-java-conniey-1.servicebus.windows.net/topic-0?api-version=2017-04topic-02020-07-02T21:40:52Z2020-07-02T21:40:52Zsb-java-conniey-1P10675199DT2H48M5.4775807S1024falsePT10Mtrue0falsefalseActive2020-07-02T21:40:52.4620569Z2020-07-02T21:40:52.4620569Z2020-07-02T22:49:02.122152Ztrue000005P10675199DT2H48M5.4775807SfalseAvailablefalsefalsehttps://sb-java-conniey-1.servicebus.windows.net/topic-1?api-version=2017-04topic-12020-07-02T21:40:52Z2020-07-02T21:40:52Zsb-java-conniey-1P10675199DT2H48M5.4775807S1024falsePT10Mtrue0falsefalseActive2020-07-02T21:40:52.3077409Z2020-07-02T21:40:52.3077409Z2020-07-02T22:46:04.6172301Ztrue000003P10675199DT2H48M5.4775807SfalseAvailablefalsefalsehttps://sb-java-conniey-1.servicebus.windows.net/topic-10?api-version=2017-04topic-102020-07-02T21:40:52Z2020-07-02T21:40:52Zsb-java-conniey-1P10675199DT2H48M5.4775807S1024falsePT10Mtrue0falsefalseActive2020-07-02T21:40:52.42Z2020-07-02T21:40:52.64Z2020-07-02T21:40:54.8940272Ztrue000002P10675199DT2H48M5.4775807SfalseAvailablefalsefalsehttps://sb-java-conniey-1.servicebus.windows.net/topic-11?api-version=2017-04topic-112020-07-02T21:40:52Z2020-07-02T21:40:52Zsb-java-conniey-1P10675199DT2H48M5.4775807S1024falsePT10Mtrue0falsefalseActive2020-07-02T21:40:52.17Z2020-07-02T21:40:52.277Z2020-07-02T21:40:54.3011986Ztrue000002P10675199DT2H48M5.4775807SfalseAvailablefalsefalsehttps://sb-java-conniey-1.servicebus.windows.net/topic-12?api-version=2017-04topic-122020-07-02T21:40:52Z2020-07-02T21:40:52Zsb-java-conniey-1P10675199DT2H48M5.4775807S1024falsePT10Mtrue0falsefalseActive2020-07-02T21:40:52.2589036Z2020-07-02T21:40:52.2589036Z2020-07-02T21:40:54.267Ztrue000002P10675199DT2H48M5.4775807SfalseAvailablefalsefalsehttps://sb-java-conniey-1.servicebus.windows.net/topic-13?api-version=2017-04topic-132020-07-02T21:40:52Z2020-07-02T21:40:52Zsb-java-conniey-1P10675199DT2H48M5.4775807S1024falsePT10Mtrue0falsefalseActive2020-07-02T21:40:52.4776547Z2020-07-02T21:40:52.4776547Z2020-07-02T21:40:54.643Ztrue000002P10675199DT2H48M5.4775807SfalseAvailablefalsefalsehttps://sb-java-conniey-1.servicebus.windows.net/topic-14?api-version=2017-04topic-142020-07-02T21:40:52Z2020-07-02T21:40:52Zsb-java-conniey-1P10675199DT2H48M5.4775807S1024falsePT10Mtrue0falsefalseActive2020-07-02T21:40:52.17Z2020-07-02T21:40:52.31Z2020-07-02T21:40:54.3636972Ztrue000002P10675199DT2H48M5.4775807SfalseAvailablefalsefalsehttps://sb-java-conniey-1.servicebus.windows.net/topic-2?api-version=2017-04topic-22020-07-02T21:40:52Z2020-07-02T21:40:52Zsb-java-conniey-1P10675199DT2H48M5.4775807S1024falsePT10Mtrue0falsefalseActive2020-07-02T21:40:52.29Z2020-07-02T21:40:52.43Z2020-07-02T21:40:54.8995889Ztrue000002P10675199DT2H48M5.4775807SfalseAvailablefalsefalsehttps://sb-java-conniey-1.servicebus.windows.net/topic-3?api-version=2017-04topic-32020-07-02T21:40:52Z2020-07-02T21:40:52Zsb-java-conniey-1P10675199DT2H48M5.4775807S1024falsePT10Mtrue0falsefalseActive2020-07-02T21:40:52.35Z2020-07-02T21:40:52.47Z2020-07-02T21:40:54.5649646Ztrue000002P10675199DT2H48M5.4775807SfalseAvailablefalsefalsehttps://sb-java-conniey-1.servicebus.windows.net/topic-4?api-version=2017-04topic-42020-07-02T21:40:52Z2020-07-02T21:40:52Zsb-java-conniey-1P10675199DT2H48M5.4775807S1024falsePT10Mtrue0falsefalseActive2020-07-02T21:40:52.4667131Z2020-07-02T21:40:52.4667131Z2020-07-02T21:40:54.6176619Ztrue000002P10675199DT2H48M5.4775807SfalseAvailablefalsefalsehttps://sb-java-conniey-1.servicebus.windows.net/topic-5?api-version=2017-04topic-52020-07-02T21:40:52Z2020-07-02T21:40:52Zsb-java-conniey-1P10675199DT2H48M5.4775807S1024falsePT10Mtrue0falsefalseActive2020-07-02T21:40:52.3630895Z2020-07-02T21:40:52.3630895Z2020-07-02T21:40:54.6139342Ztrue000002P10675199DT2H48M5.4775807SfalseAvailablefalsefalsehttps://sb-java-conniey-1.servicebus.windows.net/topic-6?api-version=2017-04topic-62020-07-02T21:40:52Z2020-07-02T21:40:52Zsb-java-conniey-1P10675199DT2H48M5.4775807S1024falsePT10Mtrue0falsefalseActive2020-07-02T21:40:52.352692Z2020-07-02T21:40:52.352692Z2020-07-02T21:40:54.377Ztrue000002P10675199DT2H48M5.4775807SfalseAvailablefalsefalsehttps://sb-java-conniey-1.servicebus.windows.net/topic-7?api-version=2017-04topic-72020-07-02T21:40:52Z2020-07-02T21:40:52Zsb-java-conniey-1P10675199DT2H48M5.4775807S1024falsePT10Mtrue0falsefalseActive2020-07-02T21:40:52.3474803Z2020-07-02T21:40:52.3474803Z2020-07-02T21:40:54.427Ztrue000002P10675199DT2H48M5.4775807SfalseAvailablefalsefalsehttps://sb-java-conniey-1.servicebus.windows.net/topic-8?api-version=2017-04topic-82020-07-02T21:41:08Z2020-07-02T21:41:08Zsb-java-conniey-1P10675199DT2H48M5.4775807S1024falsePT10Mtrue0falsefalseActive2020-07-02T21:41:08.1381576Z2020-07-02T21:41:08.1381576Z2020-07-02T21:41:10.2170259Ztrue000002P10675199DT2H48M5.4775807SfalseAvailablefalsefalsehttps://sb-java-conniey-1.servicebus.windows.net/topic-9?api-version=2017-04topic-92020-07-02T21:40:53Z2020-07-02T21:40:53Zsb-java-conniey-1P10675199DT2H48M5.4775807S1024falsePT10Mtrue0falsefalseActive2020-07-02T21:40:53.4201079Z2020-07-02T21:40:53.4201079Z2020-07-02T21:40:55.7102711Ztrue000002P10675199DT2H48M5.4775807SfalseAvailablefalsefalsehttps://sb-java-conniey-1.servicebus.windows.net/topic08886?api-version=2017-04topic088862020-07-02T22:49:06Z2020-07-02T22:49:06Zsb-java-conniey-1topic08886P10675199DT2H48M5.477S1024falsePT1Mtrue0falsefalseActive2020-07-02T22:49:06.8664428Z2020-07-02T22:49:06.8664428Z2020-07-02T22:49:07.5070756Zfalse000000P10675199DT2H48M5.477SfalseAvailablefalsefalsehttps://sb-java-conniey-1.servicebus.windows.net/topic11570?api-version=2017-04topic115702020-07-02T22:46:47Z2020-07-02T22:46:48Zsb-java-conniey-1topic11570P10675199DT2H48M5.477S1024falsePT1Mtrue0falsefalseActive2020-07-02T22:46:47.9908245Z2020-07-02T22:46:47.9908245Z2020-07-02T22:46:48.7148151Zfalse000000P10675199DT2H48M5.477SfalseAvailablefalsefalsehttps://sb-java-conniey-1.servicebus.windows.net/topic11588?api-version=2017-04topic115882020-07-02T22:40:09Z2020-07-02T22:40:10Zsb-java-conniey-1topic11588P10675199DT2H48M5.477S1024falsePT1Mtrue0falsefalseActive2020-07-02T22:40:09.4817544Z2020-07-02T22:40:09.4817544Z2020-07-02T22:40:11.0442653Zfalse000000P10675199DT2H48M5.477SfalseAvailablefalsefalsehttps://sb-java-conniey-1.servicebus.windows.net/topic35988?api-version=2017-04topic359882020-07-02T21:56:07Z2020-07-02T21:56:07Zsb-java-conniey-1topic35988P10675199DT2H48M5.477S1024falsePT1Mtrue0falsefalseActive2020-07-02T21:56:07.3307015Z2020-07-02T21:56:07.3307015Z2020-07-02T21:56:08.2994586Zfalse000000P10675199DT2H48M5.477SfalseAvailablefalsefalsehttps://sb-java-conniey-1.servicebus.windows.net/topic54477?api-version=2017-04topic544772020-07-02T22:46:01Z2020-07-02T22:46:01Zsb-java-conniey-1topic54477P10675199DT2H48M5.477S1024falsePT1Mtrue0falsefalseActive2020-07-02T22:46:01.6845378Z2020-07-02T22:46:01.6845378Z2020-07-02T22:46:02.5449437Zfalse000000P10675199DT2H48M5.477SfalseAvailablefalsefalse", + "Date" : "Thu, 02 Jul 2020 22:49:12 GMT", "Content-Type" : "application/atom+xml;type=feed;charset=utf-8" }, "Exception" : null } ], "variables" : [ ] -} +} \ No newline at end of file diff --git a/sdk/servicebus/azure-messaging-servicebus/src/test/resources/xml/NamespaceEntry.xml b/sdk/servicebus/azure-messaging-servicebus/src/test/resources/xml/NamespaceEntry.xml new file mode 100644 index 0000000000000..bffee25758953 --- /dev/null +++ b/sdk/servicebus/azure-messaging-servicebus/src/test/resources/xml/NamespaceEntry.xml @@ -0,0 +1,21 @@ + + https://shivangiservicebus.servicebus.windows.net/$namespaceinfo?api-version=2017-04 + ShivangiServiceBus + 2020-07-02T09:53:19Z + + ShivangiServiceBus + + + + + MyServiceBusFallback + 2020-04-09T08:38:55.807Z + Premium + 1 + 2020-06-12T06:34:38.383Z + ShivangiServiceBus + Messaging + + + From f27af368d4542d29618664c87d1c2957b96d534d Mon Sep 17 00:00:00 2001 From: Justin Bertrand Date: Thu, 2 Jul 2020 22:21:24 -0400 Subject: [PATCH 010/129] Update README.md (#12756) fix(maven groupId): Updated the groupId to point to the correct location. --- sdk/spring/azure-spring-boot-starter-active-directory/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/spring/azure-spring-boot-starter-active-directory/README.md b/sdk/spring/azure-spring-boot-starter-active-directory/README.md index 9644843b0f1ee..02edeb4e9d5e7 100644 --- a/sdk/spring/azure-spring-boot-starter-active-directory/README.md +++ b/sdk/spring/azure-spring-boot-starter-active-directory/README.md @@ -28,7 +28,7 @@ If you are using Maven, add the following dependency. [//]: # "{x-version-update-start;com.azure:azure-active-directory-spring-boot-starter;current}" ```xml - com.azure + com.microsoft.azure azure-active-directory-spring-boot-starter 2.3.3-beta.1 From 768553998cf42b3ee18afc1e0d3bf212da31f83c Mon Sep 17 00:00:00 2001 From: Rujun Chen Date: Fri, 3 Jul 2020 11:01:39 +0800 Subject: [PATCH 011/129] Not let our sample down if property 'azure.activedirectory.tenant-id' is not confugured. (#12645) * Not let our sample down if property 'azure.activedirectory.tenant-id' is not confugured. * Add NoLoginSecurityConfig to disable login. * Add comment to explain what NoLoginSecurityConfig used for. * Recover application.properties. * Update readme to explain what 'NoLoginSecurityConfig' is used for. Co-authored-by: Rujun Chen --- .../README.md | 3 +++ .../azure/aad/controller/HomeController.java | 2 ++ .../AADOAuth2LoginSecurityConfig.java | 2 ++ .../aad/security/NoLoginSecurityConfig.java | 25 +++++++++++++++++++ 4 files changed, 32 insertions(+) create mode 100644 sdk/spring/azure-spring-boot-samples/azure-spring-boot-sample-active-directory-backend/src/main/java/com/microsoft/azure/aad/security/NoLoginSecurityConfig.java diff --git a/sdk/spring/azure-spring-boot-samples/azure-spring-boot-sample-active-directory-backend/README.md b/sdk/spring/azure-spring-boot-samples/azure-spring-boot-sample-active-directory-backend/README.md index aa6fecd9d4965..cf791d11705d2 100644 --- a/sdk/spring/azure-spring-boot-samples/azure-spring-boot-sample-active-directory-backend/README.md +++ b/sdk/spring/azure-spring-boot-samples/azure-spring-boot-sample-active-directory-backend/README.md @@ -26,6 +26,9 @@ azure.activedirectory.tenant-id=xxxxxx-your-tenant-id-xxxxxx azure.activedirectory.active-directory-groups=group1, group2 ``` +If `azure.activedirectory.tenant-id` is configured, `AADOAuth2LoginSecurityConfig` will take effect and this app will use AAD to authentication and authorization. +If `azure.activedirectory.tenant-id` is **NOT** configured, `NoLoginSecurityConfig` will take effect and this app will **NOT** use AAD to authentication and authorization. + ### Run with Maven ```shell # Under sdk/spring project root directory diff --git a/sdk/spring/azure-spring-boot-samples/azure-spring-boot-sample-active-directory-backend/src/main/java/com/microsoft/azure/aad/controller/HomeController.java b/sdk/spring/azure-spring-boot-samples/azure-spring-boot-sample-active-directory-backend/src/main/java/com/microsoft/azure/aad/controller/HomeController.java index 6a0e802ea30a3..c0ac526c1cf6c 100644 --- a/sdk/spring/azure-spring-boot-samples/azure-spring-boot-sample-active-directory-backend/src/main/java/com/microsoft/azure/aad/controller/HomeController.java +++ b/sdk/spring/azure-spring-boot-samples/azure-spring-boot-sample-active-directory-backend/src/main/java/com/microsoft/azure/aad/controller/HomeController.java @@ -4,6 +4,7 @@ package com.microsoft.azure.aad.controller; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.oauth2.client.OAuth2AuthorizedClient; import org.springframework.security.oauth2.client.OAuth2AuthorizedClientService; @@ -13,6 +14,7 @@ import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.ResponseBody; +@ConditionalOnProperty(prefix = "azure.activedirectory", value = "tenant-id") @Controller public class HomeController { @Autowired diff --git a/sdk/spring/azure-spring-boot-samples/azure-spring-boot-sample-active-directory-backend/src/main/java/com/microsoft/azure/aad/security/AADOAuth2LoginSecurityConfig.java b/sdk/spring/azure-spring-boot-samples/azure-spring-boot-sample-active-directory-backend/src/main/java/com/microsoft/azure/aad/security/AADOAuth2LoginSecurityConfig.java index b07f305f3d455..dee2f0268b372 100644 --- a/sdk/spring/azure-spring-boot-samples/azure-spring-boot-sample-active-directory-backend/src/main/java/com/microsoft/azure/aad/security/AADOAuth2LoginSecurityConfig.java +++ b/sdk/spring/azure-spring-boot-samples/azure-spring-boot-sample-active-directory-backend/src/main/java/com/microsoft/azure/aad/security/AADOAuth2LoginSecurityConfig.java @@ -4,6 +4,7 @@ package com.microsoft.azure.aad.security; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity; import org.springframework.security.config.annotation.web.builders.HttpSecurity; import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; @@ -12,6 +13,7 @@ import org.springframework.security.oauth2.client.userinfo.OAuth2UserService; import org.springframework.security.oauth2.core.oidc.user.OidcUser; +@ConditionalOnProperty(prefix = "azure.activedirectory", value = "tenant-id") @EnableWebSecurity @EnableGlobalMethodSecurity(prePostEnabled = true) public class AADOAuth2LoginSecurityConfig extends WebSecurityConfigurerAdapter { diff --git a/sdk/spring/azure-spring-boot-samples/azure-spring-boot-sample-active-directory-backend/src/main/java/com/microsoft/azure/aad/security/NoLoginSecurityConfig.java b/sdk/spring/azure-spring-boot-samples/azure-spring-boot-sample-active-directory-backend/src/main/java/com/microsoft/azure/aad/security/NoLoginSecurityConfig.java new file mode 100644 index 0000000000000..7880d4c43c686 --- /dev/null +++ b/sdk/spring/azure-spring-boot-samples/azure-spring-boot-sample-active-directory-backend/src/main/java/com/microsoft/azure/aad/security/NoLoginSecurityConfig.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.microsoft.azure.aad.security; + +import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; +import org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity; +import org.springframework.security.config.annotation.web.builders.HttpSecurity; +import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; +import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter; + +// If "azure.activedirectory.tenant-id" is not configured, +// this bean will take effect to disable login. +@ConditionalOnMissingBean(AADOAuth2LoginSecurityConfig.class) +@EnableWebSecurity +@EnableGlobalMethodSecurity(prePostEnabled = true) +public class NoLoginSecurityConfig extends WebSecurityConfigurerAdapter { + + @Override + protected void configure(HttpSecurity http) throws Exception { + http.authorizeRequests() + .antMatchers("/**") + .permitAll(); + } +} From 31029c59398e51fded8e8b2117410a804200f734 Mon Sep 17 00:00:00 2001 From: Hemant Tanwar Date: Thu, 2 Jul 2020 22:41:52 -0700 Subject: [PATCH 012/129] Servicebus track2 readme changes 10327 (#12735) * readme changes --- .../azure-messaging-servicebus/README.md | 61 +++++++++++-------- .../messaging/servicebus/ReadmeSamples.java | 12 ++++ 2 files changed, 47 insertions(+), 26 deletions(-) diff --git a/sdk/servicebus/azure-messaging-servicebus/README.md b/sdk/servicebus/azure-messaging-servicebus/README.md index 8d7f7f5bd1292..e061bfd600c45 100644 --- a/sdk/servicebus/azure-messaging-servicebus/README.md +++ b/sdk/servicebus/azure-messaging-servicebus/README.md @@ -15,38 +15,21 @@ have to be online at the same time. [Source code][source_code] | [API reference documentation][api_documentation] | [Product documentation][product_docs]| [Samples][sample_examples] -## Table of contents - -- [Azure Service Bus client library for Java](#azure-service-bus-client-library-for-java) - - [Table of contents](#table-of-contents) - - [Getting started](#getting-started) - - [Prerequisites](#prerequisites) - - [Include the package](#include-the-package) - - [Authenticate the client](#authenticate-the-client) - - [Key concepts](#key-concepts) - - [Examples](#examples) - - [Send messages](#send-messages) - - [Receive messages](#receive-messages) - - [Settle messages](#settle-messages) - - [Send and receive from session enabled queues or topics](#send-and-receive-from-session-enabled-queues-or-topics) - - [Troubleshooting](#troubleshooting) - - [Enable client logging](#enable-client-logging) - - [Enable AMQP transport logging](#enable-amqp-transport-logging) - - [Common exceptions](#common-exceptions) - - [Next steps](#next-steps) - - [Contributing](#contributing) - ## Getting started ### Prerequisites -- Java Development Kit (JDK) with version 8 or above +- [Java Development Kit (JDK)][java_development_kit] with version 8 or above - [Maven][maven] - Microsoft Azure subscription - You can create a free account at: https://azure.microsoft.com - Azure Service Bus instance - Step-by-step guide for [creating a Service Bus instance using Azure Portal][service_bus_create] +To quickly create the needed Service Bus resources in Azure and to receive a connection string for them, you can deploy our sample template by clicking: + +[![](http://azuredeploy.net/deploybutton.png)](https://portal.azure.com/#create/Microsoft.Template/uri/https%3A%2F%2Fraw.githubusercontent.com%2FAzure%2Fazure-sdk-for-net%2Fmaster%2Fsdk%2Fservicebus%2FAzure.Messaging.ServiceBus%2Fassets%2Fsamples-azure-deploy.json) + ### Include the package [//]: # ({x-version-update-start;com.azure:azure-messaging-servicebus;current}) @@ -143,7 +126,11 @@ on which actual message transmission takes place. The namespace often serves as receives a copy of the message sent to the topic. ## Examples - + - [Send messages](#send-messages) + - [Receive messages](#receive-messages) + - [Settle messages](#settle-messages) + - [Send and receive from session enabled queues or topics](#send-and-receive-from-session-enabled-queues-or-topics) + - [Create a dead-letter queue Receiver](#create-a-dead-letter-queue-receiver) ### Send messages You'll need to create an asynchronous [`ServiceBusSenderAsyncClient`][ServiceBusSenderAsyncClient] or a synchronous @@ -321,6 +308,22 @@ ServiceBusReceiverAsyncClient receiver = new ServiceBusClientBuilder() .buildAsyncClient(); ``` +### Create a dead-letter queue Receiver + +Azure Service Bus queues and topic subscriptions provide a secondary sub-queue, called a dead-letter queue (DLQ). +The dead-letter queue doesn't need to be explicitly created and can't be deleted or otherwise managed independent +of the main entity. Learn more about dead-letter queue [here][dead-letter-queue]. + + +```java +ServiceBusReceiverClient receiver = new ServiceBusClientBuilder() + .connectionString("<< CONNECTION STRING FOR THE SERVICE BUS NAMESPACE >>") + .deadLetterReceiver() + .topicName("<< TOPIC NAME >>") + .subscriptionName("<< SUBSCRIPTION NAME >>") + .buildClient(); +``` + ## Troubleshooting ### Enable client logging @@ -359,7 +362,9 @@ java.util.logging.SimpleFormatter.format=[%1$tF %1$tr] %3$s %4$s: %5$s %n This is a general exception for AMQP related failures, which includes the AMQP errors as `ErrorCondition` and the context that caused this exception as `AmqpErrorContext`. `isTransient` is a boolean indicating if the exception is a -transient error or not. If true, then the request can be retried; otherwise not. +transient error or not. If a transient AMQP exception occurs, the client library retries the operation as many times +as the [AmqpRetryOptons][AmqpRetryOptons] allows. Afterwords, the operation fails and an exception is propagated back +to the user. [`AmqpErrorCondition`][AmqpErrorCondition] contains error conditions common to the AMQP protocol and used by Azure services. When an AMQP exception is thrown, examining the error condition field can inform developers as to why the AMQP @@ -373,7 +378,7 @@ The recommended way to solve the specific exception the AMQP exception represent Beyond those discussed, the Azure Service Bus client library offers support for many additional scenarios to help take advantage of the full feature set of the Azure Service Bus service. In order to help explore some of these scenarios, -check out the [samples README][samples_readme]. +the following set of sample is available [here][samples_readme]. ## Contributing @@ -384,8 +389,11 @@ Guidelines](./../../../CONTRIBUTING.md) for more information. [aad_authorization]: https://docs.microsoft.com/azure/service-bus-messaging/authenticate-application [amqp_transport_error]: https://docs.oasis-open.org/amqp/core/v1.0/os/amqp-core-transport-v1.0-os.html#type-amqp-error [AmqpErrorCondition]: ../../core/azure-core-amqp/src/main/java/com/azure/core/amqp/exception/AmqpErrorCondition.java +[AmqpRetryOptons]: ../../core/azure-core-amqp/src/main/java/com/azure/core/amqp/AmqpRetryOptions.java [api_documentation]: https://aka.ms/java-docs +[dead-letter-queue]: https://docs.microsoft.com/azure/service-bus-messaging/service-bus-dead-letter-queues [deadletterqueue_docs]: https://docs.microsoft.com/azure/service-bus-messaging/service-bus-dead-letter-queues +[java_development_kit]: https://docs.microsoft.com/java/azure/jdk/?view=azure-java-stable [java_8_sdk_javadocs]: https://docs.oracle.com/javase/8/docs/api/java/util/logging/package-summary.html [logging]: https://github.com/Azure/azure-sdk-for-java/wiki/Logging-with-Azure-SDK [maven]: https://maven.apache.org/ @@ -398,7 +406,7 @@ Guidelines](./../../../CONTRIBUTING.md) for more information. [ReceiveMode]: ./src/main/java/com/azure/messaging/servicebus/models/ReceiveMode.java [RetryOptions]: ../../core/azure-core-amqp/src/main/java/com/azure/core/amqp/AmqpRetryOptions.java [sample_examples]: ./src/samples/java/com/azure/messaging/servicebus/ -[samples_readme]: ./src/samples/README.md +[samples_readme]: ./src/samples/java/com/azure/messaging/servicebus [service_bus_connection_string]: https://docs.microsoft.com/azure/service-bus-messaging/service-bus-create-namespace-portal#get-the-connection-string [servicebus_create]: https://docs.microsoft.com/azure/service-bus-messaging/service-bus-create-namespace-portal [servicebus_messaging_exceptions]: https://docs.microsoft.com/azure/service-bus-messaging/service-bus-messaging-exceptions @@ -407,6 +415,7 @@ Guidelines](./../../../CONTRIBUTING.md) for more information. [ServiceBusReceiverClient]: ./src/main/java/com/azure/messaging/servicebus/ServiceBusReceiverClient.java [ServiceBusSenderAsyncClient]: ./src/main/java/com/azure/messaging/servicebus/ServiceBusSenderAsyncClient.java [ServiceBusSenderClient]: ./src/main/java/com/azure/messaging/servicebus/ServiceBusSenderClient.java +[service_bus_create]: https://docs.microsoft.com/azure/service-bus-messaging/service-bus-create-namespace-portal [source_code]: ./ [subscription_concept]: https://docs.microsoft.com/azure/service-bus-messaging/service-bus-queues-topics-subscriptions#topics-and-subscriptions [topic_concept]: https://docs.microsoft.com/azure/service-bus-messaging/service-bus-messaging-overview#topics diff --git a/sdk/servicebus/azure-messaging-servicebus/src/samples/java/com/azure/messaging/servicebus/ReadmeSamples.java b/sdk/servicebus/azure-messaging-servicebus/src/samples/java/com/azure/messaging/servicebus/ReadmeSamples.java index e512bd9f05de7..68ecda0ad74fb 100644 --- a/sdk/servicebus/azure-messaging-servicebus/src/samples/java/com/azure/messaging/servicebus/ReadmeSamples.java +++ b/sdk/servicebus/azure-messaging-servicebus/src/samples/java/com/azure/messaging/servicebus/ReadmeSamples.java @@ -192,4 +192,16 @@ public void unnamedSessionReceiver() { .queueName("<< QUEUE NAME >>") .buildAsyncClient(); } + + /** + * Code sample for creating an synchronous Service Bus receiver to read message from dead-letter queue. + */ + public void createSynchronousServiceBusDeadLetterQueueReceiver() { + ServiceBusReceiverClient receiver = new ServiceBusClientBuilder() + .connectionString("<< CONNECTION STRING FOR THE SERVICE BUS NAMESPACE >>") + .deadLetterReceiver() + .topicName("<< TOPIC NAME >>") + .subscriptionName("<< SUBSCRIPTION NAME >>") + .buildClient(); + } } From 22ce2f83bcf05a2da1db0c1b5da1bbd95ff55cd3 Mon Sep 17 00:00:00 2001 From: Hemant Tanwar Date: Thu, 2 Jul 2020 22:58:05 -0700 Subject: [PATCH 013/129] Servicebus track2 live test receive renew lock (#12737) * separating resource between live test * Fixing live test --- .../ServiceBusReceiverAsyncClientIntegrationTest.java | 1 - .../ServiceBusReceiverClientIntegrationTest.java | 11 ++--------- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/sdk/servicebus/azure-messaging-servicebus/src/test/java/com/azure/messaging/servicebus/ServiceBusReceiverAsyncClientIntegrationTest.java b/sdk/servicebus/azure-messaging-servicebus/src/test/java/com/azure/messaging/servicebus/ServiceBusReceiverAsyncClientIntegrationTest.java index 782cf00930eab..9a5fcf5c67fff 100644 --- a/sdk/servicebus/azure-messaging-servicebus/src/test/java/com/azure/messaging/servicebus/ServiceBusReceiverAsyncClientIntegrationTest.java +++ b/sdk/servicebus/azure-messaging-servicebus/src/test/java/com/azure/messaging/servicebus/ServiceBusReceiverAsyncClientIntegrationTest.java @@ -668,7 +668,6 @@ void receiveAndRenewLock(MessagingEntityType entityType) { String.format("Updated lock is not after the initial Lock. updated: [%s]. initial:[%s]", lockedUntil, initialLock)); - assertEquals(receivedMessage.getLockedUntil(), lockedUntil); }) .verifyComplete(); } finally { diff --git a/sdk/servicebus/azure-messaging-servicebus/src/test/java/com/azure/messaging/servicebus/ServiceBusReceiverClientIntegrationTest.java b/sdk/servicebus/azure-messaging-servicebus/src/test/java/com/azure/messaging/servicebus/ServiceBusReceiverClientIntegrationTest.java index 99368894f49cd..25e7bafbbd9df 100644 --- a/sdk/servicebus/azure-messaging-servicebus/src/test/java/com/azure/messaging/servicebus/ServiceBusReceiverClientIntegrationTest.java +++ b/sdk/servicebus/azure-messaging-servicebus/src/test/java/com/azure/messaging/servicebus/ServiceBusReceiverClientIntegrationTest.java @@ -15,7 +15,6 @@ import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.EnumSource; import org.junit.jupiter.params.provider.MethodSource; -import reactor.core.publisher.Mono; import java.time.Duration; import java.time.Instant; @@ -114,7 +113,6 @@ void multipleReceiveByOneSubscriberMessageTimeout(MessagingEntityType entityType final int maxMessages = 2; final int totalReceive = 2; final Duration shortTimeOut = Duration.ofSeconds(7); - final Duration longTimeOut = Duration.ofSeconds(10); final String messageId = UUID.randomUUID().toString(); List messageList = new ArrayList<>(); @@ -122,18 +120,13 @@ void multipleReceiveByOneSubscriberMessageTimeout(MessagingEntityType entityType messageList.add(getMessage(messageId, isSessionEnabled)); } - Mono.just(true) - .delayElement(longTimeOut) - .map(aBoolean -> { - sendMessages(messageList); - return aBoolean; - }) - .subscribe(); // Act & Assert IterableStream messages = receiver.receiveMessages(maxMessages, shortTimeOut); long received = messages.stream().count(); assertEquals(0, received); + sendMessages(messageList); + int receivedMessageCount; int totalReceivedCount = 0; for (int i = 0; i < totalReceive; ++i) { From 78ed9ef811643138a0fa1f444864aa2900f7b346 Mon Sep 17 00:00:00 2001 From: Weidong Xu Date: Fri, 3 Jul 2020 14:28:45 +0800 Subject: [PATCH 014/129] disable flaky assert (#12793) --- .../core/management/implementation/polling/LROPollerTests.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/core/azure-core-management/src/test/java/com/azure/core/management/implementation/polling/LROPollerTests.java b/sdk/core/azure-core-management/src/test/java/com/azure/core/management/implementation/polling/LROPollerTests.java index c2b2e008959b1..abb91d6ed9259 100644 --- a/sdk/core/azure-core-management/src/test/java/com/azure/core/management/implementation/polling/LROPollerTests.java +++ b/sdk/core/azure-core-management/src/test/java/com/azure/core/management/implementation/polling/LROPollerTests.java @@ -474,7 +474,7 @@ public String getName() { } catch (InterruptedException e) { // } - Assertions.assertEquals(count, getCallCount.get()); + //Assertions.assertEquals(count, getCallCount.get()); } finally { if (lroServer.isRunning()) { lroServer.shutdown(); From 486c321c002ba4b6ad7caed5ba292f1adf82bd07 Mon Sep 17 00:00:00 2001 From: Yi Liu Date: Fri, 3 Jul 2020 14:53:19 +0800 Subject: [PATCH 015/129] fix bug of auto configuration of spring boot starters (#12795) --- sdk/spring/azure-spring-boot-starter-servicebus-jms/pom.xml | 6 ++++++ .../src/main/resources/META-INF/spring.factories | 5 ++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/sdk/spring/azure-spring-boot-starter-servicebus-jms/pom.xml b/sdk/spring/azure-spring-boot-starter-servicebus-jms/pom.xml index f84449b7dc7e7..984c7399811e3 100644 --- a/sdk/spring/azure-spring-boot-starter-servicebus-jms/pom.xml +++ b/sdk/spring/azure-spring-boot-starter-servicebus-jms/pom.xml @@ -26,6 +26,11 @@ 2.3.3-beta.1 + + org.springframework.boot + spring-boot-starter-validation + 2.3.0.RELEASE + org.springframework @@ -53,6 +58,7 @@ com.microsoft.azure:azure-servicebus-jms:[0.0.2] com.microsoft.azure:azure-spring-boot:[2.3.3-beta.1] org.springframework:spring-jms:[5.2.6.RELEASE] + org.springframework.boot:spring-boot-starter-validation:[2.3.0.RELEASE] diff --git a/sdk/spring/azure-spring-boot/src/main/resources/META-INF/spring.factories b/sdk/spring/azure-spring-boot/src/main/resources/META-INF/spring.factories index 585ba02e906af..77ad8951f70a1 100644 --- a/sdk/spring/azure-spring-boot/src/main/resources/META-INF/spring.factories +++ b/sdk/spring/azure-spring-boot/src/main/resources/META-INF/spring.factories @@ -6,4 +6,7 @@ com.microsoft.azure.spring.autoconfigure.cosmosdb.CosmosDbReactiveRepositoriesAu com.microsoft.azure.spring.autoconfigure.gremlin.GremlinAutoConfiguration,\ com.microsoft.azure.spring.autoconfigure.gremlin.GremlinRepositoriesAutoConfiguration,\ com.microsoft.azure.spring.autoconfigure.aad.AADAuthenticationFilterAutoConfiguration,\ -com.microsoft.azure.spring.autoconfigure.aad.AADOAuth2AutoConfiguration +com.microsoft.azure.spring.autoconfigure.aad.AADOAuth2AutoConfiguration,\ +com.microsoft.azure.spring.autoconfigure.btoc.AADB2CAutoConfiguration,\ +com.microsoft.azure.spring.autoconfigure.metrics.AzureMonitorMetricsExportAutoConfiguration,\ +com.microsoft.azure.spring.autoconfigure.jms.ServiceBusJMSAutoConfiguration From e2e242c433c6f933aa917c6545086a751df02b57 Mon Sep 17 00:00:00 2001 From: Weidong Xu Date: Fri, 3 Jul 2020 15:27:45 +0800 Subject: [PATCH 016/129] mgmt regen resources (#12794) --- .../keyvault/implementation/VaultImpl.java | 3 +- .../keyvault/implementation/VaultsImpl.java | 3 +- .../resourcemanager/keyvault/models/Sku.java | 15 +- .../keyvault/models/SkuFamily.java | 31 ++++ .../network/fluent/inner/UsageInner.java | 17 +- .../implementation/NetworkUsageImpl.java | 6 +- .../network/models/AzureFirewallSkuTier.java | 39 ++--- ...nnectionMonitorEndpointFilterItemType.java | 40 ++--- .../ConnectionMonitorEndpointFilterType.java | 40 ++--- .../FirewallPolicyNatRuleActionType.java | 39 ++--- .../network/models/FlowLogFormatType.java | 39 ++--- .../network/models/HttpMethod.java | 39 ++--- .../models/ManagedRuleEnabledState.java | 39 ++--- .../network/models/NatGatewaySkuName.java | 39 ++--- .../network/models/NetworkUsage.java | 2 +- .../network/models/NetworkUsageUnit.java | 42 ----- .../network/models/OutputType.java | 39 ++--- .../network/models/PublicIpPrefixSkuName.java | 39 ++--- .../network/models/RouteFilterRuleType.java | 39 ++--- .../network/models/UsageUnit.java | 31 ++++ .../storage/fluent/BlobContainersClient.java | 32 ++-- .../fluent/ManagementPoliciesClient.java | 150 +++++++++++++----- .../fluent/inner/StorageAccountInner.java | 59 +++++++ .../ManagementPoliciesImpl.java | 6 +- .../implementation/ManagementPolicyImpl.java | 7 +- .../implementation/PolicyRuleImpl.java | 6 +- .../storage/models/ListContainersInclude.java | 31 ++++ .../storage/models/ManagementPolicyName.java | 31 ++++ .../storage/models/ManagementPolicyRule.java | 16 +- .../storage/models/MinimumTlsVersion.java | 37 +++++ .../storage/models/PolicyRule.java | 2 +- .../storage/models/RuleType.java | 31 ++++ .../StorageAccountCreateParameters.java | 58 +++++++ .../StorageAccountUpdateParameters.java | 58 +++++++ 34 files changed, 688 insertions(+), 417 deletions(-) create mode 100644 sdk/keyvault/mgmt/src/main/java/com/azure/resourcemanager/keyvault/models/SkuFamily.java delete mode 100644 sdk/network/mgmt/src/main/java/com/azure/resourcemanager/network/models/NetworkUsageUnit.java create mode 100644 sdk/network/mgmt/src/main/java/com/azure/resourcemanager/network/models/UsageUnit.java create mode 100644 sdk/storage/mgmt/src/main/java/com/azure/resourcemanager/storage/models/ListContainersInclude.java create mode 100644 sdk/storage/mgmt/src/main/java/com/azure/resourcemanager/storage/models/ManagementPolicyName.java create mode 100644 sdk/storage/mgmt/src/main/java/com/azure/resourcemanager/storage/models/MinimumTlsVersion.java create mode 100644 sdk/storage/mgmt/src/main/java/com/azure/resourcemanager/storage/models/RuleType.java diff --git a/sdk/keyvault/mgmt/src/main/java/com/azure/resourcemanager/keyvault/implementation/VaultImpl.java b/sdk/keyvault/mgmt/src/main/java/com/azure/resourcemanager/keyvault/implementation/VaultImpl.java index d2d028be841de..2620419164d24 100644 --- a/sdk/keyvault/mgmt/src/main/java/com/azure/resourcemanager/keyvault/implementation/VaultImpl.java +++ b/sdk/keyvault/mgmt/src/main/java/com/azure/resourcemanager/keyvault/implementation/VaultImpl.java @@ -20,6 +20,7 @@ import com.azure.resourcemanager.keyvault.models.NetworkRuleSet; import com.azure.resourcemanager.keyvault.models.Secrets; import com.azure.resourcemanager.keyvault.models.Sku; +import com.azure.resourcemanager.keyvault.models.SkuFamily; import com.azure.resourcemanager.keyvault.models.SkuName; import com.azure.resourcemanager.keyvault.models.Vault; import com.azure.resourcemanager.keyvault.models.VaultCreateOrUpdateParameters; @@ -283,7 +284,7 @@ public VaultImpl withSku(SkuName skuName) { if (inner().properties() == null) { inner().withProperties(new VaultProperties()); } - inner().properties().withSku(new Sku().withName(skuName)); + inner().properties().withSku(new Sku().withName(skuName).withFamily(SkuFamily.A)); return this; } diff --git a/sdk/keyvault/mgmt/src/main/java/com/azure/resourcemanager/keyvault/implementation/VaultsImpl.java b/sdk/keyvault/mgmt/src/main/java/com/azure/resourcemanager/keyvault/implementation/VaultsImpl.java index 8c17e1a868b49..c3a5fc3ea78f1 100644 --- a/sdk/keyvault/mgmt/src/main/java/com/azure/resourcemanager/keyvault/implementation/VaultsImpl.java +++ b/sdk/keyvault/mgmt/src/main/java/com/azure/resourcemanager/keyvault/implementation/VaultsImpl.java @@ -14,6 +14,7 @@ import com.azure.resourcemanager.keyvault.models.CreateMode; import com.azure.resourcemanager.keyvault.models.DeletedVault; import com.azure.resourcemanager.keyvault.models.Sku; +import com.azure.resourcemanager.keyvault.models.SkuFamily; import com.azure.resourcemanager.keyvault.models.SkuName; import com.azure.resourcemanager.keyvault.models.Vault; import com.azure.resourcemanager.keyvault.models.VaultCreateOrUpdateParameters; @@ -145,7 +146,7 @@ public Mono recoverSoftDeletedVaultAsync( .withProperties( new VaultProperties() .withCreateMode(CreateMode.RECOVER) - .withSku(new Sku().withName(SkuName.STANDARD)) + .withSku(new Sku().withName(SkuName.STANDARD).withFamily(SkuFamily.A)) .withTenantId(UUID.fromString(tenantId))); return inner() .createOrUpdateAsync(resourceGroupName, vaultName, parameters) diff --git a/sdk/keyvault/mgmt/src/main/java/com/azure/resourcemanager/keyvault/models/Sku.java b/sdk/keyvault/mgmt/src/main/java/com/azure/resourcemanager/keyvault/models/Sku.java index ee6cb828e8e69..868277d144266 100644 --- a/sdk/keyvault/mgmt/src/main/java/com/azure/resourcemanager/keyvault/models/Sku.java +++ b/sdk/keyvault/mgmt/src/main/java/com/azure/resourcemanager/keyvault/models/Sku.java @@ -18,7 +18,7 @@ public final class Sku { * SKU family name */ @JsonProperty(value = "family", required = true) - private String family; + private SkuFamily family; /* * SKU name to specify whether the key vault is a standard vault or a @@ -27,17 +27,12 @@ public final class Sku { @JsonProperty(value = "name", required = true) private SkuName name; - /** Creates an instance of Sku class. */ - public Sku() { - family = "A"; - } - /** * Get the family property: SKU family name. * * @return the family value. */ - public String family() { + public SkuFamily family() { return this.family; } @@ -47,7 +42,7 @@ public String family() { * @param family the family value to set. * @return the Sku object itself. */ - public Sku withFamily(String family) { + public Sku withFamily(SkuFamily family) { this.family = family; return this; } @@ -78,6 +73,10 @@ public Sku withName(SkuName name) { * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { + if (family() == null) { + throw logger + .logExceptionAsError(new IllegalArgumentException("Missing required property family in model Sku")); + } if (name() == null) { throw logger .logExceptionAsError(new IllegalArgumentException("Missing required property name in model Sku")); diff --git a/sdk/keyvault/mgmt/src/main/java/com/azure/resourcemanager/keyvault/models/SkuFamily.java b/sdk/keyvault/mgmt/src/main/java/com/azure/resourcemanager/keyvault/models/SkuFamily.java new file mode 100644 index 0000000000000..13a0401af6b31 --- /dev/null +++ b/sdk/keyvault/mgmt/src/main/java/com/azure/resourcemanager/keyvault/models/SkuFamily.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for SkuFamily. */ +public final class SkuFamily extends ExpandableStringEnum { + /** Static value A for SkuFamily. */ + public static final SkuFamily A = fromString("A"); + + /** + * Creates or finds a SkuFamily from its string representation. + * + * @param name a name to look for. + * @return the corresponding SkuFamily. + */ + @JsonCreator + public static SkuFamily fromString(String name) { + return fromString(name, SkuFamily.class); + } + + /** @return known SkuFamily values. */ + public static Collection values() { + return values(SkuFamily.class); + } +} diff --git a/sdk/network/mgmt/src/main/java/com/azure/resourcemanager/network/fluent/inner/UsageInner.java b/sdk/network/mgmt/src/main/java/com/azure/resourcemanager/network/fluent/inner/UsageInner.java index e7fbc65e2e65b..76248a9aec8a3 100644 --- a/sdk/network/mgmt/src/main/java/com/azure/resourcemanager/network/fluent/inner/UsageInner.java +++ b/sdk/network/mgmt/src/main/java/com/azure/resourcemanager/network/fluent/inner/UsageInner.java @@ -7,6 +7,7 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.network.models.UsageName; +import com.azure.resourcemanager.network.models.UsageUnit; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; @@ -25,7 +26,7 @@ public final class UsageInner { * An enum describing the unit of measurement. */ @JsonProperty(value = "unit", required = true) - private String unit; + private UsageUnit unit; /* * The current value of the usage. @@ -45,11 +46,6 @@ public final class UsageInner { @JsonProperty(value = "name", required = true) private UsageName name; - /** Creates an instance of UsageInner class. */ - public UsageInner() { - unit = "Count"; - } - /** * Get the id property: Resource identifier. * @@ -64,7 +60,7 @@ public String id() { * * @return the unit value. */ - public String unit() { + public UsageUnit unit() { return this.unit; } @@ -74,7 +70,7 @@ public String unit() { * @param unit the unit value to set. * @return the UsageInner object itself. */ - public UsageInner withUnit(String unit) { + public UsageInner withUnit(UsageUnit unit) { this.unit = unit; return this; } @@ -145,6 +141,11 @@ public UsageInner withName(UsageName name) { * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { + if (unit() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property unit in model UsageInner")); + } if (name() == null) { throw logger .logExceptionAsError( diff --git a/sdk/network/mgmt/src/main/java/com/azure/resourcemanager/network/implementation/NetworkUsageImpl.java b/sdk/network/mgmt/src/main/java/com/azure/resourcemanager/network/implementation/NetworkUsageImpl.java index 8f3453b0cb70a..ee78b0daa521d 100644 --- a/sdk/network/mgmt/src/main/java/com/azure/resourcemanager/network/implementation/NetworkUsageImpl.java +++ b/sdk/network/mgmt/src/main/java/com/azure/resourcemanager/network/implementation/NetworkUsageImpl.java @@ -3,9 +3,9 @@ package com.azure.resourcemanager.network.implementation; import com.azure.resourcemanager.network.models.NetworkUsage; -import com.azure.resourcemanager.network.models.NetworkUsageUnit; import com.azure.resourcemanager.network.models.UsageName; import com.azure.resourcemanager.network.fluent.inner.UsageInner; +import com.azure.resourcemanager.network.models.UsageUnit; import com.azure.resourcemanager.resources.fluentcore.model.implementation.WrapperImpl; import com.azure.resourcemanager.resources.fluentcore.utils.Utils; @@ -16,8 +16,8 @@ class NetworkUsageImpl extends WrapperImpl implements NetworkUsage { } @Override - public NetworkUsageUnit unit() { - return NetworkUsageUnit.fromString(inner().unit()); + public UsageUnit unit() { + return inner().unit(); } @Override diff --git a/sdk/network/mgmt/src/main/java/com/azure/resourcemanager/network/models/AzureFirewallSkuTier.java b/sdk/network/mgmt/src/main/java/com/azure/resourcemanager/network/models/AzureFirewallSkuTier.java index acdf014920078..9016a806853e0 100644 --- a/sdk/network/mgmt/src/main/java/com/azure/resourcemanager/network/models/AzureFirewallSkuTier.java +++ b/sdk/network/mgmt/src/main/java/com/azure/resourcemanager/network/models/AzureFirewallSkuTier.java @@ -4,41 +4,28 @@ package com.azure.resourcemanager.network.models; +import com.azure.core.util.ExpandableStringEnum; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Collection; /** Defines values for AzureFirewallSkuTier. */ -public enum AzureFirewallSkuTier { - /** Enum value Standard. */ - STANDARD("Standard"); - - /** The actual serialized value for a AzureFirewallSkuTier instance. */ - private final String value; - - AzureFirewallSkuTier(String value) { - this.value = value; - } +public final class AzureFirewallSkuTier extends ExpandableStringEnum { + /** Static value Standard for AzureFirewallSkuTier. */ + public static final AzureFirewallSkuTier STANDARD = fromString("Standard"); /** - * Parses a serialized value to a AzureFirewallSkuTier instance. + * Creates or finds a AzureFirewallSkuTier from its string representation. * - * @param value the serialized value to parse. - * @return the parsed AzureFirewallSkuTier object, or null if unable to parse. + * @param name a name to look for. + * @return the corresponding AzureFirewallSkuTier. */ @JsonCreator - public static AzureFirewallSkuTier fromString(String value) { - AzureFirewallSkuTier[] items = AzureFirewallSkuTier.values(); - for (AzureFirewallSkuTier item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; + public static AzureFirewallSkuTier fromString(String name) { + return fromString(name, AzureFirewallSkuTier.class); } - @JsonValue - @Override - public String toString() { - return this.value; + /** @return known AzureFirewallSkuTier values. */ + public static Collection values() { + return values(AzureFirewallSkuTier.class); } } diff --git a/sdk/network/mgmt/src/main/java/com/azure/resourcemanager/network/models/ConnectionMonitorEndpointFilterItemType.java b/sdk/network/mgmt/src/main/java/com/azure/resourcemanager/network/models/ConnectionMonitorEndpointFilterItemType.java index a9c94ccf95442..e9c06f94fe095 100644 --- a/sdk/network/mgmt/src/main/java/com/azure/resourcemanager/network/models/ConnectionMonitorEndpointFilterItemType.java +++ b/sdk/network/mgmt/src/main/java/com/azure/resourcemanager/network/models/ConnectionMonitorEndpointFilterItemType.java @@ -4,41 +4,29 @@ package com.azure.resourcemanager.network.models; +import com.azure.core.util.ExpandableStringEnum; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Collection; /** Defines values for ConnectionMonitorEndpointFilterItemType. */ -public enum ConnectionMonitorEndpointFilterItemType { - /** Enum value AgentAddress. */ - AGENT_ADDRESS("AgentAddress"); - - /** The actual serialized value for a ConnectionMonitorEndpointFilterItemType instance. */ - private final String value; - - ConnectionMonitorEndpointFilterItemType(String value) { - this.value = value; - } +public final class ConnectionMonitorEndpointFilterItemType + extends ExpandableStringEnum { + /** Static value AgentAddress for ConnectionMonitorEndpointFilterItemType. */ + public static final ConnectionMonitorEndpointFilterItemType AGENT_ADDRESS = fromString("AgentAddress"); /** - * Parses a serialized value to a ConnectionMonitorEndpointFilterItemType instance. + * Creates or finds a ConnectionMonitorEndpointFilterItemType from its string representation. * - * @param value the serialized value to parse. - * @return the parsed ConnectionMonitorEndpointFilterItemType object, or null if unable to parse. + * @param name a name to look for. + * @return the corresponding ConnectionMonitorEndpointFilterItemType. */ @JsonCreator - public static ConnectionMonitorEndpointFilterItemType fromString(String value) { - ConnectionMonitorEndpointFilterItemType[] items = ConnectionMonitorEndpointFilterItemType.values(); - for (ConnectionMonitorEndpointFilterItemType item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; + public static ConnectionMonitorEndpointFilterItemType fromString(String name) { + return fromString(name, ConnectionMonitorEndpointFilterItemType.class); } - @JsonValue - @Override - public String toString() { - return this.value; + /** @return known ConnectionMonitorEndpointFilterItemType values. */ + public static Collection values() { + return values(ConnectionMonitorEndpointFilterItemType.class); } } diff --git a/sdk/network/mgmt/src/main/java/com/azure/resourcemanager/network/models/ConnectionMonitorEndpointFilterType.java b/sdk/network/mgmt/src/main/java/com/azure/resourcemanager/network/models/ConnectionMonitorEndpointFilterType.java index 2e9617748f80d..2dab2c699f325 100644 --- a/sdk/network/mgmt/src/main/java/com/azure/resourcemanager/network/models/ConnectionMonitorEndpointFilterType.java +++ b/sdk/network/mgmt/src/main/java/com/azure/resourcemanager/network/models/ConnectionMonitorEndpointFilterType.java @@ -4,41 +4,29 @@ package com.azure.resourcemanager.network.models; +import com.azure.core.util.ExpandableStringEnum; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Collection; /** Defines values for ConnectionMonitorEndpointFilterType. */ -public enum ConnectionMonitorEndpointFilterType { - /** Enum value Include. */ - INCLUDE("Include"); - - /** The actual serialized value for a ConnectionMonitorEndpointFilterType instance. */ - private final String value; - - ConnectionMonitorEndpointFilterType(String value) { - this.value = value; - } +public final class ConnectionMonitorEndpointFilterType + extends ExpandableStringEnum { + /** Static value Include for ConnectionMonitorEndpointFilterType. */ + public static final ConnectionMonitorEndpointFilterType INCLUDE = fromString("Include"); /** - * Parses a serialized value to a ConnectionMonitorEndpointFilterType instance. + * Creates or finds a ConnectionMonitorEndpointFilterType from its string representation. * - * @param value the serialized value to parse. - * @return the parsed ConnectionMonitorEndpointFilterType object, or null if unable to parse. + * @param name a name to look for. + * @return the corresponding ConnectionMonitorEndpointFilterType. */ @JsonCreator - public static ConnectionMonitorEndpointFilterType fromString(String value) { - ConnectionMonitorEndpointFilterType[] items = ConnectionMonitorEndpointFilterType.values(); - for (ConnectionMonitorEndpointFilterType item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; + public static ConnectionMonitorEndpointFilterType fromString(String name) { + return fromString(name, ConnectionMonitorEndpointFilterType.class); } - @JsonValue - @Override - public String toString() { - return this.value; + /** @return known ConnectionMonitorEndpointFilterType values. */ + public static Collection values() { + return values(ConnectionMonitorEndpointFilterType.class); } } diff --git a/sdk/network/mgmt/src/main/java/com/azure/resourcemanager/network/models/FirewallPolicyNatRuleActionType.java b/sdk/network/mgmt/src/main/java/com/azure/resourcemanager/network/models/FirewallPolicyNatRuleActionType.java index 8018b04cb3202..f1b91badf6f81 100644 --- a/sdk/network/mgmt/src/main/java/com/azure/resourcemanager/network/models/FirewallPolicyNatRuleActionType.java +++ b/sdk/network/mgmt/src/main/java/com/azure/resourcemanager/network/models/FirewallPolicyNatRuleActionType.java @@ -4,41 +4,28 @@ package com.azure.resourcemanager.network.models; +import com.azure.core.util.ExpandableStringEnum; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Collection; /** Defines values for FirewallPolicyNatRuleActionType. */ -public enum FirewallPolicyNatRuleActionType { - /** Enum value DNAT. */ - DNAT("DNAT"); - - /** The actual serialized value for a FirewallPolicyNatRuleActionType instance. */ - private final String value; - - FirewallPolicyNatRuleActionType(String value) { - this.value = value; - } +public final class FirewallPolicyNatRuleActionType extends ExpandableStringEnum { + /** Static value DNAT for FirewallPolicyNatRuleActionType. */ + public static final FirewallPolicyNatRuleActionType DNAT = fromString("DNAT"); /** - * Parses a serialized value to a FirewallPolicyNatRuleActionType instance. + * Creates or finds a FirewallPolicyNatRuleActionType from its string representation. * - * @param value the serialized value to parse. - * @return the parsed FirewallPolicyNatRuleActionType object, or null if unable to parse. + * @param name a name to look for. + * @return the corresponding FirewallPolicyNatRuleActionType. */ @JsonCreator - public static FirewallPolicyNatRuleActionType fromString(String value) { - FirewallPolicyNatRuleActionType[] items = FirewallPolicyNatRuleActionType.values(); - for (FirewallPolicyNatRuleActionType item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; + public static FirewallPolicyNatRuleActionType fromString(String name) { + return fromString(name, FirewallPolicyNatRuleActionType.class); } - @JsonValue - @Override - public String toString() { - return this.value; + /** @return known FirewallPolicyNatRuleActionType values. */ + public static Collection values() { + return values(FirewallPolicyNatRuleActionType.class); } } diff --git a/sdk/network/mgmt/src/main/java/com/azure/resourcemanager/network/models/FlowLogFormatType.java b/sdk/network/mgmt/src/main/java/com/azure/resourcemanager/network/models/FlowLogFormatType.java index 5778e94282a44..fddce7ca6e0df 100644 --- a/sdk/network/mgmt/src/main/java/com/azure/resourcemanager/network/models/FlowLogFormatType.java +++ b/sdk/network/mgmt/src/main/java/com/azure/resourcemanager/network/models/FlowLogFormatType.java @@ -4,41 +4,28 @@ package com.azure.resourcemanager.network.models; +import com.azure.core.util.ExpandableStringEnum; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Collection; /** Defines values for FlowLogFormatType. */ -public enum FlowLogFormatType { - /** Enum value JSON. */ - JSON("JSON"); - - /** The actual serialized value for a FlowLogFormatType instance. */ - private final String value; - - FlowLogFormatType(String value) { - this.value = value; - } +public final class FlowLogFormatType extends ExpandableStringEnum { + /** Static value JSON for FlowLogFormatType. */ + public static final FlowLogFormatType JSON = fromString("JSON"); /** - * Parses a serialized value to a FlowLogFormatType instance. + * Creates or finds a FlowLogFormatType from its string representation. * - * @param value the serialized value to parse. - * @return the parsed FlowLogFormatType object, or null if unable to parse. + * @param name a name to look for. + * @return the corresponding FlowLogFormatType. */ @JsonCreator - public static FlowLogFormatType fromString(String value) { - FlowLogFormatType[] items = FlowLogFormatType.values(); - for (FlowLogFormatType item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; + public static FlowLogFormatType fromString(String name) { + return fromString(name, FlowLogFormatType.class); } - @JsonValue - @Override - public String toString() { - return this.value; + /** @return known FlowLogFormatType values. */ + public static Collection values() { + return values(FlowLogFormatType.class); } } diff --git a/sdk/network/mgmt/src/main/java/com/azure/resourcemanager/network/models/HttpMethod.java b/sdk/network/mgmt/src/main/java/com/azure/resourcemanager/network/models/HttpMethod.java index 6a58b52461511..c4b10a52e74da 100644 --- a/sdk/network/mgmt/src/main/java/com/azure/resourcemanager/network/models/HttpMethod.java +++ b/sdk/network/mgmt/src/main/java/com/azure/resourcemanager/network/models/HttpMethod.java @@ -4,41 +4,28 @@ package com.azure.resourcemanager.network.models; +import com.azure.core.util.ExpandableStringEnum; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Collection; /** Defines values for HttpMethod. */ -public enum HttpMethod { - /** Enum value Get. */ - GET("Get"); - - /** The actual serialized value for a HttpMethod instance. */ - private final String value; - - HttpMethod(String value) { - this.value = value; - } +public final class HttpMethod extends ExpandableStringEnum { + /** Static value Get for HttpMethod. */ + public static final HttpMethod GET = fromString("Get"); /** - * Parses a serialized value to a HttpMethod instance. + * Creates or finds a HttpMethod from its string representation. * - * @param value the serialized value to parse. - * @return the parsed HttpMethod object, or null if unable to parse. + * @param name a name to look for. + * @return the corresponding HttpMethod. */ @JsonCreator - public static HttpMethod fromString(String value) { - HttpMethod[] items = HttpMethod.values(); - for (HttpMethod item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; + public static HttpMethod fromString(String name) { + return fromString(name, HttpMethod.class); } - @JsonValue - @Override - public String toString() { - return this.value; + /** @return known HttpMethod values. */ + public static Collection values() { + return values(HttpMethod.class); } } diff --git a/sdk/network/mgmt/src/main/java/com/azure/resourcemanager/network/models/ManagedRuleEnabledState.java b/sdk/network/mgmt/src/main/java/com/azure/resourcemanager/network/models/ManagedRuleEnabledState.java index 2ced6dfc11258..f2ff5af16ad28 100644 --- a/sdk/network/mgmt/src/main/java/com/azure/resourcemanager/network/models/ManagedRuleEnabledState.java +++ b/sdk/network/mgmt/src/main/java/com/azure/resourcemanager/network/models/ManagedRuleEnabledState.java @@ -4,41 +4,28 @@ package com.azure.resourcemanager.network.models; +import com.azure.core.util.ExpandableStringEnum; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Collection; /** Defines values for ManagedRuleEnabledState. */ -public enum ManagedRuleEnabledState { - /** Enum value Disabled. */ - DISABLED("Disabled"); - - /** The actual serialized value for a ManagedRuleEnabledState instance. */ - private final String value; - - ManagedRuleEnabledState(String value) { - this.value = value; - } +public final class ManagedRuleEnabledState extends ExpandableStringEnum { + /** Static value Disabled for ManagedRuleEnabledState. */ + public static final ManagedRuleEnabledState DISABLED = fromString("Disabled"); /** - * Parses a serialized value to a ManagedRuleEnabledState instance. + * Creates or finds a ManagedRuleEnabledState from its string representation. * - * @param value the serialized value to parse. - * @return the parsed ManagedRuleEnabledState object, or null if unable to parse. + * @param name a name to look for. + * @return the corresponding ManagedRuleEnabledState. */ @JsonCreator - public static ManagedRuleEnabledState fromString(String value) { - ManagedRuleEnabledState[] items = ManagedRuleEnabledState.values(); - for (ManagedRuleEnabledState item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; + public static ManagedRuleEnabledState fromString(String name) { + return fromString(name, ManagedRuleEnabledState.class); } - @JsonValue - @Override - public String toString() { - return this.value; + /** @return known ManagedRuleEnabledState values. */ + public static Collection values() { + return values(ManagedRuleEnabledState.class); } } diff --git a/sdk/network/mgmt/src/main/java/com/azure/resourcemanager/network/models/NatGatewaySkuName.java b/sdk/network/mgmt/src/main/java/com/azure/resourcemanager/network/models/NatGatewaySkuName.java index 787d6a4fbe5b9..e9ab2796310ee 100644 --- a/sdk/network/mgmt/src/main/java/com/azure/resourcemanager/network/models/NatGatewaySkuName.java +++ b/sdk/network/mgmt/src/main/java/com/azure/resourcemanager/network/models/NatGatewaySkuName.java @@ -4,41 +4,28 @@ package com.azure.resourcemanager.network.models; +import com.azure.core.util.ExpandableStringEnum; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Collection; /** Defines values for NatGatewaySkuName. */ -public enum NatGatewaySkuName { - /** Enum value Standard. */ - STANDARD("Standard"); - - /** The actual serialized value for a NatGatewaySkuName instance. */ - private final String value; - - NatGatewaySkuName(String value) { - this.value = value; - } +public final class NatGatewaySkuName extends ExpandableStringEnum { + /** Static value Standard for NatGatewaySkuName. */ + public static final NatGatewaySkuName STANDARD = fromString("Standard"); /** - * Parses a serialized value to a NatGatewaySkuName instance. + * Creates or finds a NatGatewaySkuName from its string representation. * - * @param value the serialized value to parse. - * @return the parsed NatGatewaySkuName object, or null if unable to parse. + * @param name a name to look for. + * @return the corresponding NatGatewaySkuName. */ @JsonCreator - public static NatGatewaySkuName fromString(String value) { - NatGatewaySkuName[] items = NatGatewaySkuName.values(); - for (NatGatewaySkuName item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; + public static NatGatewaySkuName fromString(String name) { + return fromString(name, NatGatewaySkuName.class); } - @JsonValue - @Override - public String toString() { - return this.value; + /** @return known NatGatewaySkuName values. */ + public static Collection values() { + return values(NatGatewaySkuName.class); } } diff --git a/sdk/network/mgmt/src/main/java/com/azure/resourcemanager/network/models/NetworkUsage.java b/sdk/network/mgmt/src/main/java/com/azure/resourcemanager/network/models/NetworkUsage.java index d2ea5f31913bd..20d6e6767ad97 100644 --- a/sdk/network/mgmt/src/main/java/com/azure/resourcemanager/network/models/NetworkUsage.java +++ b/sdk/network/mgmt/src/main/java/com/azure/resourcemanager/network/models/NetworkUsage.java @@ -10,7 +10,7 @@ @Fluent public interface NetworkUsage extends HasInner { /** @return the unit of measurement. */ - NetworkUsageUnit unit(); + UsageUnit unit(); /** @return the current count of the allocated resources in the subscription */ long currentValue(); diff --git a/sdk/network/mgmt/src/main/java/com/azure/resourcemanager/network/models/NetworkUsageUnit.java b/sdk/network/mgmt/src/main/java/com/azure/resourcemanager/network/models/NetworkUsageUnit.java deleted file mode 100644 index 6b05dd248ea97..0000000000000 --- a/sdk/network/mgmt/src/main/java/com/azure/resourcemanager/network/models/NetworkUsageUnit.java +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.resourcemanager.network.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** Network usage units. */ -public class NetworkUsageUnit extends ExpandableStringEnum { - /** Static value Count for NetworkUsageUnit. */ - public static final NetworkUsageUnit COUNT = fromString("Count"); - - /** Static value Bytes for NetworkUsageUnit. */ - public static final NetworkUsageUnit BYTES = fromString("Bytes"); - - /** Static value Seconds for NetworkUsageUnit. */ - public static final NetworkUsageUnit SECONDS = fromString("Seconds"); - - /** Static value Percent for NetworkUsageUnit. */ - public static final NetworkUsageUnit PERCENT = fromString("Percent"); - - /** Static value CountsPerSecond for NetworkUsageUnit. */ - public static final NetworkUsageUnit COUNTS_PER_SECOND = fromString("CountsPerSecond"); - - /** Static value BytesPerSecond for ComputeUsageUnit. */ - public static final NetworkUsageUnit BYTES_PER_SECOND = fromString("BytesPerSecond"); - - /** - * Finds or creates a network usage unit based on the specified name. - * - * @param name a name - * @return an instance of NetworkUsageUnit - */ - public static NetworkUsageUnit fromString(String name) { - return fromString(name, NetworkUsageUnit.class); - } - - /** @return known network usage units */ - public static Collection values() { - return values(NetworkUsageUnit.class); - } -} diff --git a/sdk/network/mgmt/src/main/java/com/azure/resourcemanager/network/models/OutputType.java b/sdk/network/mgmt/src/main/java/com/azure/resourcemanager/network/models/OutputType.java index 0b807f0e29a66..4c7c992b911c1 100644 --- a/sdk/network/mgmt/src/main/java/com/azure/resourcemanager/network/models/OutputType.java +++ b/sdk/network/mgmt/src/main/java/com/azure/resourcemanager/network/models/OutputType.java @@ -4,41 +4,28 @@ package com.azure.resourcemanager.network.models; +import com.azure.core.util.ExpandableStringEnum; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Collection; /** Defines values for OutputType. */ -public enum OutputType { - /** Enum value Workspace. */ - WORKSPACE("Workspace"); - - /** The actual serialized value for a OutputType instance. */ - private final String value; - - OutputType(String value) { - this.value = value; - } +public final class OutputType extends ExpandableStringEnum { + /** Static value Workspace for OutputType. */ + public static final OutputType WORKSPACE = fromString("Workspace"); /** - * Parses a serialized value to a OutputType instance. + * Creates or finds a OutputType from its string representation. * - * @param value the serialized value to parse. - * @return the parsed OutputType object, or null if unable to parse. + * @param name a name to look for. + * @return the corresponding OutputType. */ @JsonCreator - public static OutputType fromString(String value) { - OutputType[] items = OutputType.values(); - for (OutputType item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; + public static OutputType fromString(String name) { + return fromString(name, OutputType.class); } - @JsonValue - @Override - public String toString() { - return this.value; + /** @return known OutputType values. */ + public static Collection values() { + return values(OutputType.class); } } diff --git a/sdk/network/mgmt/src/main/java/com/azure/resourcemanager/network/models/PublicIpPrefixSkuName.java b/sdk/network/mgmt/src/main/java/com/azure/resourcemanager/network/models/PublicIpPrefixSkuName.java index 3195f9541be93..3607cb9e7d74f 100644 --- a/sdk/network/mgmt/src/main/java/com/azure/resourcemanager/network/models/PublicIpPrefixSkuName.java +++ b/sdk/network/mgmt/src/main/java/com/azure/resourcemanager/network/models/PublicIpPrefixSkuName.java @@ -4,41 +4,28 @@ package com.azure.resourcemanager.network.models; +import com.azure.core.util.ExpandableStringEnum; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Collection; /** Defines values for PublicIpPrefixSkuName. */ -public enum PublicIpPrefixSkuName { - /** Enum value Standard. */ - STANDARD("Standard"); - - /** The actual serialized value for a PublicIpPrefixSkuName instance. */ - private final String value; - - PublicIpPrefixSkuName(String value) { - this.value = value; - } +public final class PublicIpPrefixSkuName extends ExpandableStringEnum { + /** Static value Standard for PublicIpPrefixSkuName. */ + public static final PublicIpPrefixSkuName STANDARD = fromString("Standard"); /** - * Parses a serialized value to a PublicIpPrefixSkuName instance. + * Creates or finds a PublicIpPrefixSkuName from its string representation. * - * @param value the serialized value to parse. - * @return the parsed PublicIpPrefixSkuName object, or null if unable to parse. + * @param name a name to look for. + * @return the corresponding PublicIpPrefixSkuName. */ @JsonCreator - public static PublicIpPrefixSkuName fromString(String value) { - PublicIpPrefixSkuName[] items = PublicIpPrefixSkuName.values(); - for (PublicIpPrefixSkuName item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; + public static PublicIpPrefixSkuName fromString(String name) { + return fromString(name, PublicIpPrefixSkuName.class); } - @JsonValue - @Override - public String toString() { - return this.value; + /** @return known PublicIpPrefixSkuName values. */ + public static Collection values() { + return values(PublicIpPrefixSkuName.class); } } diff --git a/sdk/network/mgmt/src/main/java/com/azure/resourcemanager/network/models/RouteFilterRuleType.java b/sdk/network/mgmt/src/main/java/com/azure/resourcemanager/network/models/RouteFilterRuleType.java index 49de03d20274e..6b9a5c0f7e96f 100644 --- a/sdk/network/mgmt/src/main/java/com/azure/resourcemanager/network/models/RouteFilterRuleType.java +++ b/sdk/network/mgmt/src/main/java/com/azure/resourcemanager/network/models/RouteFilterRuleType.java @@ -4,41 +4,28 @@ package com.azure.resourcemanager.network.models; +import com.azure.core.util.ExpandableStringEnum; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Collection; /** Defines values for RouteFilterRuleType. */ -public enum RouteFilterRuleType { - /** Enum value Community. */ - COMMUNITY("Community"); - - /** The actual serialized value for a RouteFilterRuleType instance. */ - private final String value; - - RouteFilterRuleType(String value) { - this.value = value; - } +public final class RouteFilterRuleType extends ExpandableStringEnum { + /** Static value Community for RouteFilterRuleType. */ + public static final RouteFilterRuleType COMMUNITY = fromString("Community"); /** - * Parses a serialized value to a RouteFilterRuleType instance. + * Creates or finds a RouteFilterRuleType from its string representation. * - * @param value the serialized value to parse. - * @return the parsed RouteFilterRuleType object, or null if unable to parse. + * @param name a name to look for. + * @return the corresponding RouteFilterRuleType. */ @JsonCreator - public static RouteFilterRuleType fromString(String value) { - RouteFilterRuleType[] items = RouteFilterRuleType.values(); - for (RouteFilterRuleType item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; + public static RouteFilterRuleType fromString(String name) { + return fromString(name, RouteFilterRuleType.class); } - @JsonValue - @Override - public String toString() { - return this.value; + /** @return known RouteFilterRuleType values. */ + public static Collection values() { + return values(RouteFilterRuleType.class); } } diff --git a/sdk/network/mgmt/src/main/java/com/azure/resourcemanager/network/models/UsageUnit.java b/sdk/network/mgmt/src/main/java/com/azure/resourcemanager/network/models/UsageUnit.java new file mode 100644 index 0000000000000..66d59e6a65d50 --- /dev/null +++ b/sdk/network/mgmt/src/main/java/com/azure/resourcemanager/network/models/UsageUnit.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for UsageUnit. */ +public final class UsageUnit extends ExpandableStringEnum { + /** Static value Count for UsageUnit. */ + public static final UsageUnit COUNT = fromString("Count"); + + /** + * Creates or finds a UsageUnit from its string representation. + * + * @param name a name to look for. + * @return the corresponding UsageUnit. + */ + @JsonCreator + public static UsageUnit fromString(String name) { + return fromString(name, UsageUnit.class); + } + + /** @return known UsageUnit values. */ + public static Collection values() { + return values(UsageUnit.class); + } +} diff --git a/sdk/storage/mgmt/src/main/java/com/azure/resourcemanager/storage/fluent/BlobContainersClient.java b/sdk/storage/mgmt/src/main/java/com/azure/resourcemanager/storage/fluent/BlobContainersClient.java index 0093ed602ff87..8f99917e2bc6d 100644 --- a/sdk/storage/mgmt/src/main/java/com/azure/resourcemanager/storage/fluent/BlobContainersClient.java +++ b/sdk/storage/mgmt/src/main/java/com/azure/resourcemanager/storage/fluent/BlobContainersClient.java @@ -44,7 +44,7 @@ import com.azure.resourcemanager.storage.models.BlobContainersGetImmutabilityPolicyResponse; import com.azure.resourcemanager.storage.models.BlobContainersLockImmutabilityPolicyResponse; import com.azure.resourcemanager.storage.models.LeaseContainerRequest; -import com.azure.resourcemanager.storage.models.ListSharesExpand; +import com.azure.resourcemanager.storage.models.ListContainersInclude; import java.util.List; import reactor.core.publisher.Mono; @@ -90,7 +90,7 @@ Mono> list( @PathParam("subscriptionId") String subscriptionId, @QueryParam("$maxpagesize") String maxpagesize, @QueryParam("$filter") String filter, - @QueryParam("$include") ListSharesExpand include, + @QueryParam("$include") ListContainersInclude include, Context context); @Headers({"Accept: application/json", "Content-Type: application/json"}) @@ -319,7 +319,11 @@ Mono> listNext( */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> listSinglePageAsync( - String resourceGroupName, String accountName, String maxpagesize, String filter, ListSharesExpand include) { + String resourceGroupName, + String accountName, + String maxpagesize, + String filter, + ListContainersInclude include) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -388,7 +392,7 @@ public Mono> listSinglePageAsync( String accountName, String maxpagesize, String filter, - ListSharesExpand include, + ListContainersInclude include, Context context) { if (this.client.getEndpoint() == null) { return Mono @@ -449,7 +453,11 @@ public Mono> listSinglePageAsync( */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedFlux listAsync( - String resourceGroupName, String accountName, String maxpagesize, String filter, ListSharesExpand include) { + String resourceGroupName, + String accountName, + String maxpagesize, + String filter, + ListContainersInclude include) { return new PagedFlux<>( () -> listSinglePageAsync(resourceGroupName, accountName, maxpagesize, filter, include), nextLink -> listNextSinglePageAsync(nextLink)); @@ -478,7 +486,7 @@ public PagedFlux listAsync( String accountName, String maxpagesize, String filter, - ListSharesExpand include, + ListContainersInclude include, Context context) { return new PagedFlux<>( () -> listSinglePageAsync(resourceGroupName, accountName, maxpagesize, filter, include, context), @@ -502,7 +510,7 @@ public PagedFlux listAsync( public PagedFlux listAsync(String resourceGroupName, String accountName) { final String maxpagesize = null; final String filter = null; - final ListSharesExpand include = null; + final ListContainersInclude include = null; final Context context = null; return new PagedFlux<>( () -> listSinglePageAsync(resourceGroupName, accountName, maxpagesize, filter, include), @@ -527,7 +535,11 @@ public PagedFlux listAsync(String resourceGroupName, Str */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list( - String resourceGroupName, String accountName, String maxpagesize, String filter, ListSharesExpand include) { + String resourceGroupName, + String accountName, + String maxpagesize, + String filter, + ListContainersInclude include) { return new PagedIterable<>(listAsync(resourceGroupName, accountName, maxpagesize, filter, include)); } @@ -554,7 +566,7 @@ public PagedIterable list( String accountName, String maxpagesize, String filter, - ListSharesExpand include, + ListContainersInclude include, Context context) { return new PagedIterable<>(listAsync(resourceGroupName, accountName, maxpagesize, filter, include, context)); } @@ -576,7 +588,7 @@ public PagedIterable list( public PagedIterable list(String resourceGroupName, String accountName) { final String maxpagesize = null; final String filter = null; - final ListSharesExpand include = null; + final ListContainersInclude include = null; final Context context = null; return new PagedIterable<>(listAsync(resourceGroupName, accountName, maxpagesize, filter, include)); } diff --git a/sdk/storage/mgmt/src/main/java/com/azure/resourcemanager/storage/fluent/ManagementPoliciesClient.java b/sdk/storage/mgmt/src/main/java/com/azure/resourcemanager/storage/fluent/ManagementPoliciesClient.java index 4f7c94dc296d7..e24a7e0c664b0 100644 --- a/sdk/storage/mgmt/src/main/java/com/azure/resourcemanager/storage/fluent/ManagementPoliciesClient.java +++ b/sdk/storage/mgmt/src/main/java/com/azure/resourcemanager/storage/fluent/ManagementPoliciesClient.java @@ -24,14 +24,14 @@ import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsDelete; import com.azure.resourcemanager.storage.StorageManagementClient; import com.azure.resourcemanager.storage.fluent.inner.ManagementPolicyInner; +import com.azure.resourcemanager.storage.models.ManagementPolicyName; import com.azure.resourcemanager.storage.models.ManagementPolicySchema; import reactor.core.publisher.Mono; /** An instance of this class provides access to all the operations defined in ManagementPolicies. */ -public final class ManagementPoliciesClient implements InnerSupportsDelete { +public final class ManagementPoliciesClient { private final ClientLogger logger = new ClientLogger(ManagementPoliciesClient.class); /** The proxy service used to perform REST calls. */ @@ -70,7 +70,7 @@ Mono> get( @PathParam("accountName") String accountName, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("managementPolicyName") String managementPolicyName, + @PathParam("managementPolicyName") ManagementPolicyName managementPolicyName, Context context); @Headers({"Accept: application/json", "Content-Type: application/json"}) @@ -85,7 +85,7 @@ Mono> createOrUpdate( @PathParam("accountName") String accountName, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("managementPolicyName") String managementPolicyName, + @PathParam("managementPolicyName") ManagementPolicyName managementPolicyName, @BodyParam("application/json") ManagementPolicyInner properties, Context context); @@ -101,7 +101,7 @@ Mono> delete( @PathParam("accountName") String accountName, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("managementPolicyName") String managementPolicyName, + @PathParam("managementPolicyName") ManagementPolicyName managementPolicyName, Context context); } @@ -112,13 +112,15 @@ Mono> delete( * 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 managementPolicyName The name of the Storage Account Management Policy. It should always be 'default'. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the managementpolicy associated with the specified storage account. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getWithResponseAsync(String resourceGroupName, String accountName) { + public Mono> getWithResponseAsync( + String resourceGroupName, String accountName, ManagementPolicyName managementPolicyName) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -138,7 +140,10 @@ public Mono> getWithResponseAsync(String resourc new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String managementPolicyName = "default"; + if (managementPolicyName == null) { + return Mono + .error(new IllegalArgumentException("Parameter managementPolicyName is required and cannot be null.")); + } return FluxUtil .withContext( context -> @@ -161,6 +166,7 @@ public Mono> getWithResponseAsync(String resourc * 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 managementPolicyName The name of the Storage Account Management Policy. It should always be 'default'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -169,7 +175,7 @@ public Mono> getWithResponseAsync(String resourc */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync( - String resourceGroupName, String accountName, Context context) { + String resourceGroupName, String accountName, ManagementPolicyName managementPolicyName, Context context) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -189,7 +195,10 @@ public Mono> getWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String managementPolicyName = "default"; + if (managementPolicyName == null) { + return Mono + .error(new IllegalArgumentException("Parameter managementPolicyName is required and cannot be null.")); + } return service .get( this.client.getEndpoint(), @@ -208,14 +217,16 @@ public Mono> getWithResponseAsync( * 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 managementPolicyName The name of the Storage Account Management Policy. It should always be 'default'. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the managementpolicy associated with the specified storage account. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getAsync(String resourceGroupName, String accountName) { - return getWithResponseAsync(resourceGroupName, accountName) + public Mono getAsync( + String resourceGroupName, String accountName, ManagementPolicyName managementPolicyName) { + return getWithResponseAsync(resourceGroupName, accountName, managementPolicyName) .flatMap( (Response res) -> { if (res.getValue() != null) { @@ -233,6 +244,7 @@ public Mono getAsync(String resourceGroupName, String acc * 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 managementPolicyName The name of the Storage Account Management Policy. It should always be 'default'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -240,8 +252,9 @@ public Mono getAsync(String resourceGroupName, String acc * @return the managementpolicy associated with the specified storage account. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getAsync(String resourceGroupName, String accountName, Context context) { - return getWithResponseAsync(resourceGroupName, accountName, context) + public Mono getAsync( + String resourceGroupName, String accountName, ManagementPolicyName managementPolicyName, Context context) { + return getWithResponseAsync(resourceGroupName, accountName, managementPolicyName, context) .flatMap( (Response res) -> { if (res.getValue() != null) { @@ -259,14 +272,16 @@ public Mono getAsync(String resourceGroupName, String acc * 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 managementPolicyName The name of the Storage Account Management Policy. It should always be 'default'. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the managementpolicy associated with the specified storage account. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ManagementPolicyInner get(String resourceGroupName, String accountName) { - return getAsync(resourceGroupName, accountName).block(); + public ManagementPolicyInner get( + String resourceGroupName, String accountName, ManagementPolicyName managementPolicyName) { + return getAsync(resourceGroupName, accountName, managementPolicyName).block(); } /** @@ -276,6 +291,7 @@ public ManagementPolicyInner get(String resourceGroupName, String accountName) { * 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 managementPolicyName The name of the Storage Account Management Policy. It should always be 'default'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -283,8 +299,9 @@ public ManagementPolicyInner get(String resourceGroupName, String accountName) { * @return the managementpolicy associated with the specified storage account. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ManagementPolicyInner get(String resourceGroupName, String accountName, Context context) { - return getAsync(resourceGroupName, accountName, context).block(); + public ManagementPolicyInner get( + String resourceGroupName, String accountName, ManagementPolicyName managementPolicyName, Context context) { + return getAsync(resourceGroupName, accountName, managementPolicyName, context).block(); } /** @@ -294,6 +311,7 @@ public ManagementPolicyInner get(String resourceGroupName, String accountName, C * 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 managementPolicyName The name of the Storage Account Management Policy. It should always be 'default'. * @param policy The Storage Account ManagementPolicies Rules. See more details in: * https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -303,7 +321,10 @@ public ManagementPolicyInner get(String resourceGroupName, String accountName, C */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> createOrUpdateWithResponseAsync( - String resourceGroupName, String accountName, ManagementPolicySchema policy) { + String resourceGroupName, + String accountName, + ManagementPolicyName managementPolicyName, + ManagementPolicySchema policy) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -323,10 +344,13 @@ public Mono> createOrUpdateWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + if (managementPolicyName == null) { + return Mono + .error(new IllegalArgumentException("Parameter managementPolicyName is required and cannot be null.")); + } if (policy != null) { policy.validate(); } - final String managementPolicyName = "default"; ManagementPolicyInner properties = new ManagementPolicyInner(); properties.withPolicy(policy); return FluxUtil @@ -352,6 +376,7 @@ public Mono> createOrUpdateWithResponseAsync( * 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 managementPolicyName The name of the Storage Account Management Policy. It should always be 'default'. * @param policy The Storage Account ManagementPolicies Rules. See more details in: * https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. * @param context The context to associate with this operation. @@ -362,7 +387,11 @@ public Mono> createOrUpdateWithResponseAsync( */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> createOrUpdateWithResponseAsync( - String resourceGroupName, String accountName, ManagementPolicySchema policy, Context context) { + String resourceGroupName, + String accountName, + ManagementPolicyName managementPolicyName, + ManagementPolicySchema policy, + Context context) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -382,10 +411,13 @@ public Mono> createOrUpdateWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + if (managementPolicyName == null) { + return Mono + .error(new IllegalArgumentException("Parameter managementPolicyName is required and cannot be null.")); + } if (policy != null) { policy.validate(); } - final String managementPolicyName = "default"; ManagementPolicyInner properties = new ManagementPolicyInner(); properties.withPolicy(policy); return service @@ -407,6 +439,7 @@ public Mono> createOrUpdateWithResponseAsync( * 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 managementPolicyName The name of the Storage Account Management Policy. It should always be 'default'. * @param policy The Storage Account ManagementPolicies Rules. See more details in: * https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -416,8 +449,11 @@ public Mono> createOrUpdateWithResponseAsync( */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono createOrUpdateAsync( - String resourceGroupName, String accountName, ManagementPolicySchema policy) { - return createOrUpdateWithResponseAsync(resourceGroupName, accountName, policy) + String resourceGroupName, + String accountName, + ManagementPolicyName managementPolicyName, + ManagementPolicySchema policy) { + return createOrUpdateWithResponseAsync(resourceGroupName, accountName, managementPolicyName, policy) .flatMap( (Response res) -> { if (res.getValue() != null) { @@ -435,6 +471,7 @@ public Mono createOrUpdateAsync( * 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 managementPolicyName The name of the Storage Account Management Policy. It should always be 'default'. * @param policy The Storage Account ManagementPolicies Rules. See more details in: * https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. * @param context The context to associate with this operation. @@ -445,8 +482,12 @@ public Mono createOrUpdateAsync( */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono createOrUpdateAsync( - String resourceGroupName, String accountName, ManagementPolicySchema policy, Context context) { - return createOrUpdateWithResponseAsync(resourceGroupName, accountName, policy, context) + String resourceGroupName, + String accountName, + ManagementPolicyName managementPolicyName, + ManagementPolicySchema policy, + Context context) { + return createOrUpdateWithResponseAsync(resourceGroupName, accountName, managementPolicyName, policy, context) .flatMap( (Response res) -> { if (res.getValue() != null) { @@ -464,6 +505,7 @@ public Mono createOrUpdateAsync( * 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 managementPolicyName The name of the Storage Account Management Policy. It should always be 'default'. * @param policy The Storage Account ManagementPolicies Rules. See more details in: * https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -473,8 +515,11 @@ public Mono createOrUpdateAsync( */ @ServiceMethod(returns = ReturnType.SINGLE) public ManagementPolicyInner createOrUpdate( - String resourceGroupName, String accountName, ManagementPolicySchema policy) { - return createOrUpdateAsync(resourceGroupName, accountName, policy).block(); + String resourceGroupName, + String accountName, + ManagementPolicyName managementPolicyName, + ManagementPolicySchema policy) { + return createOrUpdateAsync(resourceGroupName, accountName, managementPolicyName, policy).block(); } /** @@ -484,6 +529,7 @@ public ManagementPolicyInner createOrUpdate( * 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 managementPolicyName The name of the Storage Account Management Policy. It should always be 'default'. * @param policy The Storage Account ManagementPolicies Rules. See more details in: * https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. * @param context The context to associate with this operation. @@ -494,8 +540,12 @@ public ManagementPolicyInner createOrUpdate( */ @ServiceMethod(returns = ReturnType.SINGLE) public ManagementPolicyInner createOrUpdate( - String resourceGroupName, String accountName, ManagementPolicySchema policy, Context context) { - return createOrUpdateAsync(resourceGroupName, accountName, policy, context).block(); + String resourceGroupName, + String accountName, + ManagementPolicyName managementPolicyName, + ManagementPolicySchema policy, + Context context) { + return createOrUpdateAsync(resourceGroupName, accountName, managementPolicyName, policy, context).block(); } /** @@ -505,13 +555,15 @@ public ManagementPolicyInner createOrUpdate( * 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 managementPolicyName The name of the Storage Account Management Policy. It should always be 'default'. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteWithResponseAsync(String resourceGroupName, String accountName) { + public Mono> deleteWithResponseAsync( + String resourceGroupName, String accountName, ManagementPolicyName managementPolicyName) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -531,7 +583,10 @@ public Mono> deleteWithResponseAsync(String resourceGroupName, St new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String managementPolicyName = "default"; + if (managementPolicyName == null) { + return Mono + .error(new IllegalArgumentException("Parameter managementPolicyName is required and cannot be null.")); + } return FluxUtil .withContext( context -> @@ -554,6 +609,7 @@ public Mono> deleteWithResponseAsync(String resourceGroupName, St * 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 managementPolicyName The name of the Storage Account Management Policy. It should always be 'default'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -561,7 +617,8 @@ public Mono> deleteWithResponseAsync(String resourceGroupName, St * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteWithResponseAsync(String resourceGroupName, String accountName, Context context) { + public Mono> deleteWithResponseAsync( + String resourceGroupName, String accountName, ManagementPolicyName managementPolicyName, Context context) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -581,7 +638,10 @@ public Mono> deleteWithResponseAsync(String resourceGroupName, St new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String managementPolicyName = "default"; + if (managementPolicyName == null) { + return Mono + .error(new IllegalArgumentException("Parameter managementPolicyName is required and cannot be null.")); + } return service .delete( this.client.getEndpoint(), @@ -600,14 +660,17 @@ public Mono> deleteWithResponseAsync(String resourceGroupName, St * 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 managementPolicyName The name of the Storage Account Management Policy. It should always be 'default'. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteAsync(String resourceGroupName, String accountName) { - return deleteWithResponseAsync(resourceGroupName, accountName).flatMap((Response res) -> Mono.empty()); + public Mono deleteAsync( + String resourceGroupName, String accountName, ManagementPolicyName managementPolicyName) { + return deleteWithResponseAsync(resourceGroupName, accountName, managementPolicyName) + .flatMap((Response res) -> Mono.empty()); } /** @@ -617,6 +680,7 @@ public Mono deleteAsync(String resourceGroupName, String accountName) { * 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 managementPolicyName The name of the Storage Account Management Policy. It should always be 'default'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -624,8 +688,9 @@ public Mono deleteAsync(String resourceGroupName, String accountName) { * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteAsync(String resourceGroupName, String accountName, Context context) { - return deleteWithResponseAsync(resourceGroupName, accountName, context) + public Mono deleteAsync( + String resourceGroupName, String accountName, ManagementPolicyName managementPolicyName, Context context) { + return deleteWithResponseAsync(resourceGroupName, accountName, managementPolicyName, context) .flatMap((Response res) -> Mono.empty()); } @@ -636,13 +701,14 @@ public Mono deleteAsync(String resourceGroupName, String accountName, Cont * 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 managementPolicyName The name of the Storage Account Management Policy. It should always be 'default'. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String accountName) { - deleteAsync(resourceGroupName, accountName).block(); + public void delete(String resourceGroupName, String accountName, ManagementPolicyName managementPolicyName) { + deleteAsync(resourceGroupName, accountName, managementPolicyName).block(); } /** @@ -652,13 +718,15 @@ public void delete(String resourceGroupName, String accountName) { * 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 managementPolicyName The name of the Storage Account Management Policy. It should always be 'default'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String accountName, Context context) { - deleteAsync(resourceGroupName, accountName, context).block(); + public void delete( + String resourceGroupName, String accountName, ManagementPolicyName managementPolicyName, Context context) { + deleteAsync(resourceGroupName, accountName, managementPolicyName, context).block(); } } diff --git a/sdk/storage/mgmt/src/main/java/com/azure/resourcemanager/storage/fluent/inner/StorageAccountInner.java b/sdk/storage/mgmt/src/main/java/com/azure/resourcemanager/storage/fluent/inner/StorageAccountInner.java index c423a999ce1fd..522af210cef0a 100644 --- a/sdk/storage/mgmt/src/main/java/com/azure/resourcemanager/storage/fluent/inner/StorageAccountInner.java +++ b/sdk/storage/mgmt/src/main/java/com/azure/resourcemanager/storage/fluent/inner/StorageAccountInner.java @@ -18,6 +18,7 @@ import com.azure.resourcemanager.storage.models.Identity; import com.azure.resourcemanager.storage.models.Kind; import com.azure.resourcemanager.storage.models.LargeFileSharesState; +import com.azure.resourcemanager.storage.models.MinimumTlsVersion; import com.azure.resourcemanager.storage.models.NetworkRuleSet; import com.azure.resourcemanager.storage.models.ProvisioningState; import com.azure.resourcemanager.storage.models.RoutingPreference; @@ -202,6 +203,20 @@ public class StorageAccountInner extends Resource { @JsonProperty(value = "properties.blobRestoreStatus", access = JsonProperty.Access.WRITE_ONLY) private BlobRestoreStatusInner blobRestoreStatus; + /* + * Allow or disallow public access to all blobs or containers in the + * storage account. The default interpretation is true for this property. + */ + @JsonProperty(value = "properties.allowBlobPublicAccess") + private Boolean allowBlobPublicAccess; + + /* + * Set the minimum TLS version to be permitted on requests to storage. The + * default interpretation is TLS 1.0 for this property. + */ + @JsonProperty(value = "properties.minimumTlsVersion") + private MinimumTlsVersion minimumTlsVersion; + /** * Get the sku property: Gets the SKU. * @@ -512,6 +527,50 @@ public BlobRestoreStatusInner blobRestoreStatus() { return this.blobRestoreStatus; } + /** + * Get the allowBlobPublicAccess property: Allow or disallow public access to all blobs or containers in the storage + * account. The default interpretation is true for this property. + * + * @return the allowBlobPublicAccess value. + */ + public Boolean allowBlobPublicAccess() { + return this.allowBlobPublicAccess; + } + + /** + * Set the allowBlobPublicAccess property: Allow or disallow public access to all blobs or containers in the storage + * account. The default interpretation is true for this property. + * + * @param allowBlobPublicAccess the allowBlobPublicAccess value to set. + * @return the StorageAccountInner object itself. + */ + public StorageAccountInner withAllowBlobPublicAccess(Boolean allowBlobPublicAccess) { + this.allowBlobPublicAccess = allowBlobPublicAccess; + return this; + } + + /** + * Get the minimumTlsVersion property: Set the minimum TLS version to be permitted on requests to storage. The + * default interpretation is TLS 1.0 for this property. + * + * @return the minimumTlsVersion value. + */ + public MinimumTlsVersion minimumTlsVersion() { + return this.minimumTlsVersion; + } + + /** + * Set the minimumTlsVersion property: Set the minimum TLS version to be permitted on requests to storage. The + * default interpretation is TLS 1.0 for this property. + * + * @param minimumTlsVersion the minimumTlsVersion value to set. + * @return the StorageAccountInner object itself. + */ + public StorageAccountInner withMinimumTlsVersion(MinimumTlsVersion minimumTlsVersion) { + this.minimumTlsVersion = minimumTlsVersion; + return this; + } + /** * Validates the instance. * diff --git a/sdk/storage/mgmt/src/main/java/com/azure/resourcemanager/storage/implementation/ManagementPoliciesImpl.java b/sdk/storage/mgmt/src/main/java/com/azure/resourcemanager/storage/implementation/ManagementPoliciesImpl.java index 2c636cbf010f8..aea25d5eaa80b 100644 --- a/sdk/storage/mgmt/src/main/java/com/azure/resourcemanager/storage/implementation/ManagementPoliciesImpl.java +++ b/sdk/storage/mgmt/src/main/java/com/azure/resourcemanager/storage/implementation/ManagementPoliciesImpl.java @@ -9,6 +9,7 @@ import com.azure.resourcemanager.storage.models.ManagementPolicies; import com.azure.resourcemanager.storage.models.ManagementPolicy; import com.azure.resourcemanager.storage.fluent.inner.ManagementPolicyInner; +import com.azure.resourcemanager.storage.models.ManagementPolicyName; import reactor.core.publisher.Mono; public class ManagementPoliciesImpl extends WrapperImpl implements ManagementPolicies { @@ -38,11 +39,12 @@ private ManagementPolicyImpl wrapModel(String name) { @Override public Mono getAsync(String resourceGroupName, String accountName) { - return this.inner().getAsync(resourceGroupName, accountName).map(inner -> wrapModel(inner)); + return this.inner().getAsync(resourceGroupName, accountName, ManagementPolicyName.DEFAULT) + .map(inner -> wrapModel(inner)); } @Override public Mono deleteAsync(String resourceGroupName, String accountName) { - return this.inner().deleteAsync(resourceGroupName, accountName); + return this.inner().deleteAsync(resourceGroupName, accountName, ManagementPolicyName.DEFAULT); } } diff --git a/sdk/storage/mgmt/src/main/java/com/azure/resourcemanager/storage/implementation/ManagementPolicyImpl.java b/sdk/storage/mgmt/src/main/java/com/azure/resourcemanager/storage/implementation/ManagementPolicyImpl.java index bdd45ef996d0a..5e7ef0d469009 100644 --- a/sdk/storage/mgmt/src/main/java/com/azure/resourcemanager/storage/implementation/ManagementPolicyImpl.java +++ b/sdk/storage/mgmt/src/main/java/com/azure/resourcemanager/storage/implementation/ManagementPolicyImpl.java @@ -10,6 +10,7 @@ import com.azure.resourcemanager.storage.models.BlobTypes; import com.azure.resourcemanager.storage.models.ManagementPolicy; import com.azure.resourcemanager.storage.models.ManagementPolicyBaseBlob; +import com.azure.resourcemanager.storage.models.ManagementPolicyName; import com.azure.resourcemanager.storage.models.ManagementPolicyRule; import com.azure.resourcemanager.storage.models.ManagementPolicySchema; import com.azure.resourcemanager.storage.models.ManagementPolicySnapShot; @@ -62,7 +63,7 @@ public StorageManager manager() { public Mono createResourceAsync() { ManagementPoliciesClient client = this.manager().inner().getManagementPolicies(); return client - .createOrUpdateAsync(this.resourceGroupName, this.accountName, cpolicy) + .createOrUpdateAsync(this.resourceGroupName, this.accountName, ManagementPolicyName.DEFAULT, cpolicy) .map( resource -> { resetCreateUpdateParameters(); @@ -75,7 +76,7 @@ public Mono createResourceAsync() { public Mono updateResourceAsync() { ManagementPoliciesClient client = this.manager().inner().getManagementPolicies(); return client - .createOrUpdateAsync(this.resourceGroupName, this.accountName, upolicy) + .createOrUpdateAsync(this.resourceGroupName, this.accountName, ManagementPolicyName.DEFAULT, upolicy) .map( resource -> { resetCreateUpdateParameters(); @@ -87,7 +88,7 @@ public Mono updateResourceAsync() { @Override protected Mono getInnerAsync() { ManagementPoliciesClient client = this.manager().inner().getManagementPolicies(); - return client.getAsync(this.resourceGroupName, this.accountName); + return client.getAsync(this.resourceGroupName, this.accountName, ManagementPolicyName.DEFAULT); } @Override diff --git a/sdk/storage/mgmt/src/main/java/com/azure/resourcemanager/storage/implementation/PolicyRuleImpl.java b/sdk/storage/mgmt/src/main/java/com/azure/resourcemanager/storage/implementation/PolicyRuleImpl.java index 1710a85fa1dcc..f0780ec02bccd 100644 --- a/sdk/storage/mgmt/src/main/java/com/azure/resourcemanager/storage/implementation/PolicyRuleImpl.java +++ b/sdk/storage/mgmt/src/main/java/com/azure/resourcemanager/storage/implementation/PolicyRuleImpl.java @@ -15,6 +15,8 @@ import com.azure.resourcemanager.storage.models.ManagementPolicyRule; import com.azure.resourcemanager.storage.models.ManagementPolicySnapShot; import com.azure.resourcemanager.storage.models.PolicyRule; +import com.azure.resourcemanager.storage.models.RuleType; + import java.util.ArrayList; import java.util.Collections; import java.util.List; @@ -52,7 +54,7 @@ public String name() { } @Override - public String type() { + public RuleType type() { return this.inner.type(); } @@ -155,7 +157,7 @@ public ManagementPolicyRule inner() { @Override public PolicyRuleImpl withLifecycleRuleType() { - this.inner.withType("Lifecycle"); + this.inner.withType(RuleType.LIFECYCLE); return this; } diff --git a/sdk/storage/mgmt/src/main/java/com/azure/resourcemanager/storage/models/ListContainersInclude.java b/sdk/storage/mgmt/src/main/java/com/azure/resourcemanager/storage/models/ListContainersInclude.java new file mode 100644 index 0000000000000..c2af3fe2e9214 --- /dev/null +++ b/sdk/storage/mgmt/src/main/java/com/azure/resourcemanager/storage/models/ListContainersInclude.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ListContainersInclude. */ +public final class ListContainersInclude extends ExpandableStringEnum { + /** Static value deleted for ListContainersInclude. */ + public static final ListContainersInclude DELETED = fromString("deleted"); + + /** + * Creates or finds a ListContainersInclude from its string representation. + * + * @param name a name to look for. + * @return the corresponding ListContainersInclude. + */ + @JsonCreator + public static ListContainersInclude fromString(String name) { + return fromString(name, ListContainersInclude.class); + } + + /** @return known ListContainersInclude values. */ + public static Collection values() { + return values(ListContainersInclude.class); + } +} diff --git a/sdk/storage/mgmt/src/main/java/com/azure/resourcemanager/storage/models/ManagementPolicyName.java b/sdk/storage/mgmt/src/main/java/com/azure/resourcemanager/storage/models/ManagementPolicyName.java new file mode 100644 index 0000000000000..bb8c037b53ffb --- /dev/null +++ b/sdk/storage/mgmt/src/main/java/com/azure/resourcemanager/storage/models/ManagementPolicyName.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ManagementPolicyName. */ +public final class ManagementPolicyName extends ExpandableStringEnum { + /** Static value default for ManagementPolicyName. */ + public static final ManagementPolicyName DEFAULT = fromString("default"); + + /** + * Creates or finds a ManagementPolicyName from its string representation. + * + * @param name a name to look for. + * @return the corresponding ManagementPolicyName. + */ + @JsonCreator + public static ManagementPolicyName fromString(String name) { + return fromString(name, ManagementPolicyName.class); + } + + /** @return known ManagementPolicyName values. */ + public static Collection values() { + return values(ManagementPolicyName.class); + } +} diff --git a/sdk/storage/mgmt/src/main/java/com/azure/resourcemanager/storage/models/ManagementPolicyRule.java b/sdk/storage/mgmt/src/main/java/com/azure/resourcemanager/storage/models/ManagementPolicyRule.java index 34401ed344466..e53acc39f83fd 100644 --- a/sdk/storage/mgmt/src/main/java/com/azure/resourcemanager/storage/models/ManagementPolicyRule.java +++ b/sdk/storage/mgmt/src/main/java/com/azure/resourcemanager/storage/models/ManagementPolicyRule.java @@ -31,7 +31,7 @@ public final class ManagementPolicyRule { * The valid value is Lifecycle */ @JsonProperty(value = "type", required = true) - private String type; + private RuleType type; /* * An object that defines the Lifecycle rule. @@ -39,11 +39,6 @@ public final class ManagementPolicyRule { @JsonProperty(value = "definition", required = true) private ManagementPolicyDefinition definition; - /** Creates an instance of ManagementPolicyRule class. */ - public ManagementPolicyRule() { - type = "Lifecycle"; - } - /** * Get the enabled property: Rule is enabled if set to true. * @@ -91,7 +86,7 @@ public ManagementPolicyRule withName(String name) { * * @return the type value. */ - public String type() { + public RuleType type() { return this.type; } @@ -101,7 +96,7 @@ public String type() { * @param type the type value to set. * @return the ManagementPolicyRule object itself. */ - public ManagementPolicyRule withType(String type) { + public ManagementPolicyRule withType(RuleType type) { this.type = type; return this; } @@ -137,6 +132,11 @@ public void validate() { .logExceptionAsError( new IllegalArgumentException("Missing required property name in model ManagementPolicyRule")); } + if (type() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property type in model ManagementPolicyRule")); + } if (definition() == null) { throw logger .logExceptionAsError( diff --git a/sdk/storage/mgmt/src/main/java/com/azure/resourcemanager/storage/models/MinimumTlsVersion.java b/sdk/storage/mgmt/src/main/java/com/azure/resourcemanager/storage/models/MinimumTlsVersion.java new file mode 100644 index 0000000000000..4b60198570d24 --- /dev/null +++ b/sdk/storage/mgmt/src/main/java/com/azure/resourcemanager/storage/models/MinimumTlsVersion.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for MinimumTlsVersion. */ +public final class MinimumTlsVersion extends ExpandableStringEnum { + /** Static value TLS1_0 for MinimumTlsVersion. */ + public static final MinimumTlsVersion TLS1_0 = fromString("TLS1_0"); + + /** Static value TLS1_1 for MinimumTlsVersion. */ + public static final MinimumTlsVersion TLS1_1 = fromString("TLS1_1"); + + /** Static value TLS1_2 for MinimumTlsVersion. */ + public static final MinimumTlsVersion TLS1_2 = fromString("TLS1_2"); + + /** + * Creates or finds a MinimumTlsVersion from its string representation. + * + * @param name a name to look for. + * @return the corresponding MinimumTlsVersion. + */ + @JsonCreator + public static MinimumTlsVersion fromString(String name) { + return fromString(name, MinimumTlsVersion.class); + } + + /** @return known MinimumTlsVersion values. */ + public static Collection values() { + return values(MinimumTlsVersion.class); + } +} diff --git a/sdk/storage/mgmt/src/main/java/com/azure/resourcemanager/storage/models/PolicyRule.java b/sdk/storage/mgmt/src/main/java/com/azure/resourcemanager/storage/models/PolicyRule.java index 8940c411f46e3..6226d6ca18a6b 100644 --- a/sdk/storage/mgmt/src/main/java/com/azure/resourcemanager/storage/models/PolicyRule.java +++ b/sdk/storage/mgmt/src/main/java/com/azure/resourcemanager/storage/models/PolicyRule.java @@ -16,7 +16,7 @@ public interface PolicyRule extends HasInner { String name(); /** @return the type of the rule */ - String type(); + RuleType type(); /** @return an unmodifiable list of the blob types this rule will apply for */ List blobTypesToFilterFor(); diff --git a/sdk/storage/mgmt/src/main/java/com/azure/resourcemanager/storage/models/RuleType.java b/sdk/storage/mgmt/src/main/java/com/azure/resourcemanager/storage/models/RuleType.java new file mode 100644 index 0000000000000..18de5872c5430 --- /dev/null +++ b/sdk/storage/mgmt/src/main/java/com/azure/resourcemanager/storage/models/RuleType.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storage.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for RuleType. */ +public final class RuleType extends ExpandableStringEnum { + /** Static value Lifecycle for RuleType. */ + public static final RuleType LIFECYCLE = fromString("Lifecycle"); + + /** + * Creates or finds a RuleType from its string representation. + * + * @param name a name to look for. + * @return the corresponding RuleType. + */ + @JsonCreator + public static RuleType fromString(String name) { + return fromString(name, RuleType.class); + } + + /** @return known RuleType values. */ + public static Collection values() { + return values(RuleType.class); + } +} diff --git a/sdk/storage/mgmt/src/main/java/com/azure/resourcemanager/storage/models/StorageAccountCreateParameters.java b/sdk/storage/mgmt/src/main/java/com/azure/resourcemanager/storage/models/StorageAccountCreateParameters.java index 4824320bb83ae..67c6343dcb7eb 100644 --- a/sdk/storage/mgmt/src/main/java/com/azure/resourcemanager/storage/models/StorageAccountCreateParameters.java +++ b/sdk/storage/mgmt/src/main/java/com/azure/resourcemanager/storage/models/StorageAccountCreateParameters.java @@ -117,6 +117,20 @@ public class StorageAccountCreateParameters { @JsonProperty(value = "properties.routingPreference") private RoutingPreference routingPreference; + /* + * Allow or disallow public access to all blobs or containers in the + * storage account. The default interpretation is true for this property. + */ + @JsonProperty(value = "properties.allowBlobPublicAccess") + private Boolean allowBlobPublicAccess; + + /* + * Set the minimum TLS version to be permitted on requests to storage. The + * default interpretation is TLS 1.0 for this property. + */ + @JsonProperty(value = "properties.minimumTlsVersion") + private MinimumTlsVersion minimumTlsVersion; + /** * Get the sku property: Required. Gets or sets the SKU name. * @@ -426,6 +440,50 @@ public StorageAccountCreateParameters withRoutingPreference(RoutingPreference ro return this; } + /** + * Get the allowBlobPublicAccess property: Allow or disallow public access to all blobs or containers in the storage + * account. The default interpretation is true for this property. + * + * @return the allowBlobPublicAccess value. + */ + public Boolean allowBlobPublicAccess() { + return this.allowBlobPublicAccess; + } + + /** + * Set the allowBlobPublicAccess property: Allow or disallow public access to all blobs or containers in the storage + * account. The default interpretation is true for this property. + * + * @param allowBlobPublicAccess the allowBlobPublicAccess value to set. + * @return the StorageAccountCreateParameters object itself. + */ + public StorageAccountCreateParameters withAllowBlobPublicAccess(Boolean allowBlobPublicAccess) { + this.allowBlobPublicAccess = allowBlobPublicAccess; + return this; + } + + /** + * Get the minimumTlsVersion property: Set the minimum TLS version to be permitted on requests to storage. The + * default interpretation is TLS 1.0 for this property. + * + * @return the minimumTlsVersion value. + */ + public MinimumTlsVersion minimumTlsVersion() { + return this.minimumTlsVersion; + } + + /** + * Set the minimumTlsVersion property: Set the minimum TLS version to be permitted on requests to storage. The + * default interpretation is TLS 1.0 for this property. + * + * @param minimumTlsVersion the minimumTlsVersion value to set. + * @return the StorageAccountCreateParameters object itself. + */ + public StorageAccountCreateParameters withMinimumTlsVersion(MinimumTlsVersion minimumTlsVersion) { + this.minimumTlsVersion = minimumTlsVersion; + return this; + } + /** * Validates the instance. * diff --git a/sdk/storage/mgmt/src/main/java/com/azure/resourcemanager/storage/models/StorageAccountUpdateParameters.java b/sdk/storage/mgmt/src/main/java/com/azure/resourcemanager/storage/models/StorageAccountUpdateParameters.java index 3a06f67a24a27..9c16308ea9919 100644 --- a/sdk/storage/mgmt/src/main/java/com/azure/resourcemanager/storage/models/StorageAccountUpdateParameters.java +++ b/sdk/storage/mgmt/src/main/java/com/azure/resourcemanager/storage/models/StorageAccountUpdateParameters.java @@ -103,6 +103,20 @@ public class StorageAccountUpdateParameters { @JsonProperty(value = "properties.routingPreference") private RoutingPreference routingPreference; + /* + * Allow or disallow public access to all blobs or containers in the + * storage account. The default interpretation is true for this property. + */ + @JsonProperty(value = "properties.allowBlobPublicAccess") + private Boolean allowBlobPublicAccess; + + /* + * Set the minimum TLS version to be permitted on requests to storage. The + * default interpretation is TLS 1.0 for this property. + */ + @JsonProperty(value = "properties.minimumTlsVersion") + private MinimumTlsVersion minimumTlsVersion; + /** * Get the sku property: 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. @@ -366,6 +380,50 @@ public StorageAccountUpdateParameters withRoutingPreference(RoutingPreference ro return this; } + /** + * Get the allowBlobPublicAccess property: Allow or disallow public access to all blobs or containers in the storage + * account. The default interpretation is true for this property. + * + * @return the allowBlobPublicAccess value. + */ + public Boolean allowBlobPublicAccess() { + return this.allowBlobPublicAccess; + } + + /** + * Set the allowBlobPublicAccess property: Allow or disallow public access to all blobs or containers in the storage + * account. The default interpretation is true for this property. + * + * @param allowBlobPublicAccess the allowBlobPublicAccess value to set. + * @return the StorageAccountUpdateParameters object itself. + */ + public StorageAccountUpdateParameters withAllowBlobPublicAccess(Boolean allowBlobPublicAccess) { + this.allowBlobPublicAccess = allowBlobPublicAccess; + return this; + } + + /** + * Get the minimumTlsVersion property: Set the minimum TLS version to be permitted on requests to storage. The + * default interpretation is TLS 1.0 for this property. + * + * @return the minimumTlsVersion value. + */ + public MinimumTlsVersion minimumTlsVersion() { + return this.minimumTlsVersion; + } + + /** + * Set the minimumTlsVersion property: Set the minimum TLS version to be permitted on requests to storage. The + * default interpretation is TLS 1.0 for this property. + * + * @param minimumTlsVersion the minimumTlsVersion value to set. + * @return the StorageAccountUpdateParameters object itself. + */ + public StorageAccountUpdateParameters withMinimumTlsVersion(MinimumTlsVersion minimumTlsVersion) { + this.minimumTlsVersion = minimumTlsVersion; + return this; + } + /** * Validates the instance. * From 6410184896a9e1cf142622d807af93463d977f11 Mon Sep 17 00:00:00 2001 From: Weidong Xu Date: Mon, 6 Jul 2020 09:54:11 +0800 Subject: [PATCH 017/129] mgmt fix todo (#12798) * support key curve name for EC key * use flux for inputsteam --- .../appservice/implementation/KuduClient.java | 53 +++++++++++++++---- .../appservice/WarDeployTests.java | 6 ++- .../keyvault/implementation/KeyImpl.java | 13 +++-- .../resourcemanager/keyvault/models/Key.java | 11 +++- .../resourcemanager/keyvault/KeyTests.java | 28 ++++++++++ 5 files changed, 94 insertions(+), 17 deletions(-) diff --git a/sdk/appservice/mgmt/src/main/java/com/azure/resourcemanager/appservice/implementation/KuduClient.java b/sdk/appservice/mgmt/src/main/java/com/azure/resourcemanager/appservice/implementation/KuduClient.java index 4e7f2dd423f70..2f704de4c5d9e 100644 --- a/sdk/appservice/mgmt/src/main/java/com/azure/resourcemanager/appservice/implementation/KuduClient.java +++ b/sdk/appservice/mgmt/src/main/java/com/azure/resourcemanager/appservice/implementation/KuduClient.java @@ -24,8 +24,11 @@ import com.azure.resourcemanager.appservice.models.KuduAuthenticationPolicy; import com.azure.resourcemanager.appservice.models.WebAppBase; import com.fasterxml.jackson.core.JsonParseException; + +import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.File; +import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; import java.nio.ByteBuffer; @@ -140,7 +143,9 @@ Mono warDeploy( "x-ms-body-logging: false" }) @Post("api/zipdeploy") - Mono zipDeploy(@HostParam("$host") String host, @BodyParam("application/octet-stream") byte[] zipFile); + Mono zipDeploy( + @HostParam("$host") String host, + @BodyParam("application/octet-stream") byte[] zipFile); @Headers({ "Content-Type: application/octet-stream", @@ -243,7 +248,12 @@ private static int findByte(ByteBuffer byteBuffer, byte b) { } Mono warDeployAsync(InputStream warFile, String appName) { - return withRetry(service.warDeploy(host, byteArrayFromInputStream(warFile), appName)); + InputStreamFlux flux = fluxFromInputStream(warFile); + if (flux.flux != null) { + return withRetry(service.warDeploy(host, flux.flux, flux.size, appName)); + } else { + return withRetry(service.warDeploy(host, flux.bytes, appName)); + } } Mono warDeployAsync(File warFile, String appName) throws IOException { @@ -259,7 +269,12 @@ Mono warDeployAsync(File warFile, String appName) throws IOException { } Mono zipDeployAsync(InputStream zipFile) { - return withRetry(service.zipDeploy(host, byteArrayFromInputStream(zipFile))); + InputStreamFlux flux = fluxFromInputStream(zipFile); + if (flux.flux != null) { + return withRetry(service.zipDeploy(host, flux.flux, flux.size)); + } else { + return withRetry(service.zipDeploy(host, flux.bytes)); + } } Mono zipDeployAsync(File zipFile) throws IOException { @@ -274,21 +289,37 @@ Mono zipDeployAsync(File zipFile) throws IOException { })); } - private byte[] byteArrayFromInputStream(InputStream inputStream) { - // TODO (weidxu) core does not yet support InputStream as @BodyParam + private InputStreamFlux fluxFromInputStream(InputStream inputStream) { try { - ByteArrayOutputStream buffer = new ByteArrayOutputStream(); - int nRead; - byte[] data = new byte[16384]; - while ((nRead = inputStream.read(data, 0, data.length)) != -1) { - buffer.write(data, 0, nRead); + InputStreamFlux inputStreamFlux = new InputStreamFlux(); + if (inputStream instanceof FileInputStream) { + inputStreamFlux.size = ((FileInputStream) inputStream).getChannel().size(); + inputStreamFlux.flux = FluxUtil.toFluxByteBuffer(inputStream); + } else if (inputStream instanceof ByteArrayInputStream) { + inputStreamFlux.size = inputStream.available(); + inputStreamFlux.flux = FluxUtil.toFluxByteBuffer(inputStream); + } else { + ByteArrayOutputStream buffer = new ByteArrayOutputStream(); + int nRead; + byte[] data = new byte[16384]; + while ((nRead = inputStream.read(data, 0, data.length)) != -1) { + buffer.write(data, 0, nRead); + } + inputStreamFlux.bytes = buffer.toByteArray(); + inputStreamFlux.size = inputStreamFlux.bytes.length; } - return buffer.toByteArray(); + return inputStreamFlux; } catch (IOException e) { throw logger.logExceptionAsError(new IllegalStateException(e)); } } + private static class InputStreamFlux { + private Flux flux; + private byte[] bytes; + private long size; + } + private Mono withRetry(Mono observable) { return observable .retryWhen( diff --git a/sdk/appservice/mgmt/src/test/java/com/azure/resourcemanager/appservice/WarDeployTests.java b/sdk/appservice/mgmt/src/test/java/com/azure/resourcemanager/appservice/WarDeployTests.java index dcec739397fa5..7b3f0ce8994ed 100644 --- a/sdk/appservice/mgmt/src/test/java/com/azure/resourcemanager/appservice/WarDeployTests.java +++ b/sdk/appservice/mgmt/src/test/java/com/azure/resourcemanager/appservice/WarDeployTests.java @@ -11,6 +11,8 @@ import com.azure.resourcemanager.appservice.models.WebContainer; import com.azure.resourcemanager.resources.fluentcore.arm.Region; import java.io.File; +import java.io.FileInputStream; +import java.io.InputStream; import com.azure.resourcemanager.resources.fluentcore.profile.AzureProfile; import org.junit.jupiter.api.Assertions; @@ -75,7 +77,9 @@ public void canDeployMultipleWars() throws Exception { if (!isPlaybackMode()) { webApp.warDeploy(new File(WarDeployTests.class.getResource("/helloworld.war").getPath())); - webApp.warDeploy(new File(WarDeployTests.class.getResource("/helloworld.war").getPath()), "app2"); + try (InputStream is = new FileInputStream(new File(WarDeployTests.class.getResource("/helloworld.war").getPath()))) { + webApp.warDeploy(is, "app2"); + } Response response = curl("http://" + webappName + "." + "azurewebsites.net"); Assertions.assertEquals(200, response.getStatusCode()); diff --git a/sdk/keyvault/mgmt/src/main/java/com/azure/resourcemanager/keyvault/implementation/KeyImpl.java b/sdk/keyvault/mgmt/src/main/java/com/azure/resourcemanager/keyvault/implementation/KeyImpl.java index bbc6140963cfd..e2f10cf60ac1b 100644 --- a/sdk/keyvault/mgmt/src/main/java/com/azure/resourcemanager/keyvault/implementation/KeyImpl.java +++ b/sdk/keyvault/mgmt/src/main/java/com/azure/resourcemanager/keyvault/implementation/KeyImpl.java @@ -23,6 +23,7 @@ import com.azure.security.keyvault.keys.models.CreateRsaKeyOptions; import com.azure.security.keyvault.keys.models.ImportKeyOptions; import com.azure.security.keyvault.keys.models.JsonWebKey; +import com.azure.security.keyvault.keys.models.KeyCurveName; import com.azure.security.keyvault.keys.models.KeyOperation; import com.azure.security.keyvault.keys.models.KeyProperties; import com.azure.security.keyvault.keys.models.KeyType; @@ -345,13 +346,17 @@ public KeyImpl withHsm(boolean isHsm) { @Override public KeyImpl withKeySize(int size) { - // TODO (weidxu) currently no setKeySize in CreateEcKeyOptions - /*if (createKeyRequest instanceof CreateEcKeyOptions) { - ((CreateEcKeyOptions) createKeyRequest).setKeySize(size); - } else */ if (createKeyRequest instanceof CreateRsaKeyOptions) { ((CreateRsaKeyOptions) createKeyRequest).setKeySize(size); } return this; } + + @Override + public DefinitionStages.WithCreate withKeyCurveName(KeyCurveName keyCurveName) { + if (createKeyRequest instanceof CreateEcKeyOptions) { + ((CreateEcKeyOptions) createKeyRequest).setCurveName(keyCurveName); + } + return this; + } } diff --git a/sdk/keyvault/mgmt/src/main/java/com/azure/resourcemanager/keyvault/models/Key.java b/sdk/keyvault/mgmt/src/main/java/com/azure/resourcemanager/keyvault/models/Key.java index 2dd3bf31377c8..6f97cf97f0639 100644 --- a/sdk/keyvault/mgmt/src/main/java/com/azure/resourcemanager/keyvault/models/Key.java +++ b/sdk/keyvault/mgmt/src/main/java/com/azure/resourcemanager/keyvault/models/Key.java @@ -16,6 +16,7 @@ import com.azure.security.keyvault.keys.cryptography.models.KeyWrapAlgorithm; import com.azure.security.keyvault.keys.cryptography.models.SignatureAlgorithm; import com.azure.security.keyvault.keys.models.JsonWebKey; +import com.azure.security.keyvault.keys.models.KeyCurveName; import com.azure.security.keyvault.keys.models.KeyOperation; import com.azure.security.keyvault.keys.models.KeyProperties; import com.azure.security.keyvault.keys.models.KeyType; @@ -198,12 +199,20 @@ interface WithKey { /** The stage of a key definition allowing to specify the key size. */ interface WithKeySize { /** - * Specifies the size of the key to create. + * Specifies the size of the RSA key to create. * * @param size the size of the key in integer * @return the next stage of the definition */ WithCreate withKeySize(int size); + + /** + * Specifies the name of the key curve for elliptic-curve key to create. + * + * @param keyCurveName name of the key curve + * @return the next stage of the definition + */ + WithCreate withKeyCurveName(KeyCurveName keyCurveName); } /** The stage of a key definition allowing to specify the allowed operations for the key. */ diff --git a/sdk/keyvault/mgmt/src/test/java/com/azure/resourcemanager/keyvault/KeyTests.java b/sdk/keyvault/mgmt/src/test/java/com/azure/resourcemanager/keyvault/KeyTests.java index fad99351bd84a..032e5acec18c9 100644 --- a/sdk/keyvault/mgmt/src/test/java/com/azure/resourcemanager/keyvault/KeyTests.java +++ b/sdk/keyvault/mgmt/src/test/java/com/azure/resourcemanager/keyvault/KeyTests.java @@ -14,6 +14,7 @@ import com.azure.security.keyvault.keys.cryptography.models.KeyWrapAlgorithm; import com.azure.security.keyvault.keys.cryptography.models.SignatureAlgorithm; import com.azure.security.keyvault.keys.models.JsonWebKey; +import com.azure.security.keyvault.keys.models.KeyCurveName; import com.azure.security.keyvault.keys.models.KeyOperation; import com.azure.security.keyvault.keys.models.KeyType; import java.security.KeyPair; @@ -74,6 +75,33 @@ public void canCRUDKey() throws Exception { // List versions Iterable keys = key.listVersions(); Assertions.assertEquals(2, TestUtilities.getSize(keys)); + + // Create RSA key with size + key = vault + .keys() + .define(keyName) + .withKeyTypeToCreate(KeyType.RSA) + .withKeyOperations(KeyOperation.SIGN, KeyOperation.VERIFY) + .withKeySize(2048) + .create(); + + Assertions.assertNotNull(key); + Assertions.assertNotNull(key.id()); + Assertions.assertEquals(KeyType.RSA, key.getJsonWebKey().getKeyType()); + + // Create EC key with curve + key = vault + .keys() + .define(keyName) + .withKeyTypeToCreate(KeyType.EC) + .withKeyOperations(KeyOperation.SIGN, KeyOperation.VERIFY) + .withKeyCurveName(KeyCurveName.P_521) + .create(); + + Assertions.assertNotNull(key); + Assertions.assertNotNull(key.id()); + Assertions.assertEquals(KeyType.EC, key.getJsonWebKey().getKeyType()); + Assertions.assertEquals(KeyCurveName.P_521, key.getJsonWebKey().getCurveName()); } @Test From 0ba3641a16e9cb4c8c104b22193fc468168bdcb2 Mon Sep 17 00:00:00 2001 From: Tanyi Chen Date: Mon, 6 Jul 2020 16:45:27 +0800 Subject: [PATCH 018/129] Mgmt: Appplatform (#12350) * feat: add api specs * feat: generate app platform * add pom.xml * Add spring interface * fix compile error * add implementation * add piggymetrics source code for test * add unit test * update test and some impl * add spring service api in azure * regen app platform * fix compile error * fix checkstyle * compress source code to temp file rather than memory * rename app.deploy to app.deployments * seperate client creation and file creation * rename withCurrentActiveSetting to withSettingsFromActiveDeployment * rename sourceCode param to sourceCodeFolder * remove deployment with byte[] * align deployment update interface with definition * change deployment cache to settings cache * delete tmp file when exit * fix compile error * change WithPublicEndpoint to WithEndpoint * change sourceCode to sourceCodeFolder * close inputstream and disconnect url connection * check deployment removed * remove resource code * decompress source code from github * update gitignore * change activate in deployment to withActivation * fix compile error --- sdk/appplatform/mgmt/.gitignore | 2 + sdk/appplatform/mgmt/pom.xml | 139 + .../AppPlatformManagementClient.java | 196 ++ .../AppPlatformManagementClientBuilder.java | 107 + .../appplatform/AppPlatformManager.java | 104 + .../appplatform/fluent/AppsClient.java | 1577 +++++++++ .../appplatform/fluent/BindingsClient.java | 1296 ++++++++ .../fluent/CertificatesClient.java | 956 ++++++ .../fluent/CustomDomainsClient.java | 1526 +++++++++ .../appplatform/fluent/DeploymentsClient.java | 2960 +++++++++++++++++ .../appplatform/fluent/OperationsClient.java | 242 ++ .../appplatform/fluent/ServicesClient.java | 2432 ++++++++++++++ .../appplatform/fluent/SkusClient.java | 251 ++ .../inner/AppResourceCollectionInner.java | 83 + .../fluent/inner/AppResourceInner.java | 112 + .../inner/AvailableOperationsInner.java | 83 + .../inner/BindingResourceCollectionInner.java | 83 + .../fluent/inner/BindingResourceInner.java | 55 + .../CertificateResourceCollectionInner.java | 80 + .../inner/CertificateResourceInner.java | 55 + .../CustomDomainResourceCollectionInner.java | 80 + .../inner/CustomDomainResourceInner.java | 55 + .../CustomDomainValidateResultInner.java | 76 + .../DeploymentResourceCollectionInner.java | 83 + .../fluent/inner/DeploymentResourceInner.java | 55 + .../fluent/inner/LogFileUrlResponseInner.java | 55 + .../fluent/inner/NameAvailabilityInner.java | 102 + .../fluent/inner/OperationDetailInner.java | 162 + .../inner/ResourceSkuCollectionInner.java | 84 + .../fluent/inner/ServiceResourceInner.java | 85 + .../inner/ServiceResourceListInner.java | 83 + .../fluent/inner/package-info.java | 6 + .../appplatform/fluent/package-info.java | 6 + .../SpringAppDeploymentImpl.java | 412 +++ .../SpringAppDeploymentsImpl.java | 107 + .../implementation/SpringAppImpl.java | 282 ++ .../implementation/SpringAppsImpl.java | 106 + .../implementation/SpringServiceImpl.java | 186 ++ .../implementation/SpringServicesImpl.java | 79 + .../models/AppResourceProperties.java | 232 ++ .../models/AppResourceProvisioningState.java | 40 + .../models/BindingResourceProperties.java | 202 ++ .../models/CertificateProperties.java | 219 ++ .../models/ClusterResourceProperties.java | 127 + .../models/ConfigServerGitProperty.java | 293 ++ .../models/ConfigServerProperties.java | 97 + .../models/ConfigServerSettings.java | 53 + .../appplatform/models/ConfigServerState.java | 43 + .../models/CustomDomainProperties.java | 102 + .../models/CustomDomainValidatePayload.java | 56 + .../models/DeploymentInstance.java | 84 + .../models/DeploymentResourceProperties.java | 177 + .../DeploymentResourceProvisioningState.java | 41 + .../models/DeploymentResourceStatus.java | 49 + .../models/DeploymentSettings.java | 188 ++ .../appplatform/models/Error.java | 76 + .../models/GitPatternRepository.java | 321 ++ .../appplatform/models/LogSpecification.java | 102 + .../models/ManagedIdentityProperties.java | 102 + .../models/ManagedIdentityType.java | 40 + .../appplatform/models/MetricDimension.java | 76 + .../models/MetricSpecification.java | 297 ++ .../models/NameAvailabilityParameters.java | 86 + .../appplatform/models/OperationDisplay.java | 128 + .../models/OperationProperties.java | 53 + .../appplatform/models/PersistentDisk.java | 91 + .../appplatform/models/ProvisioningState.java | 55 + .../RegenerateTestKeyRequestPayload.java | 56 + .../appplatform/models/ResourceSku.java | 222 ++ .../models/ResourceSkuCapabilities.java | 76 + .../models/ResourceSkuLocationInfo.java | 106 + .../models/ResourceSkuRestrictionInfo.java | 77 + .../models/ResourceSkuRestrictions.java | 139 + .../ResourceSkuRestrictionsReasonCode.java | 35 + .../models/ResourceSkuRestrictionsType.java | 34 + .../models/ResourceSkuZoneDetails.java | 84 + .../models/ResourceUploadDefinition.java | 76 + .../appplatform/models/RuntimeVersion.java | 34 + .../models/ServiceSpecification.java | 83 + .../appplatform/models/Sku.java | 102 + .../appplatform/models/SkuCapacity.java | 128 + .../appplatform/models/SkuScaleType.java | 37 + .../appplatform/models/SpringApp.java | 261 ++ .../models/SpringAppDeployment.java | 354 ++ .../models/SpringAppDeployments.java | 33 + .../appplatform/models/SpringApps.java | 33 + .../appplatform/models/SpringService.java | 236 ++ .../appplatform/models/SpringServices.java | 40 + .../appplatform/models/TemporaryDisk.java | 76 + .../appplatform/models/TestKeyType.java | 34 + .../appplatform/models/TestKeys.java | 154 + .../appplatform/models/TraceProperties.java | 120 + .../appplatform/models/TraceProxyState.java | 40 + .../appplatform/models/TrackedResource.java | 79 + .../appplatform/models/UserSourceInfo.java | 132 + .../appplatform/models/UserSourceType.java | 34 + .../appplatform/models/package-info.java | 6 + .../appplatform/package-info.java | 6 + .../appplatform/AppPlatformTest.java | 35 + .../appplatform/SpringCloudTest.java | 170 + sdk/management/api-specs.json | 6 + sdk/management/azure/pom.xml | 5 + .../java/com/azure/resourcemanager/Azure.java | 21 +- sdk/management/pom.xml | 1 + 104 files changed, 21032 insertions(+), 6 deletions(-) create mode 100644 sdk/appplatform/mgmt/.gitignore create mode 100644 sdk/appplatform/mgmt/pom.xml create mode 100644 sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/AppPlatformManagementClient.java create mode 100644 sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/AppPlatformManagementClientBuilder.java create mode 100644 sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/AppPlatformManager.java create mode 100644 sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/fluent/AppsClient.java create mode 100644 sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/fluent/BindingsClient.java create mode 100644 sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/fluent/CertificatesClient.java create mode 100644 sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/fluent/CustomDomainsClient.java create mode 100644 sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/fluent/DeploymentsClient.java create mode 100644 sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/fluent/OperationsClient.java create mode 100644 sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/fluent/ServicesClient.java create mode 100644 sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/fluent/SkusClient.java create mode 100644 sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/fluent/inner/AppResourceCollectionInner.java create mode 100644 sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/fluent/inner/AppResourceInner.java create mode 100644 sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/fluent/inner/AvailableOperationsInner.java create mode 100644 sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/fluent/inner/BindingResourceCollectionInner.java create mode 100644 sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/fluent/inner/BindingResourceInner.java create mode 100644 sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/fluent/inner/CertificateResourceCollectionInner.java create mode 100644 sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/fluent/inner/CertificateResourceInner.java create mode 100644 sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/fluent/inner/CustomDomainResourceCollectionInner.java create mode 100644 sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/fluent/inner/CustomDomainResourceInner.java create mode 100644 sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/fluent/inner/CustomDomainValidateResultInner.java create mode 100644 sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/fluent/inner/DeploymentResourceCollectionInner.java create mode 100644 sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/fluent/inner/DeploymentResourceInner.java create mode 100644 sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/fluent/inner/LogFileUrlResponseInner.java create mode 100644 sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/fluent/inner/NameAvailabilityInner.java create mode 100644 sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/fluent/inner/OperationDetailInner.java create mode 100644 sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/fluent/inner/ResourceSkuCollectionInner.java create mode 100644 sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/fluent/inner/ServiceResourceInner.java create mode 100644 sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/fluent/inner/ServiceResourceListInner.java create mode 100644 sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/fluent/inner/package-info.java create mode 100644 sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/fluent/package-info.java create mode 100644 sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/implementation/SpringAppDeploymentImpl.java create mode 100644 sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/implementation/SpringAppDeploymentsImpl.java create mode 100644 sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/implementation/SpringAppImpl.java create mode 100644 sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/implementation/SpringAppsImpl.java create mode 100644 sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/implementation/SpringServiceImpl.java create mode 100644 sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/implementation/SpringServicesImpl.java create mode 100644 sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/AppResourceProperties.java create mode 100644 sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/AppResourceProvisioningState.java create mode 100644 sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/BindingResourceProperties.java create mode 100644 sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/CertificateProperties.java create mode 100644 sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/ClusterResourceProperties.java create mode 100644 sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/ConfigServerGitProperty.java create mode 100644 sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/ConfigServerProperties.java create mode 100644 sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/ConfigServerSettings.java create mode 100644 sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/ConfigServerState.java create mode 100644 sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/CustomDomainProperties.java create mode 100644 sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/CustomDomainValidatePayload.java create mode 100644 sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/DeploymentInstance.java create mode 100644 sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/DeploymentResourceProperties.java create mode 100644 sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/DeploymentResourceProvisioningState.java create mode 100644 sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/DeploymentResourceStatus.java create mode 100644 sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/DeploymentSettings.java create mode 100644 sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/Error.java create mode 100644 sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/GitPatternRepository.java create mode 100644 sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/LogSpecification.java create mode 100644 sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/ManagedIdentityProperties.java create mode 100644 sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/ManagedIdentityType.java create mode 100644 sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/MetricDimension.java create mode 100644 sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/MetricSpecification.java create mode 100644 sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/NameAvailabilityParameters.java create mode 100644 sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/OperationDisplay.java create mode 100644 sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/OperationProperties.java create mode 100644 sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/PersistentDisk.java create mode 100644 sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/ProvisioningState.java create mode 100644 sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/RegenerateTestKeyRequestPayload.java create mode 100644 sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/ResourceSku.java create mode 100644 sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/ResourceSkuCapabilities.java create mode 100644 sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/ResourceSkuLocationInfo.java create mode 100644 sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/ResourceSkuRestrictionInfo.java create mode 100644 sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/ResourceSkuRestrictions.java create mode 100644 sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/ResourceSkuRestrictionsReasonCode.java create mode 100644 sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/ResourceSkuRestrictionsType.java create mode 100644 sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/ResourceSkuZoneDetails.java create mode 100644 sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/ResourceUploadDefinition.java create mode 100644 sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/RuntimeVersion.java create mode 100644 sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/ServiceSpecification.java create mode 100644 sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/Sku.java create mode 100644 sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/SkuCapacity.java create mode 100644 sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/SkuScaleType.java create mode 100644 sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/SpringApp.java create mode 100644 sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/SpringAppDeployment.java create mode 100644 sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/SpringAppDeployments.java create mode 100644 sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/SpringApps.java create mode 100644 sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/SpringService.java create mode 100644 sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/SpringServices.java create mode 100644 sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/TemporaryDisk.java create mode 100644 sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/TestKeyType.java create mode 100644 sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/TestKeys.java create mode 100644 sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/TraceProperties.java create mode 100644 sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/TraceProxyState.java create mode 100644 sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/TrackedResource.java create mode 100644 sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/UserSourceInfo.java create mode 100644 sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/UserSourceType.java create mode 100644 sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/package-info.java create mode 100644 sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/package-info.java create mode 100644 sdk/appplatform/mgmt/src/test/java/com/azure/resourcemanager/appplatform/AppPlatformTest.java create mode 100644 sdk/appplatform/mgmt/src/test/java/com/azure/resourcemanager/appplatform/SpringCloudTest.java diff --git a/sdk/appplatform/mgmt/.gitignore b/sdk/appplatform/mgmt/.gitignore new file mode 100644 index 0000000000000..f537a954e09a9 --- /dev/null +++ b/sdk/appplatform/mgmt/.gitignore @@ -0,0 +1,2 @@ +/piggymetrics +# folder created in unit test diff --git a/sdk/appplatform/mgmt/pom.xml b/sdk/appplatform/mgmt/pom.xml new file mode 100644 index 0000000000000..6b323b92c0cf8 --- /dev/null +++ b/sdk/appplatform/mgmt/pom.xml @@ -0,0 +1,139 @@ + + + 4.0.0 + + com.azure.resourcemanager + azure-resourcemanager-parent + 2.0.0-SNAPSHOT + ../../management/pom.xml + + + azure-resourcemanager-appplatform + jar + + Microsoft Azure SDK for App Platform Management + This package contains Microsoft Azure App Platform 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.azure.resourcemanager + azure-resourcemanager-resources + 2.0.0-SNAPSHOT + + + com.azure + azure-storage-file-share + 12.5.0 + + + org.apache.commons + commons-compress + 1.20 + + + org.junit.jupiter + junit-jupiter-engine + test + + + org.junit.jupiter + junit-jupiter-api + test + + + com.azure + azure-core-http-netty + test + + + com.azure + azure-identity + test + + + + + azure-mgmt-sdk-test-jar + + + !maven.test.skip + + + + + com.azure.resourcemanager + azure-resourcemanager-resources + 2.0.0-SNAPSHOT + test-jar + test + + + + + + + + org.apache.maven.plugins + maven-jar-plugin + + + + true + true + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.8.1 + + 1.8 + 1.8 + true + true + + true + true + + + + + org.codehaus.mojo + build-helper-maven-plugin + + + + diff --git a/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/AppPlatformManagementClient.java b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/AppPlatformManagementClient.java new file mode 100644 index 0000000000000..4954f555b43b7 --- /dev/null +++ b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/AppPlatformManagementClient.java @@ -0,0 +1,196 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform; + +import com.azure.core.annotation.ServiceClient; +import com.azure.core.http.HttpPipeline; +import com.azure.core.management.AzureEnvironment; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.AzureServiceClient; +import com.azure.resourcemanager.appplatform.fluent.AppsClient; +import com.azure.resourcemanager.appplatform.fluent.BindingsClient; +import com.azure.resourcemanager.appplatform.fluent.CertificatesClient; +import com.azure.resourcemanager.appplatform.fluent.CustomDomainsClient; +import com.azure.resourcemanager.appplatform.fluent.DeploymentsClient; +import com.azure.resourcemanager.appplatform.fluent.OperationsClient; +import com.azure.resourcemanager.appplatform.fluent.ServicesClient; +import com.azure.resourcemanager.appplatform.fluent.SkusClient; + +/** Initializes a new instance of the AppPlatformManagementClient type. */ +@ServiceClient(builder = AppPlatformManagementClientBuilder.class) +public final class AppPlatformManagementClient extends AzureServiceClient { + private final ClientLogger logger = new ClientLogger(AppPlatformManagementClient.class); + + /** + * Gets subscription ID which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of + * the URI for every service call. + */ + private final String subscriptionId; + + /** + * Gets Gets subscription ID 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 getSubscriptionId() { + return this.subscriptionId; + } + + /** server parameter. */ + private final String endpoint; + + /** + * Gets server parameter. + * + * @return the endpoint value. + */ + public String getEndpoint() { + return this.endpoint; + } + + /** Api Version. */ + private final String apiVersion; + + /** + * Gets Api Version. + * + * @return the apiVersion value. + */ + public String getApiVersion() { + return this.apiVersion; + } + + /** The HTTP pipeline to send requests through. */ + private final HttpPipeline httpPipeline; + + /** + * Gets The HTTP pipeline to send requests through. + * + * @return the httpPipeline value. + */ + public HttpPipeline getHttpPipeline() { + return this.httpPipeline; + } + + /** The ServicesClient object to access its operations. */ + private final ServicesClient services; + + /** + * Gets the ServicesClient object to access its operations. + * + * @return the ServicesClient object. + */ + public ServicesClient getServices() { + return this.services; + } + + /** The AppsClient object to access its operations. */ + private final AppsClient apps; + + /** + * Gets the AppsClient object to access its operations. + * + * @return the AppsClient object. + */ + public AppsClient getApps() { + return this.apps; + } + + /** The BindingsClient object to access its operations. */ + private final BindingsClient bindings; + + /** + * Gets the BindingsClient object to access its operations. + * + * @return the BindingsClient object. + */ + public BindingsClient getBindings() { + return this.bindings; + } + + /** The CertificatesClient object to access its operations. */ + private final CertificatesClient certificates; + + /** + * Gets the CertificatesClient object to access its operations. + * + * @return the CertificatesClient object. + */ + public CertificatesClient getCertificates() { + return this.certificates; + } + + /** The CustomDomainsClient object to access its operations. */ + private final CustomDomainsClient customDomains; + + /** + * Gets the CustomDomainsClient object to access its operations. + * + * @return the CustomDomainsClient object. + */ + public CustomDomainsClient getCustomDomains() { + return this.customDomains; + } + + /** The DeploymentsClient object to access its operations. */ + private final DeploymentsClient deployments; + + /** + * Gets the DeploymentsClient object to access its operations. + * + * @return the DeploymentsClient object. + */ + public DeploymentsClient getDeployments() { + return this.deployments; + } + + /** The OperationsClient object to access its operations. */ + private final OperationsClient operations; + + /** + * Gets the OperationsClient object to access its operations. + * + * @return the OperationsClient object. + */ + public OperationsClient getOperations() { + return this.operations; + } + + /** The SkusClient object to access its operations. */ + private final SkusClient skus; + + /** + * Gets the SkusClient object to access its operations. + * + * @return the SkusClient object. + */ + public SkusClient getSkus() { + return this.skus; + } + + /** + * Initializes an instance of AppPlatformManagementClient client. + * + * @param httpPipeline The HTTP pipeline to send requests through. + * @param environment The Azure environment. + */ + AppPlatformManagementClient( + HttpPipeline httpPipeline, AzureEnvironment environment, String subscriptionId, String endpoint) { + super(httpPipeline, environment); + this.httpPipeline = httpPipeline; + this.subscriptionId = subscriptionId; + this.endpoint = endpoint; + this.apiVersion = "2019-05-01-preview"; + this.services = new ServicesClient(this); + this.apps = new AppsClient(this); + this.bindings = new BindingsClient(this); + this.certificates = new CertificatesClient(this); + this.customDomains = new CustomDomainsClient(this); + this.deployments = new DeploymentsClient(this); + this.operations = new OperationsClient(this); + this.skus = new SkusClient(this); + } +} diff --git a/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/AppPlatformManagementClientBuilder.java b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/AppPlatformManagementClientBuilder.java new file mode 100644 index 0000000000000..fe7fcab4df6b2 --- /dev/null +++ b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/AppPlatformManagementClientBuilder.java @@ -0,0 +1,107 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform; + +import com.azure.core.annotation.ServiceClientBuilder; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpPipelineBuilder; +import com.azure.core.http.policy.CookiePolicy; +import com.azure.core.http.policy.RetryPolicy; +import com.azure.core.http.policy.UserAgentPolicy; +import com.azure.core.management.AzureEnvironment; + +/** A builder for creating a new instance of the AppPlatformManagementClient type. */ +@ServiceClientBuilder(serviceClients = {AppPlatformManagementClient.class}) +public final class AppPlatformManagementClientBuilder { + /* + * Gets subscription ID which uniquely identify the Microsoft Azure + * subscription. The subscription ID forms part of the URI for every + * service call. + */ + private String subscriptionId; + + /** + * Sets Gets subscription ID 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 AppPlatformManagementClientBuilder. + */ + public AppPlatformManagementClientBuilder subscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /* + * server parameter + */ + private String endpoint; + + /** + * Sets server parameter. + * + * @param endpoint the endpoint value. + * @return the AppPlatformManagementClientBuilder. + */ + public AppPlatformManagementClientBuilder endpoint(String endpoint) { + this.endpoint = endpoint; + return this; + } + + /* + * The environment to connect to + */ + private AzureEnvironment environment; + + /** + * Sets The environment to connect to. + * + * @param environment the environment value. + * @return the AppPlatformManagementClientBuilder. + */ + public AppPlatformManagementClientBuilder environment(AzureEnvironment environment) { + this.environment = environment; + return this; + } + + /* + * The HTTP pipeline to send requests through + */ + private HttpPipeline pipeline; + + /** + * Sets The HTTP pipeline to send requests through. + * + * @param pipeline the pipeline value. + * @return the AppPlatformManagementClientBuilder. + */ + public AppPlatformManagementClientBuilder pipeline(HttpPipeline pipeline) { + this.pipeline = pipeline; + return this; + } + + /** + * Builds an instance of AppPlatformManagementClient with the provided parameters. + * + * @return an instance of AppPlatformManagementClient. + */ + public AppPlatformManagementClient buildClient() { + if (endpoint == null) { + this.endpoint = "https://management.azure.com"; + } + if (environment == null) { + this.environment = AzureEnvironment.AZURE; + } + if (pipeline == null) { + this.pipeline = + new HttpPipelineBuilder() + .policies(new UserAgentPolicy(), new RetryPolicy(), new CookiePolicy()) + .build(); + } + AppPlatformManagementClient client = + new AppPlatformManagementClient(pipeline, environment, subscriptionId, endpoint); + return client; + } +} diff --git a/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/AppPlatformManager.java b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/AppPlatformManager.java new file mode 100644 index 0000000000000..02426a2949cdf --- /dev/null +++ b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/AppPlatformManager.java @@ -0,0 +1,104 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.resourcemanager.appplatform; + + +import com.azure.core.credential.TokenCredential; +import com.azure.core.http.HttpPipeline; +import com.azure.resourcemanager.appplatform.implementation.SpringServicesImpl; +import com.azure.resourcemanager.appplatform.models.SpringServices; +import com.azure.resourcemanager.resources.fluentcore.arm.AzureConfigurable; +import com.azure.resourcemanager.resources.fluentcore.arm.implementation.AzureConfigurableImpl; +import com.azure.resourcemanager.resources.fluentcore.arm.implementation.Manager; +import com.azure.resourcemanager.resources.fluentcore.profile.AzureProfile; +import com.azure.resourcemanager.resources.fluentcore.utils.HttpPipelineProvider; +import com.azure.resourcemanager.resources.fluentcore.utils.SdkContext; + +/** Entry point to Azure App Platform management. */ +public final class AppPlatformManager extends Manager { + // Collections + private SpringServices springServices; + /** + * Get a Configurable instance that can be used to create AppPlatformManager with optional configuration. + * + * @return the instance allowing configurations + */ + public static Configurable configure() { + return new AppPlatformManager.ConfigurableImpl(); + } + + /** + * Creates an instance of AppPlatformManager that exposes app platform resource management API entry points. + * + * @param credential the credential to use + * @param profile the profile to use + * @return the AppPlatformManager + */ + public static AppPlatformManager authenticate(TokenCredential credential, AzureProfile profile) { + return authenticate(HttpPipelineProvider.buildHttpPipeline(credential, profile), profile); + } + + /** + * Creates an instance of AppPlatformManager that exposes app platform resource management API entry points. + * + * @param httpPipeline the HttpPipeline to be used for API calls. + * @param profile the profile to use + * @return the AppPlatformManager + */ + public static AppPlatformManager authenticate(HttpPipeline httpPipeline, AzureProfile profile) { + return authenticate(httpPipeline, profile, new SdkContext()); + } + + /** + * Creates an instance of AppPlatformManager that exposes app platform resource management API entry points. + * + * @param httpPipeline the HttpPipeline to be used for API calls. + * @param profile the profile to use + * @param sdkContext the sdk context + * @return the AppPlatformManager + */ + public static AppPlatformManager authenticate( + HttpPipeline httpPipeline, AzureProfile profile, SdkContext sdkContext) { + return new AppPlatformManager(httpPipeline, profile, sdkContext); + } + + /** The interface allowing configurations to be set. */ + public interface Configurable extends AzureConfigurable { + /** + * Creates an instance of AppPlatformManager that exposes app platform resource management API entry points. + * + * @param credential the credential to use + * @param profile the profile to use + * @return the interface exposing AppPlatform management API entry points that work across subscriptions + */ + AppPlatformManager authenticate(TokenCredential credential, AzureProfile profile); + } + + /** The implementation for Configurable interface. */ + private static final class ConfigurableImpl extends AzureConfigurableImpl implements Configurable { + public AppPlatformManager authenticate(TokenCredential credential, AzureProfile profile) { + return AppPlatformManager.authenticate(buildHttpPipeline(credential, profile), profile); + } + } + + private AppPlatformManager(HttpPipeline httpPipeline, AzureProfile profile, SdkContext sdkContext) { + super( + httpPipeline, + profile, + new AppPlatformManagementClientBuilder() + .pipeline(httpPipeline) + .endpoint(profile.environment().getResourceManagerEndpoint()) + .subscriptionId(profile.subscriptionId()) + .buildClient(), + sdkContext); + } + + /** @return Entry point for Spring Service management API. */ + public SpringServices springServices() { + if (springServices == null) { + springServices = new SpringServicesImpl(this); + } + return springServices; + } +} diff --git a/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/fluent/AppsClient.java b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/fluent/AppsClient.java new file mode 100644 index 0000000000000..7e392b21bc22e --- /dev/null +++ b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/fluent/AppsClient.java @@ -0,0 +1,1577 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.fluent; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.appplatform.AppPlatformManagementClient; +import com.azure.resourcemanager.appplatform.fluent.inner.AppResourceCollectionInner; +import com.azure.resourcemanager.appplatform.fluent.inner.AppResourceInner; +import com.azure.resourcemanager.appplatform.models.ResourceUploadDefinition; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in Apps. */ +public final class AppsClient { + private final ClientLogger logger = new ClientLogger(AppsClient.class); + + /** The proxy service used to perform REST calls. */ + private final AppsService service; + + /** The service client containing this operation class. */ + private final AppPlatformManagementClient client; + + /** + * Initializes an instance of AppsClient. + * + * @param client the instance of the service client containing this operation class. + */ + public AppsClient(AppPlatformManagementClient client) { + this.service = RestProxy.create(AppsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AppPlatformManagementClientApps to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AppPlatformManagemen") + private interface AppsService { + @Headers({"Accept: application/json", "Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring" + + "/{serviceName}/apps/{appName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("appName") String appName, + @QueryParam("syncStatus") String syncStatus, + Context context); + + @Headers({"Accept: application/json", "Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring" + + "/{serviceName}/apps/{appName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("appName") String appName, + @BodyParam("application/json") AppResourceInner appResource, + Context context); + + @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring" + + "/{serviceName}/apps/{appName}") + @ExpectedResponses({200, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("appName") String appName, + Context context); + + @Headers({"Accept: application/json", "Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring" + + "/{serviceName}/apps/{appName}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("appName") String appName, + @BodyParam("application/json") AppResourceInner appResource, + Context context); + + @Headers({"Accept: application/json", "Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring" + + "/{serviceName}/apps") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + Context context); + + @Headers({"Accept: application/json", "Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring" + + "/{serviceName}/apps/{appName}/getResourceUploadUrl") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getResourceUploadUrl( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("appName") String appName, + Context context); + + @Headers({"Accept: application/json", "Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, Context context); + } + + /** + * Get an App and its properties. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param syncStatus Indicates whether sync status. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an App and its properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getWithResponseAsync( + String resourceGroupName, String serviceName, String appName, String syncStatus) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (appName == null) { + return Mono.error(new IllegalArgumentException("Parameter appName is required and cannot be null.")); + } + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + appName, + syncStatus, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get an App and its properties. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param syncStatus Indicates whether sync status. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an App and its properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getWithResponseAsync( + String resourceGroupName, String serviceName, String appName, String syncStatus, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (appName == null) { + return Mono.error(new IllegalArgumentException("Parameter appName is required and cannot be null.")); + } + return service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + appName, + syncStatus, + context); + } + + /** + * Get an App and its properties. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param syncStatus Indicates whether sync status. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an App and its properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getAsync( + String resourceGroupName, String serviceName, String appName, String syncStatus) { + return getWithResponseAsync(resourceGroupName, serviceName, appName, syncStatus) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get an App and its properties. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param syncStatus Indicates whether sync status. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an App and its properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getAsync( + String resourceGroupName, String serviceName, String appName, String syncStatus, Context context) { + return getWithResponseAsync(resourceGroupName, serviceName, appName, syncStatus, context) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get an App and its properties. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an App and its properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getAsync(String resourceGroupName, String serviceName, String appName) { + final String syncStatus = null; + final Context context = null; + return getWithResponseAsync(resourceGroupName, serviceName, appName, syncStatus) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get an App and its properties. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param syncStatus Indicates whether sync status. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an App and its properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AppResourceInner get(String resourceGroupName, String serviceName, String appName, String syncStatus) { + return getAsync(resourceGroupName, serviceName, appName, syncStatus).block(); + } + + /** + * Get an App and its properties. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param syncStatus Indicates whether sync status. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an App and its properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AppResourceInner get( + String resourceGroupName, String serviceName, String appName, String syncStatus, Context context) { + return getAsync(resourceGroupName, serviceName, appName, syncStatus, context).block(); + } + + /** + * Get an App and its properties. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an App and its properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AppResourceInner get(String resourceGroupName, String serviceName, String appName) { + final String syncStatus = null; + final Context context = null; + return getAsync(resourceGroupName, serviceName, appName, syncStatus).block(); + } + + /** + * Create a new App or update an exiting App. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param appResource App resource payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return app resource payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String serviceName, String appName, AppResourceInner appResource) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (appName == null) { + return Mono.error(new IllegalArgumentException("Parameter appName is required and cannot be null.")); + } + if (appResource == null) { + return Mono.error(new IllegalArgumentException("Parameter appResource is required and cannot be null.")); + } else { + appResource.validate(); + } + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + appName, + appResource, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Create a new App or update an exiting App. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param appResource App resource payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return app resource payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String serviceName, String appName, AppResourceInner appResource, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (appName == null) { + return Mono.error(new IllegalArgumentException("Parameter appName is required and cannot be null.")); + } + if (appResource == null) { + return Mono.error(new IllegalArgumentException("Parameter appResource is required and cannot be null.")); + } else { + appResource.validate(); + } + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + appName, + appResource, + context); + } + + /** + * Create a new App or update an exiting App. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param appResource App resource payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return app resource payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PollerFlux, AppResourceInner> beginCreateOrUpdateAsync( + String resourceGroupName, String serviceName, String appName, AppResourceInner appResource) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, serviceName, appName, appResource); + return this + .client + .getLroResultAsync( + mono, this.client.getHttpPipeline(), AppResourceInner.class, AppResourceInner.class); + } + + /** + * Create a new App or update an exiting App. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param appResource App resource payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return app resource payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PollerFlux, AppResourceInner> beginCreateOrUpdateAsync( + String resourceGroupName, String serviceName, String appName, AppResourceInner appResource, Context context) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, serviceName, appName, appResource, context); + return this + .client + .getLroResultAsync( + mono, this.client.getHttpPipeline(), AppResourceInner.class, AppResourceInner.class); + } + + /** + * Create a new App or update an exiting App. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param appResource App resource payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return app resource payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, AppResourceInner> beginCreateOrUpdate( + String resourceGroupName, String serviceName, String appName, AppResourceInner appResource) { + return beginCreateOrUpdateAsync(resourceGroupName, serviceName, appName, appResource).getSyncPoller(); + } + + /** + * Create a new App or update an exiting App. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param appResource App resource payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return app resource payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, AppResourceInner> beginCreateOrUpdate( + String resourceGroupName, String serviceName, String appName, AppResourceInner appResource, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, serviceName, appName, appResource, context).getSyncPoller(); + } + + /** + * Create a new App or update an exiting App. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param appResource App resource payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return app resource payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono createOrUpdateAsync( + String resourceGroupName, String serviceName, String appName, AppResourceInner appResource) { + return beginCreateOrUpdateAsync(resourceGroupName, serviceName, appName, appResource) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a new App or update an exiting App. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param appResource App resource payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return app resource payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono createOrUpdateAsync( + String resourceGroupName, String serviceName, String appName, AppResourceInner appResource, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, serviceName, appName, appResource, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a new App or update an exiting App. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param appResource App resource payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return app resource payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AppResourceInner createOrUpdate( + String resourceGroupName, String serviceName, String appName, AppResourceInner appResource) { + return createOrUpdateAsync(resourceGroupName, serviceName, appName, appResource).block(); + } + + /** + * Create a new App or update an exiting App. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param appResource App resource payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return app resource payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AppResourceInner createOrUpdate( + String resourceGroupName, String serviceName, String appName, AppResourceInner appResource, Context context) { + return createOrUpdateAsync(resourceGroupName, serviceName, appName, appResource, context).block(); + } + + /** + * Operation to delete an App. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> deleteWithResponseAsync(String resourceGroupName, String serviceName, String appName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (appName == null) { + return Mono.error(new IllegalArgumentException("Parameter appName is required and cannot be null.")); + } + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + appName, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Operation to delete an App. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> deleteWithResponseAsync( + String resourceGroupName, String serviceName, String appName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (appName == null) { + return Mono.error(new IllegalArgumentException("Parameter appName is required and cannot be null.")); + } + return service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + appName, + context); + } + + /** + * Operation to delete an App. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono deleteAsync(String resourceGroupName, String serviceName, String appName) { + return deleteWithResponseAsync(resourceGroupName, serviceName, appName) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Operation to delete an App. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono deleteAsync(String resourceGroupName, String serviceName, String appName, Context context) { + return deleteWithResponseAsync(resourceGroupName, serviceName, appName, context) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Operation to delete an App. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String serviceName, String appName) { + deleteAsync(resourceGroupName, serviceName, appName).block(); + } + + /** + * Operation to delete an App. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String serviceName, String appName, Context context) { + deleteAsync(resourceGroupName, serviceName, appName, context).block(); + } + + /** + * Operation to update an exiting App. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param appResource App resource payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return app resource payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono>> updateWithResponseAsync( + String resourceGroupName, String serviceName, String appName, AppResourceInner appResource) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (appName == null) { + return Mono.error(new IllegalArgumentException("Parameter appName is required and cannot be null.")); + } + if (appResource == null) { + return Mono.error(new IllegalArgumentException("Parameter appResource is required and cannot be null.")); + } else { + appResource.validate(); + } + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + appName, + appResource, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Operation to update an exiting App. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param appResource App resource payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return app resource payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono>> updateWithResponseAsync( + String resourceGroupName, String serviceName, String appName, AppResourceInner appResource, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (appName == null) { + return Mono.error(new IllegalArgumentException("Parameter appName is required and cannot be null.")); + } + if (appResource == null) { + return Mono.error(new IllegalArgumentException("Parameter appResource is required and cannot be null.")); + } else { + appResource.validate(); + } + return service + .update( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + appName, + appResource, + context); + } + + /** + * Operation to update an exiting App. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param appResource App resource payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return app resource payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PollerFlux, AppResourceInner> beginUpdateAsync( + String resourceGroupName, String serviceName, String appName, AppResourceInner appResource) { + Mono>> mono = + updateWithResponseAsync(resourceGroupName, serviceName, appName, appResource); + return this + .client + .getLroResultAsync( + mono, this.client.getHttpPipeline(), AppResourceInner.class, AppResourceInner.class); + } + + /** + * Operation to update an exiting App. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param appResource App resource payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return app resource payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PollerFlux, AppResourceInner> beginUpdateAsync( + String resourceGroupName, String serviceName, String appName, AppResourceInner appResource, Context context) { + Mono>> mono = + updateWithResponseAsync(resourceGroupName, serviceName, appName, appResource, context); + return this + .client + .getLroResultAsync( + mono, this.client.getHttpPipeline(), AppResourceInner.class, AppResourceInner.class); + } + + /** + * Operation to update an exiting App. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param appResource App resource payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return app resource payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, AppResourceInner> beginUpdate( + String resourceGroupName, String serviceName, String appName, AppResourceInner appResource) { + return beginUpdateAsync(resourceGroupName, serviceName, appName, appResource).getSyncPoller(); + } + + /** + * Operation to update an exiting App. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param appResource App resource payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return app resource payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, AppResourceInner> beginUpdate( + String resourceGroupName, String serviceName, String appName, AppResourceInner appResource, Context context) { + return beginUpdateAsync(resourceGroupName, serviceName, appName, appResource, context).getSyncPoller(); + } + + /** + * Operation to update an exiting App. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param appResource App resource payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return app resource payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono updateAsync( + String resourceGroupName, String serviceName, String appName, AppResourceInner appResource) { + return beginUpdateAsync(resourceGroupName, serviceName, appName, appResource) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Operation to update an exiting App. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param appResource App resource payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return app resource payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono updateAsync( + String resourceGroupName, String serviceName, String appName, AppResourceInner appResource, Context context) { + return beginUpdateAsync(resourceGroupName, serviceName, appName, appResource, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Operation to update an exiting App. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param appResource App resource payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return app resource payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AppResourceInner update( + String resourceGroupName, String serviceName, String appName, AppResourceInner appResource) { + return updateAsync(resourceGroupName, serviceName, appName, appResource).block(); + } + + /** + * Operation to update an exiting App. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param appResource App resource payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return app resource payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AppResourceInner update( + String resourceGroupName, String serviceName, String appName, AppResourceInner appResource, Context context) { + return updateAsync(resourceGroupName, serviceName, appName, appResource, context).block(); + } + + /** + * Handles requests to list all resources in a Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of App resources and a possible link for next set. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listSinglePageAsync(String resourceGroupName, String serviceName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Handles requests to list all resources in a Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of App resources and a possible link for next set. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listSinglePageAsync( + String resourceGroupName, String serviceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + return service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Handles requests to list all resources in a Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of App resources and a possible link for next set. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listAsync(String resourceGroupName, String serviceName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, serviceName), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Handles requests to list all resources in a Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of App resources and a possible link for next set. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listAsync(String resourceGroupName, String serviceName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, serviceName, context), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Handles requests to list all resources in a Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of App resources and a possible link for next set. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String serviceName) { + return new PagedIterable<>(listAsync(resourceGroupName, serviceName)); + } + + /** + * Handles requests to list all resources in a Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of App resources and a possible link for next set. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String serviceName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, serviceName, context)); + } + + /** + * Get an resource upload URL for an App, which may be artifacts or source archive. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an resource upload URL for an App, which may be artifacts or source archive. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getResourceUploadUrlWithResponseAsync( + String resourceGroupName, String serviceName, String appName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (appName == null) { + return Mono.error(new IllegalArgumentException("Parameter appName is required and cannot be null.")); + } + return FluxUtil + .withContext( + context -> + service + .getResourceUploadUrl( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + appName, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get an resource upload URL for an App, which may be artifacts or source archive. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an resource upload URL for an App, which may be artifacts or source archive. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getResourceUploadUrlWithResponseAsync( + String resourceGroupName, String serviceName, String appName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (appName == null) { + return Mono.error(new IllegalArgumentException("Parameter appName is required and cannot be null.")); + } + return service + .getResourceUploadUrl( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + appName, + context); + } + + /** + * Get an resource upload URL for an App, which may be artifacts or source archive. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an resource upload URL for an App, which may be artifacts or source archive. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getResourceUploadUrlAsync( + String resourceGroupName, String serviceName, String appName) { + return getResourceUploadUrlWithResponseAsync(resourceGroupName, serviceName, appName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get an resource upload URL for an App, which may be artifacts or source archive. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an resource upload URL for an App, which may be artifacts or source archive. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getResourceUploadUrlAsync( + String resourceGroupName, String serviceName, String appName, Context context) { + return getResourceUploadUrlWithResponseAsync(resourceGroupName, serviceName, appName, context) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get an resource upload URL for an App, which may be artifacts or source archive. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an resource upload URL for an App, which may be artifacts or source archive. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ResourceUploadDefinition getResourceUploadUrl(String resourceGroupName, String serviceName, String appName) { + return getResourceUploadUrlAsync(resourceGroupName, serviceName, appName).block(); + } + + /** + * Get an resource upload URL for an App, which may be artifacts or source archive. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an resource upload URL for an App, which may be artifacts or source archive. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ResourceUploadDefinition getResourceUploadUrl( + String resourceGroupName, String serviceName, String appName, Context context) { + return getResourceUploadUrlAsync(resourceGroupName, serviceName, appName, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of App resources and a possible link for next set. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + return FluxUtil + .withContext(context -> service.listNext(nextLink, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of App resources and a possible link for next set. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + return service + .listNext(nextLink, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/fluent/BindingsClient.java b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/fluent/BindingsClient.java new file mode 100644 index 0000000000000..9a10fb6f6cdf8 --- /dev/null +++ b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/fluent/BindingsClient.java @@ -0,0 +1,1296 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.fluent; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.appplatform.AppPlatformManagementClient; +import com.azure.resourcemanager.appplatform.fluent.inner.BindingResourceCollectionInner; +import com.azure.resourcemanager.appplatform.fluent.inner.BindingResourceInner; +import com.azure.resourcemanager.appplatform.models.BindingResourceProperties; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in Bindings. */ +public final class BindingsClient { + private final ClientLogger logger = new ClientLogger(BindingsClient.class); + + /** The proxy service used to perform REST calls. */ + private final BindingsService service; + + /** The service client containing this operation class. */ + private final AppPlatformManagementClient client; + + /** + * Initializes an instance of BindingsClient. + * + * @param client the instance of the service client containing this operation class. + */ + public BindingsClient(AppPlatformManagementClient client) { + this.service = RestProxy.create(BindingsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AppPlatformManagementClientBindings to be used by the proxy service + * to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AppPlatformManagemen") + private interface BindingsService { + @Headers({"Accept: application/json", "Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring" + + "/{serviceName}/apps/{appName}/bindings/{bindingName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("appName") String appName, + @PathParam("bindingName") String bindingName, + Context context); + + @Headers({"Accept: application/json", "Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring" + + "/{serviceName}/apps/{appName}/bindings/{bindingName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createOrUpdate( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("appName") String appName, + @PathParam("bindingName") String bindingName, + @BodyParam("application/json") BindingResourceInner bindingResource, + Context context); + + @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring" + + "/{serviceName}/apps/{appName}/bindings/{bindingName}") + @ExpectedResponses({200, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("appName") String appName, + @PathParam("bindingName") String bindingName, + Context context); + + @Headers({"Accept: application/json", "Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring" + + "/{serviceName}/apps/{appName}/bindings/{bindingName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> update( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("appName") String appName, + @PathParam("bindingName") String bindingName, + @BodyParam("application/json") BindingResourceInner bindingResource, + Context context); + + @Headers({"Accept: application/json", "Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring" + + "/{serviceName}/apps/{appName}/bindings") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("appName") String appName, + Context context); + + @Headers({"Accept: application/json", "Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, Context context); + } + + /** + * Get a Binding and its properties. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param bindingName The name of the Binding resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Binding and its properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getWithResponseAsync( + String resourceGroupName, String serviceName, String appName, String bindingName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (appName == null) { + return Mono.error(new IllegalArgumentException("Parameter appName is required and cannot be null.")); + } + if (bindingName == null) { + return Mono.error(new IllegalArgumentException("Parameter bindingName is required and cannot be null.")); + } + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + appName, + bindingName, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get a Binding and its properties. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param bindingName The name of the Binding resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Binding and its properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getWithResponseAsync( + String resourceGroupName, String serviceName, String appName, String bindingName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (appName == null) { + return Mono.error(new IllegalArgumentException("Parameter appName is required and cannot be null.")); + } + if (bindingName == null) { + return Mono.error(new IllegalArgumentException("Parameter bindingName is required and cannot be null.")); + } + return service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + appName, + bindingName, + context); + } + + /** + * Get a Binding and its properties. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param bindingName The name of the Binding resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Binding and its properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getAsync( + String resourceGroupName, String serviceName, String appName, String bindingName) { + return getWithResponseAsync(resourceGroupName, serviceName, appName, bindingName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get a Binding and its properties. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param bindingName The name of the Binding resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Binding and its properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getAsync( + String resourceGroupName, String serviceName, String appName, String bindingName, Context context) { + return getWithResponseAsync(resourceGroupName, serviceName, appName, bindingName, context) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get a Binding and its properties. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param bindingName The name of the Binding resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Binding and its properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public BindingResourceInner get(String resourceGroupName, String serviceName, String appName, String bindingName) { + return getAsync(resourceGroupName, serviceName, appName, bindingName).block(); + } + + /** + * Get a Binding and its properties. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param bindingName The name of the Binding resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Binding and its properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public BindingResourceInner get( + String resourceGroupName, String serviceName, String appName, String bindingName, Context context) { + return getAsync(resourceGroupName, serviceName, appName, bindingName, context).block(); + } + + /** + * Create a new Binding or update an exiting Binding. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param bindingName The name of the Binding resource. + * @param properties Binding resource properties payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return binding resource payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, + String serviceName, + String appName, + String bindingName, + BindingResourceProperties properties) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (appName == null) { + return Mono.error(new IllegalArgumentException("Parameter appName is required and cannot be null.")); + } + if (bindingName == null) { + return Mono.error(new IllegalArgumentException("Parameter bindingName is required and cannot be null.")); + } + if (properties != null) { + properties.validate(); + } + BindingResourceInner bindingResource = new BindingResourceInner(); + bindingResource.withProperties(properties); + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + appName, + bindingName, + bindingResource, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Create a new Binding or update an exiting Binding. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param bindingName The name of the Binding resource. + * @param properties Binding resource properties payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return binding resource payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, + String serviceName, + String appName, + String bindingName, + BindingResourceProperties properties, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (appName == null) { + return Mono.error(new IllegalArgumentException("Parameter appName is required and cannot be null.")); + } + if (bindingName == null) { + return Mono.error(new IllegalArgumentException("Parameter bindingName is required and cannot be null.")); + } + if (properties != null) { + properties.validate(); + } + BindingResourceInner bindingResource = new BindingResourceInner(); + bindingResource.withProperties(properties); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + appName, + bindingName, + bindingResource, + context); + } + + /** + * Create a new Binding or update an exiting Binding. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param bindingName The name of the Binding resource. + * @param properties Binding resource properties payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return binding resource payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono createOrUpdateAsync( + String resourceGroupName, + String serviceName, + String appName, + String bindingName, + BindingResourceProperties properties) { + return createOrUpdateWithResponseAsync(resourceGroupName, serviceName, appName, bindingName, properties) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Create a new Binding or update an exiting Binding. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param bindingName The name of the Binding resource. + * @param properties Binding resource properties payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return binding resource payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono createOrUpdateAsync( + String resourceGroupName, + String serviceName, + String appName, + String bindingName, + BindingResourceProperties properties, + Context context) { + return createOrUpdateWithResponseAsync( + resourceGroupName, serviceName, appName, bindingName, properties, context) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Create a new Binding or update an exiting Binding. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param bindingName The name of the Binding resource. + * @param properties Binding resource properties payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return binding resource payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public BindingResourceInner createOrUpdate( + String resourceGroupName, + String serviceName, + String appName, + String bindingName, + BindingResourceProperties properties) { + return createOrUpdateAsync(resourceGroupName, serviceName, appName, bindingName, properties).block(); + } + + /** + * Create a new Binding or update an exiting Binding. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param bindingName The name of the Binding resource. + * @param properties Binding resource properties payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return binding resource payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public BindingResourceInner createOrUpdate( + String resourceGroupName, + String serviceName, + String appName, + String bindingName, + BindingResourceProperties properties, + Context context) { + return createOrUpdateAsync(resourceGroupName, serviceName, appName, bindingName, properties, context).block(); + } + + /** + * Operation to delete a Binding. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param bindingName The name of the Binding resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> deleteWithResponseAsync( + String resourceGroupName, String serviceName, String appName, String bindingName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (appName == null) { + return Mono.error(new IllegalArgumentException("Parameter appName is required and cannot be null.")); + } + if (bindingName == null) { + return Mono.error(new IllegalArgumentException("Parameter bindingName is required and cannot be null.")); + } + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + appName, + bindingName, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Operation to delete a Binding. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param bindingName The name of the Binding resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> deleteWithResponseAsync( + String resourceGroupName, String serviceName, String appName, String bindingName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (appName == null) { + return Mono.error(new IllegalArgumentException("Parameter appName is required and cannot be null.")); + } + if (bindingName == null) { + return Mono.error(new IllegalArgumentException("Parameter bindingName is required and cannot be null.")); + } + return service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + appName, + bindingName, + context); + } + + /** + * Operation to delete a Binding. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param bindingName The name of the Binding resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono deleteAsync(String resourceGroupName, String serviceName, String appName, String bindingName) { + return deleteWithResponseAsync(resourceGroupName, serviceName, appName, bindingName) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Operation to delete a Binding. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param bindingName The name of the Binding resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono deleteAsync( + String resourceGroupName, String serviceName, String appName, String bindingName, Context context) { + return deleteWithResponseAsync(resourceGroupName, serviceName, appName, bindingName, context) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Operation to delete a Binding. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param bindingName The name of the Binding resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String serviceName, String appName, String bindingName) { + deleteAsync(resourceGroupName, serviceName, appName, bindingName).block(); + } + + /** + * Operation to delete a Binding. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param bindingName The name of the Binding resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete( + String resourceGroupName, String serviceName, String appName, String bindingName, Context context) { + deleteAsync(resourceGroupName, serviceName, appName, bindingName, context).block(); + } + + /** + * Operation to update an exiting Binding. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param bindingName The name of the Binding resource. + * @param properties Binding resource properties payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return binding resource payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> updateWithResponseAsync( + String resourceGroupName, + String serviceName, + String appName, + String bindingName, + BindingResourceProperties properties) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (appName == null) { + return Mono.error(new IllegalArgumentException("Parameter appName is required and cannot be null.")); + } + if (bindingName == null) { + return Mono.error(new IllegalArgumentException("Parameter bindingName is required and cannot be null.")); + } + if (properties != null) { + properties.validate(); + } + BindingResourceInner bindingResource = new BindingResourceInner(); + bindingResource.withProperties(properties); + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + appName, + bindingName, + bindingResource, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Operation to update an exiting Binding. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param bindingName The name of the Binding resource. + * @param properties Binding resource properties payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return binding resource payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> updateWithResponseAsync( + String resourceGroupName, + String serviceName, + String appName, + String bindingName, + BindingResourceProperties properties, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (appName == null) { + return Mono.error(new IllegalArgumentException("Parameter appName is required and cannot be null.")); + } + if (bindingName == null) { + return Mono.error(new IllegalArgumentException("Parameter bindingName is required and cannot be null.")); + } + if (properties != null) { + properties.validate(); + } + BindingResourceInner bindingResource = new BindingResourceInner(); + bindingResource.withProperties(properties); + return service + .update( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + appName, + bindingName, + bindingResource, + context); + } + + /** + * Operation to update an exiting Binding. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param bindingName The name of the Binding resource. + * @param properties Binding resource properties payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return binding resource payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono updateAsync( + String resourceGroupName, + String serviceName, + String appName, + String bindingName, + BindingResourceProperties properties) { + return updateWithResponseAsync(resourceGroupName, serviceName, appName, bindingName, properties) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Operation to update an exiting Binding. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param bindingName The name of the Binding resource. + * @param properties Binding resource properties payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return binding resource payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono updateAsync( + String resourceGroupName, + String serviceName, + String appName, + String bindingName, + BindingResourceProperties properties, + Context context) { + return updateWithResponseAsync(resourceGroupName, serviceName, appName, bindingName, properties, context) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Operation to update an exiting Binding. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param bindingName The name of the Binding resource. + * @param properties Binding resource properties payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return binding resource payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public BindingResourceInner update( + String resourceGroupName, + String serviceName, + String appName, + String bindingName, + BindingResourceProperties properties) { + return updateAsync(resourceGroupName, serviceName, appName, bindingName, properties).block(); + } + + /** + * Operation to update an exiting Binding. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param bindingName The name of the Binding resource. + * @param properties Binding resource properties payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return binding resource payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public BindingResourceInner update( + String resourceGroupName, + String serviceName, + String appName, + String bindingName, + BindingResourceProperties properties, + Context context) { + return updateAsync(resourceGroupName, serviceName, appName, bindingName, properties, context).block(); + } + + /** + * Handles requests to list all resources in an App. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of Binding resources and a possible link for next set. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listSinglePageAsync( + String resourceGroupName, String serviceName, String appName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (appName == null) { + return Mono.error(new IllegalArgumentException("Parameter appName is required and cannot be null.")); + } + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + appName, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Handles requests to list all resources in an App. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of Binding resources and a possible link for next set. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listSinglePageAsync( + String resourceGroupName, String serviceName, String appName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (appName == null) { + return Mono.error(new IllegalArgumentException("Parameter appName is required and cannot be null.")); + } + return service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + appName, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Handles requests to list all resources in an App. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of Binding resources and a possible link for next set. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listAsync(String resourceGroupName, String serviceName, String appName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, serviceName, appName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Handles requests to list all resources in an App. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of Binding resources and a possible link for next set. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listAsync( + String resourceGroupName, String serviceName, String appName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, serviceName, appName, context), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Handles requests to list all resources in an App. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of Binding resources and a possible link for next set. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String serviceName, String appName) { + return new PagedIterable<>(listAsync(resourceGroupName, serviceName, appName)); + } + + /** + * Handles requests to list all resources in an App. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of Binding resources and a possible link for next set. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String serviceName, String appName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, serviceName, appName, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of Binding resources and a possible link for next set. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + return FluxUtil + .withContext(context -> service.listNext(nextLink, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of Binding resources and a possible link for next set. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + return service + .listNext(nextLink, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/fluent/CertificatesClient.java b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/fluent/CertificatesClient.java new file mode 100644 index 0000000000000..5a1853b7f415b --- /dev/null +++ b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/fluent/CertificatesClient.java @@ -0,0 +1,956 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.fluent; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.appplatform.AppPlatformManagementClient; +import com.azure.resourcemanager.appplatform.fluent.inner.CertificateResourceCollectionInner; +import com.azure.resourcemanager.appplatform.fluent.inner.CertificateResourceInner; +import com.azure.resourcemanager.appplatform.models.CertificateProperties; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in Certificates. */ +public final class CertificatesClient { + private final ClientLogger logger = new ClientLogger(CertificatesClient.class); + + /** The proxy service used to perform REST calls. */ + private final CertificatesService service; + + /** The service client containing this operation class. */ + private final AppPlatformManagementClient client; + + /** + * Initializes an instance of CertificatesClient. + * + * @param client the instance of the service client containing this operation class. + */ + public CertificatesClient(AppPlatformManagementClient client) { + this.service = + RestProxy.create(CertificatesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AppPlatformManagementClientCertificates to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AppPlatformManagemen") + private interface CertificatesService { + @Headers({"Accept: application/json", "Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring" + + "/{serviceName}/certificates/{certificateName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("certificateName") String certificateName, + Context context); + + @Headers({"Accept: application/json", "Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring" + + "/{serviceName}/certificates/{certificateName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createOrUpdate( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("certificateName") String certificateName, + @BodyParam("application/json") CertificateResourceInner certificateResource, + Context context); + + @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring" + + "/{serviceName}/certificates/{certificateName}") + @ExpectedResponses({200, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("certificateName") String certificateName, + Context context); + + @Headers({"Accept: application/json", "Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring" + + "/{serviceName}/certificates") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + Context context); + + @Headers({"Accept: application/json", "Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, Context context); + } + + /** + * Get the certificate resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param certificateName The name of the certificate resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the certificate resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getWithResponseAsync( + String resourceGroupName, String serviceName, String certificateName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (certificateName == null) { + return Mono + .error(new IllegalArgumentException("Parameter certificateName is required and cannot be null.")); + } + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + certificateName, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get the certificate resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param certificateName The name of the certificate resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the certificate resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getWithResponseAsync( + String resourceGroupName, String serviceName, String certificateName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (certificateName == null) { + return Mono + .error(new IllegalArgumentException("Parameter certificateName is required and cannot be null.")); + } + return service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + certificateName, + context); + } + + /** + * Get the certificate resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param certificateName The name of the certificate resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the certificate resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getAsync( + String resourceGroupName, String serviceName, String certificateName) { + return getWithResponseAsync(resourceGroupName, serviceName, certificateName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get the certificate resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param certificateName The name of the certificate resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the certificate resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getAsync( + String resourceGroupName, String serviceName, String certificateName, Context context) { + return getWithResponseAsync(resourceGroupName, serviceName, certificateName, context) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get the certificate resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param certificateName The name of the certificate resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the certificate resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CertificateResourceInner get(String resourceGroupName, String serviceName, String certificateName) { + return getAsync(resourceGroupName, serviceName, certificateName).block(); + } + + /** + * Get the certificate resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param certificateName The name of the certificate resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the certificate resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CertificateResourceInner get( + String resourceGroupName, String serviceName, String certificateName, Context context) { + return getAsync(resourceGroupName, serviceName, certificateName, context).block(); + } + + /** + * Create or update certificate resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param certificateName The name of the certificate resource. + * @param properties Certificate resource payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return certificate resource payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, String serviceName, String certificateName, CertificateProperties properties) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (certificateName == null) { + return Mono + .error(new IllegalArgumentException("Parameter certificateName is required and cannot be null.")); + } + if (properties != null) { + properties.validate(); + } + CertificateResourceInner certificateResource = new CertificateResourceInner(); + certificateResource.withProperties(properties); + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + certificateName, + certificateResource, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Create or update certificate resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param certificateName The name of the certificate resource. + * @param properties Certificate resource payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return certificate resource payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, + String serviceName, + String certificateName, + CertificateProperties properties, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (certificateName == null) { + return Mono + .error(new IllegalArgumentException("Parameter certificateName is required and cannot be null.")); + } + if (properties != null) { + properties.validate(); + } + CertificateResourceInner certificateResource = new CertificateResourceInner(); + certificateResource.withProperties(properties); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + certificateName, + certificateResource, + context); + } + + /** + * Create or update certificate resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param certificateName The name of the certificate resource. + * @param properties Certificate resource payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return certificate resource payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono createOrUpdateAsync( + String resourceGroupName, String serviceName, String certificateName, CertificateProperties properties) { + return createOrUpdateWithResponseAsync(resourceGroupName, serviceName, certificateName, properties) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Create or update certificate resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param certificateName The name of the certificate resource. + * @param properties Certificate resource payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return certificate resource payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono createOrUpdateAsync( + String resourceGroupName, + String serviceName, + String certificateName, + CertificateProperties properties, + Context context) { + return createOrUpdateWithResponseAsync(resourceGroupName, serviceName, certificateName, properties, context) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Create or update certificate resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param certificateName The name of the certificate resource. + * @param properties Certificate resource payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return certificate resource payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CertificateResourceInner createOrUpdate( + String resourceGroupName, String serviceName, String certificateName, CertificateProperties properties) { + return createOrUpdateAsync(resourceGroupName, serviceName, certificateName, properties).block(); + } + + /** + * Create or update certificate resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param certificateName The name of the certificate resource. + * @param properties Certificate resource payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return certificate resource payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CertificateResourceInner createOrUpdate( + String resourceGroupName, + String serviceName, + String certificateName, + CertificateProperties properties, + Context context) { + return createOrUpdateAsync(resourceGroupName, serviceName, certificateName, properties, context).block(); + } + + /** + * Delete the certificate resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param certificateName The name of the certificate resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> deleteWithResponseAsync( + String resourceGroupName, String serviceName, String certificateName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (certificateName == null) { + return Mono + .error(new IllegalArgumentException("Parameter certificateName is required and cannot be null.")); + } + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + certificateName, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Delete the certificate resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param certificateName The name of the certificate resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> deleteWithResponseAsync( + String resourceGroupName, String serviceName, String certificateName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (certificateName == null) { + return Mono + .error(new IllegalArgumentException("Parameter certificateName is required and cannot be null.")); + } + return service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + certificateName, + context); + } + + /** + * Delete the certificate resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param certificateName The name of the certificate resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono deleteAsync(String resourceGroupName, String serviceName, String certificateName) { + return deleteWithResponseAsync(resourceGroupName, serviceName, certificateName) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Delete the certificate resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param certificateName The name of the certificate resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono deleteAsync( + String resourceGroupName, String serviceName, String certificateName, Context context) { + return deleteWithResponseAsync(resourceGroupName, serviceName, certificateName, context) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Delete the certificate resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param certificateName The name of the certificate resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String serviceName, String certificateName) { + deleteAsync(resourceGroupName, serviceName, certificateName).block(); + } + + /** + * Delete the certificate resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param certificateName The name of the certificate resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String serviceName, String certificateName, Context context) { + deleteAsync(resourceGroupName, serviceName, certificateName, context).block(); + } + + /** + * List all the certificates of one user. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection compose of certificate resources list and a possible link for next page. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listSinglePageAsync( + String resourceGroupName, String serviceName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * List all the certificates of one user. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection compose of certificate resources list and a possible link for next page. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listSinglePageAsync( + String resourceGroupName, String serviceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + return service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * List all the certificates of one user. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection compose of certificate resources list and a possible link for next page. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listAsync(String resourceGroupName, String serviceName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, serviceName), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List all the certificates of one user. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection compose of certificate resources list and a possible link for next page. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listAsync( + String resourceGroupName, String serviceName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, serviceName, context), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List all the certificates of one user. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection compose of certificate resources list and a possible link for next page. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String serviceName) { + return new PagedIterable<>(listAsync(resourceGroupName, serviceName)); + } + + /** + * List all the certificates of one user. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection compose of certificate resources list and a possible link for next page. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String serviceName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, serviceName, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection compose of certificate resources list and a possible link for next page. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + return FluxUtil + .withContext(context -> service.listNext(nextLink, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection compose of certificate resources list and a possible link for next page. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + return service + .listNext(nextLink, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/fluent/CustomDomainsClient.java b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/fluent/CustomDomainsClient.java new file mode 100644 index 0000000000000..bf62bebbb1a75 --- /dev/null +++ b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/fluent/CustomDomainsClient.java @@ -0,0 +1,1526 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.fluent; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.appplatform.AppPlatformManagementClient; +import com.azure.resourcemanager.appplatform.fluent.inner.CustomDomainResourceCollectionInner; +import com.azure.resourcemanager.appplatform.fluent.inner.CustomDomainResourceInner; +import com.azure.resourcemanager.appplatform.fluent.inner.CustomDomainValidateResultInner; +import com.azure.resourcemanager.appplatform.models.CustomDomainProperties; +import com.azure.resourcemanager.appplatform.models.CustomDomainValidatePayload; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in CustomDomains. */ +public final class CustomDomainsClient { + private final ClientLogger logger = new ClientLogger(CustomDomainsClient.class); + + /** The proxy service used to perform REST calls. */ + private final CustomDomainsService service; + + /** The service client containing this operation class. */ + private final AppPlatformManagementClient client; + + /** + * Initializes an instance of CustomDomainsClient. + * + * @param client the instance of the service client containing this operation class. + */ + public CustomDomainsClient(AppPlatformManagementClient client) { + this.service = + RestProxy.create(CustomDomainsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AppPlatformManagementClientCustomDomains to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AppPlatformManagemen") + private interface CustomDomainsService { + @Headers({"Accept: application/json", "Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring" + + "/{serviceName}/apps/{appName}/domains/{domainName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("appName") String appName, + @PathParam("domainName") String domainName, + Context context); + + @Headers({"Accept: application/json", "Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring" + + "/{serviceName}/apps/{appName}/domains/{domainName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createOrUpdate( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("appName") String appName, + @PathParam("domainName") String domainName, + @BodyParam("application/json") CustomDomainResourceInner domainResource, + Context context); + + @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring" + + "/{serviceName}/apps/{appName}/domains/{domainName}") + @ExpectedResponses({200, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("appName") String appName, + @PathParam("domainName") String domainName, + Context context); + + @Headers({"Accept: application/json", "Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring" + + "/{serviceName}/apps/{appName}/domains/{domainName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> patch( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("appName") String appName, + @PathParam("domainName") String domainName, + @BodyParam("application/json") CustomDomainResourceInner domainResource, + Context context); + + @Headers({"Accept: application/json", "Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring" + + "/{serviceName}/apps/{appName}/domains") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("appName") String appName, + Context context); + + @Headers({"Accept: application/json", "Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring" + + "/{serviceName}/apps/{appName}/domains/validate") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> validate( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("appName") String appName, + @BodyParam("application/json") CustomDomainValidatePayload validatePayload, + Context context); + + @Headers({"Accept: application/json", "Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, Context context); + } + + /** + * Get the custom domain of one lifecycle application. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param domainName The name of the custom domain resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the custom domain of one lifecycle application. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getWithResponseAsync( + String resourceGroupName, String serviceName, String appName, String domainName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (appName == null) { + return Mono.error(new IllegalArgumentException("Parameter appName is required and cannot be null.")); + } + if (domainName == null) { + return Mono.error(new IllegalArgumentException("Parameter domainName is required and cannot be null.")); + } + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + appName, + domainName, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get the custom domain of one lifecycle application. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param domainName The name of the custom domain resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the custom domain of one lifecycle application. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getWithResponseAsync( + String resourceGroupName, String serviceName, String appName, String domainName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (appName == null) { + return Mono.error(new IllegalArgumentException("Parameter appName is required and cannot be null.")); + } + if (domainName == null) { + return Mono.error(new IllegalArgumentException("Parameter domainName is required and cannot be null.")); + } + return service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + appName, + domainName, + context); + } + + /** + * Get the custom domain of one lifecycle application. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param domainName The name of the custom domain resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the custom domain of one lifecycle application. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getAsync( + String resourceGroupName, String serviceName, String appName, String domainName) { + return getWithResponseAsync(resourceGroupName, serviceName, appName, domainName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get the custom domain of one lifecycle application. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param domainName The name of the custom domain resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the custom domain of one lifecycle application. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getAsync( + String resourceGroupName, String serviceName, String appName, String domainName, Context context) { + return getWithResponseAsync(resourceGroupName, serviceName, appName, domainName, context) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get the custom domain of one lifecycle application. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param domainName The name of the custom domain resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the custom domain of one lifecycle application. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CustomDomainResourceInner get( + String resourceGroupName, String serviceName, String appName, String domainName) { + return getAsync(resourceGroupName, serviceName, appName, domainName).block(); + } + + /** + * Get the custom domain of one lifecycle application. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param domainName The name of the custom domain resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the custom domain of one lifecycle application. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CustomDomainResourceInner get( + String resourceGroupName, String serviceName, String appName, String domainName, Context context) { + return getAsync(resourceGroupName, serviceName, appName, domainName, context).block(); + } + + /** + * Create or update custom domain of one lifecycle application. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param domainName The name of the custom domain resource. + * @param properties Custom domain of app resource payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return custom domain resource payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, + String serviceName, + String appName, + String domainName, + CustomDomainProperties properties) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (appName == null) { + return Mono.error(new IllegalArgumentException("Parameter appName is required and cannot be null.")); + } + if (domainName == null) { + return Mono.error(new IllegalArgumentException("Parameter domainName is required and cannot be null.")); + } + if (properties != null) { + properties.validate(); + } + CustomDomainResourceInner domainResource = new CustomDomainResourceInner(); + domainResource.withProperties(properties); + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + appName, + domainName, + domainResource, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Create or update custom domain of one lifecycle application. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param domainName The name of the custom domain resource. + * @param properties Custom domain of app resource payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return custom domain resource payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, + String serviceName, + String appName, + String domainName, + CustomDomainProperties properties, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (appName == null) { + return Mono.error(new IllegalArgumentException("Parameter appName is required and cannot be null.")); + } + if (domainName == null) { + return Mono.error(new IllegalArgumentException("Parameter domainName is required and cannot be null.")); + } + if (properties != null) { + properties.validate(); + } + CustomDomainResourceInner domainResource = new CustomDomainResourceInner(); + domainResource.withProperties(properties); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + appName, + domainName, + domainResource, + context); + } + + /** + * Create or update custom domain of one lifecycle application. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param domainName The name of the custom domain resource. + * @param properties Custom domain of app resource payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return custom domain resource payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono createOrUpdateAsync( + String resourceGroupName, + String serviceName, + String appName, + String domainName, + CustomDomainProperties properties) { + return createOrUpdateWithResponseAsync(resourceGroupName, serviceName, appName, domainName, properties) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Create or update custom domain of one lifecycle application. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param domainName The name of the custom domain resource. + * @param properties Custom domain of app resource payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return custom domain resource payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono createOrUpdateAsync( + String resourceGroupName, + String serviceName, + String appName, + String domainName, + CustomDomainProperties properties, + Context context) { + return createOrUpdateWithResponseAsync(resourceGroupName, serviceName, appName, domainName, properties, context) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Create or update custom domain of one lifecycle application. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param domainName The name of the custom domain resource. + * @param properties Custom domain of app resource payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return custom domain resource payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CustomDomainResourceInner createOrUpdate( + String resourceGroupName, + String serviceName, + String appName, + String domainName, + CustomDomainProperties properties) { + return createOrUpdateAsync(resourceGroupName, serviceName, appName, domainName, properties).block(); + } + + /** + * Create or update custom domain of one lifecycle application. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param domainName The name of the custom domain resource. + * @param properties Custom domain of app resource payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return custom domain resource payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CustomDomainResourceInner createOrUpdate( + String resourceGroupName, + String serviceName, + String appName, + String domainName, + CustomDomainProperties properties, + Context context) { + return createOrUpdateAsync(resourceGroupName, serviceName, appName, domainName, properties, context).block(); + } + + /** + * Delete the custom domain of one lifecycle application. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param domainName The name of the custom domain resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> deleteWithResponseAsync( + String resourceGroupName, String serviceName, String appName, String domainName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (appName == null) { + return Mono.error(new IllegalArgumentException("Parameter appName is required and cannot be null.")); + } + if (domainName == null) { + return Mono.error(new IllegalArgumentException("Parameter domainName is required and cannot be null.")); + } + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + appName, + domainName, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Delete the custom domain of one lifecycle application. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param domainName The name of the custom domain resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> deleteWithResponseAsync( + String resourceGroupName, String serviceName, String appName, String domainName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (appName == null) { + return Mono.error(new IllegalArgumentException("Parameter appName is required and cannot be null.")); + } + if (domainName == null) { + return Mono.error(new IllegalArgumentException("Parameter domainName is required and cannot be null.")); + } + return service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + appName, + domainName, + context); + } + + /** + * Delete the custom domain of one lifecycle application. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param domainName The name of the custom domain resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono deleteAsync(String resourceGroupName, String serviceName, String appName, String domainName) { + return deleteWithResponseAsync(resourceGroupName, serviceName, appName, domainName) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Delete the custom domain of one lifecycle application. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param domainName The name of the custom domain resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono deleteAsync( + String resourceGroupName, String serviceName, String appName, String domainName, Context context) { + return deleteWithResponseAsync(resourceGroupName, serviceName, appName, domainName, context) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Delete the custom domain of one lifecycle application. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param domainName The name of the custom domain resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String serviceName, String appName, String domainName) { + deleteAsync(resourceGroupName, serviceName, appName, domainName).block(); + } + + /** + * Delete the custom domain of one lifecycle application. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param domainName The name of the custom domain resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete( + String resourceGroupName, String serviceName, String appName, String domainName, Context context) { + deleteAsync(resourceGroupName, serviceName, appName, domainName, context).block(); + } + + /** + * Update custom domain of one lifecycle application. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param domainName The name of the custom domain resource. + * @param properties Custom domain of app resource payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return custom domain resource payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> patchWithResponseAsync( + String resourceGroupName, + String serviceName, + String appName, + String domainName, + CustomDomainProperties properties) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (appName == null) { + return Mono.error(new IllegalArgumentException("Parameter appName is required and cannot be null.")); + } + if (domainName == null) { + return Mono.error(new IllegalArgumentException("Parameter domainName is required and cannot be null.")); + } + if (properties != null) { + properties.validate(); + } + CustomDomainResourceInner domainResource = new CustomDomainResourceInner(); + domainResource.withProperties(properties); + return FluxUtil + .withContext( + context -> + service + .patch( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + appName, + domainName, + domainResource, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Update custom domain of one lifecycle application. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param domainName The name of the custom domain resource. + * @param properties Custom domain of app resource payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return custom domain resource payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> patchWithResponseAsync( + String resourceGroupName, + String serviceName, + String appName, + String domainName, + CustomDomainProperties properties, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (appName == null) { + return Mono.error(new IllegalArgumentException("Parameter appName is required and cannot be null.")); + } + if (domainName == null) { + return Mono.error(new IllegalArgumentException("Parameter domainName is required and cannot be null.")); + } + if (properties != null) { + properties.validate(); + } + CustomDomainResourceInner domainResource = new CustomDomainResourceInner(); + domainResource.withProperties(properties); + return service + .patch( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + appName, + domainName, + domainResource, + context); + } + + /** + * Update custom domain of one lifecycle application. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param domainName The name of the custom domain resource. + * @param properties Custom domain of app resource payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return custom domain resource payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono patchAsync( + String resourceGroupName, + String serviceName, + String appName, + String domainName, + CustomDomainProperties properties) { + return patchWithResponseAsync(resourceGroupName, serviceName, appName, domainName, properties) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Update custom domain of one lifecycle application. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param domainName The name of the custom domain resource. + * @param properties Custom domain of app resource payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return custom domain resource payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono patchAsync( + String resourceGroupName, + String serviceName, + String appName, + String domainName, + CustomDomainProperties properties, + Context context) { + return patchWithResponseAsync(resourceGroupName, serviceName, appName, domainName, properties, context) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Update custom domain of one lifecycle application. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param domainName The name of the custom domain resource. + * @param properties Custom domain of app resource payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return custom domain resource payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CustomDomainResourceInner patch( + String resourceGroupName, + String serviceName, + String appName, + String domainName, + CustomDomainProperties properties) { + return patchAsync(resourceGroupName, serviceName, appName, domainName, properties).block(); + } + + /** + * Update custom domain of one lifecycle application. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param domainName The name of the custom domain resource. + * @param properties Custom domain of app resource payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return custom domain resource payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CustomDomainResourceInner patch( + String resourceGroupName, + String serviceName, + String appName, + String domainName, + CustomDomainProperties properties, + Context context) { + return patchAsync(resourceGroupName, serviceName, appName, domainName, properties, context).block(); + } + + /** + * List the custom domains of one lifecycle application. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection compose of a custom domain resources list and a possible link for next page. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listSinglePageAsync( + String resourceGroupName, String serviceName, String appName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (appName == null) { + return Mono.error(new IllegalArgumentException("Parameter appName is required and cannot be null.")); + } + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + appName, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * List the custom domains of one lifecycle application. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection compose of a custom domain resources list and a possible link for next page. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listSinglePageAsync( + String resourceGroupName, String serviceName, String appName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (appName == null) { + return Mono.error(new IllegalArgumentException("Parameter appName is required and cannot be null.")); + } + return service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + appName, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * List the custom domains of one lifecycle application. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection compose of a custom domain resources list and a possible link for next page. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listAsync( + String resourceGroupName, String serviceName, String appName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, serviceName, appName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List the custom domains of one lifecycle application. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection compose of a custom domain resources list and a possible link for next page. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listAsync( + String resourceGroupName, String serviceName, String appName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, serviceName, appName, context), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List the custom domains of one lifecycle application. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection compose of a custom domain resources list and a possible link for next page. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String serviceName, String appName) { + return new PagedIterable<>(listAsync(resourceGroupName, serviceName, appName)); + } + + /** + * List the custom domains of one lifecycle application. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection compose of a custom domain resources list and a possible link for next page. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String serviceName, String appName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, serviceName, appName, context)); + } + + /** + * Check the resource name is valid as well as not in use. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param name Name to be validated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return validation result for custom domain. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> validateWithResponseAsync( + String resourceGroupName, String serviceName, String appName, String name) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (appName == null) { + return Mono.error(new IllegalArgumentException("Parameter appName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + CustomDomainValidatePayload validatePayload = new CustomDomainValidatePayload(); + validatePayload.withName(name); + return FluxUtil + .withContext( + context -> + service + .validate( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + appName, + validatePayload, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Check the resource name is valid as well as not in use. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param name Name to be validated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return validation result for custom domain. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> validateWithResponseAsync( + String resourceGroupName, String serviceName, String appName, String name, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (appName == null) { + return Mono.error(new IllegalArgumentException("Parameter appName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + CustomDomainValidatePayload validatePayload = new CustomDomainValidatePayload(); + validatePayload.withName(name); + return service + .validate( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + appName, + validatePayload, + context); + } + + /** + * Check the resource name is valid as well as not in use. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param name Name to be validated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return validation result for custom domain. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono validateAsync( + String resourceGroupName, String serviceName, String appName, String name) { + return validateWithResponseAsync(resourceGroupName, serviceName, appName, name) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Check the resource name is valid as well as not in use. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param name Name to be validated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return validation result for custom domain. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono validateAsync( + String resourceGroupName, String serviceName, String appName, String name, Context context) { + return validateWithResponseAsync(resourceGroupName, serviceName, appName, name, context) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Check the resource name is valid as well as not in use. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param name Name to be validated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return validation result for custom domain. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CustomDomainValidateResultInner validate( + String resourceGroupName, String serviceName, String appName, String name) { + return validateAsync(resourceGroupName, serviceName, appName, name).block(); + } + + /** + * Check the resource name is valid as well as not in use. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param name Name to be validated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return validation result for custom domain. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CustomDomainValidateResultInner validate( + String resourceGroupName, String serviceName, String appName, String name, Context context) { + return validateAsync(resourceGroupName, serviceName, appName, name, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection compose of a custom domain resources list and a possible link for next page. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + return FluxUtil + .withContext(context -> service.listNext(nextLink, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection compose of a custom domain resources list and a possible link for next page. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + return service + .listNext(nextLink, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/fluent/DeploymentsClient.java b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/fluent/DeploymentsClient.java new file mode 100644 index 0000000000000..47fed40a90265 --- /dev/null +++ b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/fluent/DeploymentsClient.java @@ -0,0 +1,2960 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.fluent; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.core.util.serializer.CollectionFormat; +import com.azure.core.util.serializer.JacksonAdapter; +import com.azure.resourcemanager.appplatform.AppPlatformManagementClient; +import com.azure.resourcemanager.appplatform.fluent.inner.DeploymentResourceCollectionInner; +import com.azure.resourcemanager.appplatform.fluent.inner.DeploymentResourceInner; +import com.azure.resourcemanager.appplatform.fluent.inner.LogFileUrlResponseInner; +import com.azure.resourcemanager.appplatform.models.DeploymentResourceProperties; +import java.nio.ByteBuffer; +import java.util.List; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in Deployments. */ +public final class DeploymentsClient { + private final ClientLogger logger = new ClientLogger(DeploymentsClient.class); + + /** The proxy service used to perform REST calls. */ + private final DeploymentsService service; + + /** The service client containing this operation class. */ + private final AppPlatformManagementClient client; + + /** + * Initializes an instance of DeploymentsClient. + * + * @param client the instance of the service client containing this operation class. + */ + public DeploymentsClient(AppPlatformManagementClient client) { + this.service = + RestProxy.create(DeploymentsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AppPlatformManagementClientDeployments to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AppPlatformManagemen") + private interface DeploymentsService { + @Headers({"Accept: application/json", "Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring" + + "/{serviceName}/apps/{appName}/deployments/{deploymentName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("appName") String appName, + @PathParam("deploymentName") String deploymentName, + Context context); + + @Headers({"Accept: application/json", "Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring" + + "/{serviceName}/apps/{appName}/deployments/{deploymentName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("appName") String appName, + @PathParam("deploymentName") String deploymentName, + @BodyParam("application/json") DeploymentResourceInner deploymentResource, + Context context); + + @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring" + + "/{serviceName}/apps/{appName}/deployments/{deploymentName}") + @ExpectedResponses({200, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("appName") String appName, + @PathParam("deploymentName") String deploymentName, + Context context); + + @Headers({"Accept: application/json", "Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring" + + "/{serviceName}/apps/{appName}/deployments/{deploymentName}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("appName") String appName, + @PathParam("deploymentName") String deploymentName, + @BodyParam("application/json") DeploymentResourceInner deploymentResource, + Context context); + + @Headers({"Accept: application/json", "Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring" + + "/{serviceName}/apps/{appName}/deployments") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("appName") String appName, + @QueryParam("version") String version, + Context context); + + @Headers({"Accept: application/json", "Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring" + + "/{serviceName}/deployments") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listClusterAllDeployments( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @QueryParam("version") String version, + Context context); + + @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring" + + "/{serviceName}/apps/{appName}/deployments/{deploymentName}/start") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> start( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("appName") String appName, + @PathParam("deploymentName") String deploymentName, + Context context); + + @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring" + + "/{serviceName}/apps/{appName}/deployments/{deploymentName}/stop") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> stop( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("appName") String appName, + @PathParam("deploymentName") String deploymentName, + Context context); + + @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring" + + "/{serviceName}/apps/{appName}/deployments/{deploymentName}/restart") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> restart( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("appName") String appName, + @PathParam("deploymentName") String deploymentName, + Context context); + + @Headers({"Accept: application/json", "Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring" + + "/{serviceName}/apps/{appName}/deployments/{deploymentName}/getLogFileUrl") + @ExpectedResponses({200, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getLogFileUrl( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("appName") String appName, + @PathParam("deploymentName") String deploymentName, + Context context); + + @Headers({"Accept: application/json", "Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, Context context); + + @Headers({"Accept: application/json", "Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listClusterAllDeploymentsNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, Context context); + } + + /** + * Get a Deployment and its properties. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Deployment and its properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getWithResponseAsync( + String resourceGroupName, String serviceName, String appName, String deploymentName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (appName == null) { + return Mono.error(new IllegalArgumentException("Parameter appName is required and cannot be null.")); + } + if (deploymentName == null) { + return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); + } + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + appName, + deploymentName, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get a Deployment and its properties. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Deployment and its properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getWithResponseAsync( + String resourceGroupName, String serviceName, String appName, String deploymentName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (appName == null) { + return Mono.error(new IllegalArgumentException("Parameter appName is required and cannot be null.")); + } + if (deploymentName == null) { + return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); + } + return service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + appName, + deploymentName, + context); + } + + /** + * Get a Deployment and its properties. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Deployment and its properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getAsync( + String resourceGroupName, String serviceName, String appName, String deploymentName) { + return getWithResponseAsync(resourceGroupName, serviceName, appName, deploymentName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get a Deployment and its properties. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Deployment and its properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getAsync( + String resourceGroupName, String serviceName, String appName, String deploymentName, Context context) { + return getWithResponseAsync(resourceGroupName, serviceName, appName, deploymentName, context) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get a Deployment and its properties. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Deployment and its properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DeploymentResourceInner get( + String resourceGroupName, String serviceName, String appName, String deploymentName) { + return getAsync(resourceGroupName, serviceName, appName, deploymentName).block(); + } + + /** + * Get a Deployment and its properties. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Deployment and its properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DeploymentResourceInner get( + String resourceGroupName, String serviceName, String appName, String deploymentName, Context context) { + return getAsync(resourceGroupName, serviceName, appName, deploymentName, context).block(); + } + + /** + * Create a new Deployment or update an exiting Deployment. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @param properties Deployment resource properties payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return deployment resource payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String serviceName, + String appName, + String deploymentName, + DeploymentResourceProperties properties) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (appName == null) { + return Mono.error(new IllegalArgumentException("Parameter appName is required and cannot be null.")); + } + if (deploymentName == null) { + return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); + } + if (properties != null) { + properties.validate(); + } + DeploymentResourceInner deploymentResource = new DeploymentResourceInner(); + deploymentResource.withProperties(properties); + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + appName, + deploymentName, + deploymentResource, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Create a new Deployment or update an exiting Deployment. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @param properties Deployment resource properties payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return deployment resource payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String serviceName, + String appName, + String deploymentName, + DeploymentResourceProperties properties, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (appName == null) { + return Mono.error(new IllegalArgumentException("Parameter appName is required and cannot be null.")); + } + if (deploymentName == null) { + return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); + } + if (properties != null) { + properties.validate(); + } + DeploymentResourceInner deploymentResource = new DeploymentResourceInner(); + deploymentResource.withProperties(properties); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + appName, + deploymentName, + deploymentResource, + context); + } + + /** + * Create a new Deployment or update an exiting Deployment. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @param properties Deployment resource properties payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return deployment resource payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PollerFlux, DeploymentResourceInner> beginCreateOrUpdateAsync( + String resourceGroupName, + String serviceName, + String appName, + String deploymentName, + DeploymentResourceProperties properties) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, serviceName, appName, deploymentName, properties); + return this + .client + .getLroResultAsync( + mono, this.client.getHttpPipeline(), DeploymentResourceInner.class, DeploymentResourceInner.class); + } + + /** + * Create a new Deployment or update an exiting Deployment. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @param properties Deployment resource properties payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return deployment resource payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PollerFlux, DeploymentResourceInner> beginCreateOrUpdateAsync( + String resourceGroupName, + String serviceName, + String appName, + String deploymentName, + DeploymentResourceProperties properties, + Context context) { + Mono>> mono = + createOrUpdateWithResponseAsync( + resourceGroupName, serviceName, appName, deploymentName, properties, context); + return this + .client + .getLroResultAsync( + mono, this.client.getHttpPipeline(), DeploymentResourceInner.class, DeploymentResourceInner.class); + } + + /** + * Create a new Deployment or update an exiting Deployment. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @param properties Deployment resource properties payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return deployment resource payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, DeploymentResourceInner> beginCreateOrUpdate( + String resourceGroupName, + String serviceName, + String appName, + String deploymentName, + DeploymentResourceProperties properties) { + return beginCreateOrUpdateAsync(resourceGroupName, serviceName, appName, deploymentName, properties) + .getSyncPoller(); + } + + /** + * Create a new Deployment or update an exiting Deployment. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @param properties Deployment resource properties payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return deployment resource payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, DeploymentResourceInner> beginCreateOrUpdate( + String resourceGroupName, + String serviceName, + String appName, + String deploymentName, + DeploymentResourceProperties properties, + Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, serviceName, appName, deploymentName, properties, context) + .getSyncPoller(); + } + + /** + * Create a new Deployment or update an exiting Deployment. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @param properties Deployment resource properties payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return deployment resource payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono createOrUpdateAsync( + String resourceGroupName, + String serviceName, + String appName, + String deploymentName, + DeploymentResourceProperties properties) { + return beginCreateOrUpdateAsync(resourceGroupName, serviceName, appName, deploymentName, properties) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a new Deployment or update an exiting Deployment. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @param properties Deployment resource properties payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return deployment resource payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono createOrUpdateAsync( + String resourceGroupName, + String serviceName, + String appName, + String deploymentName, + DeploymentResourceProperties properties, + Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, serviceName, appName, deploymentName, properties, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a new Deployment or update an exiting Deployment. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @param properties Deployment resource properties payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return deployment resource payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DeploymentResourceInner createOrUpdate( + String resourceGroupName, + String serviceName, + String appName, + String deploymentName, + DeploymentResourceProperties properties) { + return createOrUpdateAsync(resourceGroupName, serviceName, appName, deploymentName, properties).block(); + } + + /** + * Create a new Deployment or update an exiting Deployment. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @param properties Deployment resource properties payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return deployment resource payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DeploymentResourceInner createOrUpdate( + String resourceGroupName, + String serviceName, + String appName, + String deploymentName, + DeploymentResourceProperties properties, + Context context) { + return createOrUpdateAsync(resourceGroupName, serviceName, appName, deploymentName, properties, context) + .block(); + } + + /** + * Operation to delete a Deployment. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> deleteWithResponseAsync( + String resourceGroupName, String serviceName, String appName, String deploymentName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (appName == null) { + return Mono.error(new IllegalArgumentException("Parameter appName is required and cannot be null.")); + } + if (deploymentName == null) { + return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); + } + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + appName, + deploymentName, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Operation to delete a Deployment. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> deleteWithResponseAsync( + String resourceGroupName, String serviceName, String appName, String deploymentName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (appName == null) { + return Mono.error(new IllegalArgumentException("Parameter appName is required and cannot be null.")); + } + if (deploymentName == null) { + return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); + } + return service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + appName, + deploymentName, + context); + } + + /** + * Operation to delete a Deployment. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono deleteAsync(String resourceGroupName, String serviceName, String appName, String deploymentName) { + return deleteWithResponseAsync(resourceGroupName, serviceName, appName, deploymentName) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Operation to delete a Deployment. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono deleteAsync( + String resourceGroupName, String serviceName, String appName, String deploymentName, Context context) { + return deleteWithResponseAsync(resourceGroupName, serviceName, appName, deploymentName, context) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Operation to delete a Deployment. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String serviceName, String appName, String deploymentName) { + deleteAsync(resourceGroupName, serviceName, appName, deploymentName).block(); + } + + /** + * Operation to delete a Deployment. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete( + String resourceGroupName, String serviceName, String appName, String deploymentName, Context context) { + deleteAsync(resourceGroupName, serviceName, appName, deploymentName, context).block(); + } + + /** + * Operation to update an exiting Deployment. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @param properties Deployment resource properties payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return deployment resource payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono>> updateWithResponseAsync( + String resourceGroupName, + String serviceName, + String appName, + String deploymentName, + DeploymentResourceProperties properties) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (appName == null) { + return Mono.error(new IllegalArgumentException("Parameter appName is required and cannot be null.")); + } + if (deploymentName == null) { + return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); + } + if (properties != null) { + properties.validate(); + } + DeploymentResourceInner deploymentResource = new DeploymentResourceInner(); + deploymentResource.withProperties(properties); + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + appName, + deploymentName, + deploymentResource, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Operation to update an exiting Deployment. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @param properties Deployment resource properties payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return deployment resource payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono>> updateWithResponseAsync( + String resourceGroupName, + String serviceName, + String appName, + String deploymentName, + DeploymentResourceProperties properties, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (appName == null) { + return Mono.error(new IllegalArgumentException("Parameter appName is required and cannot be null.")); + } + if (deploymentName == null) { + return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); + } + if (properties != null) { + properties.validate(); + } + DeploymentResourceInner deploymentResource = new DeploymentResourceInner(); + deploymentResource.withProperties(properties); + return service + .update( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + appName, + deploymentName, + deploymentResource, + context); + } + + /** + * Operation to update an exiting Deployment. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @param properties Deployment resource properties payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return deployment resource payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PollerFlux, DeploymentResourceInner> beginUpdateAsync( + String resourceGroupName, + String serviceName, + String appName, + String deploymentName, + DeploymentResourceProperties properties) { + Mono>> mono = + updateWithResponseAsync(resourceGroupName, serviceName, appName, deploymentName, properties); + return this + .client + .getLroResultAsync( + mono, this.client.getHttpPipeline(), DeploymentResourceInner.class, DeploymentResourceInner.class); + } + + /** + * Operation to update an exiting Deployment. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @param properties Deployment resource properties payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return deployment resource payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PollerFlux, DeploymentResourceInner> beginUpdateAsync( + String resourceGroupName, + String serviceName, + String appName, + String deploymentName, + DeploymentResourceProperties properties, + Context context) { + Mono>> mono = + updateWithResponseAsync(resourceGroupName, serviceName, appName, deploymentName, properties, context); + return this + .client + .getLroResultAsync( + mono, this.client.getHttpPipeline(), DeploymentResourceInner.class, DeploymentResourceInner.class); + } + + /** + * Operation to update an exiting Deployment. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @param properties Deployment resource properties payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return deployment resource payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, DeploymentResourceInner> beginUpdate( + String resourceGroupName, + String serviceName, + String appName, + String deploymentName, + DeploymentResourceProperties properties) { + return beginUpdateAsync(resourceGroupName, serviceName, appName, deploymentName, properties).getSyncPoller(); + } + + /** + * Operation to update an exiting Deployment. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @param properties Deployment resource properties payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return deployment resource payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, DeploymentResourceInner> beginUpdate( + String resourceGroupName, + String serviceName, + String appName, + String deploymentName, + DeploymentResourceProperties properties, + Context context) { + return beginUpdateAsync(resourceGroupName, serviceName, appName, deploymentName, properties, context) + .getSyncPoller(); + } + + /** + * Operation to update an exiting Deployment. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @param properties Deployment resource properties payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return deployment resource payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono updateAsync( + String resourceGroupName, + String serviceName, + String appName, + String deploymentName, + DeploymentResourceProperties properties) { + return beginUpdateAsync(resourceGroupName, serviceName, appName, deploymentName, properties) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Operation to update an exiting Deployment. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @param properties Deployment resource properties payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return deployment resource payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono updateAsync( + String resourceGroupName, + String serviceName, + String appName, + String deploymentName, + DeploymentResourceProperties properties, + Context context) { + return beginUpdateAsync(resourceGroupName, serviceName, appName, deploymentName, properties, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Operation to update an exiting Deployment. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @param properties Deployment resource properties payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return deployment resource payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DeploymentResourceInner update( + String resourceGroupName, + String serviceName, + String appName, + String deploymentName, + DeploymentResourceProperties properties) { + return updateAsync(resourceGroupName, serviceName, appName, deploymentName, properties).block(); + } + + /** + * Operation to update an exiting Deployment. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @param properties Deployment resource properties payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return deployment resource payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DeploymentResourceInner update( + String resourceGroupName, + String serviceName, + String appName, + String deploymentName, + DeploymentResourceProperties properties, + Context context) { + return updateAsync(resourceGroupName, serviceName, appName, deploymentName, properties, context).block(); + } + + /** + * Handles requests to list all resources in an App. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param version Array of Get5ItemsItem. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of App resources and a possible link for next set. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listSinglePageAsync( + String resourceGroupName, String serviceName, String appName, List version) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (appName == null) { + return Mono.error(new IllegalArgumentException("Parameter appName is required and cannot be null.")); + } + String versionConverted = + JacksonAdapter.createDefaultSerializerAdapter().serializeList(version, CollectionFormat.CSV); + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + appName, + versionConverted, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Handles requests to list all resources in an App. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param version Array of Get5ItemsItem. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of App resources and a possible link for next set. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listSinglePageAsync( + String resourceGroupName, String serviceName, String appName, List version, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (appName == null) { + return Mono.error(new IllegalArgumentException("Parameter appName is required and cannot be null.")); + } + String versionConverted = + JacksonAdapter.createDefaultSerializerAdapter().serializeList(version, CollectionFormat.CSV); + return service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + appName, + versionConverted, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Handles requests to list all resources in an App. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param version Array of Get5ItemsItem. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of App resources and a possible link for next set. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listAsync( + String resourceGroupName, String serviceName, String appName, List version) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, serviceName, appName, version), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Handles requests to list all resources in an App. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param version Array of Get5ItemsItem. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of App resources and a possible link for next set. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listAsync( + String resourceGroupName, String serviceName, String appName, List version, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, serviceName, appName, version, context), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Handles requests to list all resources in an App. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of App resources and a possible link for next set. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listAsync(String resourceGroupName, String serviceName, String appName) { + final List version = null; + final Context context = null; + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, serviceName, appName, version), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Handles requests to list all resources in an App. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param version Array of Get5ItemsItem. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of App resources and a possible link for next set. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String serviceName, String appName, List version) { + return new PagedIterable<>(listAsync(resourceGroupName, serviceName, appName, version)); + } + + /** + * Handles requests to list all resources in an App. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param version Array of Get5ItemsItem. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of App resources and a possible link for next set. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String serviceName, String appName, List version, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, serviceName, appName, version, context)); + } + + /** + * Handles requests to list all resources in an App. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of App resources and a possible link for next set. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String serviceName, String appName) { + final List version = null; + final Context context = null; + return new PagedIterable<>(listAsync(resourceGroupName, serviceName, appName, version)); + } + + /** + * List deployments for a certain service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param version Array of Get4ItemsItem. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of App resources and a possible link for next set. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listClusterAllDeploymentsSinglePageAsync( + String resourceGroupName, String serviceName, List version) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + String versionConverted = + JacksonAdapter.createDefaultSerializerAdapter().serializeList(version, CollectionFormat.CSV); + return FluxUtil + .withContext( + context -> + service + .listClusterAllDeployments( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + versionConverted, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * List deployments for a certain service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param version Array of Get4ItemsItem. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of App resources and a possible link for next set. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listClusterAllDeploymentsSinglePageAsync( + String resourceGroupName, String serviceName, List version, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + String versionConverted = + JacksonAdapter.createDefaultSerializerAdapter().serializeList(version, CollectionFormat.CSV); + return service + .listClusterAllDeployments( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + versionConverted, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * List deployments for a certain service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param version Array of Get4ItemsItem. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of App resources and a possible link for next set. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listClusterAllDeploymentsAsync( + String resourceGroupName, String serviceName, List version) { + return new PagedFlux<>( + () -> listClusterAllDeploymentsSinglePageAsync(resourceGroupName, serviceName, version), + nextLink -> listClusterAllDeploymentsNextSinglePageAsync(nextLink)); + } + + /** + * List deployments for a certain service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param version Array of Get4ItemsItem. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of App resources and a possible link for next set. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listClusterAllDeploymentsAsync( + String resourceGroupName, String serviceName, List version, Context context) { + return new PagedFlux<>( + () -> listClusterAllDeploymentsSinglePageAsync(resourceGroupName, serviceName, version, context), + nextLink -> listClusterAllDeploymentsNextSinglePageAsync(nextLink)); + } + + /** + * List deployments for a certain service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of App resources and a possible link for next set. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listClusterAllDeploymentsAsync( + String resourceGroupName, String serviceName) { + final List version = null; + final Context context = null; + return new PagedFlux<>( + () -> listClusterAllDeploymentsSinglePageAsync(resourceGroupName, serviceName, version), + nextLink -> listClusterAllDeploymentsNextSinglePageAsync(nextLink)); + } + + /** + * List deployments for a certain service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param version Array of Get4ItemsItem. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of App resources and a possible link for next set. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listClusterAllDeployments( + String resourceGroupName, String serviceName, List version) { + return new PagedIterable<>(listClusterAllDeploymentsAsync(resourceGroupName, serviceName, version)); + } + + /** + * List deployments for a certain service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param version Array of Get4ItemsItem. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of App resources and a possible link for next set. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listClusterAllDeployments( + String resourceGroupName, String serviceName, List version, Context context) { + return new PagedIterable<>(listClusterAllDeploymentsAsync(resourceGroupName, serviceName, version, context)); + } + + /** + * List deployments for a certain service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of App resources and a possible link for next set. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listClusterAllDeployments( + String resourceGroupName, String serviceName) { + final List version = null; + final Context context = null; + return new PagedIterable<>(listClusterAllDeploymentsAsync(resourceGroupName, serviceName, version)); + } + + /** + * Start the deployment. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono>> startWithResponseAsync( + String resourceGroupName, String serviceName, String appName, String deploymentName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (appName == null) { + return Mono.error(new IllegalArgumentException("Parameter appName is required and cannot be null.")); + } + if (deploymentName == null) { + return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); + } + return FluxUtil + .withContext( + context -> + service + .start( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + appName, + deploymentName, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Start the deployment. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono>> startWithResponseAsync( + String resourceGroupName, String serviceName, String appName, String deploymentName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (appName == null) { + return Mono.error(new IllegalArgumentException("Parameter appName is required and cannot be null.")); + } + if (deploymentName == null) { + return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); + } + return service + .start( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + appName, + deploymentName, + context); + } + + /** + * Start the deployment. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PollerFlux, Void> beginStartAsync( + String resourceGroupName, String serviceName, String appName, String deploymentName) { + Mono>> mono = + startWithResponseAsync(resourceGroupName, serviceName, appName, deploymentName); + return this.client.getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class); + } + + /** + * Start the deployment. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PollerFlux, Void> beginStartAsync( + String resourceGroupName, String serviceName, String appName, String deploymentName, Context context) { + Mono>> mono = + startWithResponseAsync(resourceGroupName, serviceName, appName, deploymentName, context); + return this.client.getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class); + } + + /** + * Start the deployment. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginStart( + String resourceGroupName, String serviceName, String appName, String deploymentName) { + return beginStartAsync(resourceGroupName, serviceName, appName, deploymentName).getSyncPoller(); + } + + /** + * Start the deployment. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginStart( + String resourceGroupName, String serviceName, String appName, String deploymentName, Context context) { + return beginStartAsync(resourceGroupName, serviceName, appName, deploymentName, context).getSyncPoller(); + } + + /** + * Start the deployment. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono startAsync(String resourceGroupName, String serviceName, String appName, String deploymentName) { + return beginStartAsync(resourceGroupName, serviceName, appName, deploymentName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Start the deployment. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono startAsync( + String resourceGroupName, String serviceName, String appName, String deploymentName, Context context) { + return beginStartAsync(resourceGroupName, serviceName, appName, deploymentName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Start the deployment. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void start(String resourceGroupName, String serviceName, String appName, String deploymentName) { + startAsync(resourceGroupName, serviceName, appName, deploymentName).block(); + } + + /** + * Start the deployment. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void start( + String resourceGroupName, String serviceName, String appName, String deploymentName, Context context) { + startAsync(resourceGroupName, serviceName, appName, deploymentName, context).block(); + } + + /** + * Stop the deployment. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono>> stopWithResponseAsync( + String resourceGroupName, String serviceName, String appName, String deploymentName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (appName == null) { + return Mono.error(new IllegalArgumentException("Parameter appName is required and cannot be null.")); + } + if (deploymentName == null) { + return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); + } + return FluxUtil + .withContext( + context -> + service + .stop( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + appName, + deploymentName, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Stop the deployment. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono>> stopWithResponseAsync( + String resourceGroupName, String serviceName, String appName, String deploymentName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (appName == null) { + return Mono.error(new IllegalArgumentException("Parameter appName is required and cannot be null.")); + } + if (deploymentName == null) { + return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); + } + return service + .stop( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + appName, + deploymentName, + context); + } + + /** + * Stop the deployment. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PollerFlux, Void> beginStopAsync( + String resourceGroupName, String serviceName, String appName, String deploymentName) { + Mono>> mono = + stopWithResponseAsync(resourceGroupName, serviceName, appName, deploymentName); + return this.client.getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class); + } + + /** + * Stop the deployment. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PollerFlux, Void> beginStopAsync( + String resourceGroupName, String serviceName, String appName, String deploymentName, Context context) { + Mono>> mono = + stopWithResponseAsync(resourceGroupName, serviceName, appName, deploymentName, context); + return this.client.getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class); + } + + /** + * Stop the deployment. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginStop( + String resourceGroupName, String serviceName, String appName, String deploymentName) { + return beginStopAsync(resourceGroupName, serviceName, appName, deploymentName).getSyncPoller(); + } + + /** + * Stop the deployment. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginStop( + String resourceGroupName, String serviceName, String appName, String deploymentName, Context context) { + return beginStopAsync(resourceGroupName, serviceName, appName, deploymentName, context).getSyncPoller(); + } + + /** + * Stop the deployment. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono stopAsync(String resourceGroupName, String serviceName, String appName, String deploymentName) { + return beginStopAsync(resourceGroupName, serviceName, appName, deploymentName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Stop the deployment. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono stopAsync( + String resourceGroupName, String serviceName, String appName, String deploymentName, Context context) { + return beginStopAsync(resourceGroupName, serviceName, appName, deploymentName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Stop the deployment. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void stop(String resourceGroupName, String serviceName, String appName, String deploymentName) { + stopAsync(resourceGroupName, serviceName, appName, deploymentName).block(); + } + + /** + * Stop the deployment. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void stop( + String resourceGroupName, String serviceName, String appName, String deploymentName, Context context) { + stopAsync(resourceGroupName, serviceName, appName, deploymentName, context).block(); + } + + /** + * Restart the deployment. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono>> restartWithResponseAsync( + String resourceGroupName, String serviceName, String appName, String deploymentName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (appName == null) { + return Mono.error(new IllegalArgumentException("Parameter appName is required and cannot be null.")); + } + if (deploymentName == null) { + return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); + } + return FluxUtil + .withContext( + context -> + service + .restart( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + appName, + deploymentName, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Restart the deployment. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono>> restartWithResponseAsync( + String resourceGroupName, String serviceName, String appName, String deploymentName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (appName == null) { + return Mono.error(new IllegalArgumentException("Parameter appName is required and cannot be null.")); + } + if (deploymentName == null) { + return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); + } + return service + .restart( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + appName, + deploymentName, + context); + } + + /** + * Restart the deployment. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PollerFlux, Void> beginRestartAsync( + String resourceGroupName, String serviceName, String appName, String deploymentName) { + Mono>> mono = + restartWithResponseAsync(resourceGroupName, serviceName, appName, deploymentName); + return this.client.getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class); + } + + /** + * Restart the deployment. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PollerFlux, Void> beginRestartAsync( + String resourceGroupName, String serviceName, String appName, String deploymentName, Context context) { + Mono>> mono = + restartWithResponseAsync(resourceGroupName, serviceName, appName, deploymentName, context); + return this.client.getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class); + } + + /** + * Restart the deployment. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginRestart( + String resourceGroupName, String serviceName, String appName, String deploymentName) { + return beginRestartAsync(resourceGroupName, serviceName, appName, deploymentName).getSyncPoller(); + } + + /** + * Restart the deployment. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginRestart( + String resourceGroupName, String serviceName, String appName, String deploymentName, Context context) { + return beginRestartAsync(resourceGroupName, serviceName, appName, deploymentName, context).getSyncPoller(); + } + + /** + * Restart the deployment. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono restartAsync( + String resourceGroupName, String serviceName, String appName, String deploymentName) { + return beginRestartAsync(resourceGroupName, serviceName, appName, deploymentName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Restart the deployment. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono restartAsync( + String resourceGroupName, String serviceName, String appName, String deploymentName, Context context) { + return beginRestartAsync(resourceGroupName, serviceName, appName, deploymentName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Restart the deployment. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void restart(String resourceGroupName, String serviceName, String appName, String deploymentName) { + restartAsync(resourceGroupName, serviceName, appName, deploymentName).block(); + } + + /** + * Restart the deployment. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void restart( + String resourceGroupName, String serviceName, String appName, String deploymentName, Context context) { + restartAsync(resourceGroupName, serviceName, appName, deploymentName, context).block(); + } + + /** + * Get deployment log file URL. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return deployment log file URL. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getLogFileUrlWithResponseAsync( + String resourceGroupName, String serviceName, String appName, String deploymentName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (appName == null) { + return Mono.error(new IllegalArgumentException("Parameter appName is required and cannot be null.")); + } + if (deploymentName == null) { + return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); + } + return FluxUtil + .withContext( + context -> + service + .getLogFileUrl( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + appName, + deploymentName, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get deployment log file URL. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return deployment log file URL. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getLogFileUrlWithResponseAsync( + String resourceGroupName, String serviceName, String appName, String deploymentName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (appName == null) { + return Mono.error(new IllegalArgumentException("Parameter appName is required and cannot be null.")); + } + if (deploymentName == null) { + return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); + } + return service + .getLogFileUrl( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + appName, + deploymentName, + context); + } + + /** + * Get deployment log file URL. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return deployment log file URL. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getLogFileUrlAsync( + String resourceGroupName, String serviceName, String appName, String deploymentName) { + return getLogFileUrlWithResponseAsync(resourceGroupName, serviceName, appName, deploymentName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get deployment log file URL. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return deployment log file URL. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getLogFileUrlAsync( + String resourceGroupName, String serviceName, String appName, String deploymentName, Context context) { + return getLogFileUrlWithResponseAsync(resourceGroupName, serviceName, appName, deploymentName, context) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get deployment log file URL. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return deployment log file URL. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public LogFileUrlResponseInner getLogFileUrl( + String resourceGroupName, String serviceName, String appName, String deploymentName) { + return getLogFileUrlAsync(resourceGroupName, serviceName, appName, deploymentName).block(); + } + + /** + * Get deployment log file URL. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return deployment log file URL. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public LogFileUrlResponseInner getLogFileUrl( + String resourceGroupName, String serviceName, String appName, String deploymentName, Context context) { + return getLogFileUrlAsync(resourceGroupName, serviceName, appName, deploymentName, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of App resources and a possible link for next set. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + return FluxUtil + .withContext(context -> service.listNext(nextLink, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of App resources and a possible link for next set. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + return service + .listNext(nextLink, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of App resources and a possible link for next set. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listClusterAllDeploymentsNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + return FluxUtil + .withContext(context -> service.listClusterAllDeploymentsNext(nextLink, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of App resources and a possible link for next set. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listClusterAllDeploymentsNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + return service + .listClusterAllDeploymentsNext(nextLink, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/fluent/OperationsClient.java b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/fluent/OperationsClient.java new file mode 100644 index 0000000000000..3b81c594d1dfc --- /dev/null +++ b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/fluent/OperationsClient.java @@ -0,0 +1,242 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.fluent; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.appplatform.AppPlatformManagementClient; +import com.azure.resourcemanager.appplatform.fluent.inner.AvailableOperationsInner; +import com.azure.resourcemanager.appplatform.fluent.inner.OperationDetailInner; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in Operations. */ +public final class OperationsClient { + private final ClientLogger logger = new ClientLogger(OperationsClient.class); + + /** The proxy service used to perform REST calls. */ + private final OperationsService service; + + /** The service client containing this operation class. */ + private final AppPlatformManagementClient client; + + /** + * Initializes an instance of OperationsClient. + * + * @param client the instance of the service client containing this operation class. + */ + public OperationsClient(AppPlatformManagementClient client) { + this.service = + RestProxy.create(OperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AppPlatformManagementClientOperations to be used by the proxy service + * to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AppPlatformManagemen") + private interface OperationsService { + @Headers({"Accept: application/json", "Content-Type: application/json"}) + @Get("/providers/Microsoft.AppPlatform/operations") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, Context context); + + @Headers({"Accept: application/json", "Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, Context context); + } + + /** + * Lists all of the available REST API operations of the Microsoft.AppPlatform provider. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return available operations of the service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Lists all of the available REST API operations of the Microsoft.AppPlatform provider. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return available operations of the service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + return service + .list(this.client.getEndpoint(), this.client.getApiVersion(), context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all of the available REST API operations of the Microsoft.AppPlatform provider. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return available operations of the service. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists all of the available REST API operations of the Microsoft.AppPlatform provider. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return available operations of the service. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listAsync(Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists all of the available REST API operations of the Microsoft.AppPlatform provider. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return available operations of the service. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Lists all of the available REST API operations of the Microsoft.AppPlatform provider. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return available operations of the service. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return available operations of the service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + return FluxUtil + .withContext(context -> service.listNext(nextLink, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return available operations of the service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + return service + .listNext(nextLink, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/fluent/ServicesClient.java b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/fluent/ServicesClient.java new file mode 100644 index 0000000000000..9f9648f56e3f7 --- /dev/null +++ b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/fluent/ServicesClient.java @@ -0,0 +1,2432 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.fluent; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.appplatform.AppPlatformManagementClient; +import com.azure.resourcemanager.appplatform.fluent.inner.NameAvailabilityInner; +import com.azure.resourcemanager.appplatform.fluent.inner.ServiceResourceInner; +import com.azure.resourcemanager.appplatform.fluent.inner.ServiceResourceListInner; +import com.azure.resourcemanager.appplatform.models.NameAvailabilityParameters; +import com.azure.resourcemanager.appplatform.models.RegenerateTestKeyRequestPayload; +import com.azure.resourcemanager.appplatform.models.TestKeyType; +import com.azure.resourcemanager.appplatform.models.TestKeys; +import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsDelete; +import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsGet; +import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsListing; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in Services. */ +public final class ServicesClient + implements InnerSupportsGet, + InnerSupportsListing, + InnerSupportsDelete { + private final ClientLogger logger = new ClientLogger(ServicesClient.class); + + /** The proxy service used to perform REST calls. */ + private final ServicesService service; + + /** The service client containing this operation class. */ + private final AppPlatformManagementClient client; + + /** + * Initializes an instance of ServicesClient. + * + * @param client the instance of the service client containing this operation class. + */ + public ServicesClient(AppPlatformManagementClient client) { + this.service = RestProxy.create(ServicesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AppPlatformManagementClientServices to be used by the proxy service + * to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AppPlatformManagemen") + private interface ServicesService { + @Headers({"Accept: application/json", "Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring" + + "/{serviceName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + Context context); + + @Headers({"Accept: application/json", "Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring" + + "/{serviceName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @BodyParam("application/json") ServiceResourceInner resource, + Context context); + + @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring" + + "/{serviceName}") + @ExpectedResponses({202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + Context context); + + @Headers({"Accept: application/json", "Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring" + + "/{serviceName}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @BodyParam("application/json") ServiceResourceInner resource, + Context context); + + @Headers({"Accept: application/json", "Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring" + + "/{serviceName}/listTestKeys") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listTestKeys( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + Context context); + + @Headers({"Accept: application/json", "Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring" + + "/{serviceName}/regenerateTestKey") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> regenerateTestKey( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @BodyParam("application/json") RegenerateTestKeyRequestPayload regenerateTestKeyRequest, + Context context); + + @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring" + + "/{serviceName}/disableTestEndpoint") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> disableTestEndpoint( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + Context context); + + @Headers({"Accept: application/json", "Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring" + + "/{serviceName}/enableTestEndpoint") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> enableTestEndpoint( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + Context context); + + @Headers({"Accept: application/json", "Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/providers/Microsoft.AppPlatform/locations/{location}" + + "/checkNameAvailability") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> checkNameAvailability( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("location") String location, + @BodyParam("application/json") NameAvailabilityParameters availabilityParameters, + Context context); + + @Headers({"Accept: application/json", "Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.AppPlatform/Spring") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + Context context); + + @Headers({"Accept: application/json", "Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + Context context); + + @Headers({"Accept: application/json", "Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, Context context); + + @Headers({"Accept: application/json", "Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, Context context); + } + + /** + * Get a Service and its properties. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Service and its properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String serviceName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + return FluxUtil + .withContext( + context -> + service + .getByResourceGroup( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get a Service and its properties. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Service and its properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String serviceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + return service + .getByResourceGroup( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + context); + } + + /** + * Get a Service and its properties. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Service and its properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getByResourceGroupAsync(String resourceGroupName, String serviceName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, serviceName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get a Service and its properties. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Service and its properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getByResourceGroupAsync( + String resourceGroupName, String serviceName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, serviceName, context) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get a Service and its properties. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Service and its properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ServiceResourceInner getByResourceGroup(String resourceGroupName, String serviceName) { + return getByResourceGroupAsync(resourceGroupName, serviceName).block(); + } + + /** + * Get a Service and its properties. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Service and its properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ServiceResourceInner getByResourceGroup(String resourceGroupName, String serviceName, Context context) { + return getByResourceGroupAsync(resourceGroupName, serviceName, context).block(); + } + + /** + * Create a new Service or update an exiting Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param resource Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return service resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String serviceName, ServiceResourceInner resource) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + resource, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Create a new Service or update an exiting Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param resource Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return service resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String serviceName, ServiceResourceInner resource, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + resource, + context); + } + + /** + * Create a new Service or update an exiting Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param resource Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return service resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PollerFlux, ServiceResourceInner> beginCreateOrUpdateAsync( + String resourceGroupName, String serviceName, ServiceResourceInner resource) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, serviceName, resource); + return this + .client + .getLroResultAsync( + mono, this.client.getHttpPipeline(), ServiceResourceInner.class, ServiceResourceInner.class); + } + + /** + * Create a new Service or update an exiting Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param resource Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return service resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PollerFlux, ServiceResourceInner> beginCreateOrUpdateAsync( + String resourceGroupName, String serviceName, ServiceResourceInner resource, Context context) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, serviceName, resource, context); + return this + .client + .getLroResultAsync( + mono, this.client.getHttpPipeline(), ServiceResourceInner.class, ServiceResourceInner.class); + } + + /** + * Create a new Service or update an exiting Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param resource Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return service resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, ServiceResourceInner> beginCreateOrUpdate( + String resourceGroupName, String serviceName, ServiceResourceInner resource) { + return beginCreateOrUpdateAsync(resourceGroupName, serviceName, resource).getSyncPoller(); + } + + /** + * Create a new Service or update an exiting Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param resource Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return service resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, ServiceResourceInner> beginCreateOrUpdate( + String resourceGroupName, String serviceName, ServiceResourceInner resource, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, serviceName, resource, context).getSyncPoller(); + } + + /** + * Create a new Service or update an exiting Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param resource Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return service resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono createOrUpdateAsync( + String resourceGroupName, String serviceName, ServiceResourceInner resource) { + return beginCreateOrUpdateAsync(resourceGroupName, serviceName, resource) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a new Service or update an exiting Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param resource Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return service resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono createOrUpdateAsync( + String resourceGroupName, String serviceName, ServiceResourceInner resource, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, serviceName, resource, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a new Service or update an exiting Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param resource Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return service resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ServiceResourceInner createOrUpdate( + String resourceGroupName, String serviceName, ServiceResourceInner resource) { + return createOrUpdateAsync(resourceGroupName, serviceName, resource).block(); + } + + /** + * Create a new Service or update an exiting Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param resource Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return service resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ServiceResourceInner createOrUpdate( + String resourceGroupName, String serviceName, ServiceResourceInner resource, Context context) { + return createOrUpdateAsync(resourceGroupName, serviceName, resource, context).block(); + } + + /** + * Operation to delete a Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono>> deleteWithResponseAsync(String resourceGroupName, String serviceName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Operation to delete a Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono>> deleteWithResponseAsync( + String resourceGroupName, String serviceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + return service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + context); + } + + /** + * Operation to delete a Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String serviceName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, serviceName); + return this.client.getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class); + } + + /** + * Operation to delete a Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String serviceName, Context context) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, serviceName, context); + return this.client.getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class); + } + + /** + * Operation to delete a Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete(String resourceGroupName, String serviceName) { + return beginDeleteAsync(resourceGroupName, serviceName).getSyncPoller(); + } + + /** + * Operation to delete a Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String serviceName, Context context) { + return beginDeleteAsync(resourceGroupName, serviceName, context).getSyncPoller(); + } + + /** + * Operation to delete a Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono deleteAsync(String resourceGroupName, String serviceName) { + return beginDeleteAsync(resourceGroupName, serviceName).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Operation to delete a Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono deleteAsync(String resourceGroupName, String serviceName, Context context) { + return beginDeleteAsync(resourceGroupName, serviceName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Operation to delete a Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String serviceName) { + deleteAsync(resourceGroupName, serviceName).block(); + } + + /** + * Operation to delete a Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String serviceName, Context context) { + deleteAsync(resourceGroupName, serviceName, context).block(); + } + + /** + * Operation to update an exiting Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param resource Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return service resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono>> updateWithResponseAsync( + String resourceGroupName, String serviceName, ServiceResourceInner resource) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + resource, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Operation to update an exiting Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param resource Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return service resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono>> updateWithResponseAsync( + String resourceGroupName, String serviceName, ServiceResourceInner resource, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + return service + .update( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + resource, + context); + } + + /** + * Operation to update an exiting Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param resource Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return service resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PollerFlux, ServiceResourceInner> beginUpdateAsync( + String resourceGroupName, String serviceName, ServiceResourceInner resource) { + Mono>> mono = updateWithResponseAsync(resourceGroupName, serviceName, resource); + return this + .client + .getLroResultAsync( + mono, this.client.getHttpPipeline(), ServiceResourceInner.class, ServiceResourceInner.class); + } + + /** + * Operation to update an exiting Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param resource Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return service resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PollerFlux, ServiceResourceInner> beginUpdateAsync( + String resourceGroupName, String serviceName, ServiceResourceInner resource, Context context) { + Mono>> mono = + updateWithResponseAsync(resourceGroupName, serviceName, resource, context); + return this + .client + .getLroResultAsync( + mono, this.client.getHttpPipeline(), ServiceResourceInner.class, ServiceResourceInner.class); + } + + /** + * Operation to update an exiting Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param resource Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return service resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, ServiceResourceInner> beginUpdate( + String resourceGroupName, String serviceName, ServiceResourceInner resource) { + return beginUpdateAsync(resourceGroupName, serviceName, resource).getSyncPoller(); + } + + /** + * Operation to update an exiting Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param resource Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return service resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, ServiceResourceInner> beginUpdate( + String resourceGroupName, String serviceName, ServiceResourceInner resource, Context context) { + return beginUpdateAsync(resourceGroupName, serviceName, resource, context).getSyncPoller(); + } + + /** + * Operation to update an exiting Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param resource Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return service resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono updateAsync( + String resourceGroupName, String serviceName, ServiceResourceInner resource) { + return beginUpdateAsync(resourceGroupName, serviceName, resource) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Operation to update an exiting Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param resource Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return service resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono updateAsync( + String resourceGroupName, String serviceName, ServiceResourceInner resource, Context context) { + return beginUpdateAsync(resourceGroupName, serviceName, resource, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Operation to update an exiting Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param resource Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return service resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ServiceResourceInner update(String resourceGroupName, String serviceName, ServiceResourceInner resource) { + return updateAsync(resourceGroupName, serviceName, resource).block(); + } + + /** + * Operation to update an exiting Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param resource Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return service resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ServiceResourceInner update( + String resourceGroupName, String serviceName, ServiceResourceInner resource, Context context) { + return updateAsync(resourceGroupName, serviceName, resource, context).block(); + } + + /** + * List test keys for a Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return test keys payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listTestKeysWithResponseAsync(String resourceGroupName, String serviceName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + return FluxUtil + .withContext( + context -> + service + .listTestKeys( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * List test keys for a Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return test keys payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listTestKeysWithResponseAsync( + String resourceGroupName, String serviceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + return service + .listTestKeys( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + context); + } + + /** + * List test keys for a Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return test keys payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono listTestKeysAsync(String resourceGroupName, String serviceName) { + return listTestKeysWithResponseAsync(resourceGroupName, serviceName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * List test keys for a Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return test keys payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono listTestKeysAsync(String resourceGroupName, String serviceName, Context context) { + return listTestKeysWithResponseAsync(resourceGroupName, serviceName, context) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * List test keys for a Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return test keys payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public TestKeys listTestKeys(String resourceGroupName, String serviceName) { + return listTestKeysAsync(resourceGroupName, serviceName).block(); + } + + /** + * List test keys for a Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return test keys payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public TestKeys listTestKeys(String resourceGroupName, String serviceName, Context context) { + return listTestKeysAsync(resourceGroupName, serviceName, context).block(); + } + + /** + * Regenerate a test key for a Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param keyType Type of the test key. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return test keys payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> regenerateTestKeyWithResponseAsync( + String resourceGroupName, String serviceName, TestKeyType keyType) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (keyType == null) { + return Mono.error(new IllegalArgumentException("Parameter keyType is required and cannot be null.")); + } + RegenerateTestKeyRequestPayload regenerateTestKeyRequest = new RegenerateTestKeyRequestPayload(); + regenerateTestKeyRequest.withKeyType(keyType); + return FluxUtil + .withContext( + context -> + service + .regenerateTestKey( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + regenerateTestKeyRequest, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Regenerate a test key for a Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param keyType Type of the test key. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return test keys payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> regenerateTestKeyWithResponseAsync( + String resourceGroupName, String serviceName, TestKeyType keyType, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (keyType == null) { + return Mono.error(new IllegalArgumentException("Parameter keyType is required and cannot be null.")); + } + RegenerateTestKeyRequestPayload regenerateTestKeyRequest = new RegenerateTestKeyRequestPayload(); + regenerateTestKeyRequest.withKeyType(keyType); + return service + .regenerateTestKey( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + regenerateTestKeyRequest, + context); + } + + /** + * Regenerate a test key for a Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param keyType Type of the test key. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return test keys payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono regenerateTestKeyAsync(String resourceGroupName, String serviceName, TestKeyType keyType) { + return regenerateTestKeyWithResponseAsync(resourceGroupName, serviceName, keyType) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Regenerate a test key for a Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param keyType Type of the test key. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return test keys payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono regenerateTestKeyAsync( + String resourceGroupName, String serviceName, TestKeyType keyType, Context context) { + return regenerateTestKeyWithResponseAsync(resourceGroupName, serviceName, keyType, context) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Regenerate a test key for a Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param keyType Type of the test key. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return test keys payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public TestKeys regenerateTestKey(String resourceGroupName, String serviceName, TestKeyType keyType) { + return regenerateTestKeyAsync(resourceGroupName, serviceName, keyType).block(); + } + + /** + * Regenerate a test key for a Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param keyType Type of the test key. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return test keys payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public TestKeys regenerateTestKey( + String resourceGroupName, String serviceName, TestKeyType keyType, Context context) { + return regenerateTestKeyAsync(resourceGroupName, serviceName, keyType, context).block(); + } + + /** + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> disableTestEndpointWithResponseAsync(String resourceGroupName, String serviceName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + return FluxUtil + .withContext( + context -> + service + .disableTestEndpoint( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> disableTestEndpointWithResponseAsync( + String resourceGroupName, String serviceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + return service + .disableTestEndpoint( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + context); + } + + /** + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono disableTestEndpointAsync(String resourceGroupName, String serviceName) { + return disableTestEndpointWithResponseAsync(resourceGroupName, serviceName) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono disableTestEndpointAsync(String resourceGroupName, String serviceName, Context context) { + return disableTestEndpointWithResponseAsync(resourceGroupName, serviceName, context) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void disableTestEndpoint(String resourceGroupName, String serviceName) { + disableTestEndpointAsync(resourceGroupName, serviceName).block(); + } + + /** + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void disableTestEndpoint(String resourceGroupName, String serviceName, Context context) { + disableTestEndpointAsync(resourceGroupName, serviceName, context).block(); + } + + /** + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return test keys payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> enableTestEndpointWithResponseAsync(String resourceGroupName, String serviceName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + return FluxUtil + .withContext( + context -> + service + .enableTestEndpoint( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return test keys payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> enableTestEndpointWithResponseAsync( + String resourceGroupName, String serviceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + return service + .enableTestEndpoint( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + context); + } + + /** + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return test keys payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono enableTestEndpointAsync(String resourceGroupName, String serviceName) { + return enableTestEndpointWithResponseAsync(resourceGroupName, serviceName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return test keys payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono enableTestEndpointAsync(String resourceGroupName, String serviceName, Context context) { + return enableTestEndpointWithResponseAsync(resourceGroupName, serviceName, context) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return test keys payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public TestKeys enableTestEndpoint(String resourceGroupName, String serviceName) { + return enableTestEndpointAsync(resourceGroupName, serviceName).block(); + } + + /** + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return test keys payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public TestKeys enableTestEndpoint(String resourceGroupName, String serviceName, Context context) { + return enableTestEndpointAsync(resourceGroupName, serviceName, context).block(); + } + + /** + * Checks that the resource name is valid and is not already in use. + * + * @param location the region. + * @param availabilityParameters Name availability parameters payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return name availability result payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> checkNameAvailabilityWithResponseAsync( + String location, NameAvailabilityParameters availabilityParameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + if (availabilityParameters == null) { + return Mono + .error( + new IllegalArgumentException("Parameter availabilityParameters is required and cannot be null.")); + } else { + availabilityParameters.validate(); + } + return FluxUtil + .withContext( + context -> + service + .checkNameAvailability( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + location, + availabilityParameters, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Checks that the resource name is valid and is not already in use. + * + * @param location the region. + * @param availabilityParameters Name availability parameters payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return name availability result payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> checkNameAvailabilityWithResponseAsync( + String location, NameAvailabilityParameters availabilityParameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + if (availabilityParameters == null) { + return Mono + .error( + new IllegalArgumentException("Parameter availabilityParameters is required and cannot be null.")); + } else { + availabilityParameters.validate(); + } + return service + .checkNameAvailability( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + location, + availabilityParameters, + context); + } + + /** + * Checks that the resource name is valid and is not already in use. + * + * @param location the region. + * @param availabilityParameters Name availability parameters payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return name availability result payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono checkNameAvailabilityAsync( + String location, NameAvailabilityParameters availabilityParameters) { + return checkNameAvailabilityWithResponseAsync(location, availabilityParameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Checks that the resource name is valid and is not already in use. + * + * @param location the region. + * @param availabilityParameters Name availability parameters payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return name availability result payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono checkNameAvailabilityAsync( + String location, NameAvailabilityParameters availabilityParameters, Context context) { + return checkNameAvailabilityWithResponseAsync(location, availabilityParameters, context) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Checks that the resource name is valid and is not already in use. + * + * @param location the region. + * @param availabilityParameters Name availability parameters payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return name availability result payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NameAvailabilityInner checkNameAvailability( + String location, NameAvailabilityParameters availabilityParameters) { + return checkNameAvailabilityAsync(location, availabilityParameters).block(); + } + + /** + * Checks that the resource name is valid and is not already in use. + * + * @param location the region. + * @param availabilityParameters Name availability parameters payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return name availability result payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NameAvailabilityInner checkNameAvailability( + String location, NameAvailabilityParameters availabilityParameters, Context context) { + return checkNameAvailabilityAsync(location, availabilityParameters, context).block(); + } + + /** + * Handles requests to list all resources in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of Service resources and a possible link for next set. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Handles requests to list all resources in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of Service resources and a possible link for next set. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + return service + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Handles requests to list all resources in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of Service resources and a possible link for next set. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listAsync() { + return new PagedFlux<>( + () -> listSinglePageAsync(), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * Handles requests to list all resources in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of Service resources and a possible link for next set. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * Handles requests to list all resources in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of Service resources and a possible link for next set. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Handles requests to list all resources in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of Service resources and a possible link for next set. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Handles requests to list all resources in a resource group. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of Service resources and a possible link for next set. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + return FluxUtil + .withContext( + context -> + service + .listByResourceGroup( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Handles requests to list all resources in a resource group. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of Service resources and a possible link for next set. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listByResourceGroupSinglePageAsync( + String resourceGroupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + return service + .listByResourceGroup( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Handles requests to list all resources in a resource group. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of Service resources and a possible link for next set. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Handles requests to list all resources in a resource group. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of Service resources and a possible link for next set. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Handles requests to list all resources in a resource group. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of Service resources and a possible link for next set. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * Handles requests to list all resources in a resource group. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of Service resources and a possible link for next set. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of Service resources and a possible link for next set. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + return FluxUtil + .withContext(context -> service.listBySubscriptionNext(nextLink, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of Service resources and a possible link for next set. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listBySubscriptionNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + return service + .listBySubscriptionNext(nextLink, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of Service resources and a possible link for next set. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + return FluxUtil + .withContext(context -> service.listNext(nextLink, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of Service resources and a possible link for next set. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + return service + .listNext(nextLink, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/fluent/SkusClient.java b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/fluent/SkusClient.java new file mode 100644 index 0000000000000..30ebdec908c9d --- /dev/null +++ b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/fluent/SkusClient.java @@ -0,0 +1,251 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.fluent; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.appplatform.AppPlatformManagementClient; +import com.azure.resourcemanager.appplatform.fluent.inner.ResourceSkuCollectionInner; +import com.azure.resourcemanager.appplatform.models.ResourceSku; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in Skus. */ +public final class SkusClient { + private final ClientLogger logger = new ClientLogger(SkusClient.class); + + /** The proxy service used to perform REST calls. */ + private final SkusService service; + + /** The service client containing this operation class. */ + private final AppPlatformManagementClient client; + + /** + * Initializes an instance of SkusClient. + * + * @param client the instance of the service client containing this operation class. + */ + public SkusClient(AppPlatformManagementClient client) { + this.service = RestProxy.create(SkusService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AppPlatformManagementClientSkus to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AppPlatformManagemen") + private interface SkusService { + @Headers({"Accept: application/json", "Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.AppPlatform/skus") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + Context context); + + @Headers({"Accept: application/json", "Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, Context context); + } + + /** + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + return service + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listAsync(Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + return FluxUtil + .withContext(context -> service.listNext(nextLink, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + return service + .listNext(nextLink, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/fluent/inner/AppResourceCollectionInner.java b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/fluent/inner/AppResourceCollectionInner.java new file mode 100644 index 0000000000000..2f109d4979413 --- /dev/null +++ b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/fluent/inner/AppResourceCollectionInner.java @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.fluent.inner; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The AppResourceCollection model. */ +@Fluent +public final class AppResourceCollectionInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AppResourceCollectionInner.class); + + /* + * Collection of App resources + */ + @JsonProperty(value = "value") + private List value; + + /* + * URL client should use to fetch the next page (per server side paging). + * It's null for now, added for future use. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: Collection of App resources. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Collection of App resources. + * + * @param value the value value to set. + * @return the AppResourceCollectionInner object itself. + */ + public AppResourceCollectionInner withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: URL client should use to fetch the next page (per server side paging). It's null for + * now, added for future use. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: URL client should use to fetch the next page (per server side paging). It's null for + * now, added for future use. + * + * @param nextLink the nextLink value to set. + * @return the AppResourceCollectionInner object itself. + */ + public AppResourceCollectionInner withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/fluent/inner/AppResourceInner.java b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/fluent/inner/AppResourceInner.java new file mode 100644 index 0000000000000..f58db5c69ff15 --- /dev/null +++ b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/fluent/inner/AppResourceInner.java @@ -0,0 +1,112 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.fluent.inner; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.appplatform.models.AppResourceProperties; +import com.azure.resourcemanager.appplatform.models.ManagedIdentityProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The AppResource model. */ +@Fluent +public final class AppResourceInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AppResourceInner.class); + + /* + * Properties of the App resource + */ + @JsonProperty(value = "properties") + private AppResourceProperties properties; + + /* + * The Managed Identity type of the app resource + */ + @JsonProperty(value = "identity") + private ManagedIdentityProperties identity; + + /* + * The GEO location of the application, always the same with its parent + * resource + */ + @JsonProperty(value = "location") + private String location; + + /** + * Get the properties property: Properties of the App resource. + * + * @return the properties value. + */ + public AppResourceProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Properties of the App resource. + * + * @param properties the properties value to set. + * @return the AppResourceInner object itself. + */ + public AppResourceInner withProperties(AppResourceProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the identity property: The Managed Identity type of the app resource. + * + * @return the identity value. + */ + public ManagedIdentityProperties identity() { + return this.identity; + } + + /** + * Set the identity property: The Managed Identity type of the app resource. + * + * @param identity the identity value to set. + * @return the AppResourceInner object itself. + */ + public AppResourceInner withIdentity(ManagedIdentityProperties identity) { + this.identity = identity; + return this; + } + + /** + * Get the location property: The GEO location of the application, always the same with its parent resource. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Set the location property: The GEO location of the application, always the same with its parent resource. + * + * @param location the location value to set. + * @return the AppResourceInner object itself. + */ + public AppResourceInner withLocation(String location) { + this.location = location; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + if (identity() != null) { + identity().validate(); + } + } +} diff --git a/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/fluent/inner/AvailableOperationsInner.java b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/fluent/inner/AvailableOperationsInner.java new file mode 100644 index 0000000000000..67d4a6bb318a3 --- /dev/null +++ b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/fluent/inner/AvailableOperationsInner.java @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.fluent.inner; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The AvailableOperations model. */ +@Fluent +public final class AvailableOperationsInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AvailableOperationsInner.class); + + /* + * Collection of available operation details + */ + @JsonProperty(value = "value") + private List value; + + /* + * URL client should use to fetch the next page (per server side paging). + * It's null for now, added for future use. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: Collection of available operation details. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Collection of available operation details. + * + * @param value the value value to set. + * @return the AvailableOperationsInner object itself. + */ + public AvailableOperationsInner withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: URL client should use to fetch the next page (per server side paging). It's null for + * now, added for future use. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: URL client should use to fetch the next page (per server side paging). It's null for + * now, added for future use. + * + * @param nextLink the nextLink value to set. + * @return the AvailableOperationsInner object itself. + */ + public AvailableOperationsInner withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/fluent/inner/BindingResourceCollectionInner.java b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/fluent/inner/BindingResourceCollectionInner.java new file mode 100644 index 0000000000000..0df492b8aec31 --- /dev/null +++ b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/fluent/inner/BindingResourceCollectionInner.java @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.fluent.inner; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The BindingResourceCollection model. */ +@Fluent +public final class BindingResourceCollectionInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(BindingResourceCollectionInner.class); + + /* + * Collection of Binding resources + */ + @JsonProperty(value = "value") + private List value; + + /* + * URL client should use to fetch the next page (per server side paging). + * It's null for now, added for future use. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: Collection of Binding resources. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Collection of Binding resources. + * + * @param value the value value to set. + * @return the BindingResourceCollectionInner object itself. + */ + public BindingResourceCollectionInner withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: URL client should use to fetch the next page (per server side paging). It's null for + * now, added for future use. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: URL client should use to fetch the next page (per server side paging). It's null for + * now, added for future use. + * + * @param nextLink the nextLink value to set. + * @return the BindingResourceCollectionInner object itself. + */ + public BindingResourceCollectionInner withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/fluent/inner/BindingResourceInner.java b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/fluent/inner/BindingResourceInner.java new file mode 100644 index 0000000000000..8cb4e051a6ad4 --- /dev/null +++ b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/fluent/inner/BindingResourceInner.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.fluent.inner; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.appplatform.models.BindingResourceProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The BindingResource model. */ +@Fluent +public final class BindingResourceInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(BindingResourceInner.class); + + /* + * Properties of the Binding resource + */ + @JsonProperty(value = "properties") + private BindingResourceProperties properties; + + /** + * Get the properties property: Properties of the Binding resource. + * + * @return the properties value. + */ + public BindingResourceProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Properties of the Binding resource. + * + * @param properties the properties value to set. + * @return the BindingResourceInner object itself. + */ + public BindingResourceInner withProperties(BindingResourceProperties properties) { + this.properties = properties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } +} diff --git a/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/fluent/inner/CertificateResourceCollectionInner.java b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/fluent/inner/CertificateResourceCollectionInner.java new file mode 100644 index 0000000000000..364e824fb2a90 --- /dev/null +++ b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/fluent/inner/CertificateResourceCollectionInner.java @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.fluent.inner; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The CertificateResourceCollection model. */ +@Fluent +public final class CertificateResourceCollectionInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CertificateResourceCollectionInner.class); + + /* + * The certificate resources list. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The link to next page of certificate list. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: The certificate resources list. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The certificate resources list. + * + * @param value the value value to set. + * @return the CertificateResourceCollectionInner object itself. + */ + public CertificateResourceCollectionInner withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The link to next page of certificate list. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link to next page of certificate list. + * + * @param nextLink the nextLink value to set. + * @return the CertificateResourceCollectionInner object itself. + */ + public CertificateResourceCollectionInner withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/fluent/inner/CertificateResourceInner.java b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/fluent/inner/CertificateResourceInner.java new file mode 100644 index 0000000000000..d07a5ba613bf6 --- /dev/null +++ b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/fluent/inner/CertificateResourceInner.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.fluent.inner; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.appplatform.models.CertificateProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The CertificateResource model. */ +@Fluent +public final class CertificateResourceInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CertificateResourceInner.class); + + /* + * Properties of the certificate resource payload. + */ + @JsonProperty(value = "properties") + private CertificateProperties properties; + + /** + * Get the properties property: Properties of the certificate resource payload. + * + * @return the properties value. + */ + public CertificateProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Properties of the certificate resource payload. + * + * @param properties the properties value to set. + * @return the CertificateResourceInner object itself. + */ + public CertificateResourceInner withProperties(CertificateProperties properties) { + this.properties = properties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } +} diff --git a/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/fluent/inner/CustomDomainResourceCollectionInner.java b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/fluent/inner/CustomDomainResourceCollectionInner.java new file mode 100644 index 0000000000000..82118f638cec4 --- /dev/null +++ b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/fluent/inner/CustomDomainResourceCollectionInner.java @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.fluent.inner; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The CustomDomainResourceCollection model. */ +@Fluent +public final class CustomDomainResourceCollectionInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CustomDomainResourceCollectionInner.class); + + /* + * The custom domain resources list. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The link to next page of custom domain list. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: The custom domain resources list. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The custom domain resources list. + * + * @param value the value value to set. + * @return the CustomDomainResourceCollectionInner object itself. + */ + public CustomDomainResourceCollectionInner withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The link to next page of custom domain list. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link to next page of custom domain list. + * + * @param nextLink the nextLink value to set. + * @return the CustomDomainResourceCollectionInner object itself. + */ + public CustomDomainResourceCollectionInner withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/fluent/inner/CustomDomainResourceInner.java b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/fluent/inner/CustomDomainResourceInner.java new file mode 100644 index 0000000000000..8e8ccf3aeabe9 --- /dev/null +++ b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/fluent/inner/CustomDomainResourceInner.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.fluent.inner; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.appplatform.models.CustomDomainProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The CustomDomainResource model. */ +@Fluent +public final class CustomDomainResourceInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CustomDomainResourceInner.class); + + /* + * Properties of the custom domain resource. + */ + @JsonProperty(value = "properties") + private CustomDomainProperties properties; + + /** + * Get the properties property: Properties of the custom domain resource. + * + * @return the properties value. + */ + public CustomDomainProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Properties of the custom domain resource. + * + * @param properties the properties value to set. + * @return the CustomDomainResourceInner object itself. + */ + public CustomDomainResourceInner withProperties(CustomDomainProperties properties) { + this.properties = properties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } +} diff --git a/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/fluent/inner/CustomDomainValidateResultInner.java b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/fluent/inner/CustomDomainValidateResultInner.java new file mode 100644 index 0000000000000..321c7b235452f --- /dev/null +++ b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/fluent/inner/CustomDomainValidateResultInner.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.fluent.inner; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The CustomDomainValidateResult model. */ +@Fluent +public final class CustomDomainValidateResultInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CustomDomainValidateResultInner.class); + + /* + * Indicates if domain name is valid. + */ + @JsonProperty(value = "isValid") + private Boolean isValid; + + /* + * Message of why domain name is invalid. + */ + @JsonProperty(value = "message") + private String message; + + /** + * Get the isValid property: Indicates if domain name is valid. + * + * @return the isValid value. + */ + public Boolean isValid() { + return this.isValid; + } + + /** + * Set the isValid property: Indicates if domain name is valid. + * + * @param isValid the isValid value to set. + * @return the CustomDomainValidateResultInner object itself. + */ + public CustomDomainValidateResultInner withIsValid(Boolean isValid) { + this.isValid = isValid; + return this; + } + + /** + * Get the message property: Message of why domain name is invalid. + * + * @return the message value. + */ + public String message() { + return this.message; + } + + /** + * Set the message property: Message of why domain name is invalid. + * + * @param message the message value to set. + * @return the CustomDomainValidateResultInner object itself. + */ + public CustomDomainValidateResultInner withMessage(String message) { + this.message = message; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/fluent/inner/DeploymentResourceCollectionInner.java b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/fluent/inner/DeploymentResourceCollectionInner.java new file mode 100644 index 0000000000000..93b4a772bbcb8 --- /dev/null +++ b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/fluent/inner/DeploymentResourceCollectionInner.java @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.fluent.inner; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The DeploymentResourceCollection model. */ +@Fluent +public final class DeploymentResourceCollectionInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DeploymentResourceCollectionInner.class); + + /* + * Collection of Deployment resources + */ + @JsonProperty(value = "value") + private List value; + + /* + * URL client should use to fetch the next page (per server side paging). + * It's null for now, added for future use. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: Collection of Deployment resources. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Collection of Deployment resources. + * + * @param value the value value to set. + * @return the DeploymentResourceCollectionInner object itself. + */ + public DeploymentResourceCollectionInner withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: URL client should use to fetch the next page (per server side paging). It's null for + * now, added for future use. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: URL client should use to fetch the next page (per server side paging). It's null for + * now, added for future use. + * + * @param nextLink the nextLink value to set. + * @return the DeploymentResourceCollectionInner object itself. + */ + public DeploymentResourceCollectionInner withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/fluent/inner/DeploymentResourceInner.java b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/fluent/inner/DeploymentResourceInner.java new file mode 100644 index 0000000000000..8efd733bbbe2a --- /dev/null +++ b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/fluent/inner/DeploymentResourceInner.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.fluent.inner; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.appplatform.models.DeploymentResourceProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The DeploymentResource model. */ +@Fluent +public final class DeploymentResourceInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DeploymentResourceInner.class); + + /* + * Properties of the Deployment resource + */ + @JsonProperty(value = "properties") + private DeploymentResourceProperties properties; + + /** + * Get the properties property: Properties of the Deployment resource. + * + * @return the properties value. + */ + public DeploymentResourceProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Properties of the Deployment resource. + * + * @param properties the properties value to set. + * @return the DeploymentResourceInner object itself. + */ + public DeploymentResourceInner withProperties(DeploymentResourceProperties properties) { + this.properties = properties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } +} diff --git a/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/fluent/inner/LogFileUrlResponseInner.java b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/fluent/inner/LogFileUrlResponseInner.java new file mode 100644 index 0000000000000..f23bf3682238b --- /dev/null +++ b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/fluent/inner/LogFileUrlResponseInner.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.fluent.inner; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The LogFileUrlResponse model. */ +@Fluent +public final class LogFileUrlResponseInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(LogFileUrlResponseInner.class); + + /* + * URL of the log file + */ + @JsonProperty(value = "url", required = true) + private String url; + + /** + * Get the url property: URL of the log file. + * + * @return the url value. + */ + public String url() { + return this.url; + } + + /** + * Set the url property: URL of the log file. + * + * @param url the url value to set. + * @return the LogFileUrlResponseInner object itself. + */ + public LogFileUrlResponseInner withUrl(String url) { + this.url = url; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (url() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property url in model LogFileUrlResponseInner")); + } + } +} diff --git a/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/fluent/inner/NameAvailabilityInner.java b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/fluent/inner/NameAvailabilityInner.java new file mode 100644 index 0000000000000..72d4dd61764f1 --- /dev/null +++ b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/fluent/inner/NameAvailabilityInner.java @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.fluent.inner; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The NameAvailability model. */ +@Fluent +public final class NameAvailabilityInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(NameAvailabilityInner.class); + + /* + * Indicates whether the name is available + */ + @JsonProperty(value = "nameAvailable") + private Boolean nameAvailable; + + /* + * Reason why the name is not available + */ + @JsonProperty(value = "reason") + private String reason; + + /* + * Message why the name is not available + */ + @JsonProperty(value = "message") + private String message; + + /** + * Get the nameAvailable property: Indicates whether the name is available. + * + * @return the nameAvailable value. + */ + public Boolean nameAvailable() { + return this.nameAvailable; + } + + /** + * Set the nameAvailable property: Indicates whether the name is available. + * + * @param nameAvailable the nameAvailable value to set. + * @return the NameAvailabilityInner object itself. + */ + public NameAvailabilityInner withNameAvailable(Boolean nameAvailable) { + this.nameAvailable = nameAvailable; + return this; + } + + /** + * Get the reason property: Reason why the name is not available. + * + * @return the reason value. + */ + public String reason() { + return this.reason; + } + + /** + * Set the reason property: Reason why the name is not available. + * + * @param reason the reason value to set. + * @return the NameAvailabilityInner object itself. + */ + public NameAvailabilityInner withReason(String reason) { + this.reason = reason; + return this; + } + + /** + * Get the message property: Message why the name is not available. + * + * @return the message value. + */ + public String message() { + return this.message; + } + + /** + * Set the message property: Message why the name is not available. + * + * @param message the message value to set. + * @return the NameAvailabilityInner object itself. + */ + public NameAvailabilityInner withMessage(String message) { + this.message = message; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/fluent/inner/OperationDetailInner.java b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/fluent/inner/OperationDetailInner.java new file mode 100644 index 0000000000000..24de8b15d88b2 --- /dev/null +++ b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/fluent/inner/OperationDetailInner.java @@ -0,0 +1,162 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.fluent.inner; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.appplatform.models.OperationDisplay; +import com.azure.resourcemanager.appplatform.models.OperationProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The OperationDetail model. */ +@Fluent +public final class OperationDetailInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationDetailInner.class); + + /* + * Name of the operation + */ + @JsonProperty(value = "name") + private String name; + + /* + * Indicates whether the operation is a data action + */ + @JsonProperty(value = "isDataAction") + private Boolean isDataAction; + + /* + * Display of the operation + */ + @JsonProperty(value = "display") + private OperationDisplay display; + + /* + * Origin of the operation + */ + @JsonProperty(value = "origin") + private String origin; + + /* + * Properties of the operation + */ + @JsonProperty(value = "properties") + private OperationProperties properties; + + /** + * Get the name property: Name of the operation. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Name of the operation. + * + * @param name the name value to set. + * @return the OperationDetailInner object itself. + */ + public OperationDetailInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get the isDataAction property: Indicates whether the operation is a data action. + * + * @return the isDataAction value. + */ + public Boolean isDataAction() { + return this.isDataAction; + } + + /** + * Set the isDataAction property: Indicates whether the operation is a data action. + * + * @param isDataAction the isDataAction value to set. + * @return the OperationDetailInner object itself. + */ + public OperationDetailInner withIsDataAction(Boolean isDataAction) { + this.isDataAction = isDataAction; + return this; + } + + /** + * Get the display property: Display of the operation. + * + * @return the display value. + */ + public OperationDisplay display() { + return this.display; + } + + /** + * Set the display property: Display of the operation. + * + * @param display the display value to set. + * @return the OperationDetailInner object itself. + */ + public OperationDetailInner withDisplay(OperationDisplay display) { + this.display = display; + return this; + } + + /** + * Get the origin property: Origin of the operation. + * + * @return the origin value. + */ + public String origin() { + return this.origin; + } + + /** + * Set the origin property: Origin of the operation. + * + * @param origin the origin value to set. + * @return the OperationDetailInner object itself. + */ + public OperationDetailInner withOrigin(String origin) { + this.origin = origin; + return this; + } + + /** + * Get the properties property: Properties of the operation. + * + * @return the properties value. + */ + public OperationProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Properties of the operation. + * + * @param properties the properties value to set. + * @return the OperationDetailInner object itself. + */ + public OperationDetailInner withProperties(OperationProperties properties) { + this.properties = properties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (display() != null) { + display().validate(); + } + if (properties() != null) { + properties().validate(); + } + } +} diff --git a/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/fluent/inner/ResourceSkuCollectionInner.java b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/fluent/inner/ResourceSkuCollectionInner.java new file mode 100644 index 0000000000000..8cb0c08e98abe --- /dev/null +++ b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/fluent/inner/ResourceSkuCollectionInner.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.fluent.inner; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.appplatform.models.ResourceSku; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The ResourceSkuCollection model. */ +@Fluent +public final class ResourceSkuCollectionInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ResourceSkuCollectionInner.class); + + /* + * Collection of resource SKU + */ + @JsonProperty(value = "value") + private List value; + + /* + * URL client should use to fetch the next page (per server side paging). + * It's null for now, added for future use. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: Collection of resource SKU. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Collection of resource SKU. + * + * @param value the value value to set. + * @return the ResourceSkuCollectionInner object itself. + */ + public ResourceSkuCollectionInner withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: URL client should use to fetch the next page (per server side paging). It's null for + * now, added for future use. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: URL client should use to fetch the next page (per server side paging). It's null for + * now, added for future use. + * + * @param nextLink the nextLink value to set. + * @return the ResourceSkuCollectionInner object itself. + */ + public ResourceSkuCollectionInner withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/fluent/inner/ServiceResourceInner.java b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/fluent/inner/ServiceResourceInner.java new file mode 100644 index 0000000000000..180198979b3dc --- /dev/null +++ b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/fluent/inner/ServiceResourceInner.java @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.fluent.inner; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.appplatform.models.ClusterResourceProperties; +import com.azure.resourcemanager.appplatform.models.Sku; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The ServiceResource model. */ +@Fluent +public final class ServiceResourceInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ServiceResourceInner.class); + + /* + * Properties of the Service resource + */ + @JsonProperty(value = "properties") + private ClusterResourceProperties properties; + + /* + * Sku of the Service resource + */ + @JsonProperty(value = "sku") + private Sku sku; + + /** + * Get the properties property: Properties of the Service resource. + * + * @return the properties value. + */ + public ClusterResourceProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Properties of the Service resource. + * + * @param properties the properties value to set. + * @return the ServiceResourceInner object itself. + */ + public ServiceResourceInner withProperties(ClusterResourceProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the sku property: Sku of the Service resource. + * + * @return the sku value. + */ + public Sku sku() { + return this.sku; + } + + /** + * Set the sku property: Sku of the Service resource. + * + * @param sku the sku value to set. + * @return the ServiceResourceInner object itself. + */ + public ServiceResourceInner withSku(Sku sku) { + this.sku = sku; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + if (sku() != null) { + sku().validate(); + } + } +} diff --git a/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/fluent/inner/ServiceResourceListInner.java b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/fluent/inner/ServiceResourceListInner.java new file mode 100644 index 0000000000000..6019ea83a38c0 --- /dev/null +++ b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/fluent/inner/ServiceResourceListInner.java @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.fluent.inner; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The ServiceResourceList model. */ +@Fluent +public final class ServiceResourceListInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ServiceResourceListInner.class); + + /* + * Collection of Service resources + */ + @JsonProperty(value = "value") + private List value; + + /* + * URL client should use to fetch the next page (per server side paging). + * It's null for now, added for future use. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: Collection of Service resources. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Collection of Service resources. + * + * @param value the value value to set. + * @return the ServiceResourceListInner object itself. + */ + public ServiceResourceListInner withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: URL client should use to fetch the next page (per server side paging). It's null for + * now, added for future use. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: URL client should use to fetch the next page (per server side paging). It's null for + * now, added for future use. + * + * @param nextLink the nextLink value to set. + * @return the ServiceResourceListInner object itself. + */ + public ServiceResourceListInner withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/fluent/inner/package-info.java b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/fluent/inner/package-info.java new file mode 100644 index 0000000000000..24d3112074011 --- /dev/null +++ b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/fluent/inner/package-info.java @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** Package containing the inner classes for AppPlatformManagementClient. REST API for Azure Spring Cloud. */ +package com.azure.resourcemanager.appplatform.fluent.inner; diff --git a/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/fluent/package-info.java b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/fluent/package-info.java new file mode 100644 index 0000000000000..919204581a25f --- /dev/null +++ b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/fluent/package-info.java @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** Package containing the client classes for AppPlatformManagementClient. REST API for Azure Spring Cloud. */ +package com.azure.resourcemanager.appplatform.fluent; diff --git a/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/implementation/SpringAppDeploymentImpl.java b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/implementation/SpringAppDeploymentImpl.java new file mode 100644 index 0000000000000..d985f51f1d5cc --- /dev/null +++ b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/implementation/SpringAppDeploymentImpl.java @@ -0,0 +1,412 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.resourcemanager.appplatform.implementation; + +import com.azure.resourcemanager.appplatform.AppPlatformManager; +import com.azure.resourcemanager.appplatform.fluent.inner.DeploymentResourceInner; +import com.azure.resourcemanager.appplatform.fluent.inner.LogFileUrlResponseInner; +import com.azure.resourcemanager.appplatform.models.DeploymentInstance; +import com.azure.resourcemanager.appplatform.models.DeploymentResourceProperties; +import com.azure.resourcemanager.appplatform.models.DeploymentResourceStatus; +import com.azure.resourcemanager.appplatform.models.DeploymentSettings; +import com.azure.resourcemanager.appplatform.models.ResourceUploadDefinition; +import com.azure.resourcemanager.appplatform.models.RuntimeVersion; +import com.azure.resourcemanager.appplatform.models.SpringApp; +import com.azure.resourcemanager.appplatform.models.SpringAppDeployment; +import com.azure.resourcemanager.appplatform.models.UserSourceInfo; +import com.azure.resourcemanager.appplatform.models.UserSourceType; +import com.azure.resourcemanager.resources.fluentcore.arm.models.implementation.ExternalChildResourceImpl; +import com.azure.resourcemanager.resources.fluentcore.model.Indexable; +import com.azure.storage.file.share.ShareFileAsyncClient; +import com.azure.storage.file.share.ShareFileClientBuilder; +import org.apache.commons.compress.archivers.tar.TarArchiveEntry; +import org.apache.commons.compress.archivers.tar.TarArchiveOutputStream; +import org.apache.commons.compress.utils.IOUtils; +import reactor.core.publisher.Mono; + +import java.io.File; +import java.io.FileInputStream; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.nio.file.Files; +import java.nio.file.Path; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.List; +import java.util.stream.Collectors; +import java.util.zip.GZIPOutputStream; + +public class SpringAppDeploymentImpl + extends ExternalChildResourceImpl + implements SpringAppDeployment, SpringAppDeployment.Definition, SpringAppDeployment.Update { + private static final int BLOCK_SIZE = 4 * 1024 * 1024; // 4MB + private final SpringAppDeploymentsImpl client; + private DeploymentSettings originalDeploymentSettings; + + SpringAppDeploymentImpl(String name, SpringAppImpl parent, + DeploymentResourceInner innerObject, SpringAppDeploymentsImpl client) { + super(name, parent, innerObject); + this.client = client; + } + + @Override + public String appName() { + if (inner().properties() == null) { + return null; + } + return inner().properties().appName(); + } + + @Override + public DeploymentSettings settings() { + if (inner().properties() == null) { + return null; + } + return inner().properties().deploymentSettings(); + } + + @Override + public DeploymentResourceStatus status() { + if (inner().properties() == null) { + return null; + } + return inner().properties().status(); + } + + @Override + public boolean isActive() { + if (inner().properties() == null) { + return false; + } + return inner().properties().active(); + } + + @Override + public OffsetDateTime createdTime() { + if (inner().properties() == null) { + return null; + } + return inner().properties().createdTime(); + } + + @Override + public List instances() { + if (inner().properties() == null) { + return null; + } + return inner().properties().instances(); + } + + @Override + public String getLogFileUrl() { + return getLogFileUrlAsync().block(); + } + + @Override + public Mono getLogFileUrlAsync() { + return manager().inner().getDeployments().getLogFileUrlAsync( + parent().parent().resourceGroupName(), parent().parent().name(), parent().name(), name() + ) + .map(LogFileUrlResponseInner::url); + } + + private void ensureDeploySettings() { + if (inner().properties() == null) { + inner().withProperties(new DeploymentResourceProperties()); + } + if (inner().properties().deploymentSettings() == null) { + inner().properties().withDeploymentSettings(new DeploymentSettings()); + } + } + + private void ensureSource() { + if (inner().properties() == null) { + inner().withProperties(new DeploymentResourceProperties()); + } + if (inner().properties().source() == null) { + inner().properties().withSource(new UserSourceInfo()); + } + } + + private File compressSource(File sourceFolder) throws IOException { + File compressFile = File.createTempFile("java_package", "tar.gz"); + compressFile.deleteOnExit(); + try (TarArchiveOutputStream tarArchiveOutputStream = new TarArchiveOutputStream( + new GZIPOutputStream(new FileOutputStream(compressFile)))) { + tarArchiveOutputStream.setLongFileMode(TarArchiveOutputStream.LONGFILE_GNU); + + for (Path sourceFile : Files.walk(sourceFolder.toPath()).collect(Collectors.toList())) { + String relativePath = sourceFolder.toPath().relativize(sourceFile).toString(); + TarArchiveEntry entry = new TarArchiveEntry(sourceFile.toFile(), relativePath); + if (sourceFile.toFile().isFile()) { + try (InputStream inputStream = new FileInputStream(sourceFile.toFile())) { + tarArchiveOutputStream.putArchiveEntry(entry); + IOUtils.copy(inputStream, tarArchiveOutputStream); + tarArchiveOutputStream.closeArchiveEntry(); + } + } else { + tarArchiveOutputStream.putArchiveEntry(entry); + tarArchiveOutputStream.closeArchiveEntry(); + } + } + } + return compressFile; + } + + private ShareFileAsyncClient createShareFileAsyncClient(ResourceUploadDefinition option) { + return new ShareFileClientBuilder() + .endpoint(option.uploadUrl()) + .httpClient(manager().httpPipeline().getHttpClient()) + .buildFileAsyncClient(); + } + + private Mono uploadToStorage(File source, ResourceUploadDefinition option) { + inner().properties().source().withRelativePath(option.relativePath()); + try { + ShareFileAsyncClient shareFileAsyncClient = createShareFileAsyncClient(option); + return shareFileAsyncClient.create(source.length()) + .flatMap(fileInfo -> shareFileAsyncClient.uploadFromFile(source.getAbsolutePath())) + .then(Mono.empty()); + } catch (Exception e) { + return Mono.error(e); + } + } + + @Override + public SpringAppDeploymentImpl withJarFile(File jar) { + ensureSource(); + inner().properties().source().withType(UserSourceType.JAR); + this.addDependency( + context -> parent().getResourceUploadUrlAsync() + .flatMap(option -> uploadToStorage(jar, option) + .then(context.voidMono())) + ); + return this; + } + + @Override + public SpringAppDeploymentImpl withSourceCodeFolder(File sourceCodeFolder) { + ensureSource(); + inner().properties().source().withType(UserSourceType.SOURCE); + this.addDependency( + context -> parent().getResourceUploadUrlAsync() + .flatMap(option -> { + try { + return uploadToStorage(compressSource(sourceCodeFolder), option); + } catch (Exception e) { + return Mono.error(e); + } + }) + .then(context.voidMono()) + ); + return this; + } + + @Override + public SpringAppDeploymentImpl withExistingSource(UserSourceType type, String relativePath) { + ensureSource(); + inner().properties().source().withType(type); + inner().properties().source().withRelativePath(relativePath); + return this; + } + + @Override + public SpringAppDeploymentImpl withSourceCodeTarGzFile(File sourceCodeTarGz) { + ensureSource(); + inner().properties().source().withType(UserSourceType.SOURCE); + this.addDependency( + context -> parent().getResourceUploadUrlAsync() + .flatMap(option -> uploadToStorage(sourceCodeTarGz, option) + .then(context.voidMono())) + ); + return this; + } + + @Override + public SpringAppDeploymentImpl withTargetModule(String moduleName) { + ensureSource(); + inner().properties().source().withArtifactSelector(moduleName); + return this; + } + + @Override + public SpringAppDeploymentImpl withSingleModule() { + ensureSource(); + inner().properties().source().withArtifactSelector(null); + return this; + } + + @Override + public SpringAppDeploymentImpl withSettingsFromActiveDeployment() { + this.addDependency( + context -> client.getByNameAsync(parent().activeDeployment()) + .map(deployment -> { + originalDeploymentSettings = deployment.settings(); + return (Indexable) deployment; + }) + ); + return this; + } + + @Override + public SpringAppDeploymentImpl withSettingsFromDeployment(SpringAppDeployment deployment) { + originalDeploymentSettings = deployment.settings(); + return this; + } + + @Override + public SpringAppDeploymentImpl withSettingsFromDeployment(String deploymentName) { + this.addDependency( + context -> client.getByNameAsync(deploymentName) + .map(deployment -> { + originalDeploymentSettings = deployment.settings(); + return (Indexable) deployment; + }) + ); + return this; + } + + @Override + public SpringAppDeploymentImpl withCustomSetting() { + ensureDeploySettings(); + inner().properties().withDeploymentSettings(new DeploymentSettings()); + return this; + } + + @Override + public SpringAppDeploymentImpl withInstance(int count) { + ensureDeploySettings(); + inner().properties().deploymentSettings().withInstanceCount(count); + return this; + } + + @Override + public SpringAppDeploymentImpl withCpu(int cpuCount) { + ensureDeploySettings(); + inner().properties().deploymentSettings().withCpu(cpuCount); + return this; + } + + @Override + public SpringAppDeploymentImpl withMemory(int sizeInGB) { + ensureDeploySettings(); + inner().properties().deploymentSettings().withMemoryInGB(sizeInGB); + return this; + } + + @Override + public SpringAppDeploymentImpl withRuntime(RuntimeVersion version) { + ensureDeploySettings(); + inner().properties().deploymentSettings().withRuntimeVersion(version); + return this; + } + + @Override + public SpringAppDeploymentImpl withJvmOptions(String jvmOptions) { + ensureDeploySettings(); + inner().properties().deploymentSettings().withJvmOptions(jvmOptions); + return this; + } + + private void ensureEnvironments() { + ensureDeploySettings(); + if (inner().properties().deploymentSettings().environmentVariables() == null) { + inner().properties().deploymentSettings().withEnvironmentVariables(new HashMap<>()); + } + } + + @Override + public SpringAppDeploymentImpl withEnvironment(String key, String value) { + ensureEnvironments(); + inner().properties().deploymentSettings().environmentVariables().put(key, value); + return this; + } + + @Override + public SpringAppDeploymentImpl withoutEnvironment(String key) { + ensureEnvironments(); + inner().properties().deploymentSettings().environmentVariables().remove(key); + return this; + } + + @Override + public SpringAppDeploymentImpl withVersionName(String versionName) { + ensureSource(); + inner().properties().source().withVersion(versionName); + return this; + } + + @Override + public SpringAppDeploymentImpl withActivation() { + this.addPostRunDependent( + context -> parent().update().withActiveDeployment(name()).applyAsync() + .map(app -> (Indexable) app) + ); + return this; + } + + @Override + public Mono createResourceAsync() { + if (originalDeploymentSettings != null) { + ensureDeploySettings(); + inner().properties().withDeploymentSettings(originalDeploymentSettings); + } + return manager().inner().getDeployments().createOrUpdateAsync( + parent().parent().resourceGroupName(), parent().parent().name(), + parent().name(), name(), inner().properties() + ) + .map(inner -> { + originalDeploymentSettings = null; + setInner(inner); + return this; + }); + } + + @Override + public Mono updateResourceAsync() { + if (originalDeploymentSettings != null) { + ensureDeploySettings(); + inner().properties().withDeploymentSettings(originalDeploymentSettings); + } + return manager().inner().getDeployments().updateAsync( + parent().parent().resourceGroupName(), parent().parent().name(), + parent().name(), name(), inner().properties() + ) + .map(inner -> { + originalDeploymentSettings = null; + setInner(inner); + return this; + }); + } + + @Override + public Mono deleteResourceAsync() { + return manager().inner().getDeployments().deleteAsync( + parent().parent().resourceGroupName(), parent().parent().name(), parent().name(), name() + ); + } + + @Override + protected Mono getInnerAsync() { + return manager().inner().getDeployments().getAsync( + parent().parent().resourceGroupName(), parent().parent().name(), parent().name(), name() + ); + } + + @Override + public String id() { + return inner().id(); + } + + @Override + public SpringAppDeploymentImpl update() { + prepareUpdate(); + return this; + } + + private AppPlatformManager manager() { + return parent().manager(); + } +} diff --git a/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/implementation/SpringAppDeploymentsImpl.java b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/implementation/SpringAppDeploymentsImpl.java new file mode 100644 index 0000000000000..e1cc32e5e3c1e --- /dev/null +++ b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/implementation/SpringAppDeploymentsImpl.java @@ -0,0 +1,107 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.resourcemanager.appplatform.implementation; + +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.resourcemanager.appplatform.AppPlatformManager; +import com.azure.resourcemanager.appplatform.fluent.DeploymentsClient; +import com.azure.resourcemanager.appplatform.fluent.inner.DeploymentResourceInner; +import com.azure.resourcemanager.appplatform.models.SpringApp; +import com.azure.resourcemanager.appplatform.models.SpringAppDeployment; +import com.azure.resourcemanager.appplatform.models.SpringAppDeployments; +import com.azure.resourcemanager.resources.fluentcore.arm.ResourceUtils; +import com.azure.resourcemanager.resources.fluentcore.arm.collection.implementation.ExternalChildResourcesNonCachedImpl; +import reactor.core.publisher.Mono; + +public class SpringAppDeploymentsImpl + extends ExternalChildResourcesNonCachedImpl< + SpringAppDeploymentImpl, SpringAppDeployment, DeploymentResourceInner, SpringAppImpl, SpringApp> + implements SpringAppDeployments { + + SpringAppDeploymentsImpl(SpringAppImpl parent) { + super(parent, parent.taskGroup(), "SpringAppDeployment"); + } + + @Override + public SpringAppDeployment getById(String id) { + return getByIdAsync(id).block(); + } + + @Override + public Mono getByIdAsync(String id) { + return getByNameAsync(ResourceUtils.nameFromResourceId(id)); + } + + @Override + public SpringAppDeployment getByName(String name) { + return getByNameAsync(name).block(); + } + + @Override + public Mono getByNameAsync(String name) { + return inner().getAsync(parent().parent().resourceGroupName(), parent().parent().name(), parent().name(), name) + .map(this::wrapModel); + } + + @Override + public AppPlatformManager manager() { + return parent().parent().manager(); + } + + @Override + public SpringAppImpl parent() { + return super.getParent(); + } + + @Override + public SpringAppDeploymentImpl define(String name) { + return super.prepareIndependentDefine(wrapModel(name)); + } + + @Override + public void deleteById(String id) { + deleteByIdAsync(id).block(); + } + + @Override + public Mono deleteByIdAsync(String id) { + return deleteByNameAsync(ResourceUtils.nameFromResourceId(id)); + } + + @Override + public void deleteByName(String name) { + deleteByNameAsync(name).block(); + } + + @Override + public Mono deleteByNameAsync(String name) { + return inner().deleteAsync( + parent().parent().resourceGroupName(), parent().parent().name(), parent().name(), name); + } + + @Override + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + @Override + public PagedFlux listAsync() { + return inner().listAsync(parent().parent().resourceGroupName(), parent().parent().name(), parent().name()) + .mapPage(this::wrapModel); + } + + private SpringAppDeploymentImpl wrapModel(String name) { + return new SpringAppDeploymentImpl(name, parent(), new DeploymentResourceInner(), this); + } + + private SpringAppDeploymentImpl wrapModel(DeploymentResourceInner inner) { + return inner == null ? null : new SpringAppDeploymentImpl(inner.name(), parent(), inner, this); + } + + @Override + public DeploymentsClient inner() { + return manager().inner().getDeployments(); + } +} diff --git a/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/implementation/SpringAppImpl.java b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/implementation/SpringAppImpl.java new file mode 100644 index 0000000000000..6d811a0eb8d4b --- /dev/null +++ b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/implementation/SpringAppImpl.java @@ -0,0 +1,282 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.resourcemanager.appplatform.implementation; + +import com.azure.resourcemanager.appplatform.AppPlatformManager; +import com.azure.resourcemanager.appplatform.fluent.inner.AppResourceInner; +import com.azure.resourcemanager.appplatform.models.AppResourceProperties; +import com.azure.resourcemanager.appplatform.models.ManagedIdentityProperties; +import com.azure.resourcemanager.appplatform.models.PersistentDisk; +import com.azure.resourcemanager.appplatform.models.ResourceUploadDefinition; +import com.azure.resourcemanager.appplatform.models.SpringApp; +import com.azure.resourcemanager.appplatform.models.SpringAppDeployment; +import com.azure.resourcemanager.appplatform.models.SpringAppDeployments; +import com.azure.resourcemanager.appplatform.models.SpringService; +import com.azure.resourcemanager.appplatform.models.TemporaryDisk; +import com.azure.resourcemanager.appplatform.models.UserSourceType; +import com.azure.resourcemanager.resources.fluentcore.arm.models.implementation.ExternalChildResourceImpl; +import com.azure.resourcemanager.resources.fluentcore.model.Creatable; +import reactor.core.publisher.Mono; + +import java.io.File; +import java.time.OffsetDateTime; + +public class SpringAppImpl + extends ExternalChildResourceImpl + implements SpringApp, SpringApp.Definition, SpringApp.Update { + private Creatable springAppDeploymentToCreate = null; + + SpringAppImpl(String name, SpringServiceImpl parent, AppResourceInner innerObject) { + super(name, parent, innerObject); + } + + @Override + public boolean isPublic() { + if (inner().properties() == null) { + return false; + } + return inner().properties().publicProperty(); + } + + @Override + public boolean isHttpsOnly() { + if (inner().properties() == null) { + return false; + } + return inner().properties().httpsOnly(); + } + + @Override + public String url() { + if (inner().properties() == null) { + return null; + } + return inner().properties().url(); + } + + @Override + public TemporaryDisk temporaryDisk() { + if (inner().properties() == null) { + return null; + } + return inner().properties().temporaryDisk(); + } + + @Override + public PersistentDisk persistentDisk() { + if (inner().properties() == null) { + return null; + } + return inner().properties().persistentDisk(); + } + + @Override + public ManagedIdentityProperties identity() { + return inner().identity(); + } + + @Override + public OffsetDateTime createdTime() { + if (inner().properties() == null) { + return null; + } + return inner().properties().createdTime(); + } + + @Override + public String activeDeployment() { + if (inner().properties() == null) { + return null; + } + return inner().properties().activeDeploymentName(); + } + + @Override + public SpringAppDeployments deployments() { + return new SpringAppDeploymentsImpl(this); + } + + @Override + public Mono getResourceUploadUrlAsync() { + return manager().inner().getApps().getResourceUploadUrlAsync( + parent().resourceGroupName(), parent().name(), name()); + } + + @Override + public ResourceUploadDefinition getResourceUploadUrl() { + return getResourceUploadUrlAsync().block(); + } + + private void ensureProperty() { + if (inner().properties() == null) { + inner().withProperties(new AppResourceProperties()); + } + } + + @Override + public SpringAppImpl withPublicEndpoint() { + ensureProperty(); + inner().properties().withPublicProperty(true); + return this; + } + + @Override + public SpringAppImpl withoutPublicEndpoint() { + ensureProperty(); + inner().properties().withPublicProperty(false); + return this; + } + + @Override + public SpringAppImpl withCustomDomain(String domain) { + ensureProperty(); + inner().properties().withFqdn(domain); + return this; + } + + @Override + public SpringAppImpl withoutCustomDomain() { + ensureProperty(); + inner().properties().withFqdn(null); + return this; + } + + @Override + public SpringAppImpl withHttpsOnly() { + ensureProperty(); + inner().properties().withHttpsOnly(true); + return this; + } + + @Override + public SpringAppImpl withoutHttpsOnly() { + ensureProperty(); + inner().properties().withHttpsOnly(false); + return this; + } + + @Override + public SpringAppImpl withTemporaryDisk(int sizeInGB, String mountPath) { + ensureProperty(); + inner().properties().withTemporaryDisk(new TemporaryDisk().withSizeInGB(sizeInGB).withMountPath(mountPath)); + return this; + } + + @Override + public SpringAppImpl withoutTemporaryDisk() { + ensureProperty(); + inner().properties().withTemporaryDisk(null); + return this; + } + + @Override + public SpringAppImpl withPersistentDisk(int sizeInGB, String mountPath) { + ensureProperty(); + inner().properties().withPersistentDisk(new PersistentDisk().withSizeInGB(sizeInGB).withMountPath(mountPath)); + return this; + } + + @Override + public SpringAppImpl withoutPersistentDisk() { + ensureProperty(); + inner().properties().withPersistentDisk(null); + return this; + } + + @Override + public SpringAppImpl withActiveDeployment(String name) { + ensureProperty(); + inner().properties().withActiveDeploymentName(name); + return this; + } + + @Override + public SpringAppImpl withoutDeployment(String name) { + this.addPostRunDependent( + context -> deployments().deleteByNameAsync(name) + .then(context.voidMono()) + ); + return this; + } + + @Override + public SpringAppImpl deployJar(String name, File jarFile) { + ensureProperty(); + inner().properties().withActiveDeploymentName(name); + springAppDeploymentToCreate = deployments().define(name) + .withJarFile(jarFile) + .withCustomSetting(); + return this; + } + + @Override + public SpringAppImpl deploySource(String name, File sourceCodeFolder, String targetModule) { + ensureProperty(); + inner().properties().withActiveDeploymentName(name); + springAppDeploymentToCreate = deployments().define(name) + .withSourceCodeFolder(sourceCodeFolder) + .withTargetModule(targetModule) + .withCustomSetting(); + return this; + } + + @Override + public Mono createResourceAsync() { + if (springAppDeploymentToCreate == null) { + String defaultDeploymentName = "default"; + withActiveDeployment(defaultDeploymentName); + springAppDeploymentToCreate = deployments().define(defaultDeploymentName) + .withExistingSource(UserSourceType.JAR, String.format("<%s>", defaultDeploymentName)) + .withCustomSetting(); + } + return manager().inner().getApps().createOrUpdateAsync( + parent().resourceGroupName(), parent().name(), name(), new AppResourceInner()) + .flatMap(inner -> updateResourceAsync()); + } + + @Override + public Mono updateResourceAsync() { + Mono createDeployment; + if (springAppDeploymentToCreate != null) { + createDeployment = springAppDeploymentToCreate.createAsync().last(); + } else { + createDeployment = Mono.empty(); + } + return createDeployment + .then( + manager().inner().getApps().updateAsync( + parent().resourceGroupName(), parent().name(), name(), inner() + ) + .map(inner -> { + setInner(inner); + springAppDeploymentToCreate = null; + return this; + })); + } + + @Override + public Mono deleteResourceAsync() { + return manager().inner().getApps().deleteAsync(parent().resourceGroupName(), parent().name(), name()); + } + + @Override + protected Mono getInnerAsync() { + return manager().inner().getApps().getAsync(parent().resourceGroupName(), parent().name(), name()); + } + + @Override + public String id() { + return inner().id(); + } + + @Override + public SpringAppImpl update() { + prepareUpdate(); + return this; + } + + public AppPlatformManager manager() { + return parent().manager(); + } +} diff --git a/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/implementation/SpringAppsImpl.java b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/implementation/SpringAppsImpl.java new file mode 100644 index 0000000000000..3bf35e72e4490 --- /dev/null +++ b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/implementation/SpringAppsImpl.java @@ -0,0 +1,106 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.resourcemanager.appplatform.implementation; + +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.resourcemanager.appplatform.AppPlatformManager; +import com.azure.resourcemanager.appplatform.fluent.AppsClient; +import com.azure.resourcemanager.appplatform.fluent.inner.AppResourceInner; +import com.azure.resourcemanager.appplatform.models.SpringApp; +import com.azure.resourcemanager.appplatform.models.SpringApps; +import com.azure.resourcemanager.appplatform.models.SpringService; +import com.azure.resourcemanager.resources.fluentcore.arm.ResourceUtils; +import com.azure.resourcemanager.resources.fluentcore.arm.collection.implementation.ExternalChildResourcesNonCachedImpl; +import reactor.core.publisher.Mono; + +public class SpringAppsImpl + extends ExternalChildResourcesNonCachedImpl< + SpringAppImpl, SpringApp, AppResourceInner, SpringServiceImpl, SpringService> + implements SpringApps { + + SpringAppsImpl(SpringServiceImpl parent) { + super(parent, parent.taskGroup(), "SpringApp"); + } + + @Override + public SpringApp getById(String id) { + return getByIdAsync(id).block(); + } + + @Override + public Mono getByIdAsync(String id) { + return getByNameAsync(ResourceUtils.nameFromResourceId(id)); + } + + @Override + public SpringApp getByName(String name) { + return getByNameAsync(name).block(); + } + + @Override + public Mono getByNameAsync(String name) { + return inner().getAsync(parent().resourceGroupName(), parent().name(), name) + .map(this::wrapModel); + } + + @Override + public AppPlatformManager manager() { + return parent().manager(); + } + + @Override + public SpringServiceImpl parent() { + return super.getParent(); + } + + @Override + public SpringAppImpl define(String name) { + return super.prepareIndependentDefine(wrapModel(name)); + } + + @Override + public void deleteById(String id) { + deleteByIdAsync(id).block(); + } + + @Override + public Mono deleteByIdAsync(String id) { + return deleteByNameAsync(ResourceUtils.nameFromResourceId(id)); + } + + @Override + public void deleteByName(String name) { + deleteByNameAsync(name).block(); + } + + @Override + public Mono deleteByNameAsync(String name) { + return inner().deleteAsync(parent().resourceGroupName(), parent().name(), name); + } + + @Override + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + @Override + public PagedFlux listAsync() { + return inner().listAsync(parent().resourceGroupName(), parent().name()) + .mapPage(this::wrapModel); + } + + private SpringAppImpl wrapModel(AppResourceInner inner) { + return inner == null ? null : new SpringAppImpl(inner.name(), parent(), inner); + } + + private SpringAppImpl wrapModel(String name) { + return new SpringAppImpl(name, parent(), new AppResourceInner()); + } + + @Override + public AppsClient inner() { + return manager().inner().getApps(); + } +} diff --git a/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/implementation/SpringServiceImpl.java b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/implementation/SpringServiceImpl.java new file mode 100644 index 0000000000000..5ac8e890fab18 --- /dev/null +++ b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/implementation/SpringServiceImpl.java @@ -0,0 +1,186 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.resourcemanager.appplatform.implementation; + +import com.azure.resourcemanager.appplatform.AppPlatformManager; +import com.azure.resourcemanager.appplatform.fluent.inner.ServiceResourceInner; +import com.azure.resourcemanager.appplatform.models.ClusterResourceProperties; +import com.azure.resourcemanager.appplatform.models.ConfigServerGitProperty; +import com.azure.resourcemanager.appplatform.models.ConfigServerProperties; +import com.azure.resourcemanager.appplatform.models.ConfigServerSettings; +import com.azure.resourcemanager.appplatform.models.Sku; +import com.azure.resourcemanager.appplatform.models.SpringApps; +import com.azure.resourcemanager.appplatform.models.SpringService; +import com.azure.resourcemanager.appplatform.models.TestKeyType; +import com.azure.resourcemanager.appplatform.models.TestKeys; +import com.azure.resourcemanager.appplatform.models.TraceProperties; +import com.azure.resourcemanager.resources.fluentcore.arm.models.implementation.GroupableResourceImpl; +import reactor.core.publisher.Mono; + +public class SpringServiceImpl + extends GroupableResourceImpl + implements SpringService, SpringService.Definition, SpringService.Update { + + SpringServiceImpl(String name, ServiceResourceInner innerObject, AppPlatformManager manager) { + super(name, innerObject, manager); + } + @Override + public Sku sku() { + return inner().sku(); + } + + @Override + public TraceProperties traceProperties() { + return inner().properties().trace(); + } + + @Override + public ConfigServerProperties serverProperties() { + return inner().properties().configServerProperties(); + } + + @Override + public SpringApps apps() { + return new SpringAppsImpl(this); + } + + @Override + public TestKeys listTestKeys() { + return listTestKeysAsync().block(); + } + + @Override + public Mono listTestKeysAsync() { + return manager().inner().getServices().listTestKeysAsync(resourceGroupName(), name()); + } + + @Override + public TestKeys regenerateTestKeys(TestKeyType keyType) { + return regenerateTestKeysAsync(keyType).block(); + } + + @Override + public Mono regenerateTestKeysAsync(TestKeyType keyType) { + return manager().inner().getServices().regenerateTestKeyAsync(resourceGroupName(), name(), keyType); + } + + @Override + public void disableTestEndpoint() { + disableTestEndpointAsync().block(); + } + + @Override + public Mono disableTestEndpointAsync() { + return manager().inner().getServices().disableTestEndpointAsync(resourceGroupName(), name()); + } + + @Override + public TestKeys enableTestEndpoint() { + return enableTestEndpointAsync().block(); + } + + @Override + public Mono enableTestEndpointAsync() { + return manager().inner().getServices().enableTestEndpointAsync(resourceGroupName(), name()); + } + + @Override + public SpringServiceImpl withSku(String skuName) { + return withSku(new Sku().withName(skuName)); + } + + @Override + public SpringServiceImpl withSku(String skuName, int capacity) { + return withSku(new Sku().withName(skuName).withCapacity(capacity)); + } + + @Override + public SpringServiceImpl withSku(Sku sku) { + inner().withSku(sku); + return this; + } + + @Override + public SpringServiceImpl withTracing(String appInsightInstrumentationKey) { + if (inner().properties() == null) { + inner().withProperties(new ClusterResourceProperties()); + } + inner().properties().withTrace( + new TraceProperties().withAppInsightInstrumentationKey(appInsightInstrumentationKey).withEnabled(true)); + return this; + } + + @Override + public SpringServiceImpl withoutTracing() { + if (inner().properties() == null) { + inner().withProperties(new ClusterResourceProperties()); + } + inner().properties().withTrace(new TraceProperties().withEnabled(false)); + return this; + } + + private void ensureGitConfig() { + if (inner().properties() == null) { + inner().withProperties(new ClusterResourceProperties()); + } + if (inner().properties().configServerProperties() == null) { + inner().properties().withConfigServerProperties(new ConfigServerProperties()); + } + if (inner().properties().configServerProperties().configServer() == null) { + inner().properties().configServerProperties().withConfigServer(new ConfigServerSettings()); + } + if (inner().properties().configServerProperties().configServer().gitProperty() == null) { + inner().properties().configServerProperties().configServer().withGitProperty(new ConfigServerGitProperty()); + } + } + + @Override + public SpringServiceImpl withGitUri(String uri) { + ensureGitConfig(); + inner().properties().configServerProperties().configServer().gitProperty().withUri(uri); + return this; + } + + @Override + public SpringServiceImpl withGitUriAndCredential(String uri, String username, String password) { + ensureGitConfig(); + inner().properties().configServerProperties().configServer().gitProperty() + .withUri(uri).withUsername(username).withPassword(password); + return this; + } + + @Override + public SpringServiceImpl withGitConfig(ConfigServerGitProperty gitConfig) { + ensureGitConfig(); + inner().properties().configServerProperties().configServer().withGitProperty(gitConfig); + return this; + } + + @Override + public SpringServiceImpl withoutGitConfig() { + ensureGitConfig(); + inner().properties().configServerProperties().configServer().withGitProperty(null); + return this; + } + + @Override + public Mono createResourceAsync() { + Mono createOrUpdate; + if (isInCreateMode()) { + createOrUpdate = manager().inner().getServices().createOrUpdateAsync(resourceGroupName(), name(), inner()); + } else { + createOrUpdate = manager().inner().getServices().updateAsync(resourceGroupName(), name(), inner()); + } + return createOrUpdate + .map(inner -> { + this.setInner(inner); + return this; + }); + } + + @Override + protected Mono getInnerAsync() { + return manager().inner().getServices().getByResourceGroupAsync(resourceGroupName(), name()); + } +} diff --git a/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/implementation/SpringServicesImpl.java b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/implementation/SpringServicesImpl.java new file mode 100644 index 0000000000000..d48cd6be55a32 --- /dev/null +++ b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/implementation/SpringServicesImpl.java @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.resourcemanager.appplatform.implementation; + +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.resourcemanager.appplatform.AppPlatformManager; +import com.azure.resourcemanager.appplatform.fluent.ServicesClient; +import com.azure.resourcemanager.appplatform.fluent.inner.ServiceResourceInner; +import com.azure.resourcemanager.appplatform.models.ResourceSku; +import com.azure.resourcemanager.appplatform.models.SpringService; +import com.azure.resourcemanager.appplatform.models.SpringServices; +import com.azure.resourcemanager.resources.fluentcore.arm.collection.implementation.GroupableResourcesImpl; +import reactor.core.publisher.Mono; + +public class SpringServicesImpl + extends GroupableResourcesImpl< + SpringService, SpringServiceImpl, ServiceResourceInner, ServicesClient, AppPlatformManager> + implements SpringServices { + public SpringServicesImpl(AppPlatformManager manager) { + super(manager.inner().getServices(), manager); + } + + @Override + protected Mono getInnerAsync(String resourceGroupName, String name) { + return inner().getByResourceGroupAsync(resourceGroupName, name); + } + + @Override + protected Mono deleteInnerAsync(String resourceGroupName, String name) { + return inner().deleteAsync(resourceGroupName, name); + } + + @Override + protected SpringServiceImpl wrapModel(String name) { + return new SpringServiceImpl(name, new ServiceResourceInner(), manager()); + } + + @Override + protected SpringServiceImpl wrapModel(ServiceResourceInner inner) { + return inner == null ? null : new SpringServiceImpl(inner.name(), inner, manager()); + } + + @Override + public PagedIterable listSkus() { + return new PagedIterable<>(listSkusAsync()); + } + + @Override + public PagedFlux listSkusAsync() { + return manager().inner().getSkus().listAsync(); + } + + @Override + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + @Override + public PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return inner().listByResourceGroupAsync(resourceGroupName).mapPage(this::wrapModel); + } + + @Override + public SpringServiceImpl define(String name) { + return wrapModel(name); + } + + @Override + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + @Override + public PagedFlux listAsync() { + return inner().listAsync().mapPage(this::wrapModel); + } +} diff --git a/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/AppResourceProperties.java b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/AppResourceProperties.java new file mode 100644 index 0000000000000..30ca64791bf88 --- /dev/null +++ b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/AppResourceProperties.java @@ -0,0 +1,232 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** The AppResourceProperties model. */ +@Fluent +public final class AppResourceProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AppResourceProperties.class); + + /* + * Indicates whether the App exposes public endpoint + */ + @JsonProperty(value = "public") + private Boolean publicProperty; + + /* + * URL of the App + */ + @JsonProperty(value = "url", access = JsonProperty.Access.WRITE_ONLY) + private String url; + + /* + * Provisioning state of the App + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private AppResourceProvisioningState provisioningState; + + /* + * Name of the active deployment of the App + */ + @JsonProperty(value = "activeDeploymentName") + private String activeDeploymentName; + + /* + * Fully qualified dns Name. + */ + @JsonProperty(value = "fqdn") + private String fqdn; + + /* + * Indicate if only https is allowed. + */ + @JsonProperty(value = "httpsOnly") + private Boolean httpsOnly; + + /* + * Date time when the resource is created + */ + @JsonProperty(value = "createdTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime createdTime; + + /* + * Temporary disk settings + */ + @JsonProperty(value = "temporaryDisk") + private TemporaryDisk temporaryDisk; + + /* + * Persistent disk settings + */ + @JsonProperty(value = "persistentDisk") + private PersistentDisk persistentDisk; + + /** + * Get the publicProperty property: Indicates whether the App exposes public endpoint. + * + * @return the publicProperty value. + */ + public Boolean publicProperty() { + return this.publicProperty; + } + + /** + * Set the publicProperty property: Indicates whether the App exposes public endpoint. + * + * @param publicProperty the publicProperty value to set. + * @return the AppResourceProperties object itself. + */ + public AppResourceProperties withPublicProperty(Boolean publicProperty) { + this.publicProperty = publicProperty; + return this; + } + + /** + * Get the url property: URL of the App. + * + * @return the url value. + */ + public String url() { + return this.url; + } + + /** + * Get the provisioningState property: Provisioning state of the App. + * + * @return the provisioningState value. + */ + public AppResourceProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the activeDeploymentName property: Name of the active deployment of the App. + * + * @return the activeDeploymentName value. + */ + public String activeDeploymentName() { + return this.activeDeploymentName; + } + + /** + * Set the activeDeploymentName property: Name of the active deployment of the App. + * + * @param activeDeploymentName the activeDeploymentName value to set. + * @return the AppResourceProperties object itself. + */ + public AppResourceProperties withActiveDeploymentName(String activeDeploymentName) { + this.activeDeploymentName = activeDeploymentName; + return this; + } + + /** + * Get the fqdn property: Fully qualified dns Name. + * + * @return the fqdn value. + */ + public String fqdn() { + return this.fqdn; + } + + /** + * Set the fqdn property: Fully qualified dns Name. + * + * @param fqdn the fqdn value to set. + * @return the AppResourceProperties object itself. + */ + public AppResourceProperties withFqdn(String fqdn) { + this.fqdn = fqdn; + return this; + } + + /** + * Get the httpsOnly property: Indicate if only https is allowed. + * + * @return the httpsOnly value. + */ + public Boolean httpsOnly() { + return this.httpsOnly; + } + + /** + * Set the httpsOnly property: Indicate if only https is allowed. + * + * @param httpsOnly the httpsOnly value to set. + * @return the AppResourceProperties object itself. + */ + public AppResourceProperties withHttpsOnly(Boolean httpsOnly) { + this.httpsOnly = httpsOnly; + return this; + } + + /** + * Get the createdTime property: Date time when the resource is created. + * + * @return the createdTime value. + */ + public OffsetDateTime createdTime() { + return this.createdTime; + } + + /** + * Get the temporaryDisk property: Temporary disk settings. + * + * @return the temporaryDisk value. + */ + public TemporaryDisk temporaryDisk() { + return this.temporaryDisk; + } + + /** + * Set the temporaryDisk property: Temporary disk settings. + * + * @param temporaryDisk the temporaryDisk value to set. + * @return the AppResourceProperties object itself. + */ + public AppResourceProperties withTemporaryDisk(TemporaryDisk temporaryDisk) { + this.temporaryDisk = temporaryDisk; + return this; + } + + /** + * Get the persistentDisk property: Persistent disk settings. + * + * @return the persistentDisk value. + */ + public PersistentDisk persistentDisk() { + return this.persistentDisk; + } + + /** + * Set the persistentDisk property: Persistent disk settings. + * + * @param persistentDisk the persistentDisk value to set. + * @return the AppResourceProperties object itself. + */ + public AppResourceProperties withPersistentDisk(PersistentDisk persistentDisk) { + this.persistentDisk = persistentDisk; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (temporaryDisk() != null) { + temporaryDisk().validate(); + } + if (persistentDisk() != null) { + persistentDisk().validate(); + } + } +} diff --git a/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/AppResourceProvisioningState.java b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/AppResourceProvisioningState.java new file mode 100644 index 0000000000000..8c0a7f688cd1a --- /dev/null +++ b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/AppResourceProvisioningState.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for AppResourceProvisioningState. */ +public final class AppResourceProvisioningState extends ExpandableStringEnum { + /** Static value Succeeded for AppResourceProvisioningState. */ + public static final AppResourceProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** Static value Failed for AppResourceProvisioningState. */ + public static final AppResourceProvisioningState FAILED = fromString("Failed"); + + /** Static value Creating for AppResourceProvisioningState. */ + public static final AppResourceProvisioningState CREATING = fromString("Creating"); + + /** Static value Updating for AppResourceProvisioningState. */ + public static final AppResourceProvisioningState UPDATING = fromString("Updating"); + + /** + * Creates or finds a AppResourceProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding AppResourceProvisioningState. + */ + @JsonCreator + public static AppResourceProvisioningState fromString(String name) { + return fromString(name, AppResourceProvisioningState.class); + } + + /** @return known AppResourceProvisioningState values. */ + public static Collection values() { + return values(AppResourceProvisioningState.class); + } +} diff --git a/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/BindingResourceProperties.java b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/BindingResourceProperties.java new file mode 100644 index 0000000000000..52deb17dbba92 --- /dev/null +++ b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/BindingResourceProperties.java @@ -0,0 +1,202 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** The BindingResourceProperties model. */ +@Fluent +public final class BindingResourceProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(BindingResourceProperties.class); + + /* + * The name of the bound resource + */ + @JsonProperty(value = "resourceName") + private String resourceName; + + /* + * The standard Azure resource type of the bound resource + */ + @JsonProperty(value = "resourceType") + private String resourceType; + + /* + * The Azure resource id of the bound resource + */ + @JsonProperty(value = "resourceId") + private String resourceId; + + /* + * The key of the bound resource + */ + @JsonProperty(value = "key") + private String key; + + /* + * Binding parameters of the Binding resource + */ + @JsonProperty(value = "bindingParameters") + private Map bindingParameters; + + /* + * The generated Spring Boot property file for this binding. The secret + * will be deducted. + */ + @JsonProperty(value = "generatedProperties", access = JsonProperty.Access.WRITE_ONLY) + private String generatedProperties; + + /* + * Creation time of the Binding resource + */ + @JsonProperty(value = "createdAt", access = JsonProperty.Access.WRITE_ONLY) + private String createdAt; + + /* + * Update time of the Binding resource + */ + @JsonProperty(value = "updatedAt", access = JsonProperty.Access.WRITE_ONLY) + private String updatedAt; + + /** + * Get the resourceName property: The name of the bound resource. + * + * @return the resourceName value. + */ + public String resourceName() { + return this.resourceName; + } + + /** + * Set the resourceName property: The name of the bound resource. + * + * @param resourceName the resourceName value to set. + * @return the BindingResourceProperties object itself. + */ + public BindingResourceProperties withResourceName(String resourceName) { + this.resourceName = resourceName; + return this; + } + + /** + * Get the resourceType property: The standard Azure resource type of the bound resource. + * + * @return the resourceType value. + */ + public String resourceType() { + return this.resourceType; + } + + /** + * Set the resourceType property: The standard Azure resource type of the bound resource. + * + * @param resourceType the resourceType value to set. + * @return the BindingResourceProperties object itself. + */ + public BindingResourceProperties withResourceType(String resourceType) { + this.resourceType = resourceType; + return this; + } + + /** + * Get the resourceId property: The Azure resource id of the bound resource. + * + * @return the resourceId value. + */ + public String resourceId() { + return this.resourceId; + } + + /** + * Set the resourceId property: The Azure resource id of the bound resource. + * + * @param resourceId the resourceId value to set. + * @return the BindingResourceProperties object itself. + */ + public BindingResourceProperties withResourceId(String resourceId) { + this.resourceId = resourceId; + return this; + } + + /** + * Get the key property: The key of the bound resource. + * + * @return the key value. + */ + public String key() { + return this.key; + } + + /** + * Set the key property: The key of the bound resource. + * + * @param key the key value to set. + * @return the BindingResourceProperties object itself. + */ + public BindingResourceProperties withKey(String key) { + this.key = key; + return this; + } + + /** + * Get the bindingParameters property: Binding parameters of the Binding resource. + * + * @return the bindingParameters value. + */ + public Map bindingParameters() { + return this.bindingParameters; + } + + /** + * Set the bindingParameters property: Binding parameters of the Binding resource. + * + * @param bindingParameters the bindingParameters value to set. + * @return the BindingResourceProperties object itself. + */ + public BindingResourceProperties withBindingParameters(Map bindingParameters) { + this.bindingParameters = bindingParameters; + return this; + } + + /** + * Get the generatedProperties property: The generated Spring Boot property file for this binding. The secret will + * be deducted. + * + * @return the generatedProperties value. + */ + public String generatedProperties() { + return this.generatedProperties; + } + + /** + * Get the createdAt property: Creation time of the Binding resource. + * + * @return the createdAt value. + */ + public String createdAt() { + return this.createdAt; + } + + /** + * Get the updatedAt property: Update time of the Binding resource. + * + * @return the updatedAt value. + */ + public String updatedAt() { + return this.updatedAt; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/CertificateProperties.java b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/CertificateProperties.java new file mode 100644 index 0000000000000..cbc1c6d505c53 --- /dev/null +++ b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/CertificateProperties.java @@ -0,0 +1,219 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The CertificateProperties model. */ +@Fluent +public final class CertificateProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CertificateProperties.class); + + /* + * The thumbprint of certificate. + */ + @JsonProperty(value = "thumbprint", access = JsonProperty.Access.WRITE_ONLY) + private String thumbprint; + + /* + * The vault uri of user key vault. + */ + @JsonProperty(value = "vaultUri", required = true) + private String vaultUri; + + /* + * The certificate name of key vault. + */ + @JsonProperty(value = "keyVaultCertName", required = true) + private String keyVaultCertName; + + /* + * The certificate version of key vault. + */ + @JsonProperty(value = "certVersion") + private String certVersion; + + /* + * The issuer of certificate. + */ + @JsonProperty(value = "issuer", access = JsonProperty.Access.WRITE_ONLY) + private String issuer; + + /* + * The issue date of certificate. + */ + @JsonProperty(value = "issuedDate", access = JsonProperty.Access.WRITE_ONLY) + private String issuedDate; + + /* + * The expiration date of certificate. + */ + @JsonProperty(value = "expirationDate", access = JsonProperty.Access.WRITE_ONLY) + private String expirationDate; + + /* + * The activate date of certificate. + */ + @JsonProperty(value = "activateDate", access = JsonProperty.Access.WRITE_ONLY) + private String activateDate; + + /* + * The subject name of certificate. + */ + @JsonProperty(value = "subjectName", access = JsonProperty.Access.WRITE_ONLY) + private String subjectName; + + /* + * The domain list of certificate. + */ + @JsonProperty(value = "dnsNames", access = JsonProperty.Access.WRITE_ONLY) + private List dnsNames; + + /** + * Get the thumbprint property: The thumbprint of certificate. + * + * @return the thumbprint value. + */ + public String thumbprint() { + return this.thumbprint; + } + + /** + * Get the vaultUri property: The vault uri of user key vault. + * + * @return the vaultUri value. + */ + public String vaultUri() { + return this.vaultUri; + } + + /** + * Set the vaultUri property: The vault uri of user key vault. + * + * @param vaultUri the vaultUri value to set. + * @return the CertificateProperties object itself. + */ + public CertificateProperties withVaultUri(String vaultUri) { + this.vaultUri = vaultUri; + return this; + } + + /** + * Get the keyVaultCertName property: The certificate name of key vault. + * + * @return the keyVaultCertName value. + */ + public String keyVaultCertName() { + return this.keyVaultCertName; + } + + /** + * Set the keyVaultCertName property: The certificate name of key vault. + * + * @param keyVaultCertName the keyVaultCertName value to set. + * @return the CertificateProperties object itself. + */ + public CertificateProperties withKeyVaultCertName(String keyVaultCertName) { + this.keyVaultCertName = keyVaultCertName; + return this; + } + + /** + * Get the certVersion property: The certificate version of key vault. + * + * @return the certVersion value. + */ + public String certVersion() { + return this.certVersion; + } + + /** + * Set the certVersion property: The certificate version of key vault. + * + * @param certVersion the certVersion value to set. + * @return the CertificateProperties object itself. + */ + public CertificateProperties withCertVersion(String certVersion) { + this.certVersion = certVersion; + return this; + } + + /** + * Get the issuer property: The issuer of certificate. + * + * @return the issuer value. + */ + public String issuer() { + return this.issuer; + } + + /** + * Get the issuedDate property: The issue date of certificate. + * + * @return the issuedDate value. + */ + public String issuedDate() { + return this.issuedDate; + } + + /** + * Get the expirationDate property: The expiration date of certificate. + * + * @return the expirationDate value. + */ + public String expirationDate() { + return this.expirationDate; + } + + /** + * Get the activateDate property: The activate date of certificate. + * + * @return the activateDate value. + */ + public String activateDate() { + return this.activateDate; + } + + /** + * Get the subjectName property: The subject name of certificate. + * + * @return the subjectName value. + */ + public String subjectName() { + return this.subjectName; + } + + /** + * Get the dnsNames property: The domain list of certificate. + * + * @return the dnsNames value. + */ + public List dnsNames() { + return this.dnsNames; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (vaultUri() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property vaultUri in model CertificateProperties")); + } + if (keyVaultCertName() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property keyVaultCertName in model CertificateProperties")); + } + } +} diff --git a/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/ClusterResourceProperties.java b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/ClusterResourceProperties.java new file mode 100644 index 0000000000000..fde846a738c57 --- /dev/null +++ b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/ClusterResourceProperties.java @@ -0,0 +1,127 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The ClusterResourceProperties model. */ +@Fluent +public final class ClusterResourceProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ClusterResourceProperties.class); + + /* + * Provisioning state of the Service + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * Config server git properties of the Service + */ + @JsonProperty(value = "configServerProperties") + private ConfigServerProperties configServerProperties; + + /* + * Trace properties of the Service + */ + @JsonProperty(value = "trace") + private TraceProperties trace; + + /* + * Version of the Service + */ + @JsonProperty(value = "version", access = JsonProperty.Access.WRITE_ONLY) + private Integer version; + + /* + * ServiceInstanceEntity GUID which uniquely identifies a created resource + */ + @JsonProperty(value = "serviceId", access = JsonProperty.Access.WRITE_ONLY) + private String serviceId; + + /** + * Get the provisioningState property: Provisioning state of the Service. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the configServerProperties property: Config server git properties of the Service. + * + * @return the configServerProperties value. + */ + public ConfigServerProperties configServerProperties() { + return this.configServerProperties; + } + + /** + * Set the configServerProperties property: Config server git properties of the Service. + * + * @param configServerProperties the configServerProperties value to set. + * @return the ClusterResourceProperties object itself. + */ + public ClusterResourceProperties withConfigServerProperties(ConfigServerProperties configServerProperties) { + this.configServerProperties = configServerProperties; + return this; + } + + /** + * Get the trace property: Trace properties of the Service. + * + * @return the trace value. + */ + public TraceProperties trace() { + return this.trace; + } + + /** + * Set the trace property: Trace properties of the Service. + * + * @param trace the trace value to set. + * @return the ClusterResourceProperties object itself. + */ + public ClusterResourceProperties withTrace(TraceProperties trace) { + this.trace = trace; + return this; + } + + /** + * Get the version property: Version of the Service. + * + * @return the version value. + */ + public Integer version() { + return this.version; + } + + /** + * Get the serviceId property: ServiceInstanceEntity GUID which uniquely identifies a created resource. + * + * @return the serviceId value. + */ + public String serviceId() { + return this.serviceId; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (configServerProperties() != null) { + configServerProperties().validate(); + } + if (trace() != null) { + trace().validate(); + } + } +} diff --git a/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/ConfigServerGitProperty.java b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/ConfigServerGitProperty.java new file mode 100644 index 0000000000000..042d8f5781c5e --- /dev/null +++ b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/ConfigServerGitProperty.java @@ -0,0 +1,293 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The ConfigServerGitProperty model. */ +@Fluent +public final class ConfigServerGitProperty { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ConfigServerGitProperty.class); + + /* + * Repositories of git. + */ + @JsonProperty(value = "repositories") + private List repositories; + + /* + * URI of the repository + */ + @JsonProperty(value = "uri", required = true) + private String uri; + + /* + * Label of the repository + */ + @JsonProperty(value = "label") + private String label; + + /* + * Searching path of the repository + */ + @JsonProperty(value = "searchPaths") + private List searchPaths; + + /* + * Username of git repository basic auth. + */ + @JsonProperty(value = "username") + private String username; + + /* + * Password of git repository basic auth. + */ + @JsonProperty(value = "password") + private String password; + + /* + * Public sshKey of git repository. + */ + @JsonProperty(value = "hostKey") + private String hostKey; + + /* + * SshKey algorithm of git repository. + */ + @JsonProperty(value = "hostKeyAlgorithm") + private String hostKeyAlgorithm; + + /* + * Private sshKey algorithm of git repository. + */ + @JsonProperty(value = "privateKey") + private String privateKey; + + /* + * Strict host key checking or not. + */ + @JsonProperty(value = "strictHostKeyChecking") + private Boolean strictHostKeyChecking; + + /** + * Get the repositories property: Repositories of git. + * + * @return the repositories value. + */ + public List repositories() { + return this.repositories; + } + + /** + * Set the repositories property: Repositories of git. + * + * @param repositories the repositories value to set. + * @return the ConfigServerGitProperty object itself. + */ + public ConfigServerGitProperty withRepositories(List repositories) { + this.repositories = repositories; + return this; + } + + /** + * Get the uri property: URI of the repository. + * + * @return the uri value. + */ + public String uri() { + return this.uri; + } + + /** + * Set the uri property: URI of the repository. + * + * @param uri the uri value to set. + * @return the ConfigServerGitProperty object itself. + */ + public ConfigServerGitProperty withUri(String uri) { + this.uri = uri; + return this; + } + + /** + * Get the label property: Label of the repository. + * + * @return the label value. + */ + public String label() { + return this.label; + } + + /** + * Set the label property: Label of the repository. + * + * @param label the label value to set. + * @return the ConfigServerGitProperty object itself. + */ + public ConfigServerGitProperty withLabel(String label) { + this.label = label; + return this; + } + + /** + * Get the searchPaths property: Searching path of the repository. + * + * @return the searchPaths value. + */ + public List searchPaths() { + return this.searchPaths; + } + + /** + * Set the searchPaths property: Searching path of the repository. + * + * @param searchPaths the searchPaths value to set. + * @return the ConfigServerGitProperty object itself. + */ + public ConfigServerGitProperty withSearchPaths(List searchPaths) { + this.searchPaths = searchPaths; + return this; + } + + /** + * Get the username property: Username of git repository basic auth. + * + * @return the username value. + */ + public String username() { + return this.username; + } + + /** + * Set the username property: Username of git repository basic auth. + * + * @param username the username value to set. + * @return the ConfigServerGitProperty object itself. + */ + public ConfigServerGitProperty withUsername(String username) { + this.username = username; + return this; + } + + /** + * Get the password property: Password of git repository basic auth. + * + * @return the password value. + */ + public String password() { + return this.password; + } + + /** + * Set the password property: Password of git repository basic auth. + * + * @param password the password value to set. + * @return the ConfigServerGitProperty object itself. + */ + public ConfigServerGitProperty withPassword(String password) { + this.password = password; + return this; + } + + /** + * Get the hostKey property: Public sshKey of git repository. + * + * @return the hostKey value. + */ + public String hostKey() { + return this.hostKey; + } + + /** + * Set the hostKey property: Public sshKey of git repository. + * + * @param hostKey the hostKey value to set. + * @return the ConfigServerGitProperty object itself. + */ + public ConfigServerGitProperty withHostKey(String hostKey) { + this.hostKey = hostKey; + return this; + } + + /** + * Get the hostKeyAlgorithm property: SshKey algorithm of git repository. + * + * @return the hostKeyAlgorithm value. + */ + public String hostKeyAlgorithm() { + return this.hostKeyAlgorithm; + } + + /** + * Set the hostKeyAlgorithm property: SshKey algorithm of git repository. + * + * @param hostKeyAlgorithm the hostKeyAlgorithm value to set. + * @return the ConfigServerGitProperty object itself. + */ + public ConfigServerGitProperty withHostKeyAlgorithm(String hostKeyAlgorithm) { + this.hostKeyAlgorithm = hostKeyAlgorithm; + return this; + } + + /** + * Get the privateKey property: Private sshKey algorithm of git repository. + * + * @return the privateKey value. + */ + public String privateKey() { + return this.privateKey; + } + + /** + * Set the privateKey property: Private sshKey algorithm of git repository. + * + * @param privateKey the privateKey value to set. + * @return the ConfigServerGitProperty object itself. + */ + public ConfigServerGitProperty withPrivateKey(String privateKey) { + this.privateKey = privateKey; + return this; + } + + /** + * Get the strictHostKeyChecking property: Strict host key checking or not. + * + * @return the strictHostKeyChecking value. + */ + public Boolean strictHostKeyChecking() { + return this.strictHostKeyChecking; + } + + /** + * Set the strictHostKeyChecking property: Strict host key checking or not. + * + * @param strictHostKeyChecking the strictHostKeyChecking value to set. + * @return the ConfigServerGitProperty object itself. + */ + public ConfigServerGitProperty withStrictHostKeyChecking(Boolean strictHostKeyChecking) { + this.strictHostKeyChecking = strictHostKeyChecking; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (repositories() != null) { + repositories().forEach(e -> e.validate()); + } + if (uri() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property uri in model ConfigServerGitProperty")); + } + } +} diff --git a/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/ConfigServerProperties.java b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/ConfigServerProperties.java new file mode 100644 index 0000000000000..a44623269ba69 --- /dev/null +++ b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/ConfigServerProperties.java @@ -0,0 +1,97 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The ConfigServerProperties model. */ +@Fluent +public final class ConfigServerProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ConfigServerProperties.class); + + /* + * State of the config server. + */ + @JsonProperty(value = "state", access = JsonProperty.Access.WRITE_ONLY) + private ConfigServerState state; + + /* + * Error when apply config server settings. + */ + @JsonProperty(value = "error") + private Error error; + + /* + * Settings of config server. + */ + @JsonProperty(value = "configServer") + private ConfigServerSettings configServer; + + /** + * Get the state property: State of the config server. + * + * @return the state value. + */ + public ConfigServerState state() { + return this.state; + } + + /** + * Get the error property: Error when apply config server settings. + * + * @return the error value. + */ + public Error error() { + return this.error; + } + + /** + * Set the error property: Error when apply config server settings. + * + * @param error the error value to set. + * @return the ConfigServerProperties object itself. + */ + public ConfigServerProperties withError(Error error) { + this.error = error; + return this; + } + + /** + * Get the configServer property: Settings of config server. + * + * @return the configServer value. + */ + public ConfigServerSettings configServer() { + return this.configServer; + } + + /** + * Set the configServer property: Settings of config server. + * + * @param configServer the configServer value to set. + * @return the ConfigServerProperties object itself. + */ + public ConfigServerProperties withConfigServer(ConfigServerSettings configServer) { + this.configServer = configServer; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (error() != null) { + error().validate(); + } + if (configServer() != null) { + configServer().validate(); + } + } +} diff --git a/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/ConfigServerSettings.java b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/ConfigServerSettings.java new file mode 100644 index 0000000000000..f7d62b02b9ff4 --- /dev/null +++ b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/ConfigServerSettings.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The ConfigServerSettings model. */ +@Fluent +public final class ConfigServerSettings { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ConfigServerSettings.class); + + /* + * Property of git environment. + */ + @JsonProperty(value = "gitProperty") + private ConfigServerGitProperty gitProperty; + + /** + * Get the gitProperty property: Property of git environment. + * + * @return the gitProperty value. + */ + public ConfigServerGitProperty gitProperty() { + return this.gitProperty; + } + + /** + * Set the gitProperty property: Property of git environment. + * + * @param gitProperty the gitProperty value to set. + * @return the ConfigServerSettings object itself. + */ + public ConfigServerSettings withGitProperty(ConfigServerGitProperty gitProperty) { + this.gitProperty = gitProperty; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (gitProperty() != null) { + gitProperty().validate(); + } + } +} diff --git a/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/ConfigServerState.java b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/ConfigServerState.java new file mode 100644 index 0000000000000..488afab778be6 --- /dev/null +++ b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/ConfigServerState.java @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ConfigServerState. */ +public final class ConfigServerState extends ExpandableStringEnum { + /** Static value NotAvailable for ConfigServerState. */ + public static final ConfigServerState NOT_AVAILABLE = fromString("NotAvailable"); + + /** Static value Deleted for ConfigServerState. */ + public static final ConfigServerState DELETED = fromString("Deleted"); + + /** Static value Failed for ConfigServerState. */ + public static final ConfigServerState FAILED = fromString("Failed"); + + /** Static value Succeeded for ConfigServerState. */ + public static final ConfigServerState SUCCEEDED = fromString("Succeeded"); + + /** Static value Updating for ConfigServerState. */ + public static final ConfigServerState UPDATING = fromString("Updating"); + + /** + * Creates or finds a ConfigServerState from its string representation. + * + * @param name a name to look for. + * @return the corresponding ConfigServerState. + */ + @JsonCreator + public static ConfigServerState fromString(String name) { + return fromString(name, ConfigServerState.class); + } + + /** @return known ConfigServerState values. */ + public static Collection values() { + return values(ConfigServerState.class); + } +} diff --git a/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/CustomDomainProperties.java b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/CustomDomainProperties.java new file mode 100644 index 0000000000000..d98b35b605bda --- /dev/null +++ b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/CustomDomainProperties.java @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The CustomDomainProperties model. */ +@Fluent +public final class CustomDomainProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CustomDomainProperties.class); + + /* + * The thumbprint of bound certificate. + */ + @JsonProperty(value = "thumbprint") + private String thumbprint; + + /* + * The app name of domain. + */ + @JsonProperty(value = "appName") + private String appName; + + /* + * The bound certificate name of domain. + */ + @JsonProperty(value = "certName") + private String certName; + + /** + * Get the thumbprint property: The thumbprint of bound certificate. + * + * @return the thumbprint value. + */ + public String thumbprint() { + return this.thumbprint; + } + + /** + * Set the thumbprint property: The thumbprint of bound certificate. + * + * @param thumbprint the thumbprint value to set. + * @return the CustomDomainProperties object itself. + */ + public CustomDomainProperties withThumbprint(String thumbprint) { + this.thumbprint = thumbprint; + return this; + } + + /** + * Get the appName property: The app name of domain. + * + * @return the appName value. + */ + public String appName() { + return this.appName; + } + + /** + * Set the appName property: The app name of domain. + * + * @param appName the appName value to set. + * @return the CustomDomainProperties object itself. + */ + public CustomDomainProperties withAppName(String appName) { + this.appName = appName; + return this; + } + + /** + * Get the certName property: The bound certificate name of domain. + * + * @return the certName value. + */ + public String certName() { + return this.certName; + } + + /** + * Set the certName property: The bound certificate name of domain. + * + * @param certName the certName value to set. + * @return the CustomDomainProperties object itself. + */ + public CustomDomainProperties withCertName(String certName) { + this.certName = certName; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/CustomDomainValidatePayload.java b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/CustomDomainValidatePayload.java new file mode 100644 index 0000000000000..cb3af8d3fe012 --- /dev/null +++ b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/CustomDomainValidatePayload.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The CustomDomainValidatePayload model. */ +@Fluent +public final class CustomDomainValidatePayload { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CustomDomainValidatePayload.class); + + /* + * Name to be validated + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * Get the name property: Name to be validated. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Name to be validated. + * + * @param name the name value to set. + * @return the CustomDomainValidatePayload object itself. + */ + public CustomDomainValidatePayload withName(String name) { + this.name = name; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (name() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property name in model CustomDomainValidatePayload")); + } + } +} diff --git a/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/DeploymentInstance.java b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/DeploymentInstance.java new file mode 100644 index 0000000000000..218634d9ad4af --- /dev/null +++ b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/DeploymentInstance.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The DeploymentInstance model. */ +@Immutable +public final class DeploymentInstance { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DeploymentInstance.class); + + /* + * Name of the deployment instance + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /* + * Status of the deployment instance + */ + @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) + private String status; + + /* + * Failed reason of the deployment instance + */ + @JsonProperty(value = "reason", access = JsonProperty.Access.WRITE_ONLY) + private String reason; + + /* + * Discovery status of the deployment instance + */ + @JsonProperty(value = "discoveryStatus", access = JsonProperty.Access.WRITE_ONLY) + private String discoveryStatus; + + /** + * Get the name property: Name of the deployment instance. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the status property: Status of the deployment instance. + * + * @return the status value. + */ + public String status() { + return this.status; + } + + /** + * Get the reason property: Failed reason of the deployment instance. + * + * @return the reason value. + */ + public String reason() { + return this.reason; + } + + /** + * Get the discoveryStatus property: Discovery status of the deployment instance. + * + * @return the discoveryStatus value. + */ + public String discoveryStatus() { + return this.discoveryStatus; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/DeploymentResourceProperties.java b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/DeploymentResourceProperties.java new file mode 100644 index 0000000000000..35dd214aab007 --- /dev/null +++ b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/DeploymentResourceProperties.java @@ -0,0 +1,177 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** The DeploymentResourceProperties model. */ +@Fluent +public final class DeploymentResourceProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DeploymentResourceProperties.class); + + /* + * Uploaded source information of the deployment. + */ + @JsonProperty(value = "source") + private UserSourceInfo source; + + /* + * App name of the deployment + */ + @JsonProperty(value = "appName", access = JsonProperty.Access.WRITE_ONLY) + private String appName; + + /* + * Deployment settings of the Deployment + */ + @JsonProperty(value = "deploymentSettings") + private DeploymentSettings deploymentSettings; + + /* + * Provisioning state of the Deployment + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private DeploymentResourceProvisioningState provisioningState; + + /* + * Status of the Deployment + */ + @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) + private DeploymentResourceStatus status; + + /* + * Indicates whether the Deployment is active + */ + @JsonProperty(value = "active", access = JsonProperty.Access.WRITE_ONLY) + private Boolean active; + + /* + * Date time when the resource is created + */ + @JsonProperty(value = "createdTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime createdTime; + + /* + * Collection of instances belong to the Deployment + */ + @JsonProperty(value = "instances", access = JsonProperty.Access.WRITE_ONLY) + private List instances; + + /** + * Get the source property: Uploaded source information of the deployment. + * + * @return the source value. + */ + public UserSourceInfo source() { + return this.source; + } + + /** + * Set the source property: Uploaded source information of the deployment. + * + * @param source the source value to set. + * @return the DeploymentResourceProperties object itself. + */ + public DeploymentResourceProperties withSource(UserSourceInfo source) { + this.source = source; + return this; + } + + /** + * Get the appName property: App name of the deployment. + * + * @return the appName value. + */ + public String appName() { + return this.appName; + } + + /** + * Get the deploymentSettings property: Deployment settings of the Deployment. + * + * @return the deploymentSettings value. + */ + public DeploymentSettings deploymentSettings() { + return this.deploymentSettings; + } + + /** + * Set the deploymentSettings property: Deployment settings of the Deployment. + * + * @param deploymentSettings the deploymentSettings value to set. + * @return the DeploymentResourceProperties object itself. + */ + public DeploymentResourceProperties withDeploymentSettings(DeploymentSettings deploymentSettings) { + this.deploymentSettings = deploymentSettings; + return this; + } + + /** + * Get the provisioningState property: Provisioning state of the Deployment. + * + * @return the provisioningState value. + */ + public DeploymentResourceProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the status property: Status of the Deployment. + * + * @return the status value. + */ + public DeploymentResourceStatus status() { + return this.status; + } + + /** + * Get the active property: Indicates whether the Deployment is active. + * + * @return the active value. + */ + public Boolean active() { + return this.active; + } + + /** + * Get the createdTime property: Date time when the resource is created. + * + * @return the createdTime value. + */ + public OffsetDateTime createdTime() { + return this.createdTime; + } + + /** + * Get the instances property: Collection of instances belong to the Deployment. + * + * @return the instances value. + */ + public List instances() { + return this.instances; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (source() != null) { + source().validate(); + } + if (deploymentSettings() != null) { + deploymentSettings().validate(); + } + if (instances() != null) { + instances().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/DeploymentResourceProvisioningState.java b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/DeploymentResourceProvisioningState.java new file mode 100644 index 0000000000000..87dab02b2b2c3 --- /dev/null +++ b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/DeploymentResourceProvisioningState.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for DeploymentResourceProvisioningState. */ +public final class DeploymentResourceProvisioningState + extends ExpandableStringEnum { + /** Static value Creating for DeploymentResourceProvisioningState. */ + public static final DeploymentResourceProvisioningState CREATING = fromString("Creating"); + + /** Static value Updating for DeploymentResourceProvisioningState. */ + public static final DeploymentResourceProvisioningState UPDATING = fromString("Updating"); + + /** Static value Succeeded for DeploymentResourceProvisioningState. */ + public static final DeploymentResourceProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** Static value Failed for DeploymentResourceProvisioningState. */ + public static final DeploymentResourceProvisioningState FAILED = fromString("Failed"); + + /** + * Creates or finds a DeploymentResourceProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding DeploymentResourceProvisioningState. + */ + @JsonCreator + public static DeploymentResourceProvisioningState fromString(String name) { + return fromString(name, DeploymentResourceProvisioningState.class); + } + + /** @return known DeploymentResourceProvisioningState values. */ + public static Collection values() { + return values(DeploymentResourceProvisioningState.class); + } +} diff --git a/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/DeploymentResourceStatus.java b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/DeploymentResourceStatus.java new file mode 100644 index 0000000000000..c171ec186ac9a --- /dev/null +++ b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/DeploymentResourceStatus.java @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for DeploymentResourceStatus. */ +public final class DeploymentResourceStatus extends ExpandableStringEnum { + /** Static value Unknown for DeploymentResourceStatus. */ + public static final DeploymentResourceStatus UNKNOWN = fromString("Unknown"); + + /** Static value Stopped for DeploymentResourceStatus. */ + public static final DeploymentResourceStatus STOPPED = fromString("Stopped"); + + /** Static value Running for DeploymentResourceStatus. */ + public static final DeploymentResourceStatus RUNNING = fromString("Running"); + + /** Static value Failed for DeploymentResourceStatus. */ + public static final DeploymentResourceStatus FAILED = fromString("Failed"); + + /** Static value Allocating for DeploymentResourceStatus. */ + public static final DeploymentResourceStatus ALLOCATING = fromString("Allocating"); + + /** Static value Upgrading for DeploymentResourceStatus. */ + public static final DeploymentResourceStatus UPGRADING = fromString("Upgrading"); + + /** Static value Compiling for DeploymentResourceStatus. */ + public static final DeploymentResourceStatus COMPILING = fromString("Compiling"); + + /** + * Creates or finds a DeploymentResourceStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding DeploymentResourceStatus. + */ + @JsonCreator + public static DeploymentResourceStatus fromString(String name) { + return fromString(name, DeploymentResourceStatus.class); + } + + /** @return known DeploymentResourceStatus values. */ + public static Collection values() { + return values(DeploymentResourceStatus.class); + } +} diff --git a/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/DeploymentSettings.java b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/DeploymentSettings.java new file mode 100644 index 0000000000000..64293725cfa3b --- /dev/null +++ b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/DeploymentSettings.java @@ -0,0 +1,188 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** The DeploymentSettings model. */ +@Fluent +public final class DeploymentSettings { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DeploymentSettings.class); + + /* + * Required CPU, basic tier should be 1, standard tier should be in range + * (1, 4) + */ + @JsonProperty(value = "cpu") + private Integer cpu; + + /* + * Required Memory size in GB, basic tier should be in range (1, 2), + * standard tier should be in range (1, 8) + */ + @JsonProperty(value = "memoryInGB") + private Integer memoryInGB; + + /* + * JVM parameter + */ + @JsonProperty(value = "jvmOptions") + private String jvmOptions; + + /* + * Instance count, basic tier should be in range (1, 25), standard tier + * should be in range (1, 500) + */ + @JsonProperty(value = "instanceCount") + private Integer instanceCount; + + /* + * Collection of environment variables + */ + @JsonProperty(value = "environmentVariables") + private Map environmentVariables; + + /* + * Runtime version + */ + @JsonProperty(value = "runtimeVersion") + private RuntimeVersion runtimeVersion; + + /** + * Get the cpu property: Required CPU, basic tier should be 1, standard tier should be in range (1, 4). + * + * @return the cpu value. + */ + public Integer cpu() { + return this.cpu; + } + + /** + * Set the cpu property: Required CPU, basic tier should be 1, standard tier should be in range (1, 4). + * + * @param cpu the cpu value to set. + * @return the DeploymentSettings object itself. + */ + public DeploymentSettings withCpu(Integer cpu) { + this.cpu = cpu; + return this; + } + + /** + * Get the memoryInGB property: Required Memory size in GB, basic tier should be in range (1, 2), standard tier + * should be in range (1, 8). + * + * @return the memoryInGB value. + */ + public Integer memoryInGB() { + return this.memoryInGB; + } + + /** + * Set the memoryInGB property: Required Memory size in GB, basic tier should be in range (1, 2), standard tier + * should be in range (1, 8). + * + * @param memoryInGB the memoryInGB value to set. + * @return the DeploymentSettings object itself. + */ + public DeploymentSettings withMemoryInGB(Integer memoryInGB) { + this.memoryInGB = memoryInGB; + return this; + } + + /** + * Get the jvmOptions property: JVM parameter. + * + * @return the jvmOptions value. + */ + public String jvmOptions() { + return this.jvmOptions; + } + + /** + * Set the jvmOptions property: JVM parameter. + * + * @param jvmOptions the jvmOptions value to set. + * @return the DeploymentSettings object itself. + */ + public DeploymentSettings withJvmOptions(String jvmOptions) { + this.jvmOptions = jvmOptions; + return this; + } + + /** + * Get the instanceCount property: Instance count, basic tier should be in range (1, 25), standard tier should be in + * range (1, 500). + * + * @return the instanceCount value. + */ + public Integer instanceCount() { + return this.instanceCount; + } + + /** + * Set the instanceCount property: Instance count, basic tier should be in range (1, 25), standard tier should be in + * range (1, 500). + * + * @param instanceCount the instanceCount value to set. + * @return the DeploymentSettings object itself. + */ + public DeploymentSettings withInstanceCount(Integer instanceCount) { + this.instanceCount = instanceCount; + return this; + } + + /** + * Get the environmentVariables property: Collection of environment variables. + * + * @return the environmentVariables value. + */ + public Map environmentVariables() { + return this.environmentVariables; + } + + /** + * Set the environmentVariables property: Collection of environment variables. + * + * @param environmentVariables the environmentVariables value to set. + * @return the DeploymentSettings object itself. + */ + public DeploymentSettings withEnvironmentVariables(Map environmentVariables) { + this.environmentVariables = environmentVariables; + return this; + } + + /** + * Get the runtimeVersion property: Runtime version. + * + * @return the runtimeVersion value. + */ + public RuntimeVersion runtimeVersion() { + return this.runtimeVersion; + } + + /** + * Set the runtimeVersion property: Runtime version. + * + * @param runtimeVersion the runtimeVersion value to set. + * @return the DeploymentSettings object itself. + */ + public DeploymentSettings withRuntimeVersion(RuntimeVersion runtimeVersion) { + this.runtimeVersion = runtimeVersion; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/Error.java b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/Error.java new file mode 100644 index 0000000000000..658e2cf3bf54f --- /dev/null +++ b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/Error.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The Error model. */ +@Fluent +public final class Error { + @JsonIgnore private final ClientLogger logger = new ClientLogger(Error.class); + + /* + * The code of error. + */ + @JsonProperty(value = "code") + private String code; + + /* + * The message of error. + */ + @JsonProperty(value = "message") + private String message; + + /** + * Get the code property: The code of error. + * + * @return the code value. + */ + public String code() { + return this.code; + } + + /** + * Set the code property: The code of error. + * + * @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 property: The message of error. + * + * @return the message value. + */ + public String message() { + return this.message; + } + + /** + * Set the message property: The message of error. + * + * @param message the message value to set. + * @return the Error object itself. + */ + public Error withMessage(String message) { + this.message = message; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/GitPatternRepository.java b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/GitPatternRepository.java new file mode 100644 index 0000000000000..00e9327d27632 --- /dev/null +++ b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/GitPatternRepository.java @@ -0,0 +1,321 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The GitPatternRepository model. */ +@Fluent +public final class GitPatternRepository { + @JsonIgnore private final ClientLogger logger = new ClientLogger(GitPatternRepository.class); + + /* + * Name of the repository + */ + @JsonProperty(value = "name", required = true) + private String name; + + /* + * Collection of pattern of the repository + */ + @JsonProperty(value = "pattern") + private List pattern; + + /* + * URI of the repository + */ + @JsonProperty(value = "uri", required = true) + private String uri; + + /* + * Label of the repository + */ + @JsonProperty(value = "label") + private String label; + + /* + * Searching path of the repository + */ + @JsonProperty(value = "searchPaths") + private List searchPaths; + + /* + * Username of git repository basic auth. + */ + @JsonProperty(value = "username") + private String username; + + /* + * Password of git repository basic auth. + */ + @JsonProperty(value = "password") + private String password; + + /* + * Public sshKey of git repository. + */ + @JsonProperty(value = "hostKey") + private String hostKey; + + /* + * SshKey algorithm of git repository. + */ + @JsonProperty(value = "hostKeyAlgorithm") + private String hostKeyAlgorithm; + + /* + * Private sshKey algorithm of git repository. + */ + @JsonProperty(value = "privateKey") + private String privateKey; + + /* + * Strict host key checking or not. + */ + @JsonProperty(value = "strictHostKeyChecking") + private Boolean strictHostKeyChecking; + + /** + * Get the name property: Name of the repository. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Name of the repository. + * + * @param name the name value to set. + * @return the GitPatternRepository object itself. + */ + public GitPatternRepository withName(String name) { + this.name = name; + return this; + } + + /** + * Get the pattern property: Collection of pattern of the repository. + * + * @return the pattern value. + */ + public List pattern() { + return this.pattern; + } + + /** + * Set the pattern property: Collection of pattern of the repository. + * + * @param pattern the pattern value to set. + * @return the GitPatternRepository object itself. + */ + public GitPatternRepository withPattern(List pattern) { + this.pattern = pattern; + return this; + } + + /** + * Get the uri property: URI of the repository. + * + * @return the uri value. + */ + public String uri() { + return this.uri; + } + + /** + * Set the uri property: URI of the repository. + * + * @param uri the uri value to set. + * @return the GitPatternRepository object itself. + */ + public GitPatternRepository withUri(String uri) { + this.uri = uri; + return this; + } + + /** + * Get the label property: Label of the repository. + * + * @return the label value. + */ + public String label() { + return this.label; + } + + /** + * Set the label property: Label of the repository. + * + * @param label the label value to set. + * @return the GitPatternRepository object itself. + */ + public GitPatternRepository withLabel(String label) { + this.label = label; + return this; + } + + /** + * Get the searchPaths property: Searching path of the repository. + * + * @return the searchPaths value. + */ + public List searchPaths() { + return this.searchPaths; + } + + /** + * Set the searchPaths property: Searching path of the repository. + * + * @param searchPaths the searchPaths value to set. + * @return the GitPatternRepository object itself. + */ + public GitPatternRepository withSearchPaths(List searchPaths) { + this.searchPaths = searchPaths; + return this; + } + + /** + * Get the username property: Username of git repository basic auth. + * + * @return the username value. + */ + public String username() { + return this.username; + } + + /** + * Set the username property: Username of git repository basic auth. + * + * @param username the username value to set. + * @return the GitPatternRepository object itself. + */ + public GitPatternRepository withUsername(String username) { + this.username = username; + return this; + } + + /** + * Get the password property: Password of git repository basic auth. + * + * @return the password value. + */ + public String password() { + return this.password; + } + + /** + * Set the password property: Password of git repository basic auth. + * + * @param password the password value to set. + * @return the GitPatternRepository object itself. + */ + public GitPatternRepository withPassword(String password) { + this.password = password; + return this; + } + + /** + * Get the hostKey property: Public sshKey of git repository. + * + * @return the hostKey value. + */ + public String hostKey() { + return this.hostKey; + } + + /** + * Set the hostKey property: Public sshKey of git repository. + * + * @param hostKey the hostKey value to set. + * @return the GitPatternRepository object itself. + */ + public GitPatternRepository withHostKey(String hostKey) { + this.hostKey = hostKey; + return this; + } + + /** + * Get the hostKeyAlgorithm property: SshKey algorithm of git repository. + * + * @return the hostKeyAlgorithm value. + */ + public String hostKeyAlgorithm() { + return this.hostKeyAlgorithm; + } + + /** + * Set the hostKeyAlgorithm property: SshKey algorithm of git repository. + * + * @param hostKeyAlgorithm the hostKeyAlgorithm value to set. + * @return the GitPatternRepository object itself. + */ + public GitPatternRepository withHostKeyAlgorithm(String hostKeyAlgorithm) { + this.hostKeyAlgorithm = hostKeyAlgorithm; + return this; + } + + /** + * Get the privateKey property: Private sshKey algorithm of git repository. + * + * @return the privateKey value. + */ + public String privateKey() { + return this.privateKey; + } + + /** + * Set the privateKey property: Private sshKey algorithm of git repository. + * + * @param privateKey the privateKey value to set. + * @return the GitPatternRepository object itself. + */ + public GitPatternRepository withPrivateKey(String privateKey) { + this.privateKey = privateKey; + return this; + } + + /** + * Get the strictHostKeyChecking property: Strict host key checking or not. + * + * @return the strictHostKeyChecking value. + */ + public Boolean strictHostKeyChecking() { + return this.strictHostKeyChecking; + } + + /** + * Set the strictHostKeyChecking property: Strict host key checking or not. + * + * @param strictHostKeyChecking the strictHostKeyChecking value to set. + * @return the GitPatternRepository object itself. + */ + public GitPatternRepository withStrictHostKeyChecking(Boolean strictHostKeyChecking) { + this.strictHostKeyChecking = strictHostKeyChecking; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (name() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property name in model GitPatternRepository")); + } + if (uri() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property uri in model GitPatternRepository")); + } + } +} diff --git a/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/LogSpecification.java b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/LogSpecification.java new file mode 100644 index 0000000000000..dd3abe662d5f9 --- /dev/null +++ b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/LogSpecification.java @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The LogSpecification model. */ +@Fluent +public final class LogSpecification { + @JsonIgnore private final ClientLogger logger = new ClientLogger(LogSpecification.class); + + /* + * Name of the log + */ + @JsonProperty(value = "name") + private String name; + + /* + * Localized friendly display name of the log + */ + @JsonProperty(value = "displayName") + private String displayName; + + /* + * Blob duration of the log + */ + @JsonProperty(value = "blobDuration") + private String blobDuration; + + /** + * Get the name property: Name of the log. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Name of the log. + * + * @param name the name value to set. + * @return the LogSpecification object itself. + */ + public LogSpecification withName(String name) { + this.name = name; + return this; + } + + /** + * Get the displayName property: Localized friendly display name of the log. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the displayName property: Localized friendly display name of the log. + * + * @param displayName the displayName value to set. + * @return the LogSpecification object itself. + */ + public LogSpecification withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get the blobDuration property: Blob duration of the log. + * + * @return the blobDuration value. + */ + public String blobDuration() { + return this.blobDuration; + } + + /** + * Set the blobDuration property: Blob duration of the log. + * + * @param blobDuration the blobDuration value to set. + * @return the LogSpecification object itself. + */ + public LogSpecification withBlobDuration(String blobDuration) { + this.blobDuration = blobDuration; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/ManagedIdentityProperties.java b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/ManagedIdentityProperties.java new file mode 100644 index 0000000000000..eeaad7f5b4103 --- /dev/null +++ b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/ManagedIdentityProperties.java @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The ManagedIdentityProperties model. */ +@Fluent +public final class ManagedIdentityProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ManagedIdentityProperties.class); + + /* + * The type property. + */ + @JsonProperty(value = "type") + private ManagedIdentityType type; + + /* + * The principalId property. + */ + @JsonProperty(value = "principalId") + private String principalId; + + /* + * The tenantId property. + */ + @JsonProperty(value = "tenantId") + private String tenantId; + + /** + * Get the type property: The type property. + * + * @return the type value. + */ + public ManagedIdentityType type() { + return this.type; + } + + /** + * Set the type property: The type property. + * + * @param type the type value to set. + * @return the ManagedIdentityProperties object itself. + */ + public ManagedIdentityProperties withType(ManagedIdentityType type) { + this.type = type; + return this; + } + + /** + * Get the principalId property: The principalId property. + * + * @return the principalId value. + */ + public String principalId() { + return this.principalId; + } + + /** + * Set the principalId property: The principalId property. + * + * @param principalId the principalId value to set. + * @return the ManagedIdentityProperties object itself. + */ + public ManagedIdentityProperties withPrincipalId(String principalId) { + this.principalId = principalId; + return this; + } + + /** + * Get the tenantId property: The tenantId property. + * + * @return the tenantId value. + */ + public String tenantId() { + return this.tenantId; + } + + /** + * Set the tenantId property: The tenantId property. + * + * @param tenantId the tenantId value to set. + * @return the ManagedIdentityProperties object itself. + */ + public ManagedIdentityProperties withTenantId(String tenantId) { + this.tenantId = tenantId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/ManagedIdentityType.java b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/ManagedIdentityType.java new file mode 100644 index 0000000000000..5f5f786f44f09 --- /dev/null +++ b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/ManagedIdentityType.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ManagedIdentityType. */ +public final class ManagedIdentityType extends ExpandableStringEnum { + /** Static value None for ManagedIdentityType. */ + public static final ManagedIdentityType NONE = fromString("None"); + + /** Static value SystemAssigned for ManagedIdentityType. */ + public static final ManagedIdentityType SYSTEM_ASSIGNED = fromString("SystemAssigned"); + + /** Static value UserAssigned for ManagedIdentityType. */ + public static final ManagedIdentityType USER_ASSIGNED = fromString("UserAssigned"); + + /** Static value SystemAssigned,UserAssigned for ManagedIdentityType. */ + public static final ManagedIdentityType SYSTEM_ASSIGNED_USER_ASSIGNED = fromString("SystemAssigned,UserAssigned"); + + /** + * Creates or finds a ManagedIdentityType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ManagedIdentityType. + */ + @JsonCreator + public static ManagedIdentityType fromString(String name) { + return fromString(name, ManagedIdentityType.class); + } + + /** @return known ManagedIdentityType values. */ + public static Collection values() { + return values(ManagedIdentityType.class); + } +} diff --git a/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/MetricDimension.java b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/MetricDimension.java new file mode 100644 index 0000000000000..efa8babf26164 --- /dev/null +++ b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/MetricDimension.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The MetricDimension model. */ +@Fluent +public final class MetricDimension { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MetricDimension.class); + + /* + * Name of the dimension + */ + @JsonProperty(value = "name") + private String name; + + /* + * Localized friendly display name of the dimension + */ + @JsonProperty(value = "displayName") + private String displayName; + + /** + * Get the name property: Name of the dimension. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Name of the dimension. + * + * @param name the name value to set. + * @return the MetricDimension object itself. + */ + public MetricDimension withName(String name) { + this.name = name; + return this; + } + + /** + * Get the displayName property: Localized friendly display name of the dimension. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the displayName property: Localized friendly display name of the dimension. + * + * @param displayName the displayName value to set. + * @return the MetricDimension object itself. + */ + public MetricDimension withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/MetricSpecification.java b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/MetricSpecification.java new file mode 100644 index 0000000000000..c2fe877a1992b --- /dev/null +++ b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/MetricSpecification.java @@ -0,0 +1,297 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The MetricSpecification model. */ +@Fluent +public final class MetricSpecification { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MetricSpecification.class); + + /* + * Name of the metric + */ + @JsonProperty(value = "name") + private String name; + + /* + * Localized friendly display name of the metric + */ + @JsonProperty(value = "displayName") + private String displayName; + + /* + * Localized friendly description of the metric + */ + @JsonProperty(value = "displayDescription") + private String displayDescription; + + /* + * Unit that makes sense for the metric + */ + @JsonProperty(value = "unit") + private String unit; + + /* + * Name of the metric category that the metric belongs to. A metric can + * only belong to a single category. + */ + @JsonProperty(value = "category") + private String category; + + /* + * Only provide one value for this field. Valid values: Average, Minimum, + * Maximum, Total, Count. + */ + @JsonProperty(value = "aggregationType") + private String aggregationType; + + /* + * Supported aggregation types + */ + @JsonProperty(value = "supportedAggregationTypes") + private List supportedAggregationTypes; + + /* + * Supported time grain types + */ + @JsonProperty(value = "supportedTimeGrainTypes") + private List supportedTimeGrainTypes; + + /* + * Optional. If set to true, then zero will be returned for time duration + * where no metric is emitted/published. + */ + @JsonProperty(value = "fillGapWithZero") + private Boolean fillGapWithZero; + + /* + * Dimensions of the metric + */ + @JsonProperty(value = "dimensions") + private List dimensions; + + /** + * Get the name property: Name of the metric. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: 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 displayName property: Localized friendly display name of the metric. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the displayName property: Localized friendly 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 displayDescription property: Localized friendly description of the metric. + * + * @return the displayDescription value. + */ + public String displayDescription() { + return this.displayDescription; + } + + /** + * Set the displayDescription property: Localized friendly 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 the unit property: Unit that makes sense for the metric. + * + * @return the unit value. + */ + public String unit() { + return this.unit; + } + + /** + * Set the unit property: Unit that makes sense for the metric. + * + * @param unit the unit value to set. + * @return the MetricSpecification object itself. + */ + public MetricSpecification withUnit(String unit) { + this.unit = unit; + return this; + } + + /** + * Get the category property: Name of the metric category that the metric belongs to. A metric can only belong to a + * single category. + * + * @return the category value. + */ + public String category() { + return this.category; + } + + /** + * Set the category property: Name of the metric category that the metric belongs to. A metric can only belong to a + * single category. + * + * @param category the category value to set. + * @return the MetricSpecification object itself. + */ + public MetricSpecification withCategory(String category) { + this.category = category; + return this; + } + + /** + * Get the aggregationType property: Only provide one value for this field. Valid values: Average, Minimum, Maximum, + * Total, Count. + * + * @return the aggregationType value. + */ + public String aggregationType() { + return this.aggregationType; + } + + /** + * Set the aggregationType property: Only provide one value for this field. Valid values: Average, Minimum, Maximum, + * Total, Count. + * + * @param aggregationType the aggregationType value to set. + * @return the MetricSpecification object itself. + */ + public MetricSpecification withAggregationType(String aggregationType) { + this.aggregationType = aggregationType; + return this; + } + + /** + * Get the supportedAggregationTypes property: Supported aggregation types. + * + * @return the supportedAggregationTypes value. + */ + public List supportedAggregationTypes() { + return this.supportedAggregationTypes; + } + + /** + * Set the supportedAggregationTypes property: Supported aggregation types. + * + * @param supportedAggregationTypes the supportedAggregationTypes value to set. + * @return the MetricSpecification object itself. + */ + public MetricSpecification withSupportedAggregationTypes(List supportedAggregationTypes) { + this.supportedAggregationTypes = supportedAggregationTypes; + return this; + } + + /** + * Get the supportedTimeGrainTypes property: Supported time grain types. + * + * @return the supportedTimeGrainTypes value. + */ + public List supportedTimeGrainTypes() { + return this.supportedTimeGrainTypes; + } + + /** + * Set the supportedTimeGrainTypes property: Supported time grain types. + * + * @param supportedTimeGrainTypes the supportedTimeGrainTypes value to set. + * @return the MetricSpecification object itself. + */ + public MetricSpecification withSupportedTimeGrainTypes(List supportedTimeGrainTypes) { + this.supportedTimeGrainTypes = supportedTimeGrainTypes; + return this; + } + + /** + * Get the fillGapWithZero property: Optional. If set to true, then zero will be returned for time duration where no + * metric is emitted/published. + * + * @return the fillGapWithZero value. + */ + public Boolean fillGapWithZero() { + return this.fillGapWithZero; + } + + /** + * Set the fillGapWithZero property: Optional. If set to true, then zero will be returned for time duration where no + * metric is emitted/published. + * + * @param fillGapWithZero the fillGapWithZero value to set. + * @return the MetricSpecification object itself. + */ + public MetricSpecification withFillGapWithZero(Boolean fillGapWithZero) { + this.fillGapWithZero = fillGapWithZero; + return this; + } + + /** + * Get the dimensions property: Dimensions of the metric. + * + * @return the dimensions value. + */ + public List dimensions() { + return this.dimensions; + } + + /** + * Set the dimensions property: Dimensions of the metric. + * + * @param dimensions the dimensions value to set. + * @return the MetricSpecification object itself. + */ + public MetricSpecification withDimensions(List dimensions) { + this.dimensions = dimensions; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (dimensions() != null) { + dimensions().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/NameAvailabilityParameters.java b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/NameAvailabilityParameters.java new file mode 100644 index 0000000000000..b66eb3e5da154 --- /dev/null +++ b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/NameAvailabilityParameters.java @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The NameAvailabilityParameters model. */ +@Fluent +public final class NameAvailabilityParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(NameAvailabilityParameters.class); + + /* + * Type of the resource to check name availability + */ + @JsonProperty(value = "type", required = true) + private String type; + + /* + * Name to be checked + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * Get the type property: Type of the resource to check name availability. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Set the type property: Type of the resource to check name availability. + * + * @param type the type value to set. + * @return the NameAvailabilityParameters object itself. + */ + public NameAvailabilityParameters withType(String type) { + this.type = type; + return this; + } + + /** + * Get the name property: Name to be checked. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Name to be checked. + * + * @param name the name value to set. + * @return the NameAvailabilityParameters object itself. + */ + public NameAvailabilityParameters withName(String name) { + this.name = name; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (type() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property type in model NameAvailabilityParameters")); + } + if (name() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property name in model NameAvailabilityParameters")); + } + } +} diff --git a/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/OperationDisplay.java b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/OperationDisplay.java new file mode 100644 index 0000000000000..3a9e2be984aae --- /dev/null +++ b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/OperationDisplay.java @@ -0,0 +1,128 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The OperationDisplay model. */ +@Fluent +public final class OperationDisplay { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationDisplay.class); + + /* + * Resource provider of the operation + */ + @JsonProperty(value = "provider") + private String provider; + + /* + * Resource of the operation + */ + @JsonProperty(value = "resource") + private String resource; + + /* + * Localized friendly name for the operation + */ + @JsonProperty(value = "operation") + private String operation; + + /* + * Localized friendly description for the operation + */ + @JsonProperty(value = "description") + private String description; + + /** + * Get the provider property: Resource provider of the operation. + * + * @return the provider value. + */ + public String provider() { + return this.provider; + } + + /** + * Set the provider property: Resource 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 resource property: Resource of the operation. + * + * @return the resource value. + */ + public String resource() { + return this.resource; + } + + /** + * Set the resource property: Resource 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 operation property: Localized friendly name for the operation. + * + * @return the operation value. + */ + public String operation() { + return this.operation; + } + + /** + * Set the operation property: Localized friendly name for 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 property: Localized friendly description for the operation. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: Localized friendly description for the operation. + * + * @param description the description value to set. + * @return the OperationDisplay object itself. + */ + public OperationDisplay withDescription(String description) { + this.description = description; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/OperationProperties.java b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/OperationProperties.java new file mode 100644 index 0000000000000..fdb26b5bff72d --- /dev/null +++ b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/OperationProperties.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The OperationProperties model. */ +@Fluent +public final class OperationProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationProperties.class); + + /* + * Service specifications of the operation + */ + @JsonProperty(value = "serviceSpecification") + private ServiceSpecification serviceSpecification; + + /** + * Get the serviceSpecification property: Service specifications of the operation. + * + * @return the serviceSpecification value. + */ + public ServiceSpecification serviceSpecification() { + return this.serviceSpecification; + } + + /** + * Set the serviceSpecification property: Service specifications of the operation. + * + * @param serviceSpecification the serviceSpecification value to set. + * @return the OperationProperties object itself. + */ + public OperationProperties withServiceSpecification(ServiceSpecification serviceSpecification) { + this.serviceSpecification = serviceSpecification; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (serviceSpecification() != null) { + serviceSpecification().validate(); + } + } +} diff --git a/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/PersistentDisk.java b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/PersistentDisk.java new file mode 100644 index 0000000000000..58ce442a6a980 --- /dev/null +++ b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/PersistentDisk.java @@ -0,0 +1,91 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The PersistentDisk model. */ +@Fluent +public final class PersistentDisk { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PersistentDisk.class); + + /* + * Size of the persistent disk in GB + */ + @JsonProperty(value = "sizeInGB") + private Integer sizeInGB; + + /* + * Size of the used persistent disk in GB + */ + @JsonProperty(value = "usedInGB", access = JsonProperty.Access.WRITE_ONLY) + private Integer usedInGB; + + /* + * Mount path of the persistent disk + */ + @JsonProperty(value = "mountPath") + private String mountPath; + + /** + * Get the sizeInGB property: Size of the persistent disk in GB. + * + * @return the sizeInGB value. + */ + public Integer sizeInGB() { + return this.sizeInGB; + } + + /** + * Set the sizeInGB property: Size of the persistent disk in GB. + * + * @param sizeInGB the sizeInGB value to set. + * @return the PersistentDisk object itself. + */ + public PersistentDisk withSizeInGB(Integer sizeInGB) { + this.sizeInGB = sizeInGB; + return this; + } + + /** + * Get the usedInGB property: Size of the used persistent disk in GB. + * + * @return the usedInGB value. + */ + public Integer usedInGB() { + return this.usedInGB; + } + + /** + * Get the mountPath property: Mount path of the persistent disk. + * + * @return the mountPath value. + */ + public String mountPath() { + return this.mountPath; + } + + /** + * Set the mountPath property: Mount path of the persistent disk. + * + * @param mountPath the mountPath value to set. + * @return the PersistentDisk object itself. + */ + public PersistentDisk withMountPath(String mountPath) { + this.mountPath = mountPath; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/ProvisioningState.java b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/ProvisioningState.java new file mode 100644 index 0000000000000..b8bf927b282b7 --- /dev/null +++ b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/ProvisioningState.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** 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 Deleted for ProvisioningState. */ + public static final ProvisioningState DELETED = fromString("Deleted"); + + /** 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 Moving for ProvisioningState. */ + public static final ProvisioningState MOVING = fromString("Moving"); + + /** Static value Moved for ProvisioningState. */ + public static final ProvisioningState MOVED = fromString("Moved"); + + /** Static value MoveFailed for ProvisioningState. */ + public static final ProvisioningState MOVE_FAILED = fromString("MoveFailed"); + + /** + * 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/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/RegenerateTestKeyRequestPayload.java b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/RegenerateTestKeyRequestPayload.java new file mode 100644 index 0000000000000..71f8d8c6d2cc5 --- /dev/null +++ b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/RegenerateTestKeyRequestPayload.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The RegenerateTestKeyRequestPayload model. */ +@Fluent +public final class RegenerateTestKeyRequestPayload { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RegenerateTestKeyRequestPayload.class); + + /* + * Type of the test key + */ + @JsonProperty(value = "keyType", required = true) + private TestKeyType keyType; + + /** + * Get the keyType property: Type of the test key. + * + * @return the keyType value. + */ + public TestKeyType keyType() { + return this.keyType; + } + + /** + * Set the keyType property: Type of the test key. + * + * @param keyType the keyType value to set. + * @return the RegenerateTestKeyRequestPayload object itself. + */ + public RegenerateTestKeyRequestPayload withKeyType(TestKeyType keyType) { + this.keyType = keyType; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (keyType() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property keyType in model RegenerateTestKeyRequestPayload")); + } + } +} diff --git a/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/ResourceSku.java b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/ResourceSku.java new file mode 100644 index 0000000000000..42e32e16d0433 --- /dev/null +++ b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/ResourceSku.java @@ -0,0 +1,222 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The ResourceSku model. */ +@Fluent +public final class ResourceSku { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ResourceSku.class); + + /* + * Gets the type of resource the SKU applies to. + */ + @JsonProperty(value = "resourceType") + private String resourceType; + + /* + * Gets the name of SKU. + */ + @JsonProperty(value = "name") + private String name; + + /* + * Gets the tier of SKU. + */ + @JsonProperty(value = "tier") + private String tier; + + /* + * Gets the capacity of SKU. + */ + @JsonProperty(value = "capacity") + private SkuCapacity capacity; + + /* + * Gets the set of locations that the SKU is available. + */ + @JsonProperty(value = "locations") + private List locations; + + /* + * Gets a list of locations and availability zones in those locations where + * the SKU is available. + */ + @JsonProperty(value = "locationInfo") + private List locationInfo; + + /* + * Gets the restrictions because of which SKU cannot be used. This is + * empty if there are no restrictions. + */ + @JsonProperty(value = "restrictions") + private List restrictions; + + /** + * Get the resourceType property: Gets the type of resource the SKU applies to. + * + * @return the resourceType value. + */ + public String resourceType() { + return this.resourceType; + } + + /** + * Set the resourceType property: Gets the type of resource the SKU applies to. + * + * @param resourceType the resourceType value to set. + * @return the ResourceSku object itself. + */ + public ResourceSku withResourceType(String resourceType) { + this.resourceType = resourceType; + return this; + } + + /** + * Get the name property: Gets the name of SKU. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Gets the name of SKU. + * + * @param name the name value to set. + * @return the ResourceSku object itself. + */ + public ResourceSku withName(String name) { + this.name = name; + return this; + } + + /** + * Get the tier property: Gets the tier of SKU. + * + * @return the tier value. + */ + public String tier() { + return this.tier; + } + + /** + * Set the tier property: Gets the tier of SKU. + * + * @param tier the tier value to set. + * @return the ResourceSku object itself. + */ + public ResourceSku withTier(String tier) { + this.tier = tier; + return this; + } + + /** + * Get the capacity property: Gets the capacity of SKU. + * + * @return the capacity value. + */ + public SkuCapacity capacity() { + return this.capacity; + } + + /** + * Set the capacity property: Gets the capacity of SKU. + * + * @param capacity the capacity value to set. + * @return the ResourceSku object itself. + */ + public ResourceSku withCapacity(SkuCapacity capacity) { + this.capacity = capacity; + return this; + } + + /** + * Get the locations property: Gets the set of locations that the SKU is available. + * + * @return the locations value. + */ + public List locations() { + return this.locations; + } + + /** + * Set the locations property: Gets the set of locations that the SKU is available. + * + * @param locations the locations value to set. + * @return the ResourceSku object itself. + */ + public ResourceSku withLocations(List locations) { + this.locations = locations; + return this; + } + + /** + * Get the locationInfo property: Gets a list of locations and availability zones in those locations where the SKU + * is available. + * + * @return the locationInfo value. + */ + public List locationInfo() { + return this.locationInfo; + } + + /** + * Set the locationInfo property: Gets a list of locations and availability zones in those locations where the SKU + * is available. + * + * @param locationInfo the locationInfo value to set. + * @return the ResourceSku object itself. + */ + public ResourceSku withLocationInfo(List locationInfo) { + this.locationInfo = locationInfo; + return this; + } + + /** + * Get the restrictions property: Gets 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 property: Gets 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 ResourceSku object itself. + */ + public ResourceSku withRestrictions(List restrictions) { + this.restrictions = restrictions; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (capacity() != null) { + capacity().validate(); + } + if (locationInfo() != null) { + locationInfo().forEach(e -> e.validate()); + } + if (restrictions() != null) { + restrictions().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/ResourceSkuCapabilities.java b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/ResourceSkuCapabilities.java new file mode 100644 index 0000000000000..6db765498a206 --- /dev/null +++ b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/ResourceSkuCapabilities.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The ResourceSkuCapabilities model. */ +@Fluent +public final class ResourceSkuCapabilities { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ResourceSkuCapabilities.class); + + /* + * Gets an invariant to describe the feature. + */ + @JsonProperty(value = "name") + private String name; + + /* + * Gets an invariant if the feature is measured by quantity. + */ + @JsonProperty(value = "value") + private String value; + + /** + * Get the name property: Gets an invariant to describe the feature. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Gets an invariant to describe the feature. + * + * @param name the name value to set. + * @return the ResourceSkuCapabilities object itself. + */ + public ResourceSkuCapabilities withName(String name) { + this.name = name; + return this; + } + + /** + * Get the value property: Gets an invariant if the feature is measured by quantity. + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Set the value property: Gets an invariant if the feature is measured by quantity. + * + * @param value the value value to set. + * @return the ResourceSkuCapabilities object itself. + */ + public ResourceSkuCapabilities withValue(String value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/ResourceSkuLocationInfo.java b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/ResourceSkuLocationInfo.java new file mode 100644 index 0000000000000..439d9f0afa859 --- /dev/null +++ b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/ResourceSkuLocationInfo.java @@ -0,0 +1,106 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The ResourceSkuLocationInfo model. */ +@Fluent +public final class ResourceSkuLocationInfo { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ResourceSkuLocationInfo.class); + + /* + * Gets location of the SKU + */ + @JsonProperty(value = "location") + private String location; + + /* + * Gets list of availability zones where the SKU is supported. + */ + @JsonProperty(value = "zones") + private List zones; + + /* + * Gets details of capabilities available to a SKU in specific zones. + */ + @JsonProperty(value = "zoneDetails") + private List zoneDetails; + + /** + * Get the location property: Gets location of the SKU. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Set the location property: Gets location of the SKU. + * + * @param location the location value to set. + * @return the ResourceSkuLocationInfo object itself. + */ + public ResourceSkuLocationInfo withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the zones property: Gets list of availability zones where the SKU is supported. + * + * @return the zones value. + */ + public List zones() { + return this.zones; + } + + /** + * Set the zones property: Gets list of availability zones where the SKU is supported. + * + * @param zones the zones value to set. + * @return the ResourceSkuLocationInfo object itself. + */ + public ResourceSkuLocationInfo withZones(List zones) { + this.zones = zones; + return this; + } + + /** + * Get the zoneDetails property: Gets details of capabilities available to a SKU in specific zones. + * + * @return the zoneDetails value. + */ + public List zoneDetails() { + return this.zoneDetails; + } + + /** + * Set the zoneDetails property: Gets details of capabilities available to a SKU in specific zones. + * + * @param zoneDetails the zoneDetails value to set. + * @return the ResourceSkuLocationInfo object itself. + */ + public ResourceSkuLocationInfo withZoneDetails(List zoneDetails) { + this.zoneDetails = zoneDetails; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (zoneDetails() != null) { + zoneDetails().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/ResourceSkuRestrictionInfo.java b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/ResourceSkuRestrictionInfo.java new file mode 100644 index 0000000000000..ad66bfad27182 --- /dev/null +++ b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/ResourceSkuRestrictionInfo.java @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The ResourceSkuRestrictionInfo model. */ +@Fluent +public final class ResourceSkuRestrictionInfo { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ResourceSkuRestrictionInfo.class); + + /* + * Gets locations where the SKU is restricted + */ + @JsonProperty(value = "locations") + private List locations; + + /* + * Gets list of availability zones where the SKU is restricted. + */ + @JsonProperty(value = "zones") + private List zones; + + /** + * Get the locations property: Gets locations where the SKU is restricted. + * + * @return the locations value. + */ + public List locations() { + return this.locations; + } + + /** + * Set the locations property: Gets locations where the SKU is restricted. + * + * @param locations the locations value to set. + * @return the ResourceSkuRestrictionInfo object itself. + */ + public ResourceSkuRestrictionInfo withLocations(List locations) { + this.locations = locations; + return this; + } + + /** + * Get the zones property: Gets list of availability zones where the SKU is restricted. + * + * @return the zones value. + */ + public List zones() { + return this.zones; + } + + /** + * Set the zones property: Gets list of availability zones where the SKU is restricted. + * + * @param zones the zones value to set. + * @return the ResourceSkuRestrictionInfo object itself. + */ + public ResourceSkuRestrictionInfo withZones(List zones) { + this.zones = zones; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/ResourceSkuRestrictions.java b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/ResourceSkuRestrictions.java new file mode 100644 index 0000000000000..ae843bfe3c658 --- /dev/null +++ b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/ResourceSkuRestrictions.java @@ -0,0 +1,139 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The ResourceSkuRestrictions model. */ +@Fluent +public final class ResourceSkuRestrictions { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ResourceSkuRestrictions.class); + + /* + * Gets the type of restrictions. Possible values include: 'Location', + * 'Zone' + */ + @JsonProperty(value = "type") + private ResourceSkuRestrictionsType type; + + /* + * Gets 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") + private List values; + + /* + * Gets the information about the restriction where the SKU cannot be used. + */ + @JsonProperty(value = "restrictionInfo") + private ResourceSkuRestrictionInfo restrictionInfo; + + /* + * Gets the reason for restriction. Possible values include: 'QuotaId', + * 'NotAvailableForSubscription' + */ + @JsonProperty(value = "reasonCode") + private ResourceSkuRestrictionsReasonCode reasonCode; + + /** + * Get the type property: Gets the type of restrictions. Possible values include: 'Location', 'Zone'. + * + * @return the type value. + */ + public ResourceSkuRestrictionsType type() { + return this.type; + } + + /** + * Set the type property: Gets the type of restrictions. Possible values include: 'Location', 'Zone'. + * + * @param type the type value to set. + * @return the ResourceSkuRestrictions object itself. + */ + public ResourceSkuRestrictions withType(ResourceSkuRestrictionsType type) { + this.type = type; + return this; + } + + /** + * Get the values property: Gets 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; + } + + /** + * Set the values property: Gets the value of restrictions. If the restriction type is set to location. This would + * be different locations where the SKU is restricted. + * + * @param values the values value to set. + * @return the ResourceSkuRestrictions object itself. + */ + public ResourceSkuRestrictions withValues(List values) { + this.values = values; + return this; + } + + /** + * Get the restrictionInfo property: Gets the information about the restriction where the SKU cannot be used. + * + * @return the restrictionInfo value. + */ + public ResourceSkuRestrictionInfo restrictionInfo() { + return this.restrictionInfo; + } + + /** + * Set the restrictionInfo property: Gets the information about the restriction where the SKU cannot be used. + * + * @param restrictionInfo the restrictionInfo value to set. + * @return the ResourceSkuRestrictions object itself. + */ + public ResourceSkuRestrictions withRestrictionInfo(ResourceSkuRestrictionInfo restrictionInfo) { + this.restrictionInfo = restrictionInfo; + return this; + } + + /** + * Get the reasonCode property: Gets the reason for restriction. Possible values include: 'QuotaId', + * 'NotAvailableForSubscription'. + * + * @return the reasonCode value. + */ + public ResourceSkuRestrictionsReasonCode reasonCode() { + return this.reasonCode; + } + + /** + * Set the reasonCode property: Gets the reason for restriction. Possible values include: 'QuotaId', + * 'NotAvailableForSubscription'. + * + * @param reasonCode the reasonCode value to set. + * @return the ResourceSkuRestrictions object itself. + */ + public ResourceSkuRestrictions withReasonCode(ResourceSkuRestrictionsReasonCode reasonCode) { + this.reasonCode = reasonCode; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (restrictionInfo() != null) { + restrictionInfo().validate(); + } + } +} diff --git a/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/ResourceSkuRestrictionsReasonCode.java b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/ResourceSkuRestrictionsReasonCode.java new file mode 100644 index 0000000000000..6b2bc15da8cb2 --- /dev/null +++ b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/ResourceSkuRestrictionsReasonCode.java @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** 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/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/ResourceSkuRestrictionsType.java b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/ResourceSkuRestrictionsType.java new file mode 100644 index 0000000000000..bd8bbf9208a1f --- /dev/null +++ b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/ResourceSkuRestrictionsType.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ResourceSkuRestrictionsType. */ +public final class ResourceSkuRestrictionsType extends ExpandableStringEnum { + /** Static value Location for ResourceSkuRestrictionsType. */ + public static final ResourceSkuRestrictionsType LOCATION = fromString("Location"); + + /** Static value Zone for ResourceSkuRestrictionsType. */ + public static final ResourceSkuRestrictionsType ZONE = fromString("Zone"); + + /** + * 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/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/ResourceSkuZoneDetails.java b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/ResourceSkuZoneDetails.java new file mode 100644 index 0000000000000..8b7e417fb2140 --- /dev/null +++ b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/ResourceSkuZoneDetails.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The ResourceSkuZoneDetails model. */ +@Fluent +public final class ResourceSkuZoneDetails { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ResourceSkuZoneDetails.class); + + /* + * Gets the set of zones that the SKU is available in with the + * specified capabilities. + */ + @JsonProperty(value = "name") + private List name; + + /* + * Gets a list of capabilities that are available for the SKU in the + * specified list of zones. + */ + @JsonProperty(value = "capabilities") + private List capabilities; + + /** + * Get the name property: Gets the set of zones that the SKU is available in with the specified capabilities. + * + * @return the name value. + */ + public List name() { + return this.name; + } + + /** + * Set the name property: Gets the set of zones that the SKU is available in with the specified capabilities. + * + * @param name the name value to set. + * @return the ResourceSkuZoneDetails object itself. + */ + public ResourceSkuZoneDetails withName(List name) { + this.name = name; + return this; + } + + /** + * Get the capabilities property: Gets a list of capabilities that are available for the SKU in the specified list + * of zones. + * + * @return the capabilities value. + */ + public List capabilities() { + return this.capabilities; + } + + /** + * Set the capabilities property: Gets a list of capabilities that are available for the SKU in the specified list + * of zones. + * + * @param capabilities the capabilities value to set. + * @return the ResourceSkuZoneDetails object itself. + */ + public ResourceSkuZoneDetails withCapabilities(List capabilities) { + this.capabilities = capabilities; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (capabilities() != null) { + capabilities().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/ResourceUploadDefinition.java b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/ResourceUploadDefinition.java new file mode 100644 index 0000000000000..5b3202dbe0a14 --- /dev/null +++ b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/ResourceUploadDefinition.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The ResourceUploadDefinition model. */ +@Fluent +public final class ResourceUploadDefinition { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ResourceUploadDefinition.class); + + /* + * Source relative path + */ + @JsonProperty(value = "relativePath") + private String relativePath; + + /* + * Upload URL + */ + @JsonProperty(value = "uploadUrl") + private String uploadUrl; + + /** + * Get the relativePath property: Source relative path. + * + * @return the relativePath value. + */ + public String relativePath() { + return this.relativePath; + } + + /** + * Set the relativePath property: Source relative path. + * + * @param relativePath the relativePath value to set. + * @return the ResourceUploadDefinition object itself. + */ + public ResourceUploadDefinition withRelativePath(String relativePath) { + this.relativePath = relativePath; + return this; + } + + /** + * Get the uploadUrl property: Upload URL. + * + * @return the uploadUrl value. + */ + public String uploadUrl() { + return this.uploadUrl; + } + + /** + * Set the uploadUrl property: Upload URL. + * + * @param uploadUrl the uploadUrl value to set. + * @return the ResourceUploadDefinition object itself. + */ + public ResourceUploadDefinition withUploadUrl(String uploadUrl) { + this.uploadUrl = uploadUrl; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/RuntimeVersion.java b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/RuntimeVersion.java new file mode 100644 index 0000000000000..389b259eb9f59 --- /dev/null +++ b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/RuntimeVersion.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for RuntimeVersion. */ +public final class RuntimeVersion extends ExpandableStringEnum { + /** Static value Java_8 for RuntimeVersion. */ + public static final RuntimeVersion JAVA_8 = fromString("Java_8"); + + /** Static value Java_11 for RuntimeVersion. */ + public static final RuntimeVersion JAVA_11 = fromString("Java_11"); + + /** + * Creates or finds a RuntimeVersion from its string representation. + * + * @param name a name to look for. + * @return the corresponding RuntimeVersion. + */ + @JsonCreator + public static RuntimeVersion fromString(String name) { + return fromString(name, RuntimeVersion.class); + } + + /** @return known RuntimeVersion values. */ + public static Collection values() { + return values(RuntimeVersion.class); + } +} diff --git a/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/ServiceSpecification.java b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/ServiceSpecification.java new file mode 100644 index 0000000000000..b7e442aee6bf8 --- /dev/null +++ b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/ServiceSpecification.java @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The ServiceSpecification model. */ +@Fluent +public final class ServiceSpecification { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ServiceSpecification.class); + + /* + * Specifications of the Log for Azure Monitoring + */ + @JsonProperty(value = "logSpecifications") + private List logSpecifications; + + /* + * Specifications of the Metrics for Azure Monitoring + */ + @JsonProperty(value = "metricSpecifications") + private List metricSpecifications; + + /** + * Get the logSpecifications property: Specifications of the Log for Azure Monitoring. + * + * @return the logSpecifications value. + */ + public List logSpecifications() { + return this.logSpecifications; + } + + /** + * Set the logSpecifications property: Specifications of the Log for Azure Monitoring. + * + * @param logSpecifications the logSpecifications value to set. + * @return the ServiceSpecification object itself. + */ + public ServiceSpecification withLogSpecifications(List logSpecifications) { + this.logSpecifications = logSpecifications; + return this; + } + + /** + * Get the metricSpecifications property: Specifications of the Metrics for Azure Monitoring. + * + * @return the metricSpecifications value. + */ + public List metricSpecifications() { + return this.metricSpecifications; + } + + /** + * Set the metricSpecifications property: Specifications of the Metrics for Azure Monitoring. + * + * @param metricSpecifications the metricSpecifications value to set. + * @return the ServiceSpecification object itself. + */ + public ServiceSpecification withMetricSpecifications(List metricSpecifications) { + this.metricSpecifications = metricSpecifications; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (logSpecifications() != null) { + logSpecifications().forEach(e -> e.validate()); + } + if (metricSpecifications() != null) { + metricSpecifications().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/Sku.java b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/Sku.java new file mode 100644 index 0000000000000..4b869c3b03522 --- /dev/null +++ b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/Sku.java @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The Sku model. */ +@Fluent +public final class Sku { + @JsonIgnore private final ClientLogger logger = new ClientLogger(Sku.class); + + /* + * Name of the Sku + */ + @JsonProperty(value = "name") + private String name; + + /* + * Tier of the Sku + */ + @JsonProperty(value = "tier") + private String tier; + + /* + * Current capacity of the target resource + */ + @JsonProperty(value = "capacity") + private Integer capacity; + + /** + * Get the name property: Name of the Sku. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Name of the Sku. + * + * @param name the name value to set. + * @return the Sku object itself. + */ + public Sku withName(String name) { + this.name = name; + return this; + } + + /** + * Get the tier property: Tier of the Sku. + * + * @return the tier value. + */ + public String tier() { + return this.tier; + } + + /** + * Set the tier property: Tier of the 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 capacity property: Current capacity of the target resource. + * + * @return the capacity value. + */ + public Integer capacity() { + return this.capacity; + } + + /** + * Set the capacity property: Current capacity of the target resource. + * + * @param capacity the capacity value to set. + * @return the Sku object itself. + */ + public Sku withCapacity(Integer capacity) { + this.capacity = capacity; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/SkuCapacity.java b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/SkuCapacity.java new file mode 100644 index 0000000000000..4240eadd47dc9 --- /dev/null +++ b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/SkuCapacity.java @@ -0,0 +1,128 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The SkuCapacity model. */ +@Fluent +public final class SkuCapacity { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SkuCapacity.class); + + /* + * Gets or sets the minimum. + */ + @JsonProperty(value = "minimum", required = true) + private int minimum; + + /* + * Gets or sets the maximum. + */ + @JsonProperty(value = "maximum") + private Integer maximum; + + /* + * Gets or sets the default. + */ + @JsonProperty(value = "default") + private Integer defaultProperty; + + /* + * Gets or sets the type of the scale. + */ + @JsonProperty(value = "scaleType") + private SkuScaleType scaleType; + + /** + * Get the minimum property: Gets or sets the minimum. + * + * @return the minimum value. + */ + public int minimum() { + return this.minimum; + } + + /** + * Set the minimum property: Gets or sets the minimum. + * + * @param minimum the minimum value to set. + * @return the SkuCapacity object itself. + */ + public SkuCapacity withMinimum(int minimum) { + this.minimum = minimum; + return this; + } + + /** + * Get the maximum property: Gets or sets the maximum. + * + * @return the maximum value. + */ + public Integer maximum() { + return this.maximum; + } + + /** + * Set the maximum property: Gets or sets the maximum. + * + * @param maximum the maximum value to set. + * @return the SkuCapacity object itself. + */ + public SkuCapacity withMaximum(Integer maximum) { + this.maximum = maximum; + return this; + } + + /** + * Get the defaultProperty property: Gets or sets the default. + * + * @return the defaultProperty value. + */ + public Integer defaultProperty() { + return this.defaultProperty; + } + + /** + * Set the defaultProperty property: Gets or sets the default. + * + * @param defaultProperty the defaultProperty value to set. + * @return the SkuCapacity object itself. + */ + public SkuCapacity withDefaultProperty(Integer defaultProperty) { + this.defaultProperty = defaultProperty; + return this; + } + + /** + * Get the scaleType property: Gets or sets the type of the scale. + * + * @return the scaleType value. + */ + public SkuScaleType scaleType() { + return this.scaleType; + } + + /** + * Set the scaleType property: Gets or sets the type of the scale. + * + * @param scaleType the scaleType value to set. + * @return the SkuCapacity object itself. + */ + public SkuCapacity withScaleType(SkuScaleType scaleType) { + this.scaleType = scaleType; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/SkuScaleType.java b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/SkuScaleType.java new file mode 100644 index 0000000000000..12e659cfe3297 --- /dev/null +++ b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/SkuScaleType.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for SkuScaleType. */ +public final class SkuScaleType extends ExpandableStringEnum { + /** Static value None for SkuScaleType. */ + public static final SkuScaleType NONE = fromString("None"); + + /** Static value Manual for SkuScaleType. */ + public static final SkuScaleType MANUAL = fromString("Manual"); + + /** Static value Automatic for SkuScaleType. */ + public static final SkuScaleType AUTOMATIC = fromString("Automatic"); + + /** + * Creates or finds a SkuScaleType from its string representation. + * + * @param name a name to look for. + * @return the corresponding SkuScaleType. + */ + @JsonCreator + public static SkuScaleType fromString(String name) { + return fromString(name, SkuScaleType.class); + } + + /** @return known SkuScaleType values. */ + public static Collection values() { + return values(SkuScaleType.class); + } +} diff --git a/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/SpringApp.java b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/SpringApp.java new file mode 100644 index 0000000000000..a796973d671f4 --- /dev/null +++ b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/SpringApp.java @@ -0,0 +1,261 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.resourcemanager.appplatform.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.implementation.annotation.Beta; +import com.azure.resourcemanager.appplatform.fluent.inner.AppResourceInner; +import com.azure.resourcemanager.resources.fluentcore.arm.models.ExternalChildResource; +import com.azure.resourcemanager.resources.fluentcore.model.Appliable; +import com.azure.resourcemanager.resources.fluentcore.model.Creatable; +import com.azure.resourcemanager.resources.fluentcore.model.HasInner; +import com.azure.resourcemanager.resources.fluentcore.model.Updatable; +import reactor.core.publisher.Mono; + +import java.io.File; +import java.time.OffsetDateTime; + +/** An immutable client-side representation of an Azure Spring App. */ +@Fluent +@Beta +public interface SpringApp + extends ExternalChildResource, + HasInner, + Updatable { + /** @return whether the app exposes public endpoint */ + boolean isPublic(); + + /** @return whether only https is allowed for the app */ + boolean isHttpsOnly(); + + /** @return the url of the app */ + String url(); + + /** @return the temporary disk of the app */ + TemporaryDisk temporaryDisk(); + + /** @return the persistent disk of the app */ + PersistentDisk persistentDisk(); + + /** @return the identity property of the app */ + ManagedIdentityProperties identity(); + + /** @return the creation time of the app */ + OffsetDateTime createdTime(); + + /** @return the active deployment name */ + String activeDeployment(); + + /** @return the entry point of the spring app deployment */ + SpringAppDeployments deployments(); + + /** @return the blob url to upload deployment */ + Mono getResourceUploadUrlAsync(); + + /** @return the blob url to upload deployment */ + ResourceUploadDefinition getResourceUploadUrl(); + + /** Container interface for all the definitions that need to be implemented. */ + interface Definition + extends DefinitionStages.Blank { } + + /** Grouping of all the spring app definition stages. */ + interface DefinitionStages { + /** The first stage of the spring app definition. */ + interface Blank extends WithCreate { } + + /** The stage of a spring app definition allowing to specify the endpoint. */ + interface WithEndpoint { + /** + * Enables the public endpoint for the spring app. + * @return the next stage of spring app definition + */ + WithCreate withPublicEndpoint(); + + /** + * Specifies the custom domain for the spring app. + * @param domain the domain name + * @return the next stage of spring app definition + */ + WithCreate withCustomDomain(String domain); + + /** + * Enables https only for the spring app. + * @return the next stage of spring app definition + */ + WithCreate withHttpsOnly(); + } + + /** The stage of a spring app definition allowing to specify the disk. */ + interface WithDisk { + /** + * Specifies the temporary disk for the spring app. + * @param sizeInGB the size of the disk + * @param mountPath the mount path of the disk + * @return the next stage of spring app definition + */ + WithCreate withTemporaryDisk(int sizeInGB, String mountPath); + + /** + * Specifies the persistent disk for the spring app. + * @param sizeInGB the size of the disk + * @param mountPath the mount path of the disk + * @return the next stage of spring app definition + */ + WithCreate withPersistentDisk(int sizeInGB, String mountPath); + } + + /** + * The stage of a spring app definition allowing to specify an simple active deployment. + * for more operations, use {@link #deployments()} + */ + interface WithDeployment { + /** + * Deploys the jar package for the spring app with default scale. + * @param name the name of the deployment + * @param jarFile the file of the jar + * @return the next stage of spring app definition + */ + WithCreate deployJar(String name, File jarFile); + + /** + * Deploys the source code for the spring app with default scale. + * @param name the name of the deployment + * @param sourceCodeFolder the source code folder + * @param targetModule the target module of the source code + * @return the next stage of spring app definition + */ + WithCreate deploySource(String name, File sourceCodeFolder, String targetModule); + } + + /** + * The stage of the definition which contains all the minimum required inputs for the resource to be created, + * but also allows for any other optional settings to be specified. + */ + interface WithCreate + extends Creatable, + DefinitionStages.WithEndpoint, + DefinitionStages.WithDisk, + DefinitionStages.WithDeployment { } + } + + /** The template for an update operation, containing all the settings that can be modified. */ + interface Update + extends Appliable, + UpdateStages.WithEndpoint, + UpdateStages.WithDisk, + UpdateStages.WithDeployment { } + + /** Grouping of spring app update stages. */ + interface UpdateStages { + /** The stage of a spring app update allowing to specify the endpoint. */ + interface WithEndpoint { + /** + * Enables the public endpoint for the spring app. + * @return the next stage of spring app update + */ + Update withPublicEndpoint(); + + /** + * Disables the public endpoint for the spring app. + * @return the next stage of spring app update + */ + Update withoutPublicEndpoint(); + + /** + * Specifies the custom domain for the spring app. + * @param domain the domain name + * @return the next stage of spring app update + */ + Update withCustomDomain(String domain); + + /** + * Removes the custom domain for the spring app. + * @return the next stage of spring app update + */ + Update withoutCustomDomain(); + + /** + * Enables https only for the spring app. + * @return the next stage of spring app update + */ + Update withHttpsOnly(); + + /** + * Disables https only for the spring app. + * @return the next stage of spring app update + */ + Update withoutHttpsOnly(); + } + + /** The stage of a spring app update allowing to specify the disk. */ + interface WithDisk { + /** + * Specifies the temporary disk for the spring app. + * @param sizeInGB the size of the disk + * @param mountPath the mount path of the disk + * @return the next stage of spring app update + */ + Update withTemporaryDisk(int sizeInGB, String mountPath); + + /** + * Removes the temporary disk for the spring app. + * @return the next stage of spring app update + */ + Update withoutTemporaryDisk(); + + /** + * Specifies the persistent disk for the spring app. + * @param sizeInGB the size of the disk + * @param mountPath the mount path of the disk + * @return the next stage of spring app update + */ + Update withPersistentDisk(int sizeInGB, String mountPath); + + /** + * Removes the persistent disk for the spring app. + * @return the next stage of spring app update + */ + Update withoutPersistentDisk(); + } + + + /** + * The stage of a spring app update allowing to specify an simple active deployment. + * for more operations, use {@link #deployments()} + */ + interface WithDeployment { + /** + * Deploys the jar package for the spring app with default scale. + * @param name the name of the deployment + * @param jarFile the file of the jar + * @return the next stage of spring app update + */ + Update deployJar(String name, File jarFile); + + /** + * Deploys the source code for the spring app with default scale. + * @param name the name of the deployment + * @param sourceCodeFolder the source code folder + * @param targetModule the target module of the source code + * @return the next stage of spring app update + */ + Update deploySource(String name, File sourceCodeFolder, String targetModule); + + /** + * Specifies active deployment for the spring app. + * @param name the name of the deployment + * @return the next stage of spring app update + */ + Update withActiveDeployment(String name); + + /** + * Removes a deployment for the spring app. + * @param name the name of the deployment + * @return the next stage of spring app update + */ + Update withoutDeployment(String name); + } + } +} diff --git a/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/SpringAppDeployment.java b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/SpringAppDeployment.java new file mode 100644 index 0000000000000..1c4f1d368803a --- /dev/null +++ b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/SpringAppDeployment.java @@ -0,0 +1,354 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.resourcemanager.appplatform.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.implementation.annotation.Beta; +import com.azure.resourcemanager.appplatform.fluent.inner.DeploymentResourceInner; +import com.azure.resourcemanager.resources.fluentcore.arm.models.ExternalChildResource; +import com.azure.resourcemanager.resources.fluentcore.model.Appliable; +import com.azure.resourcemanager.resources.fluentcore.model.Creatable; +import com.azure.resourcemanager.resources.fluentcore.model.HasInner; +import com.azure.resourcemanager.resources.fluentcore.model.Updatable; +import reactor.core.publisher.Mono; + +import java.io.File; +import java.time.OffsetDateTime; +import java.util.List; + +/** An immutable client-side representation of an Azure deployment Deployment request. */ +@Fluent +@Beta +public interface SpringAppDeployment + extends ExternalChildResource, + HasInner, + Updatable { + /** @return the app name of the deployment */ + String appName(); + + /** @return the deploy settings of the deployment */ + DeploymentSettings settings(); + + /** @return the status of the deployment */ + DeploymentResourceStatus status(); + + /** @return whether the deployment is active */ + boolean isActive(); + + /** @return the creation time of the deployment */ + OffsetDateTime createdTime(); + + /** @return all the instances of the deployment */ + List instances(); + + /** @return the log file url of the deployment */ + String getLogFileUrl(); + + /** @return the log file url of the deployment */ + Mono getLogFileUrlAsync(); + + /** Container interface for all the definitions that need to be implemented. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithSource, + DefinitionStages.WithModule, + DefinitionStages.WithPredefinedSettings, + DefinitionStages.WithSettingsAndCreate { } + + /** Grouping of all the deployment definition stages. */ + interface DefinitionStages { + /** The first stage of the deployment definition. */ + interface Blank extends WithSource { } + + /** The stage of a deployment definition allowing to specify the source code or package. */ + interface WithSource { + /** + * Specifies the jar package for the deployment. + * @param jar the file of the jar + * @return the next stage of deployment definition + */ + WithPredefinedSettings withJarFile(File jar); + + /** + * Specifies the source code for the deployment. + * @param sourceCodeFolder the folder of the source code + * @return the next stage of deployment definition + */ + WithModule withSourceCodeFolder(File sourceCodeFolder); + + /** + * Specifies the source code for the deployment. + * @param sourceCodeTarGz a tar.gz file of the source code + * @return the next stage of deployment definition + */ + WithModule withSourceCodeTarGzFile(File sourceCodeTarGz); + + /** + * Specifies the a existing source in the cloud storage. + * @param type the source type in previous upload + * @param relativePath the relative path gotten from getResourceUploadUrl + * @return the next stage of deployment definition + */ + WithPredefinedSettings withExistingSource(UserSourceType type, String relativePath); + } + + /** The stage of a deployment definition allowing to specify the module of the source code. */ + interface WithModule { + /** + * Specifies the module of the source code. + * @param moduleName the target module of the multi-module source code + * @return the next stage of deployment definition + */ + WithPredefinedSettings withTargetModule(String moduleName); + + /** + * Specifies the only module of the source code. + * @return the next stage of deployment definition + */ + WithPredefinedSettings withSingleModule(); + } + + /** The stage of a deployment definition allowing to specify predefined settings. */ + interface WithPredefinedSettings { + /** + * Specifies the settings from the app active deployment. + * @return the next stage of deployment definition + */ + WithCreate withSettingsFromActiveDeployment(); + + /** + * Specifies the settings from another deployment. + * @param deployment the deployment object + * @return the next stage of deployment definition + */ + WithCreate withSettingsFromDeployment(SpringAppDeployment deployment); + + /** + * Specifies the settings from another deployment. + * @param deploymentName the name of the deployment + * @return the next stage of deployment definition + */ + WithCreate withSettingsFromDeployment(String deploymentName); + + /** + * Customizes settings of the deployment. + * @return the next stage of deployment definition + */ + WithSettingsAndCreate withCustomSetting(); + } + + /** The stage of a deployment definition allowing to specify deployment settings. */ + interface WithSettings { + /** + * Specifies the instance number of the deployment. + * @param count the number of the instance + * @return the next stage of deployment definition + */ + WithSettingsAndCreate withInstance(int count); + + /** + * Specifies the cpu number of the deployment. + * @param cpuCount the number of the cpu + * @return the next stage of deployment definition + */ + WithSettingsAndCreate withCpu(int cpuCount); + + /** + * Specifies the memory of the deployment. + * @param sizeInGB the size of the memory in GB + * @return the next stage of deployment definition + */ + WithSettingsAndCreate withMemory(int sizeInGB); + + /** + * Specifies the runtime version of the deployment. + * @param version the runtime version of Java + * @return the next stage of deployment definition + */ + WithSettingsAndCreate withRuntime(RuntimeVersion version); + + /** + * Specifies the jvm options of the deployment. + * @param jvmOptions the argument of jvm + * @return the next stage of deployment definition + */ + WithSettingsAndCreate withJvmOptions(String jvmOptions); + + /** + * Specifies a environment variable of the deployment. + * @param key the key of the environment + * @param value the value of the environment + * @return the next stage of deployment definition + */ + WithSettingsAndCreate withEnvironment(String key, String value); + + /** + * Specifies the version of the deployment. + * @param versionName the version name of the deployment + * @return the next stage of deployment definition + */ + WithSettingsAndCreate withVersionName(String versionName); + + /** + * Activates of the deployment after definition. + * @return the next stage of deployment definition + */ + WithSettingsAndCreate withActivation(); + } + + interface WithBaseSettings { + /** + * Specifies the version of the deployment. + * @param versionName the version name of the deployment + * @return the next stage of deployment definition + */ + WithCreate withVersionName(String versionName); + + /** + * Activates of the deployment after definition. + * @return the next stage of deployment definition + */ + WithCreate withActivation(); + } + + /** + * The stage of the definition which contains all required inputs for the resource to be created. + */ + interface WithCreate + extends Creatable, + WithBaseSettings { } + + /** + * The stage of the definition which contains all the minimum required inputs for the resource to be created, + * but also allows for any other optional settings to be specified. + */ + interface WithSettingsAndCreate + extends WithCreate, + WithSettings { } + } + + /** The template for an update operation, containing all the settings that can be modified. */ + interface Update + extends Appliable, + UpdateStages.WithSource, + UpdateStages.WithModule, + UpdateStages.WithSettings { } + + /** Grouping of deployment update stages. */ + interface UpdateStages { + /** The stage of a deployment update allowing to specify deployment settings. */ + interface WithSettings { + /** + * Specifies the instance number of the deployment. + * @param count the number of the instance + * @return the next stage of deployment update + */ + Update withInstance(int count); + + /** + * Specifies the cpu number of the deployment. + * @param cpuCount the number of the cpu + * @return the next stage of deployment update + */ + Update withCpu(int cpuCount); + + /** + * Specifies the memory of the deployment. + * @param sizeInGB the size of the memory in GB + * @return the next stage of deployment update + */ + Update withMemory(int sizeInGB); + + /** + * Specifies the runtime version of the deployment. + * @param version the runtime version of Java + * @return the next stage of deployment update + */ + Update withRuntime(RuntimeVersion version); + + /** + * Specifies the jvm options of the deployment. + * @param jvmOptions the argument of jvm + * @return the next stage of deployment update + */ + Update withJvmOptions(String jvmOptions); + + /** + * Specifies a environment variable of the deployment. + * @param key the key of the environment + * @param value the value of the environment + * @return the next stage of deployment update + */ + Update withEnvironment(String key, String value); + + /** + * Removes a environment variable of the deployment. + * @param key the key of the environment + * @return the next stage of deployment update + */ + Update withoutEnvironment(String key); + + /** + * Specifies the version of the deployment. + * @param versionName the version name of the deployment + * @return the next stage of deployment update + */ + Update withVersionName(String versionName); + + /** + * Activates of the deployment after update. + * @return the next stage of deployment update + */ + Update withActivation(); + } + + /** The stage of a deployment update allowing to specify the source code or package. */ + interface WithSource { + /** + * Specifies the jar package for the deployment. + * @param jar the file of the jar + * @return the next stage of deployment update + */ + Update withJarFile(File jar); + + /** + * Specifies the source code for the deployment. + * @param sourceCodeFolder the folder of the source code + * @return the next stage of deployment update + */ + WithModule withSourceCodeFolder(File sourceCodeFolder); + + /** + * Specifies the source code for the deployment. + * @param sourceCodeTarGz a tar.gz file of the source code + * @return the next stage of deployment update + */ + WithModule withSourceCodeTarGzFile(File sourceCodeTarGz); + + /** + * Specifies the a existing source in the cloud storage. + * @param type the source type in previous upload + * @param relativePath the relative path gotten from getResourceUploadUrl + * @return the next stage of deployment update + */ + Update withExistingSource(UserSourceType type, String relativePath); + } + + /** The stage of a deployment update allowing to specify the module of the source code. */ + interface WithModule { + /** + * Specifies the module of the source code. + * @param moduleName the target module of the multi-module source code + * @return the next stage of deployment update + */ + Update withTargetModule(String moduleName); + + /** + * Specifies the only module of the source code. + * @return the next stage of deployment update + */ + Update withSingleModule(); + } + } +} diff --git a/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/SpringAppDeployments.java b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/SpringAppDeployments.java new file mode 100644 index 0000000000000..94b05124a722e --- /dev/null +++ b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/SpringAppDeployments.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.resourcemanager.appplatform.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.implementation.annotation.Beta; +import com.azure.resourcemanager.appplatform.AppPlatformManager; +import com.azure.resourcemanager.appplatform.fluent.DeploymentsClient; +import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsGettingById; +import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsGettingByName; +import com.azure.resourcemanager.resources.fluentcore.arm.models.HasManager; +import com.azure.resourcemanager.resources.fluentcore.arm.models.HasParent; +import com.azure.resourcemanager.resources.fluentcore.collection.SupportsCreating; +import com.azure.resourcemanager.resources.fluentcore.collection.SupportsDeletingById; +import com.azure.resourcemanager.resources.fluentcore.collection.SupportsDeletingByName; +import com.azure.resourcemanager.resources.fluentcore.collection.SupportsListing; +import com.azure.resourcemanager.resources.fluentcore.model.HasInner; + +/** Entry point for Spring App Deployments API. */ +@Fluent +@Beta +public interface SpringAppDeployments + extends HasManager, + HasInner, + HasParent, + SupportsCreating, + SupportsGettingById, + SupportsGettingByName, + SupportsListing, + SupportsDeletingById, + SupportsDeletingByName { +} diff --git a/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/SpringApps.java b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/SpringApps.java new file mode 100644 index 0000000000000..d2cb8fe70155d --- /dev/null +++ b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/SpringApps.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.resourcemanager.appplatform.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.implementation.annotation.Beta; +import com.azure.resourcemanager.appplatform.AppPlatformManager; +import com.azure.resourcemanager.appplatform.fluent.AppsClient; +import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsGettingById; +import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsGettingByName; +import com.azure.resourcemanager.resources.fluentcore.arm.models.HasManager; +import com.azure.resourcemanager.resources.fluentcore.arm.models.HasParent; +import com.azure.resourcemanager.resources.fluentcore.collection.SupportsCreating; +import com.azure.resourcemanager.resources.fluentcore.collection.SupportsDeletingById; +import com.azure.resourcemanager.resources.fluentcore.collection.SupportsDeletingByName; +import com.azure.resourcemanager.resources.fluentcore.collection.SupportsListing; +import com.azure.resourcemanager.resources.fluentcore.model.HasInner; + +/** Entry point for Spring Apps API. */ +@Fluent +@Beta +public interface SpringApps + extends HasManager, + HasInner, + HasParent, + SupportsCreating, + SupportsGettingById, + SupportsGettingByName, + SupportsListing, + SupportsDeletingById, + SupportsDeletingByName { +} diff --git a/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/SpringService.java b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/SpringService.java new file mode 100644 index 0000000000000..6403422be52d5 --- /dev/null +++ b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/SpringService.java @@ -0,0 +1,236 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.resourcemanager.appplatform.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.implementation.annotation.Beta; +import com.azure.resourcemanager.appplatform.AppPlatformManager; +import com.azure.resourcemanager.appplatform.fluent.inner.ServiceResourceInner; +import com.azure.resourcemanager.resources.fluentcore.arm.models.GroupableResource; +import com.azure.resourcemanager.resources.fluentcore.arm.models.Resource; +import com.azure.resourcemanager.resources.fluentcore.model.Appliable; +import com.azure.resourcemanager.resources.fluentcore.model.Creatable; +import com.azure.resourcemanager.resources.fluentcore.model.Refreshable; +import com.azure.resourcemanager.resources.fluentcore.model.Updatable; +import reactor.core.publisher.Mono; + +/** An immutable client-side representation of an Azure Spring Service. */ +@Fluent +@Beta +public interface SpringService + extends GroupableResource, + Refreshable, + Updatable { + + /** @return Sku of the service */ + Sku sku(); + + /** @return Trace properties of the service */ + TraceProperties traceProperties(); + + /** @return server properties of the service */ + ConfigServerProperties serverProperties(); + + /** @return the entry point of the spring app */ + SpringApps apps(); + + /** + * Lists test keys for the service. + * @return all test keys + */ + TestKeys listTestKeys(); + + /** + * Lists test keys for the service. + * @return all test keys + */ + Mono listTestKeysAsync(); + + /** + * Regenerates a test key for the Service. + * @param keyType the type of the regenerated key + * @return all test keys + */ + TestKeys regenerateTestKeys(TestKeyType keyType); + + /** + * Regenerates a test key for the Service. + * @param keyType the type of the regenerated key + * @return all test keys + */ + Mono regenerateTestKeysAsync(TestKeyType keyType); + + /** + * Disables the test endpoint for the service. + */ + void disableTestEndpoint(); + + /** + * Disables the test endpoint for the service. + * @return null + */ + Mono disableTestEndpointAsync(); + + /** + * Enables the test endpoint for the service. + * @return all test keys + */ + TestKeys enableTestEndpoint(); + + /** + * Enables the test endpoint for the service. + * @return all test keys + */ + Mono enableTestEndpointAsync(); + + /** Container interface for all the definitions that need to be implemented. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithGroup, + DefinitionStages.WithCreate { } + + /** Grouping of all the spring service definition stages. */ + interface DefinitionStages { + /** The first stage of the spring service definition. */ + interface Blank extends GroupableResource.DefinitionWithRegion { } + + /** The stage of a spring service definition allowing to specify the resource group. */ + interface WithGroup extends GroupableResource.DefinitionStages.WithGroup { } + + /** + * The stage of a spring service definition allowing to specify sku. + * All sku supported could be gotten from {@link SpringServices#listSkus()}. + */ + interface WithSku { + /** + * Specifies the sku of the spring service. + * @param skuName the sku name + * @return the next stage of spring service definition + */ + WithCreate withSku(String skuName); + + /** + * Specifies the sku of the spring service. + * @param skuName the sku name + * @param capacity the capacity for the spring service + * @return the next stage of spring service definition + */ + WithCreate withSku(String skuName, int capacity); + + /** + * Specifies the sku of the spring service. + * @param sku the entire sku object + * @return the next stage of spring service definition + */ + WithCreate withSku(Sku sku); + } + + /** The stage of a spring service definition allowing to specify tracing with app insight. */ + interface WithTracing { + /** + * Specifies tracing property with app insight + * @param appInsightInstrumentationKey the app insight instrumentation key + * @return the next stage of spring service definition + */ + WithCreate withTracing(String appInsightInstrumentationKey); + } + + /** + * The stage of the definition which contains all the minimum required inputs for the resource to be created, + * but also allows for any other optional settings to be specified. + */ + interface WithCreate + extends Creatable, + Resource.DefinitionWithTags, + WithSku, + WithTracing { } + } + + /** The template for an update operation, containing all the settings that can be modified. */ + interface Update + extends Appliable, + Resource.UpdateWithTags, + UpdateStages.WithSku, + UpdateStages.WithTracing, + UpdateStages.WithConfiguration { } + + /** Grouping of spring service update stages. */ + interface UpdateStages { + /** + * The stage of a spring service update allowing to specify sku. + * All sku supported could be gotten from {@link SpringServices#listSkus()}. + */ + interface WithSku { + /** + * Specifies the sku of the spring service. + * @param skuName the sku name + * @return the next stage of spring service update + */ + Update withSku(String skuName); + + /** + * Specifies the sku of the spring service. + * @param skuName the sku name + * @param capacity the capacity for the spring service + * @return the next stage of spring service update + */ + Update withSku(String skuName, int capacity); + + /** + * Specifies the sku of the spring service. + * @param sku the entire sku object + * @return the next stage of spring service update + */ + Update withSku(Sku sku); + } + + /** The stage of a spring service update allowing to specify tracing with app insight. */ + interface WithTracing { + /** + * Specifies tracing property with app insight. + * @param appInsightInstrumentationKey the app insight instrumentation key + * @return the next stage of spring service update + */ + Update withTracing(String appInsightInstrumentationKey); + + /** + * Removes tracing property. + * @return the next stage of spring service update + */ + Update withoutTracing(); + } + + /** The stage of a spring service update allowing to specify the server configuration. */ + interface WithConfiguration { + /** + * Specifies the git repository for the spring service. + * @param uri the uri of the git repository + * @return the next stage of spring service update + */ + Update withGitUri(String uri); + + /** + * Specifies the git repository for the spring service. + * @param uri the uri of the git repository + * @param username the username of the private git repository + * @param password the password of the private git repository + * @return the next stage of spring service update + */ + Update withGitUriAndCredential(String uri, String username, String password); + + /** + * Specifies the git repository for the spring service. + * @param gitConfig the configuration of the git repository + * @return the next stage of spring service update + */ + Update withGitConfig(ConfigServerGitProperty gitConfig); + + /** + * Removes the git configuration. + * @return the next stage of spring service update + */ + Update withoutGitConfig(); + } + } +} diff --git a/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/SpringServices.java b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/SpringServices.java new file mode 100644 index 0000000000000..861f7a4eca58d --- /dev/null +++ b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/SpringServices.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.resourcemanager.appplatform.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.implementation.annotation.Beta; +import com.azure.resourcemanager.appplatform.AppPlatformManager; +import com.azure.resourcemanager.appplatform.fluent.ServicesClient; +import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsDeletingByResourceGroup; +import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsGettingById; +import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsGettingByResourceGroup; +import com.azure.resourcemanager.resources.fluentcore.arm.collection.SupportsListingByResourceGroup; +import com.azure.resourcemanager.resources.fluentcore.arm.models.HasManager; +import com.azure.resourcemanager.resources.fluentcore.collection.SupportsCreating; +import com.azure.resourcemanager.resources.fluentcore.collection.SupportsDeletingById; +import com.azure.resourcemanager.resources.fluentcore.collection.SupportsListing; +import com.azure.resourcemanager.resources.fluentcore.model.HasInner; + +/** Entry point for Spring Service management API. */ +@Fluent +@Beta +public interface SpringServices + extends HasManager, + HasInner, + SupportsCreating, + SupportsGettingById, + SupportsGettingByResourceGroup, + SupportsListing, + SupportsListingByResourceGroup, + SupportsDeletingById, + SupportsDeletingByResourceGroup { + /** @return all available sku. */ + PagedIterable listSkus(); + + /** @return all available sku. */ + PagedFlux listSkusAsync(); +} diff --git a/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/TemporaryDisk.java b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/TemporaryDisk.java new file mode 100644 index 0000000000000..f40fe05185cec --- /dev/null +++ b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/TemporaryDisk.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The TemporaryDisk model. */ +@Fluent +public final class TemporaryDisk { + @JsonIgnore private final ClientLogger logger = new ClientLogger(TemporaryDisk.class); + + /* + * Size of the temporary disk in GB + */ + @JsonProperty(value = "sizeInGB") + private Integer sizeInGB; + + /* + * Mount path of the temporary disk + */ + @JsonProperty(value = "mountPath") + private String mountPath; + + /** + * Get the sizeInGB property: Size of the temporary disk in GB. + * + * @return the sizeInGB value. + */ + public Integer sizeInGB() { + return this.sizeInGB; + } + + /** + * Set the sizeInGB property: Size of the temporary disk in GB. + * + * @param sizeInGB the sizeInGB value to set. + * @return the TemporaryDisk object itself. + */ + public TemporaryDisk withSizeInGB(Integer sizeInGB) { + this.sizeInGB = sizeInGB; + return this; + } + + /** + * Get the mountPath property: Mount path of the temporary disk. + * + * @return the mountPath value. + */ + public String mountPath() { + return this.mountPath; + } + + /** + * Set the mountPath property: Mount path of the temporary disk. + * + * @param mountPath the mountPath value to set. + * @return the TemporaryDisk object itself. + */ + public TemporaryDisk withMountPath(String mountPath) { + this.mountPath = mountPath; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/TestKeyType.java b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/TestKeyType.java new file mode 100644 index 0000000000000..df7eb484d7046 --- /dev/null +++ b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/TestKeyType.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for TestKeyType. */ +public final class TestKeyType extends ExpandableStringEnum { + /** Static value Primary for TestKeyType. */ + public static final TestKeyType PRIMARY = fromString("Primary"); + + /** Static value Secondary for TestKeyType. */ + public static final TestKeyType SECONDARY = fromString("Secondary"); + + /** + * Creates or finds a TestKeyType from its string representation. + * + * @param name a name to look for. + * @return the corresponding TestKeyType. + */ + @JsonCreator + public static TestKeyType fromString(String name) { + return fromString(name, TestKeyType.class); + } + + /** @return known TestKeyType values. */ + public static Collection values() { + return values(TestKeyType.class); + } +} diff --git a/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/TestKeys.java b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/TestKeys.java new file mode 100644 index 0000000000000..b0e1427bcafd3 --- /dev/null +++ b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/TestKeys.java @@ -0,0 +1,154 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The TestKeys model. */ +@Fluent +public final class TestKeys { + @JsonIgnore private final ClientLogger logger = new ClientLogger(TestKeys.class); + + /* + * Primary key + */ + @JsonProperty(value = "primaryKey") + private String primaryKey; + + /* + * Secondary key + */ + @JsonProperty(value = "secondaryKey") + private String secondaryKey; + + /* + * Primary test endpoint + */ + @JsonProperty(value = "primaryTestEndpoint") + private String primaryTestEndpoint; + + /* + * Secondary test endpoint + */ + @JsonProperty(value = "secondaryTestEndpoint") + private String secondaryTestEndpoint; + + /* + * Indicates whether the test endpoint feature enabled or not + */ + @JsonProperty(value = "enabled") + private Boolean enabled; + + /** + * Get the primaryKey property: Primary key. + * + * @return the primaryKey value. + */ + public String primaryKey() { + return this.primaryKey; + } + + /** + * Set the primaryKey property: Primary key. + * + * @param primaryKey the primaryKey value to set. + * @return the TestKeys object itself. + */ + public TestKeys withPrimaryKey(String primaryKey) { + this.primaryKey = primaryKey; + return this; + } + + /** + * Get the secondaryKey property: Secondary key. + * + * @return the secondaryKey value. + */ + public String secondaryKey() { + return this.secondaryKey; + } + + /** + * Set the secondaryKey property: Secondary key. + * + * @param secondaryKey the secondaryKey value to set. + * @return the TestKeys object itself. + */ + public TestKeys withSecondaryKey(String secondaryKey) { + this.secondaryKey = secondaryKey; + return this; + } + + /** + * Get the primaryTestEndpoint property: Primary test endpoint. + * + * @return the primaryTestEndpoint value. + */ + public String primaryTestEndpoint() { + return this.primaryTestEndpoint; + } + + /** + * Set the primaryTestEndpoint property: Primary test endpoint. + * + * @param primaryTestEndpoint the primaryTestEndpoint value to set. + * @return the TestKeys object itself. + */ + public TestKeys withPrimaryTestEndpoint(String primaryTestEndpoint) { + this.primaryTestEndpoint = primaryTestEndpoint; + return this; + } + + /** + * Get the secondaryTestEndpoint property: Secondary test endpoint. + * + * @return the secondaryTestEndpoint value. + */ + public String secondaryTestEndpoint() { + return this.secondaryTestEndpoint; + } + + /** + * Set the secondaryTestEndpoint property: Secondary test endpoint. + * + * @param secondaryTestEndpoint the secondaryTestEndpoint value to set. + * @return the TestKeys object itself. + */ + public TestKeys withSecondaryTestEndpoint(String secondaryTestEndpoint) { + this.secondaryTestEndpoint = secondaryTestEndpoint; + return this; + } + + /** + * Get the enabled property: Indicates whether the test endpoint feature enabled or not. + * + * @return the enabled value. + */ + public Boolean enabled() { + return this.enabled; + } + + /** + * Set the enabled property: Indicates whether the test endpoint feature enabled or not. + * + * @param enabled the enabled value to set. + * @return the TestKeys object itself. + */ + public TestKeys withEnabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/TraceProperties.java b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/TraceProperties.java new file mode 100644 index 0000000000000..ddf58267be249 --- /dev/null +++ b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/TraceProperties.java @@ -0,0 +1,120 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The TraceProperties model. */ +@Fluent +public final class TraceProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(TraceProperties.class); + + /* + * State of the trace proxy. + */ + @JsonProperty(value = "state", access = JsonProperty.Access.WRITE_ONLY) + private TraceProxyState state; + + /* + * Error when apply trace proxy changes. + */ + @JsonProperty(value = "error") + private Error error; + + /* + * Indicates whether enable the tracing functionality + */ + @JsonProperty(value = "enabled") + private Boolean enabled; + + /* + * Target application insight instrumentation key + */ + @JsonProperty(value = "appInsightInstrumentationKey") + private String appInsightInstrumentationKey; + + /** + * Get the state property: State of the trace proxy. + * + * @return the state value. + */ + public TraceProxyState state() { + return this.state; + } + + /** + * Get the error property: Error when apply trace proxy changes. + * + * @return the error value. + */ + public Error error() { + return this.error; + } + + /** + * Set the error property: Error when apply trace proxy changes. + * + * @param error the error value to set. + * @return the TraceProperties object itself. + */ + public TraceProperties withError(Error error) { + this.error = error; + return this; + } + + /** + * Get the enabled property: Indicates whether enable the tracing functionality. + * + * @return the enabled value. + */ + public Boolean enabled() { + return this.enabled; + } + + /** + * Set the enabled property: Indicates whether enable the tracing functionality. + * + * @param enabled the enabled value to set. + * @return the TraceProperties object itself. + */ + public TraceProperties withEnabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Get the appInsightInstrumentationKey property: Target application insight instrumentation key. + * + * @return the appInsightInstrumentationKey value. + */ + public String appInsightInstrumentationKey() { + return this.appInsightInstrumentationKey; + } + + /** + * Set the appInsightInstrumentationKey property: Target application insight instrumentation key. + * + * @param appInsightInstrumentationKey the appInsightInstrumentationKey value to set. + * @return the TraceProperties object itself. + */ + public TraceProperties withAppInsightInstrumentationKey(String appInsightInstrumentationKey) { + this.appInsightInstrumentationKey = appInsightInstrumentationKey; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (error() != null) { + error().validate(); + } + } +} diff --git a/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/TraceProxyState.java b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/TraceProxyState.java new file mode 100644 index 0000000000000..aa779bc61b1e6 --- /dev/null +++ b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/TraceProxyState.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for TraceProxyState. */ +public final class TraceProxyState extends ExpandableStringEnum { + /** Static value NotAvailable for TraceProxyState. */ + public static final TraceProxyState NOT_AVAILABLE = fromString("NotAvailable"); + + /** Static value Failed for TraceProxyState. */ + public static final TraceProxyState FAILED = fromString("Failed"); + + /** Static value Succeeded for TraceProxyState. */ + public static final TraceProxyState SUCCEEDED = fromString("Succeeded"); + + /** Static value Updating for TraceProxyState. */ + public static final TraceProxyState UPDATING = fromString("Updating"); + + /** + * Creates or finds a TraceProxyState from its string representation. + * + * @param name a name to look for. + * @return the corresponding TraceProxyState. + */ + @JsonCreator + public static TraceProxyState fromString(String name) { + return fromString(name, TraceProxyState.class); + } + + /** @return known TraceProxyState values. */ + public static Collection values() { + return values(TraceProxyState.class); + } +} diff --git a/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/TrackedResource.java b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/TrackedResource.java new file mode 100644 index 0000000000000..2f2cf6bbb5a91 --- /dev/null +++ b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/TrackedResource.java @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** The TrackedResource model. */ +@Fluent +public class TrackedResource extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(TrackedResource.class); + + /* + * The GEO location of the resource. + */ + @JsonProperty(value = "location") + private String location; + + /* + * Tags of the service which is a list of key value pairs that describe the + * resource. + */ + @JsonProperty(value = "tags") + private Map tags; + + /** + * Get the location property: The GEO location of the resource. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Set the location property: The GEO location of the resource. + * + * @param location the location value to set. + * @return the TrackedResource object itself. + */ + public TrackedResource withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the tags property: Tags of the service which is a list of key value pairs that describe the resource. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Tags of the service which is a list of key value pairs that describe the resource. + * + * @param tags the tags value to set. + * @return the TrackedResource object itself. + */ + public TrackedResource withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/UserSourceInfo.java b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/UserSourceInfo.java new file mode 100644 index 0000000000000..e846a1b3cd60c --- /dev/null +++ b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/UserSourceInfo.java @@ -0,0 +1,132 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The UserSourceInfo model. */ +@Fluent +public final class UserSourceInfo { + @JsonIgnore private final ClientLogger logger = new ClientLogger(UserSourceInfo.class); + + /* + * Type of the source uploaded + */ + @JsonProperty(value = "type") + private UserSourceType type; + + /* + * Relative path of the storage which stores the source + */ + @JsonProperty(value = "relativePath") + private String relativePath; + + /* + * Version of the source + */ + @JsonProperty(value = "version") + private String version; + + /* + * Selector for the artifact to be used for the deployment for multi-module + * projects. This should be + * the relative path to the target module/project. + */ + @JsonProperty(value = "artifactSelector") + private String artifactSelector; + + /** + * Get the type property: Type of the source uploaded. + * + * @return the type value. + */ + public UserSourceType type() { + return this.type; + } + + /** + * Set the type property: Type of the source uploaded. + * + * @param type the type value to set. + * @return the UserSourceInfo object itself. + */ + public UserSourceInfo withType(UserSourceType type) { + this.type = type; + return this; + } + + /** + * Get the relativePath property: Relative path of the storage which stores the source. + * + * @return the relativePath value. + */ + public String relativePath() { + return this.relativePath; + } + + /** + * Set the relativePath property: Relative path of the storage which stores the source. + * + * @param relativePath the relativePath value to set. + * @return the UserSourceInfo object itself. + */ + public UserSourceInfo withRelativePath(String relativePath) { + this.relativePath = relativePath; + return this; + } + + /** + * Get the version property: Version of the source. + * + * @return the version value. + */ + public String version() { + return this.version; + } + + /** + * Set the version property: Version of the source. + * + * @param version the version value to set. + * @return the UserSourceInfo object itself. + */ + public UserSourceInfo withVersion(String version) { + this.version = version; + return this; + } + + /** + * Get the artifactSelector property: Selector for the artifact to be used for the deployment for multi-module + * projects. This should be the relative path to the target module/project. + * + * @return the artifactSelector value. + */ + public String artifactSelector() { + return this.artifactSelector; + } + + /** + * Set the artifactSelector property: Selector for the artifact to be used for the deployment for multi-module + * projects. This should be the relative path to the target module/project. + * + * @param artifactSelector the artifactSelector value to set. + * @return the UserSourceInfo object itself. + */ + public UserSourceInfo withArtifactSelector(String artifactSelector) { + this.artifactSelector = artifactSelector; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/UserSourceType.java b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/UserSourceType.java new file mode 100644 index 0000000000000..95db47bca0772 --- /dev/null +++ b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/UserSourceType.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for UserSourceType. */ +public final class UserSourceType extends ExpandableStringEnum { + /** Static value Jar for UserSourceType. */ + public static final UserSourceType JAR = fromString("Jar"); + + /** Static value Source for UserSourceType. */ + public static final UserSourceType SOURCE = fromString("Source"); + + /** + * Creates or finds a UserSourceType from its string representation. + * + * @param name a name to look for. + * @return the corresponding UserSourceType. + */ + @JsonCreator + public static UserSourceType fromString(String name) { + return fromString(name, UserSourceType.class); + } + + /** @return known UserSourceType values. */ + public static Collection values() { + return values(UserSourceType.class); + } +} diff --git a/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/package-info.java b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/package-info.java new file mode 100644 index 0000000000000..12fc4282caf3a --- /dev/null +++ b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/models/package-info.java @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** Package containing the data models for AppPlatformManagementClient. REST API for Azure Spring Cloud. */ +package com.azure.resourcemanager.appplatform.models; diff --git a/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/package-info.java b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/package-info.java new file mode 100644 index 0000000000000..d3e4c42ab0c8a --- /dev/null +++ b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/package-info.java @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** Package containing the classes for AppPlatformManagementClient. REST API for Azure Spring Cloud. */ +package com.azure.resourcemanager.appplatform; diff --git a/sdk/appplatform/mgmt/src/test/java/com/azure/resourcemanager/appplatform/AppPlatformTest.java b/sdk/appplatform/mgmt/src/test/java/com/azure/resourcemanager/appplatform/AppPlatformTest.java new file mode 100644 index 0000000000000..2a1f0a14aeb60 --- /dev/null +++ b/sdk/appplatform/mgmt/src/test/java/com/azure/resourcemanager/appplatform/AppPlatformTest.java @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.resourcemanager.appplatform; + +import com.azure.core.http.HttpPipeline; +import com.azure.resourcemanager.resources.core.TestBase; +import com.azure.resourcemanager.resources.fluentcore.profile.AzureProfile; + +import java.io.IOException; + +public class AppPlatformTest extends TestBase { + protected AppPlatformManager appPlatformManager; + protected String rgName = ""; + + public AppPlatformTest() { + } + + AppPlatformTest(RunCondition runCondition) { + super(runCondition); + } + + @Override + protected void initializeClients(HttpPipeline httpPipeline, AzureProfile profile) throws IOException { + rgName = generateRandomResourceName("rg", 20); + appPlatformManager = AppPlatformManager.authenticate(httpPipeline, profile); + } + + @Override + protected void cleanUpResources() { + try { + appPlatformManager.resourceManager().resourceGroups().beginDeleteByName(rgName); + } catch (Exception e) { } + } +} diff --git a/sdk/appplatform/mgmt/src/test/java/com/azure/resourcemanager/appplatform/SpringCloudTest.java b/sdk/appplatform/mgmt/src/test/java/com/azure/resourcemanager/appplatform/SpringCloudTest.java new file mode 100644 index 0000000000000..86f1b70b83afa --- /dev/null +++ b/sdk/appplatform/mgmt/src/test/java/com/azure/resourcemanager/appplatform/SpringCloudTest.java @@ -0,0 +1,170 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.resourcemanager.appplatform; + +import com.azure.resourcemanager.appplatform.models.RuntimeVersion; +import com.azure.resourcemanager.appplatform.models.SpringApp; +import com.azure.resourcemanager.appplatform.models.SpringAppDeployment; +import com.azure.resourcemanager.appplatform.models.SpringService; +import com.azure.resourcemanager.resources.fluentcore.arm.Region; +import com.azure.resourcemanager.resources.fluentcore.utils.SdkContext; +import org.apache.commons.compress.archivers.tar.TarArchiveEntry; +import org.apache.commons.compress.archivers.tar.TarArchiveInputStream; +import org.apache.commons.compress.compressors.gzip.GzipCompressorInputStream; +import org.apache.commons.compress.utils.IOUtils; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; + +import java.io.File; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.net.HttpURLConnection; +import java.net.URL; + +public class SpringCloudTest extends AppPlatformTest { + + SpringCloudTest() { + super(RunCondition.LIVE_ONLY); // need storage data-plane and url check + } + + @Test + public void canCRUDSpringAppWithDeployment() throws IOException { + String serviceName = generateRandomResourceName("springsvc", 15); + String appName = "gateway"; + String deploymentName = generateRandomResourceName("deploy", 15); + String deploymentName1 = generateRandomResourceName("deploy", 15); + + SpringService service = appPlatformManager.springServices().define(serviceName) + .withRegion(Region.US_EAST) + .withNewResourceGroup(rgName) + .withSku("B0") + .create(); + + Assertions.assertEquals("B0", service.sku().name()); + + service.update() + .withSku("S0") + .apply(); + + Assertions.assertEquals("S0", service.sku().name()); + + service.update() + .withGitUri("https://github.com/Azure-Samples/piggymetrics-config") + .apply(); + Assertions.assertEquals("https://github.com/Azure-Samples/piggymetrics-config", service.serverProperties().configServer().gitProperty().uri()); + + File jarFile = new File("gateway.jar"); + if (!jarFile.exists()) { + HttpURLConnection connection = (HttpURLConnection) new URL("https://github.com/weidongxu-microsoft/azure-sdk-for-java-management-tests/raw/master/spring-cloud/gateway.jar").openConnection(); + connection.connect(); + try (InputStream inputStream = connection.getInputStream(); + OutputStream outputStream = new FileOutputStream(jarFile)) { + IOUtils.copy(inputStream, outputStream); + } + connection.disconnect(); + } + + SpringApp app = service.apps().define(appName) + .withPublicEndpoint() + .create(); + + Assertions.assertNotNull(app.url()); + Assertions.assertNotNull(app.activeDeployment()); + + Assertions.assertTrue(requestSuccess(app.url())); + + app.update() + .withoutDeployment(app.activeDeployment()) + .deployJar(deploymentName, jarFile) + .apply(); + + Assertions.assertNotNull(app.url()); + Assertions.assertEquals(deploymentName, app.activeDeployment()); + Assertions.assertEquals(1, app.deployments().list().stream().count()); + + Assertions.assertTrue(requestSuccess(app.url())); + + SpringAppDeployment deployment = app.deployments().getByName(app.activeDeployment()); + deployment.update() + .withCpu(2) + .withMemory(4) + .withRuntime(RuntimeVersion.JAVA_11) + .withInstance(2) + .apply(); + + Assertions.assertEquals(2, deployment.settings().cpu()); + Assertions.assertEquals(4, deployment.settings().memoryInGB()); + Assertions.assertEquals(RuntimeVersion.JAVA_11, deployment.settings().runtimeVersion()); + Assertions.assertEquals(2, deployment.instances().size()); + + File sourceCodeFolder = new File("piggymetrics"); + if (!sourceCodeFolder.exists() || sourceCodeFolder.isFile()) { + if (sourceCodeFolder.isFile()) { + sourceCodeFolder.delete(); + } + extraTarGzSource(sourceCodeFolder); + } + + deployment = app.deployments().define(deploymentName1) + .withSourceCodeFolder(sourceCodeFolder) + .withTargetModule("gateway") + .withSettingsFromActiveDeployment() + .withActivation() + .create(); + app.refresh(); + + Assertions.assertEquals(deploymentName1, app.activeDeployment()); + Assertions.assertEquals(2, deployment.settings().cpu()); + Assertions.assertNotNull(deployment.getLogFileUrl()); + + Assertions.assertTrue(requestSuccess(app.url())); + + app.update() + .withoutPublicEndpoint() + .apply(); + Assertions.assertFalse(app.isPublic()); + } + + private boolean requestSuccess(String url) throws IOException { + for (int i = 0; i < 60; ++i) { + HttpURLConnection connection = (HttpURLConnection) new URL(url).openConnection(); + try { + connection.connect(); + if (connection.getResponseCode() == 200) { + connection.getInputStream().close(); + return true; + } + System.out.printf("Do request to %s with response code %d%n", url, connection.getResponseCode()); + } finally { + connection.disconnect(); + SdkContext.sleep(5000); + } + } + return false; + } + + private void extraTarGzSource(File folder) throws IOException { + HttpURLConnection connection = (HttpURLConnection) new URL("https://github.com/weidongxu-microsoft/azure-sdk-for-java-management-tests/raw/master/spring-cloud/piggymetrics.tar.gz").openConnection(); + connection.connect(); + try (TarArchiveInputStream inputStream = new TarArchiveInputStream(new GzipCompressorInputStream(connection.getInputStream()))) { + TarArchiveEntry entry; + while ((entry = inputStream.getNextTarEntry()) != null) { + if (entry.isDirectory()) { + continue; + } + File file = new File(folder, entry.getName()); + File parent = file.getParentFile(); + if (!parent.exists()) { + parent.mkdirs(); + } + try (OutputStream outputStream = new FileOutputStream(file)) { + IOUtils.copy(inputStream, outputStream); + } + } + } + connection.disconnect(); + } +} diff --git a/sdk/management/api-specs.json b/sdk/management/api-specs.json index 7f9b79ac40796..349d24690be04 100644 --- a/sdk/management/api-specs.json +++ b/sdk/management/api-specs.json @@ -11,6 +11,12 @@ "package": "com.microsoft.azure.resourcemanager.apimanagement", "args": "--payload-flattening-threshold=1 --tag=package-2018-01" }, + "appplatform": { + "dir": "../appplatform/mgmt", + "source": "specification/appplatform/resource-manager/readme.md", + "package": "com.azure.resourcemanager.appplatform", + "args": "--payload-flattening-threshold=1 --tag=package-2019-05-01-preview --remove-inner=TestKeys,ResourceSku,ResourceUploadDefinition" + }, "appservice": { "dir": "../appservice/mgmt", "source": "specification/web/resource-manager/readme.md", diff --git a/sdk/management/azure/pom.xml b/sdk/management/azure/pom.xml index 1e4a730318a94..0fc16e5a2556e 100644 --- a/sdk/management/azure/pom.xml +++ b/sdk/management/azure/pom.xml @@ -116,6 +116,11 @@ azure-resourcemanager-dns 2.0.0-SNAPSHOT + + com.azure.resourcemanager + azure-resourcemanager-appplatform + 2.0.0-SNAPSHOT + org.junit.jupiter junit-jupiter-engine diff --git a/sdk/management/azure/src/main/java/com/azure/resourcemanager/Azure.java b/sdk/management/azure/src/main/java/com/azure/resourcemanager/Azure.java index a5f753171e50a..8e0c14d820db6 100644 --- a/sdk/management/azure/src/main/java/com/azure/resourcemanager/Azure.java +++ b/sdk/management/azure/src/main/java/com/azure/resourcemanager/Azure.java @@ -6,13 +6,15 @@ import com.azure.core.credential.TokenCredential; import com.azure.core.http.HttpPipeline; import com.azure.core.management.AzureEnvironment; +import com.azure.resourcemanager.appplatform.AppPlatformManager; +import com.azure.resourcemanager.appplatform.models.SpringServices; +import com.azure.resourcemanager.appservice.AppServiceManager; import com.azure.resourcemanager.appservice.models.AppServiceCertificateOrders; import com.azure.resourcemanager.appservice.models.AppServiceCertificates; import com.azure.resourcemanager.appservice.models.AppServiceDomains; import com.azure.resourcemanager.appservice.models.AppServicePlans; import com.azure.resourcemanager.appservice.models.FunctionApps; import com.azure.resourcemanager.appservice.models.WebApps; -import com.azure.resourcemanager.appservice.AppServiceManager; import com.azure.resourcemanager.authorization.AuthorizationManager; import com.azure.resourcemanager.authorization.models.ActiveDirectoryApplications; import com.azure.resourcemanager.authorization.models.ActiveDirectoryGroups; @@ -41,19 +43,20 @@ import com.azure.resourcemanager.containerservice.models.KubernetesClusters; import com.azure.resourcemanager.cosmos.CosmosManager; import com.azure.resourcemanager.cosmos.models.CosmosDBAccounts; -import com.azure.resourcemanager.dns.models.DnsZones; import com.azure.resourcemanager.dns.DnsZoneManager; -import com.azure.resourcemanager.keyvault.models.Vaults; +import com.azure.resourcemanager.dns.models.DnsZones; import com.azure.resourcemanager.keyvault.KeyVaultManager; +import com.azure.resourcemanager.keyvault.models.Vaults; +import com.azure.resourcemanager.monitor.MonitorManager; import com.azure.resourcemanager.monitor.models.ActionGroups; import com.azure.resourcemanager.monitor.models.ActivityLogs; import com.azure.resourcemanager.monitor.models.AlertRules; import com.azure.resourcemanager.monitor.models.AutoscaleSettings; import com.azure.resourcemanager.monitor.models.DiagnosticSettings; import com.azure.resourcemanager.monitor.models.MetricDefinitions; -import com.azure.resourcemanager.monitor.MonitorManager; -import com.azure.resourcemanager.msi.models.Identities; import com.azure.resourcemanager.msi.MSIManager; +import com.azure.resourcemanager.msi.models.Identities; +import com.azure.resourcemanager.network.NetworkManager; import com.azure.resourcemanager.network.models.ApplicationGateways; import com.azure.resourcemanager.network.models.ApplicationSecurityGroups; import com.azure.resourcemanager.network.models.DdosProtectionPlans; @@ -71,7 +74,6 @@ import com.azure.resourcemanager.network.models.RouteFilters; import com.azure.resourcemanager.network.models.RouteTables; import com.azure.resourcemanager.network.models.VirtualNetworkGateways; -import com.azure.resourcemanager.network.NetworkManager; import com.azure.resourcemanager.resources.ResourceManager; import com.azure.resourcemanager.resources.fluentcore.arm.AzureConfigurable; import com.azure.resourcemanager.resources.fluentcore.arm.implementation.AzureConfigurableImpl; @@ -124,6 +126,7 @@ public final class Azure { private final MSIManager msiManager; private final MonitorManager monitorManager; // private final EventHubManager eventHubManager; + private final AppPlatformManager appPlatformManager; private final String subscriptionId; private final Authenticated authenticated; private final SdkContext sdkContext; @@ -367,6 +370,7 @@ private Azure(HttpPipeline httpPipeline, AzureProfile profile, Authenticated aut this.msiManager = MSIManager.authenticate(httpPipeline, profile, sdkContext); this.monitorManager = MonitorManager.authenticate(httpPipeline, profile, sdkContext); // this.eventHubManager = EventHubManager.authenticate(restClient, subscriptionId, sdkContext); + this.appPlatformManager = AppPlatformManager.authenticate(httpPipeline, profile, sdkContext); this.subscriptionId = profile.subscriptionId(); this.authenticated = authenticated; } @@ -807,4 +811,9 @@ public BlobServices storageBlobServices() { public ManagementPolicies storageManagementPolicies() { return this.storageManager.managementPolicies(); } + + /** @return the spring service management API entry point */ + public SpringServices springServices() { + return this.appPlatformManager.springServices(); + } } diff --git a/sdk/management/pom.xml b/sdk/management/pom.xml index 676184d7d6063..a290e23ca8e75 100644 --- a/sdk/management/pom.xml +++ b/sdk/management/pom.xml @@ -473,6 +473,7 @@ ./azure ../appservice/mgmt + ../appplatform/mgmt ../compute/mgmt ../dns/mgmt ../authorization/mgmt From 02155b437fbcc501f3a5cee92e44dbb8ee3df887 Mon Sep 17 00:00:00 2001 From: Srikanta <51379715+srnagar@users.noreply.github.com> Date: Mon, 6 Jul 2020 09:46:25 -0700 Subject: [PATCH 019/129] [Event Hubs] Consolidate all javadoc codesnippet Java files into a single Java file (#12753) * Consolidate all javadoc codesnippet Java files into a single Java file * Fix checkstyle --- .../EventDataJavaDocCodeSamples.java | 40 -- ...entHubClientBuilderJavaDocCodeSamples.java | 28 - ...ConsumerAsyncClientJavaDocCodeSamples.java | 147 ---- .../EventHubConsumerJavaDocCodeSamples.java | 71 -- ...ProducerAsyncClientJavaDocCodeSamples.java | 195 ----- ...ntHubProducerClientJavaDocCodeSamples.java | 176 ----- .../EventHubsJavaDocCodeSamples.java | 670 ++++++++++++++++++ ...entProcessorBuilderJavaDocCodeSamples.java | 68 -- ...ventProcessorClientJavaDocCodeSamples.java | 37 - 9 files changed, 670 insertions(+), 762 deletions(-) delete mode 100644 sdk/eventhubs/azure-messaging-eventhubs/src/samples/java/com/azure/messaging/eventhubs/EventDataJavaDocCodeSamples.java delete mode 100644 sdk/eventhubs/azure-messaging-eventhubs/src/samples/java/com/azure/messaging/eventhubs/EventHubClientBuilderJavaDocCodeSamples.java delete mode 100644 sdk/eventhubs/azure-messaging-eventhubs/src/samples/java/com/azure/messaging/eventhubs/EventHubConsumerAsyncClientJavaDocCodeSamples.java delete mode 100644 sdk/eventhubs/azure-messaging-eventhubs/src/samples/java/com/azure/messaging/eventhubs/EventHubConsumerJavaDocCodeSamples.java delete mode 100644 sdk/eventhubs/azure-messaging-eventhubs/src/samples/java/com/azure/messaging/eventhubs/EventHubProducerAsyncClientJavaDocCodeSamples.java delete mode 100644 sdk/eventhubs/azure-messaging-eventhubs/src/samples/java/com/azure/messaging/eventhubs/EventHubProducerClientJavaDocCodeSamples.java create mode 100644 sdk/eventhubs/azure-messaging-eventhubs/src/samples/java/com/azure/messaging/eventhubs/EventHubsJavaDocCodeSamples.java delete mode 100644 sdk/eventhubs/azure-messaging-eventhubs/src/samples/java/com/azure/messaging/eventhubs/EventProcessorBuilderJavaDocCodeSamples.java delete mode 100644 sdk/eventhubs/azure-messaging-eventhubs/src/samples/java/com/azure/messaging/eventhubs/EventProcessorClientJavaDocCodeSamples.java diff --git a/sdk/eventhubs/azure-messaging-eventhubs/src/samples/java/com/azure/messaging/eventhubs/EventDataJavaDocCodeSamples.java b/sdk/eventhubs/azure-messaging-eventhubs/src/samples/java/com/azure/messaging/eventhubs/EventDataJavaDocCodeSamples.java deleted file mode 100644 index 96cb1077756d0..0000000000000 --- a/sdk/eventhubs/azure-messaging-eventhubs/src/samples/java/com/azure/messaging/eventhubs/EventDataJavaDocCodeSamples.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.messaging.eventhubs; - -import static java.nio.charset.StandardCharsets.UTF_8; - -/** - * Contains code snippets when generating javadocs through doclets for {@link EventData}. - */ -public class EventDataJavaDocCodeSamples { - - /** - * Creates an EventData using application properties. - */ - public void createEventData() { - // BEGIN: com.azure.messaging.eventhubs.eventdata.getProperties - TelemetryEvent telemetry = new TelemetryEvent("temperature", "37"); - byte[] serializedTelemetryData = telemetry.toString().getBytes(UTF_8); - - EventData eventData = new EventData(serializedTelemetryData); - eventData.getProperties().put("eventType", TelemetryEvent.class.getName()); - // END: com.azure.messaging.eventhubs.eventdata.getProperties - } - - private static final class TelemetryEvent { - private final String name; - private final String value; - - private TelemetryEvent(String name, String value) { - this.name = name; - this.value = value; - } - - @Override - public String toString() { - return String.format("[name]=%s;[value]=%s", name, value); - } - } -} diff --git a/sdk/eventhubs/azure-messaging-eventhubs/src/samples/java/com/azure/messaging/eventhubs/EventHubClientBuilderJavaDocCodeSamples.java b/sdk/eventhubs/azure-messaging-eventhubs/src/samples/java/com/azure/messaging/eventhubs/EventHubClientBuilderJavaDocCodeSamples.java deleted file mode 100644 index 29ce00fbf27ec..0000000000000 --- a/sdk/eventhubs/azure-messaging-eventhubs/src/samples/java/com/azure/messaging/eventhubs/EventHubClientBuilderJavaDocCodeSamples.java +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.messaging.eventhubs; - -/** - * Code snippets for {@link EventHubClientBuilder}. - */ -public class EventHubClientBuilderJavaDocCodeSamples { - /** - * Code snippet for {@link EventHubClientBuilder#shareConnection()}. - */ - public void sharingConnection() { - // BEGIN: com.azure.messaging.eventhubs.eventhubclientbuilder.instantiation - // Toggling `shareConnection` instructs the builder to use the same underlying connection - // for each consumer or producer created using the same builder instance. - EventHubClientBuilder builder = new EventHubClientBuilder() - .connectionString("event-hubs-instance-connection-string") - .shareConnection(); - - // Both the producer and consumer created share the same underlying connection. - EventHubProducerAsyncClient producer = builder.buildAsyncProducerClient(); - EventHubConsumerAsyncClient consumer = builder - .consumerGroup("my-consumer-group") - .buildAsyncConsumerClient(); - // END: com.azure.messaging.eventhubs.eventhubclientbuilder.instantiation - } -} diff --git a/sdk/eventhubs/azure-messaging-eventhubs/src/samples/java/com/azure/messaging/eventhubs/EventHubConsumerAsyncClientJavaDocCodeSamples.java b/sdk/eventhubs/azure-messaging-eventhubs/src/samples/java/com/azure/messaging/eventhubs/EventHubConsumerAsyncClientJavaDocCodeSamples.java deleted file mode 100644 index c39136ee31335..0000000000000 --- a/sdk/eventhubs/azure-messaging-eventhubs/src/samples/java/com/azure/messaging/eventhubs/EventHubConsumerAsyncClientJavaDocCodeSamples.java +++ /dev/null @@ -1,147 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.messaging.eventhubs; - -import com.azure.messaging.eventhubs.models.EventPosition; -import com.azure.messaging.eventhubs.models.LastEnqueuedEventProperties; -import com.azure.messaging.eventhubs.models.PartitionContext; -import com.azure.messaging.eventhubs.models.PartitionEvent; -import com.azure.messaging.eventhubs.models.ReceiveOptions; -import org.reactivestreams.Subscription; -import reactor.core.Disposable; -import reactor.core.publisher.BaseSubscriber; - -import java.util.concurrent.atomic.AtomicInteger; - -/** - * Code snippets demonstrating various {@link EventHubConsumerAsyncClient} scenarios. - */ -public class EventHubConsumerAsyncClientJavaDocCodeSamples { - private final EventHubConsumerAsyncClient consumer = new EventHubClientBuilder() - .connectionString("fake-string") - .consumerGroup("consumer-group-name") - .buildAsyncConsumerClient(); - - public void initialization() { - // BEGIN: com.azure.messaging.eventhubs.eventhubconsumerasyncclient.instantiation - // The required parameters are `consumerGroup` and a way to authenticate with Event Hubs using credentials. - EventHubConsumerAsyncClient consumer = new EventHubClientBuilder() - .connectionString("Endpoint={fully-qualified-namespace};SharedAccessKeyName={policy-name};" - + "SharedAccessKey={key};EntityPath={eh-name}") - .consumerGroup("consumer-group-name") - .buildAsyncConsumerClient(); - // END: com.azure.messaging.eventhubs.eventhubconsumerasyncclient.instantiation - - consumer.close(); - } - - /** - * Receives event data from a single partition. - */ - public void receive() { - - // BEGIN: com.azure.messaging.eventhubs.eventhubconsumerasyncclient.receive#string-eventposition - // Obtain partitionId from EventHubConsumerAsyncClient.getPartitionIds() - String partitionId = "0"; - EventPosition startingPosition = EventPosition.latest(); - - // Keep a reference to `subscription`. When the program is finished receiving events, call - // subscription.dispose(). This will stop fetching events from the Event Hub. - Disposable subscription = consumer.receiveFromPartition(partitionId, startingPosition) - .subscribe(partitionEvent -> { - PartitionContext partitionContext = partitionEvent.getPartitionContext(); - EventData event = partitionEvent.getData(); - - System.out.printf("Received event from partition '%s'%n", partitionContext.getPartitionId()); - System.out.printf("Contents of event as string: '%s'%n", event.getBodyAsString()); - }, error -> System.err.print(error.toString())); - // END: com.azure.messaging.eventhubs.eventhubconsumerasyncclient.receive#string-eventposition - - // When program ends, or you're done receiving all events. - subscription.dispose(); - } - - /** - * Receives event data with back pressure. - */ - public void receiveBackpressure() { - // Obtain partitionId from EventHubAsyncClient.getPartitionIds() - String partitionId = "0"; - - EventHubConsumerAsyncClient consumer = new EventHubClientBuilder() - .connectionString("fake-string") - .consumerGroup("consumer-group-name") - .buildAsyncConsumerClient(); - - // BEGIN: com.azure.messaging.eventhubs.eventhubconsumerasyncclient.receive#string-eventposition-basesubscriber - consumer.receiveFromPartition(partitionId, EventPosition.latest()).subscribe(new BaseSubscriber() { - private static final int NUMBER_OF_EVENTS = 5; - private final AtomicInteger currentNumberOfEvents = new AtomicInteger(); - - @Override - protected void hookOnSubscribe(Subscription subscription) { - // Tell the Publisher we only want 5 events at a time. - request(NUMBER_OF_EVENTS); - } - - @Override - protected void hookOnNext(PartitionEvent value) { - // Process the EventData - - // If the number of events we have currently received is a multiple of 5, that means we have reached the - // last event the Publisher will provide to us. Invoking request(long) here, tells the Publisher that - // the subscriber is ready to get more events from upstream. - if (currentNumberOfEvents.incrementAndGet() % 5 == 0) { - request(NUMBER_OF_EVENTS); - } - } - }); - // END: com.azure.messaging.eventhubs.eventhubconsumerasyncclient.receive#string-eventposition-basesubscriber - } - - /** - * Receives from all partitions. - */ - public void receiveAll() { - EventHubConsumerAsyncClient consumer = new EventHubClientBuilder() - .connectionString("fake-string") - .consumerGroup("consumer-group-name") - .buildAsyncConsumerClient(); - - // BEGIN: com.azure.messaging.eventhubs.eventhubconsumerasyncclient.receive#boolean - // Receives events from all partitions from the beginning of each partition. - consumer.receive(true).subscribe(partitionEvent -> { - PartitionContext context = partitionEvent.getPartitionContext(); - EventData event = partitionEvent.getData(); - System.out.printf("Event %s is from partition %s%n.", event.getSequenceNumber(), context.getPartitionId()); - }); - // END: com.azure.messaging.eventhubs.eventhubconsumerasyncclient.receive#boolean - } - - /** - * Receives from all partitions with last enqueued information. - */ - public void receiveLastEnqueuedInformation() { - EventHubConsumerAsyncClient consumer = new EventHubClientBuilder() - .connectionString("event-hub-instance-connection-string") - .consumerGroup("consumer-group-name") - .buildAsyncConsumerClient(); - - // BEGIN: com.azure.messaging.eventhubs.eventhubconsumerasyncclient.receiveFromPartition#string-eventposition-receiveoptions - // Set `setTrackLastEnqueuedEventProperties` to true to get the last enqueued information from the partition for - // each event that is received. - ReceiveOptions receiveOptions = new ReceiveOptions() - .setTrackLastEnqueuedEventProperties(true); - - // Receives events from partition "0" as they come in. - consumer.receiveFromPartition("0", EventPosition.earliest(), receiveOptions) - .subscribe(partitionEvent -> { - LastEnqueuedEventProperties properties = partitionEvent.getLastEnqueuedEventProperties(); - System.out.printf("Information received at %s. Last enqueued sequence number: %s%n", - properties.getRetrievalTime(), - properties.getSequenceNumber()); - }); - // END: com.azure.messaging.eventhubs.eventhubconsumerasyncclient.receiveFromPartition#string-eventposition-receiveoptions - } -} diff --git a/sdk/eventhubs/azure-messaging-eventhubs/src/samples/java/com/azure/messaging/eventhubs/EventHubConsumerJavaDocCodeSamples.java b/sdk/eventhubs/azure-messaging-eventhubs/src/samples/java/com/azure/messaging/eventhubs/EventHubConsumerJavaDocCodeSamples.java deleted file mode 100644 index 49bb72f61efb6..0000000000000 --- a/sdk/eventhubs/azure-messaging-eventhubs/src/samples/java/com/azure/messaging/eventhubs/EventHubConsumerJavaDocCodeSamples.java +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.messaging.eventhubs; - -import com.azure.core.util.IterableStream; -import com.azure.messaging.eventhubs.models.EventPosition; -import com.azure.messaging.eventhubs.models.PartitionEvent; - -import java.time.Duration; -import java.time.Instant; - -/** - * Code snippets demonstrating various {@link EventHubConsumerClient} scenarios. - */ -public class EventHubConsumerJavaDocCodeSamples { - /** - * Code snippet for creating an EventHubConsumer - * - */ - public void instantiate() { - // BEGIN: com.azure.messaging.eventhubs.eventhubconsumerclient.instantiation - // The required parameters are `consumerGroup`, and a way to authenticate with Event Hubs using credentials. - EventHubConsumerClient consumer = new EventHubClientBuilder() - .connectionString( - "Endpoint={eh-namespace};SharedAccessKeyName={policy-name};SharedAccessKey={key};Entity-Path={hub-name}") - .consumerGroup("$DEFAULT") - .buildConsumerClient(); - // END: com.azure.messaging.eventhubs.eventhubconsumerclient.instantiation - - consumer.close(); - } - - /** - * Receives event data from a single partition. - */ - public void receive() { - EventHubConsumerClient consumer = new EventHubClientBuilder() - .connectionString("event-hub-instance-connection-string") - .consumerGroup("consumer-group-name") - .buildConsumerClient(); - - // BEGIN: com.azure.messaging.eventhubs.eventhubconsumerclient.receive#string-int-eventposition-duration - Instant twelveHoursAgo = Instant.now().minus(Duration.ofHours(12)); - EventPosition startingPosition = EventPosition.fromEnqueuedTime(twelveHoursAgo); - String partitionId = "0"; - - // Reads events from partition '0' and returns the first 100 received or until the 30 seconds has elapsed. - IterableStream events = consumer.receiveFromPartition(partitionId, 100, - startingPosition, Duration.ofSeconds(30)); - - Long lastSequenceNumber = -1L; - for (PartitionEvent partitionEvent : events) { - // For each event, perform some sort of processing. - System.out.print("Event received: " + partitionEvent.getData().getSequenceNumber()); - lastSequenceNumber = partitionEvent.getData().getSequenceNumber(); - } - - // Figure out what the next EventPosition to receive from is based on last event we processed in the stream. - // If lastSequenceNumber is -1L, then we didn't see any events the first time we fetched events from the - // partition. - if (lastSequenceNumber != -1L) { - EventPosition nextPosition = EventPosition.fromSequenceNumber(lastSequenceNumber, false); - - // Gets the next set of events from partition '0' to consume and process. - IterableStream nextEvents = consumer.receiveFromPartition(partitionId, 100, - nextPosition, Duration.ofSeconds(30)); - } - // END: com.azure.messaging.eventhubs.eventhubconsumerclient.receive#string-int-eventposition-duration - } -} diff --git a/sdk/eventhubs/azure-messaging-eventhubs/src/samples/java/com/azure/messaging/eventhubs/EventHubProducerAsyncClientJavaDocCodeSamples.java b/sdk/eventhubs/azure-messaging-eventhubs/src/samples/java/com/azure/messaging/eventhubs/EventHubProducerAsyncClientJavaDocCodeSamples.java deleted file mode 100644 index 859c98119570f..0000000000000 --- a/sdk/eventhubs/azure-messaging-eventhubs/src/samples/java/com/azure/messaging/eventhubs/EventHubProducerAsyncClientJavaDocCodeSamples.java +++ /dev/null @@ -1,195 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.messaging.eventhubs; - -import com.azure.messaging.eventhubs.models.CreateBatchOptions; -import com.azure.messaging.eventhubs.models.SendOptions; -import java.util.Arrays; -import java.util.List; -import reactor.core.Exceptions; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -import java.util.concurrent.atomic.AtomicReference; - -import static java.nio.charset.StandardCharsets.UTF_8; - -/** - * Contains code snippets when generating javadocs through doclets for {@link EventHubProducerAsyncClient}. - */ -public class EventHubProducerAsyncClientJavaDocCodeSamples { - private final EventHubClientBuilder builder = new EventHubClientBuilder(); - - /** - * Code snippet demonstrating how to create an {@link EventHubProducerAsyncClient}. - */ - public void instantiate() { - // BEGIN: com.azure.messaging.eventhubs.eventhubasyncproducerclient.instantiation - // The required parameter is a way to authenticate with Event Hubs using credentials. - // The connectionString provides a way to authenticate with Event Hub. - EventHubProducerAsyncClient producer = new EventHubClientBuilder() - .connectionString( - "Endpoint={fully-qualified-namespace};SharedAccessKeyName={policy-name};SharedAccessKey={key}", - "event-hub-name") - .buildAsyncProducerClient(); - // END: com.azure.messaging.eventhubs.eventhubasyncproducerclient.instantiation - - producer.close(); - } - - /** - * Code snippet demonstrating how to send a batch that automatically routes events to any partition. - */ - public void batchAutomaticRouting() { - // BEGIN: com.azure.messaging.eventhubs.eventhubasyncproducerclient.createBatch - // The required parameter is a way to authenticate with Event Hubs using credentials. - // The connectionString provides a way to authenticate with Event Hub. - EventHubProducerAsyncClient producer = new EventHubClientBuilder() - .connectionString( - "Endpoint={fully-qualified-namespace};SharedAccessKeyName={policy-name};SharedAccessKey={key}", - "event-hub-name") - .buildAsyncProducerClient(); - - // Creating a batch without options set, will allow for automatic routing of events to any partition. - producer.createBatch().flatMap(batch -> { - batch.tryAdd(new EventData("test-event-1")); - batch.tryAdd(new EventData("test-event-2")); - return producer.send(batch); - }).subscribe(unused -> { - }, - error -> System.err.println("Error occurred while sending batch:" + error), - () -> System.out.println("Send complete.")); - // END: com.azure.messaging.eventhubs.eventhubasyncproducerclient.createBatch - - producer.close(); - } - - /** - * Code snippet demonstrating how to create an EventDataBatch at routes events to a single partition. - */ - public void batchPartitionId() { - EventHubProducerAsyncClient producer = builder.buildAsyncProducerClient(); - - // BEGIN: com.azure.messaging.eventhubs.eventhubasyncproducerclient.createBatch#CreateBatchOptions-partitionId - // Creating a batch with partitionId set will route all events in that batch to partition `foo`. - CreateBatchOptions options = new CreateBatchOptions().setPartitionId("foo"); - producer.createBatch(options).flatMap(batch -> { - batch.tryAdd(new EventData("test-event-1")); - batch.tryAdd(new EventData("test-event-2")); - return producer.send(batch); - }).subscribe(unused -> { - }, - error -> System.err.println("Error occurred while sending batch:" + error), - () -> System.out.println("Send complete.")); - // END: com.azure.messaging.eventhubs.eventhubasyncproducerclient.createBatch#CreateBatchOptions-partitionId - - producer.close(); - } - - /** - * Code snippet demonstrating how to send events with a partition key. - */ - public void batchPartitionKey() { - EventHubProducerAsyncClient producer = builder.buildAsyncProducerClient(); - - // BEGIN: com.azure.messaging.eventhubs.eventhubasyncproducerclient.createBatch#CreateBatchOptions-partitionKey - // Creating a batch with partitionKey set will tell the service to hash the partitionKey and decide which - // partition to send the events to. Events with the same partitionKey are always routed to the same partition. - CreateBatchOptions options = new CreateBatchOptions().setPartitionKey("bread"); - producer.createBatch(options).flatMap(batch -> { - batch.tryAdd(new EventData("sourdough")); - batch.tryAdd(new EventData("rye")); - return producer.send(batch); - }).subscribe(unused -> { - }, - error -> System.err.println("Error occurred while sending batch:" + error), - () -> System.out.println("Send complete.")); - // END: com.azure.messaging.eventhubs.eventhubasyncproducerclient.createBatch#CreateBatchOptions-partitionKey - } - - /** - * Code snippet demonstrating how to create a size-limited {@link EventDataBatch} and send it. - */ - public void batchSizeLimited() { - final EventHubProducerAsyncClient producer = builder.buildAsyncProducerClient(); - final EventData firstEvent = new EventData("92".getBytes(UTF_8)); - firstEvent.getProperties().put("telemetry", "latency"); - final EventData secondEvent = new EventData("98".getBytes(UTF_8)); - secondEvent.getProperties().put("telemetry", "cpu-temperature"); - - // BEGIN: com.azure.messaging.eventhubs.eventhubasyncproducerclient.createBatch#CreateBatchOptions-int - final Flux telemetryEvents = Flux.just(firstEvent, secondEvent); - - // Setting `setMaximumSizeInBytes` when creating a batch, limits the size of that batch. - // In this case, all the batches created with these options are limited to 256 bytes. - final CreateBatchOptions options = new CreateBatchOptions() - .setMaximumSizeInBytes(256); - final AtomicReference currentBatch = new AtomicReference<>( - producer.createBatch(options).block()); - - // The sample Flux contains two events, but it could be an infinite stream of telemetry events. - telemetryEvents.flatMap(event -> { - final EventDataBatch batch = currentBatch.get(); - if (batch.tryAdd(event)) { - return Mono.empty(); - } - - return Mono.when( - producer.send(batch), - producer.createBatch(options).map(newBatch -> { - currentBatch.set(newBatch); - - // Add the event that did not fit in the previous batch. - if (!newBatch.tryAdd(event)) { - throw Exceptions.propagate(new IllegalArgumentException( - "Event was too large to fit in an empty batch. Max size: " + newBatch.getMaxSizeInBytes())); - } - - return newBatch; - })); - }).then() - .doFinally(signal -> { - final EventDataBatch batch = currentBatch.getAndSet(null); - if (batch != null && batch.getCount() > 0) { - producer.send(batch).block(); - } - }); - // END: com.azure.messaging.eventhubs.eventhubasyncproducerclient.createBatch#CreateBatchOptions-int - } - - /** - * Code snippet to demonstrate how to send a list of events using - * {@link EventHubProducerAsyncClient#send(Iterable)}. - */ - public void sendIterableSample() { - final EventHubProducerAsyncClient producer = builder.buildAsyncProducerClient(); - // BEGIN: com.azure.messaging.eventhubs.eventhubasyncproducerclient.send#Iterable - List events = Arrays.asList(new EventData("maple"), new EventData("aspen"), - new EventData("oak")); - producer - .send(events) - .subscribe(unused -> { }, - error -> System.err.println("Error occurred while sending events:" + error), - () -> System.out.println("Send complete.")); - // END: com.azure.messaging.eventhubs.eventhubasyncproducerclient.send#Iterable - } - - /** - * Code snippet to demonstrate how to send a list of events using - * {@link EventHubProducerAsyncClient#send(Iterable, SendOptions)}. - */ - public void sendIterableWithPartitionKeySample() { - final EventHubProducerAsyncClient producer = builder.buildAsyncProducerClient(); - // BEGIN: com.azure.messaging.eventhubs.eventhubasyncproducerclient.send#Iterable-SendOptions - List events = Arrays.asList(new EventData("Melbourne"), new EventData("London"), - new EventData("New York")); - SendOptions sendOptions = new SendOptions().setPartitionKey("cities"); - producer - .send(events, sendOptions) - .subscribe(unused -> { }, - error -> System.err.println("Error occurred while sending events:" + error), - () -> System.out.println("Send complete.")); - // END: com.azure.messaging.eventhubs.eventhubasyncproducerclient.send#Iterable-SendOptions - } -} diff --git a/sdk/eventhubs/azure-messaging-eventhubs/src/samples/java/com/azure/messaging/eventhubs/EventHubProducerClientJavaDocCodeSamples.java b/sdk/eventhubs/azure-messaging-eventhubs/src/samples/java/com/azure/messaging/eventhubs/EventHubProducerClientJavaDocCodeSamples.java deleted file mode 100644 index ff39b7f889475..0000000000000 --- a/sdk/eventhubs/azure-messaging-eventhubs/src/samples/java/com/azure/messaging/eventhubs/EventHubProducerClientJavaDocCodeSamples.java +++ /dev/null @@ -1,176 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.messaging.eventhubs; - -import com.azure.messaging.eventhubs.models.CreateBatchOptions; - -import com.azure.messaging.eventhubs.models.SendOptions; -import java.util.Arrays; -import java.util.List; - -import static java.nio.charset.StandardCharsets.UTF_8; - -/** - * Contains code snippets when generating javadocs through doclets for {@link EventHubProducerClient}. - */ -public class EventHubProducerClientJavaDocCodeSamples { - private final EventHubClientBuilder builder = new EventHubClientBuilder() - .connectionString("fake-string"); - - /** - * Code snippet demonstrating how to create an {@link EventHubProducerClient}. - */ - public void instantiate() { - // BEGIN: com.azure.messaging.eventhubs.eventhubproducerclient.instantiation - // The required parameter is a way to authenticate with Event Hubs using credentials. - // The connectionString provides a way to authenticate with Event Hub. - EventHubProducerClient producer = new EventHubClientBuilder() - .connectionString( - "Endpoint={fully-qualified-namespace};SharedAccessKeyName={policy-name};SharedAccessKey={key}", - "event-hub-name") - .buildProducerClient(); - // END: com.azure.messaging.eventhubs.eventhubproducerclient.instantiation - - producer.close(); - } - - /** - * Code snippet demonstrating how to send a batch that automatically routes events to any partition. - * - * @throws IllegalArgumentException if an event is too large for an empty batch. - */ - public void batchAutomaticRouting() { - // BEGIN: com.azure.messaging.eventhubs.eventhubproducerclient.createBatch - // The required parameter is a way to authenticate with Event Hubs using credentials. - // The connectionString provides a way to authenticate with Event Hub. - EventHubProducerClient producer = new EventHubClientBuilder() - .connectionString( - "Endpoint={fully-qualified-namespace};SharedAccessKeyName={policy-name};SharedAccessKey={key}", - "event-hub-name") - .buildProducerClient(); - List events = Arrays.asList(new EventData("test-event-1"), new EventData("test-event-2")); - - // Creating a batch without options set, will allow for automatic routing of events to any partition. - EventDataBatch batch = producer.createBatch(); - for (EventData event : events) { - if (batch.tryAdd(event)) { - continue; - } - - producer.send(batch); - batch = producer.createBatch(); - if (!batch.tryAdd(event)) { - throw new IllegalArgumentException("Event is too large for an empty batch."); - } - } - // END: com.azure.messaging.eventhubs.eventhubproducerclient.createBatch - - producer.close(); - } - - /** - * Code snippet demonstrating how to create an EventDataBatch at routes events to a single partition. - */ - public void batchPartitionId() { - final EventHubProducerClient producer = builder.buildProducerClient(); - - // BEGIN: com.azure.messaging.eventhubs.eventhubproducerclient.createBatch#CreateBatchOptions-partitionId - // Creating a batch with partitionId set will route all events in that batch to partition `foo`. - CreateBatchOptions options = new CreateBatchOptions().setPartitionId("foo"); - - EventDataBatch batch = producer.createBatch(options); - batch.tryAdd(new EventData("data-to-partition-foo")); - producer.send(batch); - // END: com.azure.messaging.eventhubs.eventhubproducerclient.createBatch#CreateBatchOptions-partitionId - } - - /** - * Code snippet demonstrating how to send events with a partition key. - */ - public void batchPartitionKey() { - final EventHubProducerClient producer = builder.buildProducerClient(); - - // BEGIN: com.azure.messaging.eventhubs.eventhubproducerclient.createBatch#CreateBatchOptions-partitionKey - List events = Arrays.asList(new EventData("sourdough"), new EventData("rye"), - new EventData("wheat")); - - // Creating a batch with partitionKey set will tell the service to hash the partitionKey and decide which - // partition to send the events to. Events with the same partitionKey are always routed to the same partition. - CreateBatchOptions options = new CreateBatchOptions().setPartitionKey("bread"); - EventDataBatch batch = producer.createBatch(options); - - events.forEach(event -> batch.tryAdd(event)); - producer.send(batch); - // END: com.azure.messaging.eventhubs.eventhubproducerclient.createBatch#CreateBatchOptions-partitionKey - } - - /** - * Code snippet demonstrating how to create a size-limited {@link EventDataBatch} and send it. - * - * @throws IllegalArgumentException if an event is too large for an empty batch. - */ - public void batchSizeLimited() { - final EventHubProducerClient producer = builder.buildProducerClient(); - final EventData firstEvent = new EventData("92".getBytes(UTF_8)); - firstEvent.getProperties().put("telemetry", "latency"); - final EventData secondEvent = new EventData("98".getBytes(UTF_8)); - secondEvent.getProperties().put("telemetry", "cpu-temperature"); - final EventData thirdEvent = new EventData("120".getBytes(UTF_8)); - thirdEvent.getProperties().put("telemetry", "fps"); - - // BEGIN: com.azure.messaging.eventhubs.eventhubproducerclient.createBatch#CreateBatchOptions-int - - - final List telemetryEvents = Arrays.asList(firstEvent, secondEvent, thirdEvent); - - // Setting `setMaximumSizeInBytes` when creating a batch, limits the size of that batch. - // In this case, all the batches created with these options are limited to 256 bytes. - final CreateBatchOptions options = new CreateBatchOptions() - .setMaximumSizeInBytes(256); - - EventDataBatch currentBatch = producer.createBatch(options); - - // For each telemetry event, we try to add it to the current batch. - // When the batch is full, send it then create another batch to add more events to. - for (EventData event : telemetryEvents) { - if (!currentBatch.tryAdd(event)) { - producer.send(currentBatch); - currentBatch = producer.createBatch(options); - - // Add the event we couldn't before. - if (!currentBatch.tryAdd(event)) { - throw new IllegalArgumentException("Event is too large for an empty batch."); - } - } - } - // END: com.azure.messaging.eventhubs.eventhubproducerclient.createBatch#CreateBatchOptions-int - } - - /** - * Code snippet to demonstrate how to send a list of events using {@link EventHubProducerClient#send(Iterable)}. - */ - public void sendIterableSample() { - final EventHubProducerClient producer = builder.buildProducerClient(); - // BEGIN: com.azure.messaging.eventhubs.eventhubproducerclient.send#Iterable - List events = Arrays.asList(new EventData("maple"), new EventData("aspen"), - new EventData("oak")); - producer.send(events); - // END: com.azure.messaging.eventhubs.eventhubproducerclient.send#Iterable - } - - /** - * Code snippet to demonstrate how to send a list of events using - * {@link EventHubProducerClient#send(Iterable, SendOptions)}. - */ - public void sendIterableWithPartitionKeySample() { - final EventHubProducerClient producer = builder.buildProducerClient(); - // BEGIN: com.azure.messaging.eventhubs.eventhubproducerclient.send#Iterable-SendOptions - List events = Arrays.asList(new EventData("Melbourne"), new EventData("London"), - new EventData("New York")); - SendOptions sendOptions = new SendOptions().setPartitionKey("cities"); - producer.send(events, sendOptions); - // END: com.azure.messaging.eventhubs.eventhubproducerclient.send#Iterable-SendOptions - } - -} diff --git a/sdk/eventhubs/azure-messaging-eventhubs/src/samples/java/com/azure/messaging/eventhubs/EventHubsJavaDocCodeSamples.java b/sdk/eventhubs/azure-messaging-eventhubs/src/samples/java/com/azure/messaging/eventhubs/EventHubsJavaDocCodeSamples.java new file mode 100644 index 0000000000000..462ed1eb3486c --- /dev/null +++ b/sdk/eventhubs/azure-messaging-eventhubs/src/samples/java/com/azure/messaging/eventhubs/EventHubsJavaDocCodeSamples.java @@ -0,0 +1,670 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.messaging.eventhubs; + +import static java.nio.charset.StandardCharsets.UTF_8; + +import com.azure.core.util.IterableStream; +import com.azure.messaging.eventhubs.models.CreateBatchOptions; +import com.azure.messaging.eventhubs.models.EventPosition; +import com.azure.messaging.eventhubs.models.LastEnqueuedEventProperties; +import com.azure.messaging.eventhubs.models.PartitionContext; +import com.azure.messaging.eventhubs.models.PartitionEvent; +import com.azure.messaging.eventhubs.models.ReceiveOptions; +import com.azure.messaging.eventhubs.models.SendOptions; +import java.time.Duration; +import java.time.Instant; +import java.util.Arrays; +import java.util.List; +import java.util.concurrent.atomic.AtomicInteger; +import java.util.concurrent.atomic.AtomicReference; +import org.reactivestreams.Subscription; +import reactor.core.Disposable; +import reactor.core.Exceptions; +import reactor.core.publisher.BaseSubscriber; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * This class contains all code snippets that are used in Event Hubs JavaDocs. + */ +public class EventHubsJavaDocCodeSamples { + private final EventHubClientBuilder builder = new EventHubClientBuilder(); + private final EventHubConsumerAsyncClient consumer = builder + .connectionString("fake-string") + .consumerGroup("consumer-group-name") + .buildAsyncConsumerClient(); + + /** + * Creates an EventData using application properties. + */ + public void createEventData() { + // BEGIN: com.azure.messaging.eventhubs.eventdata.getProperties + TelemetryEvent telemetry = new TelemetryEvent("temperature", "37"); + byte[] serializedTelemetryData = telemetry.toString().getBytes(UTF_8); + + EventData eventData = new EventData(serializedTelemetryData); + eventData.getProperties().put("eventType", TelemetryEvent.class.getName()); + // END: com.azure.messaging.eventhubs.eventdata.getProperties + } + + /** + * Code snippet for {@link EventHubClientBuilder#shareConnection()}. + */ + public void sharingConnection() { + // BEGIN: com.azure.messaging.eventhubs.eventhubclientbuilder.instantiation + // Toggling `shareConnection` instructs the builder to use the same underlying connection + // for each consumer or producer created using the same builder instance. + EventHubClientBuilder builder = new EventHubClientBuilder() + .connectionString("event-hubs-instance-connection-string") + .shareConnection(); + + // Both the producer and consumer created share the same underlying connection. + EventHubProducerAsyncClient producer = builder.buildAsyncProducerClient(); + EventHubConsumerAsyncClient consumer = builder + .consumerGroup("my-consumer-group") + .buildAsyncConsumerClient(); + // END: com.azure.messaging.eventhubs.eventhubclientbuilder.instantiation + } + + + public void instantiateConsumerAsyncClient() { + // BEGIN: com.azure.messaging.eventhubs.eventhubconsumerasyncclient.instantiation + // The required parameters are `consumerGroup` and a way to authenticate with Event Hubs using credentials. + EventHubConsumerAsyncClient consumer = new EventHubClientBuilder() + .connectionString("Endpoint={fully-qualified-namespace};SharedAccessKeyName={policy-name};" + + "SharedAccessKey={key};EntityPath={eh-name}") + .consumerGroup("consumer-group-name") + .buildAsyncConsumerClient(); + // END: com.azure.messaging.eventhubs.eventhubconsumerasyncclient.instantiation + + consumer.close(); + } + + /** + * Receives event data from a single partition. + */ + public void receive() { + + // BEGIN: com.azure.messaging.eventhubs.eventhubconsumerasyncclient.receive#string-eventposition + // Obtain partitionId from EventHubConsumerAsyncClient.getPartitionIds() + String partitionId = "0"; + EventPosition startingPosition = EventPosition.latest(); + + // Keep a reference to `subscription`. When the program is finished receiving events, call + // subscription.dispose(). This will stop fetching events from the Event Hub. + Disposable subscription = consumer.receiveFromPartition(partitionId, startingPosition) + .subscribe(partitionEvent -> { + PartitionContext partitionContext = partitionEvent.getPartitionContext(); + EventData event = partitionEvent.getData(); + + System.out.printf("Received event from partition '%s'%n", partitionContext.getPartitionId()); + System.out.printf("Contents of event as string: '%s'%n", event.getBodyAsString()); + }, error -> System.err.print(error.toString())); + // END: com.azure.messaging.eventhubs.eventhubconsumerasyncclient.receive#string-eventposition + + // When program ends, or you're done receiving all events. + subscription.dispose(); + } + + /** + * Receives event data with back pressure. + */ + public void receiveBackpressure() { + // Obtain partitionId from EventHubAsyncClient.getPartitionIds() + String partitionId = "0"; + + EventHubConsumerAsyncClient consumer = new EventHubClientBuilder() + .connectionString("fake-string") + .consumerGroup("consumer-group-name") + .buildAsyncConsumerClient(); + + // BEGIN: com.azure.messaging.eventhubs.eventhubconsumerasyncclient.receive#string-eventposition-basesubscriber + consumer.receiveFromPartition(partitionId, EventPosition.latest()).subscribe(new BaseSubscriber() { + private static final int NUMBER_OF_EVENTS = 5; + private final AtomicInteger currentNumberOfEvents = new AtomicInteger(); + + @Override + protected void hookOnSubscribe(Subscription subscription) { + // Tell the Publisher we only want 5 events at a time. + request(NUMBER_OF_EVENTS); + } + + @Override + protected void hookOnNext(PartitionEvent value) { + // Process the EventData + + // If the number of events we have currently received is a multiple of 5, that means we have reached the + // last event the Publisher will provide to us. Invoking request(long) here, tells the Publisher that + // the subscriber is ready to get more events from upstream. + if (currentNumberOfEvents.incrementAndGet() % 5 == 0) { + request(NUMBER_OF_EVENTS); + } + } + }); + // END: com.azure.messaging.eventhubs.eventhubconsumerasyncclient.receive#string-eventposition-basesubscriber + } + + /** + * Receives from all partitions. + */ + public void receiveAll() { + EventHubConsumerAsyncClient consumer = new EventHubClientBuilder() + .connectionString("fake-string") + .consumerGroup("consumer-group-name") + .buildAsyncConsumerClient(); + + // BEGIN: com.azure.messaging.eventhubs.eventhubconsumerasyncclient.receive#boolean + // Receives events from all partitions from the beginning of each partition. + consumer.receive(true).subscribe(partitionEvent -> { + PartitionContext context = partitionEvent.getPartitionContext(); + EventData event = partitionEvent.getData(); + System.out.printf("Event %s is from partition %s%n.", event.getSequenceNumber(), context.getPartitionId()); + }); + // END: com.azure.messaging.eventhubs.eventhubconsumerasyncclient.receive#boolean + } + + /** + * Receives from all partitions with last enqueued information. + */ + public void receiveLastEnqueuedInformation() { + EventHubConsumerAsyncClient consumer = new EventHubClientBuilder() + .connectionString("event-hub-instance-connection-string") + .consumerGroup("consumer-group-name") + .buildAsyncConsumerClient(); + + // BEGIN: com.azure.messaging.eventhubs.eventhubconsumerasyncclient.receiveFromPartition#string-eventposition-receiveoptions + // Set `setTrackLastEnqueuedEventProperties` to true to get the last enqueued information from the partition for + // each event that is received. + ReceiveOptions receiveOptions = new ReceiveOptions() + .setTrackLastEnqueuedEventProperties(true); + + // Receives events from partition "0" as they come in. + consumer.receiveFromPartition("0", EventPosition.earliest(), receiveOptions) + .subscribe(partitionEvent -> { + LastEnqueuedEventProperties properties = partitionEvent.getLastEnqueuedEventProperties(); + System.out.printf("Information received at %s. Last enqueued sequence number: %s%n", + properties.getRetrievalTime(), + properties.getSequenceNumber()); + }); + // END: com.azure.messaging.eventhubs.eventhubconsumerasyncclient.receiveFromPartition#string-eventposition-receiveoptions + } + + + /** + * Code snippet for creating an EventHubConsumer + */ + public void instantiateConsumerClient() { + // BEGIN: com.azure.messaging.eventhubs.eventhubconsumerclient.instantiation + // The required parameters are `consumerGroup`, and a way to authenticate with Event Hubs using credentials. + EventHubConsumerClient consumer = new EventHubClientBuilder() + .connectionString( + "Endpoint={eh-namespace};SharedAccessKeyName={policy-name};SharedAccessKey={key};Entity-Path={hub-name}") + .consumerGroup("$DEFAULT") + .buildConsumerClient(); + // END: com.azure.messaging.eventhubs.eventhubconsumerclient.instantiation + + consumer.close(); + } + + /** + * Receives event data from a single partition. + */ + public void receiveFromSinglePartition() { + EventHubConsumerClient consumer = new EventHubClientBuilder() + .connectionString("event-hub-instance-connection-string") + .consumerGroup("consumer-group-name") + .buildConsumerClient(); + + // BEGIN: com.azure.messaging.eventhubs.eventhubconsumerclient.receive#string-int-eventposition-duration + Instant twelveHoursAgo = Instant.now().minus(Duration.ofHours(12)); + EventPosition startingPosition = EventPosition.fromEnqueuedTime(twelveHoursAgo); + String partitionId = "0"; + + // Reads events from partition '0' and returns the first 100 received or until the 30 seconds has elapsed. + IterableStream events = consumer.receiveFromPartition(partitionId, 100, + startingPosition, Duration.ofSeconds(30)); + + Long lastSequenceNumber = -1L; + for (PartitionEvent partitionEvent : events) { + // For each event, perform some sort of processing. + System.out.print("Event received: " + partitionEvent.getData().getSequenceNumber()); + lastSequenceNumber = partitionEvent.getData().getSequenceNumber(); + } + + // Figure out what the next EventPosition to receive from is based on last event we processed in the stream. + // If lastSequenceNumber is -1L, then we didn't see any events the first time we fetched events from the + // partition. + if (lastSequenceNumber != -1L) { + EventPosition nextPosition = EventPosition.fromSequenceNumber(lastSequenceNumber, false); + + // Gets the next set of events from partition '0' to consume and process. + IterableStream nextEvents = consumer.receiveFromPartition(partitionId, 100, + nextPosition, Duration.ofSeconds(30)); + } + // END: com.azure.messaging.eventhubs.eventhubconsumerclient.receive#string-int-eventposition-duration + } + + + /** + * Code snippet demonstrating how to create an {@link EventHubProducerAsyncClient}. + */ + public void instantiateProducerAsyncClient() { + // BEGIN: com.azure.messaging.eventhubs.eventhubasyncproducerclient.instantiation + // The required parameter is a way to authenticate with Event Hubs using credentials. + // The connectionString provides a way to authenticate with Event Hub. + EventHubProducerAsyncClient producer = new EventHubClientBuilder() + .connectionString( + "Endpoint={fully-qualified-namespace};SharedAccessKeyName={policy-name};SharedAccessKey={key}", + "event-hub-name") + .buildAsyncProducerClient(); + // END: com.azure.messaging.eventhubs.eventhubasyncproducerclient.instantiation + + producer.close(); + } + + /** + * Code snippet demonstrating how to send a batch that automatically routes events to any partition. + */ + public void batchAutomaticRoutingAsync() { + // BEGIN: com.azure.messaging.eventhubs.eventhubasyncproducerclient.createBatch + // The required parameter is a way to authenticate with Event Hubs using credentials. + // The connectionString provides a way to authenticate with Event Hub. + EventHubProducerAsyncClient producer = new EventHubClientBuilder() + .connectionString( + "Endpoint={fully-qualified-namespace};SharedAccessKeyName={policy-name};SharedAccessKey={key}", + "event-hub-name") + .buildAsyncProducerClient(); + + // Creating a batch without options set, will allow for automatic routing of events to any partition. + producer.createBatch().flatMap(batch -> { + batch.tryAdd(new EventData("test-event-1")); + batch.tryAdd(new EventData("test-event-2")); + return producer.send(batch); + }).subscribe(unused -> { }, + error -> System.err.println("Error occurred while sending batch:" + error), + () -> System.out.println("Send complete.")); + // END: com.azure.messaging.eventhubs.eventhubasyncproducerclient.createBatch + + producer.close(); + } + + /** + * Code snippet demonstrating how to create an EventDataBatch at routes events to a single partition. + */ + public void batchPartitionIdAsync() { + EventHubProducerAsyncClient producer = builder.buildAsyncProducerClient(); + + // BEGIN: com.azure.messaging.eventhubs.eventhubasyncproducerclient.createBatch#CreateBatchOptions-partitionId + // Creating a batch with partitionId set will route all events in that batch to partition `foo`. + CreateBatchOptions options = new CreateBatchOptions().setPartitionId("foo"); + producer.createBatch(options).flatMap(batch -> { + batch.tryAdd(new EventData("test-event-1")); + batch.tryAdd(new EventData("test-event-2")); + return producer.send(batch); + }).subscribe(unused -> { }, + error -> System.err.println("Error occurred while sending batch:" + error), + () -> System.out.println("Send complete.")); + // END: com.azure.messaging.eventhubs.eventhubasyncproducerclient.createBatch#CreateBatchOptions-partitionId + + producer.close(); + } + + /** + * Code snippet demonstrating how to send events with a partition key. + */ + public void batchPartitionKeyAsync() { + EventHubProducerAsyncClient producer = builder.buildAsyncProducerClient(); + + // BEGIN: com.azure.messaging.eventhubs.eventhubasyncproducerclient.createBatch#CreateBatchOptions-partitionKey + // Creating a batch with partitionKey set will tell the service to hash the partitionKey and decide which + // partition to send the events to. Events with the same partitionKey are always routed to the same partition. + CreateBatchOptions options = new CreateBatchOptions().setPartitionKey("bread"); + producer.createBatch(options).flatMap(batch -> { + batch.tryAdd(new EventData("sourdough")); + batch.tryAdd(new EventData("rye")); + return producer.send(batch); + }).subscribe(unused -> { }, + error -> System.err.println("Error occurred while sending batch:" + error), + () -> System.out.println("Send complete.")); + // END: com.azure.messaging.eventhubs.eventhubasyncproducerclient.createBatch#CreateBatchOptions-partitionKey + } + + /** + * Code snippet demonstrating how to create a size-limited {@link EventDataBatch} and send it. + */ + public void batchSizeLimitedAsync() { + final EventHubProducerAsyncClient producer = builder.buildAsyncProducerClient(); + final EventData firstEvent = new EventData("92".getBytes(UTF_8)); + firstEvent.getProperties().put("telemetry", "latency"); + final EventData secondEvent = new EventData("98".getBytes(UTF_8)); + secondEvent.getProperties().put("telemetry", "cpu-temperature"); + + // BEGIN: com.azure.messaging.eventhubs.eventhubasyncproducerclient.createBatch#CreateBatchOptions-int + final Flux telemetryEvents = Flux.just(firstEvent, secondEvent); + + // Setting `setMaximumSizeInBytes` when creating a batch, limits the size of that batch. + // In this case, all the batches created with these options are limited to 256 bytes. + final CreateBatchOptions options = new CreateBatchOptions() + .setMaximumSizeInBytes(256); + final AtomicReference currentBatch = new AtomicReference<>( + producer.createBatch(options).block()); + + // The sample Flux contains two events, but it could be an infinite stream of telemetry events. + telemetryEvents.flatMap(event -> { + final EventDataBatch batch = currentBatch.get(); + if (batch.tryAdd(event)) { + return Mono.empty(); + } + + return Mono.when( + producer.send(batch), + producer.createBatch(options).map(newBatch -> { + currentBatch.set(newBatch); + + // Add the event that did not fit in the previous batch. + if (!newBatch.tryAdd(event)) { + throw Exceptions.propagate(new IllegalArgumentException( + "Event was too large to fit in an empty batch. Max size: " + newBatch.getMaxSizeInBytes())); + } + + return newBatch; + })); + }).then() + .doFinally(signal -> { + final EventDataBatch batch = currentBatch.getAndSet(null); + if (batch != null && batch.getCount() > 0) { + producer.send(batch).block(); + } + }); + // END: com.azure.messaging.eventhubs.eventhubasyncproducerclient.createBatch#CreateBatchOptions-int + } + + /** + * Code snippet to demonstrate how to send a list of events using + * {@link EventHubProducerAsyncClient#send(Iterable)}. + */ + public void sendIterableSampleAsync() { + final EventHubProducerAsyncClient producer = builder.buildAsyncProducerClient(); + // BEGIN: com.azure.messaging.eventhubs.eventhubasyncproducerclient.send#Iterable + List events = Arrays.asList(new EventData("maple"), new EventData("aspen"), + new EventData("oak")); + producer + .send(events) + .subscribe(unused -> { }, + error -> System.err.println("Error occurred while sending events:" + error), + () -> System.out.println("Send complete.")); + // END: com.azure.messaging.eventhubs.eventhubasyncproducerclient.send#Iterable + } + + /** + * Code snippet to demonstrate how to send a list of events using + * {@link EventHubProducerAsyncClient#send(Iterable, SendOptions)}. + */ + public void sendIterableWithPartitionKeySampleAsync() { + final EventHubProducerAsyncClient producer = builder.buildAsyncProducerClient(); + // BEGIN: com.azure.messaging.eventhubs.eventhubasyncproducerclient.send#Iterable-SendOptions + List events = Arrays.asList(new EventData("Melbourne"), new EventData("London"), + new EventData("New York")); + SendOptions sendOptions = new SendOptions().setPartitionKey("cities"); + producer + .send(events, sendOptions) + .subscribe(unused -> { }, + error -> System.err.println("Error occurred while sending events:" + error), + () -> System.out.println("Send complete.")); + // END: com.azure.messaging.eventhubs.eventhubasyncproducerclient.send#Iterable-SendOptions + } + + /** + * Code snippet demonstrating how to create an {@link EventHubProducerClient}. + */ + public void instantiateProducerClient() { + // BEGIN: com.azure.messaging.eventhubs.eventhubproducerclient.instantiation + // The required parameter is a way to authenticate with Event Hubs using credentials. + // The connectionString provides a way to authenticate with Event Hub. + EventHubProducerClient producer = new EventHubClientBuilder() + .connectionString( + "Endpoint={fully-qualified-namespace};SharedAccessKeyName={policy-name};SharedAccessKey={key}", + "event-hub-name") + .buildProducerClient(); + // END: com.azure.messaging.eventhubs.eventhubproducerclient.instantiation + + producer.close(); + } + + /** + * Code snippet demonstrating how to send a batch that automatically routes events to any partition. + * + * @throws IllegalArgumentException if an event is too large for an empty batch. + */ + public void batchAutomaticRouting() { + // BEGIN: com.azure.messaging.eventhubs.eventhubproducerclient.createBatch + // The required parameter is a way to authenticate with Event Hubs using credentials. + // The connectionString provides a way to authenticate with Event Hub. + EventHubProducerClient producer = new EventHubClientBuilder() + .connectionString( + "Endpoint={fully-qualified-namespace};SharedAccessKeyName={policy-name};SharedAccessKey={key}", + "event-hub-name") + .buildProducerClient(); + List events = Arrays.asList(new EventData("test-event-1"), new EventData("test-event-2")); + + // Creating a batch without options set, will allow for automatic routing of events to any partition. + EventDataBatch batch = producer.createBatch(); + for (EventData event : events) { + if (batch.tryAdd(event)) { + continue; + } + + producer.send(batch); + batch = producer.createBatch(); + if (!batch.tryAdd(event)) { + throw new IllegalArgumentException("Event is too large for an empty batch."); + } + } + // END: com.azure.messaging.eventhubs.eventhubproducerclient.createBatch + + producer.close(); + } + + /** + * Code snippet demonstrating how to create an EventDataBatch at routes events to a single partition. + */ + public void batchPartitionId() { + final EventHubProducerClient producer = builder.buildProducerClient(); + + // BEGIN: com.azure.messaging.eventhubs.eventhubproducerclient.createBatch#CreateBatchOptions-partitionId + // Creating a batch with partitionId set will route all events in that batch to partition `foo`. + CreateBatchOptions options = new CreateBatchOptions().setPartitionId("foo"); + + EventDataBatch batch = producer.createBatch(options); + batch.tryAdd(new EventData("data-to-partition-foo")); + producer.send(batch); + // END: com.azure.messaging.eventhubs.eventhubproducerclient.createBatch#CreateBatchOptions-partitionId + } + + /** + * Code snippet demonstrating how to send events with a partition key. + */ + public void batchPartitionKey() { + final EventHubProducerClient producer = builder.buildProducerClient(); + + // BEGIN: com.azure.messaging.eventhubs.eventhubproducerclient.createBatch#CreateBatchOptions-partitionKey + List events = Arrays.asList(new EventData("sourdough"), new EventData("rye"), + new EventData("wheat")); + + // Creating a batch with partitionKey set will tell the service to hash the partitionKey and decide which + // partition to send the events to. Events with the same partitionKey are always routed to the same partition. + CreateBatchOptions options = new CreateBatchOptions().setPartitionKey("bread"); + EventDataBatch batch = producer.createBatch(options); + + events.forEach(event -> batch.tryAdd(event)); + producer.send(batch); + // END: com.azure.messaging.eventhubs.eventhubproducerclient.createBatch#CreateBatchOptions-partitionKey + } + + /** + * Code snippet demonstrating how to create a size-limited {@link EventDataBatch} and send it. + * + * @throws IllegalArgumentException if an event is too large for an empty batch. + */ + public void batchSizeLimited() { + final EventHubProducerClient producer = builder.buildProducerClient(); + final EventData firstEvent = new EventData("92".getBytes(UTF_8)); + firstEvent.getProperties().put("telemetry", "latency"); + final EventData secondEvent = new EventData("98".getBytes(UTF_8)); + secondEvent.getProperties().put("telemetry", "cpu-temperature"); + final EventData thirdEvent = new EventData("120".getBytes(UTF_8)); + thirdEvent.getProperties().put("telemetry", "fps"); + + // BEGIN: com.azure.messaging.eventhubs.eventhubproducerclient.createBatch#CreateBatchOptions-int + + + final List telemetryEvents = Arrays.asList(firstEvent, secondEvent, thirdEvent); + + // Setting `setMaximumSizeInBytes` when creating a batch, limits the size of that batch. + // In this case, all the batches created with these options are limited to 256 bytes. + final CreateBatchOptions options = new CreateBatchOptions() + .setMaximumSizeInBytes(256); + + EventDataBatch currentBatch = producer.createBatch(options); + + // For each telemetry event, we try to add it to the current batch. + // When the batch is full, send it then create another batch to add more events to. + for (EventData event : telemetryEvents) { + if (!currentBatch.tryAdd(event)) { + producer.send(currentBatch); + currentBatch = producer.createBatch(options); + + // Add the event we couldn't before. + if (!currentBatch.tryAdd(event)) { + throw new IllegalArgumentException("Event is too large for an empty batch."); + } + } + } + // END: com.azure.messaging.eventhubs.eventhubproducerclient.createBatch#CreateBatchOptions-int + } + + /** + * Code snippet to demonstrate how to send a list of events using {@link EventHubProducerClient#send(Iterable)}. + */ + public void sendIterableSample() { + final EventHubProducerClient producer = builder.buildProducerClient(); + // BEGIN: com.azure.messaging.eventhubs.eventhubproducerclient.send#Iterable + List events = Arrays.asList(new EventData("maple"), new EventData("aspen"), + new EventData("oak")); + producer.send(events); + // END: com.azure.messaging.eventhubs.eventhubproducerclient.send#Iterable + } + + /** + * Code snippet to demonstrate how to send a list of events using + * {@link EventHubProducerClient#send(Iterable, SendOptions)}. + */ + public void sendIterableWithPartitionKeySample() { + final EventHubProducerClient producer = builder.buildProducerClient(); + // BEGIN: com.azure.messaging.eventhubs.eventhubproducerclient.send#Iterable-SendOptions + List events = Arrays.asList(new EventData("Melbourne"), new EventData("London"), + new EventData("New York")); + SendOptions sendOptions = new SendOptions().setPartitionKey("cities"); + producer.send(events, sendOptions); + // END: com.azure.messaging.eventhubs.eventhubproducerclient.send#Iterable-SendOptions + } + + /** + * Code snippet for showing how to create a new instance of {@link EventProcessorClient}. + * + * @return A new instance of {@link EventProcessorClient} + */ + // BEGIN: com.azure.messaging.eventhubs.eventprocessorclientbuilder.instantiation + public EventProcessorClient createEventProcessor() { + String connectionString = "Endpoint={endpoint};SharedAccessKeyName={sharedAccessKeyName};" + + "SharedAccessKey={sharedAccessKey};EntityPath={eventHubName}"; + + EventProcessorClient eventProcessorClient = new EventProcessorClientBuilder() + .consumerGroup("consumer-group") + .checkpointStore(new SampleCheckpointStore()) + .processEvent(eventContext -> { + System.out.println("Partition id = " + eventContext.getPartitionContext().getPartitionId() + + "and sequence number of event = " + eventContext.getEventData().getSequenceNumber()); + }) + .processError(errorContext -> { + System.out.printf("Error occurred in partition processor for partition {}, {}", + errorContext.getPartitionContext().getPartitionId(), + errorContext.getThrowable()); + }) + .connectionString(connectionString) + .buildEventProcessorClient(); + return eventProcessorClient; + } + // END: com.azure.messaging.eventhubs.eventprocessorclientbuilder.instantiation + + /** + * Code snippet to show creation of an event processor that receives events in batches. + */ + public void receiveBatchSample() { + String connectionString = "Endpoint={endpoint};SharedAccessKeyName={sharedAccessKeyName};" + + "SharedAccessKey={sharedAccessKey};EntityPath={eventHubName}"; + + // BEGIN: com.azure.messaging.eventhubs.eventprocessorclientbuilder.batchreceive + EventProcessorClient eventProcessorClient = new EventProcessorClientBuilder() + .consumerGroup("consumer-group") + .checkpointStore(new SampleCheckpointStore()) + .processEventBatch(eventBatchContext -> { + eventBatchContext.getEvents().forEach(eventData -> { + System.out.println("Partition id = " + eventBatchContext.getPartitionContext().getPartitionId() + + "and sequence number of event = " + eventData.getSequenceNumber()); + }); + }, 50, Duration.ofSeconds(30)) + .processError(errorContext -> { + System.out.printf("Error occurred in partition processor for partition {}, {}", + errorContext.getPartitionContext().getPartitionId(), + errorContext.getThrowable()); + }) + .connectionString(connectionString) + .buildEventProcessorClient(); + // END: com.azure.messaging.eventhubs.eventprocessorclientbuilder.batchreceive + } + + /** + * Code snippet for showing how to start and stop an {@link EventProcessorClient}. + */ + public void startStopSample() { + String connectionString = "Endpoint={endpoint};SharedAccessKeyName={sharedAccessKeyName};" + + "SharedAccessKey={sharedAccessKey};EntityPath={eventHubName}"; + EventProcessorClient eventProcessorClient = new EventProcessorClientBuilder() + .connectionString(connectionString) + .processEvent(eventContext -> { + System.out.println("Partition id = " + eventContext.getPartitionContext().getPartitionId() + " and " + + "sequence number of event = " + eventContext.getEventData().getSequenceNumber()); + }) + .processError(errorContext -> { + System.out.printf("Error occurred in partition processor for partition {}, {}", + errorContext.getPartitionContext().getPartitionId(), + errorContext.getThrowable()); + }) + .consumerGroup("consumer-group") + .buildEventProcessorClient(); + + // BEGIN: com.azure.messaging.eventhubs.eventprocessorclient.startstop + eventProcessorClient.start(); + // Continue to perform other tasks while the processor is running in the background. + eventProcessorClient.stop(); + // END: com.azure.messaging.eventhubs.eventprocessorclient.startstop + } + + private static final class TelemetryEvent { + private final String name; + private final String value; + + private TelemetryEvent(String name, String value) { + this.name = name; + this.value = value; + } + + @Override + public String toString() { + return String.format("[name]=%s;[value]=%s", name, value); + } + } +} diff --git a/sdk/eventhubs/azure-messaging-eventhubs/src/samples/java/com/azure/messaging/eventhubs/EventProcessorBuilderJavaDocCodeSamples.java b/sdk/eventhubs/azure-messaging-eventhubs/src/samples/java/com/azure/messaging/eventhubs/EventProcessorBuilderJavaDocCodeSamples.java deleted file mode 100644 index 04a4ad841c92a..0000000000000 --- a/sdk/eventhubs/azure-messaging-eventhubs/src/samples/java/com/azure/messaging/eventhubs/EventProcessorBuilderJavaDocCodeSamples.java +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.messaging.eventhubs; - -import java.time.Duration; - -/** - * Code snippets for {@link EventProcessorClientBuilder}. - */ -public class EventProcessorBuilderJavaDocCodeSamples { - - /** - * Code snippet for showing how to create a new instance of {@link EventProcessorClient}. - * - * @return A new instance of {@link EventProcessorClient} - */ - // BEGIN: com.azure.messaging.eventhubs.eventprocessorclientbuilder.instantiation - public EventProcessorClient createEventProcessor() { - String connectionString = "Endpoint={endpoint};SharedAccessKeyName={sharedAccessKeyName};" - + "SharedAccessKey={sharedAccessKey};EntityPath={eventHubName}"; - - EventProcessorClient eventProcessorClient = new EventProcessorClientBuilder() - .consumerGroup("consumer-group") - .checkpointStore(new SampleCheckpointStore()) - .processEvent(eventContext -> { - System.out.println("Partition id = " + eventContext.getPartitionContext().getPartitionId() - + "and sequence number of event = " + eventContext.getEventData().getSequenceNumber()); - }) - .processError(errorContext -> { - System.out.printf("Error occurred in partition processor for partition {}, {}", - errorContext.getPartitionContext().getPartitionId(), - errorContext.getThrowable()); - }) - .connectionString(connectionString) - .buildEventProcessorClient(); - return eventProcessorClient; - } - // END: com.azure.messaging.eventhubs.eventprocessorclientbuilder.instantiation - - /** - * Code snippet to show creation of an event processor that receives events in batches. - */ - public void receiveBatchSample() { - String connectionString = "Endpoint={endpoint};SharedAccessKeyName={sharedAccessKeyName};" - + "SharedAccessKey={sharedAccessKey};EntityPath={eventHubName}"; - - // BEGIN: com.azure.messaging.eventhubs.eventprocessorclientbuilder.batchreceive - EventProcessorClient eventProcessorClient = new EventProcessorClientBuilder() - .consumerGroup("consumer-group") - .checkpointStore(new SampleCheckpointStore()) - .processEventBatch(eventBatchContext -> { - eventBatchContext.getEvents().forEach(eventData -> { - System.out.println("Partition id = " + eventBatchContext.getPartitionContext().getPartitionId() - + "and sequence number of event = " + eventData.getSequenceNumber()); - }); - }, 50, Duration.ofSeconds(30)) - .processError(errorContext -> { - System.out.printf("Error occurred in partition processor for partition {}, {}", - errorContext.getPartitionContext().getPartitionId(), - errorContext.getThrowable()); - }) - .connectionString(connectionString) - .buildEventProcessorClient(); - // END: com.azure.messaging.eventhubs.eventprocessorclientbuilder.batchreceive - } - -} diff --git a/sdk/eventhubs/azure-messaging-eventhubs/src/samples/java/com/azure/messaging/eventhubs/EventProcessorClientJavaDocCodeSamples.java b/sdk/eventhubs/azure-messaging-eventhubs/src/samples/java/com/azure/messaging/eventhubs/EventProcessorClientJavaDocCodeSamples.java deleted file mode 100644 index 6a43081a63be0..0000000000000 --- a/sdk/eventhubs/azure-messaging-eventhubs/src/samples/java/com/azure/messaging/eventhubs/EventProcessorClientJavaDocCodeSamples.java +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.messaging.eventhubs; - -/** - * Code snippets for {@link EventProcessorClient}. - */ -public final class EventProcessorClientJavaDocCodeSamples { - - /** - * Code snippet for showing how to start and stop an {@link EventProcessorClient}. - */ - public void startStopSample() { - String connectionString = "Endpoint={endpoint};SharedAccessKeyName={sharedAccessKeyName};" - + "SharedAccessKey={sharedAccessKey};EntityPath={eventHubName}"; - EventProcessorClient eventProcessorClient = new EventProcessorClientBuilder() - .connectionString(connectionString) - .processEvent(eventContext -> { - System.out.println("Partition id = " + eventContext.getPartitionContext().getPartitionId() + " and " - + "sequence number of event = " + eventContext.getEventData().getSequenceNumber()); - }) - .processError(errorContext -> { - System.out.printf("Error occurred in partition processor for partition {}, {}", - errorContext.getPartitionContext().getPartitionId(), - errorContext.getThrowable()); - }) - .consumerGroup("consumer-group") - .buildEventProcessorClient(); - - // BEGIN: com.azure.messaging.eventhubs.eventprocessorclient.startstop - eventProcessorClient.start(); - // Continue to perform other tasks while the processor is running in the background. - eventProcessorClient.stop(); - // END: com.azure.messaging.eventhubs.eventprocessorclient.startstop - } -} From 60cde34ec1e0a11de0735c628cb3e23d2dac0ef8 Mon Sep 17 00:00:00 2001 From: Sameeksha Vaity Date: Mon, 6 Jul 2020 14:20:06 -0700 Subject: [PATCH 020/129] FormRecognizer Receipt design update (#12380) --- .../checkstyle/checkstyle-suppressions.xml | 2 + .../azure-ai-formrecognizer/CHANGELOG.md | 3 + .../azure-ai-formrecognizer/README.md | 125 ++--- .../FormRecognizerAsyncClient.java | 25 +- .../formrecognizer/FormRecognizerClient.java | 17 +- .../azure/ai/formrecognizer/Transforms.java | 90 ++-- .../ai/formrecognizer/models/FieldValue.java | 215 --------- .../formrecognizer/models/FieldValueType.java | 201 ++++++-- .../ai/formrecognizer/models/FormField.java | 34 +- .../formrecognizer/models/RecognizedForm.java | 6 +- .../models/RecognizedReceipt.java | 36 -- .../AdvancedDiffLabeledUnlabeledData.java | 4 +- ...AdvancedDiffLabeledUnlabeledDataAsync.java | 4 +- .../ai/formrecognizer/Authentication.java | 113 +++-- ...ognizerAsyncClientJavaDocCodeSnippets.java | 336 ++++++++------ ...rmRecognizerClientJavaDocCodeSnippets.java | 302 +++++++----- .../ai/formrecognizer/GetBoundingBoxes.java | 2 +- .../formrecognizer/GetBoundingBoxesAsync.java | 2 +- .../ai/formrecognizer/ReadmeSamples.java | 103 +++-- .../com/azure/ai/formrecognizer/Receipt.java | 360 +++++++++++++++ .../ai/formrecognizer/RecognizeReceipts.java | 96 ++-- .../RecognizeReceiptsAsync.java | 97 ++-- .../RecognizeReceiptsFromUrl.java | 99 ++-- .../RecognizeReceiptsFromUrlAsync.java | 98 ++-- .../StronglyTypedRecognizedForm.java | 79 ++++ .../FieldValueTypeCastTest.java | 429 ++++++++++++++++++ .../FormRecognizerAsyncClientTest.java | 21 +- .../FormRecognizerClientTest.java | 23 +- .../FormRecognizerClientTestBase.java | 89 ++-- .../FormTrainingAsyncClientTest.java | 4 +- .../FormTrainingClientTest.java | 4 +- .../FormTrainingClientTestBase.java | 8 +- 32 files changed, 2010 insertions(+), 1017 deletions(-) delete mode 100644 sdk/formrecognizer/azure-ai-formrecognizer/src/main/java/com/azure/ai/formrecognizer/models/FieldValue.java delete mode 100644 sdk/formrecognizer/azure-ai-formrecognizer/src/main/java/com/azure/ai/formrecognizer/models/RecognizedReceipt.java create mode 100644 sdk/formrecognizer/azure-ai-formrecognizer/src/samples/java/com/azure/ai/formrecognizer/Receipt.java create mode 100644 sdk/formrecognizer/azure-ai-formrecognizer/src/samples/java/com/azure/ai/formrecognizer/StronglyTypedRecognizedForm.java create mode 100644 sdk/formrecognizer/azure-ai-formrecognizer/src/test/java/com/azure/ai/formrecognizer/FieldValueTypeCastTest.java diff --git a/eng/code-quality-reports/src/main/resources/checkstyle/checkstyle-suppressions.xml b/eng/code-quality-reports/src/main/resources/checkstyle/checkstyle-suppressions.xml index 11048593d7430..e7baf627fd477 100755 --- a/eng/code-quality-reports/src/main/resources/checkstyle/checkstyle-suppressions.xml +++ b/eng/code-quality-reports/src/main/resources/checkstyle/checkstyle-suppressions.xml @@ -417,6 +417,8 @@ + + diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/CHANGELOG.md b/sdk/formrecognizer/azure-ai-formrecognizer/CHANGELOG.md index 162ff520b38fa..3cb44caee64fd 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/CHANGELOG.md +++ b/sdk/formrecognizer/azure-ai-formrecognizer/CHANGELOG.md @@ -2,6 +2,9 @@ ## 1.0.0-beta.4 (Unreleased) ### Breaking Changes +- `beginRecognizeReceipt` APIs now return a `RecognizedForm` model instead of a `RecognizedReceipt`. See +[this](https://github.com/Azure/azure-sdk-for-java/sdk/formrecognizer/azure-ai-formrecognizer/src/samples/java/com/azure/ai/formrecognizer/StronglyTypedRecognizedFormUSReceipt.java) +suggested approach for extracting information from receipts. - Methods returning `textContent` have been renamed to `fieldElements` on `FieldData` and `FormTableCell` - Renamed `FormContent` to `FormElement` - Renamed `FieldText` to `FieldData` diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/README.md b/sdk/formrecognizer/azure-ai-formrecognizer/README.md index 1ba2bd54919b9..6fef4de94f21e 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/README.md +++ b/sdk/formrecognizer/azure-ai-formrecognizer/README.md @@ -177,7 +177,7 @@ followed by polling the service at intervals to determine whether the operation succeeded, to get the result. Methods that train models or recognize values from forms are modeled as long-running operations. The client exposes -a `begin` method that returns a `SyncPoller` or `PollerFlux` instance. +a `begin` method that returns a `SyncPoller` or `PollerFlux` instance. Callers should wait for the operation to completed by calling `getFinalResult()` on the returned operation from the `begin` method. Sample code snippets are provided to illustrate using long-running operations [below](#Examples). @@ -195,7 +195,7 @@ The following section provides several code snippets covering some of the most c ### Recognize Forms Using a Custom Model Recognize name/value pairs and table data from forms. These models are trained with your own data, so they're tailored to your forms. You should only recognize forms of the same form type that the custom model was trained on. - + ```java String formUrl = "{form_url}"; String modelId = "{custom_trained_model_id}"; @@ -206,20 +206,19 @@ List recognizedForms = recognizeFormPoller.getFinalResult(); for (int i = 0; i < recognizedForms.size(); i++) { RecognizedForm form = recognizedForms.get(i); - System.out.printf("----------- Recognized Form %d-----------%n", i); + System.out.printf("----------- Recognized Form %d -----------%n", i); System.out.printf("Form type: %s%n", form.getFormType()); - form.getFields().forEach((label, formField) -> { + form.getFields().forEach((label, formField) -> System.out.printf("Field %s has value %s with confidence score of %f.%n", label, formField.getValueData().getText(), - formField.getConfidence()); - }); - System.out.print("-----------------------------------"); + formField.getConfidence()) + ); } ``` ### Recognize Content Recognize text and table structures, along with their bounding box coordinates, from documents. - + ```java // recognize form content using file input stream File form = new File("local/file_path/filename.png"); @@ -233,7 +232,7 @@ List contentPageResults = recognizeContentPoller.getFinalResult(); for (int i = 0; i < contentPageResults.size(); i++) { FormPage formPage = contentPageResults.get(i); - System.out.printf("----Recognizing content for page %d----%n", i); + System.out.printf("----Recognizing content for page %d ----%n", i); // Table information System.out.printf("Has width: %f and height: %f, measured with unit: %s.%n", formPage.getWidth(), formPage.getHeight(), @@ -241,64 +240,75 @@ for (int i = 0; i < contentPageResults.size(); i++) { formPage.getTables().forEach(formTable -> { System.out.printf("Table has %d rows and %d columns.%n", formTable.getRowCount(), formTable.getColumnCount()); - formTable.getCells().forEach(formTableCell -> { - System.out.printf("Cell has text %s.%n", formTableCell.getText()); - }); - System.out.println(); + formTable.getCells().forEach(formTableCell -> + System.out.printf("Cell has text %s.%n", formTableCell.getText())); }); } ``` ### Recognize receipts -Recognize data from a USA sales receipts using a prebuilt model. [Here][service_recognize_receipt] are the fields the -service returns for a recognized receipt. - +Recognize data from a USA sales receipts using a prebuilt model. [Here][service_recognize_receipt] are the fields the service returns for a recognized receipt. See [StronglyTypedRecognizedForm.java][strongly_typed_sample] for a suggested approach to extract +information from receipts. + + ```java String receiptUrl = "https://docs.microsoft.com/en-us/azure/cognitive-services/form-recognizer/media" + "/contoso-allinone.jpg"; -SyncPoller> syncPoller = +SyncPoller> syncPoller = formRecognizerClient.beginRecognizeReceiptsFromUrl(receiptUrl); -List receiptPageResults = syncPoller.getFinalResult(); +List receiptPageResults = syncPoller.getFinalResult(); for (int i = 0; i < receiptPageResults.size(); i++) { - RecognizedReceipt recognizedReceipt = receiptPageResults.get(i); - Map recognizedFields = recognizedReceipt.getRecognizedForm().getFields(); + RecognizedForm recognizedForm = receiptPageResults.get(i); + Map> recognizedFields = recognizedForm.getFields(); System.out.printf("----------- Recognized Receipt page %d -----------%n", i); - FormField merchantNameField = recognizedFields.get("MerchantName"); - if (merchantNameField.getFieldValue().getType() == FieldValueType.STRING) { - System.out.printf("Merchant Name: %s, confidence: %.2f%n", - merchantNameField.getFieldValue().asString(), - merchantNameField.getConfidence()); + FormField merchantNameField = recognizedFields.get("MerchantName"); + if (merchantNameField != null) { + if (FieldValueType.STRING.equals(merchantNameField.getValueType())) { + String merchantName = FieldValueType.STRING.cast(merchantNameField); + System.out.printf("Merchant Name: %s, confidence: %.2f%n", + merchantName, merchantNameField.getConfidence()); + } } - FormField transactionDateField = recognizedFields.get("TransactionDate"); - if (transactionDateField.getFieldValue().getType() == FieldValueType.DATE) { - System.out.printf("Transaction Date: %s, confidence: %.2f%n", - transactionDateField.getFieldValue().asDate(), - transactionDateField.getConfidence()); + + FormField merchantPhoneNumberField = recognizedFields.get("MerchantPhoneNumber"); + if (merchantPhoneNumberField != null) { + if (FieldValueType.PHONE_NUMBER.equals(merchantNameField.getValueType())) { + String merchantAddress = FieldValueType.PHONE_NUMBER.cast(merchantPhoneNumberField); + System.out.printf("Merchant Phone number: %s, confidence: %.2f%n", + merchantAddress, merchantPhoneNumberField.getConfidence()); + } } - FormField receiptItemsField = recognizedFields.get("Items"); - System.out.printf("Receipt Items: %n"); - if (receiptItemsField.getFieldValue().getType() == FieldValueType.LIST) { - List receiptItems = receiptItemsField.getFieldValue().asList(); - receiptItems.forEach(receiptItem -> { - if (receiptItem.getFieldValue().getType() == FieldValueType.MAP) { - receiptItem.getFieldValue().asMap().forEach((key, formField) -> { - if (key.equals("Name")) { - if (formField.getFieldValue().getType() == FieldValueType.STRING) { - System.out.printf("Name: %s, confidence: %.2fs%n", - formField.getFieldValue().asString(), - formField.getConfidence()); - } - } - if (key.equals("Quantity")) { - if (formField.getFieldValue().getType() == FieldValueType.INTEGER) { - System.out.printf("Quantity: %d, confidence: %.2f%n", - formField.getFieldValue().asInteger(), formField.getConfidence()); + + FormField transactionDateField = recognizedFields.get("TransactionDate"); + if (transactionDateField != null) { + if (FieldValueType.DATE.equals(transactionDateField.getValueType())) { + LocalDate transactionDate = FieldValueType.DATE.cast(transactionDateField); + System.out.printf("Transaction Date: %s, confidence: %.2f%n", + transactionDate, transactionDateField.getConfidence()); + } + } + + FormField receiptItemsField = recognizedFields.get("Items"); + if (receiptItemsField != null) { + System.out.printf("Receipt Items: %n"); + if (FieldValueType.LIST.equals(receiptItemsField.getValueType())) { + List> receiptItems = FieldValueType.LIST.cast(receiptItemsField); + receiptItems.forEach(receiptItem -> { + if (FieldValueType.MAP.equals(receiptItem.getValueType())) { + Map> formFieldMap = FieldValueType.MAP.cast(receiptItem); + formFieldMap.forEach((key, formField) -> { + if ("Quantity".equals(key)) { + if (FieldValueType.DOUBLE.equals(formField.getValueType())) { + Float quantity = FieldValueType.DOUBLE.cast(formField); + System.out.printf("Quantity: %f, confidence: %.2f%n", + quantity, formField.getConfidence()); + } } - } - }); - } - }); + }); + } + }); + } } } ``` @@ -307,7 +317,7 @@ for (int i = 0; i < receiptPageResults.size(); i++) { Train a machine-learned model on your own form type. The resulting model will be able to recognize values from the types of forms it was trained on. Provide a container SAS url to your Azure Storage Blob container where you're storing the training documents. See details on setting this up in the [service quickstart documentation][quickstart_training]. - + ```java String trainingFilesUrl = "{SAS-URL-of-your-container-in-blob-storage}"; SyncPoller trainingPoller = @@ -334,7 +344,7 @@ customFormModel.getSubmodels().forEach(customFormSubmodel -> { ### Manage your models Manage the custom models attached to your account. - + ```java AtomicReference modelId = new AtomicReference<>(); // First, we see how many custom models we have, and what our limit is @@ -376,7 +386,7 @@ to provide an invalid file source URL an `HttpResponseException` would be raised In the following code snippet, the error is handled gracefully by catching the exception and display the additional information about the error. - + ```java try { formRecognizerClient.beginRecognizeContentFromUrl("invalidSourceUrl"); @@ -414,7 +424,7 @@ These code samples show common scenario operations with the Azure Form Recognize #### Async APIs All the examples shown so far have been using synchronous APIs, but we provide full support for async APIs as well. You'll need to use `FormRecognizerAsyncClient` - + ```java FormRecognizerAsyncClient formRecognizerAsyncClient = new FormRecognizerClientBuilder() .credential(new AzureKeyCredential("{key}")) @@ -498,7 +508,8 @@ This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For m [service_access]: https://docs.microsoft.com/azure/cognitive-services/cognitive-services-apis-create-account?tabs=multiservice%2Cwindows [service_doc_train_unlabeled]: https://docs.microsoft.com/azure/cognitive-services/form-recognizer/overview#train-without-labels [service_doc_train_labeled]: https://docs.microsoft.com/azure/cognitive-services/form-recognizer/overview#train-with-labels -[service_recognize_receipt]: https://westus2.dev.cognitive.microsoft.com/docs/services/form-recognizer-api-v2-preview/operations/GetAnalyzeReceiptResult +[service_recognize_receipt]: https://aka.ms/azsdk/python/formrecognizer/receiptfields +[strongly_typed_sample]: https://github.com/Azure/azure-sdk-for-java/blob/master/sdk/formrecognizer/azure-ai-formrecognizer/src/samples/java/com/azure/ai/formrecognizer/StronglyTypedRecognizedForm.java [source_code]: src [quickstart_training]: https://docs.microsoft.com/azure/cognitive-services/form-recognizer/quickstarts/curl-train-extract#train-a-form-recognizer-model [wiki_identity]: https://github.com/Azure/azure-sdk-for-java/wiki/Identity-and-Authentication diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/src/main/java/com/azure/ai/formrecognizer/FormRecognizerAsyncClient.java b/sdk/formrecognizer/azure-ai-formrecognizer/src/main/java/com/azure/ai/formrecognizer/FormRecognizerAsyncClient.java index 6f35bf31af369..6e9dc5a0a9629 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/src/main/java/com/azure/ai/formrecognizer/FormRecognizerAsyncClient.java +++ b/sdk/formrecognizer/azure-ai-formrecognizer/src/main/java/com/azure/ai/formrecognizer/FormRecognizerAsyncClient.java @@ -16,7 +16,6 @@ import com.azure.ai.formrecognizer.models.OperationResult; import com.azure.ai.formrecognizer.models.RecognizeOptions; import com.azure.ai.formrecognizer.models.RecognizedForm; -import com.azure.ai.formrecognizer.models.RecognizedReceipt; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceClient; import com.azure.core.annotation.ServiceMethod; @@ -38,7 +37,6 @@ import java.util.UUID; import java.util.function.Function; -import static com.azure.ai.formrecognizer.Transforms.toReceipt; import static com.azure.ai.formrecognizer.Transforms.toRecognizedForm; import static com.azure.ai.formrecognizer.Transforms.toRecognizedLayout; import static com.azure.ai.formrecognizer.implementation.Utility.detectContentType; @@ -339,13 +337,13 @@ public PollerFlux> beginRecognizeContent(Flux> + public PollerFlux> beginRecognizeReceiptsFromUrl(String receiptUrl) { return beginRecognizeReceiptsFromUrl(receiptUrl, null); } @@ -364,17 +362,17 @@ public PollerFlux> beginRecognizeContent(Flux> + public PollerFlux> beginRecognizeReceiptsFromUrl(String receiptUrl, RecognizeOptions recognizeOptions) { try { recognizeOptions = getRecognizeOptionsProperties(recognizeOptions); - return new PollerFlux>( + return new PollerFlux>( recognizeOptions.getPollInterval(), receiptAnalyzeActivationOperation(receiptUrl, recognizeOptions.isIncludeFieldElements()), extractReceiptPollOperation(), @@ -403,13 +401,13 @@ public PollerFlux> beginRecognizeContent(Flux> beginRecognizeReceipts( + public PollerFlux> beginRecognizeReceipts( Flux receipt, long length) { return beginRecognizeReceipts(receipt, length, null); } @@ -433,13 +431,13 @@ public PollerFlux> beginRecognizeReceip * analyzing a receipt. * * @return A {@link PollerFlux} that polls the recognize receipt operation until it has completed, has failed, - * or has been cancelled. The completed operation returns a List of {@link RecognizedReceipt}. + * or has been cancelled. The completed operation returns a List of {@link RecognizedForm}. * @throws FormRecognizerException If recognize operation fails and the {@link AnalyzeOperationResult} returned with * an {@link OperationStatus#FAILED}. * @throws NullPointerException If {@code recognizeOptions} is {@code null}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PollerFlux> + public PollerFlux> beginRecognizeReceipts(Flux receipt, long length, RecognizeOptions recognizeOptions) { try { recognizeOptions = getRecognizeOptionsProperties(recognizeOptions); @@ -514,7 +512,7 @@ private Function, Mono> receipt }; } - private Function, Mono>> + private Function, Mono>> fetchExtractReceiptResult(boolean includeFieldElements) { return (pollingContext) -> { try { @@ -522,7 +520,8 @@ private Function, Mono> receipt return service.getAnalyzeReceiptResultWithResponseAsync(resultUid) .map(modelSimpleResponse -> { throwIfAnalyzeStatusInvalid(modelSimpleResponse.getValue()); - return toReceipt(modelSimpleResponse.getValue().getAnalyzeResult(), includeFieldElements); + return toRecognizedForm(modelSimpleResponse.getValue().getAnalyzeResult(), + includeFieldElements); }) .onErrorMap(Utility::mapToHttpResponseExceptionIfExist); } catch (RuntimeException ex) { diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/src/main/java/com/azure/ai/formrecognizer/FormRecognizerClient.java b/sdk/formrecognizer/azure-ai-formrecognizer/src/main/java/com/azure/ai/formrecognizer/FormRecognizerClient.java index 2d0fcb6f8d425..be8c2332fc80e 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/src/main/java/com/azure/ai/formrecognizer/FormRecognizerClient.java +++ b/sdk/formrecognizer/azure-ai-formrecognizer/src/main/java/com/azure/ai/formrecognizer/FormRecognizerClient.java @@ -11,7 +11,6 @@ import com.azure.ai.formrecognizer.models.OperationResult; import com.azure.ai.formrecognizer.models.RecognizeOptions; import com.azure.ai.formrecognizer.models.RecognizedForm; -import com.azure.ai.formrecognizer.models.RecognizedReceipt; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceClient; import com.azure.core.annotation.ServiceMethod; @@ -257,13 +256,13 @@ public SyncPoller> beginRecognizeContent(InputSt * @param receiptUrl The URL of the receipt to analyze. * * @return A {@link SyncPoller} to poll the progress of the recognize receipt operation until it has completed, - * has failed, or has been cancelled. The completed operation returns a List of {@link RecognizedReceipt}. + * has failed, or has been cancelled. The completed operation returns a List of {@link RecognizedForm}. * @throws FormRecognizerException If recognize operation fails and the {@link AnalyzeOperationResult} returned with * an {@link OperationStatus#FAILED}. * @throws NullPointerException If {@code receiptUrl} is {@code null}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public SyncPoller> beginRecognizeReceiptsFromUrl(String receiptUrl) { + public SyncPoller> beginRecognizeReceiptsFromUrl(String receiptUrl) { return beginRecognizeReceiptsFromUrl(receiptUrl, null); } @@ -281,13 +280,13 @@ public SyncPoller> beginRecognizeReceip * analyzing a receipt. Include text lines and element references in the result. * * @return A {@link SyncPoller} to poll the progress of the recognize receipt operation until it has completed, - * has failed, or has been cancelled. The completed operation returns a List of {@link RecognizedReceipt}. + * has failed, or has been cancelled. The completed operation returns a List of {@link RecognizedForm}. * @throws FormRecognizerException If recognize operation fails and the {@link AnalyzeOperationResult} returned with * an {@link OperationStatus#FAILED}. * @throws NullPointerException If {@code receiptUrl} is {@code null}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public SyncPoller> + public SyncPoller> beginRecognizeReceiptsFromUrl(String receiptUrl, RecognizeOptions recognizeOptions) { return client.beginRecognizeReceiptsFromUrl(receiptUrl, recognizeOptions).getSyncPoller(); } @@ -306,13 +305,13 @@ public SyncPoller> beginRecognizeReceip * @param length The exact length of the data. * * @return A {@link SyncPoller} that polls the recognize receipt operation until it has completed, - * has failed, or has been cancelled. The completed operation returns a List of {@link RecognizedReceipt}. + * has failed, or has been cancelled. The completed operation returns a List of {@link RecognizedForm}. * @throws FormRecognizerException If recognize operation fails and the {@link AnalyzeOperationResult} returned with * an {@link OperationStatus#FAILED}. * @throws NullPointerException If {@code receipt} is {@code null}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public SyncPoller> + public SyncPoller> beginRecognizeReceipts(InputStream receipt, long length) { return beginRecognizeReceipts(receipt, length, null); } @@ -333,13 +332,13 @@ public SyncPoller> beginRecognizeReceip * analyzing a receipt. * * @return A {@link SyncPoller} that polls the recognize receipt operation until it has completed, has failed, - * or has been cancelled. The completed operation returns a List of {@link RecognizedReceipt}. + * or has been cancelled. The completed operation returns a List of {@link RecognizedForm}. * @throws FormRecognizerException If recognize operation fails and the {@link AnalyzeOperationResult} returned with * an {@link OperationStatus#FAILED}. * @throws NullPointerException If {@code recognizeOptions} is {@code null}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public SyncPoller> + public SyncPoller> beginRecognizeReceipts(InputStream receipt, long length, RecognizeOptions recognizeOptions) { Flux buffer = Utility.toFluxByteBuffer(receipt); return client.beginRecognizeReceipts(buffer, length, recognizeOptions).getSyncPoller(); diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/src/main/java/com/azure/ai/formrecognizer/Transforms.java b/sdk/formrecognizer/azure-ai-formrecognizer/src/main/java/com/azure/ai/formrecognizer/Transforms.java index 156c0a8f28aba..9ddbefa914a1d 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/src/main/java/com/azure/ai/formrecognizer/Transforms.java +++ b/sdk/formrecognizer/azure-ai-formrecognizer/src/main/java/com/azure/ai/formrecognizer/Transforms.java @@ -25,7 +25,6 @@ import com.azure.ai.formrecognizer.models.LengthUnit; import com.azure.ai.formrecognizer.models.Point; import com.azure.ai.formrecognizer.models.RecognizedForm; -import com.azure.ai.formrecognizer.models.RecognizedReceipt; import com.azure.core.util.CoreUtils; import com.azure.core.util.logging.ClientLogger; @@ -80,7 +79,7 @@ static List toRecognizedForm(AnalyzeResult analyzeResult, boolea formPageRange = new FormPageRange(1, 1); } - Map extractedFieldMap = getUnlabeledFieldMap(documentResultItem, readResults, + Map> extractedFieldMap = getUnlabeledFieldMap(documentResultItem, readResults, includeFieldElements); extractedFormList.add(new RecognizedForm( extractedFieldMap, @@ -97,7 +96,7 @@ static List toRecognizedForm(AnalyzeResult analyzeResult, boolea if (clusterId != null) { formType.append(clusterId); } - Map extractedFieldMap = getLabeledFieldMap(includeFieldElements, readResults, + Map> extractedFieldMap = getLabeledFieldMap(includeFieldElements, readResults, pageResultItem, pageNumber); extractedFormList.add(new RecognizedForm( @@ -110,21 +109,6 @@ static List toRecognizedForm(AnalyzeResult analyzeResult, boolea return extractedFormList; } - /** - * Helper method to transform the service returned {@link AnalyzeResult} to SDK model {@link RecognizedReceipt}. - * - * @param analyzeResult The service returned result for analyze receipts. - * @param includeFieldElements Boolean to indicate if to set reference elements data on fields. - * - * @return The List of {@code RecognizedReceipt}. - */ - static List toReceipt(AnalyzeResult analyzeResult, boolean includeFieldElements) { - return toRecognizedForm(analyzeResult, includeFieldElements) - .stream() - .map(recognizedForm -> new RecognizedReceipt(recognizedForm)) - .collect(Collectors.toList()); - } - /** * Helper method to transform the service returned {@link AnalyzeResult} to SDK model {@link FormPage}. * @@ -213,9 +197,9 @@ static List getReadResultFormLines(ReadResult readResultItem) { * * @return The {@code RecognizedForm#getFields}. */ - private static Map getUnlabeledFieldMap(DocumentResult documentResultItem, + private static Map> getUnlabeledFieldMap(DocumentResult documentResultItem, List readResults, boolean includeFieldElements) { - Map extractedFieldMap = new TreeMap<>(); + Map> extractedFieldMap = new TreeMap<>(); // add receipt fields if (!CoreUtils.isNullOrEmpty(documentResultItem.getFields())) { documentResultItem.getFields().forEach((key, fieldValue) -> { @@ -233,8 +217,8 @@ private static Map getUnlabeledFieldMap(DocumentResult docume readResults)); } else { FieldData labelText = new FieldData(key, null, null, null); - extractedFieldMap.put(key, new FormField(DEFAULT_CONFIDENCE_VALUE, labelText, - key, null, null)); + extractedFieldMap.put(key, new FormField<>(DEFAULT_CONFIDENCE_VALUE, labelText, + key, null, null, null)); } }); } @@ -254,52 +238,44 @@ private static Map getUnlabeledFieldMap(DocumentResult docume * * @return The strongly typed {@link FormField} for the field input. */ - private static FormField setFormField(FieldData labelText, String key, FieldValue fieldValue, + private static FormField setFormField(FieldData labelText, String key, FieldValue fieldValue, FieldData valueText, Integer pageNumber, List readResults) { - FormField value; + FormField value; switch (fieldValue.getType()) { case PHONE_NUMBER: - value = new FormField(setDefaultConfidenceValue(fieldValue.getConfidence()), labelText, - key, new com.azure.ai.formrecognizer.models.FieldValue(FieldValueType.PHONE_NUMBER). - setFormFieldPhoneNumber(fieldValue.getValuePhoneNumber()), valueText); + value = new FormField<>(setDefaultConfidenceValue(fieldValue.getConfidence()), labelText, + key, fieldValue.getValuePhoneNumber(), valueText, FieldValueType.PHONE_NUMBER); break; case STRING: - value = new FormField(setDefaultConfidenceValue(fieldValue.getConfidence()), labelText, - key, new com.azure.ai.formrecognizer.models.FieldValue(FieldValueType.STRING) - .setFormFieldString(fieldValue.getValueString()), valueText); + value = new FormField<>(setDefaultConfidenceValue(fieldValue.getConfidence()), labelText, + key, fieldValue.getValueString(), valueText, FieldValueType.STRING); break; case TIME: LocalTime fieldTime = fieldValue.getValueTime() == null ? null : LocalTime .parse(fieldValue.getValueTime(), DateTimeFormatter.ofPattern("HH:mm:ss")); - value = new FormField(setDefaultConfidenceValue(fieldValue.getConfidence()), labelText, - key, new com.azure.ai.formrecognizer.models.FieldValue(FieldValueType.TIME) - .setFormFieldTime(fieldTime), valueText); + value = new FormField<>(setDefaultConfidenceValue(fieldValue.getConfidence()), labelText, + key, fieldTime, valueText, FieldValueType.TIME); break; case DATE: - value = new FormField(setDefaultConfidenceValue(fieldValue.getConfidence()), labelText, - key, new com.azure.ai.formrecognizer.models.FieldValue(FieldValueType.DATE) - .setFormFieldDate(fieldValue.getValueDate()), valueText); + value = new FormField<>(setDefaultConfidenceValue(fieldValue.getConfidence()), labelText, + key, fieldValue.getValueDate(), valueText, FieldValueType.DATE); break; case INTEGER: - value = new FormField(setDefaultConfidenceValue(fieldValue.getConfidence()), labelText, - key, new com.azure.ai.formrecognizer.models.FieldValue(FieldValueType.INTEGER) - .setFormFieldInteger(fieldValue.getValueInteger()), valueText); + value = new FormField<>(setDefaultConfidenceValue(fieldValue.getConfidence()), labelText, + key, fieldValue.getValueInteger(), valueText, FieldValueType.LONG); break; case NUMBER: - value = new FormField(setDefaultConfidenceValue(fieldValue.getConfidence()), labelText, - key, new com.azure.ai.formrecognizer.models.FieldValue(FieldValueType.FLOAT) - .setFormFieldFloat(fieldValue.getValueNumber()), valueText); + value = new FormField<>(setDefaultConfidenceValue(fieldValue.getConfidence()), labelText, + key, fieldValue.getValueNumber(), valueText, FieldValueType.DOUBLE); break; case ARRAY: - value = new FormField(setDefaultConfidenceValue(fieldValue.getConfidence()), null, key, - new com.azure.ai.formrecognizer.models.FieldValue(FieldValueType.LIST) - .setFormFieldList(toFormFieldArray(fieldValue.getValueArray(), readResults)), null); + value = new FormField<>(setDefaultConfidenceValue(fieldValue.getConfidence()), null, key, + toFormFieldArray(fieldValue.getValueArray(), readResults), null, FieldValueType.LIST); break; case OBJECT: - value = new FormField(setDefaultConfidenceValue(fieldValue.getConfidence()), labelText, - key, new com.azure.ai.formrecognizer.models.FieldValue(FieldValueType.MAP) - .setFormFieldMap(toFormFieldObject(fieldValue.getValueObject(), pageNumber, readResults)), valueText - ); + value = new FormField<>(setDefaultConfidenceValue(fieldValue.getConfidence()), labelText, + key, toFormFieldObject(fieldValue.getValueObject(), pageNumber, readResults), valueText, + FieldValueType.MAP); break; default: throw LOGGER.logExceptionAsError(new RuntimeException("FieldValue Type not supported")); @@ -327,9 +303,9 @@ private static float setDefaultConfidenceValue(Float confidence) { * * @return The Map of {@link FormField}. */ - private static Map toFormFieldObject(Map valueObject, + private static Map> toFormFieldObject(Map valueObject, Integer pageNumber, List readResults) { - Map fieldValueObjectMap = new TreeMap<>(); + Map> fieldValueObjectMap = new TreeMap<>(); valueObject.forEach((key, fieldValue) -> fieldValueObjectMap.put(key, setFormField(null, key, fieldValue, new FieldData(fieldValue.getText(), @@ -350,7 +326,7 @@ private static Map toFormFieldObject(Map * * @return The List of {@link FormField}. */ - private static List toFormFieldArray(List valueArray, List readResults) { + private static List> toFormFieldArray(List valueArray, List readResults) { return valueArray.stream() .map(fieldValue -> setFormField(null, null, fieldValue, null, fieldValue.getPage(), readResults)) .collect(Collectors.toList()); @@ -388,10 +364,10 @@ private static FormPage getFormPage(ReadResult readResultItem, List p * * @return The fields populated on {@link RecognizedForm#getFields() fields}. */ - private static Map getLabeledFieldMap(boolean includeFieldElements, + private static Map> getLabeledFieldMap(boolean includeFieldElements, List readResults, PageResult pageResultItem, Integer pageNumber) { - Map formFieldMap = new TreeMap<>(); + Map> formFieldMap = new TreeMap<>(); List keyValuePairs = pageResultItem.getKeyValuePairs(); forEachWithIndex(keyValuePairs, ((index, keyValuePair) -> { List formKeyContentList = null; @@ -407,10 +383,8 @@ private static Map getLabeledFieldMap(boolean includeFieldEle toBoundingBox(keyValuePair.getValue().getBoundingBox()), pageNumber, formValueContentList); String fieldName = "field-" + index; - FormField formField = new FormField(setDefaultConfidenceValue(keyValuePair.getConfidence()), - labelFieldData, fieldName, - new com.azure.ai.formrecognizer.models.FieldValue(FieldValueType.STRING) - .setFormFieldString(keyValuePair.getValue().getText()), valueText); + FormField formField = new FormField<>(setDefaultConfidenceValue(keyValuePair.getConfidence()), + labelFieldData, fieldName, keyValuePair.getValue().getText(), valueText, FieldValueType.STRING); formFieldMap.put(fieldName, formField); })); return formFieldMap; diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/src/main/java/com/azure/ai/formrecognizer/models/FieldValue.java b/sdk/formrecognizer/azure-ai-formrecognizer/src/main/java/com/azure/ai/formrecognizer/models/FieldValue.java deleted file mode 100644 index 688930ce24399..0000000000000 --- a/sdk/formrecognizer/azure-ai-formrecognizer/src/main/java/com/azure/ai/formrecognizer/models/FieldValue.java +++ /dev/null @@ -1,215 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.ai.formrecognizer.models; - -import com.azure.core.annotation.Fluent; - -import java.time.LocalDate; -import java.time.LocalTime; -import java.util.Collections; -import java.util.List; -import java.util.Map; - -/** - * The FieldValue model. - */ -@Fluent -public final class FieldValue { - private final FieldValueType type; - private Map formFieldMap; - private List formFieldList; - private Float formFieldFloat; - private Integer formFieldInteger; - private LocalDate formFieldDate; - private LocalTime formFieldTime; - private String formFieldString; - private String formFieldPhoneNumber; - - /** - * Constructs a FieldValue object - * - * @param type The type of the field. - */ - public FieldValue(final FieldValueType type) { - this.type = type; - } - - /** - * Set the map value of the field. - * - * @param formFieldMap the map value of the field. - * - * @return the FieldValue object itself. - */ - public FieldValue setFormFieldMap(final Map formFieldMap) { - this.formFieldMap = formFieldMap == null ? null : Collections.unmodifiableMap(formFieldMap); - return this; - } - - /** - * Set the list value of the field. - * - * @param formFieldList the list of the field. - * - * @return the FieldValue object itself. - */ - public FieldValue setFormFieldList(final List formFieldList) { - this.formFieldList = formFieldList == null ? null - : Collections.unmodifiableList(formFieldList); - return this; - } - - /** - * Set the float value of the field. - * - * @param formFieldFloat the float value of the field. - * - * @return the FieldValue object itself. - */ - public FieldValue setFormFieldFloat(final Float formFieldFloat) { - this.formFieldFloat = formFieldFloat; - return this; - } - - /** - * Set the integer value of the field. - * - * @param formFieldInteger the integer value of the field. - * - * @return the FieldValue object itself. - */ - public FieldValue setFormFieldInteger(final Integer formFieldInteger) { - this.formFieldInteger = formFieldInteger; - return this; - } - - /** - * Set the date value of the field. - * - * @param formFieldDate the date value of the field. - * - * @return the FieldValue object itself. - */ - public FieldValue setFormFieldDate(final LocalDate formFieldDate) { - this.formFieldDate = formFieldDate; - return this; - } - - /** - * Set the time value of the field. - * - * @param formFieldTime the time value of the field. - * - * @return the FieldValue object itself. - */ - public FieldValue setFormFieldTime(final LocalTime formFieldTime) { - this.formFieldTime = formFieldTime; - return this; - } - - /** - * Set the string value of the field. - * - * @param formFieldString the string value of the field. - * - * @return the FieldValue object itself. - */ - public FieldValue setFormFieldString(final String formFieldString) { - this.formFieldString = formFieldString; - return this; - } - - /** - * Set the phone number value of the field. - * - * @param formFieldPhoneNumber the phone number value of the field. - * - * @return the FieldValue object itself. - */ - public FieldValue setFormFieldPhoneNumber(final String formFieldPhoneNumber) { - this.formFieldPhoneNumber = formFieldPhoneNumber; - return this; - } - - /** - * Gets the type of the value of the field. - * - * @return the {@link FieldValueType type} of the field. - */ - public FieldValueType getType() { - return type; - } - - /** - * Gets the value of the field as a {@link String}. - * - * @return the value of the field as a {@link String}. - */ - public String asString() { - return this.formFieldString; - } - - /** - * Gets the value of the field as a {@link Integer}. - * - * @return the value of the field as a {@link Integer}. - */ - public Integer asInteger() { - return this.formFieldInteger; - } - - /** - * Gets the value of the field as a {@link Float}. - * - * @return the value of the field as a {@link Float}. - */ - public Float asFloat() { - return this.formFieldFloat; - } - - /** - * Gets the value of the field as a {@link LocalDate}. - * - * @return the value of the field as a {@link LocalDate}. - */ - public LocalDate asDate() { - return this.formFieldDate; - } - - /** - * Gets the value of the field as a {@link LocalTime}. - * - * @return the value of the field as a {@link LocalTime}. - */ - public LocalTime asTime() { - return this.formFieldTime; - } - - /** - * Gets the value of the field as a phone number. - * - * @return the value of the field as a phone number. - */ - public String asPhoneNumber() { - return this.formFieldPhoneNumber; - } - - /** - * Gets the value of the field as a {@link List}. - * - * @return the value of the field as an unmodifiable {@link List}. - */ - public List asList() { - return this.formFieldList; - } - - /** - * Gets the value of the field as a {@link Map}. - * - * @return the value of the field as an unmodifiable {@link Map}. - */ - public Map asMap() { - return this.formFieldMap; - } -} diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/src/main/java/com/azure/ai/formrecognizer/models/FieldValueType.java b/sdk/formrecognizer/azure-ai-formrecognizer/src/main/java/com/azure/ai/formrecognizer/models/FieldValueType.java index 93e5f7dda8b03..975c61ae89c43 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/src/main/java/com/azure/ai/formrecognizer/models/FieldValueType.java +++ b/sdk/formrecognizer/azure-ai-formrecognizer/src/main/java/com/azure/ai/formrecognizer/models/FieldValueType.java @@ -3,62 +3,179 @@ package com.azure.ai.formrecognizer.models; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; +import com.azure.core.util.logging.ClientLogger; -/** Defines values for FieldValueType. */ +import java.time.LocalDate; +import java.time.LocalTime; +import java.time.format.DateTimeFormatter; +import java.util.Objects; + +/** + * Define enum values for FieldValue types. + */ +@SuppressWarnings("unchecked") public enum FieldValueType { - /** Enum value string. */ - STRING("string"), + /** + * Static value string for FieldValueType. + */ + STRING { + @Override + public T cast(FormField formField) { + if (isFieldValueNull(formField)) { + return null; + } + return (T) String.valueOf(formField.getValue()); + } + }, - /** Enum value date. */ - DATE("date"), + /** + * Static value date for FieldValueType. + */ + DATE { + @Override + public T cast(FormField formField) { + if (isFieldValueNull(formField)) { + return null; + } + if (this == formField.getValueType()) { + return (T) formField.getValue(); + } else if (STRING == formField.getValueType()) { + return (T) LocalDate.parse(formField.getValue().toString(), DateTimeFormatter.ofPattern("yyyy/MM/dd")); + } else { + throw LOGGER.logExceptionAsError(new UnsupportedOperationException(String.format("Cannot cast from " + + "field value of type %s to type %s", formField.getValueType(), DATE))); + } + } + }, - /** Enum value time. */ - TIME("time"), + /** + * Static value time for FieldValueType. + */ + TIME { + @Override + public T cast(FormField formField) { + if (isFieldValueNull(formField)) { + return null; + } + if (this == formField.getValueType()) { + return (T) formField.getValue(); + } else if (STRING == formField.getValueType()) { + return (T) LocalTime.parse(formField.getValue().toString(), DateTimeFormatter.ofPattern("HH:mm:ss")); + } else { + throw LOGGER.logExceptionAsError(new UnsupportedOperationException(String.format("Cannot cast from " + + "field value of type %s to type %s", formField.getValueType(), TIME))); + } + } + }, - /** Enum value phoneNumber. */ - PHONE_NUMBER("phoneNumber"), + /** + * Static value phone number for FieldValueType. + */ + PHONE_NUMBER { + @Override + public T cast(FormField formField) { + if (isFieldValueNull(formField)) { + return null; + } + if (this == formField.getValueType()) { + return (T) formField.getValue(); + } else if (STRING == formField.getValueType()) { + return (T) formField.getValue(); + } else { + throw LOGGER.logExceptionAsError(new UnsupportedOperationException(String.format("Cannot cast from " + + "field value of type %s to type %s", formField.getValueType(), PHONE_NUMBER))); + } + } + }, - /** Enum value number. */ - FLOAT("float"), + /** + * Static value double for FieldValueType. + */ + DOUBLE { + @Override + public T cast(FormField formField) { + if (isFieldValueNull(formField)) { + return null; + } + if (this == formField.getValueType()) { + return (T) formField.getValue(); + } else if (STRING == formField.getValueType()) { + return (T) Double.valueOf(formField.getValue().toString()); + } else { + throw LOGGER.logExceptionAsError(new UnsupportedOperationException(String.format("Cannot cast from " + + "field value of type %s to type %s", formField.getValueType(), DOUBLE))); + } + } + }, - /** Enum value integer. */ - INTEGER("integer"), + /** + * Static value long for FieldValueType. + */ + LONG { + @Override + public T cast(FormField formField) { + if (isFieldValueNull(formField)) { + return null; + } + if (this == formField.getValueType()) { + return (T) formField.getValue(); + } else if (STRING == formField.getValueType()) { + return (T) Long.valueOf(formField.getValue().toString()); + } else { + throw LOGGER.logExceptionAsError(new UnsupportedOperationException(String.format("Cannot cast from " + + "field value of type %s to type %s", formField.getValueType(), LONG))); + } + } + }, - /** Enum value array. */ - LIST("list"), + /** + * Static value list for FieldValueType. + */ + LIST { + @Override + public T cast(FormField formField) { + return getCollectionTypeCast(formField); + } + }, - /** Enum value object. */ - MAP("map"); + /** + * Static value map for FieldValueType. + */ + MAP { + @Override + public T cast(FormField formField) { + return getCollectionTypeCast(formField); + } + }; - /** The actual serialized value for a FieldValueType instance. */ - private final String value; + static boolean isFieldValueNull(FormField formField) { + Objects.requireNonNull(formField, "'formField' cannot be null"); + return formField.getValue() == null; + } - FieldValueType(String value) { - this.value = value; + T getCollectionTypeCast(FormField formField) { + if (isFieldValueNull(formField)) { + return null; + } + if (this == formField.getValueType()) { + return (T) formField.getValue(); + } else { + throw LOGGER.logExceptionAsError(new UnsupportedOperationException(String.format("Cannot cast from " + + "field value of type %s to type %s", formField.getValueType(), this))); + } } + private static final ClientLogger LOGGER = new ClientLogger(FieldValueType.class); + /** - * Parses a serialized value to a FieldValueType instance. + * Converts the form field value to a specific enum type. + * + * @param formField The recognized field value that needs to be converted. + * @param the class of the field. * - * @param value the serialized value to parse. - * @return the parsed FieldValueType object, or null if unable to parse. + * @return the converted value of the recognized field. + * @throws UnsupportedOperationException if the {@code formField} type does not match the casting value type. + * @throws NullPointerException if {@code formField} is {@code null} */ - @JsonCreator - public static FieldValueType fromString(String value) { - FieldValueType[] items = FieldValueType.values(); - for (FieldValueType item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; - } - - @JsonValue - @Override - public String toString() { - return this.value; - } + public abstract T cast(FormField formField); } diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/src/main/java/com/azure/ai/formrecognizer/models/FormField.java b/sdk/formrecognizer/azure-ai-formrecognizer/src/main/java/com/azure/ai/formrecognizer/models/FormField.java index 036bfbef2db2e..6eef6b1912568 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/src/main/java/com/azure/ai/formrecognizer/models/FormField.java +++ b/sdk/formrecognizer/azure-ai-formrecognizer/src/main/java/com/azure/ai/formrecognizer/models/FormField.java @@ -9,13 +9,14 @@ * The FormField model. */ @Immutable -public final class FormField { +public final class FormField { private final float confidence; private final FieldData labelData; private final String name; - private final FieldValue fieldValue; private final FieldData valueData; + private final T value; + private final FieldValueType valueType; /** * Constructs a FormField object. @@ -23,16 +24,18 @@ public final class FormField { * @param confidence The confidence of the recognized field. * @param labelData The text, bounding box, and field elements for the field label. * @param name The name the field or label. - * @param fieldValue The value of the recognized field. + * @param value The value of the recognized field. * @param valueData The text, bounding box, and field elements for the field value. + * @param valueType The type of the value of the recognized field. */ - public FormField(final float confidence, final FieldData labelData, final String name, final FieldValue fieldValue, - final FieldData valueData) { + public FormField(final float confidence, final FieldData labelData, final String name, final T value, + final FieldData valueData, FieldValueType valueType) { this.confidence = confidence; this.labelData = labelData; this.name = name; - this.fieldValue = fieldValue; + this.value = value; this.valueData = valueData; + this.valueType = valueType; } /** @@ -65,14 +68,25 @@ public String getName() { /** * Get the value of the recognized field. * - * @return Value of the recognized field. + * @return the value of the recognized field. */ - public FieldValue getFieldValue() { - return this.fieldValue; + public T getValue() { + return this.value; } /** - * Get the text, bounding box, and field elements for the field value. + * The type of the value of the recognized field. + * Possible types include: 'String', + * 'LocalDate', 'LocalTime', 'Long', 'Double', 'Map', or 'List'. + * + * @return the type of the value of the field. + */ + public FieldValueType getValueType() { + return valueType; + } + + /** + * Get the text, bounding box, and text content of the field value. * * @return the text, bounding box, and field elements for the field value. */ diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/src/main/java/com/azure/ai/formrecognizer/models/RecognizedForm.java b/sdk/formrecognizer/azure-ai-formrecognizer/src/main/java/com/azure/ai/formrecognizer/models/RecognizedForm.java index 5a8c11011ca7e..9b775763a9f4b 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/src/main/java/com/azure/ai/formrecognizer/models/RecognizedForm.java +++ b/sdk/formrecognizer/azure-ai-formrecognizer/src/main/java/com/azure/ai/formrecognizer/models/RecognizedForm.java @@ -20,7 +20,7 @@ public final class RecognizedForm { * For models trained with labels, this is the training-time label of the field. For models trained with forms * only, a unique name is generated for each field. */ - private final Map fields; + private final Map> fields; /* * Form type. @@ -45,7 +45,7 @@ public final class RecognizedForm { * @param formPageRange First and last page number where the document is found. * @param pages List of extracted pages from the form. */ - public RecognizedForm(final Map fields, final String formType, + public RecognizedForm(final Map> fields, final String formType, final FormPageRange formPageRange, final List pages) { this.fields = fields == null ? null : Collections.unmodifiableMap(fields); this.formType = formType; @@ -60,7 +60,7 @@ public RecognizedForm(final Map fields, final String formType * * @return the unmodifiable map of recognized fields. */ - public Map getFields() { + public Map> getFields() { return this.fields; } diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/src/main/java/com/azure/ai/formrecognizer/models/RecognizedReceipt.java b/sdk/formrecognizer/azure-ai-formrecognizer/src/main/java/com/azure/ai/formrecognizer/models/RecognizedReceipt.java deleted file mode 100644 index 2f16596dfaca8..0000000000000 --- a/sdk/formrecognizer/azure-ai-formrecognizer/src/main/java/com/azure/ai/formrecognizer/models/RecognizedReceipt.java +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.ai.formrecognizer.models; - -import com.azure.core.annotation.Immutable; - -/** - * The RecognizedReceipt model. - */ -@Immutable -public class RecognizedReceipt { - - /** - * The recognized form. - */ - private final RecognizedForm recognizedForm; - - /** - * Constructs a RecognizedReceipt object. - * - * @param recognizedForm The recognized form. - */ - public RecognizedReceipt(final RecognizedForm recognizedForm) { - this.recognizedForm = recognizedForm; - } - - /** - * Get the extracted field information form for the provided document. - * - * @return The extracted field information form for the provided document. - */ - public RecognizedForm getRecognizedForm() { - return this.recognizedForm; - } -} diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/src/samples/java/com/azure/ai/formrecognizer/AdvancedDiffLabeledUnlabeledData.java b/sdk/formrecognizer/azure-ai-formrecognizer/src/samples/java/com/azure/ai/formrecognizer/AdvancedDiffLabeledUnlabeledData.java index e380fce535a96..b3a96dd6c8955 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/src/samples/java/com/azure/ai/formrecognizer/AdvancedDiffLabeledUnlabeledData.java +++ b/sdk/formrecognizer/azure-ai-formrecognizer/src/samples/java/com/azure/ai/formrecognizer/AdvancedDiffLabeledUnlabeledData.java @@ -78,7 +78,7 @@ public static void main(String[] args) throws IOException { } System.out.printf("Field %s has value %s based on %s within bounding box %s with a confidence score " + "of %.2f.%n", - label, formField.getFieldValue(), formField.getValueData().getText(), boundingBoxStr, + label, formField.getValue(), formField.getValueData().getText(), boundingBoxStr, formField.getConfidence()); // Find the value of a specific labeled field. @@ -120,7 +120,7 @@ public static void main(String[] args) throws IOException { System.out.printf("Field %s has value %s based on %s within bounding box %s with a confidence score " + "of %.2f.%n", - label, formField.getFieldValue(), formField.getValueData().getText(), boundingBoxStr, + label, formField.getValue(), formField.getValueData().getText(), boundingBoxStr, formField.getConfidence()); // Find the value of a specific unlabeled field. The specific key "Vendor Name:" provided in the example diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/src/samples/java/com/azure/ai/formrecognizer/AdvancedDiffLabeledUnlabeledDataAsync.java b/sdk/formrecognizer/azure-ai-formrecognizer/src/samples/java/com/azure/ai/formrecognizer/AdvancedDiffLabeledUnlabeledDataAsync.java index f5e14b6167076..24b783a515d1a 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/src/samples/java/com/azure/ai/formrecognizer/AdvancedDiffLabeledUnlabeledDataAsync.java +++ b/sdk/formrecognizer/azure-ai-formrecognizer/src/samples/java/com/azure/ai/formrecognizer/AdvancedDiffLabeledUnlabeledDataAsync.java @@ -108,7 +108,7 @@ public static void main(String[] args) throws IOException { } System.out.printf("Field %s has value %s based on %s within bounding box %s with a confidence score " + "of %.2f.%n", - label, formField.getFieldValue(), formField.getValueData().getText(), boundingBoxStr, + label, formField.getValue(), formField.getValueData().getText(), boundingBoxStr, formField.getConfidence()); // Find the value of a specific labeled field. @@ -157,7 +157,7 @@ public static void main(String[] args) throws IOException { System.out.printf("Field %s has value %s based on %s within bounding box %s with a confidence " + "score of %.2f.%n", - label, formField.getFieldValue(), formField.getValueData().getText(), boundingBoxStr, + label, formField.getValue(), formField.getValueData().getText(), boundingBoxStr, formField.getConfidence()); // Find the value of a specific unlabeled field. The specific key "Vendor Name:" provided in the diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/src/samples/java/com/azure/ai/formrecognizer/Authentication.java b/sdk/formrecognizer/azure-ai-formrecognizer/src/samples/java/com/azure/ai/formrecognizer/Authentication.java index a8ddc6396270a..121fa1b04037c 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/src/samples/java/com/azure/ai/formrecognizer/Authentication.java +++ b/sdk/formrecognizer/azure-ai-formrecognizer/src/samples/java/com/azure/ai/formrecognizer/Authentication.java @@ -7,21 +7,21 @@ import com.azure.ai.formrecognizer.models.FieldValueType; import com.azure.ai.formrecognizer.models.FormField; import com.azure.ai.formrecognizer.models.OperationResult; -import com.azure.ai.formrecognizer.models.RecognizedReceipt; +import com.azure.ai.formrecognizer.models.RecognizedForm; import com.azure.ai.formrecognizer.training.FormTrainingClient; import com.azure.ai.formrecognizer.training.FormTrainingClientBuilder; import com.azure.core.credential.AzureKeyCredential; import com.azure.core.util.polling.SyncPoller; import com.azure.identity.DefaultAzureCredentialBuilder; -import java.io.IOException; +import java.time.LocalDate; import java.util.List; import java.util.Map; /** * Samples for two supported methods of authentication in Form Recognizer and Form Training clients: - * 1) Use a Form Recognizer API key with AzureKeyCredential from azure.core.credentials - * 2) Use a token credential from azure-identity to authenticate with Azure Active Directory + * 1) Use a Form Recognizer API key with AzureKeyCredential from azure.core.credentials + * 2) Use a token credential from azure-identity to authenticate with Azure Active Directory */ public class Authentication { /** @@ -29,16 +29,15 @@ public class Authentication { * * @param args Unused arguments to the program. * - * @throws IOException Exception thrown when there is an error in reading all the bytes from the File. */ public static void main(String[] args) { - /* - Set the environment variables with your own values before running the sample: + /** + * Set the environment variables with your own values before running the sample: + * AZURE_CLIENT_ID - the client ID of your active directory application. + * AZURE_TENANT_ID - the tenant ID of your active directory application. + * AZURE_CLIENT_SECRET - the secret of your active directory application. + */ - 1) AZURE_CLIENT_ID - the client ID of your active directory application. - 2) AZURE_TENANT_ID - the tenant ID of your active directory application. - 3) AZURE_CLIENT_SECRET - the secret of your active directory application. - */ // Form recognizer client: Key credential authenticationWithKeyCredentialFormRecognizerClient(); // Form recognizer client: Azure Active Directory @@ -82,52 +81,72 @@ private static void authenticationWithAzureActiveDirectoryFormTrainingClient() { } private static void beginRecognizeCustomFormsFromUrl(FormRecognizerClient formRecognizerClient) { - String receiptUrl = "https://raw.githubusercontent.com/Azure/azure-sdk-for-java/master/sdk/formrecognizer/azure-ai-formrecognizer/src/samples/java/sample-forms/receipts/contoso-allinone.jpg"; + String receiptUrl = "https://raw.githubusercontent.com/Azure/azure-sdk-for-java/master/sdk/formrecognizer" + + "/azure-ai-formrecognizer/src/samples/java/sample-forms/receipts/contoso-allinone.jpg"; - SyncPoller> recognizeReceiptPoller = + SyncPoller> recognizeReceiptPoller = formRecognizerClient.beginRecognizeReceiptsFromUrl(receiptUrl); - List receiptPageResults = recognizeReceiptPoller.getFinalResult(); + List receiptPageResults = recognizeReceiptPoller.getFinalResult(); for (int i = 0; i < receiptPageResults.size(); i++) { - RecognizedReceipt recognizedReceipt = receiptPageResults.get(i); - Map recognizedFields = recognizedReceipt.getRecognizedForm().getFields(); + RecognizedForm recognizedForm = receiptPageResults.get(i); + Map> recognizedFields = recognizedForm.getFields(); System.out.printf("----------- Recognized Receipt page %d -----------%n", i); - FormField merchantNameField = recognizedFields.get("MerchantName"); - if (merchantNameField.getFieldValue().getType() == FieldValueType.STRING) { - System.out.printf("Merchant Name: %s, confidence: %.2f%n", - merchantNameField.getFieldValue().asString(), - merchantNameField.getConfidence()); + FormField merchantNameField = recognizedFields.get("MerchantName"); + if (merchantNameField != null) { + if (FieldValueType.STRING.equals(merchantNameField.getValueType())) { + String merchantName = FieldValueType.STRING.cast(merchantNameField); + System.out.printf("Merchant Name: %s, confidence: %.2f%n", + merchantName, merchantNameField.getConfidence()); + } } - FormField transactionDateField = recognizedFields.get("TransactionDate"); - if (transactionDateField.getFieldValue().getType() == FieldValueType.DATE) { - System.out.printf("Transaction Date: %s, confidence: %.2f%n", - transactionDateField.getFieldValue().asDate(), - transactionDateField.getConfidence()); + + FormField merchantPhoneNumberField = recognizedFields.get("MerchantPhoneNumber"); + if (merchantPhoneNumberField != null) { + if (FieldValueType.PHONE_NUMBER.equals(merchantNameField.getValueType())) { + String merchantAddress = FieldValueType.PHONE_NUMBER.cast(merchantPhoneNumberField); + System.out.printf("Merchant Phone number: %s, confidence: %.2f%n", + merchantAddress, merchantPhoneNumberField.getConfidence()); + } + } + + FormField transactionDateField = recognizedFields.get("TransactionDate"); + if (transactionDateField != null) { + if (FieldValueType.DATE.equals(transactionDateField.getValueType())) { + LocalDate transactionDate = FieldValueType.DATE.cast(transactionDateField); + System.out.printf("Transaction Date: %s, confidence: %.2f%n", + transactionDate, transactionDateField.getConfidence()); + } } - FormField receiptItemsField = recognizedFields.get("Items"); - System.out.printf("Receipt Items: %n"); - if (receiptItemsField.getFieldValue().getType() == FieldValueType.LIST) { - List receiptItems = receiptItemsField.getFieldValue().asList(); - receiptItems.forEach(receiptItem -> { - if (receiptItem.getFieldValue().getType() == FieldValueType.MAP) { - receiptItem.getFieldValue().asMap().forEach((key, formField) -> { - if (key.equals("Name")) { - if (formField.getFieldValue().getType() == FieldValueType.STRING) { - System.out.printf("Name: %s, confidence: %.2fs%n", - formField.getFieldValue().asString(), - formField.getConfidence()); + + FormField receiptItemsField = recognizedFields.get("Items"); + if (receiptItemsField != null) { + System.out.printf("Receipt Items: %n"); + if (FieldValueType.LIST.equals(receiptItemsField.getValueType())) { + List> receiptItems = FieldValueType.LIST.cast(receiptItemsField); + receiptItems.forEach(receiptItem -> { + if (FieldValueType.MAP.equals(receiptItem.getValueType())) { + Map> formFieldMap = FieldValueType.MAP.cast(receiptItem); + formFieldMap.forEach((key, formField) -> { + if ("Name".equals(key)) { + if (FieldValueType.STRING.equals(formField.getValueType())) { + String name = FieldValueType.STRING.cast(formField); + System.out.printf("Name: %s, confidence: %.2fs%n", + name, formField.getConfidence()); + } } - } - if (key.equals("Quantity")) { - if (formField.getFieldValue().getType() == FieldValueType.INTEGER) { - System.out.printf("Quantity: %s, confidence: %.2f%n", - formField.getFieldValue().asInteger(), formField.getConfidence()); + if ("Quantity".equals(key)) { + if (FieldValueType.DOUBLE.equals(formField.getValueType())) { + Float quantity = FieldValueType.DOUBLE.cast(formField); + System.out.printf("Quantity: %f, confidence: %.2f%n", + quantity, formField.getConfidence()); + } } - } - }); - } - }); + }); + } + }); + } } System.out.print("-----------------------------------"); } diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/src/samples/java/com/azure/ai/formrecognizer/FormRecognizerAsyncClientJavaDocCodeSnippets.java b/sdk/formrecognizer/azure-ai-formrecognizer/src/samples/java/com/azure/ai/formrecognizer/FormRecognizerAsyncClientJavaDocCodeSnippets.java index ab23ef74d3c29..3ac36fa322436 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/src/samples/java/com/azure/ai/formrecognizer/FormRecognizerAsyncClientJavaDocCodeSnippets.java +++ b/sdk/formrecognizer/azure-ai-formrecognizer/src/samples/java/com/azure/ai/formrecognizer/FormRecognizerAsyncClientJavaDocCodeSnippets.java @@ -7,7 +7,7 @@ import com.azure.ai.formrecognizer.models.FormContentType; import com.azure.ai.formrecognizer.models.FormField; import com.azure.ai.formrecognizer.models.RecognizeOptions; -import com.azure.ai.formrecognizer.models.RecognizedReceipt; +import com.azure.ai.formrecognizer.models.RecognizedForm; import com.azure.core.credential.AzureKeyCredential; import com.azure.core.http.HttpPipeline; import com.azure.core.http.HttpPipelineBuilder; @@ -19,6 +19,7 @@ import java.nio.ByteBuffer; import java.nio.file.Files; import java.time.Duration; +import java.time.LocalDate; import java.util.List; import java.util.Map; @@ -76,7 +77,7 @@ public void beginRecognizeCustomFormsFromUrl() { recognizedForms.forEach(recognizedForm -> { recognizedForm.getFields().forEach((fieldText, fieldValue) -> { System.out.printf("Field text: %s%n", fieldText); - System.out.printf("Field value: %s%n", fieldValue.getFieldValue()); + System.out.printf("Field value: %s%n", fieldValue.getValue()); System.out.printf("Confidence score: %.2f%n", fieldValue.getConfidence()); }); })); @@ -103,7 +104,7 @@ public void beginRecognizeCustomFormsFromUrlWithOptions() { recognizedForms.forEach(recognizedForm -> { recognizedForm.getFields().forEach((fieldText, fieldValue) -> { System.out.printf("Field text: %s%n", fieldText); - System.out.printf("Field value: %s%n", fieldValue.getFieldValue()); + System.out.printf("Field value: %s%n", fieldValue.getValue()); System.out.printf("Confidence score: %.2f%n", fieldValue.getConfidence()); }); })); @@ -129,7 +130,7 @@ public void beginRecognizeCustomForms() throws IOException { recognizedForms.forEach(recognizedForm -> { recognizedForm.getFields().forEach((fieldText, fieldValue) -> { System.out.printf("Field text: %s%n", fieldText); - System.out.printf("Field value: %s%n", fieldValue.getFieldValue()); + System.out.printf("Field value: %s%n", fieldValue.getValue()); System.out.printf("Confidence score: %.2f%n", fieldValue.getConfidence()); }); })); @@ -162,7 +163,7 @@ public void beginRecognizeCustomFormsWithOptions() throws IOException { recognizedForms.forEach(recognizedForm -> { recognizedForm.getFields().forEach((fieldText, fieldValue) -> { System.out.printf("Field text: %s%n", fieldText); - System.out.printf("Field value: %s%n", fieldValue.getFieldValue()); + System.out.printf("Field value: %s%n", fieldValue.getValue()); System.out.printf("Confidence score: %.2f%n", fieldValue.getConfidence()); }); })); @@ -289,37 +290,57 @@ public void beginRecognizeReceiptsFromUrl() { recognizePollingOperation.getFinalResult()) .subscribe(recognizedReceipts -> { for (int i = 0; i < recognizedReceipts.size(); i++) { - RecognizedReceipt recognizedReceipt = recognizedReceipts.get(i); - Map recognizedFields = recognizedReceipt.getRecognizedForm().getFields(); + RecognizedForm recognizedForm = recognizedReceipts.get(i); + Map> recognizedFields = recognizedForm.getFields(); System.out.printf("----------- Recognized Receipt page %d -----------%n", i); - FormField merchantNameField = recognizedFields.get("MerchantName"); - if (merchantNameField.getFieldValue().getType() == FieldValueType.STRING) { - System.out.printf("Merchant Name: %s, confidence: %.2f%n", - merchantNameField.getFieldValue().asString(), - merchantNameField.getConfidence()); + FormField merchantNameField = recognizedFields.get("MerchantName"); + if (merchantNameField != null) { + if (FieldValueType.STRING.equals(merchantNameField.getValueType())) { + String merchantName = FieldValueType.STRING.cast(merchantNameField); + System.out.printf("Merchant Name: %s, confidence: %.2f%n", + merchantName, merchantNameField.getConfidence()); + } } - FormField transactionDateField = recognizedFields.get("TransactionDate"); - if (transactionDateField.getFieldValue().getType() == FieldValueType.DATE) { - System.out.printf("Transaction Date: %s, confidence: %.2f%n", - transactionDateField.getFieldValue().asDate(), - transactionDateField.getConfidence()); + + FormField merchantPhoneNumberField = recognizedFields.get("MerchantPhoneNumber"); + if (merchantPhoneNumberField != null) { + if (FieldValueType.PHONE_NUMBER.equals(merchantNameField.getValueType())) { + String merchantAddress = FieldValueType.PHONE_NUMBER.cast(merchantPhoneNumberField); + System.out.printf("Merchant Phone number: %s, confidence: %.2f%n", + merchantAddress, merchantPhoneNumberField.getConfidence()); + } + } + + FormField transactionDateField = recognizedFields.get("TransactionDate"); + if (transactionDateField != null) { + if (FieldValueType.DATE.equals(transactionDateField.getValueType())) { + LocalDate transactionDate = FieldValueType.DATE.cast(transactionDateField); + System.out.printf("Transaction Date: %s, confidence: %.2f%n", + transactionDate, transactionDateField.getConfidence()); + } } - FormField receiptItemsField = recognizedFields.get("Items"); - System.out.printf("Receipt Items: %n"); - if (receiptItemsField.getFieldValue().getType() == FieldValueType.LIST) { - List receiptItems = receiptItemsField.getFieldValue().asList(); - receiptItems.forEach(receiptItem -> { - if (receiptItem.getFieldValue().getType() == FieldValueType.MAP) { - receiptItem.getFieldValue().asMap().forEach((key, formField) -> { - if (key.equals("Quantity")) { - if (formField.getFieldValue().getType() == FieldValueType.INTEGER) { - System.out.printf("Quantity: %s, confidence: %.2f%n", - formField.getFieldValue().asInteger(), formField.getConfidence()); + + FormField receiptItemsField = recognizedFields.get("Items"); + if (receiptItemsField != null) { + System.out.printf("Receipt Items: %n"); + if (FieldValueType.LIST.equals(receiptItemsField.getValueType())) { + List> receiptItems = FieldValueType.LIST.cast(receiptItemsField); + receiptItems.forEach(receiptItem -> { + if (FieldValueType.MAP.equals(receiptItem.getValueType())) { + + Map> formFieldMap = FieldValueType.MAP.cast(receiptItem); + formFieldMap.forEach((key, formField) -> { + if ("Quantity".equals(key)) { + if (FieldValueType.DOUBLE.equals(formField.getValueType())) { + Float quantity = FieldValueType.DOUBLE.cast(formField); + System.out.printf("Quantity: %f, confidence: %.2f%n", + quantity, formField.getConfidence()); + } } - } - }); - } - }); + }); + } + }); + } } } }); @@ -342,37 +363,57 @@ public void beginRecognizeReceiptsFromUrlWithOptions() { recognizePollingOperation.getFinalResult()) .subscribe(recognizedReceipts -> { for (int i = 0; i < recognizedReceipts.size(); i++) { - RecognizedReceipt recognizedReceipt = recognizedReceipts.get(i); - Map recognizedFields = recognizedReceipt.getRecognizedForm().getFields(); - System.out.printf("----------- Recognized Receipt page %s -----------%n", i); - FormField merchantNameField = recognizedFields.get("MerchantName"); - if (merchantNameField.getFieldValue().getType() == FieldValueType.STRING) { - System.out.printf("Merchant Name: %s, confidence: %.2f%n", - merchantNameField.getFieldValue().asString(), - merchantNameField.getConfidence()); + RecognizedForm recognizedReceipt = recognizedReceipts.get(i); + Map> recognizedFields = recognizedReceipt.getFields(); + System.out.printf("----------- Recognized Receipt page %d -----------%n", i); + FormField merchantNameField = recognizedFields.get("MerchantName"); + if (merchantNameField != null) { + if (FieldValueType.STRING.equals(merchantNameField.getValueType())) { + String merchantName = FieldValueType.STRING.cast(merchantNameField); + System.out.printf("Merchant Name: %s, confidence: %.2f%n", + merchantName, merchantNameField.getConfidence()); + } } - FormField transactionDateField = recognizedFields.get("TransactionDate"); - if (transactionDateField.getFieldValue().getType() == FieldValueType.DATE) { - System.out.printf("Transaction Date: %s, confidence: %.2f%n", - transactionDateField.getFieldValue().asDate(), - transactionDateField.getConfidence()); + + FormField merchantPhoneNumberField = recognizedFields.get("MerchantPhoneNumber"); + if (merchantPhoneNumberField != null) { + if (FieldValueType.PHONE_NUMBER.equals(merchantNameField.getValueType())) { + String merchantAddress = FieldValueType.PHONE_NUMBER.cast(merchantPhoneNumberField); + System.out.printf("Merchant Phone number: %s, confidence: %.2f%n", + merchantAddress, merchantPhoneNumberField.getConfidence()); + } } - FormField receiptItemsField = recognizedFields.get("Items"); - System.out.printf("Receipt Items: %n"); - if (receiptItemsField.getFieldValue().getType() == FieldValueType.LIST) { - List receiptItems = receiptItemsField.getFieldValue().asList(); - receiptItems.forEach(receiptItem -> { - if (receiptItem.getFieldValue().getType() == FieldValueType.MAP) { - receiptItem.getFieldValue().asMap().forEach((key, formField) -> { - if (key.equals("Quantity")) { - if (formField.getFieldValue().getType() == FieldValueType.INTEGER) { - System.out.printf("Quantity: %s, confidence: %.2f%n", - formField.getFieldValue().asInteger(), formField.getConfidence()); + + FormField transactionDateField = recognizedFields.get("TransactionDate"); + if (transactionDateField != null) { + if (FieldValueType.DATE.equals(transactionDateField.getValueType())) { + LocalDate transactionDate = FieldValueType.DATE.cast(transactionDateField); + System.out.printf("Transaction Date: %s, confidence: %.2f%n", + transactionDate, transactionDateField.getConfidence()); + } + } + + FormField receiptItemsField = recognizedFields.get("Items"); + if (receiptItemsField != null) { + System.out.printf("Receipt Items: %n"); + if (FieldValueType.LIST.equals(receiptItemsField.getValueType())) { + List> receiptItems = FieldValueType.LIST.cast(receiptItemsField); + receiptItems.forEach(receiptItem -> { + if (FieldValueType.MAP.equals(receiptItem.getValueType())) { + + Map> formFieldMap = FieldValueType.MAP.cast(receiptItem); + formFieldMap.forEach((key, formField) -> { + if ("Quantity".equals(key)) { + if (FieldValueType.DOUBLE.equals(formField.getValueType())) { + Float quantity = FieldValueType.DOUBLE.cast(formField); + System.out.printf("Quantity: %f, confidence: %.2f%n", + quantity, formField.getConfidence()); + } } - } - }); - } - }); + }); + } + }); + } } } }); @@ -389,45 +430,64 @@ public void beginRecognizeReceipts() throws IOException { File receipt = new File("{file_source_url}"); Flux buffer = toFluxByteBuffer(new ByteArrayInputStream(Files.readAllBytes(receipt.toPath()))); formRecognizerAsyncClient.beginRecognizeReceipts(buffer, receipt.length()) - .flatMap(recognizePollingOperation -> + .subscribe(recognizePollingOperation -> // if training polling operation completed, retrieve the final result. - recognizePollingOperation.getFinalResult()) - .subscribe(recognizedReceipts -> { - for (int i = 0; i < recognizedReceipts.size(); i++) { - RecognizedReceipt recognizedReceipt = recognizedReceipts.get(i); - Map recognizedFields = recognizedReceipt.getRecognizedForm().getFields(); - System.out.printf("----------- Recognized Receipt page %s -----------%n", i); - FormField merchantNameField = recognizedFields.get("MerchantName"); - if (merchantNameField.getFieldValue().getType() == FieldValueType.STRING) { - System.out.printf("Merchant Name: %s, confidence: %.2f%n", - merchantNameField.getFieldValue().asString(), - merchantNameField.getConfidence()); - } - FormField transactionDateField = recognizedFields.get("TransactionDate"); - if (transactionDateField.getFieldValue().getType() == FieldValueType.DATE) { - System.out.printf("Transaction Date: %s, confidence: %.2f%n", - transactionDateField.getFieldValue().asDate(), - transactionDateField.getConfidence()); - } - FormField receiptItemsField = recognizedFields.get("Items"); - System.out.printf("Receipt Items: %n"); - if (receiptItemsField.getFieldValue().getType() == FieldValueType.LIST) { - List receiptItems = receiptItemsField.getFieldValue().asList(); - receiptItems.forEach(receiptItem -> { - if (receiptItem.getFieldValue().getType() == FieldValueType.MAP) { - receiptItem.getFieldValue().asMap().forEach((key, formField) -> { - if (key.equals("Quantity")) { - if (formField.getFieldValue().getType() == FieldValueType.INTEGER) { - System.out.printf("Quantity: %s, confidence: %.2f%n", - formField.getFieldValue().asInteger(), formField.getConfidence()); - } + recognizePollingOperation.getFinalResult().subscribe(recognizedReceipts -> { + for (int i = 0; i < recognizedReceipts.size(); i++) { + RecognizedForm recognizedForm = recognizedReceipts.get(i); + Map> recognizedFields = recognizedForm.getFields(); + System.out.printf("----------- Recognized Receipt page %d -----------%n", i); + FormField merchantNameField = recognizedFields.get("MerchantName"); + if (merchantNameField != null) { + if (FieldValueType.STRING.equals(merchantNameField.getValueType())) { + String merchantName = FieldValueType.STRING.cast(merchantNameField); + System.out.printf("Merchant Name: %s, confidence: %.2f%n", + merchantName, merchantNameField.getConfidence()); + } + } + + FormField merchantPhoneNumberField = recognizedFields.get("MerchantPhoneNumber"); + if (merchantPhoneNumberField != null) { + if (FieldValueType.PHONE_NUMBER.equals(merchantNameField.getValueType())) { + String merchantAddress = FieldValueType.PHONE_NUMBER.cast(merchantPhoneNumberField); + System.out.printf("Merchant Phone number: %s, confidence: %.2f%n", + merchantAddress, merchantPhoneNumberField.getConfidence()); + } + } + + FormField transactionDateField = recognizedFields.get("TransactionDate"); + if (transactionDateField != null) { + if (FieldValueType.DATE.equals(transactionDateField.getValueType())) { + LocalDate transactionDate = FieldValueType.DATE.cast(transactionDateField); + System.out.printf("Transaction Date: %s, confidence: %.2f%n", + transactionDate, transactionDateField.getConfidence()); + } + } + + FormField receiptItemsField = recognizedFields.get("Items"); + if (receiptItemsField != null) { + System.out.printf("Receipt Items: %n"); + if (FieldValueType.LIST.equals(receiptItemsField.getValueType())) { + List> receiptItems = FieldValueType.LIST.cast(receiptItemsField); + receiptItems.forEach(receiptItem -> { + if (FieldValueType.MAP.equals(receiptItem.getValueType())) { + + Map> formFieldMap = FieldValueType.MAP.cast(receiptItem); + formFieldMap.forEach((key, formField) -> { + if ("Quantity".equals(key)) { + if (FieldValueType.DOUBLE.equals(formField.getValueType())) { + Float quantity = FieldValueType.DOUBLE.cast(formField); + System.out.printf("Quantity: %f, confidence: %.2f%n", + quantity, formField.getConfidence()); + } + } + }); } }); } - }); + } } - } - }); + })); // END: com.azure.ai.formrecognizer.FormRecognizerAsyncClient.beginRecognizeReceipts#Flux-long } @@ -448,45 +508,65 @@ public void beginRecognizeReceiptsWithOptions() throws IOException { .setContentType(FormContentType.IMAGE_JPEG) .setIncludeFieldElements(includeFieldElements) .setPollInterval(Duration.ofSeconds(5))) - .flatMap(recognizePollingOperation -> + .subscribe(recognizePollingOperation -> // if training polling operation completed, retrieve the final result. - recognizePollingOperation.getFinalResult()) - .subscribe(recognizedReceipts -> { - for (int i = 0; i < recognizedReceipts.size(); i++) { - RecognizedReceipt recognizedReceipt = recognizedReceipts.get(i); - Map recognizedFields = recognizedReceipt.getRecognizedForm().getFields(); - System.out.printf("----------- Recognized Receipt page %s -----------%n", i); - FormField merchantNameField = recognizedFields.get("MerchantName"); - if (merchantNameField.getFieldValue().getType() == FieldValueType.STRING) { - System.out.printf("Merchant Name: %s, confidence: %.2f%n", - merchantNameField.getFieldValue().asString(), - merchantNameField.getConfidence()); - } - FormField transactionDateField = recognizedFields.get("TransactionDate"); - if (transactionDateField.getFieldValue().getType() == FieldValueType.DATE) { - System.out.printf("Transaction Date: %s, confidence: %.2f%n", - transactionDateField.getFieldValue().asDate(), - transactionDateField.getConfidence()); - } - FormField receiptItemsField = recognizedFields.get("Items"); - System.out.printf("Receipt Items: %n"); - if (receiptItemsField.getFieldValue().getType() == FieldValueType.LIST) { - List receiptItems = receiptItemsField.getFieldValue().asList(); - receiptItems.forEach(receiptItem -> { - if (receiptItem.getFieldValue().getType() == FieldValueType.MAP) { - receiptItem.getFieldValue().asMap().forEach((key, formField) -> { - if (key.equals("Quantity")) { - if (formField.getFieldValue().getType() == FieldValueType.INTEGER) { - System.out.printf("Quantity: %s, confidence: %.2f%n", - formField.getFieldValue().asInteger(), formField.getConfidence()); - } + recognizePollingOperation.getFinalResult().subscribe(recognizedReceipts -> { + for (int i = 0; i < recognizedReceipts.size(); i++) { + RecognizedForm recognizedForm = recognizedReceipts.get(i); + Map> recognizedFields = recognizedForm.getFields(); + System.out.printf("----------- Recognized Receipt page %d -----------%n", i); + FormField merchantNameField = recognizedFields.get("MerchantName"); + if (merchantNameField != null) { + if (FieldValueType.STRING.equals(merchantNameField.getValueType())) { + String merchantName = FieldValueType.STRING.cast(merchantNameField); + System.out.printf("Merchant Name: %s, confidence: %.2f%n", + merchantName, merchantNameField.getConfidence()); + } + } + + FormField merchantPhoneNumberField = recognizedFields.get("MerchantPhoneNumber"); + if (merchantPhoneNumberField != null) { + if (FieldValueType.PHONE_NUMBER.equals(merchantNameField.getValueType())) { + String merchantAddress = FieldValueType.PHONE_NUMBER.cast(merchantPhoneNumberField); + System.out.printf("Merchant Phone number: %s, confidence: %.2f%n", + merchantAddress, merchantPhoneNumberField.getConfidence()); + } + } + + FormField transactionDateField = recognizedFields.get("TransactionDate"); + if (transactionDateField != null) { + if (FieldValueType.DATE.equals(transactionDateField.getValueType())) { + LocalDate transactionDate = FieldValueType.DATE.cast(transactionDateField); + System.out.printf("Transaction Date: %s, confidence: %.2f%n", + transactionDate, transactionDateField.getConfidence()); + } + } + + FormField receiptItemsField = recognizedFields.get("Items"); + if (receiptItemsField != null) { + System.out.printf("Receipt Items: %n"); + if (FieldValueType.LIST.equals(receiptItemsField.getValueType())) { + List> receiptItems = FieldValueType.LIST.cast(receiptItemsField); + receiptItems.forEach(receiptItem -> { + if (FieldValueType.MAP.equals(receiptItem.getValueType())) { + + Map> formFieldMap = FieldValueType.MAP.cast(receiptItem); + formFieldMap.forEach((key, formField) -> { + if ("Quantity".equals(key)) { + if (FieldValueType.DOUBLE.equals(formField.getValueType())) { + Float quantity = FieldValueType.DOUBLE.cast(formField); + System.out.printf("Quantity: %f, confidence: %.2f%n", + quantity, formField.getConfidence()); + } + } + }); } }); } - }); + } } - } - }); + })); + // END: com.azure.ai.formrecognizer.FormRecognizerAsyncClient.beginRecognizeReceipts#Flux-long-recognizeOptions } } diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/src/samples/java/com/azure/ai/formrecognizer/FormRecognizerClientJavaDocCodeSnippets.java b/sdk/formrecognizer/azure-ai-formrecognizer/src/samples/java/com/azure/ai/formrecognizer/FormRecognizerClientJavaDocCodeSnippets.java index f1aa02207094a..3e88ff23d154f 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/src/samples/java/com/azure/ai/formrecognizer/FormRecognizerClientJavaDocCodeSnippets.java +++ b/sdk/formrecognizer/azure-ai-formrecognizer/src/samples/java/com/azure/ai/formrecognizer/FormRecognizerClientJavaDocCodeSnippets.java @@ -17,6 +17,7 @@ import java.io.InputStream; import java.nio.file.Files; import java.time.Duration; +import java.time.LocalDate; import java.util.List; import java.util.Map; @@ -67,13 +68,12 @@ public void beginRecognizeCustomFormsFromUrl() { String modelId = "{custom_trained_model_id}"; formRecognizerClient.beginRecognizeCustomFormsFromUrl(formUrl, modelId).getFinalResult() - .forEach(recognizedForm -> { + .forEach(recognizedForm -> recognizedForm.getFields().forEach((fieldText, fieldValue) -> { System.out.printf("Field text: %s%n", fieldText); - System.out.printf("Field value: %s%n", fieldValue.getFieldValue()); + System.out.printf("Field value: %s%n", fieldValue.getValue()); System.out.printf("Confidence score: %.2f%n", fieldValue.getConfidence()); - }); - }); + })); // END: com.azure.ai.formrecognizer.FormRecognizerClient.beginRecognizeCustomFormsFromUrl#string-string } @@ -94,7 +94,7 @@ public void beginRecognizeCustomFormsFromUrlWithOptions() { .getFinalResult() .forEach(recognizedForm -> recognizedForm.getFields().forEach((fieldText, fieldValue) -> { System.out.printf("Field text: %s%n", fieldText); - System.out.printf("Field value: %s%n", fieldValue.getFieldValue()); + System.out.printf("Field value: %s%n", fieldValue.getValue()); System.out.printf("Confidence score: %.2f%n", fieldValue.getConfidence()); })); // END: com.azure.ai.formrecognizer.FormRecognizerClient.beginRecognizeCustomFormsFromUrl#string-string-recognizeOptions @@ -116,7 +116,7 @@ public void beginRecognizeCustomForms() throws IOException { formRecognizerClient.beginRecognizeCustomForms(targetStream, form.length(), modelId).getFinalResult() .forEach(recognizedForm -> recognizedForm.getFields().forEach((fieldText, fieldValue) -> { System.out.printf("Field text: %s%n", fieldText); - System.out.printf("Field value: %s%n", fieldValue.getFieldValue()); + System.out.printf("Field value: %s%n", fieldValue.getValue()); System.out.printf("Confidence score: %.2f%n", fieldValue.getConfidence()); })); // END: com.azure.ai.formrecognizer.FormRecognizerClient.beginRecognizeCustomForms#InputStream-long-string @@ -145,7 +145,7 @@ public void beginRecognizeCustomFormsWithOptions() throws IOException { .getFinalResult() .forEach(recognizedForm -> recognizedForm.getFields().forEach((fieldText, fieldValue) -> { System.out.printf("Field text: %s%n", fieldText); - System.out.printf("Field value: %s%n", fieldValue.getFieldValue()); + System.out.printf("Field value: %s%n", fieldValue.getValue()); System.out.printf("Confidence score: %.2f%n", fieldValue.getConfidence()); })); // END: com.azure.ai.formrecognizer.FormRecognizerClient.beginRecognizeCustomForms#InputStream-long-string-recognizeOptions @@ -250,35 +250,54 @@ public void beginRecognizeReceiptsFromUrl() { String receiptUrl = "{file_source_url}"; formRecognizerClient.beginRecognizeReceiptsFromUrl(receiptUrl).getFinalResult() .forEach(recognizedReceipt -> { - Map recognizedFields = recognizedReceipt.getRecognizedForm().getFields(); - FormField merchantNameField = recognizedFields.get("MerchantName"); - if (merchantNameField.getFieldValue().getType() == FieldValueType.STRING) { - System.out.printf("Merchant Name: %s, confidence: %.2f%n", - merchantNameField.getFieldValue().asString(), - merchantNameField.getConfidence()); + Map> recognizedFields = recognizedReceipt.getFields(); + FormField merchantNameField = recognizedFields.get("MerchantName"); + if (merchantNameField != null) { + if (FieldValueType.STRING.equals(merchantNameField.getValueType())) { + String merchantName = FieldValueType.STRING.cast(merchantNameField); + System.out.printf("Merchant Name: %s, confidence: %.2f%n", + merchantName, merchantNameField.getConfidence()); + } } - FormField transactionDateField = recognizedFields.get("TransactionDate"); - if (transactionDateField.getFieldValue().getType() == FieldValueType.DATE) { - System.out.printf("Transaction Date: %s, confidence: %.2f%n", - transactionDateField.getFieldValue().asDate(), - transactionDateField.getConfidence()); + + FormField merchantPhoneNumberField = recognizedFields.get("MerchantPhoneNumber"); + if (merchantPhoneNumberField != null) { + if (FieldValueType.PHONE_NUMBER.equals(merchantNameField.getValueType())) { + String merchantAddress = FieldValueType.PHONE_NUMBER.cast(merchantPhoneNumberField); + System.out.printf("Merchant Phone number: %s, confidence: %.2f%n", + merchantAddress, merchantPhoneNumberField.getConfidence()); + } + } + + FormField transactionDateField = recognizedFields.get("TransactionDate"); + if (transactionDateField != null) { + if (FieldValueType.DATE.equals(transactionDateField.getValueType())) { + LocalDate transactionDate = FieldValueType.DATE.cast(transactionDateField); + System.out.printf("Transaction Date: %s, confidence: %.2f%n", + transactionDate, transactionDateField.getConfidence()); + } } - FormField receiptItemsField = recognizedFields.get("Items"); - System.out.printf("Receipt Items: %n"); - if (receiptItemsField.getFieldValue().getType() == FieldValueType.LIST) { - List receiptItems = receiptItemsField.getFieldValue().asList(); - receiptItems.forEach(receiptItem -> { - if (receiptItem.getFieldValue().getType() == FieldValueType.MAP) { - receiptItem.getFieldValue().asMap().forEach((key, formField) -> { - if (key.equals("Quantity")) { - if (formField.getFieldValue().getType() == FieldValueType.INTEGER) { - System.out.printf("Quantity: %s, confidence: %.2f%n", - formField.getFieldValue().asInteger(), formField.getConfidence()); + + FormField receiptItemsField = recognizedFields.get("Items"); + if (receiptItemsField != null) { + System.out.printf("Receipt Items: %n"); + if (FieldValueType.LIST.equals(receiptItemsField.getValueType())) { + List> receiptItems = FieldValueType.LIST.cast(receiptItemsField); + receiptItems.forEach(receiptItem -> { + if (FieldValueType.MAP.equals(receiptItem.getValueType())) { + Map> formFieldMap = FieldValueType.MAP.cast(receiptItem); + formFieldMap.forEach((key, formField) -> { + if ("Quantity".equals(key)) { + if (FieldValueType.DOUBLE.equals(formField.getValueType())) { + Float quantity = FieldValueType.DOUBLE.cast(formField); + System.out.printf("Quantity: %d, confidence: %.2f%n", + quantity, formField.getConfidence()); + } } - } - }); - } - }); + }); + } + }); + } } }); // END: com.azure.ai.formrecognizer.FormRecognizerClient.beginRecognizeReceiptsFromUrl#string @@ -289,38 +308,57 @@ public void beginRecognizeReceiptsFromUrl() { */ public void beginRecognizeReceiptsFromUrlWithOptions() { // BEGIN: com.azure.ai.formrecognizer.FormRecognizerClient.beginRecognizeReceiptsFromUrl#string-recognizeOptions - String receiptUrl = "{file_source_url}"; + String receiptUrl = "{receipt_url}"; formRecognizerClient.beginRecognizeReceiptsFromUrl(receiptUrl).getFinalResult() .forEach(recognizedReceipt -> { - Map recognizedFields = recognizedReceipt.getRecognizedForm().getFields(); - FormField merchantNameField = recognizedFields.get("MerchantName"); - if (merchantNameField.getFieldValue().getType() == FieldValueType.STRING) { - System.out.printf("Merchant Name: %s, confidence: %.2f%n", - merchantNameField.getFieldValue().asString(), - merchantNameField.getConfidence()); + Map> recognizedFields = recognizedReceipt.getFields(); + FormField merchantNameField = recognizedFields.get("MerchantName"); + if (merchantNameField != null) { + if (FieldValueType.STRING.equals(merchantNameField.getValueType())) { + String merchantName = FieldValueType.STRING.cast(merchantNameField); + System.out.printf("Merchant Name: %s, confidence: %.2f%n", + merchantName, merchantNameField.getConfidence()); + } } - FormField transactionDateField = recognizedFields.get("TransactionDate"); - if (transactionDateField.getFieldValue().getType() == FieldValueType.DATE) { - System.out.printf("Transaction Date: %s, confidence: %.2f%n", - transactionDateField.getFieldValue().asDate(), - transactionDateField.getConfidence()); + + FormField merchantPhoneNumberField = recognizedFields.get("MerchantPhoneNumber"); + if (merchantPhoneNumberField != null) { + if (FieldValueType.PHONE_NUMBER.equals(merchantNameField.getValueType())) { + String merchantAddress = FieldValueType.PHONE_NUMBER.cast(merchantPhoneNumberField); + System.out.printf("Merchant Phone number: %s, confidence: %.2f%n", + merchantAddress, merchantPhoneNumberField.getConfidence()); + } + } + + FormField transactionDateField = recognizedFields.get("TransactionDate"); + if (transactionDateField != null) { + if (FieldValueType.DATE.equals(transactionDateField.getValueType())) { + LocalDate transactionDate = FieldValueType.DATE.cast(transactionDateField); + System.out.printf("Transaction Date: %s, confidence: %.2f%n", + transactionDate, transactionDateField.getConfidence()); + } } - FormField receiptItemsField = recognizedFields.get("Items"); - System.out.printf("Receipt Items: %n"); - if (receiptItemsField.getFieldValue().getType() == FieldValueType.LIST) { - List receiptItems = receiptItemsField.getFieldValue().asList(); - receiptItems.forEach(receiptItem -> { - if (receiptItem.getFieldValue().getType() == FieldValueType.MAP) { - receiptItem.getFieldValue().asMap().forEach((key, formField) -> { - if (key.equals("Quantity")) { - if (formField.getFieldValue().getType() == FieldValueType.INTEGER) { - System.out.printf("Quantity: %s, confidence: %.2f%n", - formField.getFieldValue().asInteger(), formField.getConfidence()); + + FormField receiptItemsField = recognizedFields.get("Items"); + if (receiptItemsField != null) { + System.out.printf("Receipt Items: %n"); + if (FieldValueType.LIST.equals(receiptItemsField.getValueType())) { + List> receiptItems = FieldValueType.LIST.cast(receiptItemsField); + receiptItems.forEach(receiptItem -> { + if (FieldValueType.MAP.equals(receiptItem.getValueType())) { + Map> formFieldMap = FieldValueType.MAP.cast(receiptItem); + formFieldMap.forEach((key, formField) -> { + if ("Quantity".equals(key)) { + if (FieldValueType.DOUBLE.equals(formField.getValueType())) { + Float quantity = FieldValueType.DOUBLE.cast(formField); + System.out.printf("Quantity: %d, confidence: %.2f%n", + quantity, formField.getConfidence()); + } } - } - }); - } - }); + }); + } + }); + } } }); // END: com.azure.ai.formrecognizer.FormRecognizerClient.beginRecognizeReceiptsFromUrl#string-recognizeOptions @@ -333,41 +371,60 @@ public void beginRecognizeReceiptsFromUrlWithOptions() { */ public void beginRecognizeReceipts() throws IOException { // BEGIN: com.azure.ai.formrecognizer.FormRecognizerClient.beginRecognizeReceipts#InputStream-long - File receipt = new File("{file_source_url}"); + File receipt = new File("{receipt_url}"); byte[] fileContent = Files.readAllBytes(receipt.toPath()); InputStream targetStream = new ByteArrayInputStream(fileContent); formRecognizerClient.beginRecognizeReceipts(targetStream, receipt.length()) .getFinalResult().forEach(recognizedReceipt -> { - Map recognizedFields = recognizedReceipt.getRecognizedForm().getFields(); - FormField merchantNameField = recognizedFields.get("MerchantName"); - if (merchantNameField.getFieldValue().getType() == FieldValueType.STRING) { - System.out.printf("Merchant Name: %s, confidence: %.2f%n", - merchantNameField.getFieldValue().asString(), - merchantNameField.getConfidence()); + Map> recognizedFields = recognizedReceipt.getFields(); + FormField merchantNameField = recognizedFields.get("MerchantName"); + if (merchantNameField != null) { + if (FieldValueType.STRING.equals(merchantNameField.getValueType())) { + String merchantName = FieldValueType.STRING.cast(merchantNameField); + System.out.printf("Merchant Name: %s, confidence: %.2f%n", + merchantName, merchantNameField.getConfidence()); + } } - FormField transactionDateField = recognizedFields.get("TransactionDate"); - if (transactionDateField.getFieldValue().getType() == FieldValueType.DATE) { - System.out.printf("Transaction Date: %s, confidence: %.2f%n", - transactionDateField.getFieldValue().asDate(), - transactionDateField.getConfidence()); + + FormField merchantPhoneNumberField = recognizedFields.get("MerchantPhoneNumber"); + if (merchantPhoneNumberField != null) { + if (FieldValueType.PHONE_NUMBER.equals(merchantNameField.getValueType())) { + String merchantAddress = FieldValueType.PHONE_NUMBER.cast(merchantPhoneNumberField); + System.out.printf("Merchant Phone number: %s, confidence: %.2f%n", + merchantAddress, merchantPhoneNumberField.getConfidence()); + } } - FormField receiptItemsField = recognizedFields.get("Items"); - System.out.printf("Receipt Items: %n"); - if (receiptItemsField.getFieldValue().getType() == FieldValueType.LIST) { - List receiptItems = receiptItemsField.getFieldValue().asList(); - receiptItems.forEach(receiptItem -> { - if (receiptItem.getFieldValue().getType() == FieldValueType.MAP) { - receiptItem.getFieldValue().asMap().forEach((key, formField) -> { - if (key.equals("Quantity")) { - if (formField.getFieldValue().getType() == FieldValueType.INTEGER) { - System.out.printf("Quantity: %d, confidence: %.2f%n", - formField.getFieldValue().asInteger(), formField.getConfidence()); + + FormField transactionDateField = recognizedFields.get("TransactionDate"); + if (transactionDateField != null) { + if (FieldValueType.DATE.equals(transactionDateField.getValueType())) { + LocalDate transactionDate = FieldValueType.DATE.cast(transactionDateField); + System.out.printf("Transaction Date: %s, confidence: %.2f%n", + transactionDate, transactionDateField.getConfidence()); + } + } + + FormField receiptItemsField = recognizedFields.get("Items"); + if (receiptItemsField != null) { + System.out.printf("Receipt Items: %n"); + if (FieldValueType.LIST.equals(receiptItemsField.getValueType())) { + List> receiptItems = FieldValueType.LIST.cast(receiptItemsField); + receiptItems.forEach(receiptItem -> { + if (FieldValueType.MAP.equals(receiptItem.getValueType())) { + Map> formFieldMap = FieldValueType.MAP.cast(receiptItem); + formFieldMap.forEach((key, formField) -> { + if ("Quantity".equals(key)) { + if (FieldValueType.DOUBLE.equals(formField.getValueType())) { + Float quantity = FieldValueType.DOUBLE.cast(formField); + System.out.printf("Quantity: %d, confidence: %.2f%n", + quantity, formField.getConfidence()); + } } - } - }); - } - }); + }); + } + }); + } } }); // END: com.azure.ai.formrecognizer.FormRecognizerClient.beginRecognizeReceipts#InputStream-long @@ -392,35 +449,54 @@ public void beginRecognizeReceiptsWithOptions() throws IOException { .setIncludeFieldElements(includeFieldElements) .setPollInterval(Duration.ofSeconds(5))) .getFinalResult().forEach(recognizedReceipt -> { - Map recognizedFields = recognizedReceipt.getRecognizedForm().getFields(); - FormField merchantNameField = recognizedFields.get("MerchantName"); - if (merchantNameField.getFieldValue().getType() == FieldValueType.STRING) { - System.out.printf("Merchant Name: %s, confidence: %.2f%n", - merchantNameField.getFieldValue().asString(), - merchantNameField.getConfidence()); + Map> recognizedFields = recognizedReceipt.getFields(); + FormField merchantNameField = recognizedFields.get("MerchantName"); + if (merchantNameField != null) { + if (FieldValueType.STRING.equals(merchantNameField.getValueType())) { + String merchantName = FieldValueType.STRING.cast(merchantNameField); + System.out.printf("Merchant Name: %s, confidence: %.2f%n", + merchantName, merchantNameField.getConfidence()); + } } - FormField transactionDateField = recognizedFields.get("TransactionDate"); - if (transactionDateField.getFieldValue().getType() == FieldValueType.DATE) { - System.out.printf("Transaction Date: %s, confidence: %.2f%n", - transactionDateField.getFieldValue().asDate(), - transactionDateField.getConfidence()); + + FormField merchantPhoneNumberField = recognizedFields.get("MerchantPhoneNumber"); + if (merchantPhoneNumberField != null) { + if (FieldValueType.PHONE_NUMBER.equals(merchantNameField.getValueType())) { + String merchantAddress = FieldValueType.PHONE_NUMBER.cast(merchantPhoneNumberField); + System.out.printf("Merchant Phone number: %s, confidence: %.2f%n", + merchantAddress, merchantPhoneNumberField.getConfidence()); + } + } + + FormField transactionDateField = recognizedFields.get("TransactionDate"); + if (transactionDateField != null) { + if (FieldValueType.DATE.equals(transactionDateField.getValueType())) { + LocalDate transactionDate = FieldValueType.DATE.cast(transactionDateField); + System.out.printf("Transaction Date: %s, confidence: %.2f%n", + transactionDate, transactionDateField.getConfidence()); + } } - FormField receiptItemsField = recognizedFields.get("Items"); - System.out.printf("Receipt Items: %n"); - if (receiptItemsField.getFieldValue().getType() == FieldValueType.LIST) { - List receiptItems = receiptItemsField.getFieldValue().asList(); - receiptItems.forEach(receiptItem -> { - if (receiptItem.getFieldValue().getType() == FieldValueType.MAP) { - receiptItem.getFieldValue().asMap().forEach((key, formField) -> { - if (key.equals("Quantity")) { - if (formField.getFieldValue().getType() == FieldValueType.INTEGER) { - System.out.printf("Quantity: %d, confidence: %.2f%n", - formField.getFieldValue().asInteger(), formField.getConfidence()); + + FormField receiptItemsField = recognizedFields.get("Items"); + if (receiptItemsField != null) { + System.out.printf("Receipt Items: %n"); + if (FieldValueType.LIST.equals(receiptItemsField.getValueType())) { + List> receiptItems = FieldValueType.LIST.cast(receiptItemsField); + receiptItems.forEach(receiptItem -> { + if (FieldValueType.MAP.equals(receiptItem.getValueType())) { + Map> formFieldMap = FieldValueType.MAP.cast(receiptItem); + formFieldMap.forEach((key, formField) -> { + if ("Quantity".equals(key)) { + if (FieldValueType.DOUBLE.equals(formField.getValueType())) { + Float quantity = FieldValueType.DOUBLE.cast(formField); + System.out.printf("Quantity: %d, confidence: %.2f%n", + quantity, formField.getConfidence()); + } } - } - }); - } - }); + }); + } + }); + } } }); // END: com.azure.ai.formrecognizer.FormRecognizerClient.beginRecognizeReceipts#InputStream-long-recognizeOptions diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/src/samples/java/com/azure/ai/formrecognizer/GetBoundingBoxes.java b/sdk/formrecognizer/azure-ai-formrecognizer/src/samples/java/com/azure/ai/formrecognizer/GetBoundingBoxes.java index ed281654cad82..f6f72e2d9c951 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/src/samples/java/com/azure/ai/formrecognizer/GetBoundingBoxes.java +++ b/sdk/formrecognizer/azure-ai-formrecognizer/src/samples/java/com/azure/ai/formrecognizer/GetBoundingBoxes.java @@ -50,7 +50,7 @@ public static void main(String[] args) { recognizedForm.getFields().forEach((fieldText, fieldValue) -> System.out.printf("Field %s has value %s " + "based on %s with a confidence score " + "of %.2f.%n", - fieldText, fieldValue.getFieldValue(), fieldValue.getValueData().getText(), + fieldText, fieldValue.getValue(), fieldValue.getValueData().getText(), fieldValue.getConfidence())); // Page Information diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/src/samples/java/com/azure/ai/formrecognizer/GetBoundingBoxesAsync.java b/sdk/formrecognizer/azure-ai-formrecognizer/src/samples/java/com/azure/ai/formrecognizer/GetBoundingBoxesAsync.java index c8931c16ab2ac..ebfad4bdc35f7 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/src/samples/java/com/azure/ai/formrecognizer/GetBoundingBoxesAsync.java +++ b/sdk/formrecognizer/azure-ai-formrecognizer/src/samples/java/com/azure/ai/formrecognizer/GetBoundingBoxesAsync.java @@ -63,7 +63,7 @@ public static void main(String[] args) { recognizedForm.getFields().forEach((fieldText, fieldValue) -> { System.out.printf("Field %s has value %s based on %s with a confidence score " + "of %.2f.%n", - fieldText, fieldValue.getFieldValue(), fieldValue.getValueData().getText(), + fieldText, fieldValue.getValue(), fieldValue.getValueData().getText(), fieldValue.getConfidence()); }); diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/src/samples/java/com/azure/ai/formrecognizer/ReadmeSamples.java b/sdk/formrecognizer/azure-ai-formrecognizer/src/samples/java/com/azure/ai/formrecognizer/ReadmeSamples.java index d58e884434b32..e1851afe0cd48 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/src/samples/java/com/azure/ai/formrecognizer/ReadmeSamples.java +++ b/sdk/formrecognizer/azure-ai-formrecognizer/src/samples/java/com/azure/ai/formrecognizer/ReadmeSamples.java @@ -11,7 +11,6 @@ import com.azure.ai.formrecognizer.models.FormPage; import com.azure.ai.formrecognizer.models.OperationResult; import com.azure.ai.formrecognizer.models.RecognizedForm; -import com.azure.ai.formrecognizer.models.RecognizedReceipt; import com.azure.ai.formrecognizer.training.FormTrainingClient; import com.azure.ai.formrecognizer.training.FormTrainingClientBuilder; import com.azure.core.credential.AzureKeyCredential; @@ -26,6 +25,7 @@ import java.io.IOException; import java.io.InputStream; import java.nio.file.Files; +import java.time.LocalDate; import java.util.List; import java.util.Map; import java.util.concurrent.atomic.AtomicReference; @@ -95,14 +95,13 @@ public void recognizeCustomForm() { for (int i = 0; i < recognizedForms.size(); i++) { RecognizedForm form = recognizedForms.get(i); - System.out.printf("----------- Recognized Form %d-----------%n", i); + System.out.printf("----------- Recognized Form %d -----------%n", i); System.out.printf("Form type: %s%n", form.getFormType()); - form.getFields().forEach((label, formField) -> { + form.getFields().forEach((label, formField) -> System.out.printf("Field %s has value %s with confidence score of %f.%n", label, formField.getValueData().getText(), - formField.getConfidence()); - }); - System.out.print("-----------------------------------"); + formField.getConfidence()) + ); } } @@ -124,7 +123,7 @@ public void recognizeContent() throws IOException { for (int i = 0; i < contentPageResults.size(); i++) { FormPage formPage = contentPageResults.get(i); - System.out.printf("----Recognizing content for page %d----%n", i); + System.out.printf("----Recognizing content for page %d ----%n", i); // Table information System.out.printf("Has width: %f and height: %f, measured with unit: %s.%n", formPage.getWidth(), formPage.getHeight(), @@ -132,10 +131,8 @@ public void recognizeContent() throws IOException { formPage.getTables().forEach(formTable -> { System.out.printf("Table has %d rows and %d columns.%n", formTable.getRowCount(), formTable.getColumnCount()); - formTable.getCells().forEach(formTableCell -> { - System.out.printf("Cell has text %s.%n", formTableCell.getText()); - }); - System.out.println(); + formTable.getCells().forEach(formTableCell -> + System.out.printf("Cell has text %s.%n", formTableCell.getText())); }); } } @@ -143,49 +140,61 @@ public void recognizeContent() throws IOException { public void recognizeReceipt() { String receiptUrl = "https://docs.microsoft.com/en-us/azure/cognitive-services/form-recognizer/media" + "/contoso-allinone.jpg"; - SyncPoller> syncPoller = + SyncPoller> syncPoller = formRecognizerClient.beginRecognizeReceiptsFromUrl(receiptUrl); - List receiptPageResults = syncPoller.getFinalResult(); + List receiptPageResults = syncPoller.getFinalResult(); for (int i = 0; i < receiptPageResults.size(); i++) { - RecognizedReceipt recognizedReceipt = receiptPageResults.get(i); - Map recognizedFields = recognizedReceipt.getRecognizedForm().getFields(); + RecognizedForm recognizedForm = receiptPageResults.get(i); + Map> recognizedFields = recognizedForm.getFields(); System.out.printf("----------- Recognized Receipt page %d -----------%n", i); - FormField merchantNameField = recognizedFields.get("MerchantName"); - if (merchantNameField.getFieldValue().getType() == FieldValueType.STRING) { - System.out.printf("Merchant Name: %s, confidence: %.2f%n", - merchantNameField.getFieldValue().asString(), - merchantNameField.getConfidence()); + FormField merchantNameField = recognizedFields.get("MerchantName"); + if (merchantNameField != null) { + if (FieldValueType.STRING.equals(merchantNameField.getValueType())) { + String merchantName = FieldValueType.STRING.cast(merchantNameField); + System.out.printf("Merchant Name: %s, confidence: %.2f%n", + merchantName, merchantNameField.getConfidence()); + } } - FormField transactionDateField = recognizedFields.get("TransactionDate"); - if (transactionDateField.getFieldValue().getType() == FieldValueType.DATE) { - System.out.printf("Transaction Date: %s, confidence: %.2f%n", - transactionDateField.getFieldValue().asDate(), - transactionDateField.getConfidence()); + + FormField merchantPhoneNumberField = recognizedFields.get("MerchantPhoneNumber"); + if (merchantPhoneNumberField != null) { + if (FieldValueType.PHONE_NUMBER.equals(merchantNameField.getValueType())) { + String merchantAddress = FieldValueType.PHONE_NUMBER.cast(merchantPhoneNumberField); + System.out.printf("Merchant Phone number: %s, confidence: %.2f%n", + merchantAddress, merchantPhoneNumberField.getConfidence()); + } } - FormField receiptItemsField = recognizedFields.get("Items"); - System.out.printf("Receipt Items: %n"); - if (receiptItemsField.getFieldValue().getType() == FieldValueType.LIST) { - List receiptItems = receiptItemsField.getFieldValue().asList(); - receiptItems.forEach(receiptItem -> { - if (receiptItem.getFieldValue().getType() == FieldValueType.MAP) { - receiptItem.getFieldValue().asMap().forEach((key, formField) -> { - if (key.equals("Name")) { - if (formField.getFieldValue().getType() == FieldValueType.STRING) { - System.out.printf("Name: %s, confidence: %.2fs%n", - formField.getFieldValue().asString(), - formField.getConfidence()); - } - } - if (key.equals("Quantity")) { - if (formField.getFieldValue().getType() == FieldValueType.INTEGER) { - System.out.printf("Quantity: %d, confidence: %.2f%n", - formField.getFieldValue().asInteger(), formField.getConfidence()); + + FormField transactionDateField = recognizedFields.get("TransactionDate"); + if (transactionDateField != null) { + if (FieldValueType.DATE.equals(transactionDateField.getValueType())) { + LocalDate transactionDate = FieldValueType.DATE.cast(transactionDateField); + System.out.printf("Transaction Date: %s, confidence: %.2f%n", + transactionDate, transactionDateField.getConfidence()); + } + } + + FormField receiptItemsField = recognizedFields.get("Items"); + if (receiptItemsField != null) { + System.out.printf("Receipt Items: %n"); + if (FieldValueType.LIST.equals(receiptItemsField.getValueType())) { + List> receiptItems = FieldValueType.LIST.cast(receiptItemsField); + receiptItems.forEach(receiptItem -> { + if (FieldValueType.MAP.equals(receiptItem.getValueType())) { + Map> formFieldMap = FieldValueType.MAP.cast(receiptItem); + formFieldMap.forEach((key, formField) -> { + if ("Quantity".equals(key)) { + if (FieldValueType.DOUBLE.equals(formField.getValueType())) { + Float quantity = FieldValueType.DOUBLE.cast(formField); + System.out.printf("Quantity: %f, confidence: %.2f%n", + quantity, formField.getConfidence()); + } } - } - }); - } - }); + }); + } + }); + } } } } diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/src/samples/java/com/azure/ai/formrecognizer/Receipt.java b/sdk/formrecognizer/azure-ai-formrecognizer/src/samples/java/com/azure/ai/formrecognizer/Receipt.java new file mode 100644 index 0000000000000..f174d8f2ff629 --- /dev/null +++ b/sdk/formrecognizer/azure-ai-formrecognizer/src/samples/java/com/azure/ai/formrecognizer/Receipt.java @@ -0,0 +1,360 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.ai.formrecognizer; + +import com.azure.ai.formrecognizer.models.FormField; +import com.azure.ai.formrecognizer.models.RecognizedForm; +import com.azure.core.annotation.Immutable; + +import java.time.LocalDate; +import java.time.LocalTime; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +/** + * The Receipt model. + */ +public final class Receipt { + + /** + * List of recognized field items. + */ + private List receiptItems; + + /** + * Recognized receipt type information. + */ + private ReceiptType receiptType; + + /** + * Recognized field merchant name. + */ + private FormField merchantName; + + /** + * Recognized field merchant address. + */ + private FormField merchantAddress; + + /** + * Recognized field merchant phone number. + */ + private FormField merchantPhoneNumber; + + /** + * Recognized field subtotal. + */ + private FormField subtotal; + + /** + * Recognized field tax. + */ + private FormField tax; + + /** + * Recognized field tip. + */ + private FormField tip; + + /** + * Recognized field total. + */ + private FormField total; + + /** + * Recognized field transaction date. + */ + private FormField transactionDate; + + /** + * Recognized field transaction time. + */ + private FormField transactionTime; + + @SuppressWarnings("unchecked") + public Receipt(RecognizedForm recognizedForm) { + for (Map.Entry> entry : recognizedForm.getFields().entrySet()) { + String key = entry.getKey(); + FormField fieldValue = entry.getValue(); + switch (key) { + case "ReceiptType": + receiptType = new ReceiptType(((FormField) fieldValue).getValue(), + fieldValue.getConfidence()); + break; + case "MerchantName": + merchantName = (FormField) fieldValue; + break; + case "MerchantAddress": + merchantAddress = (FormField) fieldValue; + break; + case "MerchantPhoneNumber": + merchantPhoneNumber = (FormField) fieldValue; + break; + case "Subtotal": + subtotal = (FormField) fieldValue; + break; + case "Tax": + tax = (FormField) fieldValue; + break; + case "Tip": + tip = (FormField) fieldValue; + break; + case "Total": + total = (FormField) fieldValue; + break; + case "TransactionDate": + transactionDate = (FormField) fieldValue; + break; + case "TransactionTime": + transactionTime = (FormField) fieldValue; + break; + case "Items": + receiptItems = Collections.unmodifiableList(toReceiptItems(fieldValue)); + break; + default: + break; + } + } + } + + /** + * Get the itemized fields in the Recognized Receipt. + * + * @return the unmodifiable list of itemized fields on the receipt. + */ + public List getReceiptItems() { + return this.receiptItems; + } + + /** + * Get the type of Recognized Receipt. + * + * @return the type of Recognized Receipt. + */ + public ReceiptType getReceiptType() { + return this.receiptType; + } + + /** + * Get the merchant name field. + * + * @return the merchantName value. + */ + public FormField getMerchantName() { + return this.merchantName; + } + + /** + * Get the merchant address field. + * + * @return the merchantAddress value. + */ + public FormField getMerchantAddress() { + return this.merchantAddress; + } + + /** + * Get the merchant Phone number field. + * + * @return the merchantPhoneNumber value. + */ + public FormField getMerchantPhoneNumber() { + return this.merchantPhoneNumber; + } + + /** + * Get the subtotal field. + * + * @return the subtotal value. + */ + public FormField getSubtotal() { + return this.subtotal; + } + + /** + * Get the tax field. + * + * @return the tax value. + */ + public FormField getTax() { + return this.tax; + } + + /** + * Get the tip field. + * + * @return the tip value. + */ + public FormField getTip() { + return this.tip; + } + + /** + * Get the Total field. + * + * @return the total value. + */ + public FormField getTotal() { + return this.total; + } + + /** + * Get the Transaction date field. + * + * @return the transactionDate value. + */ + public FormField getTransactionDate() { + return this.transactionDate; + } + + /** + * Get the transaction time field. + * + * @return the transactionTime value. + */ + public FormField getTransactionTime() { + return this.transactionTime; + } + + /** + * Helper method to convert the service level + * {@link com.azure.ai.formrecognizer.implementation.models.FieldValue#getValueArray() value items} + * to SDK level {@link ReceiptItem receipt items}. + * + * @param fieldValueItems The strongly typed field values. + * b + * + * @return An unmodifiable list of {@link ReceiptItem}. + */ + @SuppressWarnings("unchecked") + private static List toReceiptItems(FormField fieldValueItems) { + List> fieldValueArray = (List>) fieldValueItems.getValue(); + List receiptItemList = new ArrayList<>(); + + for (FormField eachFieldValue : fieldValueArray) { + Map> objectValue = ((Map>) (eachFieldValue.getValue())); + FormField name = null; + FormField quantity = null; + FormField price = null; + FormField totalPrice = null; + for (Map.Entry> entry : objectValue.entrySet()) { + String key = entry.getKey(); + if ("Quantity".equals(key)) { + quantity = (FormField) entry.getValue(); + } else if ("Name".equals(key)) { + name = (FormField) entry.getValue(); + } else if ("Price".equals(key)) { + price = (FormField) entry.getValue(); + } else if ("Total Price".equals(key)) { + totalPrice = (FormField) entry.getValue(); + } + } + receiptItemList.add(new ReceiptItem(name, quantity, price, totalPrice)); + } + return Collections.unmodifiableList(receiptItemList); + } + + /** + * The USReceiptType model. + */ + @Immutable + public static final class ReceiptType { + private final String type; + private final float confidence; + + /** + * Constructs a Receipt Type. + * + * @param type The type of the receipt. + * @param confidence The confidence score. + */ + public ReceiptType(final String type, final float confidence) { + this.type = type; + this.confidence = confidence; + } + + /** + * Gets the type of the receipt. + * + * @return The type of the receipt. + */ + public String getType() { + return this.type; + } + + /** + * Gets the confidence score of the detected type of the receipt. + * + * @return The confidence score of the detected type of the receipt. + */ + public float getConfidence() { + return this.confidence; + } + } + + /** + * The ReceiptItem model. + */ + @Immutable + public static final class ReceiptItem { + private final FormField name; + private final FormField quantity; + private final FormField price; + private final FormField totalPrice; + + /** + * Constructs a ReceiptItem object. + * + * @param name Name of the field value. + * @param quantity quantity of the field value. + * @param price price of the field value. + * @param totalPrice Total price of the field value. + */ + public ReceiptItem(final FormField name, final FormField quantity, final FormField price, + final FormField totalPrice) { + this.name = name; + this.quantity = quantity; + this.price = price; + this.totalPrice = totalPrice; + } + + /** + * Gets the name of the field value. + * + * @return The name of the field value. + */ + public FormField getName() { + return name; + } + + /** + * Gets the quantity of the Receipt Item. + * + * @return the quantity of Receipt Item. + */ + public FormField getQuantity() { + return quantity; + } + + /** + * Gets the price of the Receipt Item. + * + * @return The total Price. + */ + public FormField getPrice() { + return price; + } + + /** + * Gets the total price of the Receipt Item. + * + * @return The total Price. + */ + public FormField getTotalPrice() { + return totalPrice; + } + } +} diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/src/samples/java/com/azure/ai/formrecognizer/RecognizeReceipts.java b/sdk/formrecognizer/azure-ai-formrecognizer/src/samples/java/com/azure/ai/formrecognizer/RecognizeReceipts.java index da6871ca95b87..cd612e70d4a65 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/src/samples/java/com/azure/ai/formrecognizer/RecognizeReceipts.java +++ b/sdk/formrecognizer/azure-ai-formrecognizer/src/samples/java/com/azure/ai/formrecognizer/RecognizeReceipts.java @@ -6,7 +6,7 @@ import com.azure.ai.formrecognizer.models.FieldValueType; import com.azure.ai.formrecognizer.models.FormField; import com.azure.ai.formrecognizer.models.OperationResult; -import com.azure.ai.formrecognizer.models.RecognizedReceipt; +import com.azure.ai.formrecognizer.models.RecognizedForm; import com.azure.core.credential.AzureKeyCredential; import com.azure.core.util.polling.SyncPoller; @@ -15,11 +15,15 @@ import java.io.IOException; import java.io.InputStream; import java.nio.file.Files; +import java.time.LocalDate; import java.util.List; import java.util.Map; /** - * Sample for recognizing US receipt information using file source URL. + * Sample for recognizing commonly found US receipt fields from a local file input stream. + * For a suggested approach to extracting information from receipts, see StronglyTypedRecognizedForm.java. + * See fields found on a receipt here: + * https://aka.ms/azsdk/python/formrecognizer/receiptfields */ public class RecognizeReceipts { @@ -42,72 +46,86 @@ public static void main(final String[] args) throws IOException { byte[] fileContent = Files.readAllBytes(sourceFile.toPath()); InputStream targetStream = new ByteArrayInputStream(fileContent); - SyncPoller> analyzeReceiptPoller = + SyncPoller> analyzeReceiptPoller = client.beginRecognizeReceipts(targetStream, sourceFile.length()); - List receiptPageResults = analyzeReceiptPoller.getFinalResult(); + List receiptPageResults = analyzeReceiptPoller.getFinalResult(); for (int i = 0; i < receiptPageResults.size(); i++) { - RecognizedReceipt recognizedReceipt = receiptPageResults.get(i); - Map recognizedFields = recognizedReceipt.getRecognizedForm().getFields(); + RecognizedForm recognizedForm = receiptPageResults.get(i); + Map> recognizedFields = recognizedForm.getFields(); System.out.printf("----------- Recognized Receipt page %d -----------%n", i); - FormField merchantNameField = recognizedFields.get("MerchantName"); + FormField merchantNameField = recognizedFields.get("MerchantName"); if (merchantNameField != null) { - if (merchantNameField.getFieldValue().getType() == FieldValueType.STRING) { + if (FieldValueType.STRING.equals(merchantNameField.getValueType())) { + String merchantName = FieldValueType.STRING.cast(merchantNameField); System.out.printf("Merchant Name: %s, confidence: %.2f%n", - merchantNameField.getFieldValue().asString(), - merchantNameField.getConfidence()); + merchantName, merchantNameField.getConfidence()); } } - FormField merchantAddressField = recognizedFields.get("MerchantAddress"); + + FormField merchantPhoneNumberField = recognizedFields.get("MerchantPhoneNumber"); + if (merchantPhoneNumberField != null) { + if (FieldValueType.PHONE_NUMBER.equals(merchantNameField.getValueType())) { + String merchantAddress = FieldValueType.PHONE_NUMBER.cast(merchantPhoneNumberField); + System.out.printf("Merchant Phone number: %s, confidence: %.2f%n", + merchantAddress, merchantPhoneNumberField.getConfidence()); + } + } + + FormField merchantAddressField = recognizedFields.get("MerchantAddress"); if (merchantAddressField != null) { - if (merchantAddressField.getFieldValue().getType() == FieldValueType.STRING) { + if (FieldValueType.STRING.equals(merchantNameField.getValueType())) { + String merchantAddress = FieldValueType.STRING.cast(merchantAddressField); System.out.printf("Merchant Address: %s, confidence: %.2f%n", - merchantAddressField.getFieldValue().asString(), - merchantAddressField.getConfidence()); + merchantAddress, merchantAddressField.getConfidence()); } } - FormField transactionDateField = recognizedFields.get("TransactionDate"); + + FormField transactionDateField = recognizedFields.get("TransactionDate"); if (transactionDateField != null) { - if (transactionDateField.getFieldValue().getType() == FieldValueType.DATE) { + if (FieldValueType.DATE.equals(transactionDateField.getValueType())) { + LocalDate transactionDate = FieldValueType.DATE.cast(transactionDateField); System.out.printf("Transaction Date: %s, confidence: %.2f%n", - transactionDateField.getFieldValue().asDate(), - transactionDateField.getConfidence()); + transactionDate, transactionDateField.getConfidence()); } } - FormField receiptItemsField = recognizedFields.get("Items"); + + FormField receiptItemsField = recognizedFields.get("Items"); if (receiptItemsField != null) { System.out.printf("Receipt Items: %n"); - if (receiptItemsField.getFieldValue().getType() == FieldValueType.LIST) { - List receiptItems = receiptItemsField.getFieldValue().asList(); + if (FieldValueType.LIST.equals(receiptItemsField.getValueType())) { + List> receiptItems = FieldValueType.LIST.cast(receiptItemsField); receiptItems.forEach(receiptItem -> { - if (receiptItem.getFieldValue().getType() == FieldValueType.MAP) { - receiptItem.getFieldValue().asMap().forEach((key, formField) -> { - if (key.equals("Name")) { - if (formField.getFieldValue().getType() == FieldValueType.STRING) { + if (FieldValueType.MAP.equals(receiptItem.getValueType())) { + Map> formFieldMap = FieldValueType.MAP.cast(receiptItem); + formFieldMap.forEach((key, formField) -> { + if ("Name".equals(key)) { + if (FieldValueType.STRING.equals(formField.getValueType())) { + String name = FieldValueType.STRING.cast(formField); System.out.printf("Name: %s, confidence: %.2fs%n", - formField.getFieldValue().asString(), - formField.getConfidence()); + name, formField.getConfidence()); } } - if (key.equals("Quantity")) { - if (formField.getFieldValue().getType() == FieldValueType.INTEGER) { - System.out.printf("Quantity: %d, confidence: %.2f%n", - formField.getFieldValue().asInteger(), formField.getConfidence()); + if ("Quantity".equals(key)) { + if (FieldValueType.DOUBLE.equals(formField.getValueType())) { + Float quantity = FieldValueType.DOUBLE.cast(formField); + System.out.printf("Quantity: %f, confidence: %.2f%n", + quantity, formField.getConfidence()); } } - if (key.equals("Price")) { - if (formField.getFieldValue().getType() == FieldValueType.FLOAT) { + if ("Price".equals(key)) { + if (FieldValueType.DOUBLE.equals(formField.getValueType())) { + Float price = FieldValueType.DOUBLE.cast(formField); System.out.printf("Price: %f, confidence: %.2f%n", - formField.getFieldValue().asFloat(), - formField.getConfidence()); + price, formField.getConfidence()); } } - if (key.equals("TotalPrice")) { - if (formField.getFieldValue().getType() == FieldValueType.FLOAT) { + if ("TotalPrice".equals(key)) { + if (FieldValueType.DOUBLE.equals(formField.getValueType())) { + Float totalPrice = FieldValueType.DOUBLE.cast(formField); System.out.printf("Total Price: %f, confidence: %.2f%n", - formField.getFieldValue().asFloat(), - formField.getConfidence()); + totalPrice, formField.getConfidence()); } } }); diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/src/samples/java/com/azure/ai/formrecognizer/RecognizeReceiptsAsync.java b/sdk/formrecognizer/azure-ai-formrecognizer/src/samples/java/com/azure/ai/formrecognizer/RecognizeReceiptsAsync.java index f59aeb97cb60e..d9c1b3849187c 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/src/samples/java/com/azure/ai/formrecognizer/RecognizeReceiptsAsync.java +++ b/sdk/formrecognizer/azure-ai-formrecognizer/src/samples/java/com/azure/ai/formrecognizer/RecognizeReceiptsAsync.java @@ -6,7 +6,7 @@ import com.azure.ai.formrecognizer.models.FieldValueType; import com.azure.ai.formrecognizer.models.FormField; import com.azure.ai.formrecognizer.models.OperationResult; -import com.azure.ai.formrecognizer.models.RecognizedReceipt; +import com.azure.ai.formrecognizer.models.RecognizedForm; import com.azure.core.credential.AzureKeyCredential; import com.azure.core.util.polling.PollerFlux; import reactor.core.publisher.Mono; @@ -16,6 +16,7 @@ import java.io.IOException; import java.io.InputStream; import java.nio.file.Files; +import java.time.LocalDate; import java.util.List; import java.util.Map; import java.util.concurrent.TimeUnit; @@ -23,7 +24,10 @@ import static com.azure.ai.formrecognizer.implementation.Utility.toFluxByteBuffer; /** - * Async sample for recognizing US receipt information from a local file. + * Async sample for recognizing commonly found US receipt fields from a local file input stream. + * For a suggested approach to extracting information from receipts, see StronglyTypedRecognizedForm.java. + * See fields found on a receipt here: + * https://aka.ms/azsdk/python/formrecognizer/receiptfields */ public class RecognizeReceiptsAsync { @@ -31,6 +35,7 @@ public class RecognizeReceiptsAsync { * Main method to invoke this demo. * * @param args Unused. Arguments to the program. + * * @throws IOException Exception thrown when there is an error in reading all the bytes from the File. */ public static void main(final String[] args) throws IOException { @@ -45,11 +50,11 @@ public static void main(final String[] args) throws IOException { byte[] fileContent = Files.readAllBytes(sourceFile.toPath()); InputStream targetStream = new ByteArrayInputStream(fileContent); - PollerFlux> analyzeReceiptPoller = + PollerFlux> analyzeReceiptPoller = client.beginRecognizeReceipts(toFluxByteBuffer(targetStream), sourceFile.length()); - Mono> receiptPageResultsMono = analyzeReceiptPoller + Mono> receiptPageResultsMono = analyzeReceiptPoller .last() .flatMap(recognizeReceiptPollOperation -> { if (recognizeReceiptPollOperation.getStatus().isComplete()) { @@ -64,66 +69,80 @@ public static void main(final String[] args) throws IOException { receiptPageResultsMono.subscribe(receiptPageResults -> { for (int i = 0; i < receiptPageResults.size(); i++) { - RecognizedReceipt recognizedReceipt = receiptPageResults.get(i); - Map recognizedFields = recognizedReceipt.getRecognizedForm().getFields(); + RecognizedForm recognizedForm = receiptPageResults.get(i); + Map> recognizedFields = recognizedForm.getFields(); System.out.printf("----------- Recognized Receipt page %d -----------%n", i); - FormField merchantNameField = recognizedFields.get("MerchantName"); + FormField merchantNameField = recognizedFields.get("MerchantName"); if (merchantNameField != null) { - if (merchantNameField.getFieldValue().getType() == FieldValueType.STRING) { + if (FieldValueType.STRING.equals(merchantNameField.getValueType())) { + String merchantName = FieldValueType.STRING.cast(merchantNameField); System.out.printf("Merchant Name: %s, confidence: %.2f%n", - merchantNameField.getFieldValue().asString(), - merchantNameField.getConfidence()); + merchantName, merchantNameField.getConfidence()); + } + } + + FormField merchantPhoneNumberField = recognizedFields.get("MerchantPhoneNumber"); + if (merchantPhoneNumberField != null) { + if (FieldValueType.PHONE_NUMBER.equals(merchantNameField.getValueType())) { + String merchantAddress = FieldValueType.PHONE_NUMBER.cast(merchantPhoneNumberField); + System.out.printf("Merchant Phone number: %s, confidence: %.2f%n", + merchantAddress, merchantPhoneNumberField.getConfidence()); } } - FormField merchantAddressField = recognizedFields.get("MerchantAddress"); + + FormField merchantAddressField = recognizedFields.get("MerchantAddress"); if (merchantAddressField != null) { - if (merchantAddressField.getFieldValue().getType() == FieldValueType.STRING) { + if (FieldValueType.STRING.equals(merchantNameField.getValueType())) { + String merchantAddress = FieldValueType.STRING.cast(merchantAddressField); System.out.printf("Merchant Address: %s, confidence: %.2f%n", - merchantAddressField.getFieldValue().asString(), - merchantAddressField.getConfidence()); + merchantAddress, merchantAddressField.getConfidence()); } } - FormField transactionDateField = recognizedFields.get("TransactionDate"); + + FormField transactionDateField = recognizedFields.get("TransactionDate"); if (transactionDateField != null) { - if (transactionDateField.getFieldValue().getType() == FieldValueType.DATE) { + if (FieldValueType.DATE.equals(transactionDateField.getValueType())) { + LocalDate transactionDate = FieldValueType.DATE.cast(transactionDateField); System.out.printf("Transaction Date: %s, confidence: %.2f%n", - transactionDateField.getFieldValue().asDate(), - transactionDateField.getConfidence()); + transactionDate, transactionDateField.getConfidence()); } } - FormField receiptItemsField = recognizedFields.get("Items"); + + FormField receiptItemsField = recognizedFields.get("Items"); if (receiptItemsField != null) { System.out.printf("Receipt Items: %n"); - if (receiptItemsField.getFieldValue().getType() == FieldValueType.LIST) { - List receiptItems = receiptItemsField.getFieldValue().asList(); + if (FieldValueType.LIST.equals(receiptItemsField.getValueType())) { + List> receiptItems = FieldValueType.LIST.cast(receiptItemsField); receiptItems.forEach(receiptItem -> { - if (receiptItem.getFieldValue().getType() == FieldValueType.MAP) { - receiptItem.getFieldValue().asMap().forEach((key, formField) -> { - if (key.equals("Name")) { - if (formField.getFieldValue().getType() == FieldValueType.STRING) { + if (FieldValueType.MAP.equals(receiptItem.getValueType())) { + Map> formFieldMap = FieldValueType.MAP.cast(receiptItem); + formFieldMap.forEach((key, formField) -> { + if ("Name".equals(key)) { + if (FieldValueType.STRING.equals(formField.getValueType())) { + String name = FieldValueType.STRING.cast(formField); System.out.printf("Name: %s, confidence: %.2fs%n", - formField.getFieldValue().asString(), - formField.getConfidence()); + name, formField.getConfidence()); } } - if (key.equals("Quantity")) { - if (formField.getFieldValue().getType() == FieldValueType.INTEGER) { - System.out.printf("Quantity: %d, confidence: %.2f%n", - formField.getFieldValue().asInteger(), formField.getConfidence()); + if ("Quantity".equals(key)) { + if (FieldValueType.DOUBLE.equals(formField.getValueType())) { + Float quantity = FieldValueType.DOUBLE.cast(formField); + System.out.printf("Quantity: %f, confidence: %.2f%n", + quantity, formField.getConfidence()); } } - if (key.equals("Price")) { - if (formField.getFieldValue().getType() == FieldValueType.FLOAT) { + if ("Price".equals(key)) { + if (FieldValueType.DOUBLE.equals(formField.getValueType())) { + Float price = FieldValueType.DOUBLE.cast(formField); System.out.printf("Price: %f, confidence: %.2f%n", - formField.getFieldValue().asFloat(), - formField.getConfidence()); + price, formField.getConfidence()); } } - if (key.equals("TotalPrice")) { - if (formField.getFieldValue().getType() == FieldValueType.FLOAT) { + if ("TotalPrice".equals(key)) { + if (FieldValueType.DOUBLE.equals(formField.getValueType())) { + Float totalPrice = FieldValueType.DOUBLE.cast(formField); System.out.printf("Total Price: %f, confidence: %.2f%n", - formField.getFieldValue().asFloat(), - formField.getConfidence()); + totalPrice, formField.getConfidence()); } } }); diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/src/samples/java/com/azure/ai/formrecognizer/RecognizeReceiptsFromUrl.java b/sdk/formrecognizer/azure-ai-formrecognizer/src/samples/java/com/azure/ai/formrecognizer/RecognizeReceiptsFromUrl.java index 8e7239f00dc0a..df9c21ca7d093 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/src/samples/java/com/azure/ai/formrecognizer/RecognizeReceiptsFromUrl.java +++ b/sdk/formrecognizer/azure-ai-formrecognizer/src/samples/java/com/azure/ai/formrecognizer/RecognizeReceiptsFromUrl.java @@ -6,15 +6,19 @@ import com.azure.ai.formrecognizer.models.FieldValueType; import com.azure.ai.formrecognizer.models.FormField; import com.azure.ai.formrecognizer.models.OperationResult; -import com.azure.ai.formrecognizer.models.RecognizedReceipt; +import com.azure.ai.formrecognizer.models.RecognizedForm; import com.azure.core.credential.AzureKeyCredential; import com.azure.core.util.polling.SyncPoller; +import java.time.LocalDate; import java.util.List; import java.util.Map; /** - * Sample for recognizing US receipt information using file source URL. + * Sample for recognizing commonly found US receipt fields from a file source URL. For a suggested approach to + * extracting information from receipts, see StronglyTypedRecognizedForm.java. + * See fields found on a receipt here: + * https://aka.ms/azsdk/python/formrecognizer/receiptfields */ public class RecognizeReceiptsFromUrl { @@ -30,73 +34,88 @@ public static void main(final String[] args) { .endpoint("https://{endpoint}.cognitiveservices.azure.com/") .buildClient(); - String receiptUrl = "https://raw.githubusercontent.com/Azure/azure-sdk-for-java/master/sdk/formrecognizer/azure-ai-formrecognizer/src/samples/java/sample-forms/receipts/contoso-allinone.jpg"; - SyncPoller> recognizeReceiptPoller = + String receiptUrl = "https://raw.githubusercontent.com/Azure/azure-sdk-for-java/master/sdk/formrecognizer" + + "/azure-ai-formrecognizer/src/samples/java/sample-forms/receipts/contoso-allinone.jpg"; + SyncPoller> recognizeReceiptPoller = client.beginRecognizeReceiptsFromUrl(receiptUrl); - List receiptPageResults = recognizeReceiptPoller.getFinalResult(); + List receiptPageResults = recognizeReceiptPoller.getFinalResult(); for (int i = 0; i < receiptPageResults.size(); i++) { - RecognizedReceipt recognizedReceipt = receiptPageResults.get(i); - Map recognizedFields = recognizedReceipt.getRecognizedForm().getFields(); + RecognizedForm recognizedForm = receiptPageResults.get(i); + Map> recognizedFields = recognizedForm.getFields(); System.out.printf("----------- Recognized Receipt page %d -----------%n", i); - FormField merchantNameField = recognizedFields.get("MerchantName"); + FormField merchantNameField = recognizedFields.get("MerchantName"); if (merchantNameField != null) { - if (merchantNameField.getFieldValue().getType() == FieldValueType.STRING) { + if (FieldValueType.STRING.equals(merchantNameField.getValueType())) { + String merchantName = FieldValueType.STRING.cast(merchantNameField); System.out.printf("Merchant Name: %s, confidence: %.2f%n", - merchantNameField.getFieldValue().asString(), - merchantNameField.getConfidence()); + merchantName, merchantNameField.getConfidence()); } } - FormField merchantAddressField = recognizedFields.get("MerchantAddress"); + + FormField merchantAddressField = recognizedFields.get("MerchantAddress"); if (merchantAddressField != null) { - if (merchantAddressField.getFieldValue().getType() == FieldValueType.STRING) { + if (FieldValueType.STRING.equals(merchantNameField.getValueType())) { + String merchantAddress = FieldValueType.STRING.cast(merchantAddressField); System.out.printf("Merchant Address: %s, confidence: %.2f%n", - merchantAddressField.getFieldValue().asString(), - merchantAddressField.getConfidence()); + merchantAddress, merchantAddressField.getConfidence()); + } + } + + FormField merchantPhoneNumberField = recognizedFields.get("MerchantPhoneNumber"); + if (merchantPhoneNumberField != null) { + if (FieldValueType.PHONE_NUMBER.equals(merchantNameField.getValueType())) { + String merchantAddress = FieldValueType.PHONE_NUMBER.cast(merchantPhoneNumberField); + System.out.printf("Merchant Phone number: %s, confidence: %.2f%n", + merchantAddress, merchantPhoneNumberField.getConfidence()); } } - FormField transactionDateField = recognizedFields.get("TransactionDate"); + + FormField transactionDateField = recognizedFields.get("TransactionDate"); if (transactionDateField != null) { - if (transactionDateField.getFieldValue().getType() == FieldValueType.DATE) { + if (FieldValueType.DATE.equals(transactionDateField.getValueType())) { + LocalDate transactionDate = FieldValueType.DATE.cast(transactionDateField); System.out.printf("Transaction Date: %s, confidence: %.2f%n", - transactionDateField.getFieldValue().asDate(), - transactionDateField.getConfidence()); + transactionDate, transactionDateField.getConfidence()); } } - FormField receiptItemsField = recognizedFields.get("Items"); + + FormField receiptItemsField = recognizedFields.get("Items"); if (receiptItemsField != null) { System.out.printf("Receipt Items: %n"); - if (receiptItemsField.getFieldValue().getType() == FieldValueType.LIST) { - List receiptItems = receiptItemsField.getFieldValue().asList(); + if (FieldValueType.LIST.equals(receiptItemsField.getValueType())) { + List> receiptItems = FieldValueType.LIST.cast(receiptItemsField); receiptItems.forEach(receiptItem -> { - if (receiptItem.getFieldValue().getType() == FieldValueType.MAP) { - receiptItem.getFieldValue().asMap().forEach((key, formField) -> { - if (key.equals("Name")) { - if (formField.getFieldValue().getType() == FieldValueType.STRING) { + if (FieldValueType.MAP.equals(receiptItem.getValueType())) { + Map> formFieldMap = FieldValueType.MAP.cast(receiptItem); + formFieldMap.forEach((key, formField) -> { + if ("Name".equals(key)) { + if (FieldValueType.STRING.equals(formField.getValueType())) { + String name = FieldValueType.STRING.cast(formField); System.out.printf("Name: %s, confidence: %.2fs%n", - formField.getFieldValue().asString(), - formField.getConfidence()); + name, formField.getConfidence()); } } - if (key.equals("Quantity")) { - if (formField.getFieldValue().getType() == FieldValueType.INTEGER) { - System.out.printf("Quantity: %d, confidence: %.2f%n", - formField.getFieldValue().asInteger(), formField.getConfidence()); + if ("Quantity".equals(key)) { + if (FieldValueType.DOUBLE.equals(formField.getValueType())) { + Float quantity = FieldValueType.DOUBLE.cast(formField); + System.out.printf("Quantity: %f, confidence: %.2f%n", + quantity, formField.getConfidence()); } } - if (key.equals("Price")) { - if (formField.getFieldValue().getType() == FieldValueType.FLOAT) { + if ("Price".equals(key)) { + if (FieldValueType.DOUBLE.equals(formField.getValueType())) { + Float price = FieldValueType.DOUBLE.cast(formField); System.out.printf("Price: %f, confidence: %.2f%n", - formField.getFieldValue().asFloat(), - formField.getConfidence()); + price, formField.getConfidence()); } } - if (key.equals("TotalPrice")) { - if (formField.getFieldValue().getType() == FieldValueType.FLOAT) { + if ("TotalPrice".equals(key)) { + if (FieldValueType.DOUBLE.equals(formField.getValueType())) { + Float totalPrice = FieldValueType.DOUBLE.cast(formField); System.out.printf("Total Price: %f, confidence: %.2f%n", - formField.getFieldValue().asFloat(), - formField.getConfidence()); + totalPrice, formField.getConfidence()); } } }); diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/src/samples/java/com/azure/ai/formrecognizer/RecognizeReceiptsFromUrlAsync.java b/sdk/formrecognizer/azure-ai-formrecognizer/src/samples/java/com/azure/ai/formrecognizer/RecognizeReceiptsFromUrlAsync.java index e6148c58664a2..4df763056b81d 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/src/samples/java/com/azure/ai/formrecognizer/RecognizeReceiptsFromUrlAsync.java +++ b/sdk/formrecognizer/azure-ai-formrecognizer/src/samples/java/com/azure/ai/formrecognizer/RecognizeReceiptsFromUrlAsync.java @@ -6,17 +6,21 @@ import com.azure.ai.formrecognizer.models.FieldValueType; import com.azure.ai.formrecognizer.models.FormField; import com.azure.ai.formrecognizer.models.OperationResult; -import com.azure.ai.formrecognizer.models.RecognizedReceipt; +import com.azure.ai.formrecognizer.models.RecognizedForm; import com.azure.core.credential.AzureKeyCredential; import com.azure.core.util.polling.PollerFlux; import reactor.core.publisher.Mono; +import java.time.LocalDate; import java.util.List; import java.util.Map; import java.util.concurrent.TimeUnit; /** - * Async sample for recognizing US receipt information using file source URL. + * Async sample for recognizing commonly found US receipt fields from a file source URL. For a suggested approach to + * extracting information from receipts, see StronglyTypedRecognizedForm.java. + * See fields found on a receipt here: + * https://aka.ms/azsdk/python/formrecognizer/receiptfields */ public class RecognizeReceiptsFromUrlAsync { @@ -32,11 +36,12 @@ public static void main(final String[] args) { .endpoint("https://{endpoint}.cognitiveservices.azure.com/") .buildAsyncClient(); - String receiptUrl = "https://raw.githubusercontent.com/Azure/azure-sdk-for-java/master/sdk/formrecognizer/azure-ai-formrecognizer/src/samples/java/sample-forms/receipts/contoso-allinone.jpg"; - PollerFlux> recognizeReceiptPoller = + String receiptUrl = "https://raw.githubusercontent.com/Azure/azure-sdk-for-java/master/sdk/formrecognizer" + + "/azure-ai-formrecognizer/src/samples/java/sample-forms/receipts/contoso-allinone.jpg"; + PollerFlux> recognizeReceiptPoller = client.beginRecognizeReceiptsFromUrl(receiptUrl); - Mono> receiptPageResults = recognizeReceiptPoller + Mono> receiptPageResults = recognizeReceiptPoller .last() .flatMap(trainingOperationResponse -> { if (trainingOperationResponse.getStatus().isComplete()) { @@ -51,66 +56,81 @@ public static void main(final String[] args) { receiptPageResults.subscribe(recognizedReceipts -> { for (int i = 0; i < recognizedReceipts.size(); i++) { - RecognizedReceipt recognizedReceipt = recognizedReceipts.get(i); - Map recognizedFields = recognizedReceipt.getRecognizedForm().getFields(); + RecognizedForm recognizedForm = recognizedReceipts.get(i); + Map> recognizedFields = recognizedForm.getFields(); System.out.printf("----------- Recognized Receipt page %d -----------%n", i); - FormField merchantNameField = recognizedFields.get("MerchantName"); + FormField merchantNameField = recognizedFields.get("MerchantName"); if (merchantNameField != null) { - if (merchantNameField.getFieldValue().getType() == FieldValueType.STRING) { + if (FieldValueType.STRING.equals(merchantNameField.getValueType())) { + String merchantName = FieldValueType.STRING.cast(merchantNameField); System.out.printf("Merchant Name: %s, confidence: %.2f%n", - merchantNameField.getFieldValue().asString(), - merchantNameField.getConfidence()); + merchantName, merchantNameField.getConfidence()); } } - FormField merchantAddressField = recognizedFields.get("MerchantAddress"); + + FormField merchantPhoneNumberField = recognizedFields.get("MerchantPhoneNumber"); + if (merchantPhoneNumberField != null) { + if (FieldValueType.PHONE_NUMBER.equals(merchantNameField.getValueType())) { + String merchantAddress = FieldValueType.PHONE_NUMBER.cast(merchantPhoneNumberField); + System.out.printf("Merchant Address: %s, confidence: %.2f%n", + merchantAddress, merchantPhoneNumberField.getConfidence()); + } + } + + FormField merchantAddressField = recognizedFields.get("MerchantAddress"); if (merchantAddressField != null) { - if (merchantAddressField.getFieldValue().getType() == FieldValueType.STRING) { + if (FieldValueType.STRING.equals(merchantNameField.getValueType())) { + String merchantAddress = FieldValueType.STRING.cast(merchantAddressField); System.out.printf("Merchant Address: %s, confidence: %.2f%n", - merchantAddressField.getFieldValue().asString(), - merchantAddressField.getConfidence()); + merchantAddress, merchantAddressField.getConfidence()); } } - FormField transactionDateField = recognizedFields.get("TransactionDate"); + + FormField transactionDateField = recognizedFields.get("TransactionDate"); if (transactionDateField != null) { - if (transactionDateField.getFieldValue().getType() == FieldValueType.DATE) { + if (FieldValueType.DATE.equals(transactionDateField.getValueType())) { + LocalDate transactionDate = FieldValueType.DATE.cast(transactionDateField); System.out.printf("Transaction Date: %s, confidence: %.2f%n", - transactionDateField.getFieldValue().asDate(), - transactionDateField.getConfidence()); + transactionDate, transactionDateField.getConfidence()); } } - FormField receiptItemsField = recognizedFields.get("Items"); + + FormField receiptItemsField = recognizedFields.get("Items"); if (receiptItemsField != null) { System.out.printf("Receipt Items: %n"); - if (receiptItemsField.getFieldValue().getType() == FieldValueType.LIST) { - List receiptItems = receiptItemsField.getFieldValue().asList(); + if (FieldValueType.LIST.equals(receiptItemsField.getValueType())) { + List> receiptItems = FieldValueType.LIST.cast(receiptItemsField); receiptItems.forEach(receiptItem -> { - if (receiptItem.getFieldValue().getType() == FieldValueType.MAP) { - receiptItem.getFieldValue().asMap().forEach((key, formField) -> { - if (key.equals("Name")) { - if (formField.getFieldValue().getType() == FieldValueType.STRING) { + if (FieldValueType.MAP.equals(receiptItem.getValueType())) { + // we still have to cast or assign + Map> formFieldMap = FieldValueType.MAP.cast(receiptItem); + formFieldMap.forEach((key, formField) -> { + if ("Name".equals(key)) { + if (FieldValueType.STRING.equals(formField.getValueType())) { + String name = FieldValueType.STRING.cast(formField); System.out.printf("Name: %s, confidence: %.2fs%n", - formField.getFieldValue().asString(), - formField.getConfidence()); + name, formField.getConfidence()); } } - if (key.equals("Quantity")) { - if (formField.getFieldValue().getType() == FieldValueType.INTEGER) { + if ("Quantity".equals(key)) { + if (FieldValueType.DOUBLE.equals(formField.getValueType())) { + Float quantity = FieldValueType.DOUBLE.cast(formField); System.out.printf("Quantity: %f, confidence: %.2f%n", - formField.getFieldValue().asInteger(), formField.getConfidence()); + quantity, formField.getConfidence()); } } - if (key.equals("Price")) { - if (formField.getFieldValue().getType() == FieldValueType.FLOAT) { + if ("Price".equals(key)) { + if (FieldValueType.DOUBLE.equals(formField.getValueType())) { + Float price = FieldValueType.DOUBLE.cast(formField); System.out.printf("Price: %f, confidence: %.2f%n", - formField.getFieldValue().asFloat(), - formField.getConfidence()); + price, formField.getConfidence()); } } - if (key.equals("TotalPrice")) { - if (formField.getFieldValue().getType() == FieldValueType.FLOAT) { + if ("TotalPrice".equals(key)) { + if (FieldValueType.DOUBLE.equals(formField.getValueType())) { + Float totalPrice = FieldValueType.DOUBLE.cast(formField); System.out.printf("Total Price: %f, confidence: %.2f%n", - formField.getFieldValue().asFloat(), - formField.getConfidence()); + totalPrice, formField.getConfidence()); } } }); diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/src/samples/java/com/azure/ai/formrecognizer/StronglyTypedRecognizedForm.java b/sdk/formrecognizer/azure-ai-formrecognizer/src/samples/java/com/azure/ai/formrecognizer/StronglyTypedRecognizedForm.java new file mode 100644 index 0000000000000..f0144fdc9a565 --- /dev/null +++ b/sdk/formrecognizer/azure-ai-formrecognizer/src/samples/java/com/azure/ai/formrecognizer/StronglyTypedRecognizedForm.java @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +package com.azure.ai.formrecognizer; + +import com.azure.ai.formrecognizer.models.OperationResult; +import com.azure.ai.formrecognizer.models.RecognizedForm; +import com.azure.core.credential.AzureKeyCredential; +import com.azure.core.util.polling.SyncPoller; + +import java.util.List; + +/** + * Sample demonstrating converting recognized form fields to strongly typed US receipt field values. + * See + * + * for information on the strongly typed fields returned by service when recognizing receipts. + */ +public class StronglyTypedRecognizedForm { + + /** + * Main method to invoke this demo. + * + * @param args Unused. Arguments to the program. + */ + public static void main(final String[] args) { + // Instantiate a client that will be used to call the service. + FormRecognizerClient client = new FormRecognizerClientBuilder() + .credential(new AzureKeyCredential("{api_Key}")) + .endpoint("https://{endpoint}.cognitiveservices.azure.com/") + .buildClient(); + + String receiptUrl = "https://raw.githubusercontent.com/Azure/azure-sdk-for-java/master/sdk/formrecognizer" + + "/azure-ai-formrecognizer/src/samples/java/sample-forms/receipts/contoso-allinone.jpg"; + SyncPoller> recognizeReceiptPoller = + client.beginRecognizeReceiptsFromUrl(receiptUrl); + + List receiptPageResults = recognizeReceiptPoller.getFinalResult(); + + for (int i = 0; i < receiptPageResults.size(); i++) { + final RecognizedForm recognizedForm = receiptPageResults.get(i); + System.out.printf("----------- Recognized Receipt page %d -----------%n", i); + // Use Receipt model transform the recognized form to strongly typed US receipt fields + Receipt usReceipt = new Receipt(recognizedForm); + System.out.printf("Merchant Name: %s, confidence: %.2f%n", usReceipt.getMerchantName().getValue(), + usReceipt.getMerchantName().getConfidence()); + System.out.printf("Merchant Address: %s, confidence: %.2f%n", + usReceipt.getMerchantAddress().getValue(), + usReceipt.getMerchantAddress().getConfidence()); + System.out.printf("Merchant Phone Number %s, confidence: %.2f%n", + usReceipt.getMerchantPhoneNumber().getValue(), usReceipt.getMerchantPhoneNumber().getConfidence()); + System.out.printf("Total: %s confidence: %.2f%n", usReceipt.getTotal().getValue(), + usReceipt.getTotal().getConfidence()); + System.out.printf("Transaction Date: %s, confidence: %.2f%n", + usReceipt.getTransactionDate().getValue(), usReceipt.getTransactionDate().getConfidence()); + System.out.printf("Transaction Time: %s, confidence: %.2f%n", + usReceipt.getTransactionTime().getValue(), usReceipt.getTransactionTime().getConfidence()); + System.out.printf("Receipt Items: %n"); + usReceipt.getReceiptItems().forEach(receiptItem -> { + if (receiptItem.getName() != null) { + System.out.printf("Name: %s, confidence: %.2f%n", receiptItem.getName().getValue(), + receiptItem.getName().getConfidence()); + } + if (receiptItem.getQuantity() != null) { + System.out.printf("Quantity: %f, confidence: %.2f%n", receiptItem.getQuantity().getValue(), + receiptItem.getQuantity().getConfidence()); + } + if (receiptItem.getPrice() != null) { + System.out.printf("Price: %f, confidence: %.2f%n", receiptItem.getPrice().getValue(), + receiptItem.getPrice().getConfidence()); + } + if (receiptItem.getTotalPrice() != null) { + System.out.printf("Total Price: %f, confidence: %.2f%n", + receiptItem.getTotalPrice().getValue(), receiptItem.getTotalPrice().getConfidence()); + } + }); + System.out.print("-----------------------------------"); + } + } +} diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/src/test/java/com/azure/ai/formrecognizer/FieldValueTypeCastTest.java b/sdk/formrecognizer/azure-ai-formrecognizer/src/test/java/com/azure/ai/formrecognizer/FieldValueTypeCastTest.java new file mode 100644 index 0000000000000..1c74acbfcb934 --- /dev/null +++ b/sdk/formrecognizer/azure-ai-formrecognizer/src/test/java/com/azure/ai/formrecognizer/FieldValueTypeCastTest.java @@ -0,0 +1,429 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.ai.formrecognizer; + +import com.azure.ai.formrecognizer.models.FieldValueType; +import com.azure.ai.formrecognizer.models.FormField; +import org.junit.jupiter.api.Test; + +import java.time.LocalDate; +import java.time.LocalTime; +import java.time.format.DateTimeFormatter; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertThrows; + +public class FieldValueTypeCastTest { + + /** + * Test for {@link com.azure.ai.formrecognizer.models.FieldValueType#cast(FormField)} to Date. + */ + @Test + public void toDateFromDate() { + LocalDate inputDate = LocalDate.of(2006, 6, 6); + LocalDate actualDate = FieldValueType.DATE.cast(new FormField<>(0, null, null, + inputDate, null, FieldValueType.DATE)); + assertEquals(inputDate, actualDate); + } + + /** + * Test for {@link com.azure.ai.formrecognizer.models.FieldValueType#cast(FormField)} to Date from String. + */ + @Test + public void toDateFromString() { + String inputDateString = "2006/06/06"; + LocalDate inputDate = LocalDate.parse(inputDateString, DateTimeFormatter.ofPattern("yyyy/MM/dd")); + LocalDate actualDate = FieldValueType.DATE.cast(new FormField<>(0, null, null, + inputDateString, null, FieldValueType.STRING)); + assertEquals(inputDate, actualDate); + } + + /** + * Test for {@link com.azure.ai.formrecognizer.models.FieldValueType#cast(FormField)} to Date from null field value. + */ + @Test + public void toDateFromNull() { + assertNull(FieldValueType.DATE.cast(new FormField<>(0, null, null, + null, null, FieldValueType.STRING))); + } + + /** + * Test for {@link com.azure.ai.formrecognizer.models.FieldValueType#cast(FormField)} to Date from any other + * FieldValueType except for String. + */ + @Test + public void toDateFromPhoneNumber() { + final UnsupportedOperationException unsupportedOperationException = + assertThrows(UnsupportedOperationException.class, () -> + FieldValueType.DATE.cast(new FormField<>(0, null, null, + "19876543210", null, FieldValueType.PHONE_NUMBER))); + assertEquals(unsupportedOperationException.getMessage(), "Cannot cast from field value of " + + "type PHONE_NUMBER to type DATE"); + } + + /** + * Test for {@link com.azure.ai.formrecognizer.models.FieldValueType#cast(FormField)} to TIME. + */ + @Test + public void toTimeFromTime() { + LocalTime inputTime = LocalTime.parse("13:59:00", DateTimeFormatter.ofPattern("HH:mm:ss")); + LocalTime actualTime = FieldValueType.TIME.cast(new FormField<>(0, null, null, + inputTime, null, FieldValueType.TIME)); + assertEquals(inputTime, actualTime); + } + + /** + * Test for {@link com.azure.ai.formrecognizer.models.FieldValueType#cast(FormField)} to TIME from String. + */ + @Test + public void toTimeFromString() { + String inputTimeString = "13:59:00"; + LocalTime inputTime = LocalTime.parse(inputTimeString, DateTimeFormatter.ofPattern("HH:mm:ss")); + LocalTime actualTime = FieldValueType.TIME.cast(new FormField<>(0, null, null, + inputTimeString, null, FieldValueType.STRING)); + assertEquals(inputTime, actualTime); + } + + /** + * Test for {@link com.azure.ai.formrecognizer.models.FieldValueType#cast(FormField)} to TIME from null field value. + */ + @Test + public void toTimeFromNull() { + assertNull(FieldValueType.TIME.cast(new FormField<>(0, null, null, + null, null, FieldValueType.TIME))); + } + + /** + * Test for {@link com.azure.ai.formrecognizer.models.FieldValueType#cast(FormField)} to TIME from any other + * FieldValueType except for String. + */ + @Test + public void toTimeFromPhoneNumber() { + final UnsupportedOperationException unsupportedOperationException = + assertThrows(UnsupportedOperationException.class, () -> + FieldValueType.TIME.cast(new FormField<>(0, null, null, + "19876543210", null, FieldValueType.PHONE_NUMBER))); + assertEquals(unsupportedOperationException.getMessage(), "Cannot cast from field value of " + + "type PHONE_NUMBER to type TIME"); + } + + /** + * Test for {@link com.azure.ai.formrecognizer.models.FieldValueType#cast(FormField)} to list. + */ + @Test + public void toListFromList() { + List inputList = new ArrayList<>(Arrays.asList("1")); + List actualList = FieldValueType.LIST.cast(new FormField<>(0, null, null, + inputList, null, FieldValueType.LIST)); + assertEquals(inputList, actualList); + } + + /** + * Test for {@link com.azure.ai.formrecognizer.models.FieldValueType#cast(FormField)} to list from String. + */ + @Test + public void toListFromString() { + String listString = "1"; + final UnsupportedOperationException unsupportedOperationException = + assertThrows(UnsupportedOperationException.class, () -> + FieldValueType.LIST.cast(new FormField<>(0, null, null, + listString, null, FieldValueType.STRING))); + assertEquals(unsupportedOperationException.getMessage(), "Cannot cast from field value of " + + "type STRING to type LIST"); + } + + /** + * Test for {@link com.azure.ai.formrecognizer.models.FieldValueType#cast(FormField)} to list from null field value. + */ + @Test + public void toListFromNull() { + assertNull(FieldValueType.LIST.cast(new FormField<>(0, null, null, + null, null, FieldValueType.LIST))); + } + + /** + * Test for {@link com.azure.ai.formrecognizer.models.FieldValueType#cast(FormField)} to list from any other + * FieldValueType except for String. + */ + @Test + public void toListFromTime() { + LocalTime inputTime = LocalTime.parse("13:59:00", DateTimeFormatter.ofPattern("HH:mm:ss")); + final UnsupportedOperationException unsupportedOperationException = + assertThrows(UnsupportedOperationException.class, () -> + FieldValueType.LIST.cast(new FormField<>(0, null, null, + inputTime, null, FieldValueType.TIME))); + assertEquals(unsupportedOperationException.getMessage(), "Cannot cast from field value of " + + "type TIME to type LIST"); + } + + /** + * Test for {@link com.azure.ai.formrecognizer.models.FieldValueType#cast(FormField)} to phone number. + */ + @Test + public void toPhoneNumberFromPhoneNumber() { + String phoneNumber = "19876543210"; + String actualPhoneNumber = FieldValueType.PHONE_NUMBER.cast(new FormField<>(0, null, null, + phoneNumber, null, FieldValueType.PHONE_NUMBER)); + assertEquals(phoneNumber, actualPhoneNumber); + } + + /** + * Test for {@link com.azure.ai.formrecognizer.models.FieldValueType#cast(FormField)} to phone number from String. + */ + @Test + public void toPhoneNumberFromString() { + String phoneNumber = "19876543210"; + String actualPhoneNumber = FieldValueType.PHONE_NUMBER.cast(new FormField<>(0, null, null, + phoneNumber, null, FieldValueType.STRING)); + assertEquals(phoneNumber, actualPhoneNumber); + } + + /** + * Test for {@link com.azure.ai.formrecognizer.models.FieldValueType#cast(FormField)} to phone number from null field value. + */ + @Test + public void toPhoneNumberFromNull() { + assertNull(FieldValueType.PHONE_NUMBER.cast(new FormField<>(0, null, null, + null, null, FieldValueType.PHONE_NUMBER))); + } + + /** + * Test for {@link com.azure.ai.formrecognizer.models.FieldValueType#cast(FormField)} to phone number from any other + * FieldValueType except for String. + */ + @Test + public void toPhoneNumberFromTime() { + LocalTime inputTime = LocalTime.parse("13:59:00", DateTimeFormatter.ofPattern("HH:mm:ss")); + final UnsupportedOperationException unsupportedOperationException = + assertThrows(UnsupportedOperationException.class, () -> + FieldValueType.PHONE_NUMBER.cast(new FormField<>(0, null, null, + inputTime, null, FieldValueType.TIME))); + assertEquals(unsupportedOperationException.getMessage(), "Cannot cast from field value of " + + "type TIME to type PHONE_NUMBER"); + } + + /** + * Test for {@link com.azure.ai.formrecognizer.models.FieldValueType#cast(FormField)} to map. + */ + @Test + public void toMapFromMap() { + Map inputMap = Collections.singletonMap("key", "value"); + Map actualList = FieldValueType.MAP.cast(new FormField<>(0, null, null, + inputMap, null, FieldValueType.MAP)); + assertEquals(inputMap, actualList); + } + + /** + * Test for {@link com.azure.ai.formrecognizer.models.FieldValueType#cast(FormField)} to map from String. + */ + @Test + public void toMapFromString() { + String listString = "1"; + final UnsupportedOperationException unsupportedOperationException = + assertThrows(UnsupportedOperationException.class, () -> + FieldValueType.MAP.cast(new FormField<>(0, null, null, + listString, null, FieldValueType.STRING))); + assertEquals(unsupportedOperationException.getMessage(), "Cannot cast from field value of " + + "type STRING to type MAP"); + } + + /** + * Test for {@link com.azure.ai.formrecognizer.models.FieldValueType#cast(FormField)} to map from null field value. + */ + @Test + public void toMapFromNull() { + assertNull(FieldValueType.MAP.cast(new FormField<>(0, null, null, + null, null, FieldValueType.MAP))); + } + + /** + * Test for {@link com.azure.ai.formrecognizer.models.FieldValueType#cast(FormField)} to map from any other + * FieldValueType except for String. + */ + @Test + public void toMapFromTime() { + LocalTime inputTime = LocalTime.parse("13:59:00", DateTimeFormatter.ofPattern("HH:mm:ss")); + final UnsupportedOperationException unsupportedOperationException = + assertThrows(UnsupportedOperationException.class, () -> + FieldValueType.MAP.cast(new FormField<>(0, null, null, + inputTime, null, FieldValueType.TIME))); + assertEquals(unsupportedOperationException.getMessage(), "Cannot cast from field value of " + + "type TIME to type MAP"); + } + + /** + * Test for {@link com.azure.ai.formrecognizer.models.FieldValueType#cast(FormField)} to double. + */ + @Test + public void toDoubleFromDouble() { + Double inputDouble = 2.2; + Double actualDoubleValue = FieldValueType.DOUBLE.cast(new FormField<>(0, null, null, + inputDouble, null, FieldValueType.DOUBLE)); + assertEquals(inputDouble, actualDoubleValue); + } + + /** + * Test for {@link com.azure.ai.formrecognizer.models.FieldValueType#cast(FormField)} to double from String. + */ + @Test + public void toDoubleFromString() { + String doubleString = "2.2"; + Double actualDouble = FieldValueType.DOUBLE.cast(new FormField<>(0, null, null, + doubleString, null, FieldValueType.STRING)); + assertEquals(Double.valueOf(doubleString), actualDouble); + } + + /** + * Test for {@link com.azure.ai.formrecognizer.models.FieldValueType#cast(FormField)} to double from null field value. + */ + @Test + public void toDoubleFromNull() { + assertNull(FieldValueType.DOUBLE.cast(new FormField<>(0, null, null, + null, null, FieldValueType.DOUBLE))); + } + + /** + * Test for {@link com.azure.ai.formrecognizer.models.FieldValueType#cast(FormField)} to double from any other + * FieldValueType except for String. + */ + @Test + public void toDoubleFromTime() { + LocalTime inputTime = LocalTime.parse("13:59:00", DateTimeFormatter.ofPattern("HH:mm:ss")); + final UnsupportedOperationException unsupportedOperationException = + assertThrows(UnsupportedOperationException.class, () -> + FieldValueType.DOUBLE.cast(new FormField<>(0, null, null, + inputTime, null, FieldValueType.TIME))); + assertEquals(unsupportedOperationException.getMessage(), "Cannot cast from field value of " + + "type TIME to type DOUBLE"); + } + + /** + * Test for {@link com.azure.ai.formrecognizer.models.FieldValueType#cast(FormField)} to long. + */ + @Test + public void toLongFromLong() { + long inputDouble = 22; + Long actualLongValue = FieldValueType.LONG.cast(new FormField<>(0, null, null, + inputDouble, null, FieldValueType.LONG)); + assertEquals(inputDouble, actualLongValue); + } + + /** + * Test for {@link com.azure.ai.formrecognizer.models.FieldValueType#cast(FormField)} to long from String. + */ + @Test + public void toLongFromString() { + String inputDoubleString = "22"; + Long actualLongValue = FieldValueType.LONG.cast(new FormField<>(0, null, null, + inputDoubleString, null, FieldValueType.STRING)); + assertEquals(Long.valueOf(inputDoubleString), actualLongValue); + } + + /** + * Test for {@link com.azure.ai.formrecognizer.models.FieldValueType#cast(FormField)} to long from null field value. + */ + @Test + public void toLongFromNull() { + assertNull(FieldValueType.LONG.cast(new FormField<>(0, null, null, + null, null, FieldValueType.LONG))); + } + + /** + * Test for {@link com.azure.ai.formrecognizer.models.FieldValueType#cast(FormField)} to long from any other + * FieldValueType except for String. + */ + @Test + public void toLongFromTime() { + LocalTime inputTime = LocalTime.parse("13:59:00", DateTimeFormatter.ofPattern("HH:mm:ss")); + final UnsupportedOperationException unsupportedOperationException = + assertThrows(UnsupportedOperationException.class, () -> + FieldValueType.LONG.cast(new FormField<>(0, null, null, + inputTime, null, FieldValueType.TIME))); + assertEquals(unsupportedOperationException.getMessage(), "Cannot cast from field value of " + + "type TIME to type LONG"); + } + + /** + * Test for {@link com.azure.ai.formrecognizer.models.FieldValueType#cast(FormField)} to String from TIME. + */ + @Test + public void toStringFromTime() { + LocalTime inputTime = LocalTime.parse("13:59:00", DateTimeFormatter.ofPattern("HH:mm:ss")); + String localTimeString = FieldValueType.STRING.cast(new FormField<>(0, null, null, + inputTime, null, FieldValueType.TIME)); + assertEquals(inputTime.toString(), localTimeString); + } + + /** + * Test for {@link com.azure.ai.formrecognizer.models.FieldValueType#cast(FormField)} to String from String. + */ + @Test + public void toStringFromString() { + String stringValue = "String value"; + String actualStringValue = FieldValueType.STRING.cast(new FormField<>(0, null, null, + stringValue, null, FieldValueType.STRING)); + assertEquals(stringValue, actualStringValue); + } + + /** + * Test for {@link com.azure.ai.formrecognizer.models.FieldValueType#cast(FormField)} to String from double. + */ + @Test + public void toStringFromDouble() { + Double doubleValue = 2.2; + String actualDouble = FieldValueType.STRING.cast(new FormField<>(0, null, null, + doubleValue, null, FieldValueType.DOUBLE)); + assertEquals(String.valueOf(doubleValue), actualDouble); + } + + /** + * Test for {@link com.azure.ai.formrecognizer.models.FieldValueType#cast(FormField)} to long from String. + */ + @Test + public void toStringFromLong() { + Long inputLong = 22L; + String actualLongValue = FieldValueType.STRING.cast(new FormField<>(0, null, null, + inputLong, null, FieldValueType.LONG)); + assertEquals(String.valueOf(inputLong), actualLongValue); + } + + /** + * Test for {@link com.azure.ai.formrecognizer.models.FieldValueType#cast(FormField)} to String from Map. + */ + @Test + public void toStringFromMap() { + Map inputMap = Collections.singletonMap("key", "value"); + String stringMap = FieldValueType.STRING.cast(new FormField<>(0, null, null, + inputMap, null, FieldValueType.MAP)); + assertEquals(inputMap.toString(), stringMap); + } + + /** + * Test for {@link com.azure.ai.formrecognizer.models.FieldValueType#cast(FormField)} to String from Phone number. + */ + @Test + public void toStringFromPhoneNumber() { + String phoneNumber = "19876543210"; + String actualPhoneNumber = FieldValueType.STRING.cast(new FormField<>(0, null, null, + phoneNumber, null, FieldValueType.PHONE_NUMBER)); + assertEquals(phoneNumber, actualPhoneNumber); + } + + /** + * Test for {@link com.azure.ai.formrecognizer.models.FieldValueType#cast(FormField)} to String from List. + */ + @Test + public void toStringFromList() { + List inputList = Collections.singletonList("1"); + String actualStringList = FieldValueType.STRING.cast(new FormField<>(0, null, null, + inputList, null, FieldValueType.LIST)); + assertEquals(inputList.toString(), actualStringList); + } +} diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/src/test/java/com/azure/ai/formrecognizer/FormRecognizerAsyncClientTest.java b/sdk/formrecognizer/azure-ai-formrecognizer/src/test/java/com/azure/ai/formrecognizer/FormRecognizerAsyncClientTest.java index 4a63846663ef5..5aa35327f249c 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/src/test/java/com/azure/ai/formrecognizer/FormRecognizerAsyncClientTest.java +++ b/sdk/formrecognizer/azure-ai-formrecognizer/src/test/java/com/azure/ai/formrecognizer/FormRecognizerAsyncClientTest.java @@ -11,7 +11,6 @@ import com.azure.ai.formrecognizer.models.OperationResult; import com.azure.ai.formrecognizer.models.RecognizeOptions; import com.azure.ai.formrecognizer.models.RecognizedForm; -import com.azure.ai.formrecognizer.models.RecognizedReceipt; import com.azure.ai.formrecognizer.training.FormTrainingAsyncClient; import com.azure.core.exception.HttpResponseException; import com.azure.core.http.HttpClient; @@ -78,7 +77,7 @@ private FormTrainingAsyncClient getFormTrainingAsyncClient(HttpClient httpClient public void recognizeReceiptData(HttpClient httpClient, FormRecognizerServiceVersion serviceVersion) { client = getFormRecognizerAsyncClient(httpClient, serviceVersion); receiptDataRunner((data, dataLength) -> { - SyncPoller> syncPoller = + SyncPoller> syncPoller = client.beginRecognizeReceipts(toFluxByteBuffer(data), dataLength, new RecognizeOptions() .setContentType(FormContentType.IMAGE_JPEG).setPollInterval(durationTestMode)) .getSyncPoller(); @@ -108,7 +107,7 @@ public void recognizeReceiptDataWithContentTypeAutoDetection(HttpClient httpClie FormRecognizerServiceVersion serviceVersion) { client = getFormRecognizerAsyncClient(httpClient, serviceVersion); - SyncPoller> syncPoller = client.beginRecognizeReceipts( + SyncPoller> syncPoller = client.beginRecognizeReceipts( getReplayableBufferData(RECEIPT_LOCAL_URL), RECEIPT_FILE_LENGTH, new RecognizeOptions() .setPollInterval(durationTestMode)).getSyncPoller(); @@ -124,7 +123,7 @@ public void recognizeReceiptDataWithContentTypeAutoDetection(HttpClient httpClie public void recognizeReceiptDataIncludeFieldElements(HttpClient httpClient, FormRecognizerServiceVersion serviceVersion) { client = getFormRecognizerAsyncClient(httpClient, serviceVersion); receiptDataRunnerFieldElements((data, includeFieldElements) -> { - SyncPoller> syncPoller = client.beginRecognizeReceipts( + SyncPoller> syncPoller = client.beginRecognizeReceipts( toFluxByteBuffer(data), RECEIPT_FILE_LENGTH, new RecognizeOptions() .setContentType(FormContentType.IMAGE_JPEG).setIncludeFieldElements(includeFieldElements) .setPollInterval(durationTestMode)).getSyncPoller(); @@ -142,7 +141,7 @@ public void recognizeReceiptDataWithPngFile(HttpClient httpClient, FormRecognizerServiceVersion serviceVersion) { client = getFormRecognizerAsyncClient(httpClient, serviceVersion); receiptPngDataRunnerFieldElements((data, includeFieldElements) -> { - SyncPoller> syncPoller = + SyncPoller> syncPoller = client.beginRecognizeReceipts(toFluxByteBuffer(data), RECEIPT_PNG_FILE_LENGTH, new RecognizeOptions() .setContentType(FormContentType.IMAGE_PNG).setIncludeFieldElements(includeFieldElements) .setPollInterval(durationTestMode)).getSyncPoller(); @@ -160,7 +159,7 @@ public void recognizeReceiptDataWithBlankPdf(HttpClient httpClient, FormRecognizerServiceVersion serviceVersion) { client = getFormRecognizerAsyncClient(httpClient, serviceVersion); blankPdfDataRunner((data, dataLength) -> { - SyncPoller> syncPoller = + SyncPoller> syncPoller = client.beginRecognizeReceipts(toFluxByteBuffer(data), dataLength, new RecognizeOptions() .setContentType(FormContentType.APPLICATION_PDF).setPollInterval(durationTestMode)) .getSyncPoller(); @@ -174,7 +173,7 @@ public void recognizeReceiptDataWithBlankPdf(HttpClient httpClient, public void recognizeReceiptFromDataMultiPage(HttpClient httpClient, FormRecognizerServiceVersion serviceVersion) { client = getFormRecognizerAsyncClient(httpClient, serviceVersion); multipageFromDataRunner((data, dataLength) -> { - SyncPoller> syncPoller = client.beginRecognizeReceipts( + SyncPoller> syncPoller = client.beginRecognizeReceipts( toFluxByteBuffer(data), dataLength, new RecognizeOptions() .setContentType(FormContentType.APPLICATION_PDF).setPollInterval(durationTestMode)) .getSyncPoller(); @@ -193,7 +192,7 @@ public void recognizeReceiptFromDataMultiPage(HttpClient httpClient, FormRecogni public void recognizeReceiptSourceUrl(HttpClient httpClient, FormRecognizerServiceVersion serviceVersion) { client = getFormRecognizerAsyncClient(httpClient, serviceVersion); receiptSourceUrlRunner(sourceUrl -> { - SyncPoller> syncPoller = + SyncPoller> syncPoller = client.beginRecognizeReceiptsFromUrl(sourceUrl).getSyncPoller(); syncPoller.waitForCompletion(); validateReceiptResultData(syncPoller.getFinalResult(), false); @@ -227,7 +226,7 @@ public void recognizeReceiptFromUrlIncludeFieldElements(HttpClient httpClient, FormRecognizerServiceVersion serviceVersion) { client = getFormRecognizerAsyncClient(httpClient, serviceVersion); receiptSourceUrlRunnerFieldElements((sourceUrl, includeFieldElements) -> { - SyncPoller> syncPoller = client.beginRecognizeReceiptsFromUrl( + SyncPoller> syncPoller = client.beginRecognizeReceiptsFromUrl( sourceUrl, new RecognizeOptions().setIncludeFieldElements(includeFieldElements) .setPollInterval(durationTestMode)).getSyncPoller(); syncPoller.waitForCompletion(); @@ -245,7 +244,7 @@ public void recognizeReceiptSourceUrlWithPngFile(HttpClient httpClient, FormRecognizerServiceVersion serviceVersion) { client = getFormRecognizerAsyncClient(httpClient, serviceVersion); receiptPngSourceUrlRunnerFieldElements((sourceUrl, includeFieldElements) -> { - SyncPoller> syncPoller = client.beginRecognizeReceiptsFromUrl( + SyncPoller> syncPoller = client.beginRecognizeReceiptsFromUrl( sourceUrl, new RecognizeOptions().setIncludeFieldElements(includeFieldElements) .setPollInterval(durationTestMode)) .getSyncPoller(); @@ -259,7 +258,7 @@ sourceUrl, new RecognizeOptions().setIncludeFieldElements(includeFieldElements) public void recognizeReceiptFromUrlMultiPage(HttpClient httpClient, FormRecognizerServiceVersion serviceVersion) { client = getFormRecognizerAsyncClient(httpClient, serviceVersion); multipageFromUrlRunner(fileUrl -> { - SyncPoller> syncPoller = client.beginRecognizeReceiptsFromUrl( + SyncPoller> syncPoller = client.beginRecognizeReceiptsFromUrl( fileUrl, new RecognizeOptions().setPollInterval(durationTestMode)).getSyncPoller(); syncPoller.waitForCompletion(); validateMultipageReceiptData(syncPoller.getFinalResult()); diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/src/test/java/com/azure/ai/formrecognizer/FormRecognizerClientTest.java b/sdk/formrecognizer/azure-ai-formrecognizer/src/test/java/com/azure/ai/formrecognizer/FormRecognizerClientTest.java index 860e06541abfb..ca8741c86814d 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/src/test/java/com/azure/ai/formrecognizer/FormRecognizerClientTest.java +++ b/sdk/formrecognizer/azure-ai-formrecognizer/src/test/java/com/azure/ai/formrecognizer/FormRecognizerClientTest.java @@ -11,7 +11,6 @@ import com.azure.ai.formrecognizer.models.OperationResult; import com.azure.ai.formrecognizer.models.RecognizeOptions; import com.azure.ai.formrecognizer.models.RecognizedForm; -import com.azure.ai.formrecognizer.models.RecognizedReceipt; import com.azure.ai.formrecognizer.training.FormTrainingClient; import com.azure.core.exception.HttpResponseException; import com.azure.core.http.HttpClient; @@ -63,7 +62,7 @@ private FormTrainingClient getFormTrainingClient(HttpClient httpClient, public void recognizeReceiptData(HttpClient httpClient, FormRecognizerServiceVersion serviceVersion) { client = getFormRecognizerClient(httpClient, serviceVersion); receiptDataRunner((data, dataLength) -> { - SyncPoller> syncPoller = + SyncPoller> syncPoller = client.beginRecognizeReceipts(data, dataLength, new RecognizeOptions() .setContentType(FormContentType.IMAGE_JPEG).setPollInterval(durationTestMode)); syncPoller.waitForCompletion(); @@ -91,7 +90,7 @@ public void recognizeReceiptDataNullData(HttpClient httpClient, public void recognizeReceiptDataWithContentTypeAutoDetection(HttpClient httpClient, FormRecognizerServiceVersion serviceVersion) { client = getFormRecognizerClient(httpClient, serviceVersion); - SyncPoller> syncPoller = client.beginRecognizeReceipts( + SyncPoller> syncPoller = client.beginRecognizeReceipts( getContentDetectionFileData(RECEIPT_LOCAL_URL), RECEIPT_FILE_LENGTH, new RecognizeOptions() .setPollInterval(durationTestMode)); syncPoller.waitForCompletion(); @@ -107,7 +106,7 @@ public void recognizeReceiptDataWithContentTypeAutoDetection(HttpClient httpClie public void recognizeReceiptDataIncludeFieldElements(HttpClient httpClient, FormRecognizerServiceVersion serviceVersion) { client = getFormRecognizerClient(httpClient, serviceVersion); receiptDataRunnerFieldElements((data, includeFieldElements) -> { - SyncPoller> syncPoller = client.beginRecognizeReceipts( + SyncPoller> syncPoller = client.beginRecognizeReceipts( data, RECEIPT_FILE_LENGTH, new RecognizeOptions().setContentType(FormContentType.IMAGE_JPEG) .setIncludeFieldElements(includeFieldElements).setPollInterval(durationTestMode)); syncPoller.waitForCompletion(); @@ -124,7 +123,7 @@ public void recognizeReceiptDataWithPngFile(HttpClient httpClient, FormRecognizerServiceVersion serviceVersion) { client = getFormRecognizerClient(httpClient, serviceVersion); receiptPngDataRunnerFieldElements((data, includeFieldElements) -> { - SyncPoller> syncPoller = + SyncPoller> syncPoller = client.beginRecognizeReceipts(data, RECEIPT_PNG_FILE_LENGTH, new RecognizeOptions().setContentType( FormContentType.IMAGE_PNG).setIncludeFieldElements(includeFieldElements) .setPollInterval(durationTestMode)); @@ -142,7 +141,7 @@ public void recognizeReceiptDataWithBlankPdf(HttpClient httpClient, FormRecognizerServiceVersion serviceVersion) { client = getFormRecognizerClient(httpClient, serviceVersion); blankPdfDataRunner((data, dataLength) -> { - SyncPoller> syncPoller = client.beginRecognizeReceipts( + SyncPoller> syncPoller = client.beginRecognizeReceipts( data, dataLength, new RecognizeOptions().setContentType(FormContentType.APPLICATION_PDF) .setPollInterval(durationTestMode)); syncPoller.waitForCompletion(); @@ -155,7 +154,7 @@ data, dataLength, new RecognizeOptions().setContentType(FormContentType.APPLICAT public void recognizeReceiptFromDataMultiPage(HttpClient httpClient, FormRecognizerServiceVersion serviceVersion) { client = getFormRecognizerClient(httpClient, serviceVersion); multipageFromDataRunner((data, dataLength) -> { - SyncPoller> syncPoller = client.beginRecognizeReceipts( + SyncPoller> syncPoller = client.beginRecognizeReceipts( data, dataLength, new RecognizeOptions().setContentType(FormContentType.APPLICATION_PDF) .setPollInterval(durationTestMode)); syncPoller.waitForCompletion(); @@ -173,7 +172,7 @@ data, dataLength, new RecognizeOptions().setContentType(FormContentType.APPLICAT public void recognizeReceiptSourceUrl(HttpClient httpClient, FormRecognizerServiceVersion serviceVersion) { client = getFormRecognizerClient(httpClient, serviceVersion); receiptSourceUrlRunner((sourceUrl) -> { - SyncPoller> syncPoller = + SyncPoller> syncPoller = client.beginRecognizeReceiptsFromUrl(sourceUrl); syncPoller.waitForCompletion(); validateReceiptResultData(syncPoller.getFinalResult(), false); @@ -202,7 +201,7 @@ public void recognizeReceiptFromUrlIncludeFieldElements(HttpClient httpClient, FormRecognizerServiceVersion serviceVersion) { client = getFormRecognizerClient(httpClient, serviceVersion); receiptSourceUrlRunnerFieldElements((sourceUrl, includeFieldElements) -> { - SyncPoller> syncPoller = client.beginRecognizeReceiptsFromUrl( + SyncPoller> syncPoller = client.beginRecognizeReceiptsFromUrl( sourceUrl, new RecognizeOptions().setIncludeFieldElements(includeFieldElements) .setPollInterval(durationTestMode)); syncPoller.waitForCompletion(); @@ -220,7 +219,7 @@ public void recognizeReceiptSourceUrlWithPngFile(HttpClient httpClient, FormRecognizerServiceVersion serviceVersion) { client = getFormRecognizerClient(httpClient, serviceVersion); receiptPngSourceUrlRunnerFieldElements((sourceUrl, includeFieldElements) -> { - SyncPoller> syncPoller = client.beginRecognizeReceiptsFromUrl( + SyncPoller> syncPoller = client.beginRecognizeReceiptsFromUrl( sourceUrl, new RecognizeOptions().setIncludeFieldElements(includeFieldElements) .setPollInterval(durationTestMode)); @@ -234,7 +233,7 @@ public void recognizeReceiptSourceUrlWithPngFile(HttpClient httpClient, public void recognizeReceiptFromUrlMultiPage(HttpClient httpClient, FormRecognizerServiceVersion serviceVersion) { client = getFormRecognizerClient(httpClient, serviceVersion); multipageFromUrlRunner(receiptUrl -> { - SyncPoller> syncPoller = client.beginRecognizeReceiptsFromUrl( + SyncPoller> syncPoller = client.beginRecognizeReceiptsFromUrl( receiptUrl, new RecognizeOptions().setPollInterval(durationTestMode)); syncPoller.waitForCompletion(); validateMultipageReceiptData(syncPoller.getFinalResult()); @@ -411,7 +410,7 @@ public void recognizeCustomFormLabeledDataWithJpgContentType(HttpClient httpClie beginTrainingLabeledRunner((trainingFilesUrl, useTrainingLabels) -> { SyncPoller trainingPoller = getFormTrainingClient(httpClient, serviceVersion).beginTraining(trainingFilesUrl, useTrainingLabels, - null, durationTestMode); + null, durationTestMode); trainingPoller.waitForCompletion(); SyncPoller> syncPoller = client.beginRecognizeCustomForms( diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/src/test/java/com/azure/ai/formrecognizer/FormRecognizerClientTestBase.java b/sdk/formrecognizer/azure-ai-formrecognizer/src/test/java/com/azure/ai/formrecognizer/FormRecognizerClientTestBase.java index 31c0cf01d6330..4fa322aff7449 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/src/test/java/com/azure/ai/formrecognizer/FormRecognizerClientTestBase.java +++ b/sdk/formrecognizer/azure-ai-formrecognizer/src/test/java/com/azure/ai/formrecognizer/FormRecognizerClientTestBase.java @@ -16,6 +16,7 @@ import com.azure.ai.formrecognizer.implementation.models.TextLine; import com.azure.ai.formrecognizer.implementation.models.TextWord; import com.azure.ai.formrecognizer.models.BoundingBox; +import com.azure.ai.formrecognizer.models.FieldValueType; import com.azure.ai.formrecognizer.models.FormElement; import com.azure.ai.formrecognizer.models.FormField; import com.azure.ai.formrecognizer.models.FormLine; @@ -26,7 +27,6 @@ import com.azure.ai.formrecognizer.models.FormWord; import com.azure.ai.formrecognizer.models.Point; import com.azure.ai.formrecognizer.models.RecognizedForm; -import com.azure.ai.formrecognizer.models.RecognizedReceipt; import com.azure.ai.formrecognizer.training.FormTrainingClientBuilder; import com.azure.core.credential.AzureKeyCredential; import com.azure.core.http.HttpClient; @@ -253,7 +253,8 @@ private static void validateBoundingBoxData(List expectedBoundingBox, Bou } } - private static void validateFieldValueTransforms(FieldValue expectedFieldValue, FormField actualFormField, + @SuppressWarnings("unchecked") + private static void validateFieldValueTransforms(FieldValue expectedFieldValue, FormField actualFormField, List readResults, boolean includeFieldElements) { if (expectedFieldValue != null) { if (expectedFieldValue.getBoundingBox() != null) { @@ -266,35 +267,35 @@ private static void validateFieldValueTransforms(FieldValue expectedFieldValue, } switch (expectedFieldValue.getType()) { case NUMBER: - assertEquals(expectedFieldValue.getValueNumber(), actualFormField.getFieldValue().asFloat()); + assertEquals(expectedFieldValue.getValueNumber(), FieldValueType.DOUBLE.cast(actualFormField)); break; case DATE: - assertEquals(expectedFieldValue.getValueDate(), actualFormField.getFieldValue().asDate()); + assertEquals(expectedFieldValue.getValueDate(), FieldValueType.DATE.cast(actualFormField)); break; case TIME: assertEquals(LocalTime.parse(expectedFieldValue.getValueTime(), - DateTimeFormatter.ofPattern("HH:mm:ss")), actualFormField.getFieldValue().asTime()); + DateTimeFormatter.ofPattern("HH:mm:ss")), FieldValueType.TIME.cast(actualFormField)); break; case STRING: - assertEquals(expectedFieldValue.getValueString(), actualFormField.getFieldValue().asString()); + assertEquals(expectedFieldValue.getValueString(), FieldValueType.STRING.cast(actualFormField)); break; case INTEGER: - assertEquals(expectedFieldValue.getValueInteger(), actualFormField.getFieldValue().asInteger()); + assertEquals(expectedFieldValue.getValueInteger(), FieldValueType.LONG.cast(actualFormField)); break; case PHONE_NUMBER: - assertEquals(expectedFieldValue.getValuePhoneNumber(), actualFormField.getFieldValue().asPhoneNumber()); + assertEquals(expectedFieldValue.getValuePhoneNumber(), FieldValueType.PHONE_NUMBER.cast(actualFormField)); break; case OBJECT: expectedFieldValue.getValueObject().forEach((key, fieldValue) -> { - FormField actualFormFieldValue = actualFormField.getFieldValue().asMap().get(key); + FormField actualFormFieldValue = ((Map>) actualFormField.getValue()).get(key); validateFieldValueTransforms(fieldValue, actualFormFieldValue, readResults, includeFieldElements); }); break; case ARRAY: - assertEquals(expectedFieldValue.getValueArray().size(), actualFormField.getFieldValue().asList().size()); + assertEquals(expectedFieldValue.getValueArray().size(), ((List>) actualFormField.getValue()).size()); for (int i = 0; i < expectedFieldValue.getValueArray().size(); i++) { FieldValue expectedReceiptItem = expectedFieldValue.getValueArray().get(i); - FormField actualReceiptItem = actualFormField.getFieldValue().asList().get(i); + FormField actualReceiptItem = ((List>) actualFormField.getValue()).get(i); validateFieldValueTransforms(expectedReceiptItem, actualReceiptItem, readResults, includeFieldElements); } break; @@ -492,14 +493,14 @@ abstract void recognizeCustomFormUrlMultiPageLabeled(HttpClient httpClient, FormRecognizerServiceVersion serviceVersion); // Receipt - void validateReceiptDataFields(Map actualRecognizedReceiptFields, boolean includeFieldElements) { + void validateReceiptDataFields(Map> actualRecognizedReceiptFields, boolean includeFieldElements) { final AnalyzeResult analyzeResult = getAnalyzeRawResponse().getAnalyzeResult(); List readResults = analyzeResult.getReadResults(); DocumentResult documentResult = analyzeResult.getDocumentResults().get(0); Map expectedReceiptFields = documentResult.getFields(); assertEquals(expectedReceiptFields.get("ReceiptType").getValueString(), - actualRecognizedReceiptFields.get("ReceiptType").getFieldValue().asString()); + FieldValueType.STRING.cast(actualRecognizedReceiptFields.get("ReceiptType"))); assertEquals(expectedReceiptFields.get("ReceiptType").getConfidence(), actualRecognizedReceiptFields.get("ReceiptType").getConfidence()); validateFieldValueTransforms(expectedReceiptFields.get("MerchantName"), @@ -547,20 +548,20 @@ void validateContentResultData(List actualFormPageList, boolean includ } } - void validateReceiptResultData(List actualReceiptList, boolean includeFieldElements) { + void validateReceiptResultData(List actualReceiptList, boolean includeFieldElements) { final AnalyzeResult rawResponse = getAnalyzeRawResponse().getAnalyzeResult(); for (int i = 0; i < actualReceiptList.size(); i++) { - final RecognizedReceipt actualReceipt = actualReceiptList.get(i); - validateLabeledData(actualReceipt.getRecognizedForm(), includeFieldElements, rawResponse.getReadResults(), + final RecognizedForm actualReceipt = actualReceiptList.get(i); + validateLabeledData(actualReceipt, includeFieldElements, rawResponse.getReadResults(), rawResponse.getDocumentResults().get(i)); - validateReceiptDataFields(actualReceipt.getRecognizedForm().getFields(), includeFieldElements); + validateReceiptDataFields(actualReceipt.getFields(), includeFieldElements); } } - void validateBlankPdfResultData(List actualReceiptList) { + void validateBlankPdfResultData(List actualReceiptList) { assertEquals(1, actualReceiptList.size()); - final RecognizedReceipt actualReceipt = actualReceiptList.get(0); - assertTrue(actualReceipt.getRecognizedForm().getFields().isEmpty()); + final RecognizedForm actualReceipt = actualReceiptList.get(0); + assertTrue(actualReceipt.getFields().isEmpty()); } void validateRecognizedResult(List actualFormList, boolean includeFieldElements, @@ -697,7 +698,7 @@ private void validateUnLabeledResult(RecognizedForm actualForm, boolean includeF validatePageRangeData(expectedPage.getPage(), actualForm.getFormPageRange()); for (int i = 0; i < expectedPage.getKeyValuePairs().size(); i++) { final KeyValuePair expectedFormField = expectedPage.getKeyValuePairs().get(i); - final FormField actualFormField = actualForm.getFields().get("field-" + i); + final FormField actualFormField = actualForm.getFields().get("field-" + i); assertEquals(expectedFormField.getConfidence(), actualFormField.getConfidence()); assertEquals(expectedFormField.getKey().getText(), actualFormField.getLabelData().getText()); validateBoundingBoxData(expectedFormField.getKey().getBoundingBox(), @@ -720,7 +721,7 @@ private void validateLabeledData(RecognizedForm actualForm, boolean includeField assertEquals(documentResult.getPageRange().get(0), actualForm.getFormPageRange().getFirstPageNumber()); assertEquals(documentResult.getPageRange().get(1), actualForm.getFormPageRange().getLastPageNumber()); documentResult.getFields().forEach((label, expectedFieldValue) -> { - final FormField actualFormField = actualForm.getFields().get(label); + final FormField actualFormField = actualForm.getFields().get(label); assertEquals(label, actualFormField.getName()); if (expectedFieldValue != null) { if (expectedFieldValue.getConfidence() != null) { @@ -741,7 +742,7 @@ static void validateMultiPageDataLabeled(List actualRecognizedFo assertEquals(3, recognizedForm.getPages().size()); recognizedForm.getFields().forEach((label, formField) -> { assertNotNull(formField.getName()); - assertNotNull(formField.getFieldValue()); + assertNotNull(formField.getValue()); assertNotNull(formField.getValueData().getText()); assertNotNull(formField.getLabelData().getText()); }); @@ -751,34 +752,35 @@ static void validateMultiPageDataLabeled(List actualRecognizedFo static void validateMultiPageDataUnlabeled(List actualRecognizedFormsList) { actualRecognizedFormsList.forEach(recognizedForm -> { assertNotNull(recognizedForm.getFormType()); - assertEquals(1, recognizedForm.getPages().stream().count()); + assertEquals(1, (long) recognizedForm.getPages().size()); recognizedForm.getFields().forEach((label, formField) -> { assertNotNull(formField.getName()); - assertNotNull(formField.getFieldValue()); + assertNotNull(formField.getValue()); assertNotNull(formField.getValueData().getText()); assertNotNull(formField.getLabelData().getText()); + }); }); } - static void validateMultipageReceiptData(List recognizedReceipts) { + static void validateMultipageReceiptData(List recognizedReceipts) { assertEquals(3, recognizedReceipts.size()); - RecognizedForm receiptPage1 = recognizedReceipts.get(0).getRecognizedForm(); - RecognizedForm receiptPage2 = recognizedReceipts.get(1).getRecognizedForm(); - RecognizedForm receiptPage3 = recognizedReceipts.get(2).getRecognizedForm(); + RecognizedForm receiptPage1 = recognizedReceipts.get(0); + RecognizedForm receiptPage2 = recognizedReceipts.get(1); + RecognizedForm receiptPage3 = recognizedReceipts.get(2); assertEquals(1, receiptPage1.getFormPageRange().getFirstPageNumber()); assertEquals(1, receiptPage1.getFormPageRange().getLastPageNumber()); - Map receiptPage1Fields = receiptPage1.getFields(); + Map> receiptPage1Fields = receiptPage1.getFields(); assertEquals(EXPECTED_MULTIPAGE_ADDRESS_VALUE, receiptPage1Fields.get("MerchantAddress") - .getFieldValue().asString()); + .getValue()); assertEquals("Bilbo Baggins", receiptPage1Fields.get("MerchantName") - .getFieldValue().asString()); + .getValue()); assertEquals(EXPECTED_MULTIPAGE_PHONE_NUMBER_VALUE, receiptPage1Fields.get("MerchantPhoneNumber") - .getFieldValue().asPhoneNumber()); - assertNotNull(receiptPage1Fields.get("Total").getFieldValue().asFloat()); + .getValue()); + assertNotNull(receiptPage1Fields.get("Total").getValue()); assertNotNull(receiptPage1.getPages()); - assertEquals(ITEMIZED_RECEIPT_VALUE, receiptPage1Fields.get("ReceiptType").getFieldValue().asString()); + assertEquals(ITEMIZED_RECEIPT_VALUE, receiptPage1Fields.get("ReceiptType").getValue()); // Assert no fields, tables and lines on second page assertEquals(0, receiptPage2.getFields().size()); @@ -791,18 +793,15 @@ static void validateMultipageReceiptData(List recognizedRecei assertEquals(3, receiptPage3.getFormPageRange().getFirstPageNumber()); assertEquals(3, receiptPage3.getFormPageRange().getLastPageNumber()); - Map receiptPage3Fields = receiptPage3.getFields(); - assertEquals(EXPECTED_MULTIPAGE_ADDRESS_VALUE, receiptPage3Fields.get("MerchantAddress") - .getFieldValue().asString()); - assertEquals("Frodo Baggins", receiptPage3Fields.get("MerchantName") - .getFieldValue().asString()); - assertEquals(EXPECTED_MULTIPAGE_PHONE_NUMBER_VALUE, receiptPage3Fields.get("MerchantPhoneNumber") - .getFieldValue().asPhoneNumber()); - assertNotNull(receiptPage3Fields.get("Total").getFieldValue().asFloat()); + Map> receiptPage3Fields = receiptPage3.getFields(); + assertEquals(EXPECTED_MULTIPAGE_ADDRESS_VALUE, FieldValueType.STRING.cast(receiptPage3Fields.get("MerchantAddress"))); + assertEquals("Frodo Baggins", FieldValueType.STRING.cast(receiptPage3Fields.get("MerchantName"))); + assertEquals(EXPECTED_MULTIPAGE_PHONE_NUMBER_VALUE, FieldValueType.PHONE_NUMBER.cast(receiptPage3Fields.get("MerchantPhoneNumber"))); + assertNotNull(receiptPage3Fields.get("Total").getValue()); // why isn't tip returned by service? // total value 1000 returned by service but should be 4300, service bug - assertEquals(3000.0f, receiptPage3Fields.get("Subtotal").getFieldValue().asFloat()); - assertEquals(ITEMIZED_RECEIPT_VALUE, receiptPage3Fields.get("ReceiptType").getFieldValue().asString()); + assertEquals(3000.0f, (Float) receiptPage3Fields.get("Subtotal").getValue()); + assertEquals(ITEMIZED_RECEIPT_VALUE, FieldValueType.STRING.cast(receiptPage3Fields.get("ReceiptType"))); } protected String getEndpoint() { diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/src/test/java/com/azure/ai/formrecognizer/FormTrainingAsyncClientTest.java b/sdk/formrecognizer/azure-ai-formrecognizer/src/test/java/com/azure/ai/formrecognizer/FormTrainingAsyncClientTest.java index 7d660cffb838b..804537d907f11 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/src/test/java/com/azure/ai/formrecognizer/FormTrainingAsyncClientTest.java +++ b/sdk/formrecognizer/azure-ai-formrecognizer/src/test/java/com/azure/ai/formrecognizer/FormTrainingAsyncClientTest.java @@ -12,7 +12,7 @@ import com.azure.ai.formrecognizer.models.FormRecognizerException; import com.azure.ai.formrecognizer.models.OperationResult; import com.azure.ai.formrecognizer.models.RecognizeOptions; -import com.azure.ai.formrecognizer.models.RecognizedReceipt; +import com.azure.ai.formrecognizer.models.RecognizedForm; import com.azure.ai.formrecognizer.models.TrainingFileFilter; import com.azure.ai.formrecognizer.training.FormTrainingAsyncClient; import com.azure.core.exception.HttpResponseException; @@ -70,7 +70,7 @@ void getFormRecognizerClientAndValidate(HttpClient httpClient, FormRecognizerSer FormRecognizerAsyncClient formRecognizerClient = getFormTrainingAsyncClient(httpClient, serviceVersion) .getFormRecognizerAsyncClient(); blankPdfDataRunner(data -> { - SyncPoller> syncPoller = + SyncPoller> syncPoller = formRecognizerClient.beginRecognizeReceipts(toFluxByteBuffer(data), BLANK_FORM_FILE_LENGTH, new RecognizeOptions() .setContentType(FormContentType.APPLICATION_PDF) diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/src/test/java/com/azure/ai/formrecognizer/FormTrainingClientTest.java b/sdk/formrecognizer/azure-ai-formrecognizer/src/test/java/com/azure/ai/formrecognizer/FormTrainingClientTest.java index beb6aa4bd0fd6..340889097b86c 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/src/test/java/com/azure/ai/formrecognizer/FormTrainingClientTest.java +++ b/sdk/formrecognizer/azure-ai-formrecognizer/src/test/java/com/azure/ai/formrecognizer/FormTrainingClientTest.java @@ -13,7 +13,7 @@ import com.azure.ai.formrecognizer.models.FormRecognizerException; import com.azure.ai.formrecognizer.models.OperationResult; import com.azure.ai.formrecognizer.models.RecognizeOptions; -import com.azure.ai.formrecognizer.models.RecognizedReceipt; +import com.azure.ai.formrecognizer.models.RecognizedForm; import com.azure.ai.formrecognizer.models.TrainingFileFilter; import com.azure.ai.formrecognizer.training.FormTrainingClient; import com.azure.core.exception.HttpResponseException; @@ -55,7 +55,7 @@ public void getFormRecognizerClientAndValidate(HttpClient httpClient, FormRecogn FormRecognizerClient formRecognizerClient = getFormTrainingClient(httpClient, serviceVersion) .getFormRecognizerClient(); blankPdfDataRunner(data -> { - SyncPoller> syncPoller = + SyncPoller> syncPoller = formRecognizerClient.beginRecognizeReceipts(data, BLANK_FORM_FILE_LENGTH, new RecognizeOptions() .setContentType(FormContentType.APPLICATION_PDF).setPollInterval(durationTestMode)); syncPoller.waitForCompletion(); diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/src/test/java/com/azure/ai/formrecognizer/FormTrainingClientTestBase.java b/sdk/formrecognizer/azure-ai-formrecognizer/src/test/java/com/azure/ai/formrecognizer/FormTrainingClientTestBase.java index cc3ed0e43fd8e..3ce2fd70e2a59 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/src/test/java/com/azure/ai/formrecognizer/FormTrainingClientTestBase.java +++ b/sdk/formrecognizer/azure-ai-formrecognizer/src/test/java/com/azure/ai/formrecognizer/FormTrainingClientTestBase.java @@ -12,7 +12,7 @@ import com.azure.ai.formrecognizer.models.CustomFormSubmodel; import com.azure.ai.formrecognizer.models.ErrorInformation; import com.azure.ai.formrecognizer.models.FormRecognizerError; -import com.azure.ai.formrecognizer.models.RecognizedReceipt; +import com.azure.ai.formrecognizer.models.RecognizedForm; import com.azure.ai.formrecognizer.models.TrainingDocumentInfo; import com.azure.ai.formrecognizer.training.FormTrainingClientBuilder; import com.azure.core.credential.AzureKeyCredential; @@ -348,10 +348,10 @@ String getEndpoint() { : Configuration.getGlobalConfiguration().get(AZURE_FORM_RECOGNIZER_ENDPOINT); } - void validateBlankPdfResultData(List actualReceiptList) { + void validateBlankPdfResultData(List actualReceiptList) { assertEquals(1, actualReceiptList.size()); - final RecognizedReceipt actualReceipt = actualReceiptList.get(0); - assertTrue(actualReceipt.getRecognizedForm().getFields().isEmpty()); + final RecognizedForm actualReceipt = actualReceiptList.get(0); + assertTrue(actualReceipt.getFields().isEmpty()); } void blankPdfDataRunner(Consumer testRunner) { From 2fc46dc42aaa576ea9589b9bfb6f5e4e0d3ecd89 Mon Sep 17 00:00:00 2001 From: Azure SDK Bot <53356347+azure-sdk@users.noreply.github.com> Date: Mon, 6 Jul 2020 14:53:04 -0700 Subject: [PATCH 021/129] Sync eng/common directory with azure-sdk-tools repository (#12738) --- eng/common/pipelines/templates/steps/verify-changelog.yml | 2 +- eng/common/scripts/create-tags-and-git-release.ps1 | 1 - eng/common/scripts/modules/ChangeLog-Operations.psm1 | 5 ++--- eng/common/scripts/modules/Package-Properties.psm1 | 2 +- 4 files changed, 4 insertions(+), 6 deletions(-) diff --git a/eng/common/pipelines/templates/steps/verify-changelog.yml b/eng/common/pipelines/templates/steps/verify-changelog.yml index 914adcc660e8e..f6005124a87f3 100644 --- a/eng/common/pipelines/templates/steps/verify-changelog.yml +++ b/eng/common/pipelines/templates/steps/verify-changelog.yml @@ -21,5 +21,5 @@ steps: -ForRelease $${{ parameters.ForRelease }} pwsh: true workingDirectory: $(Pipeline.Workspace) - displayName: Verify ChangeLog / Release Notes + displayName: Verify ChangeLogEntry for ${{ parameters.PackageName }} continueOnError: false \ No newline at end of file diff --git a/eng/common/scripts/create-tags-and-git-release.ps1 b/eng/common/scripts/create-tags-and-git-release.ps1 index cec45536b7044..1667cddd7e22a 100644 --- a/eng/common/scripts/create-tags-and-git-release.ps1 +++ b/eng/common/scripts/create-tags-and-git-release.ps1 @@ -6,7 +6,6 @@ param ( # used by VerifyPackages $artifactLocation, # the root of the artifact folder. DevOps $(System.ArtifactsDirectory) $workingDirectory, # directory that package artifacts will be extracted into for examination (if necessary) - [ValidateSet("Nuget","NPM","PyPI","Maven")] $packageRepository, # used to indicate destination against which we will check the existing version. # valid options: PyPI, Nuget, NPM, Maven, C # used by CreateTags diff --git a/eng/common/scripts/modules/ChangeLog-Operations.psm1 b/eng/common/scripts/modules/ChangeLog-Operations.psm1 index 5c173876124ea..e92070b195b33 100644 --- a/eng/common/scripts/modules/ChangeLog-Operations.psm1 +++ b/eng/common/scripts/modules/ChangeLog-Operations.psm1 @@ -94,9 +94,8 @@ function Confirm-ChangeLogEntry { } if ($ForRelease -eq $True) { - $CurrentDate = Get-Date -Format "yyyy-MM-dd" - if ($changeLogEntry.ReleaseStatus -ne "($CurrentDate)") { - Write-Host ("##[warning]Incorrect Date: Please use the current date in the Changelog '{0}' before releasing the package" -f $ChangeLogLocation) + if ($changeLogEntry.ReleaseStatus -eq "(Unreleased)") { + Write-Host ("##[error]No release date set. Please set a release date with format 'yyyy-MM-dd' in the heading for version '{0}' in the changelog '{1}'." -f $VersionString, $ChangelogLocation) exit 1 } diff --git a/eng/common/scripts/modules/Package-Properties.psm1 b/eng/common/scripts/modules/Package-Properties.psm1 index 294f6609dab81..dca123f929f71 100644 --- a/eng/common/scripts/modules/Package-Properties.psm1 +++ b/eng/common/scripts/modules/Package-Properties.psm1 @@ -106,7 +106,7 @@ function Extract-PythonPkgProps ($pkgPath, $serviceName, $pkgName) { $setupLocation = $pkgPath.Replace('\','/') pushd $RepoRoot - $setupProps = (python -c "import scripts.devops_tasks.common_tasks; obj=scripts.devops_tasks.common_tasks.parse_setup('$setupLocation'); print('{0},{1}'.format(obj[0], obj[1]));") -split "," + $setupProps = (python -c "import sys; import os; sys.path.append(os.path.join('scripts', 'devops_tasks')); from common_tasks import parse_setup; obj=parse_setup('$setupLocation'); print('{0},{1}'.format(obj[0], obj[1]));") -split "," popd if (($setupProps -ne $null) -and ($setupProps[0] -eq $pkgName)) { From 714c26bbf69274c0c94cc9ad14b362abd24a298f Mon Sep 17 00:00:00 2001 From: Hemant Tanwar Date: Mon, 6 Jul 2020 14:55:19 -0700 Subject: [PATCH 022/129] Removing bridge API for reactor. (#12827) Co-authored-by: Hemant Tanwar --- .../ServiceBusReceiverAsyncClient.java | 28 -------------- ...ReceiverAsyncClientJavaDocCodeSamples.java | 30 --------------- ...BusReceiverAsyncClientIntegrationTest.java | 38 ------------------- 3 files changed, 96 deletions(-) diff --git a/sdk/servicebus/azure-messaging-servicebus/src/main/java/com/azure/messaging/servicebus/ServiceBusReceiverAsyncClient.java b/sdk/servicebus/azure-messaging-servicebus/src/main/java/com/azure/messaging/servicebus/ServiceBusReceiverAsyncClient.java index b75f2e01523f3..5206e8ab6c0ed 100644 --- a/sdk/servicebus/azure-messaging-servicebus/src/main/java/com/azure/messaging/servicebus/ServiceBusReceiverAsyncClient.java +++ b/sdk/servicebus/azure-messaging-servicebus/src/main/java/com/azure/messaging/servicebus/ServiceBusReceiverAsyncClient.java @@ -56,10 +56,6 @@ * other terminal scenarios. See {@link #receiveMessages()} for more information.

* {@codesnippet com.azure.messaging.servicebus.servicebusasyncreceiverclient.receive#all} * - *

Receive a maximum number of messages or until max a Duration

- *

This receives at most 15 messages, or until a duration of 30 seconds elapses. Whichever occurs first.

- * {@codesnippet com.azure.messaging.servicebus.servicebusasyncreceiverclient.receive#int-duration} - * *

Receive messages in {@link ReceiveMode#RECEIVE_AND_DELETE} mode from Service Bus resource

* {@codesnippet com.azure.messaging.servicebus.servicebusasyncreceiverclient.receiveWithReceiveAndDeleteMode} * @@ -886,30 +882,6 @@ public Flux receiveMessages() { } } - /** - * Receives a bounded stream of {@link ServiceBusReceivedMessage messages} from the Service Bus entity. This stream - * receives either {@code maxNumberOfMessages} are received or the {@code maxWaitTime} has elapsed. - * - * @param maxNumberOfMessages Maximum number of messages to receive. - * @param maxWaitTime Maximum time to wait. - * - * @return A bounded {@link Flux} of messages. - * @throws NullPointerException if {@code maxWaitTime} is null. - * @throws IllegalArgumentException if {@code maxNumberOfMessages} is less than 1. {@code maxWaitTime} is zero - * or a negative duration. - */ - public Flux receiveMessages(int maxNumberOfMessages, Duration maxWaitTime) { - if (maxNumberOfMessages < 1) { - return fluxError(logger, new IllegalArgumentException("'maxNumberOfMessages' cannot be less than 1.")); - } else if (maxWaitTime == null) { - return fluxError(logger, new NullPointerException("'maxWaitTime' cannot be null.")); - } else if (maxWaitTime.isNegative() || maxWaitTime.isZero()) { - return fluxError(logger, new NullPointerException("'maxWaitTime' cannot be negative or zero.")); - } - - return receiveMessages().take(maxNumberOfMessages).take(maxWaitTime); - } - /** * Receives a deferred {@link ServiceBusReceivedMessage message}. Deferred messages can only be received by using * sequence number. diff --git a/sdk/servicebus/azure-messaging-servicebus/src/samples/java/com/azure/messaging/servicebus/ServiceBusReceiverAsyncClientJavaDocCodeSamples.java b/sdk/servicebus/azure-messaging-servicebus/src/samples/java/com/azure/messaging/servicebus/ServiceBusReceiverAsyncClientJavaDocCodeSamples.java index 7dde0409d038c..4fa81a2c8c40d 100644 --- a/sdk/servicebus/azure-messaging-servicebus/src/samples/java/com/azure/messaging/servicebus/ServiceBusReceiverAsyncClientJavaDocCodeSamples.java +++ b/sdk/servicebus/azure-messaging-servicebus/src/samples/java/com/azure/messaging/servicebus/ServiceBusReceiverAsyncClientJavaDocCodeSamples.java @@ -11,7 +11,6 @@ import reactor.core.publisher.Mono; import java.util.Map; -import java.time.Duration; import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicReference; @@ -140,35 +139,6 @@ public void receiveAll() { // END: com.azure.messaging.servicebus.servicebusasyncreceiverclient.receive#all } - /** - * Receives messages up to a time or duration. - */ - public void receiveMaxTimeDuration() { - ServiceBusReceiverAsyncClient receiver = new ServiceBusClientBuilder() - .connectionString("fake-string") - .receiver() - .queueName("<< QUEUE NAME >>") - .buildAsyncClient(); - - // BEGIN: com.azure.messaging.servicebus.servicebusasyncreceiverclient.receive#int-duration - Disposable subscription = receiver.receiveMessages(15, Duration.ofSeconds(30)) - .flatMap(context -> { - ServiceBusReceivedMessage message = context.getMessage(); - System.out.printf("Received message id: %s%n", message.getMessageId()); - System.out.printf("Contents of message as string: %s%n", new String(message.getBody(), UTF_8)); - return receiver.complete(message.getLockToken()); - }).subscribe(aVoid -> System.out.println("Processed message."), - error -> System.out.println("Error occurred: " + error)); - - // subscribe is a non-blocking call and program flow will continue before messages are fetched. - // END: com.azure.messaging.servicebus.servicebusasyncreceiverclient.receive#int-duration - - // When program ends, or you're done receiving all messages. - subscription.dispose(); - - receiver.close(); - } - /** * Demonstrates how to create a session receiver for a single, first available session. */ diff --git a/sdk/servicebus/azure-messaging-servicebus/src/test/java/com/azure/messaging/servicebus/ServiceBusReceiverAsyncClientIntegrationTest.java b/sdk/servicebus/azure-messaging-servicebus/src/test/java/com/azure/messaging/servicebus/ServiceBusReceiverAsyncClientIntegrationTest.java index 9a5fcf5c67fff..823605ce32972 100644 --- a/sdk/servicebus/azure-messaging-servicebus/src/test/java/com/azure/messaging/servicebus/ServiceBusReceiverAsyncClientIntegrationTest.java +++ b/sdk/servicebus/azure-messaging-servicebus/src/test/java/com/azure/messaging/servicebus/ServiceBusReceiverAsyncClientIntegrationTest.java @@ -933,44 +933,6 @@ void setAndGetSessionState(MessagingEntityType entityType) { messagesPending.decrementAndGet(); } - @MethodSource("com.azure.messaging.servicebus.IntegrationTestBase#messagingEntityProvider") - @ParameterizedTest - void receivesByNumber(MessagingEntityType entityType) { - // Arrange - setSenderAndReceiver(entityType, TestUtils.USE_CASE_RECEIVE_BY_NUMBER, false); - - final String messageId = UUID.randomUUID().toString(); - final int number = 10; - final List messages = TestUtils.getServiceBusMessages(number, messageId, CONTENTS_BYTES); - - sendMessage(messages).block(Duration.ofSeconds(10)); - - // Act & Assert - StepVerifier.create(receiveAndDeleteReceiver.receiveMessages(messages.size(), Duration.ofSeconds(15)) - .doOnNext(next -> messagesPending.decrementAndGet())) - .expectNextCount(number) - .verifyComplete(); - } - - @MethodSource("com.azure.messaging.servicebus.IntegrationTestBase#messagingEntityProvider") - @ParameterizedTest - void receivesByTime(MessagingEntityType entityType) { - // Arrange - - setSenderAndReceiver(entityType, TestUtils.USE_CASE_RECEIVE_BY_TIME, false); - final String messageId = UUID.randomUUID().toString(); - final int number = 10; - final List messages = TestUtils.getServiceBusMessages(number, messageId, CONTENTS_BYTES); - - sendMessage(messages).block(Duration.ofSeconds(15)); - - // Act & Assert - StepVerifier.create(receiveAndDeleteReceiver.receiveMessages(number + 10, Duration.ofSeconds(15)) - .doOnNext(next -> messagesPending.decrementAndGet())) - .expectNextCount(number) - .verifyComplete(); - } - /** * Verifies that we can receive a message from dead letter queue. */ From b730543a87f5690871d71b6273bd05634684cfa4 Mon Sep 17 00:00:00 2001 From: Kamil Sobol <61715331+kasobol-msft@users.noreply.github.com> Date: Mon, 6 Jul 2020 16:48:47 -0700 Subject: [PATCH 023/129] Fix single upload retry. (#12834) --- .../storage/common/implementation/PayloadSizeGate.java | 3 ++- .../storage/common/implementation/UploadUtils.java | 10 +++++++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/sdk/storage/azure-storage-common/src/main/java/com/azure/storage/common/implementation/PayloadSizeGate.java b/sdk/storage/azure-storage-common/src/main/java/com/azure/storage/common/implementation/PayloadSizeGate.java index ba8be907702cc..806fa97e54967 100644 --- a/sdk/storage/azure-storage-common/src/main/java/com/azure/storage/common/implementation/PayloadSizeGate.java +++ b/sdk/storage/azure-storage-common/src/main/java/com/azure/storage/common/implementation/PayloadSizeGate.java @@ -66,7 +66,8 @@ Flux write(ByteBuffer buf) { */ Flux flush() { if (byteBuffers != null) { - Flux result = dequeuingFlux(byteBuffers); + // We return Flux from iterable in this case to support retries on single upload. + Flux result = Flux.fromIterable(byteBuffers); byteBuffers = null; return result; } else { diff --git a/sdk/storage/azure-storage-common/src/main/java/com/azure/storage/common/implementation/UploadUtils.java b/sdk/storage/azure-storage-common/src/main/java/com/azure/storage/common/implementation/UploadUtils.java index 6c0611d3363b9..6c97ce64d2f0c 100644 --- a/sdk/storage/azure-storage-common/src/main/java/com/azure/storage/common/implementation/UploadUtils.java +++ b/sdk/storage/azure-storage-common/src/main/java/com/azure/storage/common/implementation/UploadUtils.java @@ -44,14 +44,18 @@ public static Mono> uploadFullOrChunked(final Flux d .filter(ByteBuffer::hasRemaining) // The gate buffers data until threshold is breached. .concatMap(gate::write) - .concatWith(Flux.defer(gate::flush)) // First buffer is emitted after threshold is breached or there's no more data. // Therefore we can make a decision how to upload data on first element. .switchOnFirst((signal, flux) -> { if (gate.isThresholdBreached()) { - return uploadInChunks.apply(flux); + // In this case we can pass a flux that can have just one subscriber because + // the chunked upload is going to cache the data downstream before sending chunks over the wire. + return uploadInChunks.apply(flux.concatWith(Flux.defer(gate::flush))); } else { - return uploadFull.apply(flux, gate.size()); + // In this case gate contains all the data cached. + // The flux passed to this lambda allows only one subscriber. Therefore we substitute it + // with flux coming from gate which is based of iterable and can be subscribed again. + return uploadFull.apply(gate.flush(), gate.size()); } }) .next() From 3d49736b20ffdf64be4a81a42965823279d350b6 Mon Sep 17 00:00:00 2001 From: Gauri Prasad <51212198+gapra-msft@users.noreply.github.com> Date: Mon, 6 Jul 2020 17:06:56 -0700 Subject: [PATCH 024/129] Fixes bug in buffered upload where data would be uploaded incorrectly if data did not fit exactly in the buffers (#12832) --- .../storage/common/implementation/UploadBufferPool.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sdk/storage/azure-storage-common/src/main/java/com/azure/storage/common/implementation/UploadBufferPool.java b/sdk/storage/azure-storage-common/src/main/java/com/azure/storage/common/implementation/UploadBufferPool.java index 96222f808bd7f..b4590afc123ec 100644 --- a/sdk/storage/azure-storage-common/src/main/java/com/azure/storage/common/implementation/UploadBufferPool.java +++ b/sdk/storage/azure-storage-common/src/main/java/com/azure/storage/common/implementation/UploadBufferPool.java @@ -112,10 +112,11 @@ public Flux write(ByteBuffer buf) { // We will overflow the current buffer and require another one. // Duplicate and adjust the window of buf so that we fill up currentBuf without going out of bounds. ByteBuffer duplicate = buf.duplicate(); - duplicate.limit(buf.position() + (int) this.currentBuf.remainingCapacity()); + int newLimit = buf.position() + (int) this.currentBuf.remainingCapacity(); + duplicate.limit(newLimit); this.currentBuf.append(duplicate); // Adjust the window of original buffer to represent remaining part. - buf.position(buf.position() + (int) this.currentBuf.remainingCapacity()); + buf.position(newLimit); result = Flux.just(this.currentBuf); From d8afe9cb25de6efd15a67c37c9cd2cd400505bea Mon Sep 17 00:00:00 2001 From: Weidong Xu Date: Tue, 7 Jul 2020 14:14:04 +0800 Subject: [PATCH 025/129] mgmt, add url to pom description (#12844) * add url to pom description * update wording --- sdk/management/README.md | 2 +- sdk/management/azure/pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sdk/management/README.md b/sdk/management/README.md index 58b701bf42106..874c196e932ac 100644 --- a/sdk/management/README.md +++ b/sdk/management/README.md @@ -4,7 +4,7 @@ The Azure Management Libraries for Java is a higher-level, object-oriented API f that is optimized for ease of use, succinctness and consistency. - [API reference documentation][docs] -- [Code snippets and samples][sample] +- **[Code snippets and samples][sample]** ## Getting started diff --git a/sdk/management/azure/pom.xml b/sdk/management/azure/pom.xml index 0fc16e5a2556e..47f5898756970 100644 --- a/sdk/management/azure/pom.xml +++ b/sdk/management/azure/pom.xml @@ -16,7 +16,7 @@ jar Microsoft Azure SDK - This package contains Microsoft Azure SDK. + This package contains Microsoft Azure SDK. For documentation on how to use this package, please see https://aka.ms/azure-sdk-java-mgmt https://github.com/Azure/azure-sdk-for-java From 467c9e71a007366709257d39bd58da67073ac816 Mon Sep 17 00:00:00 2001 From: Chuang <54572251+xccc-msft@users.noreply.github.com> Date: Tue, 7 Jul 2020 15:53:32 +0800 Subject: [PATCH 026/129] update link in AUTH.md (#12845) * update link in AUTH.md * update line number --- sdk/management/docs/AUTH.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sdk/management/docs/AUTH.md b/sdk/management/docs/AUTH.md index eaea25c97a46d..6207ef90c2ba7 100644 --- a/sdk/management/docs/AUTH.md +++ b/sdk/management/docs/AUTH.md @@ -61,13 +61,13 @@ AzureProfile profile = new AzureProfile("", " Date: Tue, 7 Jul 2020 15:55:00 +0800 Subject: [PATCH 027/129] mgmt resources fix TODOs (#12814) * mgmt resources fix TODOs * update logic of response handling * update mono error --- .../appservice/AppServiceTest.java | 23 +------ .../ExternalChildResourceImpl.java | 11 ---- .../policy/ProviderRegistrationPolicy.java | 1 - .../resources/fluentcore/utils/Utils.java | 63 +++++++++++++++---- .../resources/ResourceUtilsTests.java | 23 +++++-- 5 files changed, 72 insertions(+), 49 deletions(-) diff --git a/sdk/appservice/mgmt/src/test/java/com/azure/resourcemanager/appservice/AppServiceTest.java b/sdk/appservice/mgmt/src/test/java/com/azure/resourcemanager/appservice/AppServiceTest.java index 814bc570538f1..a7cfd3991bafd 100644 --- a/sdk/appservice/mgmt/src/test/java/com/azure/resourcemanager/appservice/AppServiceTest.java +++ b/sdk/appservice/mgmt/src/test/java/com/azure/resourcemanager/appservice/AppServiceTest.java @@ -34,11 +34,11 @@ import java.io.IOException; import java.io.InputStream; import java.net.MalformedURLException; -import java.net.URL; import java.nio.ByteBuffer; import java.nio.charset.StandardCharsets; import java.time.temporal.ChronoUnit; +import com.azure.resourcemanager.resources.fluentcore.utils.Utils; import org.apache.commons.net.ftp.FTP; import org.apache.commons.net.ftp.FTPClient; import org.junit.jupiter.api.Assertions; @@ -171,7 +171,7 @@ public static void uploadFileToWebApp(PublishingProfile profile, String fileName protected Response curl(String urlString) throws IOException { try { - return stringResponse(httpClient.getString(getHost(urlString), getPathAndQuery(urlString))).block(); + return stringResponse(httpClient.getString(Utils.getHost(urlString), Utils.getPathAndQuery(urlString))).block(); } catch (MalformedURLException e) { Assertions.fail(); return null; @@ -180,7 +180,7 @@ protected Response curl(String urlString) throws IOException { protected String post(String urlString, String body) { try { - return stringResponse(httpClient.postString(getHost(urlString), getPathAndQuery(urlString), body)) + return stringResponse(httpClient.postString(Utils.getHost(urlString), Utils.getPathAndQuery(urlString), body)) .block() .getValue(); } catch (Exception e) { @@ -201,23 +201,6 @@ private static Mono> stringResponse(Mono invokeTaskAsync(TaskGroup.InvocationContext context) { .doOnNext(createdExternalChild -> externalChild.setPendingOperation(PendingOperation.None)) .map(updatedExternalChild -> updatedExternalChild); case ToBeRemoved: - // With 2.0 runtime, deleteResourceAsync() will be - // returning 'Completable' then use below code instead - // - // return this.externalChild.deleteResourceAsync().doOnCompleted(new Action0() { - // @Override - // public void call() { - // externalChild.setPendingOperation(PendingOperation.None); - // } - // }).andThen(voidObservable()); - // - // TODO: Fix void mono result. return this.externalChild.deleteResourceAsync() .doOnSuccess(aVoid -> externalChild.setPendingOperation(PendingOperation.None)) .map(aVoid -> voidIndexable()); diff --git a/sdk/resources/mgmt/src/main/java/com/azure/resourcemanager/resources/fluentcore/policy/ProviderRegistrationPolicy.java b/sdk/resources/mgmt/src/main/java/com/azure/resourcemanager/resources/fluentcore/policy/ProviderRegistrationPolicy.java index 1943e854e7e41..ac8386bbaf5ea 100644 --- a/sdk/resources/mgmt/src/main/java/com/azure/resourcemanager/resources/fluentcore/policy/ProviderRegistrationPolicy.java +++ b/sdk/resources/mgmt/src/main/java/com/azure/resourcemanager/resources/fluentcore/policy/ProviderRegistrationPolicy.java @@ -66,7 +66,6 @@ public Mono process(HttpPipelineCallContext context, HttpPipelineN } if (cloudError != null && MISSING_SUBSCRIPTION_REGISTRATION.equals(cloudError.getCode())) { - // TODO: add proxy in rest client ResourceManager resourceManager = ResourceManager.authenticate(credential, profile) .withDefaultSubscription(); Pattern providerPattern = Pattern.compile(".*'(.*)'"); diff --git a/sdk/resources/mgmt/src/main/java/com/azure/resourcemanager/resources/fluentcore/utils/Utils.java b/sdk/resources/mgmt/src/main/java/com/azure/resourcemanager/resources/fluentcore/utils/Utils.java index 665ccaf4e6b03..3f33fafeabf40 100644 --- a/sdk/resources/mgmt/src/main/java/com/azure/resourcemanager/resources/fluentcore/utils/Utils.java +++ b/sdk/resources/mgmt/src/main/java/com/azure/resourcemanager/resources/fluentcore/utils/Utils.java @@ -4,19 +4,27 @@ package com.azure.resourcemanager.resources.fluentcore.utils; import com.azure.core.annotation.Get; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.ServiceInterface; import com.azure.core.http.HttpPipeline; import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; import com.azure.core.http.rest.PagedIterable; import com.azure.core.http.rest.RestProxy; +import com.azure.core.http.rest.SimpleResponse; import com.azure.core.management.AzureEnvironment; +import com.azure.core.util.FluxUtil; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.resources.fluentcore.arm.ResourceId; import com.azure.resourcemanager.resources.fluentcore.model.Indexable; import com.azure.resourcemanager.resources.models.Subscription; +import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; +import java.net.MalformedURLException; +import java.net.URL; +import java.nio.ByteBuffer; import java.util.ArrayList; import java.util.List; import java.util.Locale; @@ -115,20 +123,48 @@ public static Mono rootResource(Mono stream) * Download a file asynchronously. * * @param url the URL pointing to the file - * @param retrofit the retrofit client + * @param httpPipeline the http pipeline * @return an Observable pointing to the content of the file */ + public static Mono downloadFileAsync(String url, HttpPipeline httpPipeline) { + FileService service = RestProxy.create(FileService.class, httpPipeline); + try { + return service.download(getHost(url), getPathAndQuery(url)) + .flatMap(response -> FluxUtil.collectBytesInByteBufferStream(response.getValue())); + } catch (MalformedURLException ex) { + return Mono.error(() -> ex); + } + } + /** - * Download a file asynchronously. + * Get host from url. * - * @param url the URL pointing to the file - * @param retrofit the retrofit client - * @return an Observable pointing to the content of the file + * @param urlString the url string + * @return the host + * @throws MalformedURLException when url is invalid format */ - public static Mono downloadFileAsync(String url, HttpPipeline retrofit) { - FileService service = RestProxy.create(FileService.class, retrofit); - Mono response = service.download(url); - return response.flatMap(httpResponse -> httpResponse.getBodyAsByteArray()); + public static String getHost(String urlString) throws MalformedURLException { + URL url = new URL(urlString); + String protocol = url.getProtocol(); + String host = url.getAuthority(); + return protocol + "://" + host; + } + + /** + * Get path from url. + * + * @param urlString the url string + * @return the path + * @throws MalformedURLException when the url is invalid format + */ + public static String getPathAndQuery(String urlString) throws MalformedURLException { + URL url = new URL(urlString); + String path = url.getPath(); + String query = url.getQuery(); + if (query != null && !query.isEmpty()) { + path = path + "?" + query; + } + return path; } /** @@ -185,9 +221,12 @@ public static String resourceGroupId(String id) { /** * A Retrofit service used to download a file. */ + @Host("{$host}") + @ServiceInterface(name = "FileService") private interface FileService { - @Get("{url}") - Mono download(@PathParam("url") String url); + @Get("{path}") + Mono>> download( + @HostParam("$host") String host, @PathParam(value = "path", encoded = true) String path); } /** diff --git a/sdk/resources/mgmt/src/test/java/com/azure/resourcemanager/resources/ResourceUtilsTests.java b/sdk/resources/mgmt/src/test/java/com/azure/resourcemanager/resources/ResourceUtilsTests.java index 677803cd12336..651898b9150dc 100644 --- a/sdk/resources/mgmt/src/test/java/com/azure/resourcemanager/resources/ResourceUtilsTests.java +++ b/sdk/resources/mgmt/src/test/java/com/azure/resourcemanager/resources/ResourceUtilsTests.java @@ -3,12 +3,20 @@ package com.azure.resourcemanager.resources; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpPipelineBuilder; +import com.azure.core.http.policy.HttpLogDetailLevel; +import com.azure.core.http.policy.HttpLogOptions; +import com.azure.core.http.policy.HttpLoggingPolicy; +import com.azure.core.http.policy.RetryPolicy; import com.azure.core.management.AzureEnvironment; import com.azure.resourcemanager.resources.fluentcore.arm.ResourceUtils; import com.azure.resourcemanager.resources.fluentcore.utils.Utils; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; +import java.time.temporal.ChronoUnit; + public class ResourceUtilsTests { @Test public void canExtractGroupFromId() throws Exception { @@ -39,11 +47,16 @@ public void canExtractRelativePathFromId() throws Exception { @Test public void canDownloadFile() throws Exception { - // TODO(not known): Fix this -// RestProxy retrofit = new RestProxyBuilder().baseUrl("http://microsoft.com").addCallAdapterFactory(RxJavaCallAdapterFactory.create()).build(); -// byte[] content = Utils.downloadFileAsync("http://google.com/humans.txt", retrofit).toBlocking().single(); -// String contentString = new String(content); -// Assertions.assertNotNull(contentString); + HttpPipeline httpPipeline = new HttpPipelineBuilder() + .policies( + new HttpLoggingPolicy(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BODY_AND_HEADERS)), + new RetryPolicy("Retry-After", ChronoUnit.SECONDS) + ) + .build(); + byte[] content = Utils.downloadFileAsync("https://www.google.com/humans.txt", httpPipeline).block(); + String contentString = new String(content); + Assertions.assertNotNull(contentString); + Assertions.assertTrue(contentString.startsWith("Google is built by a large team of engineers,")); } @Test From 00e50966a47fef126fe9ac3a29b1b9a678f5ff42 Mon Sep 17 00:00:00 2001 From: Annie Liang <64233642+xinlian12@users.noreply.github.com> Date: Tue, 7 Jul 2020 07:29:22 -0700 Subject: [PATCH 028/129] Cache refresh for container recreate with same id (#12747) * fix for delete and recreate collection with same name Co-authored-by: Annie Liang --- .../implementation/BackoffRetryUtility.java | 12 + .../InvalidPartitionExceptionRetryPolicy.java | 11 +- .../implementation/ObservableHelper.java | 17 + .../implementation/RxDocumentClientImpl.java | 38 +- .../azure/cosmos/AzureKeyCredentialTest.java | 22 +- ...osContainerContentResponseOnWriteTest.java | 13 - .../com/azure/cosmos/CosmosContainerTest.java | 17 +- .../CosmosItemContentResponseOnWriteTest.java | 14 - .../azure/cosmos/rx/CollectionCrudTest.java | 13 - ...ContainerCreateDeleteWithSameNameTest.java | 354 ++++++++++++++++++ ...QueryTest.java => ContainerQueryTest.java} | 57 +-- .../com/azure/cosmos/rx/TestSuiteBase.java | 8 +- 12 files changed, 468 insertions(+), 108 deletions(-) create mode 100644 sdk/cosmos/azure-cosmos/src/test/java/com/azure/cosmos/rx/ContainerCreateDeleteWithSameNameTest.java rename sdk/cosmos/azure-cosmos/src/test/java/com/azure/cosmos/rx/{CollectionQueryTest.java => ContainerQueryTest.java} (67%) diff --git a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/BackoffRetryUtility.java b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/BackoffRetryUtility.java index f57eeec24e2f2..6a9d496ccbc80 100644 --- a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/BackoffRetryUtility.java +++ b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/BackoffRetryUtility.java @@ -2,6 +2,7 @@ // Licensed under the MIT License. package com.azure.cosmos.implementation; +import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; import java.time.Duration; @@ -38,6 +39,17 @@ static public Mono executeRetry(Callable> callbackMethod, }).retryWhen(RetryUtils.toRetryWhenFunc(retryPolicy)); } + static public Flux fluxExecuteRetry(Callable> callbackMethod, IRetryPolicy retryPolicy) { + + return Flux.defer(() -> { + try { + return callbackMethod.call(); + } catch (Exception e) { + return Flux.error(e); + } + }).retryWhen(RetryUtils.toRetryWhenFunc(retryPolicy)); + } + static public Mono executeAsync( Function, Mono> callbackMethod, IRetryPolicy retryPolicy, Function, Mono> inBackoffAlternateCallbackMethod, diff --git a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/InvalidPartitionExceptionRetryPolicy.java b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/InvalidPartitionExceptionRetryPolicy.java index 4c05f78ed8434..5083b6210aac9 100644 --- a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/InvalidPartitionExceptionRetryPolicy.java +++ b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/InvalidPartitionExceptionRetryPolicy.java @@ -41,7 +41,9 @@ public InvalidPartitionExceptionRetryPolicy(RxCollectionCache collectionCache, @Override public void onBeforeSendRequest(RxDocumentServiceRequest request) { this.request = request; - this.nextPolicy.onBeforeSendRequest(request); + if (this.nextPolicy != null) { + this.nextPolicy.onBeforeSendRequest(request); + } } @Override @@ -56,7 +58,7 @@ public Mono shouldRetry(Exception e) { // TODO: this is blocking. is that fine? if(this.cosmosQueryRequestOptions != null) { this.clientCollectionCache.refresh( - BridgeInternal.getMetaDataDiagnosticContext(this.request.requestContext.cosmosDiagnostics), + this.request != null ? BridgeInternal.getMetaDataDiagnosticContext(this.request.requestContext.cosmosDiagnostics) : null, collectionLink, ModelBridgeInternal.getPropertiesFromQueryRequestOptions(this.cosmosQueryRequestOptions)); } else { @@ -73,6 +75,9 @@ public Mono shouldRetry(Exception e) { } } - return this.nextPolicy.shouldRetry(e); + if (this.nextPolicy != null) { + return this.nextPolicy.shouldRetry(e); + } + return Mono.just(ShouldRetryResult.error(e)); } } diff --git a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/ObservableHelper.java b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/ObservableHelper.java index 91309bb3e0b2b..2865eb351370d 100644 --- a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/ObservableHelper.java +++ b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/ObservableHelper.java @@ -44,4 +44,21 @@ static public Mono inlineIfPossibleAsObs(Callable> function, IRet return BackoffRetryUtility.executeRetry(() -> function.call(), retryPolicy); } } + + static public Flux fluxInlineIfPossibleAsObs(Callable> function, IRetryPolicy retryPolicy) { + + if (retryPolicy == null) { + // shortcut + return Flux.defer(() -> { + try { + return function.call(); + } catch (Exception e) { + return Flux.error(e); + } + }); + + } else { + return BackoffRetryUtility.fluxExecuteRetry(() -> function.call(), retryPolicy); + } + } } diff --git a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/RxDocumentClientImpl.java b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/RxDocumentClientImpl.java index 152da0570689c..a004f7ab68bc5 100644 --- a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/RxDocumentClientImpl.java +++ b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/RxDocumentClientImpl.java @@ -560,18 +560,42 @@ private String parentResourceLinkToQueryLink(String parentResouceLink, ResourceT } private Flux> createQuery( - String parentResourceLink, + String parentResourceLink, + SqlQuerySpec sqlQuery, + CosmosQueryRequestOptions options, + Class klass, + ResourceType resourceTypeEnum) { + + String resourceLink = parentResourceLinkToQueryLink(parentResourceLink, resourceTypeEnum); + UUID activityId = Utils.randomUUID(); + IDocumentQueryClient queryClient = documentQueryClientImpl(RxDocumentClientImpl.this); + + // Trying to put this logic as low as the query pipeline + // Since for parallelQuery, each partition will have its own request, so at this point, there will be no request associate with this retry policy. + // For default document context, it already wired up InvalidPartitionExceptionRetry, but there is no harm to wire it again here + InvalidPartitionExceptionRetryPolicy invalidPartitionExceptionRetryPolicy = new InvalidPartitionExceptionRetryPolicy( + this.collectionCache, + null, + resourceLink, + options); + + return ObservableHelper.fluxInlineIfPossibleAsObs( + () -> createQueryInternal(resourceLink, sqlQuery, options, klass, resourceTypeEnum, queryClient, activityId), + invalidPartitionExceptionRetryPolicy); + } + + private Flux> createQueryInternal( + String resourceLink, SqlQuerySpec sqlQuery, CosmosQueryRequestOptions options, Class klass, - ResourceType resourceTypeEnum) { + ResourceType resourceTypeEnum, + IDocumentQueryClient queryClient, + UUID activityId) { - String queryResourceLink = parentResourceLinkToQueryLink(parentResourceLink, resourceTypeEnum); - - UUID activityId = Utils.randomUUID(); - IDocumentQueryClient queryClient = documentQueryClientImpl(RxDocumentClientImpl.this); Flux> executionContext = - DocumentQueryExecutionContextFactory.createDocumentQueryExecutionContextAsync(queryClient, resourceTypeEnum, klass, sqlQuery , options, queryResourceLink, false, activityId); + DocumentQueryExecutionContextFactory.createDocumentQueryExecutionContextAsync(queryClient, resourceTypeEnum, klass, sqlQuery , options, resourceLink, false, activityId); + return executionContext.flatMap(iDocumentQueryExecutionContext -> { QueryInfo queryInfo = null; if (iDocumentQueryExecutionContext instanceof PipelinedDocumentQueryExecutionContext) { diff --git a/sdk/cosmos/azure-cosmos/src/test/java/com/azure/cosmos/AzureKeyCredentialTest.java b/sdk/cosmos/azure-cosmos/src/test/java/com/azure/cosmos/AzureKeyCredentialTest.java index 9e161fe0662e5..e8c80957fa06f 100644 --- a/sdk/cosmos/azure-cosmos/src/test/java/com/azure/cosmos/AzureKeyCredentialTest.java +++ b/sdk/cosmos/azure-cosmos/src/test/java/com/azure/cosmos/AzureKeyCredentialTest.java @@ -1,25 +1,24 @@ package com.azure.cosmos; -import com.azure.cosmos.implementation.InternalObjectNode; import com.azure.cosmos.implementation.FailureValidator; +import com.azure.cosmos.implementation.InternalObjectNode; import com.azure.cosmos.implementation.RetryAnalyzer; -import com.azure.cosmos.models.CosmosContainerResponse; -import com.azure.cosmos.models.CosmosDatabaseResponse; -import com.azure.cosmos.models.CosmosItemResponse; +import com.azure.cosmos.implementation.TestConfigurations; import com.azure.cosmos.models.CosmosContainerProperties; import com.azure.cosmos.models.CosmosContainerRequestOptions; +import com.azure.cosmos.models.CosmosContainerResponse; import com.azure.cosmos.models.CosmosDatabaseProperties; import com.azure.cosmos.models.CosmosDatabaseRequestOptions; +import com.azure.cosmos.models.CosmosDatabaseResponse; import com.azure.cosmos.models.CosmosItemRequestOptions; +import com.azure.cosmos.models.CosmosItemResponse; import com.azure.cosmos.models.CosmosResponse; import com.azure.cosmos.models.IndexingMode; import com.azure.cosmos.models.IndexingPolicy; import com.azure.cosmos.models.ModelBridgeInternal; import com.azure.cosmos.models.PartitionKey; -import com.azure.cosmos.models.PartitionKeyDefinition; import com.azure.cosmos.rx.CosmosItemResponseValidator; import com.azure.cosmos.rx.TestSuiteBase; -import com.azure.cosmos.implementation.TestConfigurations; import org.testng.annotations.AfterClass; import org.testng.annotations.AfterMethod; import org.testng.annotations.BeforeClass; @@ -65,17 +64,6 @@ public Object[][] crudArgProvider() { }; } - private CosmosContainerProperties getCollectionDefinition(String collectionName) { - PartitionKeyDefinition partitionKeyDef = new PartitionKeyDefinition(); - ArrayList paths = new ArrayList<>(); - paths.add("/mypk"); - partitionKeyDef.setPaths(paths); - - return new CosmosContainerProperties( - collectionName, - partitionKeyDef); - } - private InternalObjectNode getDocumentDefinition(String documentId) { final String uuid = UUID.randomUUID().toString(); return new InternalObjectNode(String.format("{ " diff --git a/sdk/cosmos/azure-cosmos/src/test/java/com/azure/cosmos/CosmosContainerContentResponseOnWriteTest.java b/sdk/cosmos/azure-cosmos/src/test/java/com/azure/cosmos/CosmosContainerContentResponseOnWriteTest.java index efaab4cdf95f7..c9c473d7ae75f 100644 --- a/sdk/cosmos/azure-cosmos/src/test/java/com/azure/cosmos/CosmosContainerContentResponseOnWriteTest.java +++ b/sdk/cosmos/azure-cosmos/src/test/java/com/azure/cosmos/CosmosContainerContentResponseOnWriteTest.java @@ -11,14 +11,12 @@ import com.azure.cosmos.models.CosmosContainerResponse; import com.azure.cosmos.models.IndexingMode; import com.azure.cosmos.models.IndexingPolicy; -import com.azure.cosmos.models.PartitionKeyDefinition; import com.azure.cosmos.rx.TestSuiteBase; import org.testng.annotations.AfterClass; import org.testng.annotations.BeforeClass; import org.testng.annotations.Factory; import org.testng.annotations.Test; -import java.util.ArrayList; import java.util.UUID; import static org.assertj.core.api.Assertions.assertThat; @@ -102,17 +100,6 @@ public void replaceContainer_withContentResponseOnWriteDisabled() throws Excepti } - private CosmosContainerProperties getCollectionDefinition(String collectionName) { - PartitionKeyDefinition partitionKeyDef = new PartitionKeyDefinition(); - ArrayList paths = new ArrayList(); - paths.add("/mypk"); - partitionKeyDef.setPaths(paths); - - return new CosmosContainerProperties( - collectionName, - partitionKeyDef); - } - private void validateContainerResponse(CosmosContainerProperties containerProperties, CosmosContainerResponse createResponse) { // Basic validation diff --git a/sdk/cosmos/azure-cosmos/src/test/java/com/azure/cosmos/CosmosContainerTest.java b/sdk/cosmos/azure-cosmos/src/test/java/com/azure/cosmos/CosmosContainerTest.java index 65970732ce53c..39c7f7f9d1292 100644 --- a/sdk/cosmos/azure-cosmos/src/test/java/com/azure/cosmos/CosmosContainerTest.java +++ b/sdk/cosmos/azure-cosmos/src/test/java/com/azure/cosmos/CosmosContainerTest.java @@ -6,17 +6,16 @@ package com.azure.cosmos; +import com.azure.cosmos.implementation.HttpConstants; import com.azure.cosmos.models.CosmosContainerProperties; import com.azure.cosmos.models.CosmosContainerRequestOptions; import com.azure.cosmos.models.CosmosContainerResponse; import com.azure.cosmos.models.CosmosQueryRequestOptions; import com.azure.cosmos.models.IndexingMode; import com.azure.cosmos.models.IndexingPolicy; -import com.azure.cosmos.models.PartitionKeyDefinition; import com.azure.cosmos.models.SqlQuerySpec; import com.azure.cosmos.models.ThroughputProperties; import com.azure.cosmos.rx.TestSuiteBase; -import com.azure.cosmos.implementation.HttpConstants; import com.azure.cosmos.util.CosmosPagedIterable; import org.testng.annotations.AfterClass; import org.testng.annotations.BeforeClass; @@ -24,7 +23,6 @@ import org.testng.annotations.Factory; import org.testng.annotations.Test; -import java.util.ArrayList; import java.util.UUID; import static org.assertj.core.api.Assertions.assertThat; @@ -53,19 +51,6 @@ public void afterClass() { safeCloseSyncClient(client); } - private CosmosContainerProperties getCollectionDefinition(String collectionName) { - PartitionKeyDefinition partitionKeyDef = new PartitionKeyDefinition(); - ArrayList paths = new ArrayList(); - paths.add("/mypk"); - partitionKeyDef.setPaths(paths); - - CosmosContainerProperties collectionDefinition = new CosmosContainerProperties( - collectionName, - partitionKeyDef); - - return collectionDefinition; - } - @Test(groups = { "emulator" }, timeOut = TIMEOUT) public void createContainer_withProperties() throws Exception { String collectionName = UUID.randomUUID().toString(); diff --git a/sdk/cosmos/azure-cosmos/src/test/java/com/azure/cosmos/CosmosItemContentResponseOnWriteTest.java b/sdk/cosmos/azure-cosmos/src/test/java/com/azure/cosmos/CosmosItemContentResponseOnWriteTest.java index 767d96aafc4c7..e4d0b96e2174e 100644 --- a/sdk/cosmos/azure-cosmos/src/test/java/com/azure/cosmos/CosmosItemContentResponseOnWriteTest.java +++ b/sdk/cosmos/azure-cosmos/src/test/java/com/azure/cosmos/CosmosItemContentResponseOnWriteTest.java @@ -7,19 +7,16 @@ package com.azure.cosmos; import com.azure.cosmos.implementation.InternalObjectNode; -import com.azure.cosmos.models.CosmosContainerProperties; import com.azure.cosmos.models.CosmosItemRequestOptions; import com.azure.cosmos.models.CosmosItemResponse; import com.azure.cosmos.models.ModelBridgeInternal; import com.azure.cosmos.models.PartitionKey; -import com.azure.cosmos.models.PartitionKeyDefinition; import com.azure.cosmos.rx.TestSuiteBase; import org.testng.annotations.AfterClass; import org.testng.annotations.BeforeClass; import org.testng.annotations.Factory; import org.testng.annotations.Test; -import java.util.ArrayList; import java.util.UUID; import static org.assertj.core.api.Assertions.assertThat; @@ -106,17 +103,6 @@ public void deleteItem_withContentResponseOnWriteDisabled() throws Exception { validateMinimalItemResponse(properties, deleteResponse, false); } - private CosmosContainerProperties getCollectionDefinition(String collectionName) { - PartitionKeyDefinition partitionKeyDef = new PartitionKeyDefinition(); - ArrayList paths = new ArrayList(); - paths.add("/mypk"); - partitionKeyDef.setPaths(paths); - - return new CosmosContainerProperties( - collectionName, - partitionKeyDef); - } - private InternalObjectNode getDocumentDefinition(String documentId) { final String uuid = UUID.randomUUID().toString(); final InternalObjectNode properties = diff --git a/sdk/cosmos/azure-cosmos/src/test/java/com/azure/cosmos/rx/CollectionCrudTest.java b/sdk/cosmos/azure-cosmos/src/test/java/com/azure/cosmos/rx/CollectionCrudTest.java index f2d660ce53ca2..1b05b05355b7d 100644 --- a/sdk/cosmos/azure-cosmos/src/test/java/com/azure/cosmos/rx/CollectionCrudTest.java +++ b/sdk/cosmos/azure-cosmos/src/test/java/com/azure/cosmos/rx/CollectionCrudTest.java @@ -70,19 +70,6 @@ public Object[][] collectionCrudArgProvider() { }; } - private CosmosContainerProperties getCollectionDefinition(String collectionName) { - PartitionKeyDefinition partitionKeyDef = new PartitionKeyDefinition(); - ArrayList paths = new ArrayList(); - paths.add("/mypk"); - partitionKeyDef.setPaths(paths); - - CosmosContainerProperties collectionDefinition = new CosmosContainerProperties( - collectionName, - partitionKeyDef); - - return collectionDefinition; - } - @Test(groups = { "emulator" }, timeOut = TIMEOUT, dataProvider = "collectionCrudArgProvider") public void createCollection(String collectionName) throws InterruptedException { CosmosContainerProperties collectionDefinition = getCollectionDefinition(collectionName); diff --git a/sdk/cosmos/azure-cosmos/src/test/java/com/azure/cosmos/rx/ContainerCreateDeleteWithSameNameTest.java b/sdk/cosmos/azure-cosmos/src/test/java/com/azure/cosmos/rx/ContainerCreateDeleteWithSameNameTest.java new file mode 100644 index 0000000000000..24380fcdb4f3a --- /dev/null +++ b/sdk/cosmos/azure-cosmos/src/test/java/com/azure/cosmos/rx/ContainerCreateDeleteWithSameNameTest.java @@ -0,0 +1,354 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.cosmos.rx; + +import com.azure.cosmos.ChangeFeedProcessor; +import com.azure.cosmos.ChangeFeedProcessorBuilder; +import com.azure.cosmos.CosmosAsyncClient; +import com.azure.cosmos.CosmosAsyncContainer; +import com.azure.cosmos.CosmosAsyncDatabase; +import com.azure.cosmos.CosmosClientBuilder; +import com.azure.cosmos.implementation.FeedResponseListValidator; +import com.azure.cosmos.implementation.Utils; +import com.azure.cosmos.models.ChangeFeedProcessorOptions; +import com.azure.cosmos.models.CosmosContainerProperties; +import com.azure.cosmos.models.CosmosContainerRequestOptions; +import com.azure.cosmos.models.CosmosItemRequestOptions; +import com.azure.cosmos.models.CosmosItemResponse; +import com.azure.cosmos.models.CosmosQueryRequestOptions; +import com.azure.cosmos.models.PartitionKey; +import com.azure.cosmos.util.CosmosPagedFlux; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; +import org.apache.commons.lang3.RandomStringUtils; +import org.testng.annotations.AfterClass; +import org.testng.annotations.BeforeClass; +import org.testng.annotations.Factory; +import org.testng.annotations.Test; +import reactor.core.publisher.Mono; +import reactor.core.scheduler.Schedulers; + +import java.time.Duration; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Random; +import java.util.UUID; +import java.util.concurrent.ConcurrentHashMap; +import java.util.function.BiConsumer; +import java.util.function.Consumer; + +import static org.assertj.core.api.Assertions.assertThat; + +public class ContainerCreateDeleteWithSameNameTest extends TestSuiteBase { + private final static int TIMEOUT = 300000; + // Delete collections in emulator is not instant, + // so to avoid get 500 back, we are adding delay for creating the collection with same name, since in this case we want to test 410/1000 + private final static int COLLECTION_RECREATION_TIME_DELAY = 2000; + private CosmosAsyncClient client; + private CosmosAsyncDatabase createdDatabase; + + @Factory(dataProvider = "clientBuildersWithSessionConsistency") + public ContainerCreateDeleteWithSameNameTest(CosmosClientBuilder clientBuilder) { + super(clientBuilder); + this.subscriberValidationTimeout = TIMEOUT; + } + + @Test(groups = {"emulator"}, timeOut = TIMEOUT) + public void query() throws Exception { + String query = "SELECT * FROM r"; + + Consumer func = (container) -> { + TestObject docDefinition = getDocumentDefinition(); + container.createItem(docDefinition).block(); + + CosmosQueryRequestOptions requestOptions = new CosmosQueryRequestOptions(); + CosmosPagedFlux queryFlux = container.queryItems(query, requestOptions, TestObject.class); + FeedResponseListValidator queryValidator = new FeedResponseListValidator.Builder() + .totalSize(1) + .numberOfPages(1) + .build(); + validateQuerySuccess(queryFlux.byPage(10), queryValidator); + }; + + createDeleteContainerWithSameName(func); + } + + @Test(groups = {"emulator"}, timeOut = TIMEOUT) + public void readItem() throws Exception { + + Consumer func = (container) -> { + TestObject docDefinition = getDocumentDefinition(); + container.createItem(docDefinition).block(); + + Mono> responseMono = container.readItem(docDefinition.getId(), + new PartitionKey(docDefinition.getMypk()), + new CosmosItemRequestOptions(), + TestObject.class); + + CosmosItemResponseValidator validator = + new CosmosItemResponseValidator.Builder>() + .withId(docDefinition.getId()) + .build(); + + this.validateItemSuccess(responseMono, validator); + }; + + createDeleteContainerWithSameName(func); + } + + @Test(groups = {"emulator"}, timeOut = TIMEOUT) + public void deleteItem() throws Exception { + + Consumer func = (container) -> { + TestObject docDefinition = getDocumentDefinition(); + container.createItem(docDefinition).block(); + + Mono> deleteObservable = container.deleteItem( + docDefinition.getId(), + new PartitionKey(docDefinition.getMypk()), + new CosmosItemRequestOptions()); + + CosmosItemResponseValidator validator = + new CosmosItemResponseValidator.Builder>() + .nullResource() + .build(); + this.validateItemSuccess(deleteObservable, validator); + }; + + createDeleteContainerWithSameName(func); + } + + @Test(groups = {"emulator"}, timeOut = TIMEOUT) + public void upsertItem() throws Exception { + + Consumer func = (container) -> { + TestObject docDefinition = getDocumentDefinition(); + docDefinition = container.createItem(docDefinition).block().getItem(); + + docDefinition.setProp(UUID.randomUUID().toString()); + + Mono> readObservable = container.upsertItem(docDefinition, new CosmosItemRequestOptions()); + + // Validate result + CosmosItemResponseValidator validator = + new CosmosItemResponseValidator.Builder>() + .withProperty("prop", docDefinition.getProp()) + .build(); + + this.validateItemSuccess(readObservable, validator); + }; + + createDeleteContainerWithSameName(func); + } + + @Test(groups = {"emulator"}, timeOut = TIMEOUT) + public void changeFeed() throws Exception { + + ObjectMapper objectMapper = Utils.getSimpleObjectMapper(); + BiConsumer func = (feedContainer, leaseContainer) -> { + String hostName = RandomStringUtils.randomAlphabetic(6); + int CHANGE_FEED_PROCESSOR_TIMEOUT = 5000; + final int FEED_COUNT = 5; + List createdDocuments = new ArrayList<>(); + Map receivedDocuments = new ConcurrentHashMap<>(); + + setupReadFeedDocuments(createdDocuments, feedContainer, FEED_COUNT); + + ChangeFeedProcessor changeFeedProcessor = new ChangeFeedProcessorBuilder() + .hostName(hostName) + .handleChanges((docs) -> { + for (JsonNode item : docs) { + try { + TestObject obj = objectMapper.treeToValue(item, TestObject.class); + receivedDocuments.put(obj.getId(), obj); + } catch (JsonProcessingException e) { + e.printStackTrace(); + } + } + }) + .feedContainer(feedContainer) + .leaseContainer(leaseContainer) + .options(new ChangeFeedProcessorOptions() + .setLeaseRenewInterval(Duration.ofSeconds(20)) + .setLeaseAcquireInterval(Duration.ofSeconds(10)) + .setLeaseExpirationInterval(Duration.ofSeconds(30)) + .setFeedPollDelay(Duration.ofSeconds(2)) + .setLeasePrefix("TEST") + .setMaxItemCount(10) + .setStartFromBeginning(true) + .setMaxScaleCount(0) // unlimited + ) + .buildChangeFeedProcessor(); + + try { + changeFeedProcessor.start().subscribeOn(Schedulers.elastic()) + .timeout(Duration.ofMillis(2 * CHANGE_FEED_PROCESSOR_TIMEOUT)) + .subscribe(); + } catch (Exception ex) { + throw ex; + } + + // Wait for the feed processor to receive and process the documents. + try { + Thread.sleep(2 * CHANGE_FEED_PROCESSOR_TIMEOUT); + assertThat(changeFeedProcessor.isStarted()).as("Change Feed Processor instance is running").isTrue(); + + long remainingWork = 2 * CHANGE_FEED_PROCESSOR_TIMEOUT; + while (remainingWork > 0 && receivedDocuments.size() < createdDocuments.size()) { + remainingWork -= 100; + Thread.sleep(100); + } + + assertThat(remainingWork >= 0).as("Failed to receive all the feed documents").isTrue(); + + changeFeedProcessor.stop().subscribeOn(Schedulers.elastic()).timeout(Duration.ofMillis(CHANGE_FEED_PROCESSOR_TIMEOUT)).subscribe(); + + // Wait for the feed processor to shutdown. + Thread.sleep(CHANGE_FEED_PROCESSOR_TIMEOUT); + + } catch (InterruptedException e) { + throw new RuntimeException("Interrupted exception", e); + } + }; + + changeFeedCreateDeleteContainerWithSameName(func); + } + + @BeforeClass(groups = {"emulator"}, timeOut = SETUP_TIMEOUT) + public void before_ContainerCreateDeleteWithSameNameTest() throws Exception { + client = getClientBuilder().buildAsyncClient(); + createdDatabase = getSharedCosmosDatabase(client); + } + + @AfterClass(groups = {"emulator"}, timeOut = SETUP_TIMEOUT) + public void after_ContainerCreateDeleteWithSameNameTest() throws Exception { + safeDeleteAllCollections(createdDatabase); + } + + private void createDeleteContainerWithSameName(Consumer validateFunc) throws InterruptedException { + CosmosAsyncContainer container = null; + try { + // step1: create container + String testContainerId = UUID.randomUUID().toString(); + CosmosContainerProperties containerProperties = getCollectionDefinition(testContainerId); + container = createCollection(this.createdDatabase, containerProperties, new CosmosContainerRequestOptions()); + + // Step2: execute func + validateFunc.accept(container); + + // step3: delete the container + safeDeleteCollection(container); + Thread.sleep(COLLECTION_RECREATION_TIME_DELAY); + + // step4: recreate the container with same id as step1 + container = createCollection(this.createdDatabase, containerProperties, new CosmosContainerRequestOptions()); + + // step5: same as step2. + // This part will confirm the cache refreshed correctly + validateFunc.accept(container); + } finally { + safeDeleteCollection(container); + } + } + + private void changeFeedCreateDeleteContainerWithSameName(BiConsumer validateFunc) throws InterruptedException { + CosmosAsyncContainer feedContainer = null; + CosmosAsyncContainer leaseContainer = null; + + try { + // step1: create feed container and lease container + String feedContainerId = UUID.randomUUID().toString(); + CosmosContainerProperties feedContainerProperties = getCollectionDefinition(feedContainerId); + feedContainer = createCollection(this.createdDatabase, feedContainerProperties, new CosmosContainerRequestOptions()); + + String leaseContainerId = UUID.randomUUID().toString(); + CosmosContainerProperties leaseContainerProperties = getCollectionDefinition(leaseContainerId); + leaseContainer = createLeaseContainer(leaseContainerProperties.getId()); + + // Step2: execute func + validateFunc.accept(feedContainer, leaseContainer); + + // step3: delete the lease container + safeDeleteCollection(leaseContainer); + truncateCollection(feedContainer); + Thread.sleep(COLLECTION_RECREATION_TIME_DELAY); + + // step4: recreate the lease container and lease container with same ids as step1 + leaseContainer = createLeaseContainer(leaseContainerProperties.getId()); + + // step5: same as step2. + // This part will confirm the cache refreshed correctly + validateFunc.accept(feedContainer, leaseContainer); + } finally { + safeDeleteCollection(feedContainer); + safeDeleteCollection(leaseContainer); + } + } + + private static TestObject getDocumentDefinition() { + return new TestObject( + UUID.randomUUID().toString(), + UUID.randomUUID().toString(), + UUID.randomUUID().toString() + ); + } + + private void setupReadFeedDocuments(List createdDocuments, CosmosAsyncContainer feedContainer, long count) { + List docDefList = new ArrayList<>(); + + for (int i = 0; i < count; i++) { + docDefList.add(getDocumentDefinition()); + } + + createdDocuments.addAll(bulkInsertBlocking(feedContainer, docDefList)); + waitIfNeededForReplicasToCatchUp(getClientBuilder()); + } + + private CosmosAsyncContainer createLeaseContainer(String conatinerId) { + CosmosContainerRequestOptions options = new CosmosContainerRequestOptions(); + CosmosContainerProperties collectionDefinition = new CosmosContainerProperties(conatinerId, "/id"); + return createCollection(createdDatabase, collectionDefinition, options); + } + + static class TestObject { + String id; + String mypk; + String prop; + + public TestObject() { + } + + public TestObject(String id, String mypk, String prop) { + this.id = id; + this.mypk = mypk; + this.prop = prop; + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getMypk() { + return mypk; + } + + public void setMypk(String mypk) { + this.mypk = mypk; + } + + public String getProp() { + return prop; + } + + public void setProp(String prop) { + this.prop = prop; + } + } +} diff --git a/sdk/cosmos/azure-cosmos/src/test/java/com/azure/cosmos/rx/CollectionQueryTest.java b/sdk/cosmos/azure-cosmos/src/test/java/com/azure/cosmos/rx/ContainerQueryTest.java similarity index 67% rename from sdk/cosmos/azure-cosmos/src/test/java/com/azure/cosmos/rx/CollectionQueryTest.java rename to sdk/cosmos/azure-cosmos/src/test/java/com/azure/cosmos/rx/ContainerQueryTest.java index 1349df5d905b4..2e2fb261377e3 100644 --- a/sdk/cosmos/azure-cosmos/src/test/java/com/azure/cosmos/rx/CollectionQueryTest.java +++ b/sdk/cosmos/azure-cosmos/src/test/java/com/azure/cosmos/rx/ContainerQueryTest.java @@ -6,11 +6,12 @@ import com.azure.cosmos.CosmosAsyncContainer; import com.azure.cosmos.CosmosAsyncDatabase; import com.azure.cosmos.CosmosClientBuilder; +import com.azure.cosmos.implementation.InternalObjectNode; import com.azure.cosmos.models.CosmosContainerProperties; +import com.azure.cosmos.models.PartitionKeyDefinition; import com.azure.cosmos.util.CosmosPagedFlux; import com.azure.cosmos.CosmosDatabaseForTest; import com.azure.cosmos.models.CosmosQueryRequestOptions; -import com.azure.cosmos.models.PartitionKeyDefinition; import com.azure.cosmos.implementation.FeedResponseListValidator; import com.azure.cosmos.implementation.FeedResponseValidator; import org.apache.commons.lang3.StringUtils; @@ -26,39 +27,39 @@ import static org.assertj.core.api.Assertions.assertThat; -public class CollectionQueryTest extends TestSuiteBase { +public class ContainerQueryTest extends TestSuiteBase { private final static int TIMEOUT = 30000; private final String databaseId = CosmosDatabaseForTest.generateId(); - private List createdCollections = new ArrayList<>(); + private List createdContainers = new ArrayList<>(); private CosmosAsyncClient client; private CosmosAsyncDatabase createdDatabase; @Factory(dataProvider = "clientBuilders") - public CollectionQueryTest(CosmosClientBuilder clientBuilder) { + public ContainerQueryTest(CosmosClientBuilder clientBuilder) { super(clientBuilder); this.subscriberValidationTimeout = TIMEOUT; } @Test(groups = { "simple" }, timeOut = TIMEOUT) - public void queryCollectionsWithFilter() throws Exception { + public void queryContainersWithFilter() throws Exception { - String filterCollectionId = createdCollections.get(0).getId(); - String query = String.format("SELECT * from c where c.id = '%s'", filterCollectionId); + String filterContainerId = createdContainers.get(0).getId(); + String query = String.format("SELECT * from c where c.id = '%s'", filterContainerId); CosmosQueryRequestOptions options = new CosmosQueryRequestOptions(); int maxItemCount = 2; CosmosPagedFlux queryObservable = createdDatabase.queryContainers(query, options); - List expectedCollections = createdCollections.stream() - .filter(c -> StringUtils.equals(filterCollectionId, c.getId()) ).collect(Collectors.toList()); + List expectedContainers = createdContainers.stream() + .filter(c -> StringUtils.equals(filterContainerId, c.getId()) ).collect(Collectors.toList()); - assertThat(expectedCollections).isNotEmpty(); + assertThat(expectedContainers).isNotEmpty(); - int expectedPageSize = (expectedCollections.size() + maxItemCount - 1) / maxItemCount; + int expectedPageSize = (expectedContainers.size() + maxItemCount - 1) / maxItemCount; FeedResponseListValidator validator = new FeedResponseListValidator.Builder() - .totalSize(expectedCollections.size()) - .exactlyContainsInAnyOrder(expectedCollections.stream().map(d -> d.read().block().getProperties().getResourceId()).collect(Collectors.toList())) + .totalSize(expectedContainers.size()) + .exactlyContainsInAnyOrder(expectedContainers.stream().map(d -> d.read().block().getProperties().getResourceId()).collect(Collectors.toList())) .numberOfPages(expectedPageSize) .pageSatisfy(0, new FeedResponseValidator.Builder() .requestChargeGreaterThanOrEqualTo(1.0).build()) @@ -68,7 +69,7 @@ public void queryCollectionsWithFilter() throws Exception { } @Test(groups = { "simple" }, timeOut = TIMEOUT) - public void queryAllCollections() throws Exception { + public void queryAllContainers() throws Exception { String query = "SELECT * from c"; @@ -76,15 +77,15 @@ public void queryAllCollections() throws Exception { int maxItemCount = 2; CosmosPagedFlux queryObservable = createdDatabase.queryContainers(query, options); - List expectedCollections = createdCollections; + List expectedContainers = createdContainers; - assertThat(expectedCollections).isNotEmpty(); + assertThat(expectedContainers).isNotEmpty(); - int expectedPageSize = (expectedCollections.size() + maxItemCount - 1) / maxItemCount; + int expectedPageSize = (expectedContainers.size() + maxItemCount - 1) / maxItemCount; FeedResponseListValidator validator = new FeedResponseListValidator.Builder() - .totalSize(expectedCollections.size()) - .exactlyContainsInAnyOrder(expectedCollections.stream().map(d -> d.read().block().getProperties().getResourceId()).collect(Collectors.toList())) + .totalSize(expectedContainers.size()) + .exactlyContainsInAnyOrder(expectedContainers.stream().map(d -> d.read().block().getProperties().getResourceId()).collect(Collectors.toList())) .numberOfPages(expectedPageSize) .pageSatisfy(0, new FeedResponseValidator.Builder() .requestChargeGreaterThanOrEqualTo(1.0).build()) @@ -94,7 +95,7 @@ public void queryAllCollections() throws Exception { } @Test(groups = { "simple" }, timeOut = TIMEOUT) - public void queryCollections_NoResults() throws Exception { + public void queryContainers_NoResults() throws Exception { String query = "SELECT * from root r where r.id = '2'"; CosmosQueryRequestOptions options = new CosmosQueryRequestOptions(); @@ -110,7 +111,7 @@ public void queryCollections_NoResults() throws Exception { } @BeforeClass(groups = { "simple" }, timeOut = SETUP_TIMEOUT) - public void before_CollectionQueryTest() throws Exception { + public void before_ContainerQueryTest() throws Exception { client = getClientBuilder().buildAsyncClient(); createdDatabase = createDatabase(client, databaseId); @@ -119,8 +120,8 @@ public void before_CollectionQueryTest() throws Exception { paths.add("/mypk"); partitionKeyDef.setPaths(paths); - CosmosContainerProperties collection = new CosmosContainerProperties(UUID.randomUUID().toString(), partitionKeyDef); - createdCollections.add(createCollection(client, databaseId, collection)); + CosmosContainerProperties container = new CosmosContainerProperties(UUID.randomUUID().toString(), partitionKeyDef); + createdContainers.add(createCollection(client, databaseId, container)); } @AfterClass(groups = { "simple" }, timeOut = SHUTDOWN_TIMEOUT, alwaysRun = true) @@ -128,4 +129,14 @@ public void afterClass() { safeDeleteDatabase(createdDatabase); safeClose(client); } + + private static InternalObjectNode getDocumentDefinition() { + String uuid = UUID.randomUUID().toString(); + InternalObjectNode doc = new InternalObjectNode(String.format("{ " + + "\"id\": \"%s\", " + + "\"mypk\": \"%s\", " + + "}" + , uuid, uuid)); + return doc; + } } diff --git a/sdk/cosmos/azure-cosmos/src/test/java/com/azure/cosmos/rx/TestSuiteBase.java b/sdk/cosmos/azure-cosmos/src/test/java/com/azure/cosmos/rx/TestSuiteBase.java index dead021f8e7e9..a5e0e0682e933 100644 --- a/sdk/cosmos/azure-cosmos/src/test/java/com/azure/cosmos/rx/TestSuiteBase.java +++ b/sdk/cosmos/azure-cosmos/src/test/java/com/azure/cosmos/rx/TestSuiteBase.java @@ -516,12 +516,16 @@ private static CosmosAsyncContainer safeCreateCollection(CosmosAsyncClient clien } static protected CosmosContainerProperties getCollectionDefinition() { + return getCollectionDefinition(UUID.randomUUID().toString()); + } + + static protected CosmosContainerProperties getCollectionDefinition(String collectionId) { PartitionKeyDefinition partitionKeyDef = new PartitionKeyDefinition(); - ArrayList paths = new ArrayList(); + ArrayList paths = new ArrayList<>(); paths.add("/mypk"); partitionKeyDef.setPaths(paths); - CosmosContainerProperties collectionDefinition = new CosmosContainerProperties(UUID.randomUUID().toString(), partitionKeyDef); + CosmosContainerProperties collectionDefinition = new CosmosContainerProperties(collectionId, partitionKeyDef); return collectionDefinition; } From 196111686c001296b1fef66d47ca23e56a2329d0 Mon Sep 17 00:00:00 2001 From: Yi Liu Date: Wed, 8 Jul 2020 00:11:53 +0800 Subject: [PATCH 029/129] Migrate integration tests for spring-data-cosmosdb (#12609) * add spring cosmosdb IT to sdk\cosmos tests.yml * add test-resources.json for IT * add default constructor for IT * modify javadoc and code owners * add tests.yml in azure-spring-data-cosmosdb * modify readme.md for outdated link * place integration test files in sdk/cosmos and rename directory path * modify javadoc warning of @ symbol for the pipeline * revert eng files and modify test-resources.json for IT * Added spring integration matrix tests for Session and Strong consistency * Enabled unit tests and integration tests for azure and emulator * Added account host and key to emulator tests * Reverted experimental changes. Exculded PageablePersonRepositoryIT from emulator tests * restore file generate_overview_from_readme.py * clear reademe.md temparorily for pipeline * add Contributing.md * modify version declaration in contributing.md Co-authored-by: Kushagra Thapar --- .github/CODEOWNERS | 4 +- .gitignore | 1 + .../templates/stages/cosmos-sdk-client.yml | 10 +- .../Contributing.md | 62 ++++ .../azure-spring-data-cosmosdb/README.md | 317 ------------------ sdk/cosmos/azure-spring-data-cosmosdb/pom.xml | 87 +++-- .../spring/data/cosmosdb}/Constants.java | 0 .../data/cosmosdb}/CosmosDbFactory.java | 0 .../data/cosmosdb}/common/CosmosdbUtils.java | 0 .../cosmosdb}/common/ExpressionResolver.java | 0 .../data/cosmosdb}/common/MacAddress.java | 0 .../data/cosmosdb}/common/Memoizer.java | 0 .../data/cosmosdb}/common/PropertyLoader.java | 0 .../cosmosdb}/common/TelemetryEventData.java | 0 .../cosmosdb}/common/TelemetrySender.java | 0 .../data/cosmosdb}/common/package-info.java | 0 .../config/AbstractCosmosConfiguration.java | 0 .../config/CosmosConfigurationSupport.java | 0 .../data/cosmosdb}/config/CosmosDBConfig.java | 0 .../data/cosmosdb}/config/package-info.java | 0 .../data/cosmosdb}/core/CosmosOperations.java | 0 .../data/cosmosdb}/core/CosmosTemplate.java | 0 .../core/ReactiveCosmosOperations.java | 2 +- .../core/ReactiveCosmosTemplate.java | 0 .../cosmosdb}/core/ResponseDiagnostics.java | 0 .../core/ResponseDiagnosticsProcessor.java | 0 .../core/convert/MappingCosmosConverter.java | 0 .../core/convert/ObjectMapperFactory.java | 0 .../cosmosdb}/core/convert/package-info.java | 0 .../generator/AbstractQueryGenerator.java | 0 .../core/generator/CountQueryGenerator.java | 0 .../generator/FindQuerySpecGenerator.java | 0 .../core/generator/QuerySpecGenerator.java | 0 .../core/generator/package-info.java | 0 .../mapping/BasicCosmosPersistentEntity.java | 0 .../BasicCosmosPersistentProperty.java | 0 .../core/mapping/CosmosMappingContext.java | 0 .../core/mapping/CosmosPersistentEntity.java | 0 .../mapping/CosmosPersistentProperty.java | 0 .../data/cosmosdb}/core/mapping/Document.java | 0 .../core/mapping/DocumentIndexingPolicy.java | 0 .../cosmosdb}/core/mapping/PartitionKey.java | 0 .../cosmosdb}/core/mapping/package-info.java | 0 .../data/cosmosdb}/core/package-info.java | 0 .../cosmosdb}/core/query/CosmosPageImpl.java | 0 .../core/query/CosmosPageRequest.java | 0 .../data/cosmosdb}/core/query/Criteria.java | 0 .../cosmosdb}/core/query/CriteriaType.java | 0 .../cosmosdb}/core/query/DocumentQuery.java | 0 .../cosmosdb}/core/query/package-info.java | 0 .../exception/ConfigurationException.java | 0 .../exception/CosmosDBAccessException.java | 0 .../exception/CosmosDBExceptionUtils.java | 0 .../exception/DatabaseCreationException.java | 0 .../exception/IllegalCollectionException.java | 0 .../exception/IllegalQueryException.java | 0 .../cosmosdb}/exception/package-info.java | 0 .../spring/data/cosmosdb}/package-info.java | 0 .../repository/CosmosRepository.java | 0 .../repository/ReactiveCosmosRepository.java | 0 .../config/CosmosRepositoriesRegistrar.java | 0 ...osmosRepositoryConfigurationExtension.java | 0 .../config/EnableCosmosRepositories.java | 0 .../EnableReactiveCosmosRepositories.java | 0 .../ReactiveCosmosRepositoriesRegistrar.java | 0 ...osmosRepositoryConfigurationExtension.java | 0 .../repository/config/package-info.java | 0 .../cosmosdb}/repository/package-info.java | 0 .../repository/query/AbstractCosmosQuery.java | 0 .../query/AbstractReactiveCosmosQuery.java | 0 .../query/CosmosEntityMetadata.java | 0 .../repository/query/CosmosParameter.java | 0 .../query/CosmosParameterAccessor.java | 0 .../CosmosParameterParameterAccessor.java | 0 .../repository/query/CosmosParameters.java | 0 .../repository/query/CosmosQueryCreator.java | 0 .../query/CosmosQueryExecution.java | 0 .../repository/query/CosmosQueryMethod.java | 0 .../repository/query/PartTreeCosmosQuery.java | 0 .../query/PartTreeReactiveCosmosQuery.java | 0 .../query/ReactiveCosmosEntityMetadata.java | 0 .../ReactiveCosmosParameterAccessor.java | 0 ...ctiveCosmosParameterParameterAccessor.java | 0 .../query/ReactiveCosmosQueryCreator.java | 0 .../query/ReactiveCosmosQueryExecution.java | 0 .../query/ReactiveCosmosQueryMethod.java | 0 .../query/SimpleCosmosEntityMetadata.java | 0 .../SimpleReactiveCosmosEntityMetadata.java | 0 .../repository/query/package-info.java | 0 .../support/CosmosEntityInformation.java | 0 .../support/CosmosRepositoryFactory.java | 0 .../support/CosmosRepositoryFactoryBean.java | 0 .../ReactiveCosmosRepositoryFactory.java | 0 .../ReactiveCosmosRepositoryFactoryBean.java | 0 .../support/SimpleCosmosRepository.java | 0 .../SimpleReactiveCosmosRepository.java | 0 .../repository/support/package-info.java | 0 .../data/cosmosdb}/CosmosDbFactoryTestIT.java | 0 .../data/cosmosdb}/UserAgentTestIT.java | 0 .../cosmosdb}/common/DynamicContainer.java | 0 .../common/ExpressionResolverUnitTest.java | 1 - .../cosmosdb}/common/MemoizerUnitTest.java | 4 +- .../data/cosmosdb}/common/PageTestUtils.java | 0 .../common/PropertyLoaderUnitTest.java | 0 .../common/ResponseDiagnosticsTestUtils.java | 0 .../data/cosmosdb}/common/TestConstants.java | 0 .../data/cosmosdb}/common/TestUtils.java | 0 .../config/AbstractCosmosConfigurationIT.java | 1 - .../data/cosmosdb}/core/CosmosTemplateIT.java | 15 +- .../core/CosmosTemplateIllegalTest.java | 4 +- .../core/CosmosTemplatePartitionIT.java | 0 .../core/CosmosTemplateUnitTest.java | 0 .../core/ReactiveCosmosTemplateIT.java | 6 +- .../ReactiveCosmosTemplatePartitionIT.java | 17 +- .../ZonedDateTimeDeserializerTest.java | 0 .../MappingCosmosConverterUnitTest.java | 2 +- .../BasicCosmosPersistentEntityUnitTest.java | 0 .../mapping/CosmosMappingContextUnitTest.java | 0 .../core/query/CriteriaUnitTest.java | 0 .../core/query/DocumentQueryUnitTest.java | 0 .../spring/data/cosmosdb}/domain/Address.java | 0 .../spring/data/cosmosdb}/domain/Contact.java | 3 + .../spring/data/cosmosdb}/domain/Course.java | 0 .../data/cosmosdb}/domain/Customer.java | 6 + .../data/cosmosdb}/domain/Importance.java | 0 .../cosmosdb}/domain/IntegerIdDomain.java | 0 .../spring/data/cosmosdb}/domain/Memo.java | 0 .../domain/NoDBAnnotationPerson.java | 3 + .../cosmosdb}/domain/PageableAddress.java | 3 + .../data/cosmosdb}/domain/PageableMemo.java | 3 + .../data/cosmosdb}/domain/PageablePerson.java | 0 .../cosmosdb}/domain/PartitionPerson.java | 3 + .../spring/data/cosmosdb}/domain/Person.java | 7 +- .../spring/data/cosmosdb}/domain/Project.java | 3 + .../data/cosmosdb}/domain/Question.java | 0 .../spring/data/cosmosdb}/domain/Role.java | 3 + .../data/cosmosdb}/domain/SortedProject.java | 3 + .../cosmosdb}/domain/SpELBeanStudent.java | 0 .../cosmosdb}/domain/SpELPropertyStudent.java | 0 .../spring/data/cosmosdb}/domain/Student.java | 3 + .../cosmosdb}/domain/TimeToLiveSample.java | 3 + .../cosmosdb}/domain/inheritance/Shape.java | 0 .../cosmosdb}/domain/inheritance/Square.java | 0 .../performance/PerfConfiguration.java | 0 .../performance/PerformanceCompare.java | 0 .../performance/PerformanceReport.java | 0 .../performance/domain/PerfPerson.java | 0 .../repository/PerfPersonRepository.java | 0 .../performance/service/SdkService.java | 8 +- .../performance/utils/Constants.java | 0 .../performance/utils/DatabaseUtils.java | 6 +- .../performance/utils/FunctionUtils.java | 0 .../performance/utils/PerfDataProvider.java | 0 .../repository/CosmosAnnotationUnitTest.java | 0 .../SimpleCosmosRepositoryIllegalTest.java | 0 .../SimpleCosmosRepositoryUnitTest.java | 2 +- .../repository/TestRepositoryConfig.java | 0 ...ositoryConfigurationExtensionUnitTest.java | 0 ...ositoryConfigurationExtensionUnitTest.java | 0 .../integration/AddressRepositoryIT.java | 7 +- .../integration/ContactRepositoryIT.java | 7 +- .../integration/CosmosAnnotationIT.java | 0 .../integration/CustomerRepositoryIT.java | 6 +- .../IntegerIdDomainRepositoryIT.java | 10 +- .../integration/MemoRepositoryIT.java | 8 +- .../PageableAddressRepositoryIT.java | 0 .../integration/PageableMemoRepositoryIT.java | 8 +- .../PageablePersonRepositoryIT.java | 6 +- .../integration/PersonRepositoryIT.java | 0 .../integration/ProjectRepositoryIT.java | 12 +- .../integration/ProjectRepositorySortIT.java | 6 +- .../integration/QuestionRepositoryIT.java | 6 +- .../ReactiveCourseRepositoryIT.java | 0 .../integration/SpELCosmosDBAnnotationIT.java | 0 .../integration/SquareRepositoryIT.java | 0 .../integration/StudentRepositoryIT.java | 6 +- .../repository/AddressRepository.java | 0 .../repository/ContactRepository.java | 0 .../repository/CustomerRepository.java | 0 .../repository/IntegerIdDomainRepository.java | 0 .../repository/repository/MemoRepository.java | 2 +- .../repository/PageableAddressRepository.java | 0 .../repository/PageableMemoRepository.java | 0 .../repository/PageablePersonRepository.java | 0 .../repository/PartitionPersonRepository.java | 0 .../repository/PersonRepository.java | 0 .../repository/ProjectRepository.java | 0 .../repository/QuestionRepository.java | 0 .../repository/ReactiveCourseRepository.java | 0 .../repository/SortedProjectRepository.java | 0 .../repository/SquareRepository.java | 0 .../repository/StudentRepository.java | 0 .../CosmosEntityInformationUnitTest.java | 7 +- .../CosmosRepositoryFactoryBeanUnitTest.java | 0 .../CosmosRepositoryFactoryUnitTest.java | 0 .../src/test/resources/application.properties | 6 +- sdk/cosmos/test-resources.json | 2 +- sdk/cosmos/tests.yml | 31 +- 198 files changed, 236 insertions(+), 486 deletions(-) create mode 100644 sdk/cosmos/azure-spring-data-cosmosdb/Contributing.md rename sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/{com.microsoft.azure.spring.data.cosmosdb => com/microsoft/azure/spring/data/cosmosdb}/Constants.java (100%) rename sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/{com.microsoft.azure.spring.data.cosmosdb => com/microsoft/azure/spring/data/cosmosdb}/CosmosDbFactory.java (100%) rename sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/{com.microsoft.azure.spring.data.cosmosdb => com/microsoft/azure/spring/data/cosmosdb}/common/CosmosdbUtils.java (100%) rename sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/{com.microsoft.azure.spring.data.cosmosdb => com/microsoft/azure/spring/data/cosmosdb}/common/ExpressionResolver.java (100%) rename sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/{com.microsoft.azure.spring.data.cosmosdb => com/microsoft/azure/spring/data/cosmosdb}/common/MacAddress.java (100%) rename sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/{com.microsoft.azure.spring.data.cosmosdb => com/microsoft/azure/spring/data/cosmosdb}/common/Memoizer.java (100%) rename sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/{com.microsoft.azure.spring.data.cosmosdb => com/microsoft/azure/spring/data/cosmosdb}/common/PropertyLoader.java (100%) rename sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/{com.microsoft.azure.spring.data.cosmosdb => com/microsoft/azure/spring/data/cosmosdb}/common/TelemetryEventData.java (100%) rename sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/{com.microsoft.azure.spring.data.cosmosdb => com/microsoft/azure/spring/data/cosmosdb}/common/TelemetrySender.java (100%) rename sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/{com.microsoft.azure.spring.data.cosmosdb => com/microsoft/azure/spring/data/cosmosdb}/common/package-info.java (100%) rename sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/{com.microsoft.azure.spring.data.cosmosdb => com/microsoft/azure/spring/data/cosmosdb}/config/AbstractCosmosConfiguration.java (100%) rename sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/{com.microsoft.azure.spring.data.cosmosdb => com/microsoft/azure/spring/data/cosmosdb}/config/CosmosConfigurationSupport.java (100%) rename sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/{com.microsoft.azure.spring.data.cosmosdb => com/microsoft/azure/spring/data/cosmosdb}/config/CosmosDBConfig.java (100%) rename sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/{com.microsoft.azure.spring.data.cosmosdb => com/microsoft/azure/spring/data/cosmosdb}/config/package-info.java (100%) rename sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/{com.microsoft.azure.spring.data.cosmosdb => com/microsoft/azure/spring/data/cosmosdb}/core/CosmosOperations.java (100%) rename sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/{com.microsoft.azure.spring.data.cosmosdb => com/microsoft/azure/spring/data/cosmosdb}/core/CosmosTemplate.java (100%) rename sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/{com.microsoft.azure.spring.data.cosmosdb => com/microsoft/azure/spring/data/cosmosdb}/core/ReactiveCosmosOperations.java (98%) rename sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/{com.microsoft.azure.spring.data.cosmosdb => com/microsoft/azure/spring/data/cosmosdb}/core/ReactiveCosmosTemplate.java (100%) rename sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/{com.microsoft.azure.spring.data.cosmosdb => com/microsoft/azure/spring/data/cosmosdb}/core/ResponseDiagnostics.java (100%) rename sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/{com.microsoft.azure.spring.data.cosmosdb => com/microsoft/azure/spring/data/cosmosdb}/core/ResponseDiagnosticsProcessor.java (100%) rename sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/{com.microsoft.azure.spring.data.cosmosdb => com/microsoft/azure/spring/data/cosmosdb}/core/convert/MappingCosmosConverter.java (100%) rename sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/{com.microsoft.azure.spring.data.cosmosdb => com/microsoft/azure/spring/data/cosmosdb}/core/convert/ObjectMapperFactory.java (100%) rename sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/{com.microsoft.azure.spring.data.cosmosdb => com/microsoft/azure/spring/data/cosmosdb}/core/convert/package-info.java (100%) rename sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/{com.microsoft.azure.spring.data.cosmosdb => com/microsoft/azure/spring/data/cosmosdb}/core/generator/AbstractQueryGenerator.java (100%) rename sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/{com.microsoft.azure.spring.data.cosmosdb => com/microsoft/azure/spring/data/cosmosdb}/core/generator/CountQueryGenerator.java (100%) rename sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/{com.microsoft.azure.spring.data.cosmosdb => com/microsoft/azure/spring/data/cosmosdb}/core/generator/FindQuerySpecGenerator.java (100%) rename sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/{com.microsoft.azure.spring.data.cosmosdb => com/microsoft/azure/spring/data/cosmosdb}/core/generator/QuerySpecGenerator.java (100%) rename sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/{com.microsoft.azure.spring.data.cosmosdb => com/microsoft/azure/spring/data/cosmosdb}/core/generator/package-info.java (100%) rename sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/{com.microsoft.azure.spring.data.cosmosdb => com/microsoft/azure/spring/data/cosmosdb}/core/mapping/BasicCosmosPersistentEntity.java (100%) rename sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/{com.microsoft.azure.spring.data.cosmosdb => com/microsoft/azure/spring/data/cosmosdb}/core/mapping/BasicCosmosPersistentProperty.java (100%) rename sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/{com.microsoft.azure.spring.data.cosmosdb => com/microsoft/azure/spring/data/cosmosdb}/core/mapping/CosmosMappingContext.java (100%) rename sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/{com.microsoft.azure.spring.data.cosmosdb => com/microsoft/azure/spring/data/cosmosdb}/core/mapping/CosmosPersistentEntity.java (100%) rename sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/{com.microsoft.azure.spring.data.cosmosdb => com/microsoft/azure/spring/data/cosmosdb}/core/mapping/CosmosPersistentProperty.java (100%) rename sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/{com.microsoft.azure.spring.data.cosmosdb => com/microsoft/azure/spring/data/cosmosdb}/core/mapping/Document.java (100%) rename sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/{com.microsoft.azure.spring.data.cosmosdb => com/microsoft/azure/spring/data/cosmosdb}/core/mapping/DocumentIndexingPolicy.java (100%) rename sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/{com.microsoft.azure.spring.data.cosmosdb => com/microsoft/azure/spring/data/cosmosdb}/core/mapping/PartitionKey.java (100%) rename sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/{com.microsoft.azure.spring.data.cosmosdb => com/microsoft/azure/spring/data/cosmosdb}/core/mapping/package-info.java (100%) rename sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/{com.microsoft.azure.spring.data.cosmosdb => com/microsoft/azure/spring/data/cosmosdb}/core/package-info.java (100%) rename sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/{com.microsoft.azure.spring.data.cosmosdb => com/microsoft/azure/spring/data/cosmosdb}/core/query/CosmosPageImpl.java (100%) rename sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/{com.microsoft.azure.spring.data.cosmosdb => com/microsoft/azure/spring/data/cosmosdb}/core/query/CosmosPageRequest.java (100%) rename sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/{com.microsoft.azure.spring.data.cosmosdb => com/microsoft/azure/spring/data/cosmosdb}/core/query/Criteria.java (100%) rename sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/{com.microsoft.azure.spring.data.cosmosdb => com/microsoft/azure/spring/data/cosmosdb}/core/query/CriteriaType.java (100%) rename sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/{com.microsoft.azure.spring.data.cosmosdb => com/microsoft/azure/spring/data/cosmosdb}/core/query/DocumentQuery.java (100%) rename sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/{com.microsoft.azure.spring.data.cosmosdb => com/microsoft/azure/spring/data/cosmosdb}/core/query/package-info.java (100%) rename sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/{com.microsoft.azure.spring.data.cosmosdb => com/microsoft/azure/spring/data/cosmosdb}/exception/ConfigurationException.java (100%) rename sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/{com.microsoft.azure.spring.data.cosmosdb => com/microsoft/azure/spring/data/cosmosdb}/exception/CosmosDBAccessException.java (100%) rename sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/{com.microsoft.azure.spring.data.cosmosdb => com/microsoft/azure/spring/data/cosmosdb}/exception/CosmosDBExceptionUtils.java (100%) rename sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/{com.microsoft.azure.spring.data.cosmosdb => com/microsoft/azure/spring/data/cosmosdb}/exception/DatabaseCreationException.java (100%) rename sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/{com.microsoft.azure.spring.data.cosmosdb => com/microsoft/azure/spring/data/cosmosdb}/exception/IllegalCollectionException.java (100%) rename sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/{com.microsoft.azure.spring.data.cosmosdb => com/microsoft/azure/spring/data/cosmosdb}/exception/IllegalQueryException.java (100%) rename sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/{com.microsoft.azure.spring.data.cosmosdb => com/microsoft/azure/spring/data/cosmosdb}/exception/package-info.java (100%) rename sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/{com.microsoft.azure.spring.data.cosmosdb => com/microsoft/azure/spring/data/cosmosdb}/package-info.java (100%) rename sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/{com.microsoft.azure.spring.data.cosmosdb => com/microsoft/azure/spring/data/cosmosdb}/repository/CosmosRepository.java (100%) rename sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/{com.microsoft.azure.spring.data.cosmosdb => com/microsoft/azure/spring/data/cosmosdb}/repository/ReactiveCosmosRepository.java (100%) rename sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/{com.microsoft.azure.spring.data.cosmosdb => com/microsoft/azure/spring/data/cosmosdb}/repository/config/CosmosRepositoriesRegistrar.java (100%) rename sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/{com.microsoft.azure.spring.data.cosmosdb => com/microsoft/azure/spring/data/cosmosdb}/repository/config/CosmosRepositoryConfigurationExtension.java (100%) rename sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/{com.microsoft.azure.spring.data.cosmosdb => com/microsoft/azure/spring/data/cosmosdb}/repository/config/EnableCosmosRepositories.java (100%) rename sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/{com.microsoft.azure.spring.data.cosmosdb => com/microsoft/azure/spring/data/cosmosdb}/repository/config/EnableReactiveCosmosRepositories.java (100%) rename sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/{com.microsoft.azure.spring.data.cosmosdb => com/microsoft/azure/spring/data/cosmosdb}/repository/config/ReactiveCosmosRepositoriesRegistrar.java (100%) rename sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/{com.microsoft.azure.spring.data.cosmosdb => com/microsoft/azure/spring/data/cosmosdb}/repository/config/ReactiveCosmosRepositoryConfigurationExtension.java (100%) rename sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/{com.microsoft.azure.spring.data.cosmosdb => com/microsoft/azure/spring/data/cosmosdb}/repository/config/package-info.java (100%) rename sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/{com.microsoft.azure.spring.data.cosmosdb => com/microsoft/azure/spring/data/cosmosdb}/repository/package-info.java (100%) rename sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/{com.microsoft.azure.spring.data.cosmosdb => com/microsoft/azure/spring/data/cosmosdb}/repository/query/AbstractCosmosQuery.java (100%) rename sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/{com.microsoft.azure.spring.data.cosmosdb => com/microsoft/azure/spring/data/cosmosdb}/repository/query/AbstractReactiveCosmosQuery.java (100%) rename sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/{com.microsoft.azure.spring.data.cosmosdb => com/microsoft/azure/spring/data/cosmosdb}/repository/query/CosmosEntityMetadata.java (100%) rename sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/{com.microsoft.azure.spring.data.cosmosdb => com/microsoft/azure/spring/data/cosmosdb}/repository/query/CosmosParameter.java (100%) rename sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/{com.microsoft.azure.spring.data.cosmosdb => com/microsoft/azure/spring/data/cosmosdb}/repository/query/CosmosParameterAccessor.java (100%) rename sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/{com.microsoft.azure.spring.data.cosmosdb => com/microsoft/azure/spring/data/cosmosdb}/repository/query/CosmosParameterParameterAccessor.java (100%) rename sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/{com.microsoft.azure.spring.data.cosmosdb => com/microsoft/azure/spring/data/cosmosdb}/repository/query/CosmosParameters.java (100%) rename sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/{com.microsoft.azure.spring.data.cosmosdb => com/microsoft/azure/spring/data/cosmosdb}/repository/query/CosmosQueryCreator.java (100%) rename sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/{com.microsoft.azure.spring.data.cosmosdb => com/microsoft/azure/spring/data/cosmosdb}/repository/query/CosmosQueryExecution.java (100%) rename sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/{com.microsoft.azure.spring.data.cosmosdb => com/microsoft/azure/spring/data/cosmosdb}/repository/query/CosmosQueryMethod.java (100%) rename sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/{com.microsoft.azure.spring.data.cosmosdb => com/microsoft/azure/spring/data/cosmosdb}/repository/query/PartTreeCosmosQuery.java (100%) rename sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/{com.microsoft.azure.spring.data.cosmosdb => com/microsoft/azure/spring/data/cosmosdb}/repository/query/PartTreeReactiveCosmosQuery.java (100%) rename sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/{com.microsoft.azure.spring.data.cosmosdb => com/microsoft/azure/spring/data/cosmosdb}/repository/query/ReactiveCosmosEntityMetadata.java (100%) rename sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/{com.microsoft.azure.spring.data.cosmosdb => com/microsoft/azure/spring/data/cosmosdb}/repository/query/ReactiveCosmosParameterAccessor.java (100%) rename sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/{com.microsoft.azure.spring.data.cosmosdb => com/microsoft/azure/spring/data/cosmosdb}/repository/query/ReactiveCosmosParameterParameterAccessor.java (100%) rename sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/{com.microsoft.azure.spring.data.cosmosdb => com/microsoft/azure/spring/data/cosmosdb}/repository/query/ReactiveCosmosQueryCreator.java (100%) rename sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/{com.microsoft.azure.spring.data.cosmosdb => com/microsoft/azure/spring/data/cosmosdb}/repository/query/ReactiveCosmosQueryExecution.java (100%) rename sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/{com.microsoft.azure.spring.data.cosmosdb => com/microsoft/azure/spring/data/cosmosdb}/repository/query/ReactiveCosmosQueryMethod.java (100%) rename sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/{com.microsoft.azure.spring.data.cosmosdb => com/microsoft/azure/spring/data/cosmosdb}/repository/query/SimpleCosmosEntityMetadata.java (100%) rename sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/{com.microsoft.azure.spring.data.cosmosdb => com/microsoft/azure/spring/data/cosmosdb}/repository/query/SimpleReactiveCosmosEntityMetadata.java (100%) rename sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/{com.microsoft.azure.spring.data.cosmosdb => com/microsoft/azure/spring/data/cosmosdb}/repository/query/package-info.java (100%) rename sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/{com.microsoft.azure.spring.data.cosmosdb => com/microsoft/azure/spring/data/cosmosdb}/repository/support/CosmosEntityInformation.java (100%) rename sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/{com.microsoft.azure.spring.data.cosmosdb => com/microsoft/azure/spring/data/cosmosdb}/repository/support/CosmosRepositoryFactory.java (100%) rename sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/{com.microsoft.azure.spring.data.cosmosdb => com/microsoft/azure/spring/data/cosmosdb}/repository/support/CosmosRepositoryFactoryBean.java (100%) rename sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/{com.microsoft.azure.spring.data.cosmosdb => com/microsoft/azure/spring/data/cosmosdb}/repository/support/ReactiveCosmosRepositoryFactory.java (100%) rename sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/{com.microsoft.azure.spring.data.cosmosdb => com/microsoft/azure/spring/data/cosmosdb}/repository/support/ReactiveCosmosRepositoryFactoryBean.java (100%) rename sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/{com.microsoft.azure.spring.data.cosmosdb => com/microsoft/azure/spring/data/cosmosdb}/repository/support/SimpleCosmosRepository.java (100%) rename sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/{com.microsoft.azure.spring.data.cosmosdb => com/microsoft/azure/spring/data/cosmosdb}/repository/support/SimpleReactiveCosmosRepository.java (100%) rename sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/{com.microsoft.azure.spring.data.cosmosdb => com/microsoft/azure/spring/data/cosmosdb}/repository/support/package-info.java (100%) rename sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/{com.microsoft.azure.spring.data.cosmosdb => com/microsoft/azure/spring/data/cosmosdb}/CosmosDbFactoryTestIT.java (100%) rename sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/{com.microsoft.azure.spring.data.cosmosdb => com/microsoft/azure/spring/data/cosmosdb}/UserAgentTestIT.java (100%) rename sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/{com.microsoft.azure.spring.data.cosmosdb => com/microsoft/azure/spring/data/cosmosdb}/common/DynamicContainer.java (100%) rename sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/{com.microsoft.azure.spring.data.cosmosdb => com/microsoft/azure/spring/data/cosmosdb}/common/ExpressionResolverUnitTest.java (99%) rename sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/{com.microsoft.azure.spring.data.cosmosdb => com/microsoft/azure/spring/data/cosmosdb}/common/MemoizerUnitTest.java (100%) rename sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/{com.microsoft.azure.spring.data.cosmosdb => com/microsoft/azure/spring/data/cosmosdb}/common/PageTestUtils.java (100%) rename sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/{com.microsoft.azure.spring.data.cosmosdb => com/microsoft/azure/spring/data/cosmosdb}/common/PropertyLoaderUnitTest.java (100%) rename sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/{com.microsoft.azure.spring.data.cosmosdb => com/microsoft/azure/spring/data/cosmosdb}/common/ResponseDiagnosticsTestUtils.java (100%) rename sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/{com.microsoft.azure.spring.data.cosmosdb => com/microsoft/azure/spring/data/cosmosdb}/common/TestConstants.java (100%) rename sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/{com.microsoft.azure.spring.data.cosmosdb => com/microsoft/azure/spring/data/cosmosdb}/common/TestUtils.java (100%) rename sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/{com.microsoft.azure.spring.data.cosmosdb => com/microsoft/azure/spring/data/cosmosdb}/config/AbstractCosmosConfigurationIT.java (99%) rename sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/{com.microsoft.azure.spring.data.cosmosdb => com/microsoft/azure/spring/data/cosmosdb}/core/CosmosTemplateIT.java (94%) rename sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/{com.microsoft.azure.spring.data.cosmosdb => com/microsoft/azure/spring/data/cosmosdb}/core/CosmosTemplateIllegalTest.java (100%) rename sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/{com.microsoft.azure.spring.data.cosmosdb => com/microsoft/azure/spring/data/cosmosdb}/core/CosmosTemplatePartitionIT.java (100%) rename sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/{com.microsoft.azure.spring.data.cosmosdb => com/microsoft/azure/spring/data/cosmosdb}/core/CosmosTemplateUnitTest.java (100%) rename sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/{com.microsoft.azure.spring.data.cosmosdb => com/microsoft/azure/spring/data/cosmosdb}/core/ReactiveCosmosTemplateIT.java (99%) rename sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/{com.microsoft.azure.spring.data.cosmosdb => com/microsoft/azure/spring/data/cosmosdb}/core/ReactiveCosmosTemplatePartitionIT.java (90%) rename sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/{com.microsoft.azure.spring.data.cosmosdb => com/microsoft/azure/spring/data/cosmosdb}/core/convert/ZonedDateTimeDeserializerTest.java (100%) rename sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/{com.microsoft.azure.spring.data.cosmosdb => com/microsoft/azure/spring/data/cosmosdb}/core/converter/MappingCosmosConverterUnitTest.java (100%) rename sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/{com.microsoft.azure.spring.data.cosmosdb => com/microsoft/azure/spring/data/cosmosdb}/core/mapping/BasicCosmosPersistentEntityUnitTest.java (100%) rename sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/{com.microsoft.azure.spring.data.cosmosdb => com/microsoft/azure/spring/data/cosmosdb}/core/mapping/CosmosMappingContextUnitTest.java (100%) rename sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/{com.microsoft.azure.spring.data.cosmosdb => com/microsoft/azure/spring/data/cosmosdb}/core/query/CriteriaUnitTest.java (100%) rename sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/{com.microsoft.azure.spring.data.cosmosdb => com/microsoft/azure/spring/data/cosmosdb}/core/query/DocumentQueryUnitTest.java (100%) rename sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/{com.microsoft.azure.spring.data.cosmosdb => com/microsoft/azure/spring/data/cosmosdb}/domain/Address.java (100%) rename sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/{com.microsoft.azure.spring.data.cosmosdb => com/microsoft/azure/spring/data/cosmosdb}/domain/Contact.java (98%) rename sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/{com.microsoft.azure.spring.data.cosmosdb => com/microsoft/azure/spring/data/cosmosdb}/domain/Course.java (100%) rename sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/{com.microsoft.azure.spring.data.cosmosdb => com/microsoft/azure/spring/data/cosmosdb}/domain/Customer.java (97%) rename sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/{com.microsoft.azure.spring.data.cosmosdb => com/microsoft/azure/spring/data/cosmosdb}/domain/Importance.java (100%) rename sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/{com.microsoft.azure.spring.data.cosmosdb => com/microsoft/azure/spring/data/cosmosdb}/domain/IntegerIdDomain.java (100%) rename sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/{com.microsoft.azure.spring.data.cosmosdb => com/microsoft/azure/spring/data/cosmosdb}/domain/Memo.java (100%) rename sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/{com.microsoft.azure.spring.data.cosmosdb => com/microsoft/azure/spring/data/cosmosdb}/domain/NoDBAnnotationPerson.java (98%) rename sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/{com.microsoft.azure.spring.data.cosmosdb => com/microsoft/azure/spring/data/cosmosdb}/domain/PageableAddress.java (98%) rename sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/{com.microsoft.azure.spring.data.cosmosdb => com/microsoft/azure/spring/data/cosmosdb}/domain/PageableMemo.java (98%) rename sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/{com.microsoft.azure.spring.data.cosmosdb => com/microsoft/azure/spring/data/cosmosdb}/domain/PageablePerson.java (100%) rename sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/{com.microsoft.azure.spring.data.cosmosdb => com/microsoft/azure/spring/data/cosmosdb}/domain/PartitionPerson.java (98%) rename sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/{com.microsoft.azure.spring.data.cosmosdb => com/microsoft/azure/spring/data/cosmosdb}/domain/Person.java (99%) rename sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/{com.microsoft.azure.spring.data.cosmosdb => com/microsoft/azure/spring/data/cosmosdb}/domain/Project.java (99%) rename sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/{com.microsoft.azure.spring.data.cosmosdb => com/microsoft/azure/spring/data/cosmosdb}/domain/Question.java (100%) rename sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/{com.microsoft.azure.spring.data.cosmosdb => com/microsoft/azure/spring/data/cosmosdb}/domain/Role.java (98%) rename sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/{com.microsoft.azure.spring.data.cosmosdb => com/microsoft/azure/spring/data/cosmosdb}/domain/SortedProject.java (98%) rename sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/{com.microsoft.azure.spring.data.cosmosdb => com/microsoft/azure/spring/data/cosmosdb}/domain/SpELBeanStudent.java (100%) rename sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/{com.microsoft.azure.spring.data.cosmosdb => com/microsoft/azure/spring/data/cosmosdb}/domain/SpELPropertyStudent.java (100%) rename sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/{com.microsoft.azure.spring.data.cosmosdb => com/microsoft/azure/spring/data/cosmosdb}/domain/Student.java (98%) rename sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/{com.microsoft.azure.spring.data.cosmosdb => com/microsoft/azure/spring/data/cosmosdb}/domain/TimeToLiveSample.java (93%) rename sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/{com.microsoft.azure.spring.data.cosmosdb => com/microsoft/azure/spring/data/cosmosdb}/domain/inheritance/Shape.java (100%) rename sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/{com.microsoft.azure.spring.data.cosmosdb => com/microsoft/azure/spring/data/cosmosdb}/domain/inheritance/Square.java (100%) rename sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/{com.microsoft.azure.spring.data.cosmosdb => com/microsoft/azure/spring/data/cosmosdb}/performance/PerfConfiguration.java (100%) rename sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/{com.microsoft.azure.spring.data.cosmosdb => com/microsoft/azure/spring/data/cosmosdb}/performance/PerformanceCompare.java (100%) rename sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/{com.microsoft.azure.spring.data.cosmosdb => com/microsoft/azure/spring/data/cosmosdb}/performance/PerformanceReport.java (100%) rename sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/{com.microsoft.azure.spring.data.cosmosdb => com/microsoft/azure/spring/data/cosmosdb}/performance/domain/PerfPerson.java (100%) rename sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/{com.microsoft.azure.spring.data.cosmosdb => com/microsoft/azure/spring/data/cosmosdb}/performance/repository/PerfPersonRepository.java (100%) rename sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/{com.microsoft.azure.spring.data.cosmosdb => com/microsoft/azure/spring/data/cosmosdb}/performance/service/SdkService.java (96%) rename sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/{com.microsoft.azure.spring.data.cosmosdb => com/microsoft/azure/spring/data/cosmosdb}/performance/utils/Constants.java (100%) rename sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/{com.microsoft.azure.spring.data.cosmosdb => com/microsoft/azure/spring/data/cosmosdb}/performance/utils/DatabaseUtils.java (90%) rename sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/{com.microsoft.azure.spring.data.cosmosdb => com/microsoft/azure/spring/data/cosmosdb}/performance/utils/FunctionUtils.java (100%) rename sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/{com.microsoft.azure.spring.data.cosmosdb => com/microsoft/azure/spring/data/cosmosdb}/performance/utils/PerfDataProvider.java (100%) rename sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/{com.microsoft.azure.spring.data.cosmosdb => com/microsoft/azure/spring/data/cosmosdb}/repository/CosmosAnnotationUnitTest.java (100%) rename sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/{com.microsoft.azure.spring.data.cosmosdb => com/microsoft/azure/spring/data/cosmosdb}/repository/SimpleCosmosRepositoryIllegalTest.java (100%) rename sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/{com.microsoft.azure.spring.data.cosmosdb => com/microsoft/azure/spring/data/cosmosdb}/repository/SimpleCosmosRepositoryUnitTest.java (100%) rename sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/{com.microsoft.azure.spring.data.cosmosdb => com/microsoft/azure/spring/data/cosmosdb}/repository/TestRepositoryConfig.java (100%) rename sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/{com.microsoft.azure.spring.data.cosmosdb => com/microsoft/azure/spring/data/cosmosdb}/repository/config/CosmosRepositoryConfigurationExtensionUnitTest.java (100%) rename sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/{com.microsoft.azure.spring.data.cosmosdb => com/microsoft/azure/spring/data/cosmosdb}/repository/config/ReactiveCosmosRepositoryConfigurationExtensionUnitTest.java (100%) rename sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/{com.microsoft.azure.spring.data.cosmosdb => com/microsoft/azure/spring/data/cosmosdb}/repository/integration/AddressRepositoryIT.java (98%) rename sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/{com.microsoft.azure.spring.data.cosmosdb => com/microsoft/azure/spring/data/cosmosdb}/repository/integration/ContactRepositoryIT.java (97%) rename sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/{com.microsoft.azure.spring.data.cosmosdb => com/microsoft/azure/spring/data/cosmosdb}/repository/integration/CosmosAnnotationIT.java (100%) rename sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/{com.microsoft.azure.spring.data.cosmosdb => com/microsoft/azure/spring/data/cosmosdb}/repository/integration/CustomerRepositoryIT.java (96%) rename sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/{com.microsoft.azure.spring.data.cosmosdb => com/microsoft/azure/spring/data/cosmosdb}/repository/integration/IntegerIdDomainRepositoryIT.java (98%) rename sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/{com.microsoft.azure.spring.data.cosmosdb => com/microsoft/azure/spring/data/cosmosdb}/repository/integration/MemoRepositoryIT.java (98%) rename sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/{com.microsoft.azure.spring.data.cosmosdb => com/microsoft/azure/spring/data/cosmosdb}/repository/integration/PageableAddressRepositoryIT.java (100%) rename sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/{com.microsoft.azure.spring.data.cosmosdb => com/microsoft/azure/spring/data/cosmosdb}/repository/integration/PageableMemoRepositoryIT.java (97%) rename sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/{com.microsoft.azure.spring.data.cosmosdb => com/microsoft/azure/spring/data/cosmosdb}/repository/integration/PageablePersonRepositoryIT.java (97%) rename sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/{com.microsoft.azure.spring.data.cosmosdb => com/microsoft/azure/spring/data/cosmosdb}/repository/integration/PersonRepositoryIT.java (100%) rename sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/{com.microsoft.azure.spring.data.cosmosdb => com/microsoft/azure/spring/data/cosmosdb}/repository/integration/ProjectRepositoryIT.java (98%) rename sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/{com.microsoft.azure.spring.data.cosmosdb => com/microsoft/azure/spring/data/cosmosdb}/repository/integration/ProjectRepositorySortIT.java (98%) rename sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/{com.microsoft.azure.spring.data.cosmosdb => com/microsoft/azure/spring/data/cosmosdb}/repository/integration/QuestionRepositoryIT.java (96%) rename sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/{com.microsoft.azure.spring.data.cosmosdb => com/microsoft/azure/spring/data/cosmosdb}/repository/integration/ReactiveCourseRepositoryIT.java (100%) rename sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/{com.microsoft.azure.spring.data.cosmosdb => com/microsoft/azure/spring/data/cosmosdb}/repository/integration/SpELCosmosDBAnnotationIT.java (100%) rename sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/{com.microsoft.azure.spring.data.cosmosdb => com/microsoft/azure/spring/data/cosmosdb}/repository/integration/SquareRepositoryIT.java (100%) rename sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/{com.microsoft.azure.spring.data.cosmosdb => com/microsoft/azure/spring/data/cosmosdb}/repository/integration/StudentRepositoryIT.java (97%) rename sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/{com.microsoft.azure.spring.data.cosmosdb => com/microsoft/azure/spring/data/cosmosdb}/repository/repository/AddressRepository.java (100%) rename sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/{com.microsoft.azure.spring.data.cosmosdb => com/microsoft/azure/spring/data/cosmosdb}/repository/repository/ContactRepository.java (100%) rename sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/{com.microsoft.azure.spring.data.cosmosdb => com/microsoft/azure/spring/data/cosmosdb}/repository/repository/CustomerRepository.java (100%) rename sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/{com.microsoft.azure.spring.data.cosmosdb => com/microsoft/azure/spring/data/cosmosdb}/repository/repository/IntegerIdDomainRepository.java (100%) rename sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/{com.microsoft.azure.spring.data.cosmosdb => com/microsoft/azure/spring/data/cosmosdb}/repository/repository/MemoRepository.java (100%) rename sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/{com.microsoft.azure.spring.data.cosmosdb => com/microsoft/azure/spring/data/cosmosdb}/repository/repository/PageableAddressRepository.java (100%) rename sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/{com.microsoft.azure.spring.data.cosmosdb => com/microsoft/azure/spring/data/cosmosdb}/repository/repository/PageableMemoRepository.java (100%) rename sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/{com.microsoft.azure.spring.data.cosmosdb => com/microsoft/azure/spring/data/cosmosdb}/repository/repository/PageablePersonRepository.java (100%) rename sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/{com.microsoft.azure.spring.data.cosmosdb => com/microsoft/azure/spring/data/cosmosdb}/repository/repository/PartitionPersonRepository.java (100%) rename sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/{com.microsoft.azure.spring.data.cosmosdb => com/microsoft/azure/spring/data/cosmosdb}/repository/repository/PersonRepository.java (100%) rename sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/{com.microsoft.azure.spring.data.cosmosdb => com/microsoft/azure/spring/data/cosmosdb}/repository/repository/ProjectRepository.java (100%) rename sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/{com.microsoft.azure.spring.data.cosmosdb => com/microsoft/azure/spring/data/cosmosdb}/repository/repository/QuestionRepository.java (100%) rename sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/{com.microsoft.azure.spring.data.cosmosdb => com/microsoft/azure/spring/data/cosmosdb}/repository/repository/ReactiveCourseRepository.java (100%) rename sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/{com.microsoft.azure.spring.data.cosmosdb => com/microsoft/azure/spring/data/cosmosdb}/repository/repository/SortedProjectRepository.java (100%) rename sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/{com.microsoft.azure.spring.data.cosmosdb => com/microsoft/azure/spring/data/cosmosdb}/repository/repository/SquareRepository.java (100%) rename sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/{com.microsoft.azure.spring.data.cosmosdb => com/microsoft/azure/spring/data/cosmosdb}/repository/repository/StudentRepository.java (100%) rename sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/{com.microsoft.azure.spring.data.cosmosdb => com/microsoft/azure/spring/data/cosmosdb}/repository/support/CosmosEntityInformationUnitTest.java (99%) rename sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/{com.microsoft.azure.spring.data.cosmosdb => com/microsoft/azure/spring/data/cosmosdb}/repository/support/CosmosRepositoryFactoryBeanUnitTest.java (100%) rename sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/{com.microsoft.azure.spring.data.cosmosdb => com/microsoft/azure/spring/data/cosmosdb}/repository/support/CosmosRepositoryFactoryUnitTest.java (100%) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 670f9828cc167..e05646bfe713a 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -17,7 +17,7 @@ /sdk/core/ @alzimmermsft @jianghaolu @srnagar @hemanttanwar @anuchandy /sdk/core/azure-core-tracing-opentelemetry/ @samvaity @alzimmermsft /sdk/cosmos/ @moderakh @kushagraThapar @David-Noble-at-work @kirankumarkolli @mbhaskar -/sdk/cosmos/azure-spring-data-cosmosdb/ @kushagraThapar +/sdk/cosmos/azure-spring-data-cosmosdb/ @kushagraThapar @saragluna @yiliuTo @chenrujun @zhoufenqin @jialindai /sdk/eventhubs/ @conniey @srnagar @mssfang /sdk/formrecognizer/ @samvaity @mssfang @sima-zhu /sdk/identity/ @schaabs @g2vinay @jianghaolu @@ -27,7 +27,7 @@ /sdk/servicebus/ @yvgopal @nemakam @hemanttanwar @conniey /sdk/storage/ @amishra-dev @rickle-msft @jaschrep-msft @gapra-msft @alzimmermsft @sima-zhu /sdk/textanalytics/ @samvaity @mssfang @sima-zhu -/sdk/spring/ @saragluna @yiliuTo @chenrujun @jialindai +/sdk/spring/ @saragluna @yiliuTo @chenrujun @zhoufenqin @jialindai # end to end tests /sdk/e2e/ @jianghaolu @g2vinay diff --git a/.gitignore b/.gitignore index b95a70475b316..8071d0f700c3d 100644 --- a/.gitignore +++ b/.gitignore @@ -68,3 +68,4 @@ package-lock.json # VS Code .vscode/ .factorypath +jacoco.exec diff --git a/eng/pipelines/templates/stages/cosmos-sdk-client.yml b/eng/pipelines/templates/stages/cosmos-sdk-client.yml index 3fea2eef3eea3..d59a746bd1bc7 100644 --- a/eng/pipelines/templates/stages/cosmos-sdk-client.yml +++ b/eng/pipelines/templates/stages/cosmos-sdk-client.yml @@ -94,6 +94,7 @@ stages: DisplayName: 'Emulator only Integration Tests' PROTOCOLS: '["Tcp"]' DESIRED_CONSISTENCIES: '["Strong", "Session"]' + AdditionalArgs: '-DargLine="-DACCOUNT_HOST=https://localhost:8081/"' Https_Integration_Tests_Java8: OSVmImage: 'windows-2019' JavaTestVersion: '1.8' @@ -101,10 +102,17 @@ stages: DisplayName: 'Emulator only Integration Tests' PROTOCOLS: '["Https"]' DESIRED_CONSISTENCIES: '["Strong", "Session"]' + AdditionalArgs: '-DargLine="-DACCOUNT_HOST=https://localhost:8081/"' + Spring_Integration_Tests_Java8: + OSVmImage: 'windows-2019' + JavaTestVersion: '1.8' + ProfileFlag: '-P integration-test-emulator' + DisplayName: 'Spring Emulator only Integration Tests' + AdditionalArgs: '-DargLine="-DACCOUNT_HOST=https://localhost:8081/ -DACCOUNT_KEY=C2y6yDjf5/R+ob0N8A7Cgv30VRDJIWEHLM+4QDU5DE2nQ9nDuVTqobD4b8mGGyPMbIZnqyMsEcaGQy67XIw/Jw== -DSECONDARY_ACCOUNT_KEY=C2y6yDjf5/R+ob0N8A7Cgv30VRDJIWEHLM+4QDU5DE2nQ9nDuVTqobD4b8mGGyPMbIZnqyMsEcaGQy67XIw/Jw=="' TestStepMavenInputs: goals: 'verify' - options: '$(ProfileFlag) -Dgpg.skip -DargLine="-DACCOUNT_HOST=https://localhost:8081/" -pl $(ProjectList)' + options: '$(ProfileFlag) -Dgpg.skip $(AdditionalArgs) -pl $(ProjectList)' mavenAuthenticateFeed: true jdkVersionOption: $(JavaTestVersion) diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/Contributing.md b/sdk/cosmos/azure-spring-data-cosmosdb/Contributing.md new file mode 100644 index 0000000000000..b22da7d47c965 --- /dev/null +++ b/sdk/cosmos/azure-spring-data-cosmosdb/Contributing.md @@ -0,0 +1,62 @@ +# Contributing +This instruction is guideline for building and code contribution. + +## Prequisites +- JDK 1.8 and above +- [Maven](http://maven.apache.org/) 3.0 and above + +## Build from source +To build the project, run maven commands. + +```bash +git clone https://github.com/Azure/azure-sdk-for-java.git +cd sdk/cosmos/azure-spring-data-cosmosdb +mvnw clean install +``` + +## Test +There're integration tests on azure and on emulator to trigger integration test execution against Azure Cosmos DB and against [Azure Cosmos DB Emulator](https://docs.microsoft.com/azure/cosmos-db/local-emulator), you need to follow the link to setup emulator before test execution. + +- Run unit tests +```bash +mvnw clean install +``` + +- Run integration tests + - on Azure + >**NOTE** Please note that integration test against Azure requires Azure Cosmos DB Document API and will automatically create a Cosmos database in your Azure subscription, then there will be **Azure usage fee.** + + Integration tests will require a Azure Subscription. If you don't already have an Azure subscription, you can activate your [MSDN subscriber benefits](https://azure.microsoft.com/pricing/member-offers/msdn-benefits-details/) or sign up for a [free Azure account](https://azure.microsoft.com/free/). + + 1. Create an Azure Cosmos DB on Azure. + - Go to [Azure portal](https://portal.azure.com/) and click +New. + - Click Databases, and then click Azure Cosmos DB to create your database. + - Navigate to the database you have created, and click Access keys and copy your URI and access keys for your database. + + 2. Set environment variables ACCOUNT_HOST, ACCOUNT_KEY and SECONDARY_ACCOUNT_KEY, where value of them are Cosmos account URI, primary key and secondary key. + 3. Run maven command with `integration-test-azure` profile. + + ```bash + set ACCOUNT_HOST=your-cosmos-account-uri + set ACCOUNT_KEY=your-cosmos-account-primary-key + set SECONDARY_ACCOUNT_KEY=your-cosmos-account-secondary-key + mvnw -P integration-test-azure clean install + ``` + - on Emulator + + Setup Azure Cosmos DB Emulator by following [this instruction](https://docs.microsoft.com/azure/cosmos-db/local-emulator), and set associated environment variables. Then run test with: + ```bash + mvnw -P integration-test-emulator install + ``` + + +- Skip tests execution +```bash +mvnw clean install -DskipTests +``` + +## Version management +Developing version naming convention is like `0.1.2-beta.1`. Release version naming convention is like `0.1.2`. + +## Contribute to code +Contribution is welcome. Please follow [this instruction](https://github.com/Azure/azure-sdk-for-java/blob/master/CONTRIBUTING.md) to contribute code. diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/README.md b/sdk/cosmos/azure-spring-data-cosmosdb/README.md index c181d5b5ff53b..c6e8f26a27727 100644 --- a/sdk/cosmos/azure-spring-data-cosmosdb/README.md +++ b/sdk/cosmos/azure-spring-data-cosmosdb/README.md @@ -1,342 +1,25 @@ -[![Travis CI](https://travis-ci.org/Microsoft/spring-data-cosmosdb.svg?branch=master)](https://travis-ci.org/Microsoft/spring-data-cosmosdb) -[![codecov](https://codecov.io/gh/Microsoft/spring-data-cosmosdb/branch/master/graph/badge.svg)](https://codecov.io/gh/Microsoft/spring-data-cosmosdb) -[![MIT License](http://img.shields.io/badge/license-MIT-green.svg) ](https://github.com/Microsoft/spring-data-cosmosdb/blob/master/LICENSE) - - #Azure Cosmos DB client library for Java ## Getting started -[Azure Cosmos DB](https://docs.microsoft.com/en-us/azure/cosmos-db/introduction) is a globally-distributed database service that allows developers to work with data using a variety of standard APIs, such as SQL, MongoDB, Cassandra, Graph, and Table. - -**Spring Data Azure Cosmos DB** provides initial Spring Data support for Azure Cosmos DB using the [SQL API](https://docs.microsoft.com/en-us/azure/cosmos-db/sql-api-introduction), based on Spring Data framework. Currently it only supports SQL API, the other APIs are in the plan. ## TOC -* [Examples](#Examples) -* [Spring data version support](#spring-data-version-support) -* [Feature List](#feature-list) -* [Quick Start](#quick-start) -* [Query Partitioned Collection](QueryPartitionedCollection.md) -* [Snapshots](#snapshots) -* [Troubleshooting](#Troubleshooting) -* [Contributing](#Contributing) -* [Code of Conduct](#code-of-conduct) -* [Key concepts](#Key concepts) -* [Next steps](#Next steps) - ## Examples -Please refer to [sample project here](./samplecode). ## Spring Data Version Support -Version mapping between spring boot and spring-data-cosmosdb: - -| Spring boot version | spring-data-cosmosdb version | -| :----------------------------------------------------------:|:-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------:| -| ![version](https://img.shields.io/badge/version-2.3.x-blue) | [![Maven Central](https://img.shields.io/maven-central/v/com.microsoft.azure/spring-data-cosmosdb/2.3.svg)](https://search.maven.org/search?q=g:com.microsoft.azure%20AND%20a:spring-data-cosmosdb%20AND%20v:2.3.*) | -| ![version](https://img.shields.io/badge/version-2.2.x-blue) | [![Maven Central](https://img.shields.io/maven-central/v/com.microsoft.azure/spring-data-cosmosdb/2.2.svg)](https://search.maven.org/search?q=g:com.microsoft.azure%20AND%20a:spring-data-cosmosdb%20AND%20v:2.2.*) | -| ![version](https://img.shields.io/badge/version-2.1.x-blue) | [![Maven Central](https://img.shields.io/maven-central/v/com.microsoft.azure/spring-data-cosmosdb/2.1.svg)](https://search.maven.org/search?q=g:com.microsoft.azure%20AND%20a:spring-data-cosmosdb%20AND%20v:2.1.*) | -| ![version](https://img.shields.io/badge/version-2.0.x-blue) | [![Maven Central](https://img.shields.io/maven-central/v/com.microsoft.azure/spring-data-cosmosdb/2.0.svg)](https://search.maven.org/search?q=g:com.microsoft.azure%20AND%20a:spring-data-cosmosdb%20AND%20v:2.0.*) | ## Feature List -- Spring Data ReactiveCrudRepository CrudRepository basic CRUD functionality - - save - - findAll - - findOne by Id - - deleteAll - - delete by Id - - delete entity -- Spring Data [@Id](https://github.com/spring-projects/spring-data-commons/blob/db62390de90c93a78743c97cc2cc9ccd964994a5/src/main/java/org/springframework/data/annotation/Id.java) annotation. - There're 2 ways to map a field in domain class to `id` field of Azure Cosmos DB document. - - annotate a field in domain class with `@Id`, this field will be mapped to document `id` in Cosmos DB. - - set name of this field to `id`, this field will be mapped to document `id` in Azure Cosmos DB. -- Custom collection Name. - By default, collection name will be class name of user domain class. To customize it, add the `@Document(collection="myCustomCollectionName")` annotation to the domain class. The collection field also supports SpEL expressions (eg. `collection = "${dynamic.collection.name}"` or `collection = "#{@someBean.getContainerName()}"`) in order to provide collection names programmatically/via configuration properties. -- Custom IndexingPolicy - By default, IndexingPolicy will be set by azure service. To customize it add annotation `@DocumentIndexingPolicy` to domain class. This annotation has 4 attributes to customize, see following: -```java - boolean automatic; // Indicate if indexing policy use automatic or not - IndexingMode mode; // Indexing policy mode, option Consistent|Lazy|None. - String[] includePaths; // Included paths for indexing - String[] excludePaths; // Excluded paths for indexing -``` -- Supports Optimistic Locking for specific collections, which means upserts/deletes by document will fail with an exception in case the document was modified by another process in the meanwhile. To enable Optimistic Locking for a collection, just create a string `_etag` field and mark it with the `@Version` annotation. See the following: - -```java -@Document(collection = "myCollection") -class MyDocument { - String id; - String data; - @Version - String _etag; -} -``` -- Supports [Azure Cosmos DB partition](https://docs.microsoft.com/en-us/azure/cosmos-db/partition-data). To specify a field of domain class to be partition key field, just annotate it with `@PartitionKey`. When you do CRUD operation, pls specify your partition value. For more sample on partition CRUD, pls refer to [test here](./src/test/java/com/microsoft/azure/spring/data/cosmosdb/repository/integration/AddressRepositoryIT.java) -- Supports [Spring Data custom query](https://docs.spring.io/spring-data/commons/docs/current/reference/html/#repositories.query-methods.details) find operation, e.g., `findByAFieldAndBField` -- Supports [Spring Data pagable and sort](https://docs.spring.io/spring-data/commons/docs/current/reference/html/#repositories.special-parameters). - - Based on available RUs on the database account, cosmosDB can return documents less than or equal to the requested size. - - Due to this variable number of returned documents in every iteration, user should not rely on the totalPageSize, and instead iterating over pageable should be done in this way. -```java - final CosmosPageRequest pageRequest = new CosmosPageRequest(0, pageSize, null); - Page page = tRepository.findAll(pageRequest); - List pageContent = page.getContent(); - while(page.hasNext()) { - Pageable nextPageable = page.nextPageable(); - page = repository.findAll(nextPageable); - pageContent = page.getContent(); - } -``` -- Supports [spring-boot-starter-data-rest](https://projects.spring.io/spring-data-rest/). -- Supports List and nested type in domain class. -- Configurable ObjectMapper bean with unique name `cosmosdbObjectMapper`, only configure customized ObjectMapper if you really need to. e.g., -```java - @Bean(name = "cosmosdbObjectMapper") - public ObjectMapper objectMapper() { - return new ObjectMapper(); // Do configuration to the ObjectMapper if required - } -``` ## Quick Start -### Add the dependency -`spring-data-cosmosdb` is published on Maven Central Repository. -If you are using Maven, add the following dependency. - -```xml - - com.microsoft.azure - spring-data-cosmosdb - 2.2.4 - -``` - -### Setup Configuration -Setup configuration class. - -CosmosKeyCredential feature provides capability to rotate keys on the fly. You can switch keys using switchToSecondaryKey(). -For more information on this, see the Sample Application code. - -### Sync and Reactive Repository support -2.2.x supports both sync and reactive repository support. - -Use `@EnableCosmosRepositories` to enable sync repository support. - -For reactive repository support, use `@EnableReactiveCosmosRepositories` - -### Response Diagnostics String and Query Metrics -2.2.x supports Response Diagnostics String and Query Metrics. -Set `populateQueryMetrics` flag to true in application.properties to enable query metrics. -In addition to setting the flag, implement `ResponseDiagnosticsProcessor` to log diagnostics information. - -```java -@Configuration -@EnableCosmosRepositories -@Slf4j -public class AppConfiguration extends AbstractCosmosConfiguration { - - @Value("${azure.cosmosdb.uri}") - private String uri; - - @Value("${azure.cosmosdb.key}") - private String key; - - @Value("${azure.cosmosdb.secondaryKey}") - private String secondaryKey; - - @Value("${azure.cosmosdb.database}") - private String dbName; - - @Value("${azure.cosmosdb.populateQueryMetrics}") - private boolean populateQueryMetrics; - - private CosmosKeyCredential cosmosKeyCredential; - - public CosmosDBConfig getConfig() { - this.cosmosKeyCredential = new CosmosKeyCredential(key); - CosmosDbConfig cosmosdbConfig = CosmosDBConfig.builder(uri, - this.cosmosKeyCredential, dbName).build(); - cosmosdbConfig.setPopulateQueryMetrics(populateQueryMetrics); - cosmosdbConfig.setResponseDiagnosticsProcessor(new ResponseDiagnosticsProcessorImplementation()); - return cosmosdbConfig; - } - - public void switchToSecondaryKey() { - this.cosmosKeyCredential.key(secondaryKey); - } - - private static class ResponseDiagnosticsProcessorImplementation implements ResponseDiagnosticsProcessor { - - @Override - public void processResponseDiagnostics(@Nullable ResponseDiagnostics responseDiagnostics) { - log.info("Response Diagnostics {}", responseDiagnostics); - } - } - -} -``` -Or if you want to customize your config: -```java -public CosmosDBConfig getConfig() { - this.cosmosKeyCredential = new CosmosKeyCredential(key); - CosmosDBConfig cosmosDbConfig = CosmosDBConfig.builder(uri, this.cosmosKeyCredential, dbName).build(); - cosmosDbConfig.getConnectionPolicy().setConnectionMode(ConnectionMode.DIRECT); - cosmosDbConfig.getConnectionPolicy().setMaxPoolSize(1000); - return cosmosDbConfig; -} -``` -By default, `@EnableCosmosRepositories` will scan the current package for any interfaces that extend one of Spring Data's repository interfaces. Using it to annotate your Configuration class to scan a different root package by type if your project layout has multiple projects and it's not finding your repositories. -```java -@Configuration -@EnableCosmosRepositories(basePackageClass=UserRepository.class) -public class AppConfiguration extends AbstractCosmosConfiguration { - // configuration code -} -``` - - -### Define an entity -Define a simple entity as Document in Azure Cosmos DB. - -You can define entities by adding the `@Document` annotation and specifying properties related to the container, such as the container name, request units (RUs), time to live, and auto-create container. - -Containers are created automatically unless you don't want them to: Set `autoCreateCollection` to false in `@Document` annotation to disable auto creation of containers. - -Note: By default request units assigned to newly created containers is 4000. Specify different ru value to customize request units for container created by the SDK (minimum RU value is 400). - -```java -@Document(collection = "myCollection", ru = "400") -public class User { - private String id; - private String firstName; - - @PartitionKey - private String lastName; - - ... // setters and getters - - public User() { - // If you do not want to create a default constructor, - // use annotation @JsonCreator and @JsonProperty in the full args constructor - } - - public User(String id, String firstName, String lastName) { - this.id = id; - this.firstName = firstName; - this.lastName = lastName; - } - - @Override - public String toString() { - return String.format("User: %s %s, %s", firstName, lastName, id); - } -} -``` -`id` field will be used as document id in Azure Cosmos DB. If you want use another field like `emailAddress` as document `id`, just annotate that field with `@Id` annotation. - -Annotation `@Document(collection="mycollection")` is used to specify collection name in Azure Cosmos DB. -Annotation `@PartitionKey` on `lastName` field is used to specify this field be partition key in Azure Cosmos DB. - -```java -@Document(collection = "mycollection") -public class User { - @Id - private String emailAddress; - - ... -} -``` - -### Create repositories -Extends CosmosRepository interface, which provides Spring Data repository support. - -```java -import CosmosRepository; -import org.springframework.stereotype.Repository; - -@Repository -public interface UserRepository extends CosmosRepository { - List findByFirstName(String firstName); -} -``` - -`findByFirstName` method is custom query method, it will find documents per FirstName. - -### Create an Application class -Here create an application class with all the components - -```java -@SpringBootApplication -public class SampleApplication implements CommandLineRunner { - - @Autowired - private UserRepository repository; - - @Autowired - private ApplicationContext applicationContext; - - public static void main(String[] args) { - SpringApplication.run(SampleApplication.class, args); - } - - public void run(String... var1) throws Exception { - - final User testUser = new User("testId", "testFirstName", "testLastName"); - - repository.deleteAll(); - repository.save(testUser); - - // to find by Id, please specify partition key value if collection is partitioned - final User result = repository.findOne(testUser.getId(), testUser.getLastName); - // if emailAddress is mapped to id, then - // final User result = respository.findOne(testUser.getEmailAddress(), testUser.getLastName()); - - // Switch to secondary key - UserRepositoryConfiguration bean = - applicationContext.getBean(UserRepositoryConfiguration.class); - bean.switchToSecondaryKey(); - - // Now repository will use secondary key - repository.save(testUser); - - } -} -``` -Autowired UserRepository interface, then can do save, delete and find operations. Spring Data Azure Cosmos DB uses the CosmosTemplate to execute the queries behind *find*, *save* methods. You can use the template yourself for more complex queries. - ## Snapshots -[![Nexus OSS](https://img.shields.io/nexus/snapshots/https/oss.sonatype.org/com.microsoft.azure/spring-data-cosmosdb.svg)](https://oss.sonatype.org/content/repositories/snapshots/com/microsoft/azure/spring-data-cosmosdb/) - -Snapshots built from `master` branch are available, add [maven repositories](https://maven.apache.org/settings.html#Repositories) configuration to your pom file as below. -```xml - - - nexus-snapshots - https://oss.sonatype.org/content/repositories/snapshots/ - - true - always - - - -``` ## Troubleshooting -If you encounter any bug, please file an issue [here](https://github.com/Microsoft/spring-data-cosmosdb/issues/new). - -To suggest a new feature or changes that could be made, file an issue the same way you would for a bug. - ## Contributing -Contribution is welcome. Please follow [this instruction](https://github.com/Azure/azure-sdk-for-java/blob/master/CONTRIBUTING.md) to contribute code. - ## Code of Conduct -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. - -### Data/Telemetry - - This project collects usage data and sends it to Microsoft to help improve our products and services. Read our [privacy](https://privacy.microsoft.com/en-us/privacystatement) statement to learn more. - ## Key concepts ## Next steps diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/pom.xml b/sdk/cosmos/azure-spring-data-cosmosdb/pom.xml index c173ad25dd9a9..bd96baf15b134 100644 --- a/sdk/cosmos/azure-spring-data-cosmosdb/pom.xml +++ b/sdk/cosmos/azure-spring-data-cosmosdb/pom.xml @@ -13,7 +13,7 @@ com.microsoft.azure spring-data-cosmosdb 2.3.1-beta.1 - + jar Spring Data for Azure Cosmos DB SQL API Spring Data for Azure Cosmos DB SQL API https://github.com/Microsoft/spring-data-cosmosdb @@ -213,29 +213,6 @@ - - org.codehaus.mojo - cobertura-maven-plugin - 2.7 - - - html - xml - - - true - 65 - 65 - - - - com/microsoft/azure/**/GetHashMac.class - com/microsoft/azure/**/Constants.class - - - - - org.apache.maven.plugins maven-failsafe-plugin @@ -254,22 +231,72 @@ + org.apache.maven.plugins maven-javadoc-plugin 3.1.1 - private - - BasicCosmosPersistentProperty.java - + com/microsoft/azure/spring/data/cosmosdb/core/mapping/BasicCosmosPersistentProperty.java - ${basedir}/src/main/java/com/microsoft/azure/spring/data/cosmosdb/core/mapping/ + + + org.projectlombok + lombok + 1.18.6 + + - + + + dev + + true + + + dev + true + false + false + + + + integration-test-azure + + integration-test-azure + false + true + false + + + + integration-test-emulator + + integration-test-emulator + false + false + true + + + + + org.apache.maven.plugins + maven-failsafe-plugin + 2.22.0 + + + + **/PageablePersonRepositoryIT.java + + + + + + + diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com.microsoft.azure.spring.data.cosmosdb/Constants.java b/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/Constants.java similarity index 100% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com.microsoft.azure.spring.data.cosmosdb/Constants.java rename to sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/Constants.java diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com.microsoft.azure.spring.data.cosmosdb/CosmosDbFactory.java b/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/CosmosDbFactory.java similarity index 100% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com.microsoft.azure.spring.data.cosmosdb/CosmosDbFactory.java rename to sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/CosmosDbFactory.java diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com.microsoft.azure.spring.data.cosmosdb/common/CosmosdbUtils.java b/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/common/CosmosdbUtils.java similarity index 100% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com.microsoft.azure.spring.data.cosmosdb/common/CosmosdbUtils.java rename to sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/common/CosmosdbUtils.java diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com.microsoft.azure.spring.data.cosmosdb/common/ExpressionResolver.java b/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/common/ExpressionResolver.java similarity index 100% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com.microsoft.azure.spring.data.cosmosdb/common/ExpressionResolver.java rename to sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/common/ExpressionResolver.java diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com.microsoft.azure.spring.data.cosmosdb/common/MacAddress.java b/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/common/MacAddress.java similarity index 100% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com.microsoft.azure.spring.data.cosmosdb/common/MacAddress.java rename to sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/common/MacAddress.java diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com.microsoft.azure.spring.data.cosmosdb/common/Memoizer.java b/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/common/Memoizer.java similarity index 100% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com.microsoft.azure.spring.data.cosmosdb/common/Memoizer.java rename to sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/common/Memoizer.java diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com.microsoft.azure.spring.data.cosmosdb/common/PropertyLoader.java b/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/common/PropertyLoader.java similarity index 100% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com.microsoft.azure.spring.data.cosmosdb/common/PropertyLoader.java rename to sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/common/PropertyLoader.java diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com.microsoft.azure.spring.data.cosmosdb/common/TelemetryEventData.java b/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/common/TelemetryEventData.java similarity index 100% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com.microsoft.azure.spring.data.cosmosdb/common/TelemetryEventData.java rename to sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/common/TelemetryEventData.java diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com.microsoft.azure.spring.data.cosmosdb/common/TelemetrySender.java b/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/common/TelemetrySender.java similarity index 100% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com.microsoft.azure.spring.data.cosmosdb/common/TelemetrySender.java rename to sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/common/TelemetrySender.java diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com.microsoft.azure.spring.data.cosmosdb/common/package-info.java b/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/common/package-info.java similarity index 100% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com.microsoft.azure.spring.data.cosmosdb/common/package-info.java rename to sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/common/package-info.java diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com.microsoft.azure.spring.data.cosmosdb/config/AbstractCosmosConfiguration.java b/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/config/AbstractCosmosConfiguration.java similarity index 100% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com.microsoft.azure.spring.data.cosmosdb/config/AbstractCosmosConfiguration.java rename to sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/config/AbstractCosmosConfiguration.java diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com.microsoft.azure.spring.data.cosmosdb/config/CosmosConfigurationSupport.java b/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/config/CosmosConfigurationSupport.java similarity index 100% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com.microsoft.azure.spring.data.cosmosdb/config/CosmosConfigurationSupport.java rename to sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/config/CosmosConfigurationSupport.java diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com.microsoft.azure.spring.data.cosmosdb/config/CosmosDBConfig.java b/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/config/CosmosDBConfig.java similarity index 100% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com.microsoft.azure.spring.data.cosmosdb/config/CosmosDBConfig.java rename to sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/config/CosmosDBConfig.java diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com.microsoft.azure.spring.data.cosmosdb/config/package-info.java b/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/config/package-info.java similarity index 100% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com.microsoft.azure.spring.data.cosmosdb/config/package-info.java rename to sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/config/package-info.java diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com.microsoft.azure.spring.data.cosmosdb/core/CosmosOperations.java b/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/core/CosmosOperations.java similarity index 100% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com.microsoft.azure.spring.data.cosmosdb/core/CosmosOperations.java rename to sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/core/CosmosOperations.java diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com.microsoft.azure.spring.data.cosmosdb/core/CosmosTemplate.java b/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/core/CosmosTemplate.java similarity index 100% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com.microsoft.azure.spring.data.cosmosdb/core/CosmosTemplate.java rename to sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/core/CosmosTemplate.java diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com.microsoft.azure.spring.data.cosmosdb/core/ReactiveCosmosOperations.java b/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/core/ReactiveCosmosOperations.java similarity index 98% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com.microsoft.azure.spring.data.cosmosdb/core/ReactiveCosmosOperations.java rename to sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/core/ReactiveCosmosOperations.java index 64bf11e918778..e2320fd6c6792 100644 --- a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com.microsoft.azure.spring.data.cosmosdb/core/ReactiveCosmosOperations.java +++ b/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/core/ReactiveCosmosOperations.java @@ -28,7 +28,7 @@ public interface ReactiveCosmosOperations { * Use createContainerIfNotExists() instead * @param information cosmos entity information * @return Mono of cosmos container response - * @deprecated use createContainerIfNotExists(CosmosEntityInformation) instead. + * @deprecated use {@link #createContainerIfNotExists(CosmosEntityInformation)} instead. */ @Deprecated Mono createCollectionIfNotExists(CosmosEntityInformation information); diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com.microsoft.azure.spring.data.cosmosdb/core/ReactiveCosmosTemplate.java b/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/core/ReactiveCosmosTemplate.java similarity index 100% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com.microsoft.azure.spring.data.cosmosdb/core/ReactiveCosmosTemplate.java rename to sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/core/ReactiveCosmosTemplate.java diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com.microsoft.azure.spring.data.cosmosdb/core/ResponseDiagnostics.java b/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/core/ResponseDiagnostics.java similarity index 100% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com.microsoft.azure.spring.data.cosmosdb/core/ResponseDiagnostics.java rename to sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/core/ResponseDiagnostics.java diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com.microsoft.azure.spring.data.cosmosdb/core/ResponseDiagnosticsProcessor.java b/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/core/ResponseDiagnosticsProcessor.java similarity index 100% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com.microsoft.azure.spring.data.cosmosdb/core/ResponseDiagnosticsProcessor.java rename to sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/core/ResponseDiagnosticsProcessor.java diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com.microsoft.azure.spring.data.cosmosdb/core/convert/MappingCosmosConverter.java b/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/core/convert/MappingCosmosConverter.java similarity index 100% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com.microsoft.azure.spring.data.cosmosdb/core/convert/MappingCosmosConverter.java rename to sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/core/convert/MappingCosmosConverter.java diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com.microsoft.azure.spring.data.cosmosdb/core/convert/ObjectMapperFactory.java b/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/core/convert/ObjectMapperFactory.java similarity index 100% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com.microsoft.azure.spring.data.cosmosdb/core/convert/ObjectMapperFactory.java rename to sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/core/convert/ObjectMapperFactory.java diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com.microsoft.azure.spring.data.cosmosdb/core/convert/package-info.java b/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/core/convert/package-info.java similarity index 100% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com.microsoft.azure.spring.data.cosmosdb/core/convert/package-info.java rename to sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/core/convert/package-info.java diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com.microsoft.azure.spring.data.cosmosdb/core/generator/AbstractQueryGenerator.java b/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/core/generator/AbstractQueryGenerator.java similarity index 100% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com.microsoft.azure.spring.data.cosmosdb/core/generator/AbstractQueryGenerator.java rename to sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/core/generator/AbstractQueryGenerator.java diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com.microsoft.azure.spring.data.cosmosdb/core/generator/CountQueryGenerator.java b/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/core/generator/CountQueryGenerator.java similarity index 100% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com.microsoft.azure.spring.data.cosmosdb/core/generator/CountQueryGenerator.java rename to sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/core/generator/CountQueryGenerator.java diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com.microsoft.azure.spring.data.cosmosdb/core/generator/FindQuerySpecGenerator.java b/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/core/generator/FindQuerySpecGenerator.java similarity index 100% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com.microsoft.azure.spring.data.cosmosdb/core/generator/FindQuerySpecGenerator.java rename to sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/core/generator/FindQuerySpecGenerator.java diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com.microsoft.azure.spring.data.cosmosdb/core/generator/QuerySpecGenerator.java b/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/core/generator/QuerySpecGenerator.java similarity index 100% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com.microsoft.azure.spring.data.cosmosdb/core/generator/QuerySpecGenerator.java rename to sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/core/generator/QuerySpecGenerator.java diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com.microsoft.azure.spring.data.cosmosdb/core/generator/package-info.java b/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/core/generator/package-info.java similarity index 100% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com.microsoft.azure.spring.data.cosmosdb/core/generator/package-info.java rename to sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/core/generator/package-info.java diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com.microsoft.azure.spring.data.cosmosdb/core/mapping/BasicCosmosPersistentEntity.java b/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/core/mapping/BasicCosmosPersistentEntity.java similarity index 100% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com.microsoft.azure.spring.data.cosmosdb/core/mapping/BasicCosmosPersistentEntity.java rename to sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/core/mapping/BasicCosmosPersistentEntity.java diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com.microsoft.azure.spring.data.cosmosdb/core/mapping/BasicCosmosPersistentProperty.java b/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/core/mapping/BasicCosmosPersistentProperty.java similarity index 100% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com.microsoft.azure.spring.data.cosmosdb/core/mapping/BasicCosmosPersistentProperty.java rename to sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/core/mapping/BasicCosmosPersistentProperty.java diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com.microsoft.azure.spring.data.cosmosdb/core/mapping/CosmosMappingContext.java b/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/core/mapping/CosmosMappingContext.java similarity index 100% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com.microsoft.azure.spring.data.cosmosdb/core/mapping/CosmosMappingContext.java rename to sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/core/mapping/CosmosMappingContext.java diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com.microsoft.azure.spring.data.cosmosdb/core/mapping/CosmosPersistentEntity.java b/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/core/mapping/CosmosPersistentEntity.java similarity index 100% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com.microsoft.azure.spring.data.cosmosdb/core/mapping/CosmosPersistentEntity.java rename to sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/core/mapping/CosmosPersistentEntity.java diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com.microsoft.azure.spring.data.cosmosdb/core/mapping/CosmosPersistentProperty.java b/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/core/mapping/CosmosPersistentProperty.java similarity index 100% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com.microsoft.azure.spring.data.cosmosdb/core/mapping/CosmosPersistentProperty.java rename to sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/core/mapping/CosmosPersistentProperty.java diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com.microsoft.azure.spring.data.cosmosdb/core/mapping/Document.java b/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/core/mapping/Document.java similarity index 100% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com.microsoft.azure.spring.data.cosmosdb/core/mapping/Document.java rename to sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/core/mapping/Document.java diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com.microsoft.azure.spring.data.cosmosdb/core/mapping/DocumentIndexingPolicy.java b/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/core/mapping/DocumentIndexingPolicy.java similarity index 100% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com.microsoft.azure.spring.data.cosmosdb/core/mapping/DocumentIndexingPolicy.java rename to sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/core/mapping/DocumentIndexingPolicy.java diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com.microsoft.azure.spring.data.cosmosdb/core/mapping/PartitionKey.java b/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/core/mapping/PartitionKey.java similarity index 100% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com.microsoft.azure.spring.data.cosmosdb/core/mapping/PartitionKey.java rename to sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/core/mapping/PartitionKey.java diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com.microsoft.azure.spring.data.cosmosdb/core/mapping/package-info.java b/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/core/mapping/package-info.java similarity index 100% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com.microsoft.azure.spring.data.cosmosdb/core/mapping/package-info.java rename to sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/core/mapping/package-info.java diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com.microsoft.azure.spring.data.cosmosdb/core/package-info.java b/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/core/package-info.java similarity index 100% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com.microsoft.azure.spring.data.cosmosdb/core/package-info.java rename to sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/core/package-info.java diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com.microsoft.azure.spring.data.cosmosdb/core/query/CosmosPageImpl.java b/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/core/query/CosmosPageImpl.java similarity index 100% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com.microsoft.azure.spring.data.cosmosdb/core/query/CosmosPageImpl.java rename to sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/core/query/CosmosPageImpl.java diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com.microsoft.azure.spring.data.cosmosdb/core/query/CosmosPageRequest.java b/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/core/query/CosmosPageRequest.java similarity index 100% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com.microsoft.azure.spring.data.cosmosdb/core/query/CosmosPageRequest.java rename to sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/core/query/CosmosPageRequest.java diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com.microsoft.azure.spring.data.cosmosdb/core/query/Criteria.java b/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/core/query/Criteria.java similarity index 100% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com.microsoft.azure.spring.data.cosmosdb/core/query/Criteria.java rename to sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/core/query/Criteria.java diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com.microsoft.azure.spring.data.cosmosdb/core/query/CriteriaType.java b/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/core/query/CriteriaType.java similarity index 100% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com.microsoft.azure.spring.data.cosmosdb/core/query/CriteriaType.java rename to sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/core/query/CriteriaType.java diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com.microsoft.azure.spring.data.cosmosdb/core/query/DocumentQuery.java b/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/core/query/DocumentQuery.java similarity index 100% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com.microsoft.azure.spring.data.cosmosdb/core/query/DocumentQuery.java rename to sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/core/query/DocumentQuery.java diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com.microsoft.azure.spring.data.cosmosdb/core/query/package-info.java b/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/core/query/package-info.java similarity index 100% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com.microsoft.azure.spring.data.cosmosdb/core/query/package-info.java rename to sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/core/query/package-info.java diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com.microsoft.azure.spring.data.cosmosdb/exception/ConfigurationException.java b/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/exception/ConfigurationException.java similarity index 100% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com.microsoft.azure.spring.data.cosmosdb/exception/ConfigurationException.java rename to sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/exception/ConfigurationException.java diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com.microsoft.azure.spring.data.cosmosdb/exception/CosmosDBAccessException.java b/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/exception/CosmosDBAccessException.java similarity index 100% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com.microsoft.azure.spring.data.cosmosdb/exception/CosmosDBAccessException.java rename to sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/exception/CosmosDBAccessException.java diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com.microsoft.azure.spring.data.cosmosdb/exception/CosmosDBExceptionUtils.java b/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/exception/CosmosDBExceptionUtils.java similarity index 100% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com.microsoft.azure.spring.data.cosmosdb/exception/CosmosDBExceptionUtils.java rename to sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/exception/CosmosDBExceptionUtils.java diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com.microsoft.azure.spring.data.cosmosdb/exception/DatabaseCreationException.java b/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/exception/DatabaseCreationException.java similarity index 100% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com.microsoft.azure.spring.data.cosmosdb/exception/DatabaseCreationException.java rename to sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/exception/DatabaseCreationException.java diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com.microsoft.azure.spring.data.cosmosdb/exception/IllegalCollectionException.java b/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/exception/IllegalCollectionException.java similarity index 100% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com.microsoft.azure.spring.data.cosmosdb/exception/IllegalCollectionException.java rename to sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/exception/IllegalCollectionException.java diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com.microsoft.azure.spring.data.cosmosdb/exception/IllegalQueryException.java b/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/exception/IllegalQueryException.java similarity index 100% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com.microsoft.azure.spring.data.cosmosdb/exception/IllegalQueryException.java rename to sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/exception/IllegalQueryException.java diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com.microsoft.azure.spring.data.cosmosdb/exception/package-info.java b/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/exception/package-info.java similarity index 100% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com.microsoft.azure.spring.data.cosmosdb/exception/package-info.java rename to sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/exception/package-info.java diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com.microsoft.azure.spring.data.cosmosdb/package-info.java b/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/package-info.java similarity index 100% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com.microsoft.azure.spring.data.cosmosdb/package-info.java rename to sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/package-info.java diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com.microsoft.azure.spring.data.cosmosdb/repository/CosmosRepository.java b/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/repository/CosmosRepository.java similarity index 100% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com.microsoft.azure.spring.data.cosmosdb/repository/CosmosRepository.java rename to sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/repository/CosmosRepository.java diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com.microsoft.azure.spring.data.cosmosdb/repository/ReactiveCosmosRepository.java b/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/repository/ReactiveCosmosRepository.java similarity index 100% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com.microsoft.azure.spring.data.cosmosdb/repository/ReactiveCosmosRepository.java rename to sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/repository/ReactiveCosmosRepository.java diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com.microsoft.azure.spring.data.cosmosdb/repository/config/CosmosRepositoriesRegistrar.java b/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/repository/config/CosmosRepositoriesRegistrar.java similarity index 100% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com.microsoft.azure.spring.data.cosmosdb/repository/config/CosmosRepositoriesRegistrar.java rename to sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/repository/config/CosmosRepositoriesRegistrar.java diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com.microsoft.azure.spring.data.cosmosdb/repository/config/CosmosRepositoryConfigurationExtension.java b/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/repository/config/CosmosRepositoryConfigurationExtension.java similarity index 100% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com.microsoft.azure.spring.data.cosmosdb/repository/config/CosmosRepositoryConfigurationExtension.java rename to sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/repository/config/CosmosRepositoryConfigurationExtension.java diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com.microsoft.azure.spring.data.cosmosdb/repository/config/EnableCosmosRepositories.java b/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/repository/config/EnableCosmosRepositories.java similarity index 100% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com.microsoft.azure.spring.data.cosmosdb/repository/config/EnableCosmosRepositories.java rename to sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/repository/config/EnableCosmosRepositories.java diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com.microsoft.azure.spring.data.cosmosdb/repository/config/EnableReactiveCosmosRepositories.java b/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/repository/config/EnableReactiveCosmosRepositories.java similarity index 100% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com.microsoft.azure.spring.data.cosmosdb/repository/config/EnableReactiveCosmosRepositories.java rename to sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/repository/config/EnableReactiveCosmosRepositories.java diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com.microsoft.azure.spring.data.cosmosdb/repository/config/ReactiveCosmosRepositoriesRegistrar.java b/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/repository/config/ReactiveCosmosRepositoriesRegistrar.java similarity index 100% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com.microsoft.azure.spring.data.cosmosdb/repository/config/ReactiveCosmosRepositoriesRegistrar.java rename to sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/repository/config/ReactiveCosmosRepositoriesRegistrar.java diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com.microsoft.azure.spring.data.cosmosdb/repository/config/ReactiveCosmosRepositoryConfigurationExtension.java b/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/repository/config/ReactiveCosmosRepositoryConfigurationExtension.java similarity index 100% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com.microsoft.azure.spring.data.cosmosdb/repository/config/ReactiveCosmosRepositoryConfigurationExtension.java rename to sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/repository/config/ReactiveCosmosRepositoryConfigurationExtension.java diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com.microsoft.azure.spring.data.cosmosdb/repository/config/package-info.java b/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/repository/config/package-info.java similarity index 100% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com.microsoft.azure.spring.data.cosmosdb/repository/config/package-info.java rename to sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/repository/config/package-info.java diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com.microsoft.azure.spring.data.cosmosdb/repository/package-info.java b/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/repository/package-info.java similarity index 100% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com.microsoft.azure.spring.data.cosmosdb/repository/package-info.java rename to sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/repository/package-info.java diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com.microsoft.azure.spring.data.cosmosdb/repository/query/AbstractCosmosQuery.java b/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/repository/query/AbstractCosmosQuery.java similarity index 100% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com.microsoft.azure.spring.data.cosmosdb/repository/query/AbstractCosmosQuery.java rename to sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/repository/query/AbstractCosmosQuery.java diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com.microsoft.azure.spring.data.cosmosdb/repository/query/AbstractReactiveCosmosQuery.java b/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/repository/query/AbstractReactiveCosmosQuery.java similarity index 100% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com.microsoft.azure.spring.data.cosmosdb/repository/query/AbstractReactiveCosmosQuery.java rename to sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/repository/query/AbstractReactiveCosmosQuery.java diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com.microsoft.azure.spring.data.cosmosdb/repository/query/CosmosEntityMetadata.java b/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/repository/query/CosmosEntityMetadata.java similarity index 100% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com.microsoft.azure.spring.data.cosmosdb/repository/query/CosmosEntityMetadata.java rename to sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/repository/query/CosmosEntityMetadata.java diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com.microsoft.azure.spring.data.cosmosdb/repository/query/CosmosParameter.java b/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/repository/query/CosmosParameter.java similarity index 100% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com.microsoft.azure.spring.data.cosmosdb/repository/query/CosmosParameter.java rename to sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/repository/query/CosmosParameter.java diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com.microsoft.azure.spring.data.cosmosdb/repository/query/CosmosParameterAccessor.java b/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/repository/query/CosmosParameterAccessor.java similarity index 100% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com.microsoft.azure.spring.data.cosmosdb/repository/query/CosmosParameterAccessor.java rename to sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/repository/query/CosmosParameterAccessor.java diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com.microsoft.azure.spring.data.cosmosdb/repository/query/CosmosParameterParameterAccessor.java b/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/repository/query/CosmosParameterParameterAccessor.java similarity index 100% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com.microsoft.azure.spring.data.cosmosdb/repository/query/CosmosParameterParameterAccessor.java rename to sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/repository/query/CosmosParameterParameterAccessor.java diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com.microsoft.azure.spring.data.cosmosdb/repository/query/CosmosParameters.java b/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/repository/query/CosmosParameters.java similarity index 100% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com.microsoft.azure.spring.data.cosmosdb/repository/query/CosmosParameters.java rename to sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/repository/query/CosmosParameters.java diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com.microsoft.azure.spring.data.cosmosdb/repository/query/CosmosQueryCreator.java b/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/repository/query/CosmosQueryCreator.java similarity index 100% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com.microsoft.azure.spring.data.cosmosdb/repository/query/CosmosQueryCreator.java rename to sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/repository/query/CosmosQueryCreator.java diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com.microsoft.azure.spring.data.cosmosdb/repository/query/CosmosQueryExecution.java b/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/repository/query/CosmosQueryExecution.java similarity index 100% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com.microsoft.azure.spring.data.cosmosdb/repository/query/CosmosQueryExecution.java rename to sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/repository/query/CosmosQueryExecution.java diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com.microsoft.azure.spring.data.cosmosdb/repository/query/CosmosQueryMethod.java b/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/repository/query/CosmosQueryMethod.java similarity index 100% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com.microsoft.azure.spring.data.cosmosdb/repository/query/CosmosQueryMethod.java rename to sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/repository/query/CosmosQueryMethod.java diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com.microsoft.azure.spring.data.cosmosdb/repository/query/PartTreeCosmosQuery.java b/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/repository/query/PartTreeCosmosQuery.java similarity index 100% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com.microsoft.azure.spring.data.cosmosdb/repository/query/PartTreeCosmosQuery.java rename to sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/repository/query/PartTreeCosmosQuery.java diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com.microsoft.azure.spring.data.cosmosdb/repository/query/PartTreeReactiveCosmosQuery.java b/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/repository/query/PartTreeReactiveCosmosQuery.java similarity index 100% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com.microsoft.azure.spring.data.cosmosdb/repository/query/PartTreeReactiveCosmosQuery.java rename to sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/repository/query/PartTreeReactiveCosmosQuery.java diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com.microsoft.azure.spring.data.cosmosdb/repository/query/ReactiveCosmosEntityMetadata.java b/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/repository/query/ReactiveCosmosEntityMetadata.java similarity index 100% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com.microsoft.azure.spring.data.cosmosdb/repository/query/ReactiveCosmosEntityMetadata.java rename to sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/repository/query/ReactiveCosmosEntityMetadata.java diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com.microsoft.azure.spring.data.cosmosdb/repository/query/ReactiveCosmosParameterAccessor.java b/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/repository/query/ReactiveCosmosParameterAccessor.java similarity index 100% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com.microsoft.azure.spring.data.cosmosdb/repository/query/ReactiveCosmosParameterAccessor.java rename to sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/repository/query/ReactiveCosmosParameterAccessor.java diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com.microsoft.azure.spring.data.cosmosdb/repository/query/ReactiveCosmosParameterParameterAccessor.java b/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/repository/query/ReactiveCosmosParameterParameterAccessor.java similarity index 100% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com.microsoft.azure.spring.data.cosmosdb/repository/query/ReactiveCosmosParameterParameterAccessor.java rename to sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/repository/query/ReactiveCosmosParameterParameterAccessor.java diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com.microsoft.azure.spring.data.cosmosdb/repository/query/ReactiveCosmosQueryCreator.java b/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/repository/query/ReactiveCosmosQueryCreator.java similarity index 100% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com.microsoft.azure.spring.data.cosmosdb/repository/query/ReactiveCosmosQueryCreator.java rename to sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/repository/query/ReactiveCosmosQueryCreator.java diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com.microsoft.azure.spring.data.cosmosdb/repository/query/ReactiveCosmosQueryExecution.java b/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/repository/query/ReactiveCosmosQueryExecution.java similarity index 100% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com.microsoft.azure.spring.data.cosmosdb/repository/query/ReactiveCosmosQueryExecution.java rename to sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/repository/query/ReactiveCosmosQueryExecution.java diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com.microsoft.azure.spring.data.cosmosdb/repository/query/ReactiveCosmosQueryMethod.java b/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/repository/query/ReactiveCosmosQueryMethod.java similarity index 100% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com.microsoft.azure.spring.data.cosmosdb/repository/query/ReactiveCosmosQueryMethod.java rename to sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/repository/query/ReactiveCosmosQueryMethod.java diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com.microsoft.azure.spring.data.cosmosdb/repository/query/SimpleCosmosEntityMetadata.java b/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/repository/query/SimpleCosmosEntityMetadata.java similarity index 100% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com.microsoft.azure.spring.data.cosmosdb/repository/query/SimpleCosmosEntityMetadata.java rename to sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/repository/query/SimpleCosmosEntityMetadata.java diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com.microsoft.azure.spring.data.cosmosdb/repository/query/SimpleReactiveCosmosEntityMetadata.java b/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/repository/query/SimpleReactiveCosmosEntityMetadata.java similarity index 100% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com.microsoft.azure.spring.data.cosmosdb/repository/query/SimpleReactiveCosmosEntityMetadata.java rename to sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/repository/query/SimpleReactiveCosmosEntityMetadata.java diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com.microsoft.azure.spring.data.cosmosdb/repository/query/package-info.java b/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/repository/query/package-info.java similarity index 100% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com.microsoft.azure.spring.data.cosmosdb/repository/query/package-info.java rename to sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/repository/query/package-info.java diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com.microsoft.azure.spring.data.cosmosdb/repository/support/CosmosEntityInformation.java b/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/repository/support/CosmosEntityInformation.java similarity index 100% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com.microsoft.azure.spring.data.cosmosdb/repository/support/CosmosEntityInformation.java rename to sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/repository/support/CosmosEntityInformation.java diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com.microsoft.azure.spring.data.cosmosdb/repository/support/CosmosRepositoryFactory.java b/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/repository/support/CosmosRepositoryFactory.java similarity index 100% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com.microsoft.azure.spring.data.cosmosdb/repository/support/CosmosRepositoryFactory.java rename to sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/repository/support/CosmosRepositoryFactory.java diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com.microsoft.azure.spring.data.cosmosdb/repository/support/CosmosRepositoryFactoryBean.java b/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/repository/support/CosmosRepositoryFactoryBean.java similarity index 100% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com.microsoft.azure.spring.data.cosmosdb/repository/support/CosmosRepositoryFactoryBean.java rename to sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/repository/support/CosmosRepositoryFactoryBean.java diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com.microsoft.azure.spring.data.cosmosdb/repository/support/ReactiveCosmosRepositoryFactory.java b/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/repository/support/ReactiveCosmosRepositoryFactory.java similarity index 100% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com.microsoft.azure.spring.data.cosmosdb/repository/support/ReactiveCosmosRepositoryFactory.java rename to sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/repository/support/ReactiveCosmosRepositoryFactory.java diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com.microsoft.azure.spring.data.cosmosdb/repository/support/ReactiveCosmosRepositoryFactoryBean.java b/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/repository/support/ReactiveCosmosRepositoryFactoryBean.java similarity index 100% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com.microsoft.azure.spring.data.cosmosdb/repository/support/ReactiveCosmosRepositoryFactoryBean.java rename to sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/repository/support/ReactiveCosmosRepositoryFactoryBean.java diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com.microsoft.azure.spring.data.cosmosdb/repository/support/SimpleCosmosRepository.java b/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/repository/support/SimpleCosmosRepository.java similarity index 100% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com.microsoft.azure.spring.data.cosmosdb/repository/support/SimpleCosmosRepository.java rename to sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/repository/support/SimpleCosmosRepository.java diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com.microsoft.azure.spring.data.cosmosdb/repository/support/SimpleReactiveCosmosRepository.java b/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/repository/support/SimpleReactiveCosmosRepository.java similarity index 100% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com.microsoft.azure.spring.data.cosmosdb/repository/support/SimpleReactiveCosmosRepository.java rename to sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/repository/support/SimpleReactiveCosmosRepository.java diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com.microsoft.azure.spring.data.cosmosdb/repository/support/package-info.java b/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/repository/support/package-info.java similarity index 100% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com.microsoft.azure.spring.data.cosmosdb/repository/support/package-info.java rename to sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/repository/support/package-info.java diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com.microsoft.azure.spring.data.cosmosdb/CosmosDbFactoryTestIT.java b/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/CosmosDbFactoryTestIT.java similarity index 100% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com.microsoft.azure.spring.data.cosmosdb/CosmosDbFactoryTestIT.java rename to sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/CosmosDbFactoryTestIT.java diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com.microsoft.azure.spring.data.cosmosdb/UserAgentTestIT.java b/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/UserAgentTestIT.java similarity index 100% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com.microsoft.azure.spring.data.cosmosdb/UserAgentTestIT.java rename to sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/UserAgentTestIT.java diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com.microsoft.azure.spring.data.cosmosdb/common/DynamicContainer.java b/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/common/DynamicContainer.java similarity index 100% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com.microsoft.azure.spring.data.cosmosdb/common/DynamicContainer.java rename to sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/common/DynamicContainer.java diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com.microsoft.azure.spring.data.cosmosdb/common/ExpressionResolverUnitTest.java b/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/common/ExpressionResolverUnitTest.java similarity index 99% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com.microsoft.azure.spring.data.cosmosdb/common/ExpressionResolverUnitTest.java rename to sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/common/ExpressionResolverUnitTest.java index ccb3160225cad..ee4821faabf8f 100644 --- a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com.microsoft.azure.spring.data.cosmosdb/common/ExpressionResolverUnitTest.java +++ b/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/common/ExpressionResolverUnitTest.java @@ -3,7 +3,6 @@ package com.microsoft.azure.spring.data.cosmosdb.common; import org.junit.Test; - import org.springframework.beans.factory.config.ConfigurableBeanFactory; import org.springframework.context.annotation.AnnotationConfigApplicationContext; import org.springframework.context.annotation.Bean; diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com.microsoft.azure.spring.data.cosmosdb/common/MemoizerUnitTest.java b/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/common/MemoizerUnitTest.java similarity index 100% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com.microsoft.azure.spring.data.cosmosdb/common/MemoizerUnitTest.java rename to sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/common/MemoizerUnitTest.java index 0da9f66b63ffc..05f3cbb9e588c 100644 --- a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com.microsoft.azure.spring.data.cosmosdb/common/MemoizerUnitTest.java +++ b/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/common/MemoizerUnitTest.java @@ -5,14 +5,14 @@ import org.junit.Before; import org.junit.Test; -import static org.junit.Assert.assertEquals; - import java.util.HashMap; import java.util.Map; import java.util.concurrent.atomic.AtomicInteger; import java.util.function.Function; import java.util.stream.IntStream; +import static org.junit.Assert.assertEquals; + /** * * @author Domenico Sibilio diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com.microsoft.azure.spring.data.cosmosdb/common/PageTestUtils.java b/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/common/PageTestUtils.java similarity index 100% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com.microsoft.azure.spring.data.cosmosdb/common/PageTestUtils.java rename to sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/common/PageTestUtils.java diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com.microsoft.azure.spring.data.cosmosdb/common/PropertyLoaderUnitTest.java b/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/common/PropertyLoaderUnitTest.java similarity index 100% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com.microsoft.azure.spring.data.cosmosdb/common/PropertyLoaderUnitTest.java rename to sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/common/PropertyLoaderUnitTest.java diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com.microsoft.azure.spring.data.cosmosdb/common/ResponseDiagnosticsTestUtils.java b/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/common/ResponseDiagnosticsTestUtils.java similarity index 100% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com.microsoft.azure.spring.data.cosmosdb/common/ResponseDiagnosticsTestUtils.java rename to sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/common/ResponseDiagnosticsTestUtils.java diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com.microsoft.azure.spring.data.cosmosdb/common/TestConstants.java b/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/common/TestConstants.java similarity index 100% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com.microsoft.azure.spring.data.cosmosdb/common/TestConstants.java rename to sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/common/TestConstants.java diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com.microsoft.azure.spring.data.cosmosdb/common/TestUtils.java b/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/common/TestUtils.java similarity index 100% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com.microsoft.azure.spring.data.cosmosdb/common/TestUtils.java rename to sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/common/TestUtils.java diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com.microsoft.azure.spring.data.cosmosdb/config/AbstractCosmosConfigurationIT.java b/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/config/AbstractCosmosConfigurationIT.java similarity index 99% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com.microsoft.azure.spring.data.cosmosdb/config/AbstractCosmosConfigurationIT.java rename to sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/config/AbstractCosmosConfigurationIT.java index a3fdd33fc4ef9..231c587837f5a 100644 --- a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com.microsoft.azure.spring.data.cosmosdb/config/AbstractCosmosConfigurationIT.java +++ b/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/config/AbstractCosmosConfigurationIT.java @@ -16,7 +16,6 @@ import org.junit.Test; import org.junit.rules.ExpectedException; import org.mockito.Mock; - import org.springframework.beans.factory.NoSuchBeanDefinitionException; import org.springframework.beans.factory.annotation.Value; import org.springframework.context.annotation.AnnotationConfigApplicationContext; diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com.microsoft.azure.spring.data.cosmosdb/core/CosmosTemplateIT.java b/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/core/CosmosTemplateIT.java similarity index 94% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com.microsoft.azure.spring.data.cosmosdb/core/CosmosTemplateIT.java rename to sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/core/CosmosTemplateIT.java index 289a2e4d33ea3..14da8e2515431 100644 --- a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com.microsoft.azure.spring.data.cosmosdb/core/CosmosTemplateIT.java +++ b/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/core/CosmosTemplateIT.java @@ -39,20 +39,7 @@ import static com.microsoft.azure.spring.data.cosmosdb.common.PageTestUtils.validateLastPage; import static com.microsoft.azure.spring.data.cosmosdb.common.PageTestUtils.validateNonLastPage; -import static com.microsoft.azure.spring.data.cosmosdb.common.TestConstants.ADDRESSES; -import static com.microsoft.azure.spring.data.cosmosdb.common.TestConstants.FIRST_NAME; -import static com.microsoft.azure.spring.data.cosmosdb.common.TestConstants.HOBBIES; -import static com.microsoft.azure.spring.data.cosmosdb.common.TestConstants.ID_1; -import static com.microsoft.azure.spring.data.cosmosdb.common.TestConstants.ID_2; -import static com.microsoft.azure.spring.data.cosmosdb.common.TestConstants.ID_3; -import static com.microsoft.azure.spring.data.cosmosdb.common.TestConstants.LAST_NAME; -import static com.microsoft.azure.spring.data.cosmosdb.common.TestConstants.NEW_FIRST_NAME; -import static com.microsoft.azure.spring.data.cosmosdb.common.TestConstants.NEW_LAST_NAME; -import static com.microsoft.azure.spring.data.cosmosdb.common.TestConstants.NOT_EXIST_ID; -import static com.microsoft.azure.spring.data.cosmosdb.common.TestConstants.PAGE_SIZE_1; -import static com.microsoft.azure.spring.data.cosmosdb.common.TestConstants.PAGE_SIZE_2; -import static com.microsoft.azure.spring.data.cosmosdb.common.TestConstants.PAGE_SIZE_3; -import static com.microsoft.azure.spring.data.cosmosdb.common.TestConstants.UPDATED_FIRST_NAME; +import static com.microsoft.azure.spring.data.cosmosdb.common.TestConstants.*; import static org.assertj.core.api.Assertions.assertThat; import static org.junit.Assert.assertEquals; import static org.junit.Assert.fail; diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com.microsoft.azure.spring.data.cosmosdb/core/CosmosTemplateIllegalTest.java b/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/core/CosmosTemplateIllegalTest.java similarity index 100% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com.microsoft.azure.spring.data.cosmosdb/core/CosmosTemplateIllegalTest.java rename to sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/core/CosmosTemplateIllegalTest.java index 0c63ef1c49e92..4b2ad4354ec25 100644 --- a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com.microsoft.azure.spring.data.cosmosdb/core/CosmosTemplateIllegalTest.java +++ b/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/core/CosmosTemplateIllegalTest.java @@ -15,12 +15,12 @@ import org.mockito.junit.MockitoJUnitRunner; import org.springframework.util.Assert; -import static com.microsoft.azure.spring.data.cosmosdb.core.query.CriteriaType.IS_EQUAL; - import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import java.util.Arrays; +import static com.microsoft.azure.spring.data.cosmosdb.core.query.CriteriaType.IS_EQUAL; + @SuppressWarnings("unchecked") @RunWith(MockitoJUnitRunner.class) public class CosmosTemplateIllegalTest { diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com.microsoft.azure.spring.data.cosmosdb/core/CosmosTemplatePartitionIT.java b/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/core/CosmosTemplatePartitionIT.java similarity index 100% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com.microsoft.azure.spring.data.cosmosdb/core/CosmosTemplatePartitionIT.java rename to sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/core/CosmosTemplatePartitionIT.java diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com.microsoft.azure.spring.data.cosmosdb/core/CosmosTemplateUnitTest.java b/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/core/CosmosTemplateUnitTest.java similarity index 100% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com.microsoft.azure.spring.data.cosmosdb/core/CosmosTemplateUnitTest.java rename to sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/core/CosmosTemplateUnitTest.java diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com.microsoft.azure.spring.data.cosmosdb/core/ReactiveCosmosTemplateIT.java b/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/core/ReactiveCosmosTemplateIT.java similarity index 99% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com.microsoft.azure.spring.data.cosmosdb/core/ReactiveCosmosTemplateIT.java rename to sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/core/ReactiveCosmosTemplateIT.java index 37395f876c36a..d2442de406c37 100644 --- a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com.microsoft.azure.spring.data.cosmosdb/core/ReactiveCosmosTemplateIT.java +++ b/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/core/ReactiveCosmosTemplateIT.java @@ -19,11 +19,7 @@ import com.microsoft.azure.spring.data.cosmosdb.repository.TestRepositoryConfig; import com.microsoft.azure.spring.data.cosmosdb.repository.support.CosmosEntityInformation; import io.reactivex.subscribers.TestSubscriber; -import org.junit.After; -import org.junit.AfterClass; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Test; +import org.junit.*; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com.microsoft.azure.spring.data.cosmosdb/core/ReactiveCosmosTemplatePartitionIT.java b/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/core/ReactiveCosmosTemplatePartitionIT.java similarity index 90% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com.microsoft.azure.spring.data.cosmosdb/core/ReactiveCosmosTemplatePartitionIT.java rename to sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/core/ReactiveCosmosTemplatePartitionIT.java index fce527da71b08..124a85d651725 100644 --- a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com.microsoft.azure.spring.data.cosmosdb/core/ReactiveCosmosTemplatePartitionIT.java +++ b/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/core/ReactiveCosmosTemplatePartitionIT.java @@ -12,11 +12,7 @@ import com.microsoft.azure.spring.data.cosmosdb.domain.PartitionPerson; import com.microsoft.azure.spring.data.cosmosdb.repository.TestRepositoryConfig; import com.microsoft.azure.spring.data.cosmosdb.repository.support.CosmosEntityInformation; -import org.junit.After; -import org.junit.AfterClass; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Test; +import org.junit.*; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.autoconfigure.domain.EntityScanner; @@ -31,16 +27,7 @@ import java.util.Arrays; import java.util.UUID; -import static com.microsoft.azure.spring.data.cosmosdb.common.TestConstants.ADDRESSES; -import static com.microsoft.azure.spring.data.cosmosdb.common.TestConstants.FIRST_NAME; -import static com.microsoft.azure.spring.data.cosmosdb.common.TestConstants.HOBBIES; -import static com.microsoft.azure.spring.data.cosmosdb.common.TestConstants.ID_1; -import static com.microsoft.azure.spring.data.cosmosdb.common.TestConstants.ID_2; -import static com.microsoft.azure.spring.data.cosmosdb.common.TestConstants.LAST_NAME; -import static com.microsoft.azure.spring.data.cosmosdb.common.TestConstants.NEW_FIRST_NAME; -import static com.microsoft.azure.spring.data.cosmosdb.common.TestConstants.NEW_LAST_NAME; -import static com.microsoft.azure.spring.data.cosmosdb.common.TestConstants.PROPERTY_LAST_NAME; -import static com.microsoft.azure.spring.data.cosmosdb.common.TestConstants.UPDATED_FIRST_NAME; +import static com.microsoft.azure.spring.data.cosmosdb.common.TestConstants.*; import static com.microsoft.azure.spring.data.cosmosdb.core.query.CriteriaType.IS_EQUAL; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.is; diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com.microsoft.azure.spring.data.cosmosdb/core/convert/ZonedDateTimeDeserializerTest.java b/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/core/convert/ZonedDateTimeDeserializerTest.java similarity index 100% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com.microsoft.azure.spring.data.cosmosdb/core/convert/ZonedDateTimeDeserializerTest.java rename to sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/core/convert/ZonedDateTimeDeserializerTest.java diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com.microsoft.azure.spring.data.cosmosdb/core/converter/MappingCosmosConverterUnitTest.java b/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/core/converter/MappingCosmosConverterUnitTest.java similarity index 100% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com.microsoft.azure.spring.data.cosmosdb/core/converter/MappingCosmosConverterUnitTest.java rename to sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/core/converter/MappingCosmosConverterUnitTest.java index c0d3c93947ae7..5b52d9f14a48a 100644 --- a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com.microsoft.azure.spring.data.cosmosdb/core/converter/MappingCosmosConverterUnitTest.java +++ b/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/core/converter/MappingCosmosConverterUnitTest.java @@ -8,8 +8,8 @@ import com.microsoft.azure.spring.data.cosmosdb.core.convert.MappingCosmosConverter; import com.microsoft.azure.spring.data.cosmosdb.core.mapping.CosmosMappingContext; import com.microsoft.azure.spring.data.cosmosdb.domain.Address; -import com.microsoft.azure.spring.data.cosmosdb.domain.Memo; import com.microsoft.azure.spring.data.cosmosdb.domain.Importance; +import com.microsoft.azure.spring.data.cosmosdb.domain.Memo; import org.json.JSONObject; import org.junit.Before; import org.junit.Test; diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com.microsoft.azure.spring.data.cosmosdb/core/mapping/BasicCosmosPersistentEntityUnitTest.java b/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/core/mapping/BasicCosmosPersistentEntityUnitTest.java similarity index 100% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com.microsoft.azure.spring.data.cosmosdb/core/mapping/BasicCosmosPersistentEntityUnitTest.java rename to sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/core/mapping/BasicCosmosPersistentEntityUnitTest.java diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com.microsoft.azure.spring.data.cosmosdb/core/mapping/CosmosMappingContextUnitTest.java b/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/core/mapping/CosmosMappingContextUnitTest.java similarity index 100% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com.microsoft.azure.spring.data.cosmosdb/core/mapping/CosmosMappingContextUnitTest.java rename to sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/core/mapping/CosmosMappingContextUnitTest.java diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com.microsoft.azure.spring.data.cosmosdb/core/query/CriteriaUnitTest.java b/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/core/query/CriteriaUnitTest.java similarity index 100% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com.microsoft.azure.spring.data.cosmosdb/core/query/CriteriaUnitTest.java rename to sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/core/query/CriteriaUnitTest.java diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com.microsoft.azure.spring.data.cosmosdb/core/query/DocumentQueryUnitTest.java b/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/core/query/DocumentQueryUnitTest.java similarity index 100% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com.microsoft.azure.spring.data.cosmosdb/core/query/DocumentQueryUnitTest.java rename to sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/core/query/DocumentQueryUnitTest.java diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com.microsoft.azure.spring.data.cosmosdb/domain/Address.java b/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/domain/Address.java similarity index 100% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com.microsoft.azure.spring.data.cosmosdb/domain/Address.java rename to sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/domain/Address.java diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com.microsoft.azure.spring.data.cosmosdb/domain/Contact.java b/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/domain/Contact.java similarity index 98% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com.microsoft.azure.spring.data.cosmosdb/domain/Contact.java rename to sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/domain/Contact.java index 3c2bfc9c5dd4a..6770f1c528da9 100644 --- a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com.microsoft.azure.spring.data.cosmosdb/domain/Contact.java +++ b/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/domain/Contact.java @@ -14,6 +14,9 @@ public class Contact { private String title; + public Contact() { + } + public Contact(String logicId, String title) { this.logicId = logicId; this.title = title; diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com.microsoft.azure.spring.data.cosmosdb/domain/Course.java b/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/domain/Course.java similarity index 100% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com.microsoft.azure.spring.data.cosmosdb/domain/Course.java rename to sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/domain/Course.java diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com.microsoft.azure.spring.data.cosmosdb/domain/Customer.java b/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/domain/Customer.java similarity index 97% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com.microsoft.azure.spring.data.cosmosdb/domain/Customer.java rename to sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/domain/Customer.java index e79d5a49b6966..d31168f085500 100644 --- a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com.microsoft.azure.spring.data.cosmosdb/domain/Customer.java +++ b/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/domain/Customer.java @@ -15,6 +15,9 @@ public class Customer { private User user; + public Customer() { + } + public Customer(String id, Long level, User user) { this.id = id; this.level = level; @@ -83,6 +86,9 @@ public static class User { private Long age; + public User() { + } + public User(String name, Long age) { this.name = name; this.age = age; diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com.microsoft.azure.spring.data.cosmosdb/domain/Importance.java b/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/domain/Importance.java similarity index 100% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com.microsoft.azure.spring.data.cosmosdb/domain/Importance.java rename to sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/domain/Importance.java diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com.microsoft.azure.spring.data.cosmosdb/domain/IntegerIdDomain.java b/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/domain/IntegerIdDomain.java similarity index 100% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com.microsoft.azure.spring.data.cosmosdb/domain/IntegerIdDomain.java rename to sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/domain/IntegerIdDomain.java diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com.microsoft.azure.spring.data.cosmosdb/domain/Memo.java b/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/domain/Memo.java similarity index 100% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com.microsoft.azure.spring.data.cosmosdb/domain/Memo.java rename to sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/domain/Memo.java diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com.microsoft.azure.spring.data.cosmosdb/domain/NoDBAnnotationPerson.java b/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/domain/NoDBAnnotationPerson.java similarity index 98% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com.microsoft.azure.spring.data.cosmosdb/domain/NoDBAnnotationPerson.java rename to sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/domain/NoDBAnnotationPerson.java index ef76b39d97c28..bc5eab89003ad 100644 --- a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com.microsoft.azure.spring.data.cosmosdb/domain/NoDBAnnotationPerson.java +++ b/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/domain/NoDBAnnotationPerson.java @@ -14,6 +14,9 @@ public class NoDBAnnotationPerson { private List hobbies; private List
shippingAddresses; + public NoDBAnnotationPerson() { + } + public NoDBAnnotationPerson(String id, String firstName, String lastName, List hobbies, List
shippingAddresses) { this.id = id; this.firstName = firstName; diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com.microsoft.azure.spring.data.cosmosdb/domain/PageableAddress.java b/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/domain/PageableAddress.java similarity index 98% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com.microsoft.azure.spring.data.cosmosdb/domain/PageableAddress.java rename to sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/domain/PageableAddress.java index 947b30baf43cc..7b644336eead9 100644 --- a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com.microsoft.azure.spring.data.cosmosdb/domain/PageableAddress.java +++ b/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/domain/PageableAddress.java @@ -35,6 +35,9 @@ public int hashCode() { return Objects.hash(postalCode, street, city); } + public PageableAddress() { + } + public PageableAddress(String postalCode, String street, String city) { this.postalCode = postalCode; this.street = street; diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com.microsoft.azure.spring.data.cosmosdb/domain/PageableMemo.java b/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/domain/PageableMemo.java similarity index 98% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com.microsoft.azure.spring.data.cosmosdb/domain/PageableMemo.java rename to sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/domain/PageableMemo.java index 5796f18e8af7f..d1425e5c357c1 100644 --- a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com.microsoft.azure.spring.data.cosmosdb/domain/PageableMemo.java +++ b/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/domain/PageableMemo.java @@ -17,6 +17,9 @@ public class PageableMemo { private Date date; private Importance importance; + public PageableMemo() { + } + public PageableMemo(String id, String message, Date date, Importance importance) { this.id = id; this.message = message; diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com.microsoft.azure.spring.data.cosmosdb/domain/PageablePerson.java b/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/domain/PageablePerson.java similarity index 100% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com.microsoft.azure.spring.data.cosmosdb/domain/PageablePerson.java rename to sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/domain/PageablePerson.java diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com.microsoft.azure.spring.data.cosmosdb/domain/PartitionPerson.java b/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/domain/PartitionPerson.java similarity index 98% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com.microsoft.azure.spring.data.cosmosdb/domain/PartitionPerson.java rename to sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/domain/PartitionPerson.java index fefe9b080a9df..0285512b18345 100644 --- a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com.microsoft.azure.spring.data.cosmosdb/domain/PartitionPerson.java +++ b/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/domain/PartitionPerson.java @@ -22,6 +22,9 @@ public class PartitionPerson { private List
shippingAddresses; + public PartitionPerson() { + } + public PartitionPerson(String id, String firstName, String lastName, List hobbies, List
shippingAddresses) { this.id = id; this.firstName = firstName; diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com.microsoft.azure.spring.data.cosmosdb/domain/Person.java b/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/domain/Person.java similarity index 99% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com.microsoft.azure.spring.data.cosmosdb/domain/Person.java rename to sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/domain/Person.java index 8038c1826df0a..481617488a38b 100644 --- a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com.microsoft.azure.spring.data.cosmosdb/domain/Person.java +++ b/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/domain/Person.java @@ -3,16 +3,15 @@ package com.microsoft.azure.spring.data.cosmosdb.domain; -import java.util.List; -import java.util.Objects; - import com.microsoft.azure.spring.data.cosmosdb.common.TestConstants; import com.microsoft.azure.spring.data.cosmosdb.core.mapping.Document; import com.microsoft.azure.spring.data.cosmosdb.core.mapping.DocumentIndexingPolicy; import com.microsoft.azure.spring.data.cosmosdb.core.mapping.PartitionKey; - import org.springframework.data.annotation.Version; +import java.util.List; +import java.util.Objects; + @Document() @DocumentIndexingPolicy(includePaths = TestConstants.ORDER_BY_STRING_PATH) public class Person { diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com.microsoft.azure.spring.data.cosmosdb/domain/Project.java b/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/domain/Project.java similarity index 99% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com.microsoft.azure.spring.data.cosmosdb/domain/Project.java rename to sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/domain/Project.java index 436b040198faf..334cba0bad9da 100644 --- a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com.microsoft.azure.spring.data.cosmosdb/domain/Project.java +++ b/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/domain/Project.java @@ -28,6 +28,9 @@ public class Project { private Long forkCount; + public Project() { + } + public Project(String id, String name, String creator, Boolean hasReleased, Long starCount, Long forkCount) { this.id = id; this.name = name; diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com.microsoft.azure.spring.data.cosmosdb/domain/Question.java b/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/domain/Question.java similarity index 100% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com.microsoft.azure.spring.data.cosmosdb/domain/Question.java rename to sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/domain/Question.java diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com.microsoft.azure.spring.data.cosmosdb/domain/Role.java b/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/domain/Role.java similarity index 98% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com.microsoft.azure.spring.data.cosmosdb/domain/Role.java rename to sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/domain/Role.java index 6bc7ca4233d03..542885fe92549 100644 --- a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com.microsoft.azure.spring.data.cosmosdb/domain/Role.java +++ b/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/domain/Role.java @@ -34,6 +34,9 @@ public class Role { String level; + public Role() { + } + public Role(String id, String name, String level) { this.id = id; this.name = name; diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com.microsoft.azure.spring.data.cosmosdb/domain/SortedProject.java b/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/domain/SortedProject.java similarity index 98% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com.microsoft.azure.spring.data.cosmosdb/domain/SortedProject.java rename to sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/domain/SortedProject.java index 38437509175d4..f8def0da26bda 100644 --- a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com.microsoft.azure.spring.data.cosmosdb/domain/SortedProject.java +++ b/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/domain/SortedProject.java @@ -28,6 +28,9 @@ public class SortedProject { private Long forkCount; + public SortedProject() { + } + public SortedProject(String id, String name, String creator, Boolean hasReleased, Long starCount, Long forkCount) { this.id = id; this.name = name; diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com.microsoft.azure.spring.data.cosmosdb/domain/SpELBeanStudent.java b/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/domain/SpELBeanStudent.java similarity index 100% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com.microsoft.azure.spring.data.cosmosdb/domain/SpELBeanStudent.java rename to sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/domain/SpELBeanStudent.java diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com.microsoft.azure.spring.data.cosmosdb/domain/SpELPropertyStudent.java b/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/domain/SpELPropertyStudent.java similarity index 100% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com.microsoft.azure.spring.data.cosmosdb/domain/SpELPropertyStudent.java rename to sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/domain/SpELPropertyStudent.java diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com.microsoft.azure.spring.data.cosmosdb/domain/Student.java b/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/domain/Student.java similarity index 98% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com.microsoft.azure.spring.data.cosmosdb/domain/Student.java rename to sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/domain/Student.java index 6e80572759169..c531cf58ca45b 100644 --- a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com.microsoft.azure.spring.data.cosmosdb/domain/Student.java +++ b/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/domain/Student.java @@ -14,6 +14,9 @@ public class Student { private String firstName; private String lastName; + public Student() { + } + public Student(String id, String firstName, String lastName) { this.id = id; this.firstName = firstName; diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com.microsoft.azure.spring.data.cosmosdb/domain/TimeToLiveSample.java b/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/domain/TimeToLiveSample.java similarity index 93% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com.microsoft.azure.spring.data.cosmosdb/domain/TimeToLiveSample.java rename to sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/domain/TimeToLiveSample.java index 3a6093ec6b6f0..9e1455317e6b6 100644 --- a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com.microsoft.azure.spring.data.cosmosdb/domain/TimeToLiveSample.java +++ b/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/domain/TimeToLiveSample.java @@ -9,6 +9,9 @@ public class TimeToLiveSample { private String id; + public TimeToLiveSample() { + } + public TimeToLiveSample(String id) { this.id = id; } diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com.microsoft.azure.spring.data.cosmosdb/domain/inheritance/Shape.java b/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/domain/inheritance/Shape.java similarity index 100% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com.microsoft.azure.spring.data.cosmosdb/domain/inheritance/Shape.java rename to sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/domain/inheritance/Shape.java diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com.microsoft.azure.spring.data.cosmosdb/domain/inheritance/Square.java b/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/domain/inheritance/Square.java similarity index 100% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com.microsoft.azure.spring.data.cosmosdb/domain/inheritance/Square.java rename to sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/domain/inheritance/Square.java diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com.microsoft.azure.spring.data.cosmosdb/performance/PerfConfiguration.java b/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/performance/PerfConfiguration.java similarity index 100% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com.microsoft.azure.spring.data.cosmosdb/performance/PerfConfiguration.java rename to sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/performance/PerfConfiguration.java diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com.microsoft.azure.spring.data.cosmosdb/performance/PerformanceCompare.java b/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/performance/PerformanceCompare.java similarity index 100% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com.microsoft.azure.spring.data.cosmosdb/performance/PerformanceCompare.java rename to sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/performance/PerformanceCompare.java diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com.microsoft.azure.spring.data.cosmosdb/performance/PerformanceReport.java b/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/performance/PerformanceReport.java similarity index 100% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com.microsoft.azure.spring.data.cosmosdb/performance/PerformanceReport.java rename to sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/performance/PerformanceReport.java diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com.microsoft.azure.spring.data.cosmosdb/performance/domain/PerfPerson.java b/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/performance/domain/PerfPerson.java similarity index 100% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com.microsoft.azure.spring.data.cosmosdb/performance/domain/PerfPerson.java rename to sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/performance/domain/PerfPerson.java diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com.microsoft.azure.spring.data.cosmosdb/performance/repository/PerfPersonRepository.java b/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/performance/repository/PerfPersonRepository.java similarity index 100% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com.microsoft.azure.spring.data.cosmosdb/performance/repository/PerfPersonRepository.java rename to sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/performance/repository/PerfPersonRepository.java diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com.microsoft.azure.spring.data.cosmosdb/performance/service/SdkService.java b/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/performance/service/SdkService.java similarity index 96% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com.microsoft.azure.spring.data.cosmosdb/performance/service/SdkService.java rename to sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/performance/service/SdkService.java index bf5462d42c1a2..4b37ac7db7207 100644 --- a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com.microsoft.azure.spring.data.cosmosdb/performance/service/SdkService.java +++ b/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/performance/service/SdkService.java @@ -2,13 +2,7 @@ // Licensed under the MIT License. package com.microsoft.azure.spring.data.cosmosdb.performance.service; -import com.azure.data.cosmos.CosmosClient; -import com.azure.data.cosmos.CosmosClientException; -import com.azure.data.cosmos.CosmosItemProperties; -import com.azure.data.cosmos.CosmosItemRequestOptions; -import com.azure.data.cosmos.FeedOptions; -import com.azure.data.cosmos.FeedResponse; -import com.azure.data.cosmos.PartitionKey; +import com.azure.data.cosmos.*; import com.azure.data.cosmos.sync.CosmosSyncClient; import com.google.gson.Gson; import com.microsoft.azure.spring.data.cosmosdb.performance.domain.PerfPerson; diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com.microsoft.azure.spring.data.cosmosdb/performance/utils/Constants.java b/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/performance/utils/Constants.java similarity index 100% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com.microsoft.azure.spring.data.cosmosdb/performance/utils/Constants.java rename to sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/performance/utils/Constants.java diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com.microsoft.azure.spring.data.cosmosdb/performance/utils/DatabaseUtils.java b/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/performance/utils/DatabaseUtils.java similarity index 90% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com.microsoft.azure.spring.data.cosmosdb/performance/utils/DatabaseUtils.java rename to sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/performance/utils/DatabaseUtils.java index 061e6a97e4d56..8c7be5c489857 100644 --- a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com.microsoft.azure.spring.data.cosmosdb/performance/utils/DatabaseUtils.java +++ b/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/performance/utils/DatabaseUtils.java @@ -2,11 +2,7 @@ // Licensed under the MIT License. package com.microsoft.azure.spring.data.cosmosdb.performance.utils; -import com.azure.data.cosmos.CosmosClientException; -import com.azure.data.cosmos.CosmosContainerProperties; -import com.azure.data.cosmos.IncludedPath; -import com.azure.data.cosmos.IndexingPolicy; -import com.azure.data.cosmos.PartitionKeyDefinition; +import com.azure.data.cosmos.*; import com.azure.data.cosmos.internal.RequestOptions; import com.azure.data.cosmos.sync.CosmosSyncClient; diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com.microsoft.azure.spring.data.cosmosdb/performance/utils/FunctionUtils.java b/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/performance/utils/FunctionUtils.java similarity index 100% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com.microsoft.azure.spring.data.cosmosdb/performance/utils/FunctionUtils.java rename to sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/performance/utils/FunctionUtils.java diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com.microsoft.azure.spring.data.cosmosdb/performance/utils/PerfDataProvider.java b/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/performance/utils/PerfDataProvider.java similarity index 100% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com.microsoft.azure.spring.data.cosmosdb/performance/utils/PerfDataProvider.java rename to sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/performance/utils/PerfDataProvider.java diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com.microsoft.azure.spring.data.cosmosdb/repository/CosmosAnnotationUnitTest.java b/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/repository/CosmosAnnotationUnitTest.java similarity index 100% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com.microsoft.azure.spring.data.cosmosdb/repository/CosmosAnnotationUnitTest.java rename to sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/repository/CosmosAnnotationUnitTest.java diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com.microsoft.azure.spring.data.cosmosdb/repository/SimpleCosmosRepositoryIllegalTest.java b/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/repository/SimpleCosmosRepositoryIllegalTest.java similarity index 100% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com.microsoft.azure.spring.data.cosmosdb/repository/SimpleCosmosRepositoryIllegalTest.java rename to sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/repository/SimpleCosmosRepositoryIllegalTest.java diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com.microsoft.azure.spring.data.cosmosdb/repository/SimpleCosmosRepositoryUnitTest.java b/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/repository/SimpleCosmosRepositoryUnitTest.java similarity index 100% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com.microsoft.azure.spring.data.cosmosdb/repository/SimpleCosmosRepositoryUnitTest.java rename to sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/repository/SimpleCosmosRepositoryUnitTest.java index 6ec48cb66bc3e..ca3bd62d503f4 100644 --- a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com.microsoft.azure.spring.data.cosmosdb/repository/SimpleCosmosRepositoryUnitTest.java +++ b/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/repository/SimpleCosmosRepositoryUnitTest.java @@ -22,8 +22,8 @@ import java.util.List; import static org.junit.Assert.assertEquals; -import static org.mockito.ArgumentMatchers.anyString; import static org.mockito.ArgumentMatchers.any; +import static org.mockito.ArgumentMatchers.anyString; import static org.mockito.Mockito.when; @RunWith(MockitoJUnitRunner.class) diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com.microsoft.azure.spring.data.cosmosdb/repository/TestRepositoryConfig.java b/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/repository/TestRepositoryConfig.java similarity index 100% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com.microsoft.azure.spring.data.cosmosdb/repository/TestRepositoryConfig.java rename to sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/repository/TestRepositoryConfig.java diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com.microsoft.azure.spring.data.cosmosdb/repository/config/CosmosRepositoryConfigurationExtensionUnitTest.java b/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/repository/config/CosmosRepositoryConfigurationExtensionUnitTest.java similarity index 100% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com.microsoft.azure.spring.data.cosmosdb/repository/config/CosmosRepositoryConfigurationExtensionUnitTest.java rename to sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/repository/config/CosmosRepositoryConfigurationExtensionUnitTest.java diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com.microsoft.azure.spring.data.cosmosdb/repository/config/ReactiveCosmosRepositoryConfigurationExtensionUnitTest.java b/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/repository/config/ReactiveCosmosRepositoryConfigurationExtensionUnitTest.java similarity index 100% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com.microsoft.azure.spring.data.cosmosdb/repository/config/ReactiveCosmosRepositoryConfigurationExtensionUnitTest.java rename to sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/repository/config/ReactiveCosmosRepositoryConfigurationExtensionUnitTest.java diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com.microsoft.azure.spring.data.cosmosdb/repository/integration/AddressRepositoryIT.java b/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/repository/integration/AddressRepositoryIT.java similarity index 98% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com.microsoft.azure.spring.data.cosmosdb/repository/integration/AddressRepositoryIT.java rename to sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/repository/integration/AddressRepositoryIT.java index 78526ac34dd6c..90c73e73ab298 100644 --- a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com.microsoft.azure.spring.data.cosmosdb/repository/integration/AddressRepositoryIT.java +++ b/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/repository/integration/AddressRepositoryIT.java @@ -11,12 +11,7 @@ import com.microsoft.azure.spring.data.cosmosdb.repository.repository.AddressRepository; import com.microsoft.azure.spring.data.cosmosdb.repository.support.CosmosEntityInformation; import org.assertj.core.util.Lists; -import org.junit.After; -import org.junit.AfterClass; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Rule; -import org.junit.Test; +import org.junit.*; import org.junit.rules.ExpectedException; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com.microsoft.azure.spring.data.cosmosdb/repository/integration/ContactRepositoryIT.java b/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/repository/integration/ContactRepositoryIT.java similarity index 97% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com.microsoft.azure.spring.data.cosmosdb/repository/integration/ContactRepositoryIT.java rename to sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/repository/integration/ContactRepositoryIT.java index ca4368e987c09..3a7b23df07af3 100644 --- a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com.microsoft.azure.spring.data.cosmosdb/repository/integration/ContactRepositoryIT.java +++ b/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/repository/integration/ContactRepositoryIT.java @@ -9,12 +9,7 @@ import com.microsoft.azure.spring.data.cosmosdb.repository.repository.ContactRepository; import com.microsoft.azure.spring.data.cosmosdb.repository.support.CosmosEntityInformation; import org.assertj.core.util.Lists; -import org.junit.After; -import org.junit.AfterClass; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.*; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.test.context.ContextConfiguration; diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com.microsoft.azure.spring.data.cosmosdb/repository/integration/CosmosAnnotationIT.java b/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/repository/integration/CosmosAnnotationIT.java similarity index 100% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com.microsoft.azure.spring.data.cosmosdb/repository/integration/CosmosAnnotationIT.java rename to sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/repository/integration/CosmosAnnotationIT.java diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com.microsoft.azure.spring.data.cosmosdb/repository/integration/CustomerRepositoryIT.java b/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/repository/integration/CustomerRepositoryIT.java similarity index 96% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com.microsoft.azure.spring.data.cosmosdb/repository/integration/CustomerRepositoryIT.java rename to sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/repository/integration/CustomerRepositoryIT.java index c476c4a57d0e7..aade6e404ee21 100644 --- a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com.microsoft.azure.spring.data.cosmosdb/repository/integration/CustomerRepositoryIT.java +++ b/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/repository/integration/CustomerRepositoryIT.java @@ -7,11 +7,7 @@ import com.microsoft.azure.spring.data.cosmosdb.repository.TestRepositoryConfig; import com.microsoft.azure.spring.data.cosmosdb.repository.repository.CustomerRepository; import com.microsoft.azure.spring.data.cosmosdb.repository.support.CosmosEntityInformation; -import org.junit.After; -import org.junit.AfterClass; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Test; +import org.junit.*; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.lang.NonNull; diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com.microsoft.azure.spring.data.cosmosdb/repository/integration/IntegerIdDomainRepositoryIT.java b/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/repository/integration/IntegerIdDomainRepositoryIT.java similarity index 98% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com.microsoft.azure.spring.data.cosmosdb/repository/integration/IntegerIdDomainRepositoryIT.java rename to sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/repository/integration/IntegerIdDomainRepositoryIT.java index 67573dd759f6f..4b8cd3b8a4725 100644 --- a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com.microsoft.azure.spring.data.cosmosdb/repository/integration/IntegerIdDomainRepositoryIT.java +++ b/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/repository/integration/IntegerIdDomainRepositoryIT.java @@ -9,12 +9,7 @@ import com.microsoft.azure.spring.data.cosmosdb.repository.TestRepositoryConfig; import com.microsoft.azure.spring.data.cosmosdb.repository.repository.IntegerIdDomainRepository; import com.microsoft.azure.spring.data.cosmosdb.repository.support.CosmosEntityInformation; -import org.junit.After; -import org.junit.AfterClass; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.*; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.domain.Page; @@ -215,6 +210,9 @@ private static class InvalidDomain { private String location; + InvalidDomain() { + } + InvalidDomain(int count, String location) { this.count = count; this.location = location; diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com.microsoft.azure.spring.data.cosmosdb/repository/integration/MemoRepositoryIT.java b/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/repository/integration/MemoRepositoryIT.java similarity index 98% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com.microsoft.azure.spring.data.cosmosdb/repository/integration/MemoRepositoryIT.java rename to sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/repository/integration/MemoRepositoryIT.java index 4fa4053db39b7..71ce123073bf2 100644 --- a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com.microsoft.azure.spring.data.cosmosdb/repository/integration/MemoRepositoryIT.java +++ b/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/repository/integration/MemoRepositoryIT.java @@ -11,13 +11,7 @@ import com.microsoft.azure.spring.data.cosmosdb.repository.TestRepositoryConfig; import com.microsoft.azure.spring.data.cosmosdb.repository.repository.MemoRepository; import com.microsoft.azure.spring.data.cosmosdb.repository.support.CosmosEntityInformation; -import org.junit.After; -import org.junit.AfterClass; -import org.junit.Assert; -import org.junit.Before; -import org.junit.BeforeClass; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.*; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.test.context.ContextConfiguration; diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com.microsoft.azure.spring.data.cosmosdb/repository/integration/PageableAddressRepositoryIT.java b/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/repository/integration/PageableAddressRepositoryIT.java similarity index 100% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com.microsoft.azure.spring.data.cosmosdb/repository/integration/PageableAddressRepositoryIT.java rename to sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/repository/integration/PageableAddressRepositoryIT.java diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com.microsoft.azure.spring.data.cosmosdb/repository/integration/PageableMemoRepositoryIT.java b/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/repository/integration/PageableMemoRepositoryIT.java similarity index 97% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com.microsoft.azure.spring.data.cosmosdb/repository/integration/PageableMemoRepositoryIT.java rename to sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/repository/integration/PageableMemoRepositoryIT.java index 35e4a60ee5195..c8c254f7ad2bc 100644 --- a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com.microsoft.azure.spring.data.cosmosdb/repository/integration/PageableMemoRepositoryIT.java +++ b/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/repository/integration/PageableMemoRepositoryIT.java @@ -27,13 +27,7 @@ import reactor.core.publisher.Flux; import reactor.test.StepVerifier; -import java.util.ArrayList; -import java.util.Date; -import java.util.HashSet; -import java.util.List; -import java.util.Random; -import java.util.Set; -import java.util.UUID; +import java.util.*; import static org.assertj.core.api.Assertions.assertThat; diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com.microsoft.azure.spring.data.cosmosdb/repository/integration/PageablePersonRepositoryIT.java b/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/repository/integration/PageablePersonRepositoryIT.java similarity index 97% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com.microsoft.azure.spring.data.cosmosdb/repository/integration/PageablePersonRepositoryIT.java rename to sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/repository/integration/PageablePersonRepositoryIT.java index bea46dbc742ed..f3720b6e78b4d 100644 --- a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com.microsoft.azure.spring.data.cosmosdb/repository/integration/PageablePersonRepositoryIT.java +++ b/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/repository/integration/PageablePersonRepositoryIT.java @@ -21,11 +21,7 @@ import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; -import java.util.ArrayList; -import java.util.HashSet; -import java.util.List; -import java.util.Set; -import java.util.UUID; +import java.util.*; import static org.assertj.core.api.Assertions.assertThat; diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com.microsoft.azure.spring.data.cosmosdb/repository/integration/PersonRepositoryIT.java b/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/repository/integration/PersonRepositoryIT.java similarity index 100% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com.microsoft.azure.spring.data.cosmosdb/repository/integration/PersonRepositoryIT.java rename to sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/repository/integration/PersonRepositoryIT.java diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com.microsoft.azure.spring.data.cosmosdb/repository/integration/ProjectRepositoryIT.java b/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/repository/integration/ProjectRepositoryIT.java similarity index 98% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com.microsoft.azure.spring.data.cosmosdb/repository/integration/ProjectRepositoryIT.java rename to sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/repository/integration/ProjectRepositoryIT.java index 1e0475d9257d5..64ee38ccc15ea 100644 --- a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com.microsoft.azure.spring.data.cosmosdb/repository/integration/ProjectRepositoryIT.java +++ b/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/repository/integration/ProjectRepositoryIT.java @@ -9,22 +9,14 @@ import com.microsoft.azure.spring.data.cosmosdb.repository.TestRepositoryConfig; import com.microsoft.azure.spring.data.cosmosdb.repository.repository.ProjectRepository; import com.microsoft.azure.spring.data.cosmosdb.repository.support.CosmosEntityInformation; -import org.junit.After; -import org.junit.AfterClass; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Test; +import org.junit.*; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.lang.NonNull; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; -import java.util.Arrays; -import java.util.Collections; -import java.util.Comparator; -import java.util.List; -import java.util.Optional; +import java.util.*; import static org.assertj.core.api.Assertions.assertThat; diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com.microsoft.azure.spring.data.cosmosdb/repository/integration/ProjectRepositorySortIT.java b/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/repository/integration/ProjectRepositorySortIT.java similarity index 98% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com.microsoft.azure.spring.data.cosmosdb/repository/integration/ProjectRepositorySortIT.java rename to sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/repository/integration/ProjectRepositorySortIT.java index dd952e74dc53d..4da352b4589d9 100644 --- a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com.microsoft.azure.spring.data.cosmosdb/repository/integration/ProjectRepositorySortIT.java +++ b/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/repository/integration/ProjectRepositorySortIT.java @@ -10,11 +10,7 @@ import com.microsoft.azure.spring.data.cosmosdb.repository.repository.SortedProjectRepository; import com.microsoft.azure.spring.data.cosmosdb.repository.support.CosmosEntityInformation; import org.assertj.core.util.Lists; -import org.junit.After; -import org.junit.AfterClass; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Test; +import org.junit.*; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.domain.Page; diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com.microsoft.azure.spring.data.cosmosdb/repository/integration/QuestionRepositoryIT.java b/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/repository/integration/QuestionRepositoryIT.java similarity index 96% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com.microsoft.azure.spring.data.cosmosdb/repository/integration/QuestionRepositoryIT.java rename to sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/repository/integration/QuestionRepositoryIT.java index deba6ec4e6266..61b24a271e360 100644 --- a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com.microsoft.azure.spring.data.cosmosdb/repository/integration/QuestionRepositoryIT.java +++ b/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/repository/integration/QuestionRepositoryIT.java @@ -9,11 +9,7 @@ import com.microsoft.azure.spring.data.cosmosdb.repository.repository.QuestionRepository; import com.microsoft.azure.spring.data.cosmosdb.repository.support.CosmosEntityInformation; import org.assertj.core.util.Lists; -import org.junit.After; -import org.junit.AfterClass; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Test; +import org.junit.*; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.test.context.ContextConfiguration; diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com.microsoft.azure.spring.data.cosmosdb/repository/integration/ReactiveCourseRepositoryIT.java b/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/repository/integration/ReactiveCourseRepositoryIT.java similarity index 100% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com.microsoft.azure.spring.data.cosmosdb/repository/integration/ReactiveCourseRepositoryIT.java rename to sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/repository/integration/ReactiveCourseRepositoryIT.java diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com.microsoft.azure.spring.data.cosmosdb/repository/integration/SpELCosmosDBAnnotationIT.java b/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/repository/integration/SpELCosmosDBAnnotationIT.java similarity index 100% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com.microsoft.azure.spring.data.cosmosdb/repository/integration/SpELCosmosDBAnnotationIT.java rename to sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/repository/integration/SpELCosmosDBAnnotationIT.java diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com.microsoft.azure.spring.data.cosmosdb/repository/integration/SquareRepositoryIT.java b/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/repository/integration/SquareRepositoryIT.java similarity index 100% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com.microsoft.azure.spring.data.cosmosdb/repository/integration/SquareRepositoryIT.java rename to sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/repository/integration/SquareRepositoryIT.java diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com.microsoft.azure.spring.data.cosmosdb/repository/integration/StudentRepositoryIT.java b/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/repository/integration/StudentRepositoryIT.java similarity index 97% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com.microsoft.azure.spring.data.cosmosdb/repository/integration/StudentRepositoryIT.java rename to sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/repository/integration/StudentRepositoryIT.java index 9b0058e7f9056..45e25aa3cac7d 100644 --- a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com.microsoft.azure.spring.data.cosmosdb/repository/integration/StudentRepositoryIT.java +++ b/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/repository/integration/StudentRepositoryIT.java @@ -7,11 +7,7 @@ import com.microsoft.azure.spring.data.cosmosdb.repository.TestRepositoryConfig; import com.microsoft.azure.spring.data.cosmosdb.repository.repository.StudentRepository; import com.microsoft.azure.spring.data.cosmosdb.repository.support.CosmosEntityInformation; -import org.junit.After; -import org.junit.AfterClass; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Test; +import org.junit.*; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.test.context.ContextConfiguration; diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com.microsoft.azure.spring.data.cosmosdb/repository/repository/AddressRepository.java b/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/repository/repository/AddressRepository.java similarity index 100% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com.microsoft.azure.spring.data.cosmosdb/repository/repository/AddressRepository.java rename to sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/repository/repository/AddressRepository.java diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com.microsoft.azure.spring.data.cosmosdb/repository/repository/ContactRepository.java b/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/repository/repository/ContactRepository.java similarity index 100% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com.microsoft.azure.spring.data.cosmosdb/repository/repository/ContactRepository.java rename to sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/repository/repository/ContactRepository.java diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com.microsoft.azure.spring.data.cosmosdb/repository/repository/CustomerRepository.java b/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/repository/repository/CustomerRepository.java similarity index 100% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com.microsoft.azure.spring.data.cosmosdb/repository/repository/CustomerRepository.java rename to sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/repository/repository/CustomerRepository.java diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com.microsoft.azure.spring.data.cosmosdb/repository/repository/IntegerIdDomainRepository.java b/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/repository/repository/IntegerIdDomainRepository.java similarity index 100% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com.microsoft.azure.spring.data.cosmosdb/repository/repository/IntegerIdDomainRepository.java rename to sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/repository/repository/IntegerIdDomainRepository.java diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com.microsoft.azure.spring.data.cosmosdb/repository/repository/MemoRepository.java b/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/repository/repository/MemoRepository.java similarity index 100% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com.microsoft.azure.spring.data.cosmosdb/repository/repository/MemoRepository.java rename to sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/repository/repository/MemoRepository.java index f6544d0462c4d..8718388d42a66 100644 --- a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com.microsoft.azure.spring.data.cosmosdb/repository/repository/MemoRepository.java +++ b/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/repository/repository/MemoRepository.java @@ -2,8 +2,8 @@ // Licensed under the MIT License. package com.microsoft.azure.spring.data.cosmosdb.repository.repository; -import com.microsoft.azure.spring.data.cosmosdb.domain.Memo; import com.microsoft.azure.spring.data.cosmosdb.domain.Importance; +import com.microsoft.azure.spring.data.cosmosdb.domain.Memo; import com.microsoft.azure.spring.data.cosmosdb.repository.CosmosRepository; import org.springframework.stereotype.Repository; diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com.microsoft.azure.spring.data.cosmosdb/repository/repository/PageableAddressRepository.java b/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/repository/repository/PageableAddressRepository.java similarity index 100% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com.microsoft.azure.spring.data.cosmosdb/repository/repository/PageableAddressRepository.java rename to sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/repository/repository/PageableAddressRepository.java diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com.microsoft.azure.spring.data.cosmosdb/repository/repository/PageableMemoRepository.java b/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/repository/repository/PageableMemoRepository.java similarity index 100% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com.microsoft.azure.spring.data.cosmosdb/repository/repository/PageableMemoRepository.java rename to sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/repository/repository/PageableMemoRepository.java diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com.microsoft.azure.spring.data.cosmosdb/repository/repository/PageablePersonRepository.java b/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/repository/repository/PageablePersonRepository.java similarity index 100% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com.microsoft.azure.spring.data.cosmosdb/repository/repository/PageablePersonRepository.java rename to sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/repository/repository/PageablePersonRepository.java diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com.microsoft.azure.spring.data.cosmosdb/repository/repository/PartitionPersonRepository.java b/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/repository/repository/PartitionPersonRepository.java similarity index 100% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com.microsoft.azure.spring.data.cosmosdb/repository/repository/PartitionPersonRepository.java rename to sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/repository/repository/PartitionPersonRepository.java diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com.microsoft.azure.spring.data.cosmosdb/repository/repository/PersonRepository.java b/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/repository/repository/PersonRepository.java similarity index 100% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com.microsoft.azure.spring.data.cosmosdb/repository/repository/PersonRepository.java rename to sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/repository/repository/PersonRepository.java diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com.microsoft.azure.spring.data.cosmosdb/repository/repository/ProjectRepository.java b/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/repository/repository/ProjectRepository.java similarity index 100% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com.microsoft.azure.spring.data.cosmosdb/repository/repository/ProjectRepository.java rename to sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/repository/repository/ProjectRepository.java diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com.microsoft.azure.spring.data.cosmosdb/repository/repository/QuestionRepository.java b/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/repository/repository/QuestionRepository.java similarity index 100% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com.microsoft.azure.spring.data.cosmosdb/repository/repository/QuestionRepository.java rename to sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/repository/repository/QuestionRepository.java diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com.microsoft.azure.spring.data.cosmosdb/repository/repository/ReactiveCourseRepository.java b/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/repository/repository/ReactiveCourseRepository.java similarity index 100% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com.microsoft.azure.spring.data.cosmosdb/repository/repository/ReactiveCourseRepository.java rename to sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/repository/repository/ReactiveCourseRepository.java diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com.microsoft.azure.spring.data.cosmosdb/repository/repository/SortedProjectRepository.java b/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/repository/repository/SortedProjectRepository.java similarity index 100% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com.microsoft.azure.spring.data.cosmosdb/repository/repository/SortedProjectRepository.java rename to sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/repository/repository/SortedProjectRepository.java diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com.microsoft.azure.spring.data.cosmosdb/repository/repository/SquareRepository.java b/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/repository/repository/SquareRepository.java similarity index 100% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com.microsoft.azure.spring.data.cosmosdb/repository/repository/SquareRepository.java rename to sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/repository/repository/SquareRepository.java diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com.microsoft.azure.spring.data.cosmosdb/repository/repository/StudentRepository.java b/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/repository/repository/StudentRepository.java similarity index 100% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com.microsoft.azure.spring.data.cosmosdb/repository/repository/StudentRepository.java rename to sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/repository/repository/StudentRepository.java diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com.microsoft.azure.spring.data.cosmosdb/repository/support/CosmosEntityInformationUnitTest.java b/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/repository/support/CosmosEntityInformationUnitTest.java similarity index 99% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com.microsoft.azure.spring.data.cosmosdb/repository/support/CosmosEntityInformationUnitTest.java rename to sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/repository/support/CosmosEntityInformationUnitTest.java index 598f0359d8c77..e22e573c6d5ac 100644 --- a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com.microsoft.azure.spring.data.cosmosdb/repository/support/CosmosEntityInformationUnitTest.java +++ b/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/repository/support/CosmosEntityInformationUnitTest.java @@ -2,9 +2,6 @@ // Licensed under the MIT License. package com.microsoft.azure.spring.data.cosmosdb.repository.support; -import java.util.List; -import java.util.Objects; - import com.microsoft.azure.spring.data.cosmosdb.common.TestConstants; import com.microsoft.azure.spring.data.cosmosdb.core.mapping.Document; import com.microsoft.azure.spring.data.cosmosdb.core.mapping.PartitionKey; @@ -12,9 +9,11 @@ import com.microsoft.azure.spring.data.cosmosdb.domain.Person; import com.microsoft.azure.spring.data.cosmosdb.domain.Student; import org.junit.Test; - import org.springframework.data.annotation.Version; +import java.util.List; +import java.util.Objects; + import static org.assertj.core.api.Assertions.assertThat; public class CosmosEntityInformationUnitTest { diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com.microsoft.azure.spring.data.cosmosdb/repository/support/CosmosRepositoryFactoryBeanUnitTest.java b/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/repository/support/CosmosRepositoryFactoryBeanUnitTest.java similarity index 100% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com.microsoft.azure.spring.data.cosmosdb/repository/support/CosmosRepositoryFactoryBeanUnitTest.java rename to sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/repository/support/CosmosRepositoryFactoryBeanUnitTest.java diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com.microsoft.azure.spring.data.cosmosdb/repository/support/CosmosRepositoryFactoryUnitTest.java b/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/repository/support/CosmosRepositoryFactoryUnitTest.java similarity index 100% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com.microsoft.azure.spring.data.cosmosdb/repository/support/CosmosRepositoryFactoryUnitTest.java rename to sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/repository/support/CosmosRepositoryFactoryUnitTest.java diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/resources/application.properties b/sdk/cosmos/azure-spring-data-cosmosdb/src/test/resources/application.properties index 85ff3ddb4a407..12b7c8f46f80b 100644 --- a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/resources/application.properties +++ b/sdk/cosmos/azure-spring-data-cosmosdb/src/test/resources/application.properties @@ -1,6 +1,6 @@ -cosmosdb.uri=${DOCUMENTDB_URI} -cosmosdb.key=${DOCUMENTDB_KEY} -cosmosdb.secondaryKey=${COSMOSDB_SECONDARY_KEY} +cosmosdb.uri=${ACCOUNT_HOST} +cosmosdb.key=${ACCOUNT_KEY} +cosmosdb.secondaryKey=${SECONDARY_ACCOUNT_KEY} #You can also use connection string instead of uri and key to connect to cosmos DB #cosmosdb.connection-string=${DOCUMENTDB_CONNECTION_STRING} diff --git a/sdk/cosmos/test-resources.json b/sdk/cosmos/test-resources.json index 5ff266717f1bb..447dd5729a440 100644 --- a/sdk/cosmos/test-resources.json +++ b/sdk/cosmos/test-resources.json @@ -95,4 +95,4 @@ "value": "[listKeys(variables('resourceId'), variables('apiVersion')).secondaryMasterKey]" } } -} \ No newline at end of file +} diff --git a/sdk/cosmos/tests.yml b/sdk/cosmos/tests.yml index ecddcf4d81e79..41881477a7f93 100644 --- a/sdk/cosmos/tests.yml +++ b/sdk/cosmos/tests.yml @@ -244,4 +244,33 @@ jobs: goals: verify options: '$(ProfileFlag) -Dgpg.skip $(AdditionalArgs) -pl $(ProjectList)' - TestResultsFiles: '**/junitreports/TEST-*.xml' \ No newline at end of file + TestResultsFiles: '**/junitreports/TEST-*.xml' + + - template: ../../eng/pipelines/templates/jobs/archetype-sdk-tests.yml + parameters: + TestName: Integration_Test_Spring_Data_Cosmosdb + ServiceDirectory: cosmos + Artifacts: + - name: spring-data-cosmosdb + groupId: com.microsoft.azure + safeName: springdatacosmosdb + TimeoutInMinutes: 90 + Matrix: + Session_Integration: + ArmTemplateParameters: "@{ enableMultipleWriteLocations = $false; defaultConsistencyLevel = 'Session' }" + DisplayName: Session Integration + OSVmImage: 'ubuntu-18.04' + ProfileFlag: '-P integration-test-azure' + Strong_Integration: + ArmTemplateParameters: "@{ enableMultipleWriteLocations = $false; defaultConsistencyLevel = 'Strong' }" + DisplayName: Strong Integration + OSVmImage: 'ubuntu-18.04' + ProfileFlag: '-P integration-test-azure' + + EnvVars: + AZURE_TEST_MODE: LIVE + PreRunSteps: + - template: /eng/pipelines/templates/steps/install-reporting-tools.yml + TestStepMavenInputs: + goals: verify + options: '$(ProfileFlag) -Dgpg.skip -Dmaven.wagon.http.pool=false $(DefaultOptions) -Dmaven.javadoc.skip=true -Drevapi.skip=true -pl $(ProjectList)' From 86afb162836cadde5d991b2a7efe09c95abcf521 Mon Sep 17 00:00:00 2001 From: eboyd23 <65251944+eboyd23@users.noreply.github.com> Date: Tue, 7 Jul 2020 15:14:06 -0400 Subject: [PATCH 030/129] Testing for Tables Autorest Code (#12512) * testing for Tables Autorest Code --- sdk/tables/azure-data-tables/CHANGELOG.md | 3 + sdk/tables/azure-data-tables/pom.xml | 27 +- .../tables/TablesSharedKeyCredential.java | 113 ++++ .../TablesSharedKeyCredentialPolicy.java | 41 ++ .../com/azure/data/tables/package-info.java | 5 + .../azure/data/tables/AzureTableImplTest.java | 527 ++++++++++++++++++ .../session-records/createTable.json | 71 +++ .../createTableDuplicateName.json | 95 ++++ .../session-records/deleteEntity.json | 117 ++++ .../deleteNonExistentEntity.json | 93 ++++ .../deleteNonExistentTable.json | 48 ++ .../session-records/deleteTable.json | 71 +++ .../session-records/insertNoEtag.json | 97 ++++ .../session-records/mergeEntity.json | 119 ++++ .../mergeNonExistentEntity.json | 94 ++++ .../queryEntitiesWithPartitionAndRowKey.json | 120 ++++ .../session-records/queryEntity.json | 145 +++++ .../queryEntityWithFilter.json | 119 ++++ .../queryEntityWithSelect.json | 145 +++++ .../session-records/queryEntityWithTop.json | 93 ++++ .../resources/session-records/queryTable.json | 138 +++++ .../session-records/queryTablewithTop.json | 139 +++++ .../session-records/updateEntity.json | 119 ++++ .../updateNonExistentEntity.json | 94 ++++ 24 files changed, 2631 insertions(+), 2 deletions(-) create mode 100644 sdk/tables/azure-data-tables/CHANGELOG.md create mode 100644 sdk/tables/azure-data-tables/src/main/java/com/azure/data/tables/TablesSharedKeyCredential.java create mode 100644 sdk/tables/azure-data-tables/src/main/java/com/azure/data/tables/TablesSharedKeyCredentialPolicy.java create mode 100644 sdk/tables/azure-data-tables/src/main/java/com/azure/data/tables/package-info.java create mode 100644 sdk/tables/azure-data-tables/src/test/java/com/azure/data/tables/AzureTableImplTest.java create mode 100644 sdk/tables/azure-data-tables/src/test/resources/session-records/createTable.json create mode 100644 sdk/tables/azure-data-tables/src/test/resources/session-records/createTableDuplicateName.json create mode 100644 sdk/tables/azure-data-tables/src/test/resources/session-records/deleteEntity.json create mode 100644 sdk/tables/azure-data-tables/src/test/resources/session-records/deleteNonExistentEntity.json create mode 100644 sdk/tables/azure-data-tables/src/test/resources/session-records/deleteNonExistentTable.json create mode 100644 sdk/tables/azure-data-tables/src/test/resources/session-records/deleteTable.json create mode 100644 sdk/tables/azure-data-tables/src/test/resources/session-records/insertNoEtag.json create mode 100644 sdk/tables/azure-data-tables/src/test/resources/session-records/mergeEntity.json create mode 100644 sdk/tables/azure-data-tables/src/test/resources/session-records/mergeNonExistentEntity.json create mode 100644 sdk/tables/azure-data-tables/src/test/resources/session-records/queryEntitiesWithPartitionAndRowKey.json create mode 100644 sdk/tables/azure-data-tables/src/test/resources/session-records/queryEntity.json create mode 100644 sdk/tables/azure-data-tables/src/test/resources/session-records/queryEntityWithFilter.json create mode 100644 sdk/tables/azure-data-tables/src/test/resources/session-records/queryEntityWithSelect.json create mode 100644 sdk/tables/azure-data-tables/src/test/resources/session-records/queryEntityWithTop.json create mode 100644 sdk/tables/azure-data-tables/src/test/resources/session-records/queryTable.json create mode 100644 sdk/tables/azure-data-tables/src/test/resources/session-records/queryTablewithTop.json create mode 100644 sdk/tables/azure-data-tables/src/test/resources/session-records/updateEntity.json create mode 100644 sdk/tables/azure-data-tables/src/test/resources/session-records/updateNonExistentEntity.json diff --git a/sdk/tables/azure-data-tables/CHANGELOG.md b/sdk/tables/azure-data-tables/CHANGELOG.md new file mode 100644 index 0000000000000..4144f75694a03 --- /dev/null +++ b/sdk/tables/azure-data-tables/CHANGELOG.md @@ -0,0 +1,3 @@ +# Release History + +## 1.0.0-beta.1 (Unreleased) diff --git a/sdk/tables/azure-data-tables/pom.xml b/sdk/tables/azure-data-tables/pom.xml index 4fb23afccc726..4b6bc21b2d876 100644 --- a/sdk/tables/azure-data-tables/pom.xml +++ b/sdk/tables/azure-data-tables/pom.xml @@ -2,7 +2,8 @@ Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT License. --> - + 4.0.0 com.azure @@ -31,7 +32,6 @@ Licensed under the MIT License. HEAD - true @@ -42,6 +42,29 @@ Licensed under the MIT License. azure-core 1.6.0 + + com.azure + azure-storage-common + 12.7.0 + + + org.junit.jupiter + junit-jupiter + 5.6.2 + test + + + io.projectreactor + reactor-test + 3.3.5.RELEASE + test + + + com.azure + azure-core-test + 1.3.1 + test + diff --git a/sdk/tables/azure-data-tables/src/main/java/com/azure/data/tables/TablesSharedKeyCredential.java b/sdk/tables/azure-data-tables/src/main/java/com/azure/data/tables/TablesSharedKeyCredential.java new file mode 100644 index 0000000000000..276be119ad641 --- /dev/null +++ b/sdk/tables/azure-data-tables/src/main/java/com/azure/data/tables/TablesSharedKeyCredential.java @@ -0,0 +1,113 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.data.tables; + +import com.azure.storage.common.implementation.StorageImplUtils; + +import java.net.URL; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.Locale; +import java.util.Map; +import java.util.Objects; + +/** + * A Class which helps generate the shared key credentials for a given storage account to create a Http requests to + * access Azure Tables + */ +public class TablesSharedKeyCredential { + private static final String AUTHORIZATION_HEADER_FORMAT = "SharedKeyLite %s:%s"; + private final String accountName; + private final String accountKey; + + /** + * Constructor for TableSharedKeyCredential Class + * + * @param accountName name of the storage account + * @param accountKey key to the storage account + */ + public TablesSharedKeyCredential(String accountName, String accountKey) { + this.accountName = Objects.requireNonNull(accountName, "'accountName' cannot be null."); + this.accountKey = Objects.requireNonNull(accountKey, "'accountKey' cannot be null."); + } + + /** + * Generates the Auth Headers + * + * @param requestUrl the URL which the request is going to + * @param headers the headers of the request + * @return the auth header + */ + public String generateAuthorizationHeader(URL requestUrl, Map headers) { + String signature = StorageImplUtils.computeHMac256(accountKey, buildStringToSign(requestUrl, + headers)); + return String.format(AUTHORIZATION_HEADER_FORMAT, accountName, signature); + } + + /** + * creates the String to Sign + * + * @param requestUrl the Url which the request is going to + * @param headers the headers of the request + * @return a string to sign for the request + */ + private String buildStringToSign(URL requestUrl, Map headers) { + String dateHeader = headers.containsKey("x-ms-date") + ? "" + : this.getStandardHeaderValue(headers, "Date"); + return String.join("\n", + dateHeader, //date + getCanonicalizedResource(requestUrl)); //Canonicalized resource + } + + /** + * gets necessary headers if the request does not already contain them + * + * @param headers a map of the headers which the request has + * @param headerName the name of the header to get the standard header for + * @return the standard header for the given name + */ + private String getStandardHeaderValue(Map headers, String headerName) { + String headerValue = headers.get(headerName); + return headerValue == null ? "" : headerValue; + } + + + /** + * returns the canonicalized resource needed for a request + * + * @param requestUrl the url of the request + * @return the string that is the canonicalized resource + */ + private String getCanonicalizedResource(URL requestUrl) { + StringBuilder canonicalizedResource = new StringBuilder("/").append(accountName); + if (requestUrl.getPath().length() > 0) { + canonicalizedResource.append(requestUrl.getPath()); + } else { + canonicalizedResource.append('/'); + } + + if (requestUrl.getQuery() != null) { + Map queryParams = StorageImplUtils.parseQueryStringSplitValues(requestUrl.getQuery()); + ArrayList queryParamNames = new ArrayList<>(queryParams.keySet()); + + Collections.sort(queryParamNames); + + for (String queryParamName : queryParamNames) { + String[] queryParamValues = queryParams.get(queryParamName); + + Arrays.sort(queryParamValues); + + String queryParamValuesStr = String.join(",", queryParamValues); + + if (queryParamName.equalsIgnoreCase("comp")) { + canonicalizedResource.append("?").append(queryParamName.toLowerCase(Locale.ROOT)).append("=") + .append(queryParamValuesStr); + } + } + } + return canonicalizedResource.toString(); + } +} diff --git a/sdk/tables/azure-data-tables/src/main/java/com/azure/data/tables/TablesSharedKeyCredentialPolicy.java b/sdk/tables/azure-data-tables/src/main/java/com/azure/data/tables/TablesSharedKeyCredentialPolicy.java new file mode 100644 index 0000000000000..f689b85d043ad --- /dev/null +++ b/sdk/tables/azure-data-tables/src/main/java/com/azure/data/tables/TablesSharedKeyCredentialPolicy.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.data.tables; + +import com.azure.core.http.HttpPipelineCallContext; +import com.azure.core.http.HttpPipelineNextPolicy; +import com.azure.core.http.HttpResponse; +import com.azure.core.http.policy.HttpPipelinePolicy; +import reactor.core.publisher.Mono; + +/** + * This class helps authenticate an Http request for the Tables service + */ +public final class TablesSharedKeyCredentialPolicy implements HttpPipelinePolicy { + + private final TablesSharedKeyCredential credential; + + /** + * constructor for the TablesSharedKeyCredentialPolicy class + * + * @param credential the credentials of the account + */ + public TablesSharedKeyCredentialPolicy(TablesSharedKeyCredential credential) { + this.credential = credential; + } + + /** + * creates an Http response + * + * @param context the context of the http pipeline + * @param next the next Http pipeline policy + * @return an Http response + */ + public Mono process(HttpPipelineCallContext context, HttpPipelineNextPolicy next) { + String authorizationValue = credential.generateAuthorizationHeader(context.getHttpRequest().getUrl(), + context.getHttpRequest().getHeaders().toMap()); + context.getHttpRequest().setHeader("Authorization", authorizationValue); + return next.process(); + } +} diff --git a/sdk/tables/azure-data-tables/src/main/java/com/azure/data/tables/package-info.java b/sdk/tables/azure-data-tables/src/main/java/com/azure/data/tables/package-info.java new file mode 100644 index 0000000000000..22fcc4bc3349a --- /dev/null +++ b/sdk/tables/azure-data-tables/src/main/java/com/azure/data/tables/package-info.java @@ -0,0 +1,5 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +/** Package containing the inner classes for Azure Tables SDK. */ +package com.azure.data.tables; diff --git a/sdk/tables/azure-data-tables/src/test/java/com/azure/data/tables/AzureTableImplTest.java b/sdk/tables/azure-data-tables/src/test/java/com/azure/data/tables/AzureTableImplTest.java new file mode 100644 index 0000000000000..24f6133838694 --- /dev/null +++ b/sdk/tables/azure-data-tables/src/test/java/com/azure/data/tables/AzureTableImplTest.java @@ -0,0 +1,527 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.data.tables; + +import com.azure.core.http.HttpClient; +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpPipelineBuilder; +import com.azure.core.http.policy.AddDatePolicy; +import com.azure.core.http.policy.AddHeadersPolicy; +import com.azure.core.http.policy.HttpLogDetailLevel; +import com.azure.core.http.policy.HttpLogOptions; +import com.azure.core.http.policy.HttpLoggingPolicy; +import com.azure.core.http.policy.HttpPipelinePolicy; +import com.azure.core.http.policy.RetryPolicy; +import com.azure.core.test.TestBase; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.data.tables.implementation.AzureTableImpl; +import com.azure.data.tables.implementation.AzureTableImplBuilder; +import com.azure.data.tables.implementation.models.OdataMetadataFormat; +import com.azure.data.tables.implementation.models.QueryOptions; +import com.azure.data.tables.implementation.models.ResponseFormat; +import com.azure.data.tables.implementation.models.TableProperties; +import com.azure.data.tables.implementation.models.TableResponseProperties; +import com.azure.data.tables.implementation.models.TableServiceErrorException; +import com.azure.storage.common.implementation.connectionstring.StorageAuthenticationSettings; +import com.azure.storage.common.implementation.connectionstring.StorageConnectionString; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; +import reactor.test.StepVerifier; + +/** + * This class tests the Autorest code for the Tables track 2 SDK + */ +public class AzureTableImplTest extends TestBase { + private static final String PARTITION_KEY = "PartitionKey"; + private static final String ROW_KEY = "RowKey"; + private static final int TIMEOUT = 5000; + private AzureTableImpl azureTable; + + @Override + protected void beforeTest() { + String connectionString = interceptorManager.isPlaybackMode() + ? "DefaultEndpointsProtocol=https;AccountName=dummyAccount;AccountKey=xyzDummy;EndpointSuffix=core.windows.net" + : System.getenv("AZURE_TABLES_CONNECTION_STRING"); + StorageConnectionString storageConnectionString + = StorageConnectionString.create(connectionString, new ClientLogger(AzureTableImplTest.class)); + + Assertions.assertNotNull(connectionString, "Cannot continue test if connectionString is not set."); + + StorageAuthenticationSettings authSettings = storageConnectionString.getStorageAuthSettings(); + TablesSharedKeyCredential sharedKeyCredential = new TablesSharedKeyCredential(authSettings.getAccount().getName(), + authSettings.getAccount().getAccessKey()); + + List policies = new ArrayList<>(); + policies.add(new AddDatePolicy()); + policies.add(new AddHeadersPolicy(new HttpHeaders().put("Accept", + OdataMetadataFormat.APPLICATION_JSON_ODATA_MINIMALMETADATA.toString()))); + policies.add(new TablesSharedKeyCredentialPolicy(sharedKeyCredential)); + policies.add(new HttpLoggingPolicy(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BODY_AND_HEADERS))); + + HttpClient httpClientToUse; + if (interceptorManager.isPlaybackMode()) { + httpClientToUse = interceptorManager.getPlaybackClient(); + } else { + httpClientToUse = HttpClient.createDefault(); + policies.add(interceptorManager.getRecordPolicy()); + policies.add(new RetryPolicy()); + } + HttpPipeline pipeline = new HttpPipelineBuilder() + .httpClient(httpClientToUse) + .policies(policies.toArray(new HttpPipelinePolicy[0])) + .build(); + azureTable = new AzureTableImplBuilder() + .pipeline(pipeline) + .version("2019-02-02") + .url(storageConnectionString.getTableEndpoint().getPrimaryUri()) + .buildClient(); + } + + @Override + protected void afterTest() { + QueryOptions queryOptions = new QueryOptions() + .setFormat(OdataMetadataFormat.APPLICATION_JSON_ODATA_MINIMALMETADATA); + + Mono.when(azureTable.getTables().queryWithResponseAsync(testResourceNamer.randomUuid(), null, + queryOptions, Context.NONE).flatMapMany(tablesQueryResponse -> { + return Flux.fromIterable(tablesQueryResponse.getValue().getValue()).flatMap(tableResponseProperty -> { + return azureTable.getTables().deleteWithResponseAsync(tableResponseProperty.getTableName(), + testResourceNamer.randomUuid(), Context.NONE); + }); + })).block(); + } + + void createTable(String tableName) { + TableProperties tableProperties = new TableProperties().setTableName(tableName); + String requestId = testResourceNamer.randomUuid(); + + azureTable.getTables().createWithResponseAsync(tableProperties, requestId, + ResponseFormat.RETURN_CONTENT, null, Context.NONE).block(); + } + + void insertNoETag(String tableName, Map properties) { + String requestId = testResourceNamer.randomUuid(); + + azureTable.getTables().insertEntityWithResponseAsync(tableName, TIMEOUT, + requestId, ResponseFormat.RETURN_CONTENT, properties, null, Context.NONE).log().block(); + } + + @Test + void createTable() { + // Arrange + String tableName = testResourceNamer.randomName("test", 20); + TableProperties tableProperties = new TableProperties().setTableName(tableName); + int expectedStatusCode = 201; + String requestId = testResourceNamer.randomUuid(); + + // Act & Assert + StepVerifier.create(azureTable.getTables().createWithResponseAsync(tableProperties, + requestId, ResponseFormat.RETURN_CONTENT, null, Context.NONE)) + .assertNext(response -> { + Assertions.assertEquals(expectedStatusCode, response.getStatusCode()); + }) + .expectComplete() + .verify(); + } + + @Test + void createTableDuplicateName() { + // Arrange + String tableName = testResourceNamer.randomName("test", 20); + TableProperties tableProperties = new TableProperties().setTableName(tableName); + createTable(tableName); + String requestId = testResourceNamer.randomUuid(); + + // Act & Assert + StepVerifier.create(azureTable.getTables().createWithResponseAsync(tableProperties, + requestId, ResponseFormat.RETURN_CONTENT, null, Context.NONE)) + .expectError(TableServiceErrorException.class) + .verify(); + } + + @Test + void deleteTable() { + // Arrange + String tableName = testResourceNamer.randomName("test", 20); + createTable(tableName); + int expectedStatusCode = 204; + String requestId = testResourceNamer.randomUuid(); + + // Act & Assert + StepVerifier.create(azureTable.getTables().deleteWithResponseAsync(tableName, requestId, + Context.NONE)) + .assertNext(response -> { + Assertions.assertEquals(expectedStatusCode, response.getStatusCode()); + }) + .expectComplete() + .verify(); + } + + @Test + void deleteNonExistentTable() { + // Arrange + String tableName = testResourceNamer.randomName("test", 20); + String requestId = testResourceNamer.randomUuid(); + + // Act & Assert + StepVerifier.create(azureTable.getTables().deleteWithResponseAsync(tableName, requestId, + Context.NONE)) + .expectError(com.azure.data.tables.implementation.models.TableServiceErrorException.class) + .verify(); + } + + @Test + void queryTable() { + // Arrange + QueryOptions queryOptions = new QueryOptions() + .setFormat(OdataMetadataFormat.APPLICATION_JSON_ODATA_MINIMALMETADATA); + String tableA = testResourceNamer.randomName("AtestA", 20); + String tableB = testResourceNamer.randomName("BtestB", 20); + createTable(tableA); + createTable(tableB); + int expectedStatusCode = 200; + String requestId = testResourceNamer.randomUuid(); + + // Act & Assert + StepVerifier.create(azureTable.getTables().queryWithResponseAsync(requestId, null, + queryOptions, Context.NONE)) + .assertNext(response -> { + Assertions.assertEquals(expectedStatusCode, response.getStatusCode()); + Assertions.assertNotNull(response.getValue(), "Expected there to be a result."); + + List results = response.getValue().getValue(); + + Assertions.assertNotNull(results, "Expected there to be a set of items."); + Assertions.assertEquals(2, results.size()); + Assertions.assertEquals(response.getValue().getValue().get(0).getTableName(), tableA); + Assertions.assertEquals(response.getValue().getValue().get(1).getTableName(), tableB); + }) + .expectComplete() + .verify(); + } + + @Test + void queryTablewithTop() { + // Arrange + QueryOptions queryOptions = new QueryOptions() + .setFormat(OdataMetadataFormat.APPLICATION_JSON_ODATA_MINIMALMETADATA); + String tableA = testResourceNamer.randomName("AtestA", 20); + String tableB = testResourceNamer.randomName("BtestB", 20); + createTable(tableA); + createTable(tableB); + int expectedStatusCode = 200; + int expectedSize = 1; + String requestId = testResourceNamer.randomUuid(); + queryOptions.setTop(1); + + // Act & Assert + StepVerifier.create(azureTable.getTables().queryWithResponseAsync(requestId, null, + queryOptions, Context.NONE)) + .assertNext(response -> { + Assertions.assertEquals(expectedStatusCode, response.getStatusCode()); + Assertions.assertEquals(expectedSize, response.getValue().getValue().size()); + Assertions.assertEquals(tableA, response.getValue().getValue().get(0).getTableName()); + }) + .expectComplete() + .verify(); + } + + @Test + void insertNoEtag() { + // Arrange + String tableName = testResourceNamer.randomName("test", 20); + createTable(tableName); + Map properties = new HashMap<>(); + String partitionKeyValue = testResourceNamer.randomName("partitionKey", 20); + String rowKeyValue = testResourceNamer.randomName("rowKey", 20); + properties.put(PARTITION_KEY, partitionKeyValue); + properties.put(ROW_KEY, rowKeyValue); + int expectedStatusCode = 201; + String requestId = testResourceNamer.randomUuid(); + + // Act & Assert + StepVerifier.create(azureTable.getTables().insertEntityWithResponseAsync(tableName, TIMEOUT, + requestId, ResponseFormat.RETURN_CONTENT, properties, null, Context.NONE)) + .assertNext(response -> { + Assertions.assertEquals(expectedStatusCode, response.getStatusCode()); + }) + .expectComplete() + .verify(); + } + + @Test + void mergeEntity() { + // Arrange + String tableName = testResourceNamer.randomName("test", 20); + createTable(tableName); + Map properties = new HashMap<>(); + String partitionKeyValue = testResourceNamer.randomName("partitionKey", 20); + String rowKeyValue = testResourceNamer.randomName("rowKey", 20); + properties.put(PARTITION_KEY, partitionKeyValue); + properties.put(ROW_KEY, rowKeyValue); + int expectedStatusCode = 204; + String requestId = testResourceNamer.randomUuid(); + insertNoETag(tableName, properties); + properties.put("extraProperty", testResourceNamer.randomName("extraProperty", 16)); + + // Act & Assert + StepVerifier.create(azureTable.getTables().mergeEntityWithResponseAsync(tableName, partitionKeyValue, + rowKeyValue, TIMEOUT, requestId, "*", properties, null, Context.NONE)) + .assertNext(response -> { + Assertions.assertEquals(expectedStatusCode, response.getStatusCode()); + }) + .expectComplete() + .verify(); + } + + @Test + void mergeNonExistentEntity() { + // Arrange + String tableName = testResourceNamer.randomName("test", 20); + createTable(tableName); + Map properties = new HashMap<>(); + String partitionKeyValue = testResourceNamer.randomName("partitionKey", 20); + String rowKeyValue = testResourceNamer.randomName("rowKey", 20); + String requestId = testResourceNamer.randomUuid(); + + // Act & Assert + StepVerifier.create(azureTable.getTables().mergeEntityWithResponseAsync(tableName, partitionKeyValue, + rowKeyValue, TIMEOUT, requestId, "*", properties, null, Context.NONE)) + .expectError(com.azure.data.tables.implementation.models.TableServiceErrorException.class) + .verify(); + } + + @Test + void updateEntity() { + // Arrange + String tableName = testResourceNamer.randomName("test", 20); + createTable(tableName); + Map properties = new HashMap<>(); + String partitionKeyValue = testResourceNamer.randomName("partitionKey", 20); + String rowKeyValue = testResourceNamer.randomName("rowKey", 20); + properties.put(PARTITION_KEY, partitionKeyValue); + properties.put(ROW_KEY, rowKeyValue); + int expectedStatusCode = 204; + String requestId = testResourceNamer.randomUuid(); + insertNoETag(tableName, properties); + properties.put("extraProperty", testResourceNamer.randomName("extraProperty", 16)); + + // Act & Assert + StepVerifier.create(azureTable.getTables().updateEntityWithResponseAsync(tableName, partitionKeyValue, + rowKeyValue, TIMEOUT, requestId, "*", properties, null, Context.NONE)) + .assertNext(response -> { + Assertions.assertEquals(expectedStatusCode, response.getStatusCode()); + }) + .expectComplete() + .verify(); + } + + @Test + void updateNonExistentEntity() { + // Arrange + String tableName = testResourceNamer.randomName("test", 20); + createTable(tableName); + Map properties = new HashMap<>(); + String partitionKeyValue = testResourceNamer.randomName("partitionKey", 20); + String rowKeyValue = testResourceNamer.randomName("rowKey", 20); + String requestId = testResourceNamer.randomUuid(); + + // Act & Assert + StepVerifier.create(azureTable.getTables().updateEntityWithResponseAsync(tableName, partitionKeyValue, + rowKeyValue, TIMEOUT, requestId, "*", properties, null, Context.NONE)) + .expectError(com.azure.data.tables.implementation.models.TableServiceErrorException.class) + .verify(); + } + + @Test + void deleteEntity() { + // Arrange + String tableName = testResourceNamer.randomName("test", 20); + createTable(tableName); + Map properties = new HashMap<>(); + String partitionKeyValue = testResourceNamer.randomName("partitionKey", 20); + String rowKeyValue = testResourceNamer.randomName("rowKey", 20); + properties.put(PARTITION_KEY, partitionKeyValue); + properties.put(ROW_KEY, rowKeyValue); + int expectedStatusCode = 204; + String requestId = testResourceNamer.randomUuid(); + insertNoETag(tableName, properties); + + // Act & Assert + StepVerifier.create(azureTable.getTables().deleteEntityWithResponseAsync(tableName, partitionKeyValue, + rowKeyValue, "*", TIMEOUT, requestId, null, Context.NONE)) + .assertNext(response -> { + Assertions.assertEquals(expectedStatusCode, response.getStatusCode()); + }) + .expectComplete() + .verify(); + } + + @Test + void deleteNonExistentEntity() { + // Arrange + String tableName = testResourceNamer.randomName("test", 20); + createTable(tableName); + String partitionKeyValue = testResourceNamer.randomName("partitionKey", 20); + String rowKeyValue = testResourceNamer.randomName("rowKey", 20); + String requestId = testResourceNamer.randomUuid(); + + // Act & Assert + StepVerifier.create(azureTable.getTables().deleteEntityWithResponseAsync(tableName, partitionKeyValue, + rowKeyValue, "*", TIMEOUT, requestId, null, Context.NONE)) + .expectError(com.azure.data.tables.implementation.models.TableServiceErrorException.class) + .verify(); + } + + @Test + void queryEntity() { + // Arrange + String requestId = testResourceNamer.randomUuid(); + QueryOptions queryOptions = new QueryOptions().setFormat(OdataMetadataFormat.APPLICATION_JSON_ODATA_FULLMETADATA); + String tableName = testResourceNamer.randomName("test", 20); + createTable(tableName); + //insert entity A + Map entityA = new HashMap<>(); + String partitionKeyEntityA = testResourceNamer.randomName("partitionKeyA", 20); + entityA.put(PARTITION_KEY, partitionKeyEntityA); + entityA.put(ROW_KEY, testResourceNamer.randomName("rowKeyA", 20)); + insertNoETag(tableName, entityA); + //insert entity B + Map entityB = new HashMap<>(); + String partitionKeyEntityB = testResourceNamer.randomName("partitionKeyB", 20); + entityB.put(PARTITION_KEY, partitionKeyEntityB); + entityB.put(ROW_KEY, testResourceNamer.randomName("rowKeyB", 20)); + insertNoETag(tableName, entityB); + int expectedStatusCode = 200; + + // Act & Assert + StepVerifier.create(azureTable.getTables().queryEntitiesWithResponseAsync(tableName, TIMEOUT, + requestId, null, null, queryOptions, Context.NONE)) + .assertNext(response -> { + Assertions.assertEquals(expectedStatusCode, response.getStatusCode()); + Assertions.assertEquals(true, response.getValue().getValue().get(0).containsValue(partitionKeyEntityA)); + Assertions.assertEquals(true, response.getValue().getValue().get(1).containsValue(partitionKeyEntityB)); + + }) + .expectComplete() + .verify(); + } + + @Test + void queryEntityWithSelect() { + // Arrange + String requestId = testResourceNamer.randomUuid(); + QueryOptions queryOptions = new QueryOptions().setFormat(OdataMetadataFormat.APPLICATION_JSON_ODATA_FULLMETADATA); + String tableName = testResourceNamer.randomName("test", 20); + createTable(tableName); + //insert entity A + Map entityA = new HashMap<>(); + String partitionKeyEntityA = testResourceNamer.randomName("partitionKeyA", 20); + String rowKeyEntityA = testResourceNamer.randomName("rowKeyA", 20); + entityA.put(PARTITION_KEY, partitionKeyEntityA); + entityA.put(ROW_KEY, rowKeyEntityA); + insertNoETag(tableName, entityA); + //insert entity B + Map entityB = new HashMap<>(); + String partitionKeyEntityB = testResourceNamer.randomName("partitionKeyB", 20); + String rowKeyEntityB = testResourceNamer.randomName("rowKeyB", 20); + entityB.put(PARTITION_KEY, partitionKeyEntityB); + entityB.put(ROW_KEY, rowKeyEntityB); + insertNoETag(tableName, entityB); + int expectedStatusCode = 200; + queryOptions.setSelect(ROW_KEY); + + // Act & Assert + StepVerifier.create(azureTable.getTables().queryEntitiesWithResponseAsync(tableName, TIMEOUT, + requestId, null, null, queryOptions, Context.NONE)) + .assertNext(response -> { + Assertions.assertEquals(expectedStatusCode, response.getStatusCode()); + Assertions.assertEquals(true, response.getValue().getValue().get(0).containsValue(rowKeyEntityA)); + Assertions.assertEquals(true, response.getValue().getValue().get(1).containsValue(rowKeyEntityB)); + + }) + .expectComplete() + .verify(); + } + + @Test + void queryEntityWithFilter() { + // Arrange + String requestId = testResourceNamer.randomUuid(); + QueryOptions queryOptions = new QueryOptions().setFormat(OdataMetadataFormat.APPLICATION_JSON_ODATA_FULLMETADATA); + String tableName = testResourceNamer.randomName("test", 20); + createTable(tableName); + Map entityA = new HashMap<>(); + String partitionKeyEntityA = testResourceNamer.randomName("partitionKeyA", 20); + entityA.put(PARTITION_KEY, partitionKeyEntityA); + entityA.put(ROW_KEY, testResourceNamer.randomName("rowKeyA", 20)); + insertNoETag(tableName, entityA); + int expectedStatusCode = 200; + queryOptions.setSelect(PARTITION_KEY + "eq" + partitionKeyEntityA); + + // Act & Assert + StepVerifier.create(azureTable.getTables().queryEntitiesWithResponseAsync(tableName, TIMEOUT, + requestId, null, null, queryOptions, Context.NONE)) + .assertNext(response -> { + Assertions.assertEquals(expectedStatusCode, response.getStatusCode()); + + }) + .expectComplete() + .verify(); + } + + @Test + void queryEntityWithTop() { + // Arrange + String requestId = testResourceNamer.randomUuid(); + QueryOptions queryOptions = new QueryOptions().setFormat(OdataMetadataFormat.APPLICATION_JSON_ODATA_FULLMETADATA); + String tableName = testResourceNamer.randomName("test", 20); + createTable(tableName); + int expectedStatusCode = 200; + queryOptions.setTop(0); + + // Act & Assert + StepVerifier.create(azureTable.getTables().queryEntitiesWithResponseAsync(tableName, TIMEOUT, + requestId, null, null, queryOptions, Context.NONE)) + .assertNext(response -> { + Assertions.assertEquals(expectedStatusCode, response.getStatusCode()); + + }) + .expectComplete() + .verify(); + } + + + @Test + void queryEntitiesWithPartitionAndRowKey() { + // Arrange + QueryOptions queryOptions = new QueryOptions().setFormat(OdataMetadataFormat.APPLICATION_JSON_ODATA_FULLMETADATA); + String tableName = testResourceNamer.randomName("test", 20); + createTable(tableName); + Map properties = new HashMap<>(); + String partitionKeyValue = testResourceNamer.randomName("partitionKey", 20); + String rowKeyValue = testResourceNamer.randomName("rowKey", 20); + properties.put(PARTITION_KEY, partitionKeyValue); + properties.put(ROW_KEY, rowKeyValue); + insertNoETag(tableName, properties); + + // Act & Assert + StepVerifier.create(azureTable.getTables().queryEntitiesWithPartitionAndRowKeyWithResponseAsync(tableName, partitionKeyValue, + rowKeyValue, TIMEOUT, testResourceNamer.randomUuid(), queryOptions, Context.NONE)) + .assertNext(response -> { + Assertions.assertEquals(200, response.getStatusCode()); + }) + .expectComplete() + .verify(); + } + +} diff --git a/sdk/tables/azure-data-tables/src/test/resources/session-records/createTable.json b/sdk/tables/azure-data-tables/src/test/resources/session-records/createTable.json new file mode 100644 index 0000000000000..0d5bbc89624a0 --- /dev/null +++ b/sdk/tables/azure-data-tables/src/test/resources/session-records/createTable.json @@ -0,0 +1,71 @@ +{ + "networkCallRecords" : [ { + "Method" : "POST", + "Uri" : "https://REDACTED.table.core.windows.net/Tables", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "a9d78bb2-d164-4813-a68a-21b1d869f95a", + "Content-Type" : "application/json" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "StatusCode" : "201", + "Date" : "Wed, 01 Jul 2020 12:52:39 GMT", + "Cache-Control" : "no-cache", + "x-ms-request-id" : "a7b4297d-9002-00a7-1ba6-4fbd3f000000", + "Body" : "{\"odata.metadata\":\"https://telboytrial.table.core.windows.net/$metadata#Tables/@Element\",\"TableName\":\"test76690b6b34\"}", + "Preference-Applied" : "return-content", + "x-ms-client-request-id" : "a9d78bb2-d164-4813-a68a-21b1d869f95a", + "Content-Type" : "application/json;odata=minimalmetadata;streaming=true;charset=utf-8", + "Location" : "https://telboytrial.table.core.windows.net/Tables('test76690b6b34')" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.table.core.windows.net/Tables?$format=application/json%3Bodata%3Dminimalmetadata", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "5c690d2f-1bed-4a8a-b3d5-bd2e16abb60b" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "Cache-Control" : "no-cache", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "ad30c2d1-f002-0018-17a6-4f8a9a000000", + "Body" : "{\"odata.metadata\":\"https://telboytrial.table.core.windows.net/$metadata#Tables\",\"value\":[{\"TableName\":\"test76690b6b34\"}]}", + "Date" : "Wed, 01 Jul 2020 12:52:39 GMT", + "x-ms-client-request-id" : "5c690d2f-1bed-4a8a-b3d5-bd2e16abb60b", + "Content-Type" : "application/json;odata=minimalmetadata;streaming=true;charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "DELETE", + "Uri" : "https://REDACTED.table.core.windows.net/Tables('test76690b6b34')", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "5e96da64-2fbc-4c80-97e0-2a9bc5d027d2" + }, + "Response" : { + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "Cache-Control" : "no-cache", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "204", + "x-ms-request-id" : "093a81a1-5002-005c-2fa6-4f00a5000000", + "Date" : "Wed, 01 Jul 2020 12:52:40 GMT", + "x-ms-client-request-id" : "5e96da64-2fbc-4c80-97e0-2a9bc5d027d2" + }, + "Exception" : null + } ], + "variables" : [ "test76690b6b34", "a9d78bb2-d164-4813-a68a-21b1d869f95a", "5c690d2f-1bed-4a8a-b3d5-bd2e16abb60b", "5e96da64-2fbc-4c80-97e0-2a9bc5d027d2" ] +} \ No newline at end of file diff --git a/sdk/tables/azure-data-tables/src/test/resources/session-records/createTableDuplicateName.json b/sdk/tables/azure-data-tables/src/test/resources/session-records/createTableDuplicateName.json new file mode 100644 index 0000000000000..45f7ff918c26f --- /dev/null +++ b/sdk/tables/azure-data-tables/src/test/resources/session-records/createTableDuplicateName.json @@ -0,0 +1,95 @@ +{ + "networkCallRecords" : [ { + "Method" : "POST", + "Uri" : "https://REDACTED.table.core.windows.net/Tables", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "409a82ad-e287-44d1-a690-5bd4ef967ed6", + "Content-Type" : "application/json" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "StatusCode" : "201", + "Date" : "Wed, 01 Jul 2020 12:52:39 GMT", + "Cache-Control" : "no-cache", + "x-ms-request-id" : "ad30c29a-f002-0018-67a6-4f8a9a000000", + "Body" : "{\"odata.metadata\":\"https://telboytrial.table.core.windows.net/$metadata#Tables/@Element\",\"TableName\":\"test58120f3142\"}", + "Preference-Applied" : "return-content", + "x-ms-client-request-id" : "409a82ad-e287-44d1-a690-5bd4ef967ed6", + "Content-Type" : "application/json;odata=minimalmetadata;streaming=true;charset=utf-8", + "Location" : "https://telboytrial.table.core.windows.net/Tables('test58120f3142')" + }, + "Exception" : null + }, { + "Method" : "POST", + "Uri" : "https://REDACTED.table.core.windows.net/Tables", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "fd6fdf4f-e5d8-4103-8701-57186d499031", + "Content-Type" : "application/json" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "StatusCode" : "409", + "Date" : "Wed, 01 Jul 2020 12:52:39 GMT", + "Cache-Control" : "no-cache", + "x-ms-request-id" : "a7b42973-9002-00a7-13a6-4fbd3f000000", + "Body" : "{\"odata.error\":{\"code\":\"TableAlreadyExists\",\"message\":{\"lang\":\"en-US\",\"value\":\"The table specified already exists.\\nRequestId:a7b42973-9002-00a7-13a6-4fbd3f000000\\nTime:2020-07-01T12:52:40.2918342Z\"}}}", + "Preference-Applied" : "return-content", + "x-ms-client-request-id" : "fd6fdf4f-e5d8-4103-8701-57186d499031", + "Content-Type" : "application/json;odata=minimalmetadata;streaming=true;charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.table.core.windows.net/Tables?$format=application/json%3Bodata%3Dminimalmetadata", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "e65b82b8-5f45-45f5-8782-599e35dce293" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "Cache-Control" : "no-cache", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "ad30c2ab-f002-0018-74a6-4f8a9a000000", + "Body" : "{\"odata.metadata\":\"https://telboytrial.table.core.windows.net/$metadata#Tables\",\"value\":[{\"TableName\":\"test58120f3142\"}]}", + "Date" : "Wed, 01 Jul 2020 12:52:39 GMT", + "x-ms-client-request-id" : "e65b82b8-5f45-45f5-8782-599e35dce293", + "Content-Type" : "application/json;odata=minimalmetadata;streaming=true;charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "DELETE", + "Uri" : "https://REDACTED.table.core.windows.net/Tables('test58120f3142')", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "2556776e-fbcd-4604-8e29-7704e4d660b8" + }, + "Response" : { + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "Cache-Control" : "no-cache", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "204", + "x-ms-request-id" : "a7b42976-9002-00a7-15a6-4fbd3f000000", + "Date" : "Wed, 01 Jul 2020 12:52:39 GMT", + "x-ms-client-request-id" : "2556776e-fbcd-4604-8e29-7704e4d660b8" + }, + "Exception" : null + } ], + "variables" : [ "test58120f3142", "409a82ad-e287-44d1-a690-5bd4ef967ed6", "fd6fdf4f-e5d8-4103-8701-57186d499031", "e65b82b8-5f45-45f5-8782-599e35dce293", "2556776e-fbcd-4604-8e29-7704e4d660b8" ] +} \ No newline at end of file diff --git a/sdk/tables/azure-data-tables/src/test/resources/session-records/deleteEntity.json b/sdk/tables/azure-data-tables/src/test/resources/session-records/deleteEntity.json new file mode 100644 index 0000000000000..a25b9a7b1b4dd --- /dev/null +++ b/sdk/tables/azure-data-tables/src/test/resources/session-records/deleteEntity.json @@ -0,0 +1,117 @@ +{ + "networkCallRecords" : [ { + "Method" : "POST", + "Uri" : "https://REDACTED.table.core.windows.net/Tables", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "faafc5c0-590f-40a3-97f4-ebcfb9000c96", + "Content-Type" : "application/json" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "StatusCode" : "201", + "Date" : "Wed, 01 Jul 2020 12:52:39 GMT", + "Cache-Control" : "no-cache", + "x-ms-request-id" : "ad30c273-f002-0018-42a6-4f8a9a000000", + "Body" : "{\"odata.metadata\":\"https://telboytrial.table.core.windows.net/$metadata#Tables/@Element\",\"TableName\":\"test245874b810\"}", + "Preference-Applied" : "return-content", + "x-ms-client-request-id" : "faafc5c0-590f-40a3-97f4-ebcfb9000c96", + "Content-Type" : "application/json;odata=minimalmetadata;streaming=true;charset=utf-8", + "Location" : "https://telboytrial.table.core.windows.net/Tables('test245874b810')" + }, + "Exception" : null + }, { + "Method" : "POST", + "Uri" : "https://REDACTED.table.core.windows.net/test245874b810?timeout=5000", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "624270cf-d95d-4534-90e7-557fc3aa5072", + "Content-Type" : "application/json" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "StatusCode" : "201", + "Date" : "Wed, 01 Jul 2020 12:52:39 GMT", + "Cache-Control" : "no-cache", + "ETag" : "W/\"datetime'2020-07-01T12%3A52%3A39.957606Z'\"", + "x-ms-request-id" : "a7b42962-9002-00a7-06a6-4fbd3f000000", + "Body" : "{\"odata.metadata\":\"https://telboytrial.table.core.windows.net/$metadata#test245874b810/@Element\",\"odata.etag\":\"W/\\\"datetime'2020-07-01T12%3A52%3A39.957606Z'\\\"\",\"PartitionKey\":\"partitionkey59485f\",\"RowKey\":\"rowkey62777e872\",\"Timestamp\":\"2020-07-01T12:52:39.957606Z\"}", + "Preference-Applied" : "return-content", + "x-ms-client-request-id" : "624270cf-d95d-4534-90e7-557fc3aa5072", + "Content-Type" : "application/json;odata=minimalmetadata;streaming=true;charset=utf-8", + "Location" : "https://telboytrial.table.core.windows.net/test245874b810(PartitionKey='partitionkey59485f',RowKey='rowkey62777e872')" + }, + "Exception" : null + }, { + "Method" : "DELETE", + "Uri" : "https://REDACTED.table.core.windows.net/test245874b810(PartitionKey='partitionkey59485f',RowKey='rowkey62777e872')?timeout=5000", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "ccd134fc-ef83-422d-837e-29fc76d2e714" + }, + "Response" : { + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "Cache-Control" : "no-cache", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "204", + "x-ms-request-id" : "ad30c27f-f002-0018-4da6-4f8a9a000000", + "Date" : "Wed, 01 Jul 2020 12:52:39 GMT", + "x-ms-client-request-id" : "ccd134fc-ef83-422d-837e-29fc76d2e714" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.table.core.windows.net/Tables?$format=application/json%3Bodata%3Dminimalmetadata", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "c141cf5a-fea3-4063-986a-e678ebd1ef73" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "Cache-Control" : "no-cache", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "a7b42967-9002-00a7-09a6-4fbd3f000000", + "Body" : "{\"odata.metadata\":\"https://telboytrial.table.core.windows.net/$metadata#Tables\",\"value\":[{\"TableName\":\"test245874b810\"}]}", + "Date" : "Wed, 01 Jul 2020 12:52:39 GMT", + "x-ms-client-request-id" : "c141cf5a-fea3-4063-986a-e678ebd1ef73", + "Content-Type" : "application/json;odata=minimalmetadata;streaming=true;charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "DELETE", + "Uri" : "https://REDACTED.table.core.windows.net/Tables('test245874b810')", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "a03fed8f-d134-459d-a034-ecc1500936f2" + }, + "Response" : { + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "Cache-Control" : "no-cache", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "204", + "x-ms-request-id" : "ad30c286-f002-0018-54a6-4f8a9a000000", + "Date" : "Wed, 01 Jul 2020 12:52:39 GMT", + "x-ms-client-request-id" : "a03fed8f-d134-459d-a034-ecc1500936f2" + }, + "Exception" : null + } ], + "variables" : [ "test245874b810", "faafc5c0-590f-40a3-97f4-ebcfb9000c96", "partitionkey59485f", "rowkey62777e872", "ccd134fc-ef83-422d-837e-29fc76d2e714", "624270cf-d95d-4534-90e7-557fc3aa5072", "c141cf5a-fea3-4063-986a-e678ebd1ef73", "a03fed8f-d134-459d-a034-ecc1500936f2" ] +} \ No newline at end of file diff --git a/sdk/tables/azure-data-tables/src/test/resources/session-records/deleteNonExistentEntity.json b/sdk/tables/azure-data-tables/src/test/resources/session-records/deleteNonExistentEntity.json new file mode 100644 index 0000000000000..32ae91b9bf695 --- /dev/null +++ b/sdk/tables/azure-data-tables/src/test/resources/session-records/deleteNonExistentEntity.json @@ -0,0 +1,93 @@ +{ + "networkCallRecords" : [ { + "Method" : "POST", + "Uri" : "https://REDACTED.table.core.windows.net/Tables", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "8464dcea-160a-4522-be14-d2e36b9c63ea", + "Content-Type" : "application/json" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "StatusCode" : "201", + "Date" : "Wed, 01 Jul 2020 12:52:41 GMT", + "Cache-Control" : "no-cache", + "x-ms-request-id" : "093a81b5-5002-005c-3ea6-4f00a5000000", + "Body" : "{\"odata.metadata\":\"https://telboytrial.table.core.windows.net/$metadata#Tables/@Element\",\"TableName\":\"test89907b301b\"}", + "Preference-Applied" : "return-content", + "x-ms-client-request-id" : "8464dcea-160a-4522-be14-d2e36b9c63ea", + "Content-Type" : "application/json;odata=minimalmetadata;streaming=true;charset=utf-8", + "Location" : "https://telboytrial.table.core.windows.net/Tables('test89907b301b')" + }, + "Exception" : null + }, { + "Method" : "DELETE", + "Uri" : "https://REDACTED.table.core.windows.net/test89907b301b(PartitionKey='partitionkey208848',RowKey='rowkey218589688')?timeout=5000", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "7f7ff35f-5d51-460e-aeb1-51f3c8274fd2" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "Cache-Control" : "no-cache", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "StatusCode" : "404", + "x-ms-request-id" : "a7b4299e-9002-00a7-36a6-4fbd3f000000", + "Body" : "{\"odata.error\":{\"code\":\"ResourceNotFound\",\"message\":{\"lang\":\"en-US\",\"value\":\"The specified resource does not exist.\\nRequestId:a7b4299e-9002-00a7-36a6-4fbd3f000000\\nTime:2020-07-01T12:52:41.7468206Z\"}}}", + "Date" : "Wed, 01 Jul 2020 12:52:41 GMT", + "x-ms-client-request-id" : "7f7ff35f-5d51-460e-aeb1-51f3c8274fd2", + "Content-Type" : "application/json;odata=minimalmetadata;streaming=true;charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.table.core.windows.net/Tables?$format=application/json%3Bodata%3Dminimalmetadata", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "384b2804-235c-494b-987c-670eb9bdf5d7" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "Cache-Control" : "no-cache", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "ad30c31e-f002-0018-5ea6-4f8a9a000000", + "Body" : "{\"odata.metadata\":\"https://telboytrial.table.core.windows.net/$metadata#Tables\",\"value\":[{\"TableName\":\"test89907b301b\"}]}", + "Date" : "Wed, 01 Jul 2020 12:52:40 GMT", + "x-ms-client-request-id" : "384b2804-235c-494b-987c-670eb9bdf5d7", + "Content-Type" : "application/json;odata=minimalmetadata;streaming=true;charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "DELETE", + "Uri" : "https://REDACTED.table.core.windows.net/Tables('test89907b301b')", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "6ec93e40-fd7b-4493-9a7d-550630d5c052" + }, + "Response" : { + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "Cache-Control" : "no-cache", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "204", + "x-ms-request-id" : "093a81b7-5002-005c-3fa6-4f00a5000000", + "Date" : "Wed, 01 Jul 2020 12:52:41 GMT", + "x-ms-client-request-id" : "6ec93e40-fd7b-4493-9a7d-550630d5c052" + }, + "Exception" : null + } ], + "variables" : [ "test89907b301b", "8464dcea-160a-4522-be14-d2e36b9c63ea", "partitionkey208848", "rowkey218589688", "7f7ff35f-5d51-460e-aeb1-51f3c8274fd2", "384b2804-235c-494b-987c-670eb9bdf5d7", "6ec93e40-fd7b-4493-9a7d-550630d5c052" ] +} \ No newline at end of file diff --git a/sdk/tables/azure-data-tables/src/test/resources/session-records/deleteNonExistentTable.json b/sdk/tables/azure-data-tables/src/test/resources/session-records/deleteNonExistentTable.json new file mode 100644 index 0000000000000..f04c87092323a --- /dev/null +++ b/sdk/tables/azure-data-tables/src/test/resources/session-records/deleteNonExistentTable.json @@ -0,0 +1,48 @@ +{ + "networkCallRecords" : [ { + "Method" : "DELETE", + "Uri" : "https://REDACTED.table.core.windows.net/Tables('test881632ce78')", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "61e7d1cd-7f37-4a62-a9d4-e969489a4706" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "Cache-Control" : "no-cache", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "StatusCode" : "404", + "x-ms-request-id" : "a7b4299c-9002-00a7-34a6-4fbd3f000000", + "Body" : "{\"odata.error\":{\"code\":\"ResourceNotFound\",\"message\":{\"lang\":\"en-US\",\"value\":\"The specified resource does not exist.\\nRequestId:a7b4299c-9002-00a7-34a6-4fbd3f000000\\nTime:2020-07-01T12:52:41.6397487Z\"}}}", + "Date" : "Wed, 01 Jul 2020 12:52:40 GMT", + "x-ms-client-request-id" : "61e7d1cd-7f37-4a62-a9d4-e969489a4706", + "Content-Type" : "application/json;odata=minimalmetadata;streaming=true;charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.table.core.windows.net/Tables?$format=application/json%3Bodata%3Dminimalmetadata", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "b1fd53e4-f5db-4f26-ada1-717078c65c32" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "Cache-Control" : "no-cache", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "ad30c318-f002-0018-58a6-4f8a9a000000", + "Body" : "{\"odata.metadata\":\"https://telboytrial.table.core.windows.net/$metadata#Tables\",\"value\":[]}", + "Date" : "Wed, 01 Jul 2020 12:52:40 GMT", + "x-ms-client-request-id" : "b1fd53e4-f5db-4f26-ada1-717078c65c32", + "Content-Type" : "application/json;odata=minimalmetadata;streaming=true;charset=utf-8" + }, + "Exception" : null + } ], + "variables" : [ "test881632ce78", "61e7d1cd-7f37-4a62-a9d4-e969489a4706", "b1fd53e4-f5db-4f26-ada1-717078c65c32" ] +} \ No newline at end of file diff --git a/sdk/tables/azure-data-tables/src/test/resources/session-records/deleteTable.json b/sdk/tables/azure-data-tables/src/test/resources/session-records/deleteTable.json new file mode 100644 index 0000000000000..d0a1c67478c8a --- /dev/null +++ b/sdk/tables/azure-data-tables/src/test/resources/session-records/deleteTable.json @@ -0,0 +1,71 @@ +{ + "networkCallRecords" : [ { + "Method" : "POST", + "Uri" : "https://REDACTED.table.core.windows.net/Tables", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "e8dd6513-984c-4aca-b603-f2f2104b2e58", + "Content-Type" : "application/json" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "StatusCode" : "201", + "Date" : "Wed, 01 Jul 2020 12:52:39 GMT", + "Cache-Control" : "no-cache", + "x-ms-request-id" : "a7b42970-9002-00a7-11a6-4fbd3f000000", + "Body" : "{\"odata.metadata\":\"https://telboytrial.table.core.windows.net/$metadata#Tables/@Element\",\"TableName\":\"test824812e297\"}", + "Preference-Applied" : "return-content", + "x-ms-client-request-id" : "e8dd6513-984c-4aca-b603-f2f2104b2e58", + "Content-Type" : "application/json;odata=minimalmetadata;streaming=true;charset=utf-8", + "Location" : "https://telboytrial.table.core.windows.net/Tables('test824812e297')" + }, + "Exception" : null + }, { + "Method" : "DELETE", + "Uri" : "https://REDACTED.table.core.windows.net/Tables('test824812e297')", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "2e02dc7f-2073-43e9-b115-d01fe9b5f2bd" + }, + "Response" : { + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "Cache-Control" : "no-cache", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "204", + "x-ms-request-id" : "ad30c28c-f002-0018-5aa6-4f8a9a000000", + "Date" : "Wed, 01 Jul 2020 12:52:39 GMT", + "x-ms-client-request-id" : "2e02dc7f-2073-43e9-b115-d01fe9b5f2bd" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.table.core.windows.net/Tables?$format=application/json%3Bodata%3Dminimalmetadata", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "821a9e14-e040-4a42-a02f-edf44001f228" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "Cache-Control" : "no-cache", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "a7b42972-9002-00a7-12a6-4fbd3f000000", + "Body" : "{\"odata.metadata\":\"https://telboytrial.table.core.windows.net/$metadata#Tables\",\"value\":[]}", + "Date" : "Wed, 01 Jul 2020 12:52:39 GMT", + "x-ms-client-request-id" : "821a9e14-e040-4a42-a02f-edf44001f228", + "Content-Type" : "application/json;odata=minimalmetadata;streaming=true;charset=utf-8" + }, + "Exception" : null + } ], + "variables" : [ "test824812e297", "e8dd6513-984c-4aca-b603-f2f2104b2e58", "2e02dc7f-2073-43e9-b115-d01fe9b5f2bd", "821a9e14-e040-4a42-a02f-edf44001f228" ] +} \ No newline at end of file diff --git a/sdk/tables/azure-data-tables/src/test/resources/session-records/insertNoEtag.json b/sdk/tables/azure-data-tables/src/test/resources/session-records/insertNoEtag.json new file mode 100644 index 0000000000000..48c931e6931b4 --- /dev/null +++ b/sdk/tables/azure-data-tables/src/test/resources/session-records/insertNoEtag.json @@ -0,0 +1,97 @@ +{ + "networkCallRecords" : [ { + "Method" : "POST", + "Uri" : "https://REDACTED.table.core.windows.net/Tables", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "b96e625c-77ad-4e5c-82cc-01cbaff22837", + "Content-Type" : "application/json" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "StatusCode" : "201", + "Date" : "Wed, 01 Jul 2020 12:52:41 GMT", + "Cache-Control" : "no-cache", + "x-ms-request-id" : "093a81a8-5002-005c-34a6-4f00a5000000", + "Body" : "{\"odata.metadata\":\"https://telboytrial.table.core.windows.net/$metadata#Tables/@Element\",\"TableName\":\"test709465a8ae\"}", + "Preference-Applied" : "return-content", + "x-ms-client-request-id" : "b96e625c-77ad-4e5c-82cc-01cbaff22837", + "Content-Type" : "application/json;odata=minimalmetadata;streaming=true;charset=utf-8", + "Location" : "https://telboytrial.table.core.windows.net/Tables('test709465a8ae')" + }, + "Exception" : null + }, { + "Method" : "POST", + "Uri" : "https://REDACTED.table.core.windows.net/test709465a8ae?timeout=5000", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "ff21f7df-3ce1-4000-a360-16a92b215bd6", + "Content-Type" : "application/json" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "StatusCode" : "201", + "Date" : "Wed, 01 Jul 2020 12:52:40 GMT", + "Cache-Control" : "no-cache", + "ETag" : "W/\"datetime'2020-07-01T12%3A52%3A41.1924458Z'\"", + "x-ms-request-id" : "a7b42990-9002-00a7-2ba6-4fbd3f000000", + "Body" : "{\"odata.metadata\":\"https://telboytrial.table.core.windows.net/$metadata#test709465a8ae/@Element\",\"odata.etag\":\"W/\\\"datetime'2020-07-01T12%3A52%3A41.1924458Z'\\\"\",\"PartitionKey\":\"partitionkey580821\",\"RowKey\":\"rowkey8284822cb\",\"Timestamp\":\"2020-07-01T12:52:41.1924458Z\"}", + "Preference-Applied" : "return-content", + "x-ms-client-request-id" : "ff21f7df-3ce1-4000-a360-16a92b215bd6", + "Content-Type" : "application/json;odata=minimalmetadata;streaming=true;charset=utf-8", + "Location" : "https://telboytrial.table.core.windows.net/test709465a8ae(PartitionKey='partitionkey580821',RowKey='rowkey8284822cb')" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.table.core.windows.net/Tables?$format=application/json%3Bodata%3Dminimalmetadata", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "df767a68-a3a3-40fc-b397-216f6056e6ee" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "Cache-Control" : "no-cache", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "ad30c2f8-f002-0018-3ba6-4f8a9a000000", + "Body" : "{\"odata.metadata\":\"https://telboytrial.table.core.windows.net/$metadata#Tables\",\"value\":[{\"TableName\":\"test709465a8ae\"}]}", + "Date" : "Wed, 01 Jul 2020 12:52:40 GMT", + "x-ms-client-request-id" : "df767a68-a3a3-40fc-b397-216f6056e6ee", + "Content-Type" : "application/json;odata=minimalmetadata;streaming=true;charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "DELETE", + "Uri" : "https://REDACTED.table.core.windows.net/Tables('test709465a8ae')", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "3fd87f61-cc43-4d33-9236-4cd79bbd6a44" + }, + "Response" : { + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "Cache-Control" : "no-cache", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "204", + "x-ms-request-id" : "093a81ac-5002-005c-37a6-4f00a5000000", + "Date" : "Wed, 01 Jul 2020 12:52:41 GMT", + "x-ms-client-request-id" : "3fd87f61-cc43-4d33-9236-4cd79bbd6a44" + }, + "Exception" : null + } ], + "variables" : [ "test709465a8ae", "b96e625c-77ad-4e5c-82cc-01cbaff22837", "partitionkey580821", "rowkey8284822cb", "ff21f7df-3ce1-4000-a360-16a92b215bd6", "df767a68-a3a3-40fc-b397-216f6056e6ee", "3fd87f61-cc43-4d33-9236-4cd79bbd6a44" ] +} \ No newline at end of file diff --git a/sdk/tables/azure-data-tables/src/test/resources/session-records/mergeEntity.json b/sdk/tables/azure-data-tables/src/test/resources/session-records/mergeEntity.json new file mode 100644 index 0000000000000..7d06bcf3c62ea --- /dev/null +++ b/sdk/tables/azure-data-tables/src/test/resources/session-records/mergeEntity.json @@ -0,0 +1,119 @@ +{ + "networkCallRecords" : [ { + "Method" : "POST", + "Uri" : "https://REDACTED.table.core.windows.net/Tables", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "71e298e5-c839-4528-9059-c7f806d29fa3", + "Content-Type" : "application/json" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "StatusCode" : "201", + "Date" : "Wed, 01 Jul 2020 12:52:40 GMT", + "Cache-Control" : "no-cache", + "x-ms-request-id" : "a7b42984-9002-00a7-21a6-4fbd3f000000", + "Body" : "{\"odata.metadata\":\"https://telboytrial.table.core.windows.net/$metadata#Tables/@Element\",\"TableName\":\"test745290e4fc\"}", + "Preference-Applied" : "return-content", + "x-ms-client-request-id" : "71e298e5-c839-4528-9059-c7f806d29fa3", + "Content-Type" : "application/json;odata=minimalmetadata;streaming=true;charset=utf-8", + "Location" : "https://telboytrial.table.core.windows.net/Tables('test745290e4fc')" + }, + "Exception" : null + }, { + "Method" : "POST", + "Uri" : "https://REDACTED.table.core.windows.net/test745290e4fc?timeout=5000", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "12a068f7-4fe0-4d2b-a5c7-af9280c2f7cf", + "Content-Type" : "application/json" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "StatusCode" : "201", + "Date" : "Wed, 01 Jul 2020 12:52:40 GMT", + "Cache-Control" : "no-cache", + "ETag" : "W/\"datetime'2020-07-01T12%3A52%3A40.8214991Z'\"", + "x-ms-request-id" : "ad30c2d7-f002-0018-1da6-4f8a9a000000", + "Body" : "{\"odata.metadata\":\"https://telboytrial.table.core.windows.net/$metadata#test745290e4fc/@Element\",\"odata.etag\":\"W/\\\"datetime'2020-07-01T12%3A52%3A40.8214991Z'\\\"\",\"PartitionKey\":\"partitionkey47248f\",\"RowKey\":\"rowkey009805dad\",\"Timestamp\":\"2020-07-01T12:52:40.8214991Z\"}", + "Preference-Applied" : "return-content", + "x-ms-client-request-id" : "12a068f7-4fe0-4d2b-a5c7-af9280c2f7cf", + "Content-Type" : "application/json;odata=minimalmetadata;streaming=true;charset=utf-8", + "Location" : "https://telboytrial.table.core.windows.net/test745290e4fc(PartitionKey='partitionkey47248f',RowKey='rowkey009805dad')" + }, + "Exception" : null + }, { + "Method" : "PATCH", + "Uri" : "https://REDACTED.table.core.windows.net/test745290e4fc(PartitionKey='partitionkey47248f',RowKey='rowkey009805dad')?timeout=5000", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "0049a02f-1e93-4b0a-a7e1-8f886878baa1", + "Content-Type" : "application/json" + }, + "Response" : { + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "Cache-Control" : "no-cache", + "ETag" : "W/\"datetime'2020-07-01T12%3A52%3A40.8629359Z'\"", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "204", + "x-ms-request-id" : "093a81a3-5002-005c-31a6-4f00a5000000", + "Date" : "Wed, 01 Jul 2020 12:52:40 GMT", + "x-ms-client-request-id" : "0049a02f-1e93-4b0a-a7e1-8f886878baa1" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.table.core.windows.net/Tables?$format=application/json%3Bodata%3Dminimalmetadata", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "8b78b847-eb4b-4476-82f3-b43dc21281ee" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "Cache-Control" : "no-cache", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "a7b42988-9002-00a7-24a6-4fbd3f000000", + "Body" : "{\"odata.metadata\":\"https://telboytrial.table.core.windows.net/$metadata#Tables\",\"value\":[{\"TableName\":\"test745290e4fc\"}]}", + "Date" : "Wed, 01 Jul 2020 12:52:40 GMT", + "x-ms-client-request-id" : "8b78b847-eb4b-4476-82f3-b43dc21281ee", + "Content-Type" : "application/json;odata=minimalmetadata;streaming=true;charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "DELETE", + "Uri" : "https://REDACTED.table.core.windows.net/Tables('test745290e4fc')", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "9f5787b2-5335-48d3-8cdf-cc5fd77d4d38" + }, + "Response" : { + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "Cache-Control" : "no-cache", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "204", + "x-ms-request-id" : "ad30c2dd-f002-0018-22a6-4f8a9a000000", + "Date" : "Wed, 01 Jul 2020 12:52:40 GMT", + "x-ms-client-request-id" : "9f5787b2-5335-48d3-8cdf-cc5fd77d4d38" + }, + "Exception" : null + } ], + "variables" : [ "test745290e4fc", "71e298e5-c839-4528-9059-c7f806d29fa3", "partitionkey47248f", "rowkey009805dad", "0049a02f-1e93-4b0a-a7e1-8f886878baa1", "12a068f7-4fe0-4d2b-a5c7-af9280c2f7cf", "dd2a873956ce4f0e", "8b78b847-eb4b-4476-82f3-b43dc21281ee", "9f5787b2-5335-48d3-8cdf-cc5fd77d4d38" ] +} \ No newline at end of file diff --git a/sdk/tables/azure-data-tables/src/test/resources/session-records/mergeNonExistentEntity.json b/sdk/tables/azure-data-tables/src/test/resources/session-records/mergeNonExistentEntity.json new file mode 100644 index 0000000000000..c77796323013d --- /dev/null +++ b/sdk/tables/azure-data-tables/src/test/resources/session-records/mergeNonExistentEntity.json @@ -0,0 +1,94 @@ +{ + "networkCallRecords" : [ { + "Method" : "POST", + "Uri" : "https://REDACTED.table.core.windows.net/Tables", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "301b8e99-69ca-4c62-a03e-6206aed65304", + "Content-Type" : "application/json" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "StatusCode" : "201", + "Date" : "Wed, 01 Jul 2020 12:52:38 GMT", + "Cache-Control" : "no-cache", + "x-ms-request-id" : "ad30c261-f002-0018-32a6-4f8a9a000000", + "Body" : "{\"odata.metadata\":\"https://telboytrial.table.core.windows.net/$metadata#Tables/@Element\",\"TableName\":\"test64434b87bf\"}", + "Preference-Applied" : "return-content", + "x-ms-client-request-id" : "301b8e99-69ca-4c62-a03e-6206aed65304", + "Content-Type" : "application/json;odata=minimalmetadata;streaming=true;charset=utf-8", + "Location" : "https://telboytrial.table.core.windows.net/Tables('test64434b87bf')" + }, + "Exception" : null + }, { + "Method" : "PATCH", + "Uri" : "https://REDACTED.table.core.windows.net/test64434b87bf(PartitionKey='partitionkey223364',RowKey='rowkey2745830d2')?timeout=5000", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "e5e62ece-8996-4f2d-abd4-437c45a80aad", + "Content-Type" : "application/json" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "Cache-Control" : "no-cache", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "StatusCode" : "404", + "x-ms-request-id" : "a7b42955-9002-00a7-7aa6-4fbd3f000000", + "Body" : "{\"odata.error\":{\"code\":\"ResourceNotFound\",\"message\":{\"lang\":\"en-US\",\"value\":\"The specified resource does not exist.\\nRequestId:a7b42955-9002-00a7-7aa6-4fbd3f000000\\nTime:2020-07-01T12:52:39.8135080Z\"}}}", + "Date" : "Wed, 01 Jul 2020 12:52:39 GMT", + "x-ms-client-request-id" : "e5e62ece-8996-4f2d-abd4-437c45a80aad", + "Content-Type" : "application/json;odata=minimalmetadata;streaming=true;charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.table.core.windows.net/Tables?$format=application/json%3Bodata%3Dminimalmetadata", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "591ca6f1-7768-447a-8d32-800669d83f0b" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "Cache-Control" : "no-cache", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "ad30c26b-f002-0018-3ba6-4f8a9a000000", + "Body" : "{\"odata.metadata\":\"https://telboytrial.table.core.windows.net/$metadata#Tables\",\"value\":[{\"TableName\":\"test64434b87bf\"}]}", + "Date" : "Wed, 01 Jul 2020 12:52:39 GMT", + "x-ms-client-request-id" : "591ca6f1-7768-447a-8d32-800669d83f0b", + "Content-Type" : "application/json;odata=minimalmetadata;streaming=true;charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "DELETE", + "Uri" : "https://REDACTED.table.core.windows.net/Tables('test64434b87bf')", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "cdf4d28d-1808-4511-8016-3c0ab4f39d59" + }, + "Response" : { + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "Cache-Control" : "no-cache", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "204", + "x-ms-request-id" : "a7b4295c-9002-00a7-80a6-4fbd3f000000", + "Date" : "Wed, 01 Jul 2020 12:52:39 GMT", + "x-ms-client-request-id" : "cdf4d28d-1808-4511-8016-3c0ab4f39d59" + }, + "Exception" : null + } ], + "variables" : [ "test64434b87bf", "301b8e99-69ca-4c62-a03e-6206aed65304", "partitionkey223364", "rowkey2745830d2", "e5e62ece-8996-4f2d-abd4-437c45a80aad", "591ca6f1-7768-447a-8d32-800669d83f0b", "cdf4d28d-1808-4511-8016-3c0ab4f39d59" ] +} \ No newline at end of file diff --git a/sdk/tables/azure-data-tables/src/test/resources/session-records/queryEntitiesWithPartitionAndRowKey.json b/sdk/tables/azure-data-tables/src/test/resources/session-records/queryEntitiesWithPartitionAndRowKey.json new file mode 100644 index 0000000000000..899365e47b0b6 --- /dev/null +++ b/sdk/tables/azure-data-tables/src/test/resources/session-records/queryEntitiesWithPartitionAndRowKey.json @@ -0,0 +1,120 @@ +{ + "networkCallRecords" : [ { + "Method" : "POST", + "Uri" : "https://REDACTED.table.core.windows.net/Tables", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "32944c6a-6cc0-4205-ada4-e8cb6d089087", + "Content-Type" : "application/json" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "StatusCode" : "201", + "Date" : "Wed, 01 Jul 2020 12:52:40 GMT", + "Cache-Control" : "no-cache", + "x-ms-request-id" : "ad30c30a-f002-0018-4ba6-4f8a9a000000", + "Body" : "{\"odata.metadata\":\"https://telboytrial.table.core.windows.net/$metadata#Tables/@Element\",\"TableName\":\"test15500468dc\"}", + "Preference-Applied" : "return-content", + "x-ms-client-request-id" : "32944c6a-6cc0-4205-ada4-e8cb6d089087", + "Content-Type" : "application/json;odata=minimalmetadata;streaming=true;charset=utf-8", + "Location" : "https://telboytrial.table.core.windows.net/Tables('test15500468dc')" + }, + "Exception" : null + }, { + "Method" : "POST", + "Uri" : "https://REDACTED.table.core.windows.net/test15500468dc?timeout=5000", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "b1ff3069-6dd1-490b-b946-2cf3d7e6dd91", + "Content-Type" : "application/json" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "StatusCode" : "201", + "Date" : "Wed, 01 Jul 2020 12:52:41 GMT", + "Cache-Control" : "no-cache", + "ETag" : "W/\"datetime'2020-07-01T12%3A52%3A41.4917242Z'\"", + "x-ms-request-id" : "093a81b1-5002-005c-3ca6-4f00a5000000", + "Body" : "{\"odata.metadata\":\"https://telboytrial.table.core.windows.net/$metadata#test15500468dc/@Element\",\"odata.etag\":\"W/\\\"datetime'2020-07-01T12%3A52%3A41.4917242Z'\\\"\",\"PartitionKey\":\"partitionkey919688\",\"RowKey\":\"rowkey745419b2d\",\"Timestamp\":\"2020-07-01T12:52:41.4917242Z\"}", + "Preference-Applied" : "return-content", + "x-ms-client-request-id" : "b1ff3069-6dd1-490b-b946-2cf3d7e6dd91", + "Content-Type" : "application/json;odata=minimalmetadata;streaming=true;charset=utf-8", + "Location" : "https://telboytrial.table.core.windows.net/test15500468dc(PartitionKey='partitionkey919688',RowKey='rowkey745419b2d')" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.table.core.windows.net/test15500468dc(PartitionKey='partitionkey919688',RowKey='rowkey745419b2d')?timeout=5000&$format=application/json%3Bodata%3Dfullmetadata", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "97019a59-d27d-4d13-b68b-3317a67fe8e0" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "StatusCode" : "200", + "Date" : "Wed, 01 Jul 2020 12:52:40 GMT", + "Cache-Control" : "no-cache", + "ETag" : "W/\"datetime'2020-07-01T12%3A52%3A41.4917242Z'\"", + "x-ms-request-id" : "a7b4299a-9002-00a7-33a6-4fbd3f000000", + "Body" : "{\"odata.metadata\":\"https://telboytrial.table.core.windows.net/$metadata#test15500468dc/@Element\",\"odata.type\":\"telboytrial.test15500468dc\",\"odata.id\":\"https://telboytrial.table.core.windows.net/test15500468dc(PartitionKey='partitionkey919688',RowKey='rowkey745419b2d')\",\"odata.etag\":\"W/\\\"datetime'2020-07-01T12%3A52%3A41.4917242Z'\\\"\",\"odata.editLink\":\"test15500468dc(PartitionKey='partitionkey919688',RowKey='rowkey745419b2d')\",\"PartitionKey\":\"partitionkey919688\",\"RowKey\":\"rowkey745419b2d\",\"Timestamp@odata.type\":\"Edm.DateTime\",\"Timestamp\":\"2020-07-01T12:52:41.4917242Z\"}", + "x-ms-client-request-id" : "97019a59-d27d-4d13-b68b-3317a67fe8e0", + "Content-Type" : "application/json;odata=fullmetadata;streaming=true;charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.table.core.windows.net/Tables?$format=application/json%3Bodata%3Dminimalmetadata", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "0fc71aea-dec3-4afb-9180-f1007e031de5" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "Cache-Control" : "no-cache", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "ad30c312-f002-0018-52a6-4f8a9a000000", + "Body" : "{\"odata.metadata\":\"https://telboytrial.table.core.windows.net/$metadata#Tables\",\"value\":[{\"TableName\":\"test15500468dc\"}]}", + "Date" : "Wed, 01 Jul 2020 12:52:40 GMT", + "x-ms-client-request-id" : "0fc71aea-dec3-4afb-9180-f1007e031de5", + "Content-Type" : "application/json;odata=minimalmetadata;streaming=true;charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "DELETE", + "Uri" : "https://REDACTED.table.core.windows.net/Tables('test15500468dc')", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "91e1e3f0-735a-4a55-9d48-43b394164315" + }, + "Response" : { + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "Cache-Control" : "no-cache", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "204", + "x-ms-request-id" : "093a81b4-5002-005c-3da6-4f00a5000000", + "Date" : "Wed, 01 Jul 2020 12:52:41 GMT", + "x-ms-client-request-id" : "91e1e3f0-735a-4a55-9d48-43b394164315" + }, + "Exception" : null + } ], + "variables" : [ "test15500468dc", "32944c6a-6cc0-4205-ada4-e8cb6d089087", "partitionkey919688", "rowkey745419b2d", "b1ff3069-6dd1-490b-b946-2cf3d7e6dd91", "97019a59-d27d-4d13-b68b-3317a67fe8e0", "0fc71aea-dec3-4afb-9180-f1007e031de5", "91e1e3f0-735a-4a55-9d48-43b394164315" ] +} \ No newline at end of file diff --git a/sdk/tables/azure-data-tables/src/test/resources/session-records/queryEntity.json b/sdk/tables/azure-data-tables/src/test/resources/session-records/queryEntity.json new file mode 100644 index 0000000000000..fa3d704d7dc95 --- /dev/null +++ b/sdk/tables/azure-data-tables/src/test/resources/session-records/queryEntity.json @@ -0,0 +1,145 @@ +{ + "networkCallRecords" : [ { + "Method" : "POST", + "Uri" : "https://REDACTED.table.core.windows.net/Tables", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "feaa79a2-f371-43cd-82da-16db350de78e", + "Content-Type" : "application/json" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "StatusCode" : "201", + "Date" : "Wed, 01 Jul 2020 12:52:38 GMT", + "Cache-Control" : "no-cache", + "x-ms-request-id" : "a7b42905-9002-00a7-33a6-4fbd3f000000", + "Body" : "{\"odata.metadata\":\"https://telboytrial.table.core.windows.net/$metadata#Tables/@Element\",\"TableName\":\"test39546bcdb2\"}", + "Preference-Applied" : "return-content", + "x-ms-client-request-id" : "feaa79a2-f371-43cd-82da-16db350de78e", + "Content-Type" : "application/json;odata=minimalmetadata;streaming=true;charset=utf-8", + "Location" : "https://telboytrial.table.core.windows.net/Tables('test39546bcdb2')" + }, + "Exception" : null + }, { + "Method" : "POST", + "Uri" : "https://REDACTED.table.core.windows.net/test39546bcdb2?timeout=5000", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "425426f6-366e-4d3b-bcb1-76e3e4c049c5", + "Content-Type" : "application/json" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "StatusCode" : "201", + "Date" : "Wed, 01 Jul 2020 12:52:38 GMT", + "Cache-Control" : "no-cache", + "ETag" : "W/\"datetime'2020-07-01T12%3A52%3A38.9901948Z'\"", + "x-ms-request-id" : "ad30c21e-f002-0018-77a6-4f8a9a000000", + "Body" : "{\"odata.metadata\":\"https://telboytrial.table.core.windows.net/$metadata#test39546bcdb2/@Element\",\"odata.etag\":\"W/\\\"datetime'2020-07-01T12%3A52%3A38.9901948Z'\\\"\",\"PartitionKey\":\"partitionkeya18693a\",\"RowKey\":\"rowkeya648351502\",\"Timestamp\":\"2020-07-01T12:52:38.9901948Z\"}", + "Preference-Applied" : "return-content", + "x-ms-client-request-id" : "425426f6-366e-4d3b-bcb1-76e3e4c049c5", + "Content-Type" : "application/json;odata=minimalmetadata;streaming=true;charset=utf-8", + "Location" : "https://telboytrial.table.core.windows.net/test39546bcdb2(PartitionKey='partitionkeya18693a',RowKey='rowkeya648351502')" + }, + "Exception" : null + }, { + "Method" : "POST", + "Uri" : "https://REDACTED.table.core.windows.net/test39546bcdb2?timeout=5000", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "8ea2563b-487a-42b2-947c-74e7ea6844e3", + "Content-Type" : "application/json" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "StatusCode" : "201", + "Date" : "Wed, 01 Jul 2020 12:52:38 GMT", + "Cache-Control" : "no-cache", + "ETag" : "W/\"datetime'2020-07-01T12%3A52%3A39.0259727Z'\"", + "x-ms-request-id" : "a7b4290b-9002-00a7-38a6-4fbd3f000000", + "Body" : "{\"odata.metadata\":\"https://telboytrial.table.core.windows.net/$metadata#test39546bcdb2/@Element\",\"odata.etag\":\"W/\\\"datetime'2020-07-01T12%3A52%3A39.0259727Z'\\\"\",\"PartitionKey\":\"partitionkeyb950639\",\"RowKey\":\"rowkeyb2421336ba\",\"Timestamp\":\"2020-07-01T12:52:39.0259727Z\"}", + "Preference-Applied" : "return-content", + "x-ms-client-request-id" : "8ea2563b-487a-42b2-947c-74e7ea6844e3", + "Content-Type" : "application/json;odata=minimalmetadata;streaming=true;charset=utf-8", + "Location" : "https://telboytrial.table.core.windows.net/test39546bcdb2(PartitionKey='partitionkeyb950639',RowKey='rowkeyb2421336ba')" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.table.core.windows.net/test39546bcdb2()?timeout=5000&$format=application/json%3Bodata%3Dfullmetadata", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "d3c82523-db05-42a3-8132-bafca143a596" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "Cache-Control" : "no-cache", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "ad30c227-f002-0018-7da6-4f8a9a000000", + "Body" : "{\"odata.metadata\":\"https://telboytrial.table.core.windows.net/$metadata#test39546bcdb2\",\"value\":[{\"odata.type\":\"telboytrial.test39546bcdb2\",\"odata.id\":\"https://telboytrial.table.core.windows.net/test39546bcdb2(PartitionKey='partitionkeya18693a',RowKey='rowkeya648351502')\",\"odata.etag\":\"W/\\\"datetime'2020-07-01T12%3A52%3A38.9901948Z'\\\"\",\"odata.editLink\":\"test39546bcdb2(PartitionKey='partitionkeya18693a',RowKey='rowkeya648351502')\",\"PartitionKey\":\"partitionkeya18693a\",\"RowKey\":\"rowkeya648351502\",\"Timestamp@odata.type\":\"Edm.DateTime\",\"Timestamp\":\"2020-07-01T12:52:38.9901948Z\"},{\"odata.type\":\"telboytrial.test39546bcdb2\",\"odata.id\":\"https://telboytrial.table.core.windows.net/test39546bcdb2(PartitionKey='partitionkeyb950639',RowKey='rowkeyb2421336ba')\",\"odata.etag\":\"W/\\\"datetime'2020-07-01T12%3A52%3A39.0259727Z'\\\"\",\"odata.editLink\":\"test39546bcdb2(PartitionKey='partitionkeyb950639',RowKey='rowkeyb2421336ba')\",\"PartitionKey\":\"partitionkeyb950639\",\"RowKey\":\"rowkeyb2421336ba\",\"Timestamp@odata.type\":\"Edm.DateTime\",\"Timestamp\":\"2020-07-01T12:52:39.0259727Z\"}]}", + "Date" : "Wed, 01 Jul 2020 12:52:38 GMT", + "x-ms-client-request-id" : "d3c82523-db05-42a3-8132-bafca143a596", + "Content-Type" : "application/json;odata=fullmetadata;streaming=true;charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.table.core.windows.net/Tables?$format=application/json%3Bodata%3Dminimalmetadata", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "360ce089-b9d9-46de-a719-c6ab14840f76" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "Cache-Control" : "no-cache", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "a7b42919-9002-00a7-44a6-4fbd3f000000", + "Body" : "{\"odata.metadata\":\"https://telboytrial.table.core.windows.net/$metadata#Tables\",\"value\":[{\"TableName\":\"test39546bcdb2\"}]}", + "Date" : "Wed, 01 Jul 2020 12:52:38 GMT", + "x-ms-client-request-id" : "360ce089-b9d9-46de-a719-c6ab14840f76", + "Content-Type" : "application/json;odata=minimalmetadata;streaming=true;charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "DELETE", + "Uri" : "https://REDACTED.table.core.windows.net/Tables('test39546bcdb2')", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "5b5d25d6-101f-43b2-95fa-3a969e922205" + }, + "Response" : { + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "Cache-Control" : "no-cache", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "204", + "x-ms-request-id" : "ad30c231-f002-0018-05a6-4f8a9a000000", + "Date" : "Wed, 01 Jul 2020 12:52:38 GMT", + "x-ms-client-request-id" : "5b5d25d6-101f-43b2-95fa-3a969e922205" + }, + "Exception" : null + } ], + "variables" : [ "d3c82523-db05-42a3-8132-bafca143a596", "test39546bcdb2", "feaa79a2-f371-43cd-82da-16db350de78e", "partitionkeya18693a", "rowkeya648351502", "425426f6-366e-4d3b-bcb1-76e3e4c049c5", "partitionkeyb950639", "rowkeyb2421336ba", "8ea2563b-487a-42b2-947c-74e7ea6844e3", "360ce089-b9d9-46de-a719-c6ab14840f76", "5b5d25d6-101f-43b2-95fa-3a969e922205" ] +} \ No newline at end of file diff --git a/sdk/tables/azure-data-tables/src/test/resources/session-records/queryEntityWithFilter.json b/sdk/tables/azure-data-tables/src/test/resources/session-records/queryEntityWithFilter.json new file mode 100644 index 0000000000000..70f032f32508e --- /dev/null +++ b/sdk/tables/azure-data-tables/src/test/resources/session-records/queryEntityWithFilter.json @@ -0,0 +1,119 @@ +{ + "networkCallRecords" : [ { + "Method" : "POST", + "Uri" : "https://REDACTED.table.core.windows.net/Tables", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "fa5f279a-f9de-43a9-ab5e-f6e670bc5a81", + "Content-Type" : "application/json" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "StatusCode" : "201", + "Date" : "Wed, 01 Jul 2020 12:52:37 GMT", + "Cache-Control" : "no-cache", + "x-ms-request-id" : "a7b428e4-9002-00a7-18a6-4fbd3f000000", + "Body" : "{\"odata.metadata\":\"https://telboytrial.table.core.windows.net/$metadata#Tables/@Element\",\"TableName\":\"test16410dc76b\"}", + "Preference-Applied" : "return-content", + "x-ms-client-request-id" : "fa5f279a-f9de-43a9-ab5e-f6e670bc5a81", + "Content-Type" : "application/json;odata=minimalmetadata;streaming=true;charset=utf-8", + "Location" : "https://telboytrial.table.core.windows.net/Tables('test16410dc76b')" + }, + "Exception" : null + }, { + "Method" : "POST", + "Uri" : "https://REDACTED.table.core.windows.net/test16410dc76b?timeout=5000", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "99facfde-f2f2-439d-af41-eb234ad456a1", + "Content-Type" : "application/json" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "StatusCode" : "201", + "Date" : "Wed, 01 Jul 2020 12:52:37 GMT", + "Cache-Control" : "no-cache", + "ETag" : "W/\"datetime'2020-07-01T12%3A52%3A38.5556524Z'\"", + "x-ms-request-id" : "a7b428f4-9002-00a7-22a6-4fbd3f000000", + "Body" : "{\"odata.metadata\":\"https://telboytrial.table.core.windows.net/$metadata#test16410dc76b/@Element\",\"odata.etag\":\"W/\\\"datetime'2020-07-01T12%3A52%3A38.5556524Z'\\\"\",\"PartitionKey\":\"partitionkeya52522a\",\"RowKey\":\"rowkeya5870843ae\",\"Timestamp\":\"2020-07-01T12:52:38.5556524Z\"}", + "Preference-Applied" : "return-content", + "x-ms-client-request-id" : "99facfde-f2f2-439d-af41-eb234ad456a1", + "Content-Type" : "application/json;odata=minimalmetadata;streaming=true;charset=utf-8", + "Location" : "https://telboytrial.table.core.windows.net/test16410dc76b(PartitionKey='partitionkeya52522a',RowKey='rowkeya5870843ae')" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.table.core.windows.net/test16410dc76b()?timeout=5000&$format=application/json%3Bodata%3Dfullmetadata&$select=PartitionKeyeqpartitionkeya52522a", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "64b80104-3a4c-400d-ba72-c49075f2e2ca" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "Cache-Control" : "no-cache", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "a7b428f7-9002-00a7-25a6-4fbd3f000000", + "Body" : "{\"odata.metadata\":\"https://telboytrial.table.core.windows.net/$metadata#test16410dc76b&$select=PartitionKeyeqpartitionkeya52522a\",\"value\":[{\"odata.type\":\"telboytrial.test16410dc76b\",\"odata.id\":\"https://telboytrial.table.core.windows.net/test16410dc76b(PartitionKey='partitionkeya52522a',RowKey='rowkeya5870843ae')\",\"odata.etag\":\"W/\\\"datetime'2020-07-01T12%3A52%3A38.5556524Z'\\\"\",\"odata.editLink\":\"test16410dc76b(PartitionKey='partitionkeya52522a',RowKey='rowkeya5870843ae')\",\"PartitionKeyeqpartitionkeya52522a\":null}]}", + "Date" : "Wed, 01 Jul 2020 12:52:37 GMT", + "x-ms-client-request-id" : "64b80104-3a4c-400d-ba72-c49075f2e2ca", + "Content-Type" : "application/json;odata=fullmetadata;streaming=true;charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.table.core.windows.net/Tables?$format=application/json%3Bodata%3Dminimalmetadata", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "dac0dce8-b1ff-4ea8-a704-59f98ffc2812" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "Cache-Control" : "no-cache", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "a7b428fa-9002-00a7-28a6-4fbd3f000000", + "Body" : "{\"odata.metadata\":\"https://telboytrial.table.core.windows.net/$metadata#Tables\",\"value\":[{\"TableName\":\"test16410dc76b\"}]}", + "Date" : "Wed, 01 Jul 2020 12:52:37 GMT", + "x-ms-client-request-id" : "dac0dce8-b1ff-4ea8-a704-59f98ffc2812", + "Content-Type" : "application/json;odata=minimalmetadata;streaming=true;charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "DELETE", + "Uri" : "https://REDACTED.table.core.windows.net/Tables('test16410dc76b')", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "569436a7-afa3-448e-b73f-a9f02221d11d" + }, + "Response" : { + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "Cache-Control" : "no-cache", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "204", + "x-ms-request-id" : "ad30c214-f002-0018-6ea6-4f8a9a000000", + "Date" : "Wed, 01 Jul 2020 12:52:38 GMT", + "x-ms-client-request-id" : "569436a7-afa3-448e-b73f-a9f02221d11d" + }, + "Exception" : null + } ], + "variables" : [ "64b80104-3a4c-400d-ba72-c49075f2e2ca", "test16410dc76b", "fa5f279a-f9de-43a9-ab5e-f6e670bc5a81", "partitionkeya52522a", "rowkeya5870843ae", "99facfde-f2f2-439d-af41-eb234ad456a1", "dac0dce8-b1ff-4ea8-a704-59f98ffc2812", "569436a7-afa3-448e-b73f-a9f02221d11d" ] +} \ No newline at end of file diff --git a/sdk/tables/azure-data-tables/src/test/resources/session-records/queryEntityWithSelect.json b/sdk/tables/azure-data-tables/src/test/resources/session-records/queryEntityWithSelect.json new file mode 100644 index 0000000000000..bdfed955aca63 --- /dev/null +++ b/sdk/tables/azure-data-tables/src/test/resources/session-records/queryEntityWithSelect.json @@ -0,0 +1,145 @@ +{ + "networkCallRecords" : [ { + "Method" : "POST", + "Uri" : "https://REDACTED.table.core.windows.net/Tables", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "20f2e3e7-8c5b-404e-a83d-d5261fdc7fd1", + "Content-Type" : "application/json" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "StatusCode" : "201", + "Date" : "Wed, 01 Jul 2020 12:52:38 GMT", + "Cache-Control" : "no-cache", + "x-ms-request-id" : "a7b4291f-9002-00a7-4aa6-4fbd3f000000", + "Body" : "{\"odata.metadata\":\"https://telboytrial.table.core.windows.net/$metadata#Tables/@Element\",\"TableName\":\"test804717a76b\"}", + "Preference-Applied" : "return-content", + "x-ms-client-request-id" : "20f2e3e7-8c5b-404e-a83d-d5261fdc7fd1", + "Content-Type" : "application/json;odata=minimalmetadata;streaming=true;charset=utf-8", + "Location" : "https://telboytrial.table.core.windows.net/Tables('test804717a76b')" + }, + "Exception" : null + }, { + "Method" : "POST", + "Uri" : "https://REDACTED.table.core.windows.net/test804717a76b?timeout=5000", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "2e55ea16-a416-4391-93fc-785127f6a336", + "Content-Type" : "application/json" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "StatusCode" : "201", + "Date" : "Wed, 01 Jul 2020 12:52:38 GMT", + "Cache-Control" : "no-cache", + "ETag" : "W/\"datetime'2020-07-01T12%3A52%3A39.2383714Z'\"", + "x-ms-request-id" : "ad30c237-f002-0018-0ba6-4f8a9a000000", + "Body" : "{\"odata.metadata\":\"https://telboytrial.table.core.windows.net/$metadata#test804717a76b/@Element\",\"odata.etag\":\"W/\\\"datetime'2020-07-01T12%3A52%3A39.2383714Z'\\\"\",\"PartitionKey\":\"partitionkeya938347\",\"RowKey\":\"rowkeya839234295\",\"Timestamp\":\"2020-07-01T12:52:39.2383714Z\"}", + "Preference-Applied" : "return-content", + "x-ms-client-request-id" : "2e55ea16-a416-4391-93fc-785127f6a336", + "Content-Type" : "application/json;odata=minimalmetadata;streaming=true;charset=utf-8", + "Location" : "https://telboytrial.table.core.windows.net/test804717a76b(PartitionKey='partitionkeya938347',RowKey='rowkeya839234295')" + }, + "Exception" : null + }, { + "Method" : "POST", + "Uri" : "https://REDACTED.table.core.windows.net/test804717a76b?timeout=5000", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "65f5dce9-21be-4462-bd3f-6736343767a5", + "Content-Type" : "application/json" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "StatusCode" : "201", + "Date" : "Wed, 01 Jul 2020 12:52:38 GMT", + "Cache-Control" : "no-cache", + "ETag" : "W/\"datetime'2020-07-01T12%3A52%3A39.280146Z'\"", + "x-ms-request-id" : "a7b4292b-9002-00a7-55a6-4fbd3f000000", + "Body" : "{\"odata.metadata\":\"https://telboytrial.table.core.windows.net/$metadata#test804717a76b/@Element\",\"odata.etag\":\"W/\\\"datetime'2020-07-01T12%3A52%3A39.280146Z'\\\"\",\"PartitionKey\":\"partitionkeyb202403\",\"RowKey\":\"rowkeyb00625d7c9\",\"Timestamp\":\"2020-07-01T12:52:39.280146Z\"}", + "Preference-Applied" : "return-content", + "x-ms-client-request-id" : "65f5dce9-21be-4462-bd3f-6736343767a5", + "Content-Type" : "application/json;odata=minimalmetadata;streaming=true;charset=utf-8", + "Location" : "https://telboytrial.table.core.windows.net/test804717a76b(PartitionKey='partitionkeyb202403',RowKey='rowkeyb00625d7c9')" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.table.core.windows.net/test804717a76b()?timeout=5000&$format=application/json%3Bodata%3Dfullmetadata&$select=RowKey", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "4bc9fc6b-09cf-494e-b91c-c1959b93f02b" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "Cache-Control" : "no-cache", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "ad30c23f-f002-0018-12a6-4f8a9a000000", + "Body" : "{\"odata.metadata\":\"https://telboytrial.table.core.windows.net/$metadata#test804717a76b&$select=RowKey\",\"value\":[{\"odata.type\":\"telboytrial.test804717a76b\",\"odata.id\":\"https://telboytrial.table.core.windows.net/test804717a76b(PartitionKey='partitionkeya938347',RowKey='rowkeya839234295')\",\"odata.etag\":\"W/\\\"datetime'2020-07-01T12%3A52%3A39.2383714Z'\\\"\",\"odata.editLink\":\"test804717a76b(PartitionKey='partitionkeya938347',RowKey='rowkeya839234295')\",\"RowKey\":\"rowkeya839234295\"},{\"odata.type\":\"telboytrial.test804717a76b\",\"odata.id\":\"https://telboytrial.table.core.windows.net/test804717a76b(PartitionKey='partitionkeyb202403',RowKey='rowkeyb00625d7c9')\",\"odata.etag\":\"W/\\\"datetime'2020-07-01T12%3A52%3A39.280146Z'\\\"\",\"odata.editLink\":\"test804717a76b(PartitionKey='partitionkeyb202403',RowKey='rowkeyb00625d7c9')\",\"RowKey\":\"rowkeyb00625d7c9\"}]}", + "Date" : "Wed, 01 Jul 2020 12:52:38 GMT", + "x-ms-client-request-id" : "4bc9fc6b-09cf-494e-b91c-c1959b93f02b", + "Content-Type" : "application/json;odata=fullmetadata;streaming=true;charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.table.core.windows.net/Tables?$format=application/json%3Bodata%3Dminimalmetadata", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "e94f1b63-444b-422e-b5a0-2f153347edc1" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "Cache-Control" : "no-cache", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "a7b42931-9002-00a7-5ba6-4fbd3f000000", + "Body" : "{\"odata.metadata\":\"https://telboytrial.table.core.windows.net/$metadata#Tables\",\"value\":[{\"TableName\":\"test804717a76b\"}]}", + "Date" : "Wed, 01 Jul 2020 12:52:38 GMT", + "x-ms-client-request-id" : "e94f1b63-444b-422e-b5a0-2f153347edc1", + "Content-Type" : "application/json;odata=minimalmetadata;streaming=true;charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "DELETE", + "Uri" : "https://REDACTED.table.core.windows.net/Tables('test804717a76b')", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "a0f62d48-3844-4ae0-94ef-964d36d30034" + }, + "Response" : { + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "Cache-Control" : "no-cache", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "204", + "x-ms-request-id" : "ad30c243-f002-0018-16a6-4f8a9a000000", + "Date" : "Wed, 01 Jul 2020 12:52:38 GMT", + "x-ms-client-request-id" : "a0f62d48-3844-4ae0-94ef-964d36d30034" + }, + "Exception" : null + } ], + "variables" : [ "4bc9fc6b-09cf-494e-b91c-c1959b93f02b", "test804717a76b", "20f2e3e7-8c5b-404e-a83d-d5261fdc7fd1", "partitionkeya938347", "rowkeya839234295", "2e55ea16-a416-4391-93fc-785127f6a336", "partitionkeyb202403", "rowkeyb00625d7c9", "65f5dce9-21be-4462-bd3f-6736343767a5", "e94f1b63-444b-422e-b5a0-2f153347edc1", "a0f62d48-3844-4ae0-94ef-964d36d30034" ] +} \ No newline at end of file diff --git a/sdk/tables/azure-data-tables/src/test/resources/session-records/queryEntityWithTop.json b/sdk/tables/azure-data-tables/src/test/resources/session-records/queryEntityWithTop.json new file mode 100644 index 0000000000000..9ec2f5951763d --- /dev/null +++ b/sdk/tables/azure-data-tables/src/test/resources/session-records/queryEntityWithTop.json @@ -0,0 +1,93 @@ +{ + "networkCallRecords" : [ { + "Method" : "POST", + "Uri" : "https://REDACTED.table.core.windows.net/Tables", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "bdc0fab6-7a19-4191-93ea-1892ef601015", + "Content-Type" : "application/json" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "StatusCode" : "201", + "Date" : "Wed, 01 Jul 2020 12:52:38 GMT", + "Cache-Control" : "no-cache", + "x-ms-request-id" : "a7b42938-9002-00a7-61a6-4fbd3f000000", + "Body" : "{\"odata.metadata\":\"https://telboytrial.table.core.windows.net/$metadata#Tables/@Element\",\"TableName\":\"test14071c6635\"}", + "Preference-Applied" : "return-content", + "x-ms-client-request-id" : "bdc0fab6-7a19-4191-93ea-1892ef601015", + "Content-Type" : "application/json;odata=minimalmetadata;streaming=true;charset=utf-8", + "Location" : "https://telboytrial.table.core.windows.net/Tables('test14071c6635')" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.table.core.windows.net/test14071c6635()?timeout=5000&$format=application/json%3Bodata%3Dfullmetadata&$top=0", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "5721d6ef-c1e8-4729-8f7e-ca0520778ba2" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "Cache-Control" : "no-cache", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "ad30c249-f002-0018-1ca6-4f8a9a000000", + "Body" : "{\"odata.metadata\":\"https://telboytrial.table.core.windows.net/$metadata#test14071c6635\",\"value\":[]}", + "Date" : "Wed, 01 Jul 2020 12:52:38 GMT", + "x-ms-client-request-id" : "5721d6ef-c1e8-4729-8f7e-ca0520778ba2", + "Content-Type" : "application/json;odata=fullmetadata;streaming=true;charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.table.core.windows.net/Tables?$format=application/json%3Bodata%3Dminimalmetadata", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "0367e980-ed8d-448b-8096-4bd6abc6b58a" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "Cache-Control" : "no-cache", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "a7b4293d-9002-00a7-65a6-4fbd3f000000", + "Body" : "{\"odata.metadata\":\"https://telboytrial.table.core.windows.net/$metadata#Tables\",\"value\":[{\"TableName\":\"test14071c6635\"}]}", + "Date" : "Wed, 01 Jul 2020 12:52:38 GMT", + "x-ms-client-request-id" : "0367e980-ed8d-448b-8096-4bd6abc6b58a", + "Content-Type" : "application/json;odata=minimalmetadata;streaming=true;charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "DELETE", + "Uri" : "https://REDACTED.table.core.windows.net/Tables('test14071c6635')", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "2b3f0ad8-5cca-47c1-8d30-8f622b8c2a93" + }, + "Response" : { + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "Cache-Control" : "no-cache", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "204", + "x-ms-request-id" : "ad30c24e-f002-0018-20a6-4f8a9a000000", + "Date" : "Wed, 01 Jul 2020 12:52:38 GMT", + "x-ms-client-request-id" : "2b3f0ad8-5cca-47c1-8d30-8f622b8c2a93" + }, + "Exception" : null + } ], + "variables" : [ "5721d6ef-c1e8-4729-8f7e-ca0520778ba2", "test14071c6635", "bdc0fab6-7a19-4191-93ea-1892ef601015", "0367e980-ed8d-448b-8096-4bd6abc6b58a", "2b3f0ad8-5cca-47c1-8d30-8f622b8c2a93" ] +} \ No newline at end of file diff --git a/sdk/tables/azure-data-tables/src/test/resources/session-records/queryTable.json b/sdk/tables/azure-data-tables/src/test/resources/session-records/queryTable.json new file mode 100644 index 0000000000000..e7903c311e598 --- /dev/null +++ b/sdk/tables/azure-data-tables/src/test/resources/session-records/queryTable.json @@ -0,0 +1,138 @@ +{ + "networkCallRecords" : [ { + "Method" : "POST", + "Uri" : "https://REDACTED.table.core.windows.net/Tables", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "77786073-56cf-42b7-a61a-da070c403604", + "Content-Type" : "application/json" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "StatusCode" : "201", + "Date" : "Wed, 01 Jul 2020 12:52:40 GMT", + "Cache-Control" : "no-cache", + "x-ms-request-id" : "093a81a5-5002-005c-32a6-4f00a5000000", + "Body" : "{\"odata.metadata\":\"https://telboytrial.table.core.windows.net/$metadata#Tables/@Element\",\"TableName\":\"atesta467458233\"}", + "Preference-Applied" : "return-content", + "x-ms-client-request-id" : "77786073-56cf-42b7-a61a-da070c403604", + "Content-Type" : "application/json;odata=minimalmetadata;streaming=true;charset=utf-8", + "Location" : "https://telboytrial.table.core.windows.net/Tables('atesta467458233')" + }, + "Exception" : null + }, { + "Method" : "POST", + "Uri" : "https://REDACTED.table.core.windows.net/Tables", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "135a7f14-fe28-49f2-9252-a25d10dfebd7", + "Content-Type" : "application/json" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "StatusCode" : "201", + "Date" : "Wed, 01 Jul 2020 12:52:40 GMT", + "Cache-Control" : "no-cache", + "x-ms-request-id" : "a7b4298b-9002-00a7-27a6-4fbd3f000000", + "Body" : "{\"odata.metadata\":\"https://telboytrial.table.core.windows.net/$metadata#Tables/@Element\",\"TableName\":\"btestb450627457\"}", + "Preference-Applied" : "return-content", + "x-ms-client-request-id" : "135a7f14-fe28-49f2-9252-a25d10dfebd7", + "Content-Type" : "application/json;odata=minimalmetadata;streaming=true;charset=utf-8", + "Location" : "https://telboytrial.table.core.windows.net/Tables('btestb450627457')" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.table.core.windows.net/Tables?$format=application/json%3Bodata%3Dminimalmetadata", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "6fc2e7ed-3c0d-401d-93b2-351725baeb74" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "Cache-Control" : "no-cache", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "ad30c2e4-f002-0018-29a6-4f8a9a000000", + "Body" : "{\"odata.metadata\":\"https://telboytrial.table.core.windows.net/$metadata#Tables\",\"value\":[{\"TableName\":\"atesta467458233\"},{\"TableName\":\"btestb450627457\"}]}", + "Date" : "Wed, 01 Jul 2020 12:52:40 GMT", + "x-ms-client-request-id" : "6fc2e7ed-3c0d-401d-93b2-351725baeb74", + "Content-Type" : "application/json;odata=minimalmetadata;streaming=true;charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.table.core.windows.net/Tables?$format=application/json%3Bodata%3Dminimalmetadata", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "aafd20ad-99b4-4698-a298-77ffb0610937" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "Cache-Control" : "no-cache", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "093a81a7-5002-005c-33a6-4f00a5000000", + "Body" : "{\"odata.metadata\":\"https://telboytrial.table.core.windows.net/$metadata#Tables\",\"value\":[{\"TableName\":\"atesta467458233\"},{\"TableName\":\"btestb450627457\"}]}", + "Date" : "Wed, 01 Jul 2020 12:52:41 GMT", + "x-ms-client-request-id" : "aafd20ad-99b4-4698-a298-77ffb0610937", + "Content-Type" : "application/json;odata=minimalmetadata;streaming=true;charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "DELETE", + "Uri" : "https://REDACTED.table.core.windows.net/Tables('atesta467458233')", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "1adcd7f8-ae5d-4d85-8b75-cf7dc7e5a605" + }, + "Response" : { + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "Cache-Control" : "no-cache", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "204", + "x-ms-request-id" : "a7b4298e-9002-00a7-29a6-4fbd3f000000", + "Date" : "Wed, 01 Jul 2020 12:52:40 GMT", + "x-ms-client-request-id" : "1adcd7f8-ae5d-4d85-8b75-cf7dc7e5a605" + }, + "Exception" : null + }, { + "Method" : "DELETE", + "Uri" : "https://REDACTED.table.core.windows.net/Tables('btestb450627457')", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "848749a5-30f4-4de5-8d1b-c60f00ed547b" + }, + "Response" : { + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "Cache-Control" : "no-cache", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "204", + "x-ms-request-id" : "ad30c2ed-f002-0018-30a6-4f8a9a000000", + "Date" : "Wed, 01 Jul 2020 12:52:40 GMT", + "x-ms-client-request-id" : "848749a5-30f4-4de5-8d1b-c60f00ed547b" + }, + "Exception" : null + } ], + "variables" : [ "atesta467458233", "btestb450627457", "77786073-56cf-42b7-a61a-da070c403604", "135a7f14-fe28-49f2-9252-a25d10dfebd7", "6fc2e7ed-3c0d-401d-93b2-351725baeb74", "aafd20ad-99b4-4698-a298-77ffb0610937", "1adcd7f8-ae5d-4d85-8b75-cf7dc7e5a605", "848749a5-30f4-4de5-8d1b-c60f00ed547b" ] +} \ No newline at end of file diff --git a/sdk/tables/azure-data-tables/src/test/resources/session-records/queryTablewithTop.json b/sdk/tables/azure-data-tables/src/test/resources/session-records/queryTablewithTop.json new file mode 100644 index 0000000000000..5fe4ef6043009 --- /dev/null +++ b/sdk/tables/azure-data-tables/src/test/resources/session-records/queryTablewithTop.json @@ -0,0 +1,139 @@ +{ + "networkCallRecords" : [ { + "Method" : "POST", + "Uri" : "https://REDACTED.table.core.windows.net/Tables", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "848bd698-011a-46ed-a001-7aafa978d96a", + "Content-Type" : "application/json" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "StatusCode" : "201", + "Date" : "Wed, 01 Jul 2020 12:52:39 GMT", + "Cache-Control" : "no-cache", + "x-ms-request-id" : "ad30c2b2-f002-0018-7ba6-4f8a9a000000", + "Body" : "{\"odata.metadata\":\"https://telboytrial.table.core.windows.net/$metadata#Tables/@Element\",\"TableName\":\"atesta47573650a\"}", + "Preference-Applied" : "return-content", + "x-ms-client-request-id" : "848bd698-011a-46ed-a001-7aafa978d96a", + "Content-Type" : "application/json;odata=minimalmetadata;streaming=true;charset=utf-8", + "Location" : "https://telboytrial.table.core.windows.net/Tables('atesta47573650a')" + }, + "Exception" : null + }, { + "Method" : "POST", + "Uri" : "https://REDACTED.table.core.windows.net/Tables", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "cceecbc5-ea58-4939-bba3-f7b0f9e157c6", + "Content-Type" : "application/json" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "StatusCode" : "201", + "Date" : "Wed, 01 Jul 2020 12:52:39 GMT", + "Cache-Control" : "no-cache", + "x-ms-request-id" : "a7b42979-9002-00a7-18a6-4fbd3f000000", + "Body" : "{\"odata.metadata\":\"https://telboytrial.table.core.windows.net/$metadata#Tables/@Element\",\"TableName\":\"btestb491748d98\"}", + "Preference-Applied" : "return-content", + "x-ms-client-request-id" : "cceecbc5-ea58-4939-bba3-f7b0f9e157c6", + "Content-Type" : "application/json;odata=minimalmetadata;streaming=true;charset=utf-8", + "Location" : "https://telboytrial.table.core.windows.net/Tables('btestb491748d98')" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.table.core.windows.net/Tables?$format=application/json%3Bodata%3Dminimalmetadata&$top=1", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "7c98cfbf-7d63-4aa3-b1c1-382abdfdf3ac" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "StatusCode" : "200", + "Date" : "Wed, 01 Jul 2020 12:52:39 GMT", + "x-ms-continuation-NextTableName" : "1!44!YnRlc3RiNDkxNzQ4ZDk4ATAxZDY0ZmE2ODEyYzZhYTI-", + "Cache-Control" : "no-cache", + "x-ms-request-id" : "ad30c2b9-f002-0018-01a6-4f8a9a000000", + "Body" : "{\"odata.metadata\":\"https://telboytrial.table.core.windows.net/$metadata#Tables\",\"value\":[{\"TableName\":\"atesta47573650a\"}]}", + "x-ms-client-request-id" : "7c98cfbf-7d63-4aa3-b1c1-382abdfdf3ac", + "Content-Type" : "application/json;odata=minimalmetadata;streaming=true;charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.table.core.windows.net/Tables?$format=application/json%3Bodata%3Dminimalmetadata", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "a5f700a0-9946-40e3-b0e5-9a387627abc0" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "Cache-Control" : "no-cache", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "a7b4297b-9002-00a7-19a6-4fbd3f000000", + "Body" : "{\"odata.metadata\":\"https://telboytrial.table.core.windows.net/$metadata#Tables\",\"value\":[{\"TableName\":\"atesta47573650a\"},{\"TableName\":\"btestb491748d98\"}]}", + "Date" : "Wed, 01 Jul 2020 12:52:39 GMT", + "x-ms-client-request-id" : "a5f700a0-9946-40e3-b0e5-9a387627abc0", + "Content-Type" : "application/json;odata=minimalmetadata;streaming=true;charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "DELETE", + "Uri" : "https://REDACTED.table.core.windows.net/Tables('atesta47573650a')", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "31f06f8f-7930-451c-8d51-8fd144aa32b5" + }, + "Response" : { + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "Cache-Control" : "no-cache", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "204", + "x-ms-request-id" : "ad30c2c2-f002-0018-09a6-4f8a9a000000", + "Date" : "Wed, 01 Jul 2020 12:52:39 GMT", + "x-ms-client-request-id" : "31f06f8f-7930-451c-8d51-8fd144aa32b5" + }, + "Exception" : null + }, { + "Method" : "DELETE", + "Uri" : "https://REDACTED.table.core.windows.net/Tables('btestb491748d98')", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "c8ee9b8f-5104-4ea6-8d1a-1880c2ae7b7f" + }, + "Response" : { + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "Cache-Control" : "no-cache", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "204", + "x-ms-request-id" : "093a819b-5002-005c-2aa6-4f00a5000000", + "Date" : "Wed, 01 Jul 2020 12:52:40 GMT", + "x-ms-client-request-id" : "c8ee9b8f-5104-4ea6-8d1a-1880c2ae7b7f" + }, + "Exception" : null + } ], + "variables" : [ "atesta47573650a", "btestb491748d98", "848bd698-011a-46ed-a001-7aafa978d96a", "cceecbc5-ea58-4939-bba3-f7b0f9e157c6", "7c98cfbf-7d63-4aa3-b1c1-382abdfdf3ac", "a5f700a0-9946-40e3-b0e5-9a387627abc0", "31f06f8f-7930-451c-8d51-8fd144aa32b5", "c8ee9b8f-5104-4ea6-8d1a-1880c2ae7b7f" ] +} \ No newline at end of file diff --git a/sdk/tables/azure-data-tables/src/test/resources/session-records/updateEntity.json b/sdk/tables/azure-data-tables/src/test/resources/session-records/updateEntity.json new file mode 100644 index 0000000000000..265d9f2ff8b6f --- /dev/null +++ b/sdk/tables/azure-data-tables/src/test/resources/session-records/updateEntity.json @@ -0,0 +1,119 @@ +{ + "networkCallRecords" : [ { + "Method" : "POST", + "Uri" : "https://REDACTED.table.core.windows.net/Tables", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "b0a7672c-2802-45ec-a0e5-c7f601fcc6d5", + "Content-Type" : "application/json" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "StatusCode" : "201", + "Date" : "Wed, 01 Jul 2020 12:52:38 GMT", + "Cache-Control" : "no-cache", + "x-ms-request-id" : "a7b42940-9002-00a7-68a6-4fbd3f000000", + "Body" : "{\"odata.metadata\":\"https://telboytrial.table.core.windows.net/$metadata#Tables/@Element\",\"TableName\":\"test28489451d8\"}", + "Preference-Applied" : "return-content", + "x-ms-client-request-id" : "b0a7672c-2802-45ec-a0e5-c7f601fcc6d5", + "Content-Type" : "application/json;odata=minimalmetadata;streaming=true;charset=utf-8", + "Location" : "https://telboytrial.table.core.windows.net/Tables('test28489451d8')" + }, + "Exception" : null + }, { + "Method" : "POST", + "Uri" : "https://REDACTED.table.core.windows.net/test28489451d8?timeout=5000", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "5b0f2001-9eee-49ec-9d42-f5581e2cb141", + "Content-Type" : "application/json" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "StatusCode" : "201", + "Date" : "Wed, 01 Jul 2020 12:52:38 GMT", + "Cache-Control" : "no-cache", + "ETag" : "W/\"datetime'2020-07-01T12%3A52%3A39.6146392Z'\"", + "x-ms-request-id" : "ad30c257-f002-0018-29a6-4f8a9a000000", + "Body" : "{\"odata.metadata\":\"https://telboytrial.table.core.windows.net/$metadata#test28489451d8/@Element\",\"odata.etag\":\"W/\\\"datetime'2020-07-01T12%3A52%3A39.6146392Z'\\\"\",\"PartitionKey\":\"partitionkey202594\",\"RowKey\":\"rowkey88272bdb9\",\"Timestamp\":\"2020-07-01T12:52:39.6146392Z\"}", + "Preference-Applied" : "return-content", + "x-ms-client-request-id" : "5b0f2001-9eee-49ec-9d42-f5581e2cb141", + "Content-Type" : "application/json;odata=minimalmetadata;streaming=true;charset=utf-8", + "Location" : "https://telboytrial.table.core.windows.net/test28489451d8(PartitionKey='partitionkey202594',RowKey='rowkey88272bdb9')" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "https://REDACTED.table.core.windows.net/test28489451d8(PartitionKey='partitionkey202594',RowKey='rowkey88272bdb9')?timeout=5000", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "dea79b44-d15d-45d5-9f3e-8b836c225509", + "Content-Type" : "application/json" + }, + "Response" : { + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "Cache-Control" : "no-cache", + "ETag" : "W/\"datetime'2020-07-01T12%3A52%3A39.6510734Z'\"", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "204", + "x-ms-request-id" : "a7b42947-9002-00a7-6ea6-4fbd3f000000", + "Date" : "Wed, 01 Jul 2020 12:52:38 GMT", + "x-ms-client-request-id" : "dea79b44-d15d-45d5-9f3e-8b836c225509" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.table.core.windows.net/Tables?$format=application/json%3Bodata%3Dminimalmetadata", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "5d8f9dc0-c148-48bd-87f0-0ef93bb0f305" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "Cache-Control" : "no-cache", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "ad30c25c-f002-0018-2da6-4f8a9a000000", + "Body" : "{\"odata.metadata\":\"https://telboytrial.table.core.windows.net/$metadata#Tables\",\"value\":[{\"TableName\":\"test28489451d8\"}]}", + "Date" : "Wed, 01 Jul 2020 12:52:38 GMT", + "x-ms-client-request-id" : "5d8f9dc0-c148-48bd-87f0-0ef93bb0f305", + "Content-Type" : "application/json;odata=minimalmetadata;streaming=true;charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "DELETE", + "Uri" : "https://REDACTED.table.core.windows.net/Tables('test28489451d8')", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "208bfe9b-e6ab-4d29-a15c-35e8ab9bdebe" + }, + "Response" : { + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "Cache-Control" : "no-cache", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "204", + "x-ms-request-id" : "a7b42950-9002-00a7-76a6-4fbd3f000000", + "Date" : "Wed, 01 Jul 2020 12:52:38 GMT", + "x-ms-client-request-id" : "208bfe9b-e6ab-4d29-a15c-35e8ab9bdebe" + }, + "Exception" : null + } ], + "variables" : [ "test28489451d8", "b0a7672c-2802-45ec-a0e5-c7f601fcc6d5", "partitionkey202594", "rowkey88272bdb9", "dea79b44-d15d-45d5-9f3e-8b836c225509", "5b0f2001-9eee-49ec-9d42-f5581e2cb141", "b5682ac15fa447b7", "5d8f9dc0-c148-48bd-87f0-0ef93bb0f305", "208bfe9b-e6ab-4d29-a15c-35e8ab9bdebe" ] +} \ No newline at end of file diff --git a/sdk/tables/azure-data-tables/src/test/resources/session-records/updateNonExistentEntity.json b/sdk/tables/azure-data-tables/src/test/resources/session-records/updateNonExistentEntity.json new file mode 100644 index 0000000000000..1921482bf009a --- /dev/null +++ b/sdk/tables/azure-data-tables/src/test/resources/session-records/updateNonExistentEntity.json @@ -0,0 +1,94 @@ +{ + "networkCallRecords" : [ { + "Method" : "POST", + "Uri" : "https://REDACTED.table.core.windows.net/Tables", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "f85c5603-c4c2-4628-b2ab-9854db6de12c", + "Content-Type" : "application/json" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "StatusCode" : "201", + "Date" : "Wed, 01 Jul 2020 12:52:40 GMT", + "Cache-Control" : "no-cache", + "x-ms-request-id" : "a7b42993-9002-00a7-2da6-4fbd3f000000", + "Body" : "{\"odata.metadata\":\"https://telboytrial.table.core.windows.net/$metadata#Tables/@Element\",\"TableName\":\"test7868718213\"}", + "Preference-Applied" : "return-content", + "x-ms-client-request-id" : "f85c5603-c4c2-4628-b2ab-9854db6de12c", + "Content-Type" : "application/json;odata=minimalmetadata;streaming=true;charset=utf-8", + "Location" : "https://telboytrial.table.core.windows.net/Tables('test7868718213')" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "https://REDACTED.table.core.windows.net/test7868718213(PartitionKey='partitionkey887715',RowKey='rowkey611341888')?timeout=5000", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "624dcfdf-ac2b-4f98-baf6-1010bde0a052", + "Content-Type" : "application/json" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "Cache-Control" : "no-cache", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "StatusCode" : "404", + "x-ms-request-id" : "ad30c302-f002-0018-45a6-4f8a9a000000", + "Body" : "{\"odata.error\":{\"code\":\"ResourceNotFound\",\"message\":{\"lang\":\"en-US\",\"value\":\"The specified resource does not exist.\\nRequestId:ad30c302-f002-0018-45a6-4f8a9a000000\\nTime:2020-07-01T12:52:41.3508756Z\"}}}", + "Date" : "Wed, 01 Jul 2020 12:52:40 GMT", + "x-ms-client-request-id" : "624dcfdf-ac2b-4f98-baf6-1010bde0a052", + "Content-Type" : "application/json;odata=minimalmetadata;streaming=true;charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.table.core.windows.net/Tables?$format=application/json%3Bodata%3Dminimalmetadata", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "7ae89496-f8dc-431e-9124-65d13583c8c9" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "Cache-Control" : "no-cache", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "093a81af-5002-005c-3aa6-4f00a5000000", + "Body" : "{\"odata.metadata\":\"https://telboytrial.table.core.windows.net/$metadata#Tables\",\"value\":[{\"TableName\":\"test7868718213\"}]}", + "Date" : "Wed, 01 Jul 2020 12:52:41 GMT", + "x-ms-client-request-id" : "7ae89496-f8dc-431e-9124-65d13583c8c9", + "Content-Type" : "application/json;odata=minimalmetadata;streaming=true;charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "DELETE", + "Uri" : "https://REDACTED.table.core.windows.net/Tables('test7868718213')", + "Headers" : { + "x-ms-version" : "2019-02-02", + "x-ms-client-request-id" : "191e2e41-a9ef-46c1-af53-97ca8a73bb63" + }, + "Response" : { + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0", + "Cache-Control" : "no-cache", + "X-Content-Type-Options" : "nosniff", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "204", + "x-ms-request-id" : "a7b42996-9002-00a7-2fa6-4fbd3f000000", + "Date" : "Wed, 01 Jul 2020 12:52:40 GMT", + "x-ms-client-request-id" : "191e2e41-a9ef-46c1-af53-97ca8a73bb63" + }, + "Exception" : null + } ], + "variables" : [ "test7868718213", "f85c5603-c4c2-4628-b2ab-9854db6de12c", "partitionkey887715", "rowkey611341888", "624dcfdf-ac2b-4f98-baf6-1010bde0a052", "7ae89496-f8dc-431e-9124-65d13583c8c9", "191e2e41-a9ef-46c1-af53-97ca8a73bb63" ] +} \ No newline at end of file From 927fa4393743ffb16ab4480ee0ff6e9efaa86d1f Mon Sep 17 00:00:00 2001 From: Alan Zimmer <48699787+alzimmermsft@users.noreply.github.com> Date: Tue, 7 Jul 2020 12:15:31 -0700 Subject: [PATCH 031/129] Update Search APIs Based on Review (#12791) * Remove vararg APIs from IndexDocumentsBatch * Update README codesnippets --- sdk/search/azure-search-documents/README.md | 4 +- .../search/documents/SearchAsyncClient.java | 10 +- .../indexes/models/IndexDocumentsBatch.java | 111 ++++-------------- .../IndexContentManagementExample.java | 5 +- .../azure/search/documents/ReadmeSamples.java | 4 +- .../documents/SearchJavaDocCodeSnippets.java | 16 +-- .../search/documents/IndexBatchTests.java | 58 ++++----- .../search/documents/IndexingSyncTests.java | 32 ++--- .../search/documents/LookupSyncTests.java | 6 +- 9 files changed, 94 insertions(+), 152 deletions(-) diff --git a/sdk/search/azure-search-documents/README.md b/sdk/search/azure-search-documents/README.md index 3105eed5d2468..947c0b0df4655 100644 --- a/sdk/search/azure-search-documents/README.md +++ b/sdk/search/azure-search-documents/README.md @@ -412,8 +412,8 @@ to be aware of. ```Java IndexDocumentsBatch batch = new IndexDocumentsBatch(); -batch.addUploadActions(new Hotel().setId("783").setName("Upload Inn")); -batch.addMergeActions(new Hotel().setId("12").setName("Renovated Ranch")); +batch.addUploadActions(Collections.singletonList(new Hotel().setId("783").setName("Upload Inn"))); +batch.addMergeActions(Collections.singletonList(new Hotel().setId("12").setName("Renovated Ranch"))); searchClient.indexDocuments(batch); ``` diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/SearchAsyncClient.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/SearchAsyncClient.java index eff449625e7ff..66950b98e0b95 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/SearchAsyncClient.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/SearchAsyncClient.java @@ -704,9 +704,8 @@ private static Map> getFacets(SearchDocumentsResult re Map> facets = new HashMap<>(); - result.getFacets().forEach((key, values) -> { - facets.put(key, values.stream().map(FacetResultConverter::map).collect(Collectors.toList())); - }); + result.getFacets().forEach((key, values) -> + facets.put(key, values.stream().map(FacetResultConverter::map).collect(Collectors.toList()))); return facets; } @@ -951,10 +950,11 @@ private static AutocompleteRequest createAutoCompleteRequest(String searchText, } private static IndexDocumentsBatch buildIndexBatch(Iterable documents, IndexActionType actionType) { - List> actions = new ArrayList>(); + List> actions = new ArrayList<>(); documents.forEach(d -> actions.add(new IndexAction() .setActionType(actionType) .setDocument(d))); - return new IndexDocumentsBatch(actions); + + return new IndexDocumentsBatch().addActions(actions); } } diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/IndexDocumentsBatch.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/IndexDocumentsBatch.java index 038738b4d1d23..857e1237157e8 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/IndexDocumentsBatch.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/IndexDocumentsBatch.java @@ -10,8 +10,6 @@ import com.azure.search.documents.models.IndexBatchBase; import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; /** * Contains a batch of document write actions to send to the index. @@ -22,35 +20,25 @@ public class IndexDocumentsBatch extends IndexBatchBase { * Constructor of {@link IndexDocumentsBatch}. */ public IndexDocumentsBatch() { - super(new ArrayList>()); + super(new ArrayList<>()); } /** - * Constructor of {@link IndexDocumentsBatch} + * Adds document index actions to the batch. * - * @param actions the actions value to set. + * @param actions Index actions. + * @return The updated IndexDocumentsBatch object. */ - public IndexDocumentsBatch(List> actions) { - super(actions); - } - - /** - * Adds an Upload IndexAction to the IndexAction chain for a document. - * - * @param documents The documents to be uploaded. - * @return IndexBatch with the desired actions added. - */ - @SuppressWarnings("unchecked") - public IndexDocumentsBatch addUploadActions(T... documents) { - addDocumentActions(Arrays.asList(documents), IndexActionType.UPLOAD); + public IndexDocumentsBatch addActions(Iterable> actions) { + actions.forEach(action -> this.getActions().add(action)); return this; } /** - * Adds Upload IndexActions to the IndexAction chain for a collection of documents. + * Adds upload document actions to the batch. * - * @param documents The document collection to be uploaded. - * @return IndexBatch with the desired actions added. + * @param documents Documents to be uploaded. + * @return The updated IndexDocumentsBatch object. */ public IndexDocumentsBatch addUploadActions(Iterable documents) { addDocumentActions(documents, IndexActionType.UPLOAD); @@ -58,22 +46,10 @@ public IndexDocumentsBatch addUploadActions(Iterable documents) { } /** - * Adds a Delete IndexAction to the IndexAction chain for a document. - * - * @param documents The documents to be deleted. - * @return IndexBatch with the desired actions added. - */ - @SuppressWarnings("unchecked") - public IndexDocumentsBatch addDeleteActions(T... documents) { - addDocumentActions(Arrays.asList(documents), IndexActionType.DELETE); - return this; - } - - /** - * Adds Delete IndexActions to the IndexAction chain for a collection of documents. + * Adds document delete actions to the batch. * - * @param documents The document collection to be deleted. - * @return IndexBatch with the desired actions added. + * @param documents Document to be deleted. + * @return The updated IndexDocumentsBatch object. */ public IndexDocumentsBatch addDeleteActions(Iterable documents) { addDocumentActions(documents, IndexActionType.DELETE); @@ -81,11 +57,11 @@ public IndexDocumentsBatch addDeleteActions(Iterable documents) { } /** - * Adds Delete IndexActions to the IndexAction chain for a collection of documents. + * Adds document delete actions based on key IDs to the batch. * - * @param keyName The name of the key field that uniquely identifies documents in the index. - * @param keyValues The keys of the documents to delete. - * @return IndexBatch with the desired actions added. + * @param keyName The key field name. + * @param keyValues Keys of the documents to delete. + * @return The updated IndexDocumentsBatch object. */ @SuppressWarnings({"unchecked", "rawtypes"}) public IndexDocumentsBatch addDeleteActions(String keyName, Iterable keyValues) { @@ -101,33 +77,10 @@ public IndexDocumentsBatch addDeleteActions(String keyName, Iterable } /** - * Adds Delete IndexActions to the IndexAction chain for a collection of documents. - * - * @param keyName The name of the key field that uniquely identifies documents in the index. - * @param keyValues The keys of the documents to delete. - * @return IndexBatch with the desired actions added. - */ - public IndexDocumentsBatch addDeleteActions(String keyName, String... keyValues) { - return this.addDeleteActions(keyName, Arrays.asList(keyValues)); - } - - /** - * Adds a Merge IndexAction to the IndexAction chain for a document. - * - * @param documents The documents to be merged. - * @return IndexBatch with the desired actions added. - */ - @SuppressWarnings("unchecked") - public IndexDocumentsBatch addMergeActions(T... documents) { - addDocumentActions(Arrays.asList(documents), IndexActionType.MERGE); - return this; - } - - /** - * Adds Merge IndexActions to the IndexAction chain for a collection of documents. + * Adds merge document actions to the batch.. * - * @param documents The document collection to be merged. - * @return IndexBatch with the desired actions added. + * @param documents Documents to be merged. + * @return The updated IndexDocumentsBatch object. */ public IndexDocumentsBatch addMergeActions(Iterable documents) { addDocumentActions(documents, IndexActionType.MERGE); @@ -135,22 +88,10 @@ public IndexDocumentsBatch addMergeActions(Iterable documents) { } /** - * Adds a Merge or Upload IndexAction to the IndexAction chain for a document. - * - * @param documents The documents to be merged or uploaded. - * @return IndexBatch with the desired actions added. - */ - @SuppressWarnings("unchecked") - public IndexDocumentsBatch addMergeOrUploadActions(T... documents) { - addDocumentActions(Arrays.asList(documents), IndexActionType.MERGE_OR_UPLOAD); - return this; - } - - /** - * Adds Merge or Upload IndexActions to the IndexAction chain for a collection of documents. + * Adds merge or upload document actions to the batch. * - * @param documents The document collection to be merged or uploaded. - * @return IndexBatch with the desired actions added. + * @param documents Documents to be merged or uploaded. + * @return The updated IndexDocumentsBatch object. */ public IndexDocumentsBatch addMergeOrUploadActions(Iterable documents) { addDocumentActions(documents, IndexActionType.MERGE_OR_UPLOAD); @@ -158,10 +99,8 @@ public IndexDocumentsBatch addMergeOrUploadActions(Iterable documents) { } private void addDocumentActions(Iterable documents, IndexActionType actionType) { - documents.forEach(d -> { - this.getActions().add(new IndexAction() - .setActionType(actionType) - .setDocument(d)); - }); + documents.forEach(d -> this.getActions().add(new IndexAction() + .setActionType(actionType) + .setDocument(d))); } } diff --git a/sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/IndexContentManagementExample.java b/sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/IndexContentManagementExample.java index f8d8a9983c716..fc537ac0fd8ee 100644 --- a/sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/IndexContentManagementExample.java +++ b/sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/IndexContentManagementExample.java @@ -10,6 +10,7 @@ import com.azure.search.documents.models.IndexDocumentsResult; import java.util.ArrayList; +import java.util.Collections; import java.util.List; /** @@ -66,8 +67,8 @@ private static void advancedIndexing() { .buildClient(); IndexDocumentsBatch batch = new IndexDocumentsBatch() - .addMergeOrUploadActions(new Hotel().setHotelId("100")) - .addDeleteActions(new Hotel().setHotelId("200")); + .addMergeOrUploadActions(Collections.singletonList(new Hotel().setHotelId("100"))) + .addDeleteActions(Collections.singletonList(new Hotel().setHotelId("200"))); // Send a single batch that performs many different actions IndexDocumentsResult result = client.indexDocuments(batch); diff --git a/sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/ReadmeSamples.java b/sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/ReadmeSamples.java index 3d684fd1ae873..7559c905983b5 100644 --- a/sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/ReadmeSamples.java +++ b/sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/ReadmeSamples.java @@ -215,8 +215,8 @@ public void retrieveDocuments() { public void batchDocumentsOperations() { IndexDocumentsBatch batch = new IndexDocumentsBatch(); - batch.addUploadActions(new Hotel().setId("783").setName("Upload Inn")); - batch.addMergeActions(new Hotel().setId("12").setName("Renovated Ranch")); + batch.addUploadActions(Collections.singletonList(new Hotel().setId("783").setName("Upload Inn"))); + batch.addMergeActions(Collections.singletonList(new Hotel().setId("12").setName("Renovated Ranch"))); searchClient.indexDocuments(batch); } diff --git a/sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/SearchJavaDocCodeSnippets.java b/sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/SearchJavaDocCodeSnippets.java index 62c6b34a4ab3c..39702f0996813 100644 --- a/sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/SearchJavaDocCodeSnippets.java +++ b/sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/SearchJavaDocCodeSnippets.java @@ -220,8 +220,8 @@ public void indexDocuments() { searchDocument2.put("hotelId", "2"); searchDocument2.put("hotelName", "test2"); IndexDocumentsBatch indexDocumentsBatch = new IndexDocumentsBatch<>(); - indexDocumentsBatch.addUploadActions(searchDocument1); - indexDocumentsBatch.addDeleteActions(searchDocument2); + indexDocumentsBatch.addUploadActions(Collections.singletonList(searchDocument1)); + indexDocumentsBatch.addDeleteActions(Collections.singletonList(searchDocument2)); IndexDocumentsResult result = searchClient.indexDocuments(indexDocumentsBatch); for (IndexingResult indexingResult : result.getResults()) { System.out.printf("Does document with key %s finish successfully? %b%n", indexingResult.getKey(), @@ -242,8 +242,8 @@ public void indexDocumentsWithResponse() { searchDocument2.put("hotelId", "2"); searchDocument2.put("hotelName", "test2"); IndexDocumentsBatch indexDocumentsBatch = new IndexDocumentsBatch<>(); - indexDocumentsBatch.addUploadActions(searchDocument1); - indexDocumentsBatch.addDeleteActions(searchDocument2); + indexDocumentsBatch.addUploadActions(Collections.singletonList(searchDocument1)); + indexDocumentsBatch.addDeleteActions(Collections.singletonList(searchDocument2)); Response resultResponse = searchClient.indexDocumentsWithResponse(indexDocumentsBatch, null, new Context(key1, value1)); System.out.println("The status code of the response is " + resultResponse.getStatusCode()); @@ -561,8 +561,8 @@ public void indexDocumentsAsync() { searchDocument2.put("hotelId", "2"); searchDocument2.put("hotelName", "test2"); IndexDocumentsBatch indexDocumentsBatch = new IndexDocumentsBatch<>(); - indexDocumentsBatch.addUploadActions(searchDocument1); - indexDocumentsBatch.addDeleteActions(searchDocument2); + indexDocumentsBatch.addUploadActions(Collections.singletonList(searchDocument1)); + indexDocumentsBatch.addDeleteActions(Collections.singletonList(searchDocument2)); searchAsyncClient.indexDocuments(indexDocumentsBatch) .subscribe(result -> { for (IndexingResult indexingResult : result.getResults()) { @@ -585,8 +585,8 @@ public void indexDocumentsWithResponseAsync() { searchDocument2.put("hotelId", "2"); searchDocument2.put("hotelName", "test2"); IndexDocumentsBatch indexDocumentsBatch = new IndexDocumentsBatch<>(); - indexDocumentsBatch.addUploadActions(searchDocument1); - indexDocumentsBatch.addDeleteActions(searchDocument2); + indexDocumentsBatch.addUploadActions(Collections.singletonList(searchDocument1)); + indexDocumentsBatch.addDeleteActions(Collections.singletonList(searchDocument2)); searchAsyncClient.indexDocumentsWithResponse(indexDocumentsBatch, null) .subscribe(resultResponse -> { System.out.println("The status code of the response is " + resultResponse.getStatusCode()); diff --git a/sdk/search/azure-search-documents/src/test/java/com/azure/search/documents/IndexBatchTests.java b/sdk/search/azure-search-documents/src/test/java/com/azure/search/documents/IndexBatchTests.java index 8e1560b4bbb77..7513e7b940107 100644 --- a/sdk/search/azure-search-documents/src/test/java/com/azure/search/documents/IndexBatchTests.java +++ b/sdk/search/azure-search-documents/src/test/java/com/azure/search/documents/IndexBatchTests.java @@ -2,9 +2,9 @@ // Licensed under the MIT License. package com.azure.search.documents; +import com.azure.search.documents.indexes.models.IndexDocumentsBatch; import com.azure.search.documents.models.IndexAction; import com.azure.search.documents.models.IndexActionType; -import com.azure.search.documents.indexes.models.IndexDocumentsBatch; import org.junit.jupiter.api.Test; import java.util.ArrayList; @@ -26,11 +26,11 @@ public void uploadDocument() { .setActionType(IndexActionType.UPLOAD) .setDocument(searchDocument); - IndexDocumentsBatch expected = new IndexDocumentsBatch( - Collections.singletonList(indexAction)); + IndexDocumentsBatch expected = new IndexDocumentsBatch() + .addActions(Collections.singletonList(indexAction)); IndexDocumentsBatch actual = new IndexDocumentsBatch() - .addUploadActions(searchDocument); + .addUploadActions(Collections.singletonList(searchDocument)); validate(expected, actual); } @@ -51,7 +51,8 @@ public void uploadDocuments() { .map(doc -> new IndexAction().setActionType(IndexActionType.UPLOAD).setDocument(doc)) .collect(Collectors.toList()); - IndexDocumentsBatch expectedBatch = new IndexDocumentsBatch(indexActions); + IndexDocumentsBatch expectedBatch = new IndexDocumentsBatch() + .addActions(indexActions); IndexDocumentsBatch actualBatch = new IndexDocumentsBatch() .addUploadActions(docs); @@ -68,11 +69,11 @@ public void mergeDocument() { .setActionType(IndexActionType.MERGE) .setDocument(searchDocument); - IndexDocumentsBatch expected = new IndexDocumentsBatch( - Collections.singletonList(indexAction)); + IndexDocumentsBatch expected = new IndexDocumentsBatch() + .addActions(Collections.singletonList(indexAction)); IndexDocumentsBatch actual = new IndexDocumentsBatch() - .addMergeActions(searchDocument); + .addMergeActions(Collections.singletonList(searchDocument)); validate(expected, actual); } @@ -93,7 +94,8 @@ public void mergeDocuments() { .map(doc -> new IndexAction().setActionType(IndexActionType.MERGE).setDocument(doc)) .collect(Collectors.toList()); - IndexDocumentsBatch expectedBatch = new IndexDocumentsBatch(indexActions); + IndexDocumentsBatch expectedBatch = new IndexDocumentsBatch() + .addActions(indexActions); IndexDocumentsBatch actualBatch = new IndexDocumentsBatch() .addMergeActions(docs); @@ -110,11 +112,11 @@ public void mergeOrUploadDocument() { .setActionType(IndexActionType.MERGE_OR_UPLOAD) .setDocument(searchDocument); - IndexDocumentsBatch expected = new IndexDocumentsBatch( - Collections.singletonList(indexAction)); + IndexDocumentsBatch expected = new IndexDocumentsBatch() + .addActions(Collections.singletonList(indexAction)); IndexDocumentsBatch actual = new IndexDocumentsBatch() - .addMergeOrUploadActions(searchDocument); + .addMergeOrUploadActions(Collections.singletonList(searchDocument)); validate(expected, actual); } @@ -135,7 +137,8 @@ public void mergeOrUploadDocuments() { .map(doc -> new IndexAction().setActionType(IndexActionType.MERGE_OR_UPLOAD).setDocument(doc)) .collect(Collectors.toList()); - IndexDocumentsBatch expectedBatch = new IndexDocumentsBatch(indexActions); + IndexDocumentsBatch expectedBatch = new IndexDocumentsBatch() + .addActions(indexActions); IndexDocumentsBatch actualBatch = new IndexDocumentsBatch() .addMergeOrUploadActions(docs); @@ -152,11 +155,11 @@ public void deleteDocument() { .setActionType(IndexActionType.DELETE) .setDocument(searchDocument); - IndexDocumentsBatch expected = new IndexDocumentsBatch( - Collections.singletonList(indexAction)); + IndexDocumentsBatch expected = new IndexDocumentsBatch() + .addActions(Collections.singletonList(indexAction)); IndexDocumentsBatch actual = new IndexDocumentsBatch() - .addDeleteActions(searchDocument); + .addDeleteActions(Collections.singletonList(searchDocument)); validate(expected, actual); } @@ -177,7 +180,8 @@ public void deleteDocuments() { .map(doc -> new IndexAction().setActionType(IndexActionType.DELETE).setDocument(doc)) .collect(Collectors.toList()); - IndexDocumentsBatch expectedBatch = new IndexDocumentsBatch(indexActions); + IndexDocumentsBatch expectedBatch = new IndexDocumentsBatch() + .addActions(indexActions); IndexDocumentsBatch actualBatch = new IndexDocumentsBatch() .addDeleteActions(docs); @@ -215,14 +219,14 @@ public void canBuildIndexBatchWithMultipleActionsAndSingleDocument() { .setActionType(IndexActionType.UPLOAD) .setDocument(documentToUpload); - IndexDocumentsBatch expected = new IndexDocumentsBatch( - Arrays.asList(mergeAction, mergeOrUploadAction, deleteAction, uploadAction)); + IndexDocumentsBatch expected = new IndexDocumentsBatch() + .addActions(Arrays.asList(mergeAction, mergeOrUploadAction, deleteAction, uploadAction)); IndexDocumentsBatch actual = new IndexDocumentsBatch() - .addMergeActions(documentToMerge) - .addMergeOrUploadActions(documentToMergeOrUpload) - .addDeleteActions(documentToDelete) - .addUploadActions(documentToUpload); + .addMergeActions(Collections.singletonList(documentToMerge)) + .addMergeOrUploadActions(Collections.singletonList(documentToMergeOrUpload)) + .addDeleteActions(Collections.singletonList(documentToDelete)) + .addUploadActions(Collections.singletonList(documentToUpload)); validate(expected, actual); } @@ -301,8 +305,8 @@ public void canBuildIndexBatchWithMultipleActionsAndMultipleDocuments() { .setActionType(IndexActionType.UPLOAD) .setDocument(documentsToUpload.get(1)); - IndexDocumentsBatch expected = new IndexDocumentsBatch( - Arrays.asList( + IndexDocumentsBatch expected = new IndexDocumentsBatch() + .addActions(Arrays.asList( mergeAction1, mergeAction2, mergeOrUploadAction1, @@ -310,9 +314,7 @@ public void canBuildIndexBatchWithMultipleActionsAndMultipleDocuments() { deleteAction1, deleteAction2, uploadAction1, - uploadAction2 - ) - ); + uploadAction2)); IndexDocumentsBatch actual = new IndexDocumentsBatch() .addMergeActions(documentsToMerge) diff --git a/sdk/search/azure-search-documents/src/test/java/com/azure/search/documents/IndexingSyncTests.java b/sdk/search/azure-search-documents/src/test/java/com/azure/search/documents/IndexingSyncTests.java index 1e9bf3ab965fe..e4e1a084bb13d 100644 --- a/sdk/search/azure-search-documents/src/test/java/com/azure/search/documents/IndexingSyncTests.java +++ b/sdk/search/azure-search-documents/src/test/java/com/azure/search/documents/IndexingSyncTests.java @@ -130,7 +130,7 @@ public void canDeleteBatchByKeys() { assertEquals(2, client.getDocumentCount()); IndexDocumentsBatch deleteBatch = new IndexDocumentsBatch() - .addDeleteActions("HotelId", "1", "2"); + .addDeleteActions("HotelId", Arrays.asList("1", "2")); IndexDocumentsResult documentIndexResult = client.indexDocuments(deleteBatch); waitForIndexing(); @@ -201,11 +201,11 @@ public void canIndexStaticallyTypedDocuments() throws ParseException { Hotel randomHotel = prepareStaticallyTypedHotel("randomId"); // deleting a non existing document IndexDocumentsBatch batch = new IndexDocumentsBatch() - .addUploadActions(hotel1) - .addDeleteActions(randomHotel) - .addMergeActions(nonExistingHotel) - .addMergeOrUploadActions(hotel3) - .addUploadActions(hotel2); + .addUploadActions(Collections.singletonList(hotel1)) + .addDeleteActions(Collections.singletonList(randomHotel)) + .addMergeActions(Collections.singletonList(nonExistingHotel)) + .addMergeOrUploadActions(Collections.singletonList(hotel3)) + .addUploadActions(Collections.singletonList(hotel2)); try { client.indexDocumentsWithResponse(batch, new IndexDocumentsOptions().setThrowOnAnyError(true), @@ -246,11 +246,11 @@ public void canIndexDynamicDocumentsNotThrow() { SearchDocument randomHotel = prepareDynamicallyTypedHotel("randomId"); // deleting a non existing document IndexDocumentsBatch batch = new IndexDocumentsBatch() - .addUploadActions(hotel1) - .addDeleteActions(randomHotel) - .addMergeActions(nonExistingHotel) - .addMergeOrUploadActions(hotel3) - .addUploadActions(hotel2); + .addUploadActions(Collections.singletonList(hotel1)) + .addDeleteActions(Collections.singletonList(randomHotel)) + .addMergeActions(Collections.singletonList(nonExistingHotel)) + .addMergeOrUploadActions(Collections.singletonList(hotel3)) + .addUploadActions(Collections.singletonList(hotel2)); Response resultResponse = client.indexDocumentsWithResponse(batch, new IndexDocumentsOptions().setThrowOnAnyError(false), Context.NONE); @@ -283,11 +283,11 @@ public void canIndexDynamicDocumentsThrowOnError() { SearchDocument randomHotel = prepareDynamicallyTypedHotel("randomId"); // deleting a non existing document IndexDocumentsBatch batch = new IndexDocumentsBatch() - .addUploadActions(hotel1) - .addDeleteActions(randomHotel) - .addMergeActions(nonExistingHotel) - .addMergeOrUploadActions(hotel3) - .addUploadActions(hotel2); + .addUploadActions(Collections.singletonList(hotel1)) + .addDeleteActions(Collections.singletonList(randomHotel)) + .addMergeActions(Collections.singletonList(nonExistingHotel)) + .addMergeOrUploadActions(Collections.singletonList(hotel3)) + .addUploadActions(Collections.singletonList(hotel2)); try { client.indexDocuments(batch); diff --git a/sdk/search/azure-search-documents/src/test/java/com/azure/search/documents/LookupSyncTests.java b/sdk/search/azure-search-documents/src/test/java/com/azure/search/documents/LookupSyncTests.java index c01d2bfc8e0a5..4d4838b7b99d2 100644 --- a/sdk/search/azure-search-documents/src/test/java/com/azure/search/documents/LookupSyncTests.java +++ b/sdk/search/azure-search-documents/src/test/java/com/azure/search/documents/LookupSyncTests.java @@ -279,7 +279,7 @@ public void getDynamicDocumentCannotAlwaysDetermineCorrectType() { // expectedDoc.put("Location", createPointGeometryString(40.760586, -73.975403)); expectedDoc.put("Rooms", Collections.singletonList(new SearchDocument(Collections.singletonMap("BaseRate", "NaN")))); - client.indexDocuments(new IndexDocumentsBatch<>().addUploadActions(indexedDoc)); + client.indexDocuments(new IndexDocumentsBatch<>().addUploadActions(Collections.singletonList(indexedDoc))); // Select only the fields set in the test case so we don't get superfluous data back. List selectedFields = Arrays.asList("HotelId", "LastRenovationDate", "Location", "Rooms/BaseRate"); @@ -296,7 +296,7 @@ public void canGetDocumentWithBase64EncodedKey() { SearchDocument expectedDoc = new SearchDocument(); expectedDoc.put("HotelId", complexKey); - client.indexDocuments(new IndexDocumentsBatch<>().addUploadActions(expectedDoc)); + client.indexDocuments(new IndexDocumentsBatch<>().addUploadActions(Collections.singletonList(expectedDoc))); assertEquals(client.getDocumentWithResponse(complexKey, SearchDocument.class, new ArrayList<>(expectedDoc.keySet()), Context.NONE).getValue(), expectedDoc); } @@ -314,7 +314,7 @@ public void roundTrippingDateTimeOffsetNormalizesToUtc() { expectedDoc.put("LastRenovationDate", OffsetDateTime.parse("2010-06-27T08:00Z")); - client.indexDocuments(new IndexDocumentsBatch<>().addUploadActions(indexedDoc)); + client.indexDocuments(new IndexDocumentsBatch<>().addUploadActions(Collections.singletonList(indexedDoc))); SearchDocument actualDoc = client.getDocumentWithResponse("1", SearchDocument.class, new ArrayList<>(expectedDoc.keySet()), Context.NONE).getValue(); assertMapEquals(expectedDoc, actualDoc, false); From 5a6bd8c0263d50f631cbce2ec78cf7f32e3ecf50 Mon Sep 17 00:00:00 2001 From: Srikanta <51379715+srnagar@users.noreply.github.com> Date: Tue, 7 Jul 2020 12:34:15 -0700 Subject: [PATCH 032/129] Enable blocking operation in batch receive (#12822) * Enable blocking operation in batch receive * Fix error type * Remove unused imports --- .../eventhubs/PartitionBasedLoadBalancer.java | 8 ---- .../eventhubs/PartitionPumpManager.java | 46 ++++++++----------- 2 files changed, 20 insertions(+), 34 deletions(-) diff --git a/sdk/eventhubs/azure-messaging-eventhubs/src/main/java/com/azure/messaging/eventhubs/PartitionBasedLoadBalancer.java b/sdk/eventhubs/azure-messaging-eventhubs/src/main/java/com/azure/messaging/eventhubs/PartitionBasedLoadBalancer.java index f387314a784f9..909ef1105d582 100644 --- a/sdk/eventhubs/azure-messaging-eventhubs/src/main/java/com/azure/messaging/eventhubs/PartitionBasedLoadBalancer.java +++ b/sdk/eventhubs/azure-messaging-eventhubs/src/main/java/com/azure/messaging/eventhubs/PartitionBasedLoadBalancer.java @@ -10,7 +10,6 @@ import com.azure.messaging.eventhubs.models.PartitionOwnership; import java.util.concurrent.atomic.AtomicBoolean; import reactor.core.Exceptions; -import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; import reactor.util.function.Tuple2; @@ -22,7 +21,6 @@ import java.util.Map.Entry; import java.util.Random; import java.util.concurrent.TimeUnit; -import java.util.concurrent.TimeoutException; import java.util.function.Consumer; import java.util.function.Function; import java.util.stream.Collectors; @@ -123,12 +121,6 @@ void loadBalance() { final Mono> partitionsMono = eventHubAsyncClient .getPartitionIds() .timeout(Duration.ofMinutes(1)) - .onErrorResume(TimeoutException.class, error -> { - // In the subsequent step where it tries to balance the load, it'll propagate an error to the user. - // So it is okay to return an empty Flux. - logger.warning("Unable to get partitionIds from eventHubAsyncClient."); - return Flux.empty(); - }) .collectList(); Mono.zip(partitionOwnershipMono, partitionsMono) diff --git a/sdk/eventhubs/azure-messaging-eventhubs/src/main/java/com/azure/messaging/eventhubs/PartitionPumpManager.java b/sdk/eventhubs/azure-messaging-eventhubs/src/main/java/com/azure/messaging/eventhubs/PartitionPumpManager.java index 7303b8c217b48..aa41cdd1b7ce3 100644 --- a/sdk/eventhubs/azure-messaging-eventhubs/src/main/java/com/azure/messaging/eventhubs/PartitionPumpManager.java +++ b/sdk/eventhubs/azure-messaging-eventhubs/src/main/java/com/azure/messaging/eventhubs/PartitionPumpManager.java @@ -43,6 +43,7 @@ import java.util.stream.Collectors; import reactor.core.publisher.Flux; import reactor.core.publisher.Signal; +import reactor.core.scheduler.Schedulers; /** * The partition pump manager that keeps track of all the partition pumps started by this {@link EventProcessorClient}. @@ -164,37 +165,30 @@ void startPartitionPump(PartitionOwnership claimedOwnership, Checkpoint checkpoi partitionPumps.put(claimedOwnership.getPartitionId(), eventHubConsumer); //@formatter:off + Flux> partitionEventFlux; if (maxWaitTime != null) { - eventHubConsumer + partitionEventFlux = eventHubConsumer .receiveFromPartition(claimedOwnership.getPartitionId(), startFromEventPosition, receiveOptions) - .windowTimeout(maxBatchSize, maxWaitTime) - .flatMap(Flux::collectList) - .subscribe(partitionEventBatch -> processEvents(partitionContext, partitionProcessor, - eventHubConsumer, partitionEventBatch), - /* EventHubConsumer receive() returned an error */ - ex -> handleError(claimedOwnership, eventHubConsumer, partitionProcessor, ex, partitionContext), - () -> { - partitionProcessor.close(new CloseContext(partitionContext, - CloseReason.EVENT_PROCESSOR_SHUTDOWN)); - cleanup(claimedOwnership, eventHubConsumer); - }); + .windowTimeout(maxBatchSize, maxWaitTime); } else { - eventHubConsumer + partitionEventFlux = eventHubConsumer .receiveFromPartition(claimedOwnership.getPartitionId(), startFromEventPosition, receiveOptions) - .window(maxBatchSize) - .flatMap(Flux::collectList) - .subscribe(partitionEventBatch -> { - processEvents(partitionContext, partitionProcessor, - eventHubConsumer, partitionEventBatch); - }, - /* EventHubConsumer receive() returned an error */ - ex -> handleError(claimedOwnership, eventHubConsumer, partitionProcessor, ex, partitionContext), - () -> { - partitionProcessor.close(new CloseContext(partitionContext, - CloseReason.EVENT_PROCESSOR_SHUTDOWN)); - cleanup(claimedOwnership, eventHubConsumer); - }); + .window(maxBatchSize); } + partitionEventFlux + .flatMap(Flux::collectList) + .publishOn(Schedulers.boundedElastic()) + .subscribe(partitionEventBatch -> { + processEvents(partitionContext, partitionProcessor, + eventHubConsumer, partitionEventBatch); + }, + /* EventHubConsumer receive() returned an error */ + ex -> handleError(claimedOwnership, eventHubConsumer, partitionProcessor, ex, partitionContext), + () -> { + partitionProcessor.close(new CloseContext(partitionContext, + CloseReason.EVENT_PROCESSOR_SHUTDOWN)); + cleanup(claimedOwnership, eventHubConsumer); + }); //@formatter:on } catch (Exception ex) { if (partitionPumps.containsKey(claimedOwnership.getPartitionId())) { From 9e4911bf845879632348099159cca92274e74b82 Mon Sep 17 00:00:00 2001 From: Vinay Gera Date: Tue, 7 Jul 2020 13:01:02 -0700 Subject: [PATCH 033/129] update versions. (#12872) --- eng/versioning/version_client.txt | 2 +- sdk/appconfiguration/azure-data-appconfiguration/pom.xml | 2 +- .../azure-messaging-eventhubs-checkpointstore-blob/pom.xml | 2 +- sdk/eventhubs/azure-messaging-eventhubs/pom.xml | 2 +- sdk/formrecognizer/azure-ai-formrecognizer/pom.xml | 2 +- sdk/keyvault/azure-security-keyvault-certificates/pom.xml | 2 +- sdk/keyvault/azure-security-keyvault-keys/pom.xml | 2 +- sdk/keyvault/azure-security-keyvault-secrets/pom.xml | 2 +- sdk/servicebus/azure-messaging-servicebus/pom.xml | 2 +- sdk/spring/azure-spring-boot/pom.xml | 2 +- sdk/storage/azure-storage-blob-batch/pom.xml | 2 +- sdk/storage/azure-storage-blob-changefeed/pom.xml | 2 +- sdk/storage/azure-storage-blob-cryptography/pom.xml | 2 +- sdk/storage/azure-storage-blob/pom.xml | 2 +- sdk/storage/azure-storage-common/pom.xml | 2 +- sdk/storage/azure-storage-file-datalake/pom.xml | 2 +- sdk/storage/azure-storage-queue/pom.xml | 2 +- sdk/textanalytics/azure-ai-textanalytics/pom.xml | 2 +- 18 files changed, 18 insertions(+), 18 deletions(-) diff --git a/eng/versioning/version_client.txt b/eng/versioning/version_client.txt index aee302830657f..0786533fc8e38 100644 --- a/eng/versioning/version_client.txt +++ b/eng/versioning/version_client.txt @@ -26,7 +26,7 @@ com.azure:azure-data-schemaregistry;1.0.0-beta.2;1.0.0-beta.3 com.azure:azure-data-schemaregistry-avro;1.0.0-beta.2;1.0.0-beta.3 com.azure:azure-data-tables;1.0.0-beta.1;1.0.0-beta.1 com.azure:azure-e2e;1.0.0-beta.1;1.0.0-beta.1 -com.azure:azure-identity;1.0.7;1.1.0-beta.6 +com.azure:azure-identity;1.0.8;1.1.0-beta.6 com.azure:azure-identity-perf;1.0.0-beta.1;1.0.0-beta.1 com.azure:azure-messaging-eventhubs;5.1.1;5.2.0-beta.1 com.azure:azure-messaging-eventhubs-checkpointstore-blob;1.1.1;1.2.0-beta.1 diff --git a/sdk/appconfiguration/azure-data-appconfiguration/pom.xml b/sdk/appconfiguration/azure-data-appconfiguration/pom.xml index be05c61b3990a..d2e314817ee95 100644 --- a/sdk/appconfiguration/azure-data-appconfiguration/pom.xml +++ b/sdk/appconfiguration/azure-data-appconfiguration/pom.xml @@ -90,7 +90,7 @@ com.azure azure-identity - 1.0.7 + 1.0.8 test diff --git a/sdk/eventhubs/azure-messaging-eventhubs-checkpointstore-blob/pom.xml b/sdk/eventhubs/azure-messaging-eventhubs-checkpointstore-blob/pom.xml index 859cdcb777847..6ee4b3c6c99a8 100644 --- a/sdk/eventhubs/azure-messaging-eventhubs-checkpointstore-blob/pom.xml +++ b/sdk/eventhubs/azure-messaging-eventhubs-checkpointstore-blob/pom.xml @@ -52,7 +52,7 @@ com.azure azure-identity - 1.0.7 + 1.0.8 test diff --git a/sdk/eventhubs/azure-messaging-eventhubs/pom.xml b/sdk/eventhubs/azure-messaging-eventhubs/pom.xml index c9200f744bac8..7d0f5adbebb57 100644 --- a/sdk/eventhubs/azure-messaging-eventhubs/pom.xml +++ b/sdk/eventhubs/azure-messaging-eventhubs/pom.xml @@ -49,7 +49,7 @@ com.azure azure-identity - 1.0.7 + 1.0.8 test diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/pom.xml b/sdk/formrecognizer/azure-ai-formrecognizer/pom.xml index a6b6d4f43755d..b66a00efe5339 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/pom.xml +++ b/sdk/formrecognizer/azure-ai-formrecognizer/pom.xml @@ -78,7 +78,7 @@ com.azure azure-identity - 1.0.7 + 1.0.8 test diff --git a/sdk/keyvault/azure-security-keyvault-certificates/pom.xml b/sdk/keyvault/azure-security-keyvault-certificates/pom.xml index 91e062ccab1cd..023eedb9f8f15 100644 --- a/sdk/keyvault/azure-security-keyvault-certificates/pom.xml +++ b/sdk/keyvault/azure-security-keyvault-certificates/pom.xml @@ -98,7 +98,7 @@ com.azure azure-identity - 1.0.7 + 1.0.8 test diff --git a/sdk/keyvault/azure-security-keyvault-keys/pom.xml b/sdk/keyvault/azure-security-keyvault-keys/pom.xml index 598fcabd84ef6..06ebf5db2f636 100644 --- a/sdk/keyvault/azure-security-keyvault-keys/pom.xml +++ b/sdk/keyvault/azure-security-keyvault-keys/pom.xml @@ -105,7 +105,7 @@ com.azure azure-identity - 1.0.7 + 1.0.8 test diff --git a/sdk/keyvault/azure-security-keyvault-secrets/pom.xml b/sdk/keyvault/azure-security-keyvault-secrets/pom.xml index 7ae99e90d3b2e..d6df31c331af3 100644 --- a/sdk/keyvault/azure-security-keyvault-secrets/pom.xml +++ b/sdk/keyvault/azure-security-keyvault-secrets/pom.xml @@ -105,7 +105,7 @@ com.azure azure-identity - 1.0.7 + 1.0.8 test diff --git a/sdk/servicebus/azure-messaging-servicebus/pom.xml b/sdk/servicebus/azure-messaging-servicebus/pom.xml index d89741dde4f13..96e672011dd68 100644 --- a/sdk/servicebus/azure-messaging-servicebus/pom.xml +++ b/sdk/servicebus/azure-messaging-servicebus/pom.xml @@ -71,7 +71,7 @@ com.azure azure-identity - 1.0.7 + 1.0.8 test diff --git a/sdk/spring/azure-spring-boot/pom.xml b/sdk/spring/azure-spring-boot/pom.xml index 5f85a2bf9504b..00f9045da2c93 100644 --- a/sdk/spring/azure-spring-boot/pom.xml +++ b/sdk/spring/azure-spring-boot/pom.xml @@ -166,7 +166,7 @@ com.azure azure-identity - 1.0.7 + 1.0.8 diff --git a/sdk/storage/azure-storage-blob-batch/pom.xml b/sdk/storage/azure-storage-blob-batch/pom.xml index 9834337dc64cf..d7e99ec5192c6 100644 --- a/sdk/storage/azure-storage-blob-batch/pom.xml +++ b/sdk/storage/azure-storage-blob-batch/pom.xml @@ -87,7 +87,7 @@ com.azure azure-identity - 1.0.7 + 1.0.8 test diff --git a/sdk/storage/azure-storage-blob-changefeed/pom.xml b/sdk/storage/azure-storage-blob-changefeed/pom.xml index 7cfe14796bbb3..bfc94e8ecc89c 100644 --- a/sdk/storage/azure-storage-blob-changefeed/pom.xml +++ b/sdk/storage/azure-storage-blob-changefeed/pom.xml @@ -87,7 +87,7 @@ com.azure azure-identity - 1.0.7 + 1.0.8 test diff --git a/sdk/storage/azure-storage-blob-cryptography/pom.xml b/sdk/storage/azure-storage-blob-cryptography/pom.xml index cf6cc2e0eb7de..d8bc4ca17c52b 100644 --- a/sdk/storage/azure-storage-blob-cryptography/pom.xml +++ b/sdk/storage/azure-storage-blob-cryptography/pom.xml @@ -95,7 +95,7 @@ com.azure azure-identity - 1.0.7 + 1.0.8 test diff --git a/sdk/storage/azure-storage-blob/pom.xml b/sdk/storage/azure-storage-blob/pom.xml index 90a19dbf5006e..9c5827fe38b63 100644 --- a/sdk/storage/azure-storage-blob/pom.xml +++ b/sdk/storage/azure-storage-blob/pom.xml @@ -92,7 +92,7 @@ com.azure azure-identity - 1.0.7 + 1.0.8 test diff --git a/sdk/storage/azure-storage-common/pom.xml b/sdk/storage/azure-storage-common/pom.xml index a3503e01608ca..51a09380c754e 100644 --- a/sdk/storage/azure-storage-common/pom.xml +++ b/sdk/storage/azure-storage-common/pom.xml @@ -68,7 +68,7 @@ com.azure azure-identity - 1.0.7 + 1.0.8 test diff --git a/sdk/storage/azure-storage-file-datalake/pom.xml b/sdk/storage/azure-storage-file-datalake/pom.xml index 588d783e12022..a2eec8ff6284b 100644 --- a/sdk/storage/azure-storage-file-datalake/pom.xml +++ b/sdk/storage/azure-storage-file-datalake/pom.xml @@ -83,7 +83,7 @@ com.azure azure-identity - 1.0.7 + 1.0.8 test diff --git a/sdk/storage/azure-storage-queue/pom.xml b/sdk/storage/azure-storage-queue/pom.xml index 2d73948453510..cd814256e79f6 100644 --- a/sdk/storage/azure-storage-queue/pom.xml +++ b/sdk/storage/azure-storage-queue/pom.xml @@ -71,7 +71,7 @@ com.azure azure-identity - 1.0.7 + 1.0.8 test diff --git a/sdk/textanalytics/azure-ai-textanalytics/pom.xml b/sdk/textanalytics/azure-ai-textanalytics/pom.xml index e4fe82eec1f4c..215b304ea4881 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/pom.xml +++ b/sdk/textanalytics/azure-ai-textanalytics/pom.xml @@ -88,7 +88,7 @@ com.azure azure-identity - 1.0.7 + 1.0.8 test From e59b8881a001eeb7553fca1caff926f4ace13df5 Mon Sep 17 00:00:00 2001 From: Gauri Prasad <51212198+gapra-msft@users.noreply.github.com> Date: Tue, 7 Jul 2020 13:22:20 -0700 Subject: [PATCH 034/129] Prepping 73 release (#12873) --- .../azure/storage/blob/LargeBlobTest.groovy | 5 +++ .../azure/storage/blob/VersioningTest.groovy | 2 +- .../implementation/FluxInputStreamTest.groovy | 7 ++++ .../file/datalake/LargeFileTest.groovy | 2 -- .../implementation/AvroParserStateTest.groovy | 7 ++++ .../avro/implementation/AvroReaderTest.groovy | 7 ++++ .../avro/implementation/AvroSchemaTest.groovy | 7 ++++ sdk/storage/test-resources.json | 32 ++++++++++++++++++- sdk/storage/tests.yml | 9 ++++++ 9 files changed, 74 insertions(+), 4 deletions(-) diff --git a/sdk/storage/azure-storage-blob/src/test/java/com/azure/storage/blob/LargeBlobTest.groovy b/sdk/storage/azure-storage-blob/src/test/java/com/azure/storage/blob/LargeBlobTest.groovy index 74f70f000a180..9fde87c654e43 100644 --- a/sdk/storage/azure-storage-blob/src/test/java/com/azure/storage/blob/LargeBlobTest.groovy +++ b/sdk/storage/azure-storage-blob/src/test/java/com/azure/storage/blob/LargeBlobTest.groovy @@ -122,6 +122,7 @@ class LargeBlobTest extends APISpec { } @Requires({ liveMode() }) + @Ignore("IS mark/reset") // This test does not send large payload over the wire def "Upload Large Blob in Single Upload"() { given: @@ -140,6 +141,7 @@ class LargeBlobTest extends APISpec { } @Requires({ liveMode() }) + @Ignore("OOM") // This test does not send large payload over the wire def "Upload Large Blob in Single Upload Async"() { given: @@ -156,6 +158,7 @@ class LargeBlobTest extends APISpec { } @Requires({ liveMode() }) + @Ignore("IS mark/reset") // This test does not send large payload over the wire def "Stage Large Blob"() { given: @@ -172,6 +175,7 @@ class LargeBlobTest extends APISpec { } @Requires({ liveMode() }) + @Ignore("OOM") // This test does not send large payload over the wire def "Upload Large Input"() { given: @@ -209,6 +213,7 @@ class LargeBlobTest extends APISpec { } @Requires({ liveMode() }) + @Ignore("IS mark/reset") // This test does not send large payload over the wire def "Upload Large Input Sync"() { given: diff --git a/sdk/storage/azure-storage-blob/src/test/java/com/azure/storage/blob/VersioningTest.groovy b/sdk/storage/azure-storage-blob/src/test/java/com/azure/storage/blob/VersioningTest.groovy index 4c377dbc5d8ab..54b31b8a57a33 100644 --- a/sdk/storage/azure-storage-blob/src/test/java/com/azure/storage/blob/VersioningTest.groovy +++ b/sdk/storage/azure-storage-blob/src/test/java/com/azure/storage/blob/VersioningTest.groovy @@ -30,7 +30,7 @@ class VersioningTest extends APISpec { def setup() { blobName = generateBlobName() containerName = generateContainerName() - blobContainerClient = versionedBlobServiceClient.createBlobContainer(containerName) + blobContainerClient = primaryBlobServiceClient.createBlobContainer(containerName) blobClient = blobContainerClient.getBlobClient(blobName) } diff --git a/sdk/storage/azure-storage-common/src/test/java/com/azure/storage/common/implementation/FluxInputStreamTest.groovy b/sdk/storage/azure-storage-common/src/test/java/com/azure/storage/common/implementation/FluxInputStreamTest.groovy index 41130554fd523..c58c1e1ac3b55 100644 --- a/sdk/storage/azure-storage-common/src/test/java/com/azure/storage/common/implementation/FluxInputStreamTest.groovy +++ b/sdk/storage/azure-storage-common/src/test/java/com/azure/storage/common/implementation/FluxInputStreamTest.groovy @@ -13,6 +13,13 @@ import java.nio.ByteBuffer class FluxInputStreamTest extends Specification { + def setup() { + String fullTestName = specificationContext.getCurrentIteration().getName().replace(' ', '').toLowerCase() + String className = specificationContext.getCurrentSpec().getName() + // Print out the test name to create breadcrumbs in our test logging in case anything hangs. + System.out.printf("========================= %s.%s =========================%n", className, fullTestName) + } + /* Network tests to be performed by implementors of the FluxInputStream. */ Flux generateData(int num) { List buffers = new ArrayList<>() diff --git a/sdk/storage/azure-storage-file-datalake/src/test/java/com/azure/storage/file/datalake/LargeFileTest.groovy b/sdk/storage/azure-storage-file-datalake/src/test/java/com/azure/storage/file/datalake/LargeFileTest.groovy index 43ae5b68b510d..00097b8c9f65b 100644 --- a/sdk/storage/azure-storage-file-datalake/src/test/java/com/azure/storage/file/datalake/LargeFileTest.groovy +++ b/sdk/storage/azure-storage-file-datalake/src/test/java/com/azure/storage/file/datalake/LargeFileTest.groovy @@ -9,8 +9,6 @@ import com.azure.storage.common.ParallelTransferOptions import com.azure.storage.common.implementation.Constants import com.azure.storage.common.policy.StorageSharedKeyCredentialPolicy import com.azure.storage.file.datalake.models.DataLakeStorageException -import org.reactivestreams.Publisher -import org.reactivestreams.Subscriber import reactor.core.publisher.Flux import reactor.core.publisher.Mono import spock.lang.Ignore diff --git a/sdk/storage/azure-storage-internal-avro/src/test/java/com/azure/storage/internal/avro/implementation/AvroParserStateTest.groovy b/sdk/storage/azure-storage-internal-avro/src/test/java/com/azure/storage/internal/avro/implementation/AvroParserStateTest.groovy index 9cb2737892873..e95e1fb73911d 100644 --- a/sdk/storage/azure-storage-internal-avro/src/test/java/com/azure/storage/internal/avro/implementation/AvroParserStateTest.groovy +++ b/sdk/storage/azure-storage-internal-avro/src/test/java/com/azure/storage/internal/avro/implementation/AvroParserStateTest.groovy @@ -8,6 +8,13 @@ import java.nio.ByteBuffer class AvroParserStateTest extends Specification { + def setup() { + String fullTestName = specificationContext.getCurrentIteration().getName().replace(' ', '').toLowerCase() + String className = specificationContext.getCurrentSpec().getName() + // Print out the test name to create breadcrumbs in our test logging in case anything hangs. + System.out.printf("========================= %s.%s =========================%n", className, fullTestName) + } + def "constructor"() { setup: AvroParserState state = new AvroParserState() diff --git a/sdk/storage/azure-storage-internal-avro/src/test/java/com/azure/storage/internal/avro/implementation/AvroReaderTest.groovy b/sdk/storage/azure-storage-internal-avro/src/test/java/com/azure/storage/internal/avro/implementation/AvroReaderTest.groovy index db0c58ab097af..469405860bedc 100644 --- a/sdk/storage/azure-storage-internal-avro/src/test/java/com/azure/storage/internal/avro/implementation/AvroReaderTest.groovy +++ b/sdk/storage/azure-storage-internal-avro/src/test/java/com/azure/storage/internal/avro/implementation/AvroReaderTest.groovy @@ -17,6 +17,13 @@ import java.nio.file.StandardOpenOption class AvroReaderTest extends Specification { + def setup() { + String fullTestName = specificationContext.getCurrentIteration().getName().replace(' ', '').toLowerCase() + String className = specificationContext.getCurrentSpec().getName() + // Print out the test name to create breadcrumbs in our test logging in case anything hangs. + System.out.printf("========================= %s.%s =========================%n", className, fullTestName) + } + String getTestCasePath(int testCase) { String fileName = String.format("test_null_%d.avro", testCase) ClassLoader classLoader = getClass().getClassLoader() diff --git a/sdk/storage/azure-storage-internal-avro/src/test/java/com/azure/storage/internal/avro/implementation/AvroSchemaTest.groovy b/sdk/storage/azure-storage-internal-avro/src/test/java/com/azure/storage/internal/avro/implementation/AvroSchemaTest.groovy index 330dd68a23778..731c48bfc9415 100644 --- a/sdk/storage/azure-storage-internal-avro/src/test/java/com/azure/storage/internal/avro/implementation/AvroSchemaTest.groovy +++ b/sdk/storage/azure-storage-internal-avro/src/test/java/com/azure/storage/internal/avro/implementation/AvroSchemaTest.groovy @@ -7,6 +7,13 @@ import java.nio.ByteBuffer class AvroSchemaTest extends Specification { + def setup() { + String fullTestName = specificationContext.getCurrentIteration().getName().replace(' ', '').toLowerCase() + String className = specificationContext.getCurrentSpec().getName() + // Print out the test name to create breadcrumbs in our test logging in case anything hangs. + System.out.printf("========================= %s.%s =========================%n", className, fullTestName) + } + def "getBytes"() { setup: ByteBuffer b1 = ByteBuffer.wrap("Hello ".getBytes()) diff --git a/sdk/storage/test-resources.json b/sdk/storage/test-resources.json index a977635c1f552..d60bc654fa19a 100644 --- a/sdk/storage/test-resources.json +++ b/sdk/storage/test-resources.json @@ -17,7 +17,7 @@ } }, "variables": { - "storageApiVersion": "2019-04-01", + "storageApiVersion": "2019-06-01", "authorizationApiVersion": "2018-09-01-preview", "blobDataContributorRoleId": "[concat('/subscriptions/', subscription().subscriptionId, '/providers/Microsoft.Authorization/roleDefinitions/ba92f5b4-2d11-453d-a403-e96b0029c9fe')]", "contributorRoleId": "[concat('/subscriptions/', subscription().subscriptionId, '/providers/Microsoft.Authorization/roleDefinitions/b24988ac-6180-42a0-ab88-20f7382dd24c')]", @@ -85,6 +85,36 @@ "accessTier": "Hot" } }, + { + "type": "Microsoft.Storage/storageAccounts/blobServices", + "apiVersion": "[variables('storageApiVersion')]", + "name": "[concat(variables('primaryAccountName'), '/default')]", + "properties": { + "isVersioningEnabled": true, + "deleteRetentionPolicy": { + "enabled": true, + "days": 1 + } + + }, + "dependsOn": [ + "[variables('primaryAccountName')]" + ] + }, + { + "type": "Microsoft.Storage/storageAccounts/fileServices", + "apiVersion": "[variables('storageApiVersion')]", + "name": "[concat(variables('primaryAccountName'), '/default')]", + "properties": { + "shareDeleteRetentionPolicy": { + "enabled": true, + "days": 1 + } + }, + "dependsOn": [ + "[variables('primaryAccountName')]" + ] + }, { "type": "Microsoft.Storage/storageAccounts", "apiVersion": "[variables('storageApiVersion')]", diff --git a/sdk/storage/tests.yml b/sdk/storage/tests.yml index 681abbf13d5b2..a8bd8cec347f8 100644 --- a/sdk/storage/tests.yml +++ b/sdk/storage/tests.yml @@ -14,6 +14,9 @@ jobs: - name: azure-storage-blob-batch groupId: com.azure safeName: azurestorageblobbatch + - name: azure-storage-blob-changefeed + groupId: com.azure + safeName: azurestorageblobchangefeed - name: azure-storage-blob-cryptography groupId: com.azure safeName: azurestorageblobcryptography @@ -26,10 +29,15 @@ jobs: - name: azure-storage-file-datalake groupId: com.azure safeName: azurestoragefiledatalake + - name: azure-storage-internal-avro + groupId: com.azure + safeName: azurestorageinternalavro - name: azure-storage-queue groupId: com.azure safeName: azurestoragequeue TimeoutInMinutes: 120 + Location: canadacentral + SubscriptionConfiguration: $(sub-config-azure-cloud-test-resources-preview) EnvVars: AZURE_TEST_MODE: LIVE AZURE_TENANT_ID: $(aad-azure-sdk-test-tenant-id) @@ -37,3 +45,4 @@ jobs: AZURE_CLIENT_SECRET: $(aad-azure-sdk-test-client-secret) VERSIONED_STORAGE_ACCOUNT_NAME: $(java-storage-versioned-account-name) VERSIONED_STORAGE_ACCOUNT_KEY: $(java-storage-versioned-account-key) + From aa1e60757f8a6e517e997d75c7d24fab48e75394 Mon Sep 17 00:00:00 2001 From: Gauri Prasad <51212198+gapra-msft@users.noreply.github.com> Date: Tue, 7 Jul 2020 13:40:00 -0700 Subject: [PATCH 035/129] Added versions and added REST docs (#12874) --- .../azure-storage-blob-batch/CHANGELOG.md | 3 ++- sdk/storage/azure-storage-blob-batch/README.md | 2 +- .../azure-storage-blob-changefeed/CHANGELOG.md | 2 +- .../CHANGELOG.md | 2 +- .../azure-storage-blob-cryptography/README.md | 2 +- sdk/storage/azure-storage-blob/CHANGELOG.md | 2 +- sdk/storage/azure-storage-blob/README.md | 2 +- .../storage/blob/BlobServiceAsyncClient.java | 6 ++---- .../azure/storage/blob/BlobServiceClient.java | 5 ++--- .../blob/specialized/BlobAsyncClientBase.java | 14 ++++++-------- .../blob/specialized/BlobClientBase.java | 18 ++++++++---------- sdk/storage/azure-storage-common/CHANGELOG.md | 4 +++- sdk/storage/azure-storage-common/README.md | 2 +- .../azure-storage-file-datalake/CHANGELOG.md | 4 +++- .../azure-storage-file-datalake/README.md | 2 +- .../file/datalake/DataLakeFileAsyncClient.java | 5 ++--- .../file/datalake/DataLakeFileClient.java | 9 ++++----- .../azure-storage-file-share/CHANGELOG.md | 3 ++- sdk/storage/azure-storage-file-share/README.md | 2 +- .../azure-storage-internal-avro/CHANGELOG.md | 2 +- sdk/storage/azure-storage-queue/CHANGELOG.md | 3 ++- sdk/storage/azure-storage-queue/README.md | 2 +- 22 files changed, 47 insertions(+), 49 deletions(-) diff --git a/sdk/storage/azure-storage-blob-batch/CHANGELOG.md b/sdk/storage/azure-storage-blob-batch/CHANGELOG.md index 450eed0d2ab18..2aa7e631edc0e 100644 --- a/sdk/storage/azure-storage-blob-batch/CHANGELOG.md +++ b/sdk/storage/azure-storage-blob-batch/CHANGELOG.md @@ -1,6 +1,7 @@ # Release History -## 12.6.0-beta.1 (Unreleased) +## 12.6.0-beta.1 (2020-07-07) +- Updated azure-storage-common and azure-storage-blob dependencies to add support for the 2019-12-12 service version. ## 12.5.2 (2020-06-12) - Updated azure-storage-common and azure-core dependencies. diff --git a/sdk/storage/azure-storage-blob-batch/README.md b/sdk/storage/azure-storage-blob-batch/README.md index e36e5cd185f93..862214cfb0deb 100644 --- a/sdk/storage/azure-storage-blob-batch/README.md +++ b/sdk/storage/azure-storage-blob-batch/README.md @@ -22,7 +22,7 @@ definition, such as text or binary data. com.azure azure-storage-blob-batch - 12.5.2 + 12.6.0-beta.1 ``` [//]: # ({x-version-update-end}) diff --git a/sdk/storage/azure-storage-blob-changefeed/CHANGELOG.md b/sdk/storage/azure-storage-blob-changefeed/CHANGELOG.md index db455f5b13073..f7ec20868880e 100644 --- a/sdk/storage/azure-storage-blob-changefeed/CHANGELOG.md +++ b/sdk/storage/azure-storage-blob-changefeed/CHANGELOG.md @@ -1,6 +1,6 @@ # Release History -## 12.0.0-beta.1 (Unreleased) +## 12.0.0-beta.1 (2020-07-07) - Initial release. - Added support to get changefeed events for an account. diff --git a/sdk/storage/azure-storage-blob-cryptography/CHANGELOG.md b/sdk/storage/azure-storage-blob-cryptography/CHANGELOG.md index 76fa6226f8668..d6c9130b22414 100644 --- a/sdk/storage/azure-storage-blob-cryptography/CHANGELOG.md +++ b/sdk/storage/azure-storage-blob-cryptography/CHANGELOG.md @@ -1,6 +1,6 @@ # Release History -## 12.8.0-beta.1 (Unreleased) +## 12.8.0-beta.1 (2020-07-07) - Added support for setting blob tags on upload. ## 12.7.0 (2020-06-12) diff --git a/sdk/storage/azure-storage-blob-cryptography/README.md b/sdk/storage/azure-storage-blob-cryptography/README.md index 2faa193ce2cff..efab887e62808 100644 --- a/sdk/storage/azure-storage-blob-cryptography/README.md +++ b/sdk/storage/azure-storage-blob-cryptography/README.md @@ -21,7 +21,7 @@ This package supports client side encryption for blob storage. com.azure azure-storage-blob-cryptography - 12.7.0 + 12.8.0-beta.1 ``` [//]: # ({x-version-update-end}) diff --git a/sdk/storage/azure-storage-blob/CHANGELOG.md b/sdk/storage/azure-storage-blob/CHANGELOG.md index 5391c541489ba..96a2a9fa02263 100644 --- a/sdk/storage/azure-storage-blob/CHANGELOG.md +++ b/sdk/storage/azure-storage-blob/CHANGELOG.md @@ -1,6 +1,6 @@ # Release History -## 12.8.0-beta.1 (Unreleased) +## 12.8.0-beta.1 (2020-07-07) - Added support for the 2019-12-12 service version. - Added support for blob tags. Added get/setTags method to Blob(Async)ClientBase. Added filterTags api to BlobServiceClient. Added ability to specify tags on all methods that create a blob. Tag count returned on getProperties/getBlob. Option to include returning tags on listing. - Added support to query a blob. Added query and opernQueryInputStream methods to Blob(Async)ClientBase. diff --git a/sdk/storage/azure-storage-blob/README.md b/sdk/storage/azure-storage-blob/README.md index 30c9e6152136e..4747ec49284c8 100644 --- a/sdk/storage/azure-storage-blob/README.md +++ b/sdk/storage/azure-storage-blob/README.md @@ -22,7 +22,7 @@ definition, such as text or binary data. com.azure azure-storage-blob - 12.7.0 + 12.8.0-beta.1 ``` [//]: # ({x-version-update-end}) diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/BlobServiceAsyncClient.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/BlobServiceAsyncClient.java index a0ea190703013..8e412393564c4 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/BlobServiceAsyncClient.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/BlobServiceAsyncClient.java @@ -343,11 +343,9 @@ private Mono listBlobContainersSegmen null, null, Context.NONE), timeout); } - - // TODO: (rickle-msft) doc links /** * Returns a reactive Publisher emitting the blobs in this account whose tags match the query expression. For more - * information, including information on the query syntax, see the Azure Docs. + * information, including information on the query syntax, see the Azure Docs. * *

Code Samples

* @@ -362,7 +360,7 @@ public PagedFlux findBlobsByTags(String query) { /** * Returns a reactive Publisher emitting the blobs in this account whose tags match the query expression. For more - * information, including information on the query syntax, see the Azure Docs. + * information, including information on the query syntax, see the Azure Docs. * *

Code Samples

* diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/BlobServiceClient.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/BlobServiceClient.java index 6e50941a7a2ac..2088971f76c54 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/BlobServiceClient.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/BlobServiceClient.java @@ -195,11 +195,10 @@ public PagedIterable listBlobContainers(ListBlobContainersOpt return new PagedIterable<>(blobServiceAsyncClient.listBlobContainersWithOptionalTimeout(options, timeout)); } - // TODO: (rickle-msft) doc links /** * Returns a lazy loaded list of blobs in this account whose tags match the query expression. The returned * {@link PagedIterable} can be consumed while new items are automatically retrieved as needed. For more - * information, including information on the query syntax, see the Azure Docs. + * information, including information on the query syntax, see the Azure Docs. * *

Code Samples

* @@ -215,7 +214,7 @@ public PagedIterable findBlobsByTags(String query) { /** * Returns a lazy loaded list of blobs in this account whose tags match the query expression. The returned * {@link PagedIterable} can be consumed while new items are automatically retrieved as needed. For more - * information, including information on the query syntax, see the Azure Docs. + * information, including information on the query syntax, see the Azure Docs. * *

Code Samples

* diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/specialized/BlobAsyncClientBase.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/specialized/BlobAsyncClientBase.java index b9dbda523c829..031786dc772eb 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/specialized/BlobAsyncClientBase.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/specialized/BlobAsyncClientBase.java @@ -1338,7 +1338,6 @@ Mono> setMetadataWithResponse(Map metadata, BlobR .map(response -> new SimpleResponse<>(response, null)); } - // TODO: (rickle-msft) docs link /** * Returns the blob's tags. * @@ -1347,7 +1346,7 @@ Mono> setMetadataWithResponse(Map metadata, BlobR * {@codesnippet com.azure.storage.blob.specialized.BlobAsyncClientBase.getTags} * *

For more information, see the - * Azure Docs

+ * Azure Docs

* * @return A reactive response containing the blob's tags. */ @@ -1363,7 +1362,7 @@ public Mono> getTags() { * {@codesnippet com.azure.storage.blob.specialized.BlobAsyncClientBase.getTagsWithResponse} * *

For more information, see the - * Azure Docs

+ * Azure Docs

* * @return A reactive response containing the blob's tags. */ @@ -1396,7 +1395,7 @@ Mono>> getTagsWithResponse(Context context) { * {@codesnippet com.azure.storage.blob.specialized.BlobAsyncClientBase.setTags#Map} * *

For more information, see the - * Azure Docs

+ * Azure Docs

* * @param tags Tags to associate with the blob. * @return A reactive response signaling completion. @@ -1414,7 +1413,7 @@ public Mono setTags(Map tags) { * {@codesnippet com.azure.storage.blob.specialized.BlobAsyncClientBase.setTagsWithResponse#Map} * *

For more information, see the - * Azure Docs

+ * Azure Docs

* * @param tags Tags to associate with the blob. * @return A reactive response signaling completion. @@ -1694,12 +1693,11 @@ public String generateSas(BlobServiceSasSignatureValues blobServiceSasSignatureV .generateSas(SasImplUtils.extractSharedKeyCredential(getHttpPipeline())); } - /* TODO (gapra): Quick Query service docs. */ /** * Queries the entire blob. * *

For more information, see the - * Azure Docs

+ * Azure Docs

* *

Code Samples

* @@ -1717,7 +1715,7 @@ public Flux query(String expression) { * Queries the entire blob. * *

For more information, see the - * Azure Docs

+ * Azure Docs

* *

Code Samples

* diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/specialized/BlobClientBase.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/specialized/BlobClientBase.java index 3adaee92bd34a..093220f8b91ce 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/specialized/BlobClientBase.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/specialized/BlobClientBase.java @@ -785,7 +785,6 @@ public Response setMetadataWithResponse(Map metadata, Blob return blockWithOptionalTimeout(response, timeout); } - // TODO: (rickle-msft) docs link /** * Returns the blob's tags. * @@ -794,7 +793,7 @@ public Response setMetadataWithResponse(Map metadata, Blob * {@codesnippet com.azure.storage.blob.specialized.BlobClientBase.getTags} * *

For more information, see the - * Azure Docs

+ * Azure Docs

* * @return The blob's tags. */ @@ -810,7 +809,7 @@ public Map getTags() { * {@codesnippet com.azure.storage.blob.specialized.BlobClientBase.getTagsWithResponse#Duration-Context} * *

For more information, see the - * Azure Docs

+ * Azure Docs

* * @param timeout An optional timeout value beyond which a {@link RuntimeException} will be raised. * @param context Additional context that is passed through the Http pipeline during the service call. @@ -831,7 +830,7 @@ public Response> getTagsWithResponse(Duration timeout, Conte * {@codesnippet com.azure.storage.blob.specialized.BlobClientBase.setTags#Map} * *

For more information, see the - * Azure Docs

+ * Azure Docs

* * @param tags Tags to associate with the blob. */ @@ -848,7 +847,7 @@ public void setTags(Map tags) { * {@codesnippet com.azure.storage.blob.specialized.BlobClientBase.setTagsWithResponse#Map-Duration-Context} * *

For more information, see the - * Azure Docs

+ * Azure Docs

* * @param tags Tags to associate with the blob. * @param timeout An optional timeout value beyond which a {@link RuntimeException} will be raised. @@ -1055,12 +1054,11 @@ public String generateSas(BlobServiceSasSignatureValues blobServiceSasSignatureV return this.client.generateSas(blobServiceSasSignatureValues); } - /* TODO (gapra): Populate Rest Api docs for quick query. */ /** * Opens a blob input stream to query the blob. * *

For more information, see the - * Azure Docs

+ * Azure Docs

* *

Code Samples

* @@ -1077,7 +1075,7 @@ public InputStream openQueryInputStream(String expression) { * Opens a blob input stream to query the blob. * *

For more information, see the - * Azure Docs

+ * Azure Docs

* *

Code Samples

* @@ -1102,7 +1100,7 @@ public InputStream openQueryInputStream(BlobQueryOptions queryOptions) { * Queries an entire blob into an output stream. * *

For more information, see the - * Azure Docs

+ * Azure Docs

* *

Code Samples

* @@ -1121,7 +1119,7 @@ public void query(OutputStream stream, String expression) { * Queries an entire blob into an output stream. * *

For more information, see the - * Azure Docs

+ * Azure Docs

* *

Code Samples

* diff --git a/sdk/storage/azure-storage-common/CHANGELOG.md b/sdk/storage/azure-storage-common/CHANGELOG.md index d8786f7f65a4c..f969e02d842de 100644 --- a/sdk/storage/azure-storage-common/CHANGELOG.md +++ b/sdk/storage/azure-storage-common/CHANGELOG.md @@ -1,6 +1,8 @@ # Release History -## 12.8.0-beta.1 (Unreleased) +## 12.8.0-beta.1 (2020-07-07) +- Added support for the 2019-12-12 service version. +- Buffered UploadUtils now supports uploading data of long sized length. ## 12.7.0 (2020-06-12) - Updated azure-core dependency. diff --git a/sdk/storage/azure-storage-common/README.md b/sdk/storage/azure-storage-common/README.md index 85bed911da472..cbe4d7e5a1516 100644 --- a/sdk/storage/azure-storage-common/README.md +++ b/sdk/storage/azure-storage-common/README.md @@ -18,7 +18,7 @@ Azure Storage Common is a library that has common dependencies for all Azure Sto com.azure azure-storage-common - 12.7.0 + 12.8.0-beta.1 ``` [//]: # ({x-version-update-end}) diff --git a/sdk/storage/azure-storage-file-datalake/CHANGELOG.md b/sdk/storage/azure-storage-file-datalake/CHANGELOG.md index 881d9af7cbdc4..04b7bbcd75433 100644 --- a/sdk/storage/azure-storage-file-datalake/CHANGELOG.md +++ b/sdk/storage/azure-storage-file-datalake/CHANGELOG.md @@ -1,7 +1,9 @@ # Release History -## 12.2.0-beta.1 (Unreleased) +## 12.2.0-beta.1 (2019-07-07) +- Added support for the 2019-12-12 service version. - Added support to query a file. +- Added support to increase the maximum size of data that can be sent via an append. ## 12.1.2 (2020-06-12) - Updated azure-storage-common and azure-core dependencies. diff --git a/sdk/storage/azure-storage-file-datalake/README.md b/sdk/storage/azure-storage-file-datalake/README.md index c9323487b20f9..dab5875941e10 100644 --- a/sdk/storage/azure-storage-file-datalake/README.md +++ b/sdk/storage/azure-storage-file-datalake/README.md @@ -25,7 +25,7 @@ Add a dependency on Azure Storage File Datalake com.azure azure-storage-file-datalake - 12.1.2 + 12.2.0-beta.1 ``` [//]: # ({x-version-update-end}) diff --git a/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/DataLakeFileAsyncClient.java b/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/DataLakeFileAsyncClient.java index 431d5b006eb07..0139c0e2fdf85 100644 --- a/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/DataLakeFileAsyncClient.java +++ b/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/DataLakeFileAsyncClient.java @@ -885,12 +885,11 @@ public Mono> renameWithResponse(String destina } } - /* TODO (gapra): Service docs*/ /** * Queries the entire file. * *

For more information, see the - * Azure Docs

+ * Azure Docs

* *

Code Samples

* @@ -908,7 +907,7 @@ public Flux query(String expression) { * Queries the entire file. * *

For more information, see the - * Azure Docs

+ * Azure Docs

* *

Code Samples

* diff --git a/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/DataLakeFileClient.java b/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/DataLakeFileClient.java index 41e0fa2697644..9a70956e97bd9 100644 --- a/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/DataLakeFileClient.java +++ b/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/DataLakeFileClient.java @@ -554,12 +554,11 @@ public Response renameWithResponse(String destinationFileSys return new SimpleResponse<>(resp, new DataLakeFileClient(resp.getValue())); } - /* TODO (gapra): Populate Rest Api docs for quick query. */ /** * Opens an input stream to query the file. * *

For more information, see the - * Azure Docs

+ * Azure Docs

* *

Code Samples

* @@ -576,7 +575,7 @@ public InputStream openQueryInputStream(String expression) { * Opens an input stream to query the file. * *

For more information, see the - * Azure Docs

+ * Azure Docs

* *

Code Samples

* @@ -602,7 +601,7 @@ public InputStream openQueryInputStream(FileQueryOptions queryOptions) { * Queries an entire file into an output stream. * *

For more information, see the - * Azure Docs

+ * Azure Docs

* *

Code Samples

* @@ -621,7 +620,7 @@ public void query(OutputStream stream, String expression) { * Queries an entire file into an output stream. * *

For more information, see the - * Azure Docs

+ * Azure Docs

* *

Code Samples

* diff --git a/sdk/storage/azure-storage-file-share/CHANGELOG.md b/sdk/storage/azure-storage-file-share/CHANGELOG.md index ef5467fc518b4..348c5394ad49d 100644 --- a/sdk/storage/azure-storage-file-share/CHANGELOG.md +++ b/sdk/storage/azure-storage-file-share/CHANGELOG.md @@ -1,6 +1,7 @@ # Release History -## 12.6.0-beta.1 (Unreleased) +## 12.6.0-beta.1 (2019-07-07) +- Added support for the 2019-12-12 service version. - Added support for restoring file share. ## 12.5.0 (2020-06-12) diff --git a/sdk/storage/azure-storage-file-share/README.md b/sdk/storage/azure-storage-file-share/README.md index 5579a22bd0d59..92123fc2b2448 100644 --- a/sdk/storage/azure-storage-file-share/README.md +++ b/sdk/storage/azure-storage-file-share/README.md @@ -24,7 +24,7 @@ Shares provide a way to organize sets of files and also can be mounted as an SMB com.azure azure-storage-file-share - 12.5.0 + 12.6.0-beta.1 ``` [//]: # ({x-version-update-end}) diff --git a/sdk/storage/azure-storage-internal-avro/CHANGELOG.md b/sdk/storage/azure-storage-internal-avro/CHANGELOG.md index bd3cd9cf81b5d..cc636ba30c980 100644 --- a/sdk/storage/azure-storage-internal-avro/CHANGELOG.md +++ b/sdk/storage/azure-storage-internal-avro/CHANGELOG.md @@ -1,6 +1,6 @@ # Release History -## 12.0.0-beta.1 (Unreleased) +## 12.0.0-beta.1 (2019-07-07) - Initial release. ### Features included in `azure-storage-internal-avro` diff --git a/sdk/storage/azure-storage-queue/CHANGELOG.md b/sdk/storage/azure-storage-queue/CHANGELOG.md index 35f02e370099f..4aab944f6f307 100644 --- a/sdk/storage/azure-storage-queue/CHANGELOG.md +++ b/sdk/storage/azure-storage-queue/CHANGELOG.md @@ -1,6 +1,7 @@ # Release History -## 12.6.0-beta.1 (Unreleased) +## 12.6.0-beta.1 (2019-07-07) +- Added support for the 2019-12-12 service version. ## 12.5.2 (2020-06-12) - Updated azure-storage-common and azure-core dependencies. diff --git a/sdk/storage/azure-storage-queue/README.md b/sdk/storage/azure-storage-queue/README.md index 77c5e64a41627..71027ce19a2eb 100644 --- a/sdk/storage/azure-storage-queue/README.md +++ b/sdk/storage/azure-storage-queue/README.md @@ -20,7 +20,7 @@ A single queue message can be up to 64 KB in size, and a queue can contain milli com.azure azure-storage-queue - 12.5.2 + 12.6.0-beta.1 ``` [//]: # ({x-version-update-end}) From c548afc068451c8f24e503f24a369e7145091995 Mon Sep 17 00:00:00 2001 From: Mohammad Derakhshani Date: Tue, 7 Jul 2020 13:44:43 -0700 Subject: [PATCH 036/129] change RNTBD defaults as per learning and to be in par with .Net (#12654) * change RNTBD defaults as per learning from customer * reduced idle value to 1h --- .../com/azure/cosmos/DirectConnectionConfig.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/DirectConnectionConfig.java b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/DirectConnectionConfig.java index 740609bca1826..54b5427873df3 100644 --- a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/DirectConnectionConfig.java +++ b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/DirectConnectionConfig.java @@ -15,8 +15,8 @@ */ public final class DirectConnectionConfig { // Constants - private static final Duration DEFAULT_IDLE_ENDPOINT_TIMEOUT = Duration.ofSeconds(70L); - private static final Duration DEFAULT_CONNECT_TIMEOUT = Duration.ofSeconds(60L); + private static final Duration DEFAULT_IDLE_ENDPOINT_TIMEOUT = Duration.ofHours(1l); + private static final Duration DEFAULT_CONNECT_TIMEOUT = Duration.ofSeconds(5L); private static final Duration DEFAULT_REQUEST_TIMEOUT = Duration.ofSeconds(5L); private static final int DEFAULT_MAX_CONNECTIONS_PER_ENDPOINT = 130; private static final int DEFAULT_MAX_REQUESTS_PER_CONNECTION = 30; @@ -55,7 +55,7 @@ public static DirectConnectionConfig getDefaultConfig() { * * Configures timeout for underlying Netty Channel {@link ChannelOption#CONNECT_TIMEOUT_MILLIS} * - * By default, the connect timeout is 60 seconds. + * By default, the connect timeout is 5 seconds. * * @return direct connect timeout */ @@ -69,7 +69,7 @@ public Duration getConnectTimeout() { * * Configures timeout for underlying Netty Channel {@link ChannelOption#CONNECT_TIMEOUT_MILLIS} * - * By default, the connect timeout is 60 seconds. + * By default, the connect timeout is 5 seconds. * * @param connectTimeout the connection timeout * @return the {@link DirectConnectionConfig} @@ -112,7 +112,7 @@ public DirectConnectionConfig setIdleConnectionTimeout(Duration idleConnectionTi /** * Gets the idle endpoint timeout * - * Default value is 70 seconds. + * Default value is 1 hour. * * If there are no requests to a specific endpoint for idle endpoint timeout duration, * direct client closes all connections to that endpoint to save resources and I/O cost. @@ -126,7 +126,7 @@ public Duration getIdleEndpointTimeout() { /** * Sets the idle endpoint timeout * - * Default value is 70 seconds. + * Default value is 1 hour. * * If there are no requests to a specific endpoint for idle endpoint timeout duration, * direct client closes all connections to that endpoint to save resources and I/O cost. From c4e54cd0e85b435d71f1979971f5df21f51028de Mon Sep 17 00:00:00 2001 From: Rick Ley Date: Tue, 7 Jul 2020 14:50:16 -0700 Subject: [PATCH 037/129] Nio read attr (#12621) * Started working on read attributes * Figuring it out * Progress * Some good progress on testing attributes * Finished tests. Added recordings * Minor cleanup * Fixed compiler warnings * Fixed test failure * Checkstyle * Spotbugs * PR feedback --- .../blob/nio/AzureBasicFileAttributeView.java | 57 +++ .../blob/nio/AzureBasicFileAttributes.java | 143 ++++++++ .../blob/nio/AzureBlobFileAttributeView.java | 147 ++++++++ .../blob/nio/AzureBlobFileAttributes.java | 292 ++++++++++++++++ .../storage/blob/nio/AzureFileStore.java | 4 +- .../storage/blob/nio/AzureFileSystem.java | 7 +- .../blob/nio/AzureFileSystemProvider.java | 201 ++++++++++- .../azure/storage/blob/nio/AzureResource.java | 2 +- .../nio/AzureStorageFileAttributeView.java | 23 -- .../storage/blob/nio/AttributeViewTest.groovy | 242 +++++++++++++ .../blob/nio/AzureFileStoreTest.groovy | 4 +- .../nio/AzureFileSystemProviderTest.groovy | 325 +++++++++++++++++- .../blob/nio/AzureFileSystemTest.groovy | 4 +- ...stattributeviewsettimesunsupported[0].json | 174 ++++++++++ ...stattributeviewsettimesunsupported[1].json | 174 ++++++++++ ...stattributeviewsettimesunsupported[2].json | 174 ++++++++++ ...tazurebasicfileattributeviewdirectory.json | 227 ++++++++++++ ...ebasicfileattributeviewreadattributes.json | 232 +++++++++++++ ...reblobfileattributeviewreadattributes.json | 232 +++++++++++++ ...ileattributeviewsetblobhttpheaders[0].json | 222 ++++++++++++ ...ileattributeviewsetblobhttpheaders[1].json | 228 ++++++++++++ ...reblobfileattributeviewsetmetadata[0].json | 225 ++++++++++++ ...reblobfileattributeviewsetmetadata[1].json | 227 ++++++++++++ ...reblobfileattributeviewsetmetadata[2].json | 227 ++++++++++++ ...tazureblobfileattributeviewsettier[0].json | 224 ++++++++++++ ...tazureblobfileattributeviewsettier[1].json | 224 ++++++++++++ ...SystemProviderTestgetattributeview[0].json | 149 ++++++++ ...SystemProviderTestgetattributeview[1].json | 149 ++++++++ ...SystemProviderTestgetattributeview[2].json | 149 ++++++++ ...ystemProviderTestgetattributeviewfail.json | 149 ++++++++ ...leSystemProviderTestreadattributes[0].json | 226 ++++++++++++ ...leSystemProviderTestreadattributes[1].json | 226 ++++++++++++ ...leSystemProviderTestreadattributes[2].json | 226 ++++++++++++ ...emProviderTestreadattributesdirectory.json | 204 +++++++++++ ...ProviderTestreadattributesioexception.json | 168 +++++++++ ...roviderTestreadattributesstrdirectory.json | 204 +++++++++++ ...temProviderTestreadattributesstria[0].json | 149 ++++++++ ...temProviderTestreadattributesstria[1].json | 149 ++++++++ ...temProviderTestreadattributesstria[2].json | 149 ++++++++ ...viderTestreadattributesstrinvalidview.json | 149 ++++++++ ...viderTestreadattributesstrioexception.json | 168 +++++++++ ...oviderTestreadattributesstrparsing[0].json | 226 ++++++++++++ ...oviderTestreadattributesstrparsing[1].json | 226 ++++++++++++ ...oviderTestreadattributesstrparsing[2].json | 226 ++++++++++++ ...oviderTestreadattributesstrparsing[3].json | 226 ++++++++++++ ...oviderTestreadattributesstrparsing[4].json | 226 ++++++++++++ ...oviderTestreadattributesstrparsing[5].json | 226 ++++++++++++ ...oviderTestreadattributesstrparsing[6].json | 226 ++++++++++++ ...oviderTestreadattributesstrparsing[7].json | 226 ++++++++++++ ...ProviderTestreadattributesunsupported.json | 149 ++++++++ ...temProviderTestsetattributesdirectory.json | 192 +++++++++++ ...emProviderTestsetattributesheaders[0].json | 245 +++++++++++++ ...emProviderTestsetattributesheaders[1].json | 251 ++++++++++++++ ...eSystemProviderTestsetattributesia[0].json | 149 ++++++++ ...eSystemProviderTestsetattributesia[1].json | 149 ++++++++ ...eSystemProviderTestsetattributesia[2].json | 149 ++++++++ ...mProviderTestsetattributesinvalidview.json | 149 ++++++++ ...mProviderTestsetattributesioexception.json | 171 +++++++++ ...mProviderTestsetattributesmetadata[0].json | 248 +++++++++++++ ...mProviderTestsetattributesmetadata[1].json | 250 ++++++++++++++ ...mProviderTestsetattributesmetadata[2].json | 250 ++++++++++++++ ...ystemProviderTestsetattributestier[0].json | 245 +++++++++++++ ...ystemProviderTestsetattributestier[1].json | 245 +++++++++++++ 63 files changed, 11467 insertions(+), 38 deletions(-) create mode 100644 sdk/storage/azure-storage-blob-nio/src/main/java/com/azure/storage/blob/nio/AzureBasicFileAttributeView.java create mode 100644 sdk/storage/azure-storage-blob-nio/src/main/java/com/azure/storage/blob/nio/AzureBasicFileAttributes.java create mode 100644 sdk/storage/azure-storage-blob-nio/src/main/java/com/azure/storage/blob/nio/AzureBlobFileAttributeView.java create mode 100644 sdk/storage/azure-storage-blob-nio/src/main/java/com/azure/storage/blob/nio/AzureBlobFileAttributes.java delete mode 100644 sdk/storage/azure-storage-blob-nio/src/main/java/com/azure/storage/blob/nio/AzureStorageFileAttributeView.java create mode 100644 sdk/storage/azure-storage-blob-nio/src/test/java/com/azure/storage/blob/nio/AttributeViewTest.groovy create mode 100644 sdk/storage/azure-storage-blob-nio/src/test/resources/session-records/AttributeViewTestattributeviewsettimesunsupported[0].json create mode 100644 sdk/storage/azure-storage-blob-nio/src/test/resources/session-records/AttributeViewTestattributeviewsettimesunsupported[1].json create mode 100644 sdk/storage/azure-storage-blob-nio/src/test/resources/session-records/AttributeViewTestattributeviewsettimesunsupported[2].json create mode 100644 sdk/storage/azure-storage-blob-nio/src/test/resources/session-records/AttributeViewTestazurebasicfileattributeviewdirectory.json create mode 100644 sdk/storage/azure-storage-blob-nio/src/test/resources/session-records/AttributeViewTestazurebasicfileattributeviewreadattributes.json create mode 100644 sdk/storage/azure-storage-blob-nio/src/test/resources/session-records/AttributeViewTestazureblobfileattributeviewreadattributes.json create mode 100644 sdk/storage/azure-storage-blob-nio/src/test/resources/session-records/AttributeViewTestazureblobfileattributeviewsetblobhttpheaders[0].json create mode 100644 sdk/storage/azure-storage-blob-nio/src/test/resources/session-records/AttributeViewTestazureblobfileattributeviewsetblobhttpheaders[1].json create mode 100644 sdk/storage/azure-storage-blob-nio/src/test/resources/session-records/AttributeViewTestazureblobfileattributeviewsetmetadata[0].json create mode 100644 sdk/storage/azure-storage-blob-nio/src/test/resources/session-records/AttributeViewTestazureblobfileattributeviewsetmetadata[1].json create mode 100644 sdk/storage/azure-storage-blob-nio/src/test/resources/session-records/AttributeViewTestazureblobfileattributeviewsetmetadata[2].json create mode 100644 sdk/storage/azure-storage-blob-nio/src/test/resources/session-records/AttributeViewTestazureblobfileattributeviewsettier[0].json create mode 100644 sdk/storage/azure-storage-blob-nio/src/test/resources/session-records/AttributeViewTestazureblobfileattributeviewsettier[1].json create mode 100644 sdk/storage/azure-storage-blob-nio/src/test/resources/session-records/AzureFileSystemProviderTestgetattributeview[0].json create mode 100644 sdk/storage/azure-storage-blob-nio/src/test/resources/session-records/AzureFileSystemProviderTestgetattributeview[1].json create mode 100644 sdk/storage/azure-storage-blob-nio/src/test/resources/session-records/AzureFileSystemProviderTestgetattributeview[2].json create mode 100644 sdk/storage/azure-storage-blob-nio/src/test/resources/session-records/AzureFileSystemProviderTestgetattributeviewfail.json create mode 100644 sdk/storage/azure-storage-blob-nio/src/test/resources/session-records/AzureFileSystemProviderTestreadattributes[0].json create mode 100644 sdk/storage/azure-storage-blob-nio/src/test/resources/session-records/AzureFileSystemProviderTestreadattributes[1].json create mode 100644 sdk/storage/azure-storage-blob-nio/src/test/resources/session-records/AzureFileSystemProviderTestreadattributes[2].json create mode 100644 sdk/storage/azure-storage-blob-nio/src/test/resources/session-records/AzureFileSystemProviderTestreadattributesdirectory.json create mode 100644 sdk/storage/azure-storage-blob-nio/src/test/resources/session-records/AzureFileSystemProviderTestreadattributesioexception.json create mode 100644 sdk/storage/azure-storage-blob-nio/src/test/resources/session-records/AzureFileSystemProviderTestreadattributesstrdirectory.json create mode 100644 sdk/storage/azure-storage-blob-nio/src/test/resources/session-records/AzureFileSystemProviderTestreadattributesstria[0].json create mode 100644 sdk/storage/azure-storage-blob-nio/src/test/resources/session-records/AzureFileSystemProviderTestreadattributesstria[1].json create mode 100644 sdk/storage/azure-storage-blob-nio/src/test/resources/session-records/AzureFileSystemProviderTestreadattributesstria[2].json create mode 100644 sdk/storage/azure-storage-blob-nio/src/test/resources/session-records/AzureFileSystemProviderTestreadattributesstrinvalidview.json create mode 100644 sdk/storage/azure-storage-blob-nio/src/test/resources/session-records/AzureFileSystemProviderTestreadattributesstrioexception.json create mode 100644 sdk/storage/azure-storage-blob-nio/src/test/resources/session-records/AzureFileSystemProviderTestreadattributesstrparsing[0].json create mode 100644 sdk/storage/azure-storage-blob-nio/src/test/resources/session-records/AzureFileSystemProviderTestreadattributesstrparsing[1].json create mode 100644 sdk/storage/azure-storage-blob-nio/src/test/resources/session-records/AzureFileSystemProviderTestreadattributesstrparsing[2].json create mode 100644 sdk/storage/azure-storage-blob-nio/src/test/resources/session-records/AzureFileSystemProviderTestreadattributesstrparsing[3].json create mode 100644 sdk/storage/azure-storage-blob-nio/src/test/resources/session-records/AzureFileSystemProviderTestreadattributesstrparsing[4].json create mode 100644 sdk/storage/azure-storage-blob-nio/src/test/resources/session-records/AzureFileSystemProviderTestreadattributesstrparsing[5].json create mode 100644 sdk/storage/azure-storage-blob-nio/src/test/resources/session-records/AzureFileSystemProviderTestreadattributesstrparsing[6].json create mode 100644 sdk/storage/azure-storage-blob-nio/src/test/resources/session-records/AzureFileSystemProviderTestreadattributesstrparsing[7].json create mode 100644 sdk/storage/azure-storage-blob-nio/src/test/resources/session-records/AzureFileSystemProviderTestreadattributesunsupported.json create mode 100644 sdk/storage/azure-storage-blob-nio/src/test/resources/session-records/AzureFileSystemProviderTestsetattributesdirectory.json create mode 100644 sdk/storage/azure-storage-blob-nio/src/test/resources/session-records/AzureFileSystemProviderTestsetattributesheaders[0].json create mode 100644 sdk/storage/azure-storage-blob-nio/src/test/resources/session-records/AzureFileSystemProviderTestsetattributesheaders[1].json create mode 100644 sdk/storage/azure-storage-blob-nio/src/test/resources/session-records/AzureFileSystemProviderTestsetattributesia[0].json create mode 100644 sdk/storage/azure-storage-blob-nio/src/test/resources/session-records/AzureFileSystemProviderTestsetattributesia[1].json create mode 100644 sdk/storage/azure-storage-blob-nio/src/test/resources/session-records/AzureFileSystemProviderTestsetattributesia[2].json create mode 100644 sdk/storage/azure-storage-blob-nio/src/test/resources/session-records/AzureFileSystemProviderTestsetattributesinvalidview.json create mode 100644 sdk/storage/azure-storage-blob-nio/src/test/resources/session-records/AzureFileSystemProviderTestsetattributesioexception.json create mode 100644 sdk/storage/azure-storage-blob-nio/src/test/resources/session-records/AzureFileSystemProviderTestsetattributesmetadata[0].json create mode 100644 sdk/storage/azure-storage-blob-nio/src/test/resources/session-records/AzureFileSystemProviderTestsetattributesmetadata[1].json create mode 100644 sdk/storage/azure-storage-blob-nio/src/test/resources/session-records/AzureFileSystemProviderTestsetattributesmetadata[2].json create mode 100644 sdk/storage/azure-storage-blob-nio/src/test/resources/session-records/AzureFileSystemProviderTestsetattributestier[0].json create mode 100644 sdk/storage/azure-storage-blob-nio/src/test/resources/session-records/AzureFileSystemProviderTestsetattributestier[1].json diff --git a/sdk/storage/azure-storage-blob-nio/src/main/java/com/azure/storage/blob/nio/AzureBasicFileAttributeView.java b/sdk/storage/azure-storage-blob-nio/src/main/java/com/azure/storage/blob/nio/AzureBasicFileAttributeView.java new file mode 100644 index 0000000000000..4a0766ac42849 --- /dev/null +++ b/sdk/storage/azure-storage-blob-nio/src/main/java/com/azure/storage/blob/nio/AzureBasicFileAttributeView.java @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.storage.blob.nio; + +import java.io.IOException; +import java.nio.file.Path; +import java.nio.file.attribute.BasicFileAttributeView; +import java.nio.file.attribute.FileTime; + +/** + * Provides support for basic file attributes. + * + * The operations supported by this view and the attributes it reads are a strict subset of + * {@link AzureBlobFileAttributeView} and has the same network behavior. Therefore, while this type is offered for + * compliance with the NIO spec, {@link AzureBlobFileAttributeView} is generally preferred. + * + * {@link #setTimes(FileTime, FileTime, FileTime)} is not supported. + * + * {@inheritDoc} + */ +public final class AzureBasicFileAttributeView implements BasicFileAttributeView { + + private final Path path; + + AzureBasicFileAttributeView(Path path) { + this.path = path; + } + + /** + * Returns {@code "azureBasic"} + * {@inheritDoc} + */ + @Override + public String name() { + return "azureBasic"; + } + + /** + * {@inheritDoc} + */ + @Override + public AzureBasicFileAttributes readAttributes() throws IOException { + return new AzureBasicFileAttributes(path); + } + + /** + * Unsupported. + * + * @throws UnsupportedOperationException Operation not supported. + * {@inheritDoc} + */ + @Override + public void setTimes(FileTime lastModifiedTime, FileTime lastAccessTime, FileTime createTime) throws IOException { + throw new UnsupportedOperationException(); + } +} diff --git a/sdk/storage/azure-storage-blob-nio/src/main/java/com/azure/storage/blob/nio/AzureBasicFileAttributes.java b/sdk/storage/azure-storage-blob-nio/src/main/java/com/azure/storage/blob/nio/AzureBasicFileAttributes.java new file mode 100644 index 0000000000000..b6c2d555a0908 --- /dev/null +++ b/sdk/storage/azure-storage-blob-nio/src/main/java/com/azure/storage/blob/nio/AzureBasicFileAttributes.java @@ -0,0 +1,143 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.storage.blob.nio; + +import com.azure.core.util.logging.ClientLogger; +import com.azure.storage.blob.models.BlobProperties; +import com.azure.storage.blob.models.BlobStorageException; + +import java.io.IOException; +import java.nio.file.Path; +import java.nio.file.attribute.BasicFileAttributes; +import java.nio.file.attribute.FileAttribute; +import java.nio.file.attribute.FileTime; +import java.util.Collections; +import java.util.HashSet; +import java.util.Set; + +/** + * Provides support for basic file attributes. + *

+ * The properties available on this type are a strict subset of {@link AzureBlobFileAttributes}, and the two types have + * the same network behavior. Therefore, while this type is offered for compliance with the NIO spec, + * {@link AzureBlobFileAttributes} is generally preferred. + *

+ * Some attributes are not supported. Refer to the javadocs on each method for more information. + * {@inheritDoc} + */ +public class AzureBasicFileAttributes implements BasicFileAttributes { + private final ClientLogger logger = new ClientLogger(AzureBasicFileAttributes.class); + + // For verifying parameters on FileSystemProvider.readAttributes + static final Set ATTRIBUTE_STRINGS; + static { + Set set = new HashSet<>(); + set.add("lastModifiedTime"); + set.add("isRegularFile"); + set.add("isDirectory"); + set.add("isSymbolicLink"); + set.add("isOther"); + set.add("size"); + set.add("creationTime"); + ATTRIBUTE_STRINGS = Collections.unmodifiableSet(set); + } + + private final BlobProperties properties; + + /* + There are some work-arounds we could do to try to accommodate virtual directories such as making a checkDirStatus + call before or after getProperties to throw an appropriate error or adding an isVirtualDirectory method. However, + the former wastes network time only to throw a slightly more specific error when we will throw on 404 anyway. The + latter introduces virtual directories into the actual code path/api surface. While we are clear in our docs about + the possible pitfalls of virtual directories, and customers should be aware of it, they shouldn't have to code + against it. Therefore, we fall back to documenting that reading attributes on a virtual directory will throw. + */ + AzureBasicFileAttributes(Path path) throws IOException { + try { + this.properties = new AzureResource(path).getBlobClient().getProperties(); + } catch (BlobStorageException e) { + throw LoggingUtility.logError(logger, new IOException(e)); + } + } + + /** + * {@inheritDoc} + */ + @Override + public FileTime lastModifiedTime() { + return FileTime.from(properties.getLastModified().toInstant()); + } + + /** + * Unsupported. + * @throws UnsupportedOperationException Operation not supported. + * {@inheritDoc} + */ + @Override + public FileTime lastAccessTime() { + throw new UnsupportedOperationException(); + } + + /** + * {@inheritDoc} + */ + @Override + public FileTime creationTime() { + return FileTime.from(properties.getCreationTime().toInstant()); + } + + /** + * {@inheritDoc} + */ + @Override + public boolean isRegularFile() { + return !this.properties.getMetadata().getOrDefault(AzureResource.DIR_METADATA_MARKER, "false").equals("true"); + } + + /** + * {@inheritDoc} + *

+ * Will only return true if the directory is a concrete directory. See + * {@link AzureFileSystemProvider#createDirectory(Path, FileAttribute[])} for more information on virtual and + * concrete directories. + */ + @Override + public boolean isDirectory() { + return !this.isRegularFile(); + } + + /** + * @return false. Symbolic links are not supported. + */ + @Override + public boolean isSymbolicLink() { + return false; + } + + /** + * @return false + */ + @Override + public boolean isOther() { + return false; + } + + /** + * {@inheritDoc} + */ + @Override + public long size() { + return properties.getBlobSize(); + } + + /** + * Unsupported. + * @throws UnsupportedOperationException Operation not supported. + * {@inheritDoc} + */ + @Override + public Object fileKey() { + throw new UnsupportedOperationException(); + } +} diff --git a/sdk/storage/azure-storage-blob-nio/src/main/java/com/azure/storage/blob/nio/AzureBlobFileAttributeView.java b/sdk/storage/azure-storage-blob-nio/src/main/java/com/azure/storage/blob/nio/AzureBlobFileAttributeView.java new file mode 100644 index 0000000000000..2761c54830b6e --- /dev/null +++ b/sdk/storage/azure-storage-blob-nio/src/main/java/com/azure/storage/blob/nio/AzureBlobFileAttributeView.java @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.storage.blob.nio; + +import com.azure.core.util.logging.ClientLogger; +import com.azure.storage.blob.models.AccessTier; +import com.azure.storage.blob.models.BlobHttpHeaders; +import com.azure.storage.blob.models.BlobStorageException; +import com.azure.storage.blob.specialized.BlobClientBase; + +import java.io.IOException; +import java.io.UncheckedIOException; +import java.nio.file.Path; +import java.nio.file.attribute.BasicFileAttributeView; +import java.nio.file.attribute.FileTime; +import java.util.HashMap; +import java.util.Map; +import java.util.function.Consumer; + +/** + * A file attribute view that provides a view of attributes specific to files stored as blobs in Azure Storage. + *

+ * All attributes are retrieved from the file system as a bulk operation. + *

+ * {@link #setTimes(FileTime, FileTime, FileTime)} is not supported. + */ +public final class AzureBlobFileAttributeView implements BasicFileAttributeView { + private final ClientLogger logger = new ClientLogger(AzureBlobFileAttributeView.class); + + static final String ATTR_CONSUMER_ERROR = "Exception thrown by attribute consumer"; + + private final Path path; + + AzureBlobFileAttributeView(Path path) { + this.path = path; + } + + @SuppressWarnings("unchecked") + static Map> setAttributeConsumers(AzureBlobFileAttributeView view) { + Map> map = new HashMap<>(); + map.put("blobHttpHeaders", obj -> { + try { + view.setBlobHttpHeaders((BlobHttpHeaders) obj); + } catch (IOException e) { + throw LoggingUtility.logError(view.logger, new UncheckedIOException(ATTR_CONSUMER_ERROR, e)); + } + }); + map.put("metadata", obj -> { + try { + Map m = (Map) obj; + if (m == null) { + throw LoggingUtility.logError(view.logger, new ClassCastException()); + } + view.setMetadata(m); + } catch (IOException e) { + throw LoggingUtility.logError(view.logger, new UncheckedIOException(ATTR_CONSUMER_ERROR, e)); + } + }); + map.put("tier", obj -> { + try { + view.setTier((AccessTier) obj); + } catch (IOException e) { + throw LoggingUtility.logError(view.logger, new UncheckedIOException(ATTR_CONSUMER_ERROR, e)); + } + }); + + return map; + } + + /** + * Returns "azureBlob". + * {@inheritDoc} + */ + @Override + public String name() { + return "azureBlob"; + } + + /** + * Reads the file attributes as a bulk operation. + * + * Gets a fresh copy every time it is called. + * @return {@link AzureBlobFileAttributes} + * @throws IOException if an IOException occurs. + */ + @Override + public AzureBlobFileAttributes readAttributes() throws IOException { + return new AzureBlobFileAttributes(path); + } + + /** + * Sets the {@link BlobHttpHeaders} as an atomic operation. + *

+ * See {@link BlobClientBase#setHttpHeaders(BlobHttpHeaders)} for more information. + * @param headers {@link BlobHttpHeaders} + * @throws IOException if an IOException occurs. + */ + public void setBlobHttpHeaders(BlobHttpHeaders headers) throws IOException { + try { + new AzureResource(this.path).getBlobClient().setHttpHeaders(headers); + } catch (BlobStorageException e) { + throw LoggingUtility.logError(logger, new IOException(e)); + } + } + + /** + * Sets the metadata as an atomic operation. + *

+ * See {@link BlobClientBase#setMetadata(Map)} for more information. + * @param metadata The metadata to associate with the blob + * @throws IOException if an IOException occurs. + */ + public void setMetadata(Map metadata) throws IOException { + try { + new AzureResource(this.path).getBlobClient().setMetadata(metadata); + } catch (BlobStorageException e) { + throw LoggingUtility.logError(logger, new IOException(e)); + } + } + + /** + * Sets the {@link AccessTier} on the file. + * + * See {@link BlobClientBase#setAccessTier(AccessTier)} for more information. + * @param tier {@link AccessTier} + * @throws IOException if an IOException occurs. + */ + public void setTier(AccessTier tier) throws IOException { + try { + new AzureResource(this.path).getBlobClient().setAccessTier(tier); + } catch (BlobStorageException e) { + throw LoggingUtility.logError(logger, new IOException(e)); + } + } + + /** + * Unsupported. + * + * @throws UnsupportedOperationException Operation not supported. + * {@inheritDoc} + */ + @Override + public void setTimes(FileTime fileTime, FileTime fileTime1, FileTime fileTime2) throws IOException { + throw new UnsupportedOperationException(); + } +} diff --git a/sdk/storage/azure-storage-blob-nio/src/main/java/com/azure/storage/blob/nio/AzureBlobFileAttributes.java b/sdk/storage/azure-storage-blob-nio/src/main/java/com/azure/storage/blob/nio/AzureBlobFileAttributes.java new file mode 100644 index 0000000000000..7c8c25b7fe531 --- /dev/null +++ b/sdk/storage/azure-storage-blob-nio/src/main/java/com/azure/storage/blob/nio/AzureBlobFileAttributes.java @@ -0,0 +1,292 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.storage.blob.nio; + +import com.azure.core.util.logging.ClientLogger; +import com.azure.storage.blob.models.AccessTier; +import com.azure.storage.blob.models.ArchiveStatus; +import com.azure.storage.blob.models.BlobHttpHeaders; +import com.azure.storage.blob.models.BlobProperties; +import com.azure.storage.blob.models.BlobStorageException; +import com.azure.storage.blob.models.BlobType; +import com.azure.storage.blob.models.CopyStatusType; + +import java.io.IOException; +import java.nio.file.Path; +import java.nio.file.attribute.BasicFileAttributes; +import java.nio.file.attribute.FileAttribute; +import java.nio.file.attribute.FileTime; +import java.time.OffsetDateTime; +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; +import java.util.function.Supplier; + +/** + * File attributes associated with a file stored as a blob in Azure Storage. + *

+ * Some of the attributes inherited from {@link BasicFileAttributes} are not supported. See the docs on each method for + * more information. + */ +public final class AzureBlobFileAttributes implements BasicFileAttributes { + /* + Some blob properties do not have getters as they do not make sense in the context of nio. These properties are: + - incremental snapshot related properties + - lease related properties + - sequence number + - encryption key sha256 + */ + + private final ClientLogger logger = new ClientLogger(AzureBlobFileAttributes.class); + + private final BlobProperties properties; + + AzureBlobFileAttributes(Path path) throws IOException { + try { + this.properties = new AzureResource(path).getBlobClient().getProperties(); + } catch (BlobStorageException e) { + throw LoggingUtility.logError(logger, new IOException("Path: " + path.toString(), e)); + } + } + + static Map> getAttributeSuppliers(AzureBlobFileAttributes attributes) { + Map> map = new HashMap<>(); + map.put("creationTime", attributes::creationTime); + map.put("lastModifiedTime", attributes::lastModifiedTime); + map.put("eTag", attributes::eTag); + map.put("blobHttpHeaders", attributes::blobHttpHeaders); + map.put("blobType", attributes::blobType); + map.put("copyId", attributes::copyId); + map.put("copyStatus", attributes::copyStatus); + map.put("copySource", attributes::copySource); + map.put("copyProgress", attributes::copyProgress); + map.put("copyCompletionTime", attributes::copyCompletionTime); + map.put("copyStatusDescription", attributes::copyStatusDescription); + map.put("isServerEncrypted", attributes::isServerEncrypted); + map.put("accessTier", attributes::accessTier); + map.put("isAccessTierInferred", attributes::isAccessTierInferred); + map.put("archiveStatus", attributes::archiveStatus); + map.put("accessTierChangeTime", attributes::accessTierChangeTime); + map.put("metadata", attributes::metadata); + map.put("committedBlockCount", attributes::committedBlockCount); + map.put("isRegularFile", attributes::isRegularFile); + map.put("isDirectory", attributes::isDirectory); + map.put("isSymbolicLink", attributes::isSymbolicLink); + map.put("isOther", attributes::isOther); + map.put("size", attributes::size); + return map; + } + + /** + * {@inheritDoc} + */ + @Override + public FileTime creationTime() { + return FileTime.from(this.properties.getCreationTime().toInstant()); + } + + /** + * {@inheritDoc} + */ + @Override + public FileTime lastModifiedTime() { + return FileTime.from(this.properties.getLastModified().toInstant()); + } + + /** + * @return the eTag of the blob + */ + public String eTag() { + return this.properties.getETag(); + } + + /** + * @return {@link BlobHttpHeaders} + */ + public BlobHttpHeaders blobHttpHeaders() { + /* + We return these all as one value so it's consistent with the way of setting, especially the setAttribute method + that accepts a string argument for the name of the property. Returning them individually would mean we have to + support setting them individually as well, which is not possible due to service constraints. + */ + return new BlobHttpHeaders() + .setContentType(this.properties.getContentType()) + .setContentLanguage(this.properties.getContentLanguage()) + .setContentMd5(this.properties.getContentMd5()) + .setContentDisposition(this.properties.getContentDisposition()) + .setContentEncoding(this.properties.getContentEncoding()) + .setCacheControl(this.properties.getCacheControl()); + } + + /** + * @return the type of the blob + */ + public BlobType blobType() { + return this.properties.getBlobType(); + } + + /** + * @return the identifier of the last copy operation. If this blob hasn't been the target of a copy operation or has + * been modified since this won't be set. + */ + public String copyId() { + return this.properties.getCopyId(); + } + + /** + * @return the status of the last copy operation. If this blob hasn't been the target of a copy operation or has + * been modified since this won't be set. + */ + public CopyStatusType copyStatus() { + return this.properties.getCopyStatus(); + } + + /** + * @return the source blob URL from the last copy operation. If this blob hasn't been the target of a copy operation + * or has been modified since this won't be set. + */ + public String copySource() { + return this.properties.getCopySource(); + } + + /** + * @return the number of bytes copied and total bytes in the source from the last copy operation (bytes copied/total + * bytes). If this blob hasn't been the target of a copy operation or has been modified since this won't be set. + */ + public String copyProgress() { + return this.properties.getCopyProgress(); + } + + /** + * @return the completion time of the last copy operation. If this blob hasn't been the target of a copy operation + * or has been modified since this won't be set. + */ + public OffsetDateTime copyCompletionTime() { + return this.properties.getCopyCompletionTime(); + } + + /** + * @return the description of the last copy failure, this is set when the {@link #copyStatus() getCopyStatus} is + * {@link CopyStatusType#FAILED failed} or {@link CopyStatusType#ABORTED aborted}. If this blob hasn't been the + * target of a copy operation or has been modified since this won't be set. + */ + public String copyStatusDescription() { + return this.properties.getCopyStatusDescription(); + } + + /** + * @return the status of the blob being encrypted on the server + */ + public Boolean isServerEncrypted() { + return this.properties.isServerEncrypted(); + } + + /** + * @return the tier of the blob. This is only set for Page blobs on a premium storage account or for Block blobs on + * blob storage or general purpose V2 account. + */ + public AccessTier accessTier() { + return this.properties.getAccessTier(); + } + + /** + * @return the status of the tier being inferred for the blob. This is only set for Page blobs on a premium storage + * account or for Block blobs on blob storage or general purpose V2 account. + */ + public Boolean isAccessTierInferred() { + return this.properties.isAccessTierInferred(); + } + + /** + * @return the archive status of the blob. This is only for blobs on a blob storage and general purpose v2 account. + */ + public ArchiveStatus archiveStatus() { + return this.properties.getArchiveStatus(); + } + + /** + * @return the time when the access tier for the blob was last changed + */ + public OffsetDateTime accessTierChangeTime() { + return this.properties.getAccessTierChangeTime(); + } + + /** + * @return the metadata associated with this blob + */ + public Map metadata() { + return Collections.unmodifiableMap(this.properties.getMetadata()); + } + + /** + * @return the number of committed blocks in the blob. This is only returned for Append blobs. + */ + public Integer committedBlockCount() { + return this.properties.getCommittedBlockCount(); + } + + /** + * Unsupported. + * @throws UnsupportedOperationException Operation not supported. + * {@inheritDoc} + */ + @Override + public FileTime lastAccessTime() { + throw new UnsupportedOperationException(); + } + + /** + * {@inheritDoc} + */ + @Override + public boolean isRegularFile() { + return !this.properties.getMetadata().getOrDefault(AzureResource.DIR_METADATA_MARKER, "false").equals("true"); + } + + /** + * {@inheritDoc} + *

+ * Will only return true if the directory is a concrete directory. See + * {@link AzureFileSystemProvider#createDirectory(Path, FileAttribute[])} for more information on virtual and + * concrete directories. + */ + @Override + public boolean isDirectory() { + return !this.isRegularFile(); + } + + /** + * @return false. Symbolic links are not supported. + */ + @Override + public boolean isSymbolicLink() { + return false; + } + + /** + * @return false + */ + @Override + public boolean isOther() { + return false; + } + + /** + * {@inheritDoc} + */ + @Override + public long size() { + return properties.getBlobSize(); + } + + /** + * Unsupported. + * @throws UnsupportedOperationException Operation not supported. + * {@inheritDoc} + */ + @Override + public Object fileKey() { + throw new UnsupportedOperationException(); + } +} diff --git a/sdk/storage/azure-storage-blob-nio/src/main/java/com/azure/storage/blob/nio/AzureFileStore.java b/sdk/storage/azure-storage-blob-nio/src/main/java/com/azure/storage/blob/nio/AzureFileStore.java index 85559e72f1dfe..bf5507446bef9 100644 --- a/sdk/storage/azure-storage-blob-nio/src/main/java/com/azure/storage/blob/nio/AzureFileStore.java +++ b/sdk/storage/azure-storage-blob-nio/src/main/java/com/azure/storage/blob/nio/AzureFileStore.java @@ -114,7 +114,7 @@ public long getUnallocatedSpace() throws IOException { *

    *
  • {@link java.nio.file.attribute.BasicFileAttributeView}
  • *
  • {@link java.nio.file.attribute.UserDefinedFileAttributeView}
  • - *
  • {@link AzureStorageFileAttributeView}
  • + *
  • {@link AzureBasicFileAttributeView}
  • *
* * {@inheritDoc} @@ -129,7 +129,7 @@ public boolean supportsFileAttributeView(Class aCla *
    *
  • {@link java.nio.file.attribute.BasicFileAttributeView}
  • *
  • {@link java.nio.file.attribute.UserDefinedFileAttributeView}
  • - *
  • {@link AzureStorageFileAttributeView}
  • + *
  • {@link AzureBasicFileAttributeView}
  • *
* * {@inheritDoc} diff --git a/sdk/storage/azure-storage-blob-nio/src/main/java/com/azure/storage/blob/nio/AzureFileSystem.java b/sdk/storage/azure-storage-blob-nio/src/main/java/com/azure/storage/blob/nio/AzureFileSystem.java index 9733383d2acf0..423264e135b5b 100644 --- a/sdk/storage/azure-storage-blob-nio/src/main/java/com/azure/storage/blob/nio/AzureFileSystem.java +++ b/sdk/storage/azure-storage-blob-nio/src/main/java/com/azure/storage/blob/nio/AzureFileSystem.java @@ -22,7 +22,6 @@ import java.nio.file.WatchService; import java.nio.file.attribute.BasicFileAttributeView; import java.nio.file.attribute.FileAttributeView; -import java.nio.file.attribute.UserDefinedFileAttributeView; import java.nio.file.attribute.UserPrincipalLookupService; import java.nio.file.spi.FileSystemProvider; @@ -129,8 +128,8 @@ public final class AzureFileSystem extends FileSystem { static { Map, String> map = new HashMap<>(); map.put(BasicFileAttributeView.class, "basic"); - map.put(UserDefinedFileAttributeView.class, "user"); - map.put(AzureStorageFileAttributeView.class, "azureStorage"); + map.put(AzureBasicFileAttributeView.class, "azureBasic"); + map.put(AzureBlobFileAttributeView.class, "azureBlob"); SUPPORTED_ATTRIBUTE_VIEWS = Collections.unmodifiableMap(map); } @@ -268,7 +267,7 @@ public Iterable getFileStores() { *
    *
  • {@link java.nio.file.attribute.BasicFileAttributeView}
  • *
  • {@link java.nio.file.attribute.UserDefinedFileAttributeView}
  • - *
  • {@link AzureStorageFileAttributeView}
  • + *
  • {@link AzureBasicFileAttributeView}
  • *
* * {@inheritDoc} diff --git a/sdk/storage/azure-storage-blob-nio/src/main/java/com/azure/storage/blob/nio/AzureFileSystemProvider.java b/sdk/storage/azure-storage-blob-nio/src/main/java/com/azure/storage/blob/nio/AzureFileSystemProvider.java index 25c5bd2b72d0a..4be316c90c830 100644 --- a/sdk/storage/azure-storage-blob-nio/src/main/java/com/azure/storage/blob/nio/AzureFileSystemProvider.java +++ b/sdk/storage/azure-storage-blob-nio/src/main/java/com/azure/storage/blob/nio/AzureFileSystemProvider.java @@ -17,6 +17,7 @@ import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; +import java.io.UncheckedIOException; import java.net.HttpURLConnection; import java.net.URI; import java.nio.channels.SeekableByteChannel; @@ -35,6 +36,7 @@ import java.nio.file.OpenOption; import java.nio.file.Path; import java.nio.file.StandardCopyOption; +import java.nio.file.attribute.BasicFileAttributeView; import java.nio.file.StandardOpenOption; import java.nio.file.attribute.BasicFileAttributes; import java.nio.file.attribute.FileAttribute; @@ -43,11 +45,14 @@ import java.time.Duration; import java.util.ArrayList; import java.util.Arrays; +import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Set; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentMap; +import java.util.function.Consumer; +import java.util.function.Supplier; /** * The {@code AzureFileSystemProvider} is Azure Storage's implementation of the nio interface on top of Azure Blob @@ -646,36 +651,226 @@ public void checkAccess(Path path, AccessMode... accessModes) throws IOException } /** + * Returns a file attribute view of a given type. + * + * See {@link AzureBasicFileAttributeView} and {@link AzureBlobFileAttributeView} for more information. + * + * Reading or setting attributes on a virtual directory is not supported and will throw an {@link IOException}. See + * {@link #createDirectory(Path, FileAttribute[])} for more information on virtual directories. * {@inheritDoc} */ @Override + @SuppressWarnings("unchecked") public V getFileAttributeView(Path path, Class aClass, LinkOption... linkOptions) { - return null; + /* + No resource validation is necessary here. That can happen at the time of making a network requests internal to + the view object. + */ + if (aClass == BasicFileAttributeView.class || aClass == AzureBasicFileAttributeView.class) { + return (V) new AzureBasicFileAttributeView(path); + } else if (aClass == AzureBlobFileAttributeView.class) { + return (V) new AzureBlobFileAttributeView(path); + } else { + return null; + } } /** + * Reads a file's attributes as a bulk operation. + * + * See {@link AzureBasicFileAttributes} and {@link AzureBlobFileAttributes} for more information. + * + * Reading attributes on a virtual directory is not supported and will throw an {@link IOException}. See + * {@link #createDirectory(Path, FileAttribute[])} for more information on virtual directories. * {@inheritDoc} */ @Override + @SuppressWarnings("unchecked") public A readAttributes(Path path, Class aClass, LinkOption... linkOptions) throws IOException { - return null; + Class view; + if (aClass == BasicFileAttributes.class || aClass == AzureBasicFileAttributes.class) { + view = AzureBasicFileAttributeView.class; + } else if (aClass == AzureBlobFileAttributes.class) { + view = AzureBlobFileAttributeView.class; + } else { + throw new UnsupportedOperationException(); + } + + /* + Resource validation will happen in readAttributes of the view. We don't want to double check, and checking + internal to the view ensures it is always checked no matter which code path is taken. + */ + return (A) getFileAttributeView(path, view, linkOptions).readAttributes(); } /** + * Reads a set of file attributes as a bulk operation. + * + * See {@link AzureBasicFileAttributes} and {@link AzureBlobFileAttributes} for more information. + * + * Reading attributes on a virtual directory is not supported and will throw an {@link IOException}. See + * {@link #createDirectory(Path, FileAttribute[])} for more information on virtual directories. * {@inheritDoc} */ @Override public Map readAttributes(Path path, String s, LinkOption... linkOptions) throws IOException { - return null; + if (s == null) { + throw LoggingUtility.logError(logger, new IllegalArgumentException("Attribute string cannot be null.")); + } + + Map results = new HashMap<>(); + + /* + AzureBlobFileAttributes can do everything the basic attributes can do and more. There's no need to instantiate + one of each if both are specified somewhere in the list as that will waste a network call. This can be + generified later if we need to add more attribute types, but for now we can stick to just caching the supplier + for a single attributes object. + */ + Map> attributeSuppliers = null; // Initialized later as needed. + String viewType; + String attributeList; + String[] parts = s.split(":"); + + if (parts.length > 2) { + throw LoggingUtility.logError(logger, + new IllegalArgumentException("Invalid format for attribute string: " + s)); + } + + if (parts.length == 1) { + viewType = "basic"; // Per jdk docs. + attributeList = s; + } else { + viewType = parts[0]; + attributeList = parts[1]; + } + + /* + For specificity, our basic implementation of BasicFileAttributes uses the name azureBasic. However, the docs + state that "basic" must be supported, so we funnel to azureBasic. + */ + if (viewType.equals("basic")) { + viewType = "azureBasic"; + } + if (!viewType.equals("azureBasic") && !viewType.equals("azureBlob")) { + throw LoggingUtility.logError(logger, + new UnsupportedOperationException("Invalid attribute view: " + viewType)); + } + + for (String attributeName : attributeList.split(",")) { + /* + We rely on the azureBlobFAV to actually do the work here as mentioned above, but if basic is specified, we + should at least validate that the attribute is available on a basic view. + */ + // TODO: Put these strings in constants + if (viewType.equals("azureBasic")) { + if (!AzureBasicFileAttributes.ATTRIBUTE_STRINGS.contains(attributeName) && !attributeName.equals("*")) { + throw LoggingUtility.logError(logger, + new IllegalArgumentException("Invalid attribute. View: " + viewType + + ". Attribute: " + attributeName)); + } + } + + // As mentioned, azure blob can fulfill requests to both kinds of views. + // Populate the supplier if we haven't already. + if (attributeSuppliers == null) { + attributeSuppliers = AzureBlobFileAttributes.getAttributeSuppliers( + this.readAttributes(path, AzureBlobFileAttributes.class, linkOptions)); + } + + // If "*" is specified, add all of the attributes from the specified set. + if (attributeName.equals("*")) { + Set attributesToAdd; + if (viewType.equals("azureBasic")) { + for (String attr : AzureBasicFileAttributes.ATTRIBUTE_STRINGS) { + results.put(attr, attributeSuppliers.get(attr).get()); + } + } else { + // attributeSuppliers is guaranteed to have been set by this point. + for (Map.Entry> entry: attributeSuppliers.entrySet()) { + results.put(entry.getKey(), entry.getValue().get()); + } + } + + } else if (!attributeSuppliers.containsKey(attributeName)) { + // Validate that the attribute is legal and add the value returned by the supplier to the results. + throw LoggingUtility.logError(logger, + new IllegalArgumentException("Invalid attribute. View: " + viewType + + ". Attribute: " + attributeName)); + } else { + results.put(attributeName, attributeSuppliers.get(attributeName).get()); + + } + } + + // Throw if nothing specified per jdk docs. + if (results.isEmpty()) { + throw LoggingUtility.logError(logger, + new IllegalArgumentException("No attributes were specified. Attributes: " + s)); + } + + return results; } /** + * Sets the value of a file attribute. + * + * See {@link AzureBlobFileAttributeView} for more information. + * + * Setting attributes on a virtual directory is not supported and will throw an {@link IOException}. See + * {@link #createDirectory(Path, FileAttribute[])} for more information on virtual directories. * {@inheritDoc} */ @Override public void setAttribute(Path path, String s, Object o, LinkOption... linkOptions) throws IOException { + String viewType; + String attributeName; + String[] parts = s.split(":"); + if (parts.length > 2) { + throw LoggingUtility.logError(logger, + new IllegalArgumentException("Invalid format for attribute string: " + s)); + } + if (parts.length == 1) { + viewType = "basic"; // Per jdk docs. + attributeName = s; + } else { + viewType = parts[0]; + attributeName = parts[1]; + } + + /* + For specificity, our basic implementation of BasicFileAttributes uses the name azureBasic. However, the docs + state that "basic" must be supported, so we funnel to azureBasic. + */ + if (viewType.equals("basic")) { + viewType = "azureBasic"; + } + // We don't actually support any setters on the basic view. + if (viewType.equals("azureBasic")) { + throw LoggingUtility.logError(logger, + new IllegalArgumentException("Invalid attribute. View: " + viewType + + ". Attribute: " + attributeName)); + } else if (viewType.equals("azureBlob")) { + Map> attributeConsumers = AzureBlobFileAttributeView.setAttributeConsumers( + this.getFileAttributeView(path, AzureBlobFileAttributeView.class, linkOptions)); + if (!attributeConsumers.containsKey(attributeName)) { + // Validate that the attribute is legal and add the value returned by the supplier to the results. + throw LoggingUtility.logError(logger, + new IllegalArgumentException("Invalid attribute. View: " + viewType + + ". Attribute: " + attributeName)); + } + try { + attributeConsumers.get(attributeName).accept(o); + } catch (UncheckedIOException e) { + if (e.getMessage().equals(AzureBlobFileAttributeView.ATTR_CONSUMER_ERROR)) { + throw LoggingUtility.logError(logger, e.getCause()); + } + } + } else { + throw LoggingUtility.logError(logger, + new UnsupportedOperationException("Invalid attribute view: " + viewType)); + } } void closeFileSystem(String fileSystemName) { diff --git a/sdk/storage/azure-storage-blob-nio/src/main/java/com/azure/storage/blob/nio/AzureResource.java b/sdk/storage/azure-storage-blob-nio/src/main/java/com/azure/storage/blob/nio/AzureResource.java index 2765cba8c365f..e9f3595bee0d8 100644 --- a/sdk/storage/azure-storage-blob-nio/src/main/java/com/azure/storage/blob/nio/AzureResource.java +++ b/sdk/storage/azure-storage-blob-nio/src/main/java/com/azure/storage/blob/nio/AzureResource.java @@ -69,7 +69,7 @@ If the parent is just the root (or null, which means the parent is implicitly th */ Path parent = this.path.getParent(); return (parent == null || parent.equals(path.getRoot())) - || new AzureResource((AzurePath) this.path.getParent()).checkDirectoryExists(); + || new AzureResource(this.path.getParent()).checkDirectoryExists(); } /** diff --git a/sdk/storage/azure-storage-blob-nio/src/main/java/com/azure/storage/blob/nio/AzureStorageFileAttributeView.java b/sdk/storage/azure-storage-blob-nio/src/main/java/com/azure/storage/blob/nio/AzureStorageFileAttributeView.java deleted file mode 100644 index 39e529884761f..0000000000000 --- a/sdk/storage/azure-storage-blob-nio/src/main/java/com/azure/storage/blob/nio/AzureStorageFileAttributeView.java +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.storage.blob.nio; - -import java.nio.file.attribute.FileAttributeView; - -/** - * Provides support for properties specific to Azure Blob Storage such as tier. - * - * {@inheritDoc} - */ -public class AzureStorageFileAttributeView implements FileAttributeView { - - /** - * Returns {@code "azureStorage"} - * {@inheritDoc} - */ - @Override - public String name() { - return "azureStorage"; - } -} diff --git a/sdk/storage/azure-storage-blob-nio/src/test/java/com/azure/storage/blob/nio/AttributeViewTest.groovy b/sdk/storage/azure-storage-blob-nio/src/test/java/com/azure/storage/blob/nio/AttributeViewTest.groovy new file mode 100644 index 0000000000000..1a9585a9378ee --- /dev/null +++ b/sdk/storage/azure-storage-blob-nio/src/test/java/com/azure/storage/blob/nio/AttributeViewTest.groovy @@ -0,0 +1,242 @@ +package com.azure.storage.blob.nio + +import com.azure.storage.blob.BlobClient +import com.azure.storage.blob.models.AccessTier +import com.azure.storage.blob.models.BlobHttpHeaders +import spock.lang.Unroll + +import java.nio.file.attribute.FileTime +import java.security.MessageDigest + +class AttributeViewTest extends APISpec { + /* + Get attributes--All properties set + */ + BlobClient bc + AzureFileSystem fs + + def setup() { + fs = createFS(initializeConfigMap()) + cc = rootNameToContainerClient(getDefaultDir(fs)) + bc = cc.getBlobClient(generateBlobName()) + bc.upload(defaultInputStream.get(), defaultDataSize) + } + + def cleanup() { + cc.delete() + } + + def "AzureBasicFileAttributeView readAttributes"() { + setup: + def path = fs.getPath(bc.getBlobName()) + + when: + def attr = new AzureBasicFileAttributeView(path).readAttributes() + def props = bc.getProperties() + + then: + props.getBlobSize() == attr.size() + FileTime.from(props.getLastModified().toInstant()) == attr.lastModifiedTime() + FileTime.from(props.getCreationTime().toInstant()) == attr.creationTime() + attr.isRegularFile() + !attr.isDirectory() + !attr.isSymbolicLink() + !attr.isOther() + } + + def "AzureBasicFileAttributeView directory"() { + setup: + def path = fs.getPath(generateBlobName()) + putDirectoryBlob(new AzureResource(path).getBlobClient().getBlockBlobClient()) + + when: + def attr = new AzureBasicFileAttributeView(path).readAttributes() + + then: + attr.isDirectory() + !attr.isRegularFile() + !attr.isOther() + !attr.isSymbolicLink() + } + + def "AzureBlobFileAttributeView readAttributes"() { + setup: + def path = fs.getPath(bc.getBlobName()) + + when: + def attr = new AzureBlobFileAttributeView(path).readAttributes() + def suppliers = AzureBlobFileAttributes.getAttributeSuppliers(attr) + def props = bc.getProperties() + + then: + // getters + props.getBlobSize() == attr.size() + FileTime.from(props.getLastModified().toInstant()) == attr.lastModifiedTime() + FileTime.from(props.getCreationTime().toInstant()) == attr.creationTime() + attr.isRegularFile() + !attr.isDirectory() + !attr.isSymbolicLink() + !attr.isOther() + props.getETag() == attr.eTag() + props.getContentType() == attr.blobHttpHeaders().getContentType() + props.getContentMd5() == attr.blobHttpHeaders().getContentMd5() + props.getContentLanguage() == attr.blobHttpHeaders().getContentLanguage() + props.getContentEncoding() == attr.blobHttpHeaders().getContentEncoding() + props.getContentDisposition() == attr.blobHttpHeaders().getContentDisposition() + props.getCacheControl() == attr.blobHttpHeaders().getCacheControl() + props.getBlobType() == attr.blobType() + props.getCopyId() == attr.copyId() + props.getCopyStatus() == attr.copyStatus() + props.getCopySource() == attr.copySource() + props.getCopyProgress() == attr.copyProgress() + props.getCopyCompletionTime() == attr.copyCompletionTime() + props.getCopyStatusDescription() == attr.copyStatusDescription() + props.isServerEncrypted() == attr.isServerEncrypted() + props.getAccessTier() == attr.accessTier() + props.isAccessTierInferred() == attr.isAccessTierInferred() + props.getArchiveStatus() == attr.archiveStatus() + props.getAccessTierChangeTime() == attr.accessTierChangeTime() + props.getMetadata() == attr.metadata() + props.getCommittedBlockCount() == attr.committedBlockCount() + + /* + suppliers. Used in FileSystemProvider.readAttributes(String) + Unlike the consumers used for setting properties, we test these here rather than + on the FileSystemProvider because there are so many of them and it is more feasible this way rather + than having a test for each method like the consumers. + */ + props.getBlobSize() == suppliers.get("size").get() + FileTime.from(props.getLastModified().toInstant()) == suppliers.get("lastModifiedTime").get() + FileTime.from(props.getCreationTime().toInstant()) == suppliers.get("creationTime").get() + attr.isRegularFile() + !attr.isDirectory() + !attr.isSymbolicLink() + !attr.isOther() + props.getETag() == suppliers.get("eTag").get() + props.getContentType() == ((BlobHttpHeaders) suppliers.get("blobHttpHeaders").get()).getContentType() + props.getContentMd5() == ((BlobHttpHeaders) suppliers.get("blobHttpHeaders").get()).getContentMd5() + props.getContentLanguage() == ((BlobHttpHeaders) suppliers.get("blobHttpHeaders").get()).getContentLanguage() + props.getContentEncoding() == ((BlobHttpHeaders) suppliers.get("blobHttpHeaders").get()).getContentEncoding() + props.getContentDisposition() == ((BlobHttpHeaders) suppliers.get("blobHttpHeaders").get()) + .getContentDisposition() + props.getCacheControl() == ((BlobHttpHeaders) suppliers.get("blobHttpHeaders").get()).getCacheControl() + props.getBlobType() == suppliers.get("blobType").get() + props.getCopyId() == suppliers.get("copyId").get() + props.getCopyStatus() == suppliers.get("copyStatus").get() + props.getCopySource() == suppliers.get("copySource").get() + props.getCopyProgress() == suppliers.get("copyProgress").get() + props.getCopyCompletionTime() == suppliers.get("copyCompletionTime").get() + props.getCopyStatusDescription() == suppliers.get("copyStatusDescription").get() + props.isServerEncrypted() == suppliers.get("isServerEncrypted").get() + props.getAccessTier() == suppliers.get("accessTier").get() + props.isAccessTierInferred() == suppliers.get("isAccessTierInferred").get() + props.getArchiveStatus() == suppliers.get("archiveStatus").get() + props.getAccessTierChangeTime() == suppliers.get("accessTierChangeTime").get() + props.getMetadata() == suppliers.get("metadata").get() + props.getCommittedBlockCount() == suppliers.get("committedBlockCount").get() + } + + @Unroll + def "AzureBlobFileAttributeView setBlobHttpHeaders"() { + setup: + def path = fs.getPath(bc.getBlobName()) + def view = new AzureBlobFileAttributeView(path) + def headers = new BlobHttpHeaders().setCacheControl(cacheControl) + .setContentDisposition(contentDisposition) + .setContentEncoding(contentEncoding) + .setContentLanguage(contentLanguage) + .setContentMd5(contentMD5) + .setContentType(contentType) + + when: + view.setBlobHttpHeaders(headers) + def response = bc.getProperties() + + then: + response.getCacheControl() == cacheControl + response.getContentDisposition() == contentDisposition + response.getContentEncoding() == contentEncoding + response.getContentLanguage() == contentLanguage + response.getContentMd5() == contentMD5 + response.getContentType() == contentType + + where: + cacheControl | contentDisposition | contentEncoding | contentLanguage | contentMD5 | contentType + null | null | null | null | null | null + "control" | "disposition" | "encoding" | "language" | Base64.getEncoder().encode(MessageDigest.getInstance("MD5").digest(defaultData.array())) | "type" + } + + @Unroll + def "AzureBlobFileAttributeView setMetadata"() { + setup: + def path = fs.getPath(bc.getBlobName()) + def view = new AzureBlobFileAttributeView(path) + def metadata = new HashMap() + if (key1 != null && value1 != null) { + metadata.put(key1, value1) + } + if (key2 != null && value2 != null) { + metadata.put(key2, value2) + } + + when: + view.setMetadata(metadata) + + then: + bc.getProperties().getMetadata() == metadata + + where: + key1 | value1 | key2 | value2 || statusCode + null | null | null | null || 200 + "foo" | "bar" | "fizz" | "buzz" || 200 + "i0" | "a" | "i_" | "a" || 200 /* Test culture sensitive word sort */ + } + + @Unroll + def "AzureBlobFileAttributeView setTier"() { + setup: + def path = fs.getPath(bc.getBlobName()) + def view = new AzureBlobFileAttributeView(path) + + when: + view.setTier(tier) + + then: + bc.getProperties().getAccessTier() == tier + + where: + tier | _ + AccessTier.HOT | _ + AccessTier.COOL | _ + /* + We don't test archive because it takes a while to take effect, and testing these two demonstrates that the tier + is successfully being passed to the underlying client. + */ + } + + @Unroll + def "AttributeView setTimes unsupported"() { + setup: + def path = fs.getPath(bc.getBlobName()) + def blobView = new AzureBlobFileAttributeView(path) + def basicView = new AzureBasicFileAttributeView(path) + + when: + blobView.setTimes(t1, t2, t3) + + then: + thrown(UnsupportedOperationException) + + when: + basicView.setTimes(t1, t2, t3) + + then: + thrown(UnsupportedOperationException) + + where: + t1 | t2 | t3 + FileTime.fromMillis(System.currentTimeMillis()) | null | null + null | FileTime.fromMillis(System.currentTimeMillis()) | null + null | null | FileTime.fromMillis(System.currentTimeMillis()) + } +} diff --git a/sdk/storage/azure-storage-blob-nio/src/test/java/com/azure/storage/blob/nio/AzureFileStoreTest.groovy b/sdk/storage/azure-storage-blob-nio/src/test/java/com/azure/storage/blob/nio/AzureFileStoreTest.groovy index 3f72f525cf379..e663fb006f944 100644 --- a/sdk/storage/azure-storage-blob-nio/src/test/java/com/azure/storage/blob/nio/AzureFileStoreTest.groovy +++ b/sdk/storage/azure-storage-blob-nio/src/test/java/com/azure/storage/blob/nio/AzureFileStoreTest.groovy @@ -66,8 +66,8 @@ class AzureFileStoreTest extends APISpec { where: view | viewName || supports BasicFileAttributeView.class | "basic" || true - UserDefinedFileAttributeView.class | "user" || true - AzureStorageFileAttributeView.class | "azureStorage" || true + AzureBlobFileAttributeView.class | "azureBlob" || true + AzureBasicFileAttributeView.class | "azureBasic" || true PosixFileAttributeView.class | "posix" || false } diff --git a/sdk/storage/azure-storage-blob-nio/src/test/java/com/azure/storage/blob/nio/AzureFileSystemProviderTest.groovy b/sdk/storage/azure-storage-blob-nio/src/test/java/com/azure/storage/blob/nio/AzureFileSystemProviderTest.groovy index b5bff84a61606..59b5c9737b867 100644 --- a/sdk/storage/azure-storage-blob-nio/src/test/java/com/azure/storage/blob/nio/AzureFileSystemProviderTest.groovy +++ b/sdk/storage/azure-storage-blob-nio/src/test/java/com/azure/storage/blob/nio/AzureFileSystemProviderTest.groovy @@ -4,6 +4,8 @@ package com.azure.storage.blob.nio import com.azure.storage.blob.BlobClient +import com.azure.storage.blob.models.AccessTier +import com.azure.storage.blob.models.BlobHttpHeaders import com.azure.storage.blob.specialized.AppendBlobClient import com.azure.storage.blob.specialized.BlockBlobClient import spock.lang.Requires @@ -18,6 +20,10 @@ import java.nio.file.FileSystemNotFoundException import java.nio.file.NoSuchFileException import java.nio.file.StandardCopyOption import java.nio.file.StandardOpenOption +import java.nio.file.attribute.BasicFileAttributeView +import java.nio.file.attribute.BasicFileAttributes +import java.nio.file.attribute.DosFileAttributeView +import java.nio.file.attribute.DosFileAttributes import java.nio.file.attribute.FileAttribute import java.security.MessageDigest @@ -908,7 +914,8 @@ class AzureFileSystemProviderTest extends APISpec { } @Unroll - @Requires({ liveMode() }) // Because we upload in blocks + @Requires({ liveMode() }) + // Because we upload in blocks def "OutputStream file system config"() { setup: def blockSize = 50L @@ -952,6 +959,322 @@ class AzureFileSystemProviderTest extends APISpec { thrown(IOException) } + @Unroll + def "GetAttributeView"() { + setup: + def fs = createFS(config) + + expect: + // No path validation is expected for getting the view + fs.provider().getFileAttributeView(fs.getPath("path"), type).class == expected + + where: + type || expected + BasicFileAttributeView.class || AzureBasicFileAttributeView.class + AzureBasicFileAttributeView.class || AzureBasicFileAttributeView.class + AzureBlobFileAttributeView.class || AzureBlobFileAttributeView.class + } + + def "GetAttributeView fail"() { + setup: + def fs = createFS(config) + + expect: + // No path validation is expected for getting the view + fs.provider().getFileAttributeView(fs.getPath("path"), DosFileAttributeView.class) == null + } + + @Unroll + def "ReadAttributes"() { + setup: + def fs = createFS(config) + def path = fs.getPath(generateBlobName()) + def os = fs.provider().newOutputStream(path) + os.close() + + expect: + fs.provider().readAttributes(path, type).class == expected + + where: + type || expected + BasicFileAttributes.class || AzureBasicFileAttributes.class + AzureBasicFileAttributes.class || AzureBasicFileAttributes.class + AzureBlobFileAttributes.class || AzureBlobFileAttributes.class + } + + def "ReadAttributes directory"() { + setup: + def fs = createFS(config) + def path = fs.getPath(generateBlobName()) + putDirectoryBlob(new AzureResource(path).getBlobClient().getBlockBlobClient()) + + when: + fs.provider().readAttributes(path, BasicFileAttributes.class) + + then: + notThrown(IOException) + } + + def "ReadAttributes unsupported"() { + setup: + def fs = createFS(config) + + when: + fs.provider().readAttributes(fs.getPath("path"), DosFileAttributes.class) + + then: + thrown(UnsupportedOperationException) + } + + def "ReadAttributes IOException"() { + setup: + def fs = createFS(config) + + when: "Path does not exist" + // Covers virtual directory, too + fs.provider().readAttributes(fs.getPath("path"), BasicFileAttributes.class) + + then: + thrown(IOException) + } + + @Unroll + def "ReadAttributes str parsing"() { + /* + This test checks that we correctly parse the attribute string and that all the requested attributes are + represented in the return value. We can also just test a subset of attributes for parsing logic. + */ + setup: + def fs = createFS(config) + def path = fs.getPath(generateBlobName()) + def os = fs.provider().newOutputStream(path) + os.close() + + when: + def result = fs.provider().readAttributes(path, attrStr) + + then: + for (String attr : attrList) { + assert result.keySet().contains(attr) + } + result.keySet().size() == attrList.size() + + where: + attrStr || attrList + "*" || ["lastModifiedTime", "creationTime", "isRegularFile", "isDirectory", "isSymbolicLink", "isOther", "size"] + "basic:*" || ["lastModifiedTime", "creationTime", "isRegularFile", "isDirectory", "isSymbolicLink", "isOther", "size"] + "azureBasic:*" || ["lastModifiedTime", "creationTime", "isRegularFile", "isDirectory", "isSymbolicLink", "isOther", "size"] + "azureBlob:*" || ["lastModifiedTime", "creationTime", "eTag", "blobHttpHeaders", "blobType", "copyId", "copyStatus", "copySource", "copyProgress", "copyCompletionTime", "copyStatusDescription", "isServerEncrypted", "accessTier", "isAccessTierInferred", "archiveStatus", "accessTierChangeTime", "metadata", "committedBlockCount", "isRegularFile", "isDirectory", "isSymbolicLink", "isOther", "size"] + "lastModifiedTime,creationTime" || ["lastModifiedTime", "creationTime"] + "basic:isRegularFile,isDirectory" || ["isRegularFile", "isDirectory"] + "azureBasic:size" || ["size"] + "azureBlob:eTag,blobHttpHeaders,blobType,copyId" || ["eTag", "blobHttpHeaders", "blobType", "copyId"] + } + + def "ReadAttributes str suppliers"() { + // This test checks that for each requested attribute, we call the correct supplier and that the supplier maps to the correct property + } + + def "ReadAttributes str directory"() { + setup: + def fs = createFS(config) + def path = fs.getPath(generateBlobName()) + putDirectoryBlob(new AzureResource(path).getBlobClient().getBlockBlobClient()) + + when: + fs.provider().readAttributes(path, "creationTime") + + then: + notThrown(IOException) + } + + @Unroll + def "ReadAttributes str IA"() { + setup: + def fs = createFS(config) + def path = fs.getPath(generateBlobName()) + + when: + fs.provider().readAttributes(path, attrStr) + + then: + thrown(IllegalArgumentException) + + where: + attrStr | _ + "azureBlob:size:foo" | _ // Invalid format + "" | _ // empty + "azureBasic:foo" | _ // Invalid property + } + + def "ReadAttributes str invalid view"() { + setup: + def fs = createFS(config) + def path = fs.getPath(generateBlobName()) + + when: + fs.provider().readAttributes(path, "foo:size") + + then: + thrown(UnsupportedOperationException) + } + + def "ReadAttributes str IOException"() { + setup: + def fs = createFS(config) + + when: "Path does not exist" + // Covers virtual directory, too + fs.provider().readAttributes(fs.getPath("path"), "basic:creationTime") + + then: + thrown(IOException) + } + + @Unroll + def "SetAttributes headers"() { + setup: + def fs = createFS(config) + def path = fs.getPath(generateBlobName()) + def os = fs.provider().newOutputStream(path) + os.close() + + def headers = new BlobHttpHeaders().setCacheControl(cacheControl) + .setContentDisposition(contentDisposition) + .setContentEncoding(contentEncoding) + .setContentLanguage(contentLanguage) + .setContentMd5(contentMD5) + .setContentType(contentType) + + when: + fs.provider().setAttribute(path, "azureBlob:blobHttpHeaders", headers) + headers = fs.provider().readAttributes(path, AzureBlobFileAttributes.class).blobHttpHeaders() + + then: + headers.getCacheControl() == cacheControl + headers.getContentDisposition() == contentDisposition + headers.getContentEncoding() == contentEncoding + headers.getContentLanguage() == contentLanguage + headers.getContentMd5() == contentMD5 + headers.getContentType() == contentType + + where: + cacheControl | contentDisposition | contentEncoding | contentLanguage | contentMD5 | contentType + null | null | null | null | null | null + "control" | "disposition" | "encoding" | "language" | Base64.getEncoder().encode(MessageDigest.getInstance("MD5").digest(defaultData.array())) | "type" + } + + @Unroll + def "SetAttributes metadata"() { + setup: + def fs = createFS(config) + def path = fs.getPath(generateBlobName()) + def os = fs.provider().newOutputStream(path) + os.close() + + def metadata = new HashMap() + if (key1 != null && value1 != null) { + metadata.put(key1, value1) + } + if (key2 != null && value2 != null) { + metadata.put(key2, value2) + } + + when: + fs.provider().setAttribute(path, "azureBlob:metadata", metadata) + def returnedMetadata = fs.provider().readAttributes(path, AzureBlobFileAttributes.class).metadata() + + then: + metadata == returnedMetadata + + where: + key1 | value1 | key2 | value2 || statusCode + null | null | null | null || 200 + "foo" | "bar" | "fizz" | "buzz" || 200 + "i0" | "a" | "i_" | "a" || 200 /* Test culture sensitive word sort */ + } + + @Unroll + def "SetAttributes tier"() { + setup: + def fs = createFS(config) + def path = fs.getPath(generateBlobName()) + def os = fs.provider().newOutputStream(path) + os.close() + + when: + fs.provider().setAttribute(path, "azureBlob:tier", tier) + + then: + fs.provider().readAttributes(path, AzureBlobFileAttributes.class).accessTier() == tier + + where: + tier | _ + AccessTier.HOT | _ + AccessTier.COOL | _ + /* + We don't test archive because it takes a while to take effect, and testing these two demonstrates that the tier + is successfully being passed to the underlying client. + */ + } + + @Unroll + def "SetAttributes directory"() { + setup: + def fs = createFS(config) + def path = fs.getPath(generateBlobName()) + putDirectoryBlob(new AzureResource(path).getBlobClient().getBlockBlobClient()) + + when: + fs.provider().setAttribute(path, "azureBlob:tier", AccessTier.COOL) + + then: + notThrown(IOException) + } + + @Unroll + def "SetAttributes IA"() { + setup: + def fs = createFS(config) + def path = fs.getPath(generateBlobName()) + + when: + fs.provider().setAttribute(path, attrStr, "Foo") + + then: + thrown(IllegalArgumentException) + + where: + attrStr | _ + "azureBlob:metadata:foo" | _ // Invalid format + "" | _ // empty + "azureBasic:foo" | _ // Invalid property + } + + def "SetAttributes invalid view"() { + setup: + def fs = createFS(config) + def path = fs.getPath(generateBlobName()) + + when: + fs.provider().setAttribute(path, "foo:size", "foo") + + then: + thrown(UnsupportedOperationException) + } + + def "SetAttributes IOException"() { + setup: + def fs = createFS(config) + + when: "Path does not exist" + // Covers virtual directory, too + fs.provider().setAttribute(fs.getPath("path"), "azureBlob:metadata", Collections.emptyMap()) + + then: + thrown(IOException) + } + def basicSetupForCopyTest(FileSystem fs) { // Generate resource names. // Don't use default directory to ensure we honor the root. diff --git a/sdk/storage/azure-storage-blob-nio/src/test/java/com/azure/storage/blob/nio/AzureFileSystemTest.groovy b/sdk/storage/azure-storage-blob-nio/src/test/java/com/azure/storage/blob/nio/AzureFileSystemTest.groovy index 240a0b9c8306e..47a8989c410a9 100644 --- a/sdk/storage/azure-storage-blob-nio/src/test/java/com/azure/storage/blob/nio/AzureFileSystemTest.groovy +++ b/sdk/storage/azure-storage-blob-nio/src/test/java/com/azure/storage/blob/nio/AzureFileSystemTest.groovy @@ -216,8 +216,8 @@ class AzureFileSystemTest extends APISpec { where: view | supports "basic" | true - "user" | true - "azureStorage" | true + "azureBasic" | true + "azureBlob" | true "posix" | false } diff --git a/sdk/storage/azure-storage-blob-nio/src/test/resources/session-records/AttributeViewTestattributeviewsettimesunsupported[0].json b/sdk/storage/azure-storage-blob-nio/src/test/resources/session-records/AttributeViewTestattributeviewsettimesunsupported[0].json new file mode 100644 index 0000000000000..026a41b87d22c --- /dev/null +++ b/sdk/storage/azure-storage-blob-nio/src/test/resources/session-records/AttributeViewTestattributeviewsettimesunsupported[0].json @@ -0,0 +1,174 @@ +{ + "networkCallRecords" : [ { + "Method" : "GET", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcattributeviewsettimesunsupported182220563339f0c97?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "94913c7d-4bfc-4fb7-b96a-efb2437152f8" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-error-code" : "ContainerNotFound", + "retry-after" : "0", + "Content-Length" : "225", + "StatusCode" : "404", + "x-ms-request-id" : "c6bdc8d3-101e-0021-734d-4e7c2c000000", + "Body" : "ContainerNotFoundThe specified container does not exist.\nRequestId:c6bdc8d3-101e-0021-734d-4e7c2c000000\nTime:2020-06-29T19:40:27.7854484Z", + "Date" : "Mon, 29 Jun 2020 19:40:26 GMT", + "x-ms-client-request-id" : "94913c7d-4bfc-4fb7-b96a-efb2437152f8", + "Content-Type" : "application/xml" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcattributeviewsettimesunsupported182220563339f0c97?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "4c8a0002-bd57-49d2-9635-df4aca195313" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "ETag" : "0x8D81C644696973B", + "Last-Modified" : "Mon, 29 Jun 2020 19:40:27 GMT", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "5f26a1c6-a01e-0099-7f4d-4e9edf000000", + "Date" : "Mon, 29 Jun 2020 19:40:27 GMT", + "x-ms-client-request-id" : "4c8a0002-bd57-49d2-9635-df4aca195313" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcattributeviewsettimesunsupported2611461be8ff8b7b5?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "218c80bd-c89a-415e-97de-295daa14ff7c" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-error-code" : "ContainerNotFound", + "retry-after" : "0", + "Content-Length" : "225", + "StatusCode" : "404", + "x-ms-request-id" : "7283252d-301e-0139-764d-4e17ec000000", + "Body" : "ContainerNotFoundThe specified container does not exist.\nRequestId:7283252d-301e-0139-764d-4e17ec000000\nTime:2020-06-29T19:40:28.1121123Z", + "Date" : "Mon, 29 Jun 2020 19:40:28 GMT", + "x-ms-client-request-id" : "218c80bd-c89a-415e-97de-295daa14ff7c", + "Content-Type" : "application/xml" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcattributeviewsettimesunsupported2611461be8ff8b7b5?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "8dcca6f1-c90e-42f2-9d7c-62325623c741" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "ETag" : "0x8D81C6446C606BD", + "Last-Modified" : "Mon, 29 Jun 2020 19:40:28 GMT", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "2a617360-901e-005d-444d-4ee119000000", + "Date" : "Mon, 29 Jun 2020 19:40:27 GMT", + "x-ms-client-request-id" : "8dcca6f1-c90e-42f2-9d7c-62325623c741" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcattributeviewsettimesunsupported182220563339f0c97/javablobattributeviewsettimesunsupported375344def9dd57", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "93d66fbb-fbd8-49fa-afd5-94819a77a380", + "Content-Type" : "application/octet-stream" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-content-crc64" : "6RYQPwaVsyQ=", + "Last-Modified" : "Mon, 29 Jun 2020 19:40:28 GMT", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-server-encrypted" : "true", + "Date" : "Mon, 29 Jun 2020 19:40:27 GMT", + "Content-MD5" : "wh+Wm18D0z1D4E+PE252gg==", + "ETag" : "0x8D81C6446E1291D", + "Content-Length" : "0", + "x-ms-request-id" : "afb91a89-801e-0049-4c4d-4e227d000000", + "x-ms-client-request-id" : "93d66fbb-fbd8-49fa-afd5-94819a77a380" + }, + "Exception" : null + }, { + "Method" : "DELETE", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcattributeviewsettimesunsupported182220563339f0c97?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "01ce62c0-180d-4bc4-ab79-fcf5eb61a2bb" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "202", + "x-ms-request-id" : "9a325db1-601e-00ad-2d4d-4e3177000000", + "Date" : "Mon, 29 Jun 2020 19:40:27 GMT", + "x-ms-client-request-id" : "01ce62c0-180d-4bc4-ab79-fcf5eb61a2bb" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.blob.core.windows.net?prefix=jtcattributeviewsettimesunsupported&comp=list", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "2cfefd46-11c2-4c43-bbc1-fd40465cb605" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "049b8d94-901e-00d5-754d-4e59c0000000", + "Body" : "jtcattributeviewsettimesunsupportedjtcattributeviewsettimesunsupported2611461be8ff8b7b5Mon, 29 Jun 2020 19:40:28 GMT\"0x8D81C6446C606BD\"unlockedavailable$account-encryption-keyfalsefalsefalse", + "Date" : "Mon, 29 Jun 2020 19:40:28 GMT", + "x-ms-client-request-id" : "2cfefd46-11c2-4c43-bbc1-fd40465cb605", + "Content-Type" : "application/xml" + }, + "Exception" : null + }, { + "Method" : "DELETE", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcattributeviewsettimesunsupported2611461be8ff8b7b5?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "2e339a35-b800-4a39-8f9b-d7e8aa891c4d" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "202", + "x-ms-request-id" : "e7a623a5-501e-00ae-414d-4e3270000000", + "Date" : "Mon, 29 Jun 2020 19:40:28 GMT", + "x-ms-client-request-id" : "2e339a35-b800-4a39-8f9b-d7e8aa891c4d" + }, + "Exception" : null + } ], + "variables" : [ "jtcattributeviewsettimesunsupported079975668a30ebc99", "jtcattributeviewsettimesunsupported182220563339f0c97", "jtcattributeviewsettimesunsupported2611461be8ff8b7b5", "javablobattributeviewsettimesunsupported375344def9dd57" ] +} \ No newline at end of file diff --git a/sdk/storage/azure-storage-blob-nio/src/test/resources/session-records/AttributeViewTestattributeviewsettimesunsupported[1].json b/sdk/storage/azure-storage-blob-nio/src/test/resources/session-records/AttributeViewTestattributeviewsettimesunsupported[1].json new file mode 100644 index 0000000000000..b6a2ebbb531c0 --- /dev/null +++ b/sdk/storage/azure-storage-blob-nio/src/test/resources/session-records/AttributeViewTestattributeviewsettimesunsupported[1].json @@ -0,0 +1,174 @@ +{ + "networkCallRecords" : [ { + "Method" : "GET", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcattributeviewsettimesunsupported14552883c497ab8e8?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "cdd4bc2c-5e71-4c54-996f-e693b5ceca88" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-error-code" : "ContainerNotFound", + "retry-after" : "0", + "Content-Length" : "225", + "StatusCode" : "404", + "x-ms-request-id" : "3229ad26-a01e-00d6-5e4d-4e5ac7000000", + "Body" : "ContainerNotFoundThe specified container does not exist.\nRequestId:3229ad26-a01e-00d6-5e4d-4e5ac7000000\nTime:2020-06-29T19:40:29.0811724Z", + "Date" : "Mon, 29 Jun 2020 19:40:28 GMT", + "x-ms-client-request-id" : "cdd4bc2c-5e71-4c54-996f-e693b5ceca88", + "Content-Type" : "application/xml" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcattributeviewsettimesunsupported14552883c497ab8e8?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "b92e7575-2f8a-49ef-80b6-333c9c573213" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "ETag" : "0x8D81C64475AEF03", + "Last-Modified" : "Mon, 29 Jun 2020 19:40:29 GMT", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "710bce92-401e-00fe-764d-4e2d78000000", + "Date" : "Mon, 29 Jun 2020 19:40:28 GMT", + "x-ms-client-request-id" : "b92e7575-2f8a-49ef-80b6-333c9c573213" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcattributeviewsettimesunsupported245336fb55c1265d4?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "92800901-7e2c-4d46-8264-73e9154d28ba" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-error-code" : "ContainerNotFound", + "retry-after" : "0", + "Content-Length" : "225", + "StatusCode" : "404", + "x-ms-request-id" : "d25f422c-201e-0126-524d-4eccfc000000", + "Body" : "ContainerNotFoundThe specified container does not exist.\nRequestId:d25f422c-201e-0126-524d-4eccfc000000\nTime:2020-06-29T19:40:29.3947049Z", + "Date" : "Mon, 29 Jun 2020 19:40:29 GMT", + "x-ms-client-request-id" : "92800901-7e2c-4d46-8264-73e9154d28ba", + "Content-Type" : "application/xml" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcattributeviewsettimesunsupported245336fb55c1265d4?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "71bf5119-f9b5-4a6a-87da-2f011e80b66f" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "ETag" : "0x8D81C644789FF84", + "Last-Modified" : "Mon, 29 Jun 2020 19:40:29 GMT", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "7ed25047-501e-00ea-1d4d-4eee1c000000", + "Date" : "Mon, 29 Jun 2020 19:40:29 GMT", + "x-ms-client-request-id" : "71bf5119-f9b5-4a6a-87da-2f011e80b66f" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcattributeviewsettimesunsupported14552883c497ab8e8/javablobattributeviewsettimesunsupported3853882130875c", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "17479d21-c9fe-4b8d-ba64-ff3666f39d82", + "Content-Type" : "application/octet-stream" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-content-crc64" : "6RYQPwaVsyQ=", + "Last-Modified" : "Mon, 29 Jun 2020 19:40:29 GMT", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-server-encrypted" : "true", + "Date" : "Mon, 29 Jun 2020 19:40:29 GMT", + "Content-MD5" : "wh+Wm18D0z1D4E+PE252gg==", + "ETag" : "0x8D81C6447A348FF", + "Content-Length" : "0", + "x-ms-request-id" : "31a7b760-301e-0072-744d-4e6023000000", + "x-ms-client-request-id" : "17479d21-c9fe-4b8d-ba64-ff3666f39d82" + }, + "Exception" : null + }, { + "Method" : "DELETE", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcattributeviewsettimesunsupported14552883c497ab8e8?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "8071a635-00af-45cd-afe4-3bcf29b19971" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "202", + "x-ms-request-id" : "b5855797-301e-0036-6c4d-4ebc4f000000", + "Date" : "Mon, 29 Jun 2020 19:40:29 GMT", + "x-ms-client-request-id" : "8071a635-00af-45cd-afe4-3bcf29b19971" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.blob.core.windows.net?prefix=jtcattributeviewsettimesunsupported&comp=list", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "af95118a-4293-40d8-aaa6-8824e6bf87d7" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "08a64c77-c01e-0023-434d-4e7ed6000000", + "Body" : "jtcattributeviewsettimesunsupportedjtcattributeviewsettimesunsupported245336fb55c1265d4Mon, 29 Jun 2020 19:40:29 GMT\"0x8D81C644789FF84\"unlockedavailable$account-encryption-keyfalsefalsefalse", + "Date" : "Mon, 29 Jun 2020 19:40:29 GMT", + "x-ms-client-request-id" : "af95118a-4293-40d8-aaa6-8824e6bf87d7", + "Content-Type" : "application/xml" + }, + "Exception" : null + }, { + "Method" : "DELETE", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcattributeviewsettimesunsupported245336fb55c1265d4?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "e1b87339-e041-4cfc-bda3-96e0e0728a66" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "202", + "x-ms-request-id" : "8caabc8d-001e-0113-604d-4e62a9000000", + "Date" : "Mon, 29 Jun 2020 19:40:29 GMT", + "x-ms-client-request-id" : "e1b87339-e041-4cfc-bda3-96e0e0728a66" + }, + "Exception" : null + } ], + "variables" : [ "jtcattributeviewsettimesunsupported01048582f6426c77c", "jtcattributeviewsettimesunsupported14552883c497ab8e8", "jtcattributeviewsettimesunsupported245336fb55c1265d4", "javablobattributeviewsettimesunsupported3853882130875c" ] +} \ No newline at end of file diff --git a/sdk/storage/azure-storage-blob-nio/src/test/resources/session-records/AttributeViewTestattributeviewsettimesunsupported[2].json b/sdk/storage/azure-storage-blob-nio/src/test/resources/session-records/AttributeViewTestattributeviewsettimesunsupported[2].json new file mode 100644 index 0000000000000..c2b1557038807 --- /dev/null +++ b/sdk/storage/azure-storage-blob-nio/src/test/resources/session-records/AttributeViewTestattributeviewsettimesunsupported[2].json @@ -0,0 +1,174 @@ +{ + "networkCallRecords" : [ { + "Method" : "GET", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcattributeviewsettimesunsupported1918315ba4854eae8?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "94ce2105-02f0-4225-a192-277f3b463320" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-error-code" : "ContainerNotFound", + "retry-after" : "0", + "Content-Length" : "225", + "StatusCode" : "404", + "x-ms-request-id" : "42de7f0f-a01e-00ff-6c4d-4e2c85000000", + "Body" : "ContainerNotFoundThe specified container does not exist.\nRequestId:42de7f0f-a01e-00ff-6c4d-4e2c85000000\nTime:2020-06-29T19:40:30.3299951Z", + "Date" : "Mon, 29 Jun 2020 19:40:29 GMT", + "x-ms-client-request-id" : "94ce2105-02f0-4225-a192-277f3b463320", + "Content-Type" : "application/xml" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcattributeviewsettimesunsupported1918315ba4854eae8?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "e1ee4f21-682f-4df9-8987-f057e5d5b634" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "ETag" : "0x8D81C6448198436", + "Last-Modified" : "Mon, 29 Jun 2020 19:40:30 GMT", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "42081801-b01e-00eb-6d4d-4eefe1000000", + "Date" : "Mon, 29 Jun 2020 19:40:30 GMT", + "x-ms-client-request-id" : "e1ee4f21-682f-4df9-8987-f057e5d5b634" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcattributeviewsettimesunsupported219906ff460d82fa1?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "323beff7-7926-483f-8fe7-550351b2afef" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-error-code" : "ContainerNotFound", + "retry-after" : "0", + "Content-Length" : "225", + "StatusCode" : "404", + "x-ms-request-id" : "fc1b5207-c01e-0127-3a4d-4ecd01000000", + "Body" : "ContainerNotFoundThe specified container does not exist.\nRequestId:fc1b5207-c01e-0127-3a4d-4ecd01000000\nTime:2020-06-29T19:40:30.6450381Z", + "Date" : "Mon, 29 Jun 2020 19:40:30 GMT", + "x-ms-client-request-id" : "323beff7-7926-483f-8fe7-550351b2afef", + "Content-Type" : "application/xml" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcattributeviewsettimesunsupported219906ff460d82fa1?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "b0bb0127-da22-4383-bc6f-4f1c24d38f5f" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "ETag" : "0x8D81C6448496189", + "Last-Modified" : "Mon, 29 Jun 2020 19:40:30 GMT", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "2ef205ed-501e-004b-804d-4e2087000000", + "Date" : "Mon, 29 Jun 2020 19:40:29 GMT", + "x-ms-client-request-id" : "b0bb0127-da22-4383-bc6f-4f1c24d38f5f" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcattributeviewsettimesunsupported1918315ba4854eae8/javablobattributeviewsettimesunsupported3451209825b621", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "4b39077d-521d-4f37-818c-c1fc9ed8a8d9", + "Content-Type" : "application/octet-stream" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-content-crc64" : "6RYQPwaVsyQ=", + "Last-Modified" : "Mon, 29 Jun 2020 19:40:30 GMT", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-server-encrypted" : "true", + "Date" : "Mon, 29 Jun 2020 19:40:30 GMT", + "Content-MD5" : "wh+Wm18D0z1D4E+PE252gg==", + "ETag" : "0x8D81C644860FAF6", + "Content-Length" : "0", + "x-ms-request-id" : "51e792ef-401e-00d7-6a4d-4e5b3a000000", + "x-ms-client-request-id" : "4b39077d-521d-4f37-818c-c1fc9ed8a8d9" + }, + "Exception" : null + }, { + "Method" : "DELETE", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcattributeviewsettimesunsupported1918315ba4854eae8?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "5e8492b7-86f9-4a86-bcb2-dfb5fc5a9a9b" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "202", + "x-ms-request-id" : "4452b5f2-801e-0060-7e4d-4e543f000000", + "Date" : "Mon, 29 Jun 2020 19:40:30 GMT", + "x-ms-client-request-id" : "5e8492b7-86f9-4a86-bcb2-dfb5fc5a9a9b" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.blob.core.windows.net?prefix=jtcattributeviewsettimesunsupported&comp=list", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "10dd49ef-197d-4ee9-b22b-c331dc7f3781" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "b666b786-401e-0114-5b4d-4e942c000000", + "Body" : "jtcattributeviewsettimesunsupportedjtcattributeviewsettimesunsupported219906ff460d82fa1Mon, 29 Jun 2020 19:40:30 GMT\"0x8D81C6448496189\"unlockedavailable$account-encryption-keyfalsefalsefalse", + "Date" : "Mon, 29 Jun 2020 19:40:30 GMT", + "x-ms-client-request-id" : "10dd49ef-197d-4ee9-b22b-c331dc7f3781", + "Content-Type" : "application/xml" + }, + "Exception" : null + }, { + "Method" : "DELETE", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcattributeviewsettimesunsupported219906ff460d82fa1?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "6d5f23c9-3966-4685-9dbd-08613c56e157" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "202", + "x-ms-request-id" : "b2612e00-a01e-0038-1b4d-4e5044000000", + "Date" : "Mon, 29 Jun 2020 19:40:30 GMT", + "x-ms-client-request-id" : "6d5f23c9-3966-4685-9dbd-08613c56e157" + }, + "Exception" : null + } ], + "variables" : [ "jtcattributeviewsettimesunsupported063342d335c29a208", "jtcattributeviewsettimesunsupported1918315ba4854eae8", "jtcattributeviewsettimesunsupported219906ff460d82fa1", "javablobattributeviewsettimesunsupported3451209825b621" ] +} \ No newline at end of file diff --git a/sdk/storage/azure-storage-blob-nio/src/test/resources/session-records/AttributeViewTestazurebasicfileattributeviewdirectory.json b/sdk/storage/azure-storage-blob-nio/src/test/resources/session-records/AttributeViewTestazurebasicfileattributeviewdirectory.json new file mode 100644 index 0000000000000..8b03d8be495e6 --- /dev/null +++ b/sdk/storage/azure-storage-blob-nio/src/test/resources/session-records/AttributeViewTestazurebasicfileattributeviewdirectory.json @@ -0,0 +1,227 @@ +{ + "networkCallRecords" : [ { + "Method" : "GET", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcazurebasicfileattributeviewdirectory1170332acf31a01?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "1344815c-bd40-42e6-8919-ac8cb3b2b983" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-error-code" : "ContainerNotFound", + "retry-after" : "0", + "Content-Length" : "225", + "StatusCode" : "404", + "x-ms-request-id" : "4452a17b-801e-0060-194d-4e543f000000", + "Body" : "ContainerNotFoundThe specified container does not exist.\nRequestId:4452a17b-801e-0060-194d-4e543f000000\nTime:2020-06-29T19:40:13.0863570Z", + "Date" : "Mon, 29 Jun 2020 19:40:12 GMT", + "x-ms-client-request-id" : "1344815c-bd40-42e6-8919-ac8cb3b2b983", + "Content-Type" : "application/xml" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcazurebasicfileattributeviewdirectory1170332acf31a01?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "3c75c65e-c8e8-4567-8d3d-6964bb0a5eea" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "ETag" : "0x8D81C643DD28058", + "Last-Modified" : "Mon, 29 Jun 2020 19:40:13 GMT", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "b666a53f-401e-0114-354d-4e942c000000", + "Date" : "Mon, 29 Jun 2020 19:40:12 GMT", + "x-ms-client-request-id" : "3c75c65e-c8e8-4567-8d3d-6964bb0a5eea" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcazurebasicfileattributeviewdirectory216007edc121e8c?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "bffebd04-40c6-44f4-b044-087553763cb1" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-error-code" : "ContainerNotFound", + "retry-after" : "0", + "Content-Length" : "225", + "StatusCode" : "404", + "x-ms-request-id" : "5c8dae17-301e-00d8-584d-4eb6cc000000", + "Body" : "ContainerNotFoundThe specified container does not exist.\nRequestId:5c8dae17-301e-00d8-584d-4eb6cc000000\nTime:2020-06-29T19:40:13.4173191Z", + "Date" : "Mon, 29 Jun 2020 19:40:12 GMT", + "x-ms-client-request-id" : "bffebd04-40c6-44f4-b044-087553763cb1", + "Content-Type" : "application/xml" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcazurebasicfileattributeviewdirectory216007edc121e8c?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "4255d165-da07-49a7-b350-f7249f669535" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "ETag" : "0x8D81C643E045D1A", + "Last-Modified" : "Mon, 29 Jun 2020 19:40:13 GMT", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "f3953ab5-501e-0100-214d-4e5748000000", + "Date" : "Mon, 29 Jun 2020 19:40:13 GMT", + "x-ms-client-request-id" : "4255d165-da07-49a7-b350-f7249f669535" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcazurebasicfileattributeviewdirectory1170332acf31a01/javablobazurebasicfileattributeviewdirectory396544396ecf", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "daa2201d-9c0b-4b7c-a8aa-b58026cc85a0", + "Content-Type" : "application/octet-stream" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-content-crc64" : "6RYQPwaVsyQ=", + "Last-Modified" : "Mon, 29 Jun 2020 19:40:13 GMT", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-server-encrypted" : "true", + "Date" : "Mon, 29 Jun 2020 19:40:13 GMT", + "Content-MD5" : "wh+Wm18D0z1D4E+PE252gg==", + "ETag" : "0x8D81C643E1E1D93", + "Content-Length" : "0", + "x-ms-request-id" : "3045bc6f-a01e-00b0-5d4d-4ee89d000000", + "x-ms-client-request-id" : "daa2201d-9c0b-4b7c-a8aa-b58026cc85a0" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcazurebasicfileattributeviewdirectory1170332acf31a01/javablobazurebasicfileattributeviewdirectory4662394d9819?comp=blocklist", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "83c73663-d769-48a6-8e04-2108abf7bd5e", + "Content-Type" : "application/xml; charset=utf-8" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "ETag" : "0x8D81C643E47CFD5", + "x-ms-content-crc64" : "p1vsGtjjPsk=", + "Last-Modified" : "Mon, 29 Jun 2020 19:40:14 GMT", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "3c3d4973-901e-0074-134d-4e975b000000", + "x-ms-request-server-encrypted" : "true", + "Date" : "Mon, 29 Jun 2020 19:40:13 GMT", + "x-ms-client-request-id" : "83c73663-d769-48a6-8e04-2108abf7bd5e" + }, + "Exception" : null + }, { + "Method" : "HEAD", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcazurebasicfileattributeviewdirectory1170332acf31a01/javablobazurebasicfileattributeviewdirectory4662394d9819", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "5b7fa9cc-2df3-4796-a2c7-8fd3631de097" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "x-ms-lease-status" : "unlocked", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-lease-state" : "available", + "Last-Modified" : "Mon, 29 Jun 2020 19:40:14 GMT", + "retry-after" : "0", + "StatusCode" : "200", + "Date" : "Mon, 29 Jun 2020 19:40:14 GMT", + "x-ms-blob-type" : "BlockBlob", + "Accept-Ranges" : "bytes", + "x-ms-server-encrypted" : "true", + "x-ms-meta-hdi_isfolder" : "true", + "ETag" : "0x8D81C643E47CFD5", + "x-ms-creation-time" : "Mon, 29 Jun 2020 19:40:14 GMT", + "Content-Length" : "0", + "x-ms-request-id" : "2c5c19bf-301e-009c-6e4d-4e6aa0000000", + "x-ms-client-request-id" : "5b7fa9cc-2df3-4796-a2c7-8fd3631de097", + "Content-Type" : "application/octet-stream" + }, + "Exception" : null + }, { + "Method" : "DELETE", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcazurebasicfileattributeviewdirectory1170332acf31a01?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "f7d65cc2-5f18-4ea2-aa8f-cb9cbed55df8" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "202", + "x-ms-request-id" : "c100957d-601e-0061-1b4d-4e55c2000000", + "Date" : "Mon, 29 Jun 2020 19:40:14 GMT", + "x-ms-client-request-id" : "f7d65cc2-5f18-4ea2-aa8f-cb9cbed55df8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.blob.core.windows.net?prefix=jtcazurebasicfileattributeviewdirectory&comp=list", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "44d1e0cc-f68f-4732-ba33-814c65c6c655" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "d120d4f8-f01e-004d-3d4d-4ed7ff000000", + "Body" : "jtcazurebasicfileattributeviewdirectoryjtcazurebasicfileattributeviewdirectory216007edc121e8cMon, 29 Jun 2020 19:40:13 GMT\"0x8D81C643E045D1A\"unlockedavailable$account-encryption-keyfalsefalsefalse", + "Date" : "Mon, 29 Jun 2020 19:40:14 GMT", + "x-ms-client-request-id" : "44d1e0cc-f68f-4732-ba33-814c65c6c655", + "Content-Type" : "application/xml" + }, + "Exception" : null + }, { + "Method" : "DELETE", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcazurebasicfileattributeviewdirectory216007edc121e8c?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "7aa503f2-7b6f-4094-9f17-a64508848a86" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "202", + "x-ms-request-id" : "ebc2c3bb-601e-0025-514d-4e89ae000000", + "Date" : "Mon, 29 Jun 2020 19:40:13 GMT", + "x-ms-client-request-id" : "7aa503f2-7b6f-4094-9f17-a64508848a86" + }, + "Exception" : null + } ], + "variables" : [ "jtcazurebasicfileattributeviewdirectory034138295640901", "jtcazurebasicfileattributeviewdirectory1170332acf31a01", "jtcazurebasicfileattributeviewdirectory216007edc121e8c", "javablobazurebasicfileattributeviewdirectory396544396ecf", "javablobazurebasicfileattributeviewdirectory4662394d9819" ] +} \ No newline at end of file diff --git a/sdk/storage/azure-storage-blob-nio/src/test/resources/session-records/AttributeViewTestazurebasicfileattributeviewreadattributes.json b/sdk/storage/azure-storage-blob-nio/src/test/resources/session-records/AttributeViewTestazurebasicfileattributeviewreadattributes.json new file mode 100644 index 0000000000000..7a8a2d6e0fff4 --- /dev/null +++ b/sdk/storage/azure-storage-blob-nio/src/test/resources/session-records/AttributeViewTestazurebasicfileattributeviewreadattributes.json @@ -0,0 +1,232 @@ +{ + "networkCallRecords" : [ { + "Method" : "GET", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcazurebasicfileattributeviewreadattributes174994735ae2?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "45cfd00b-89cd-4f42-967b-893127970377" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-error-code" : "ContainerNotFound", + "retry-after" : "0", + "Content-Length" : "225", + "StatusCode" : "404", + "x-ms-request-id" : "5419cb85-b01e-004a-274d-4e217a000000", + "Body" : "ContainerNotFoundThe specified container does not exist.\nRequestId:5419cb85-b01e-004a-274d-4e217a000000\nTime:2020-06-29T19:40:10.7235703Z", + "Date" : "Mon, 29 Jun 2020 19:40:10 GMT", + "x-ms-client-request-id" : "45cfd00b-89cd-4f42-967b-893127970377", + "Content-Type" : "application/xml" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcazurebasicfileattributeviewreadattributes174994735ae2?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "d4f59bd3-9faf-4995-b52c-bd010f250771" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "ETag" : "0x8D81C643C8747D5", + "Last-Modified" : "Mon, 29 Jun 2020 19:40:11 GMT", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "82b842e4-201e-0022-334d-4e7f2b000000", + "Date" : "Mon, 29 Jun 2020 19:40:10 GMT", + "x-ms-client-request-id" : "d4f59bd3-9faf-4995-b52c-bd010f250771" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcazurebasicfileattributeviewreadattributes2108029f7818?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "63efcae4-3acc-4077-a4e0-5e14ccb44f51" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-error-code" : "ContainerNotFound", + "retry-after" : "0", + "Content-Length" : "225", + "StatusCode" : "404", + "x-ms-request-id" : "4d48d4bd-001e-013a-6e4d-4e14eb000000", + "Body" : "ContainerNotFoundThe specified container does not exist.\nRequestId:4d48d4bd-001e-013a-6e4d-4e14eb000000\nTime:2020-06-29T19:40:11.3561050Z", + "Date" : "Mon, 29 Jun 2020 19:40:10 GMT", + "x-ms-client-request-id" : "63efcae4-3acc-4077-a4e0-5e14ccb44f51", + "Content-Type" : "application/xml" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcazurebasicfileattributeviewreadattributes2108029f7818?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "4ca37f69-0d00-4e09-9da2-3615acd35dc1" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "ETag" : "0x8D81C643CCCCD8B", + "Last-Modified" : "Mon, 29 Jun 2020 19:40:11 GMT", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "7f7cfa70-501e-000f-254d-4efceb000000", + "Date" : "Mon, 29 Jun 2020 19:40:10 GMT", + "x-ms-client-request-id" : "4ca37f69-0d00-4e09-9da2-3615acd35dc1" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcazurebasicfileattributeviewreadattributes174994735ae2/javablobazurebasicfileattributeviewreadattributes3272520ff4", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "47db7edd-3cf1-4843-aef2-8867c8481457", + "Content-Type" : "application/octet-stream" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-content-crc64" : "6RYQPwaVsyQ=", + "Last-Modified" : "Mon, 29 Jun 2020 19:40:11 GMT", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-server-encrypted" : "true", + "Date" : "Mon, 29 Jun 2020 19:40:11 GMT", + "Content-MD5" : "wh+Wm18D0z1D4E+PE252gg==", + "ETag" : "0x8D81C643CFD4BD8", + "Content-Length" : "0", + "x-ms-request-id" : "1c32a990-d01e-0037-6c4d-4ebdb2000000", + "x-ms-client-request-id" : "47db7edd-3cf1-4843-aef2-8867c8481457" + }, + "Exception" : null + }, { + "Method" : "HEAD", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcazurebasicfileattributeviewreadattributes174994735ae2/javablobazurebasicfileattributeviewreadattributes3272520ff4", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "39a606d8-5061-4bbb-8d23-dde0716a15cc" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "x-ms-lease-status" : "unlocked", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-lease-state" : "available", + "Last-Modified" : "Mon, 29 Jun 2020 19:40:11 GMT", + "retry-after" : "0", + "StatusCode" : "200", + "Date" : "Mon, 29 Jun 2020 19:40:11 GMT", + "x-ms-blob-type" : "BlockBlob", + "Content-MD5" : "wh+Wm18D0z1D4E+PE252gg==", + "Accept-Ranges" : "bytes", + "x-ms-server-encrypted" : "true", + "ETag" : "0x8D81C643CFD4BD8", + "x-ms-creation-time" : "Mon, 29 Jun 2020 19:40:11 GMT", + "Content-Length" : "7", + "x-ms-request-id" : "22f49021-b01e-00af-114d-4e338d000000", + "x-ms-client-request-id" : "39a606d8-5061-4bbb-8d23-dde0716a15cc", + "Content-Type" : "application/octet-stream" + }, + "Exception" : null + }, { + "Method" : "HEAD", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcazurebasicfileattributeviewreadattributes174994735ae2/javablobazurebasicfileattributeviewreadattributes3272520ff4", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "fbbc30b2-f7cd-47b9-885e-99da801a9ed8" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "x-ms-lease-status" : "unlocked", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-lease-state" : "available", + "Last-Modified" : "Mon, 29 Jun 2020 19:40:11 GMT", + "retry-after" : "0", + "StatusCode" : "200", + "Date" : "Mon, 29 Jun 2020 19:40:11 GMT", + "x-ms-blob-type" : "BlockBlob", + "Content-MD5" : "wh+Wm18D0z1D4E+PE252gg==", + "Accept-Ranges" : "bytes", + "x-ms-server-encrypted" : "true", + "ETag" : "0x8D81C643CFD4BD8", + "x-ms-creation-time" : "Mon, 29 Jun 2020 19:40:11 GMT", + "Content-Length" : "7", + "x-ms-request-id" : "fa751f89-501e-0087-224d-4e4432000000", + "x-ms-client-request-id" : "fbbc30b2-f7cd-47b9-885e-99da801a9ed8", + "Content-Type" : "application/octet-stream" + }, + "Exception" : null + }, { + "Method" : "DELETE", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcazurebasicfileattributeviewreadattributes174994735ae2?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "acd09338-0fe3-47f5-ba7e-654bbeecb557" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "202", + "x-ms-request-id" : "282ecac9-701e-009b-404d-4e9c25000000", + "Date" : "Mon, 29 Jun 2020 19:40:12 GMT", + "x-ms-client-request-id" : "acd09338-0fe3-47f5-ba7e-654bbeecb557" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.blob.core.windows.net?prefix=jtcazurebasicfileattributeviewreadattributes&comp=list", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "6a3b2fc5-41a1-417b-b9d3-9fa95bbe6627" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "88fed40f-d01e-0073-074d-4e61de000000", + "Body" : "jtcazurebasicfileattributeviewreadattributesjtcazurebasicfileattributeviewreadattributes2108029f7818Mon, 29 Jun 2020 19:40:11 GMT\"0x8D81C643CCCCD8B\"unlockedavailable$account-encryption-keyfalsefalsefalse", + "Date" : "Mon, 29 Jun 2020 19:40:12 GMT", + "x-ms-client-request-id" : "6a3b2fc5-41a1-417b-b9d3-9fa95bbe6627", + "Content-Type" : "application/xml" + }, + "Exception" : null + }, { + "Method" : "DELETE", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcazurebasicfileattributeviewreadattributes2108029f7818?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "a8aa9f5c-3dac-4102-9122-2568936eb983" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "202", + "x-ms-request-id" : "51e78253-401e-00d7-2a4d-4e5b3a000000", + "Date" : "Mon, 29 Jun 2020 19:40:12 GMT", + "x-ms-client-request-id" : "a8aa9f5c-3dac-4102-9122-2568936eb983" + }, + "Exception" : null + } ], + "variables" : [ "jtcazurebasicfileattributeviewreadattributes0420973d59a6", "jtcazurebasicfileattributeviewreadattributes174994735ae2", "jtcazurebasicfileattributeviewreadattributes2108029f7818", "javablobazurebasicfileattributeviewreadattributes3272520ff4" ] +} \ No newline at end of file diff --git a/sdk/storage/azure-storage-blob-nio/src/test/resources/session-records/AttributeViewTestazureblobfileattributeviewreadattributes.json b/sdk/storage/azure-storage-blob-nio/src/test/resources/session-records/AttributeViewTestazureblobfileattributeviewreadattributes.json new file mode 100644 index 0000000000000..ac30b8471f59c --- /dev/null +++ b/sdk/storage/azure-storage-blob-nio/src/test/resources/session-records/AttributeViewTestazureblobfileattributeviewreadattributes.json @@ -0,0 +1,232 @@ +{ + "networkCallRecords" : [ { + "Method" : "GET", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcazureblobfileattributeviewreadattributes1243094876f1f?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "29099c34-24d6-46fc-935b-63cdc4b92b21" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-error-code" : "ContainerNotFound", + "retry-after" : "0", + "Content-Length" : "225", + "StatusCode" : "404", + "x-ms-request-id" : "2c7ae6a4-101e-00ed-264d-4e1899000000", + "Body" : "ContainerNotFoundThe specified container does not exist.\nRequestId:2c7ae6a4-101e-00ed-264d-4e1899000000\nTime:2020-06-29T19:40:14.8715676Z", + "Date" : "Mon, 29 Jun 2020 19:40:13 GMT", + "x-ms-client-request-id" : "29099c34-24d6-46fc-935b-63cdc4b92b21", + "Content-Type" : "application/xml" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcazureblobfileattributeviewreadattributes1243094876f1f?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "f38a24e7-53ac-487e-a093-a35a811af4aa" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "ETag" : "0x8D81C643EE173E1", + "Last-Modified" : "Mon, 29 Jun 2020 19:40:15 GMT", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "a3c1b6f0-f01e-00c5-1f4d-4e6f26000000", + "Date" : "Mon, 29 Jun 2020 19:40:14 GMT", + "x-ms-client-request-id" : "f38a24e7-53ac-487e-a093-a35a811af4aa" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcazureblobfileattributeviewreadattributes255884ba4a1c7?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "44423c81-a6bc-4c4b-b455-bd95f3b17413" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-error-code" : "ContainerNotFound", + "retry-after" : "0", + "Content-Length" : "225", + "StatusCode" : "404", + "x-ms-request-id" : "ee81ec04-c01e-0089-0b4d-4ea839000000", + "Body" : "ContainerNotFoundThe specified container does not exist.\nRequestId:ee81ec04-c01e-0089-0b4d-4ea839000000\nTime:2020-06-29T19:40:15.1848518Z", + "Date" : "Mon, 29 Jun 2020 19:40:14 GMT", + "x-ms-client-request-id" : "44423c81-a6bc-4c4b-b455-bd95f3b17413", + "Content-Type" : "application/xml" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcazureblobfileattributeviewreadattributes255884ba4a1c7?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "eb8aad86-979f-4c22-a38f-a9aaa962da98" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "ETag" : "0x8D81C643F129B24", + "Last-Modified" : "Mon, 29 Jun 2020 19:40:15 GMT", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "ea7b241e-501e-0129-314d-4e210a000000", + "Date" : "Mon, 29 Jun 2020 19:40:14 GMT", + "x-ms-client-request-id" : "eb8aad86-979f-4c22-a38f-a9aaa962da98" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcazureblobfileattributeviewreadattributes1243094876f1f/javablobazureblobfileattributeviewreadattributes398226f241", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "5706def7-1fee-41ab-9c4e-1c740dc333bd", + "Content-Type" : "application/octet-stream" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-content-crc64" : "6RYQPwaVsyQ=", + "Last-Modified" : "Mon, 29 Jun 2020 19:40:15 GMT", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-server-encrypted" : "true", + "Date" : "Mon, 29 Jun 2020 19:40:15 GMT", + "Content-MD5" : "wh+Wm18D0z1D4E+PE252gg==", + "ETag" : "0x8D81C643F2AC62A", + "Content-Length" : "0", + "x-ms-request-id" : "58de2568-b01e-0101-3b4d-4e56b5000000", + "x-ms-client-request-id" : "5706def7-1fee-41ab-9c4e-1c740dc333bd" + }, + "Exception" : null + }, { + "Method" : "HEAD", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcazureblobfileattributeviewreadattributes1243094876f1f/javablobazureblobfileattributeviewreadattributes398226f241", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "e9f12b6d-7e3b-4981-be53-be6db6f73685" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "x-ms-lease-status" : "unlocked", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-lease-state" : "available", + "Last-Modified" : "Mon, 29 Jun 2020 19:40:15 GMT", + "retry-after" : "0", + "StatusCode" : "200", + "Date" : "Mon, 29 Jun 2020 19:40:15 GMT", + "x-ms-blob-type" : "BlockBlob", + "Content-MD5" : "wh+Wm18D0z1D4E+PE252gg==", + "Accept-Ranges" : "bytes", + "x-ms-server-encrypted" : "true", + "ETag" : "0x8D81C643F2AC62A", + "x-ms-creation-time" : "Mon, 29 Jun 2020 19:40:15 GMT", + "Content-Length" : "7", + "x-ms-request-id" : "59a07e6c-701e-00b2-714d-4eea67000000", + "x-ms-client-request-id" : "e9f12b6d-7e3b-4981-be53-be6db6f73685", + "Content-Type" : "application/octet-stream" + }, + "Exception" : null + }, { + "Method" : "HEAD", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcazureblobfileattributeviewreadattributes1243094876f1f/javablobazureblobfileattributeviewreadattributes398226f241", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "b5701efe-8eed-4168-af1a-41cdd767d4f2" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "x-ms-lease-status" : "unlocked", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-lease-state" : "available", + "Last-Modified" : "Mon, 29 Jun 2020 19:40:15 GMT", + "retry-after" : "0", + "StatusCode" : "200", + "Date" : "Mon, 29 Jun 2020 19:40:15 GMT", + "x-ms-blob-type" : "BlockBlob", + "Content-MD5" : "wh+Wm18D0z1D4E+PE252gg==", + "Accept-Ranges" : "bytes", + "x-ms-server-encrypted" : "true", + "ETag" : "0x8D81C643F2AC62A", + "x-ms-creation-time" : "Mon, 29 Jun 2020 19:40:15 GMT", + "Content-Length" : "7", + "x-ms-request-id" : "02d9fdbe-601e-012a-5a4d-4e220d000000", + "x-ms-client-request-id" : "b5701efe-8eed-4168-af1a-41cdd767d4f2", + "Content-Type" : "application/octet-stream" + }, + "Exception" : null + }, { + "Method" : "DELETE", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcazureblobfileattributeviewreadattributes1243094876f1f?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "3c457e69-a16a-4f31-9290-18b29acf898a" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "202", + "x-ms-request-id" : "586b1431-201e-00ee-6e4d-4e1b9e000000", + "Date" : "Mon, 29 Jun 2020 19:40:16 GMT", + "x-ms-client-request-id" : "3c457e69-a16a-4f31-9290-18b29acf898a" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.blob.core.windows.net?prefix=jtcazureblobfileattributeviewreadattributes&comp=list", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "feadc28e-f27b-4e13-a7f2-3713c3f55b0c" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "091ab25c-e01e-009e-3c4d-4e685a000000", + "Body" : "jtcazureblobfileattributeviewreadattributesjtcazureblobfileattributeviewreadattributes255884ba4a1c7Mon, 29 Jun 2020 19:40:15 GMT\"0x8D81C643F129B24\"unlockedavailable$account-encryption-keyfalsefalsefalse", + "Date" : "Mon, 29 Jun 2020 19:40:15 GMT", + "x-ms-client-request-id" : "feadc28e-f27b-4e13-a7f2-3713c3f55b0c", + "Content-Type" : "application/xml" + }, + "Exception" : null + }, { + "Method" : "DELETE", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcazureblobfileattributeviewreadattributes255884ba4a1c7?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "0a40e61d-cfdf-46ca-a905-32c04b8412c1" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "202", + "x-ms-request-id" : "fb0b2a83-401e-0076-6c4d-4e95a1000000", + "Date" : "Mon, 29 Jun 2020 19:40:16 GMT", + "x-ms-client-request-id" : "0a40e61d-cfdf-46ca-a905-32c04b8412c1" + }, + "Exception" : null + } ], + "variables" : [ "jtcazureblobfileattributeviewreadattributes081383f279b1f", "jtcazureblobfileattributeviewreadattributes1243094876f1f", "jtcazureblobfileattributeviewreadattributes255884ba4a1c7", "javablobazureblobfileattributeviewreadattributes398226f241" ] +} \ No newline at end of file diff --git a/sdk/storage/azure-storage-blob-nio/src/test/resources/session-records/AttributeViewTestazureblobfileattributeviewsetblobhttpheaders[0].json b/sdk/storage/azure-storage-blob-nio/src/test/resources/session-records/AttributeViewTestazureblobfileattributeviewsetblobhttpheaders[0].json new file mode 100644 index 0000000000000..bfc974a7d5281 --- /dev/null +++ b/sdk/storage/azure-storage-blob-nio/src/test/resources/session-records/AttributeViewTestazureblobfileattributeviewsetblobhttpheaders[0].json @@ -0,0 +1,222 @@ +{ + "networkCallRecords" : [ { + "Method" : "GET", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcazureblobfileattributeviewsetblobhttpheaders1208245463c?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "778cba62-6da2-4c4b-ab7c-ac45105d7aa4" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-error-code" : "ContainerNotFound", + "retry-after" : "0", + "Content-Length" : "225", + "StatusCode" : "404", + "x-ms-request-id" : "eabb4691-201e-00c7-0e4d-4e6ddc000000", + "Body" : "ContainerNotFoundThe specified container does not exist.\nRequestId:eabb4691-201e-00c7-0e4d-4e6ddc000000\nTime:2020-06-29T19:40:16.5947228Z", + "Date" : "Mon, 29 Jun 2020 19:40:16 GMT", + "x-ms-client-request-id" : "778cba62-6da2-4c4b-ab7c-ac45105d7aa4", + "Content-Type" : "application/xml" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcazureblobfileattributeviewsetblobhttpheaders1208245463c?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "bb4d24b2-f5d4-4cf7-a0ed-9ce03b874009" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "ETag" : "0x8D81C643FED6C83", + "Last-Modified" : "Mon, 29 Jun 2020 19:40:16 GMT", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "c3db590e-601e-0103-5a4d-4e544f000000", + "Date" : "Mon, 29 Jun 2020 19:40:16 GMT", + "x-ms-client-request-id" : "bb4d24b2-f5d4-4cf7-a0ed-9ce03b874009" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcazureblobfileattributeviewsetblobhttpheaders284195a5240?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "91a6a220-a1dd-40bf-9190-90726375e4b4" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-error-code" : "ContainerNotFound", + "retry-after" : "0", + "Content-Length" : "225", + "StatusCode" : "404", + "x-ms-request-id" : "58dd7bd5-701e-0117-2d4d-4e972b000000", + "Body" : "ContainerNotFoundThe specified container does not exist.\nRequestId:58dd7bd5-701e-0117-2d4d-4e972b000000\nTime:2020-06-29T19:40:16.9329910Z", + "Date" : "Mon, 29 Jun 2020 19:40:16 GMT", + "x-ms-client-request-id" : "91a6a220-a1dd-40bf-9190-90726375e4b4", + "Content-Type" : "application/xml" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcazureblobfileattributeviewsetblobhttpheaders284195a5240?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "4f8b54bc-d5f2-4cbf-9a4f-c732a4745feb" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "ETag" : "0x8D81C64401E2D27", + "Last-Modified" : "Mon, 29 Jun 2020 19:40:17 GMT", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "9cc51f14-b01e-0063-124d-4e5738000000", + "Date" : "Mon, 29 Jun 2020 19:40:16 GMT", + "x-ms-client-request-id" : "4f8b54bc-d5f2-4cbf-9a4f-c732a4745feb" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcazureblobfileattributeviewsetblobhttpheaders1208245463c/javablobazureblobfileattributeviewsetblobhttpheaders398918a3", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "9920fd45-f931-4b5a-8e61-6da030c2f191", + "Content-Type" : "application/octet-stream" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-content-crc64" : "6RYQPwaVsyQ=", + "Last-Modified" : "Mon, 29 Jun 2020 19:40:17 GMT", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-server-encrypted" : "true", + "Date" : "Mon, 29 Jun 2020 19:40:16 GMT", + "Content-MD5" : "wh+Wm18D0z1D4E+PE252gg==", + "ETag" : "0x8D81C644035C09D", + "Content-Length" : "0", + "x-ms-request-id" : "d5c0f134-901e-00b3-104d-4eeb9a000000", + "x-ms-client-request-id" : "9920fd45-f931-4b5a-8e61-6da030c2f191" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcazureblobfileattributeviewsetblobhttpheaders1208245463c/javablobazureblobfileattributeviewsetblobhttpheaders398918a3?comp=properties", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "a7ee9956-daab-42f3-9c7c-bed3a8dd4936" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "ETag" : "0x8D81C64405165B4", + "Last-Modified" : "Mon, 29 Jun 2020 19:40:17 GMT", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "53b613d6-b01e-0027-344d-4e8b54000000", + "Date" : "Mon, 29 Jun 2020 19:40:16 GMT", + "x-ms-client-request-id" : "a7ee9956-daab-42f3-9c7c-bed3a8dd4936" + }, + "Exception" : null + }, { + "Method" : "HEAD", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcazureblobfileattributeviewsetblobhttpheaders1208245463c/javablobazureblobfileattributeviewsetblobhttpheaders398918a3", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "d0136141-9179-448e-96a9-f4b76a440a45" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "x-ms-lease-status" : "unlocked", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-lease-state" : "available", + "Last-Modified" : "Mon, 29 Jun 2020 19:40:17 GMT", + "retry-after" : "0", + "StatusCode" : "200", + "Date" : "Mon, 29 Jun 2020 19:40:17 GMT", + "x-ms-blob-type" : "BlockBlob", + "Accept-Ranges" : "bytes", + "x-ms-server-encrypted" : "true", + "ETag" : "0x8D81C64405165B4", + "x-ms-creation-time" : "Mon, 29 Jun 2020 19:40:17 GMT", + "Content-Length" : "7", + "x-ms-request-id" : "86e4a555-a01e-0077-3a4d-4e945c000000", + "x-ms-client-request-id" : "d0136141-9179-448e-96a9-f4b76a440a45" + }, + "Exception" : null + }, { + "Method" : "DELETE", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcazureblobfileattributeviewsetblobhttpheaders1208245463c?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "0d865608-dc39-4e35-976d-187e0a051cc5" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "202", + "x-ms-request-id" : "03b07963-d01e-0078-674d-4e79aa000000", + "Date" : "Mon, 29 Jun 2020 19:40:17 GMT", + "x-ms-client-request-id" : "0d865608-dc39-4e35-976d-187e0a051cc5" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.blob.core.windows.net?prefix=jtcazureblobfileattributeviewsetblobhttpheaders&comp=list", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "76038228-59a8-4809-91f9-a027c0bb4736" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "51ce339b-c01e-012c-6d4d-4ed575000000", + "Body" : "jtcazureblobfileattributeviewsetblobhttpheadersjtcazureblobfileattributeviewsetblobhttpheaders284195a5240Mon, 29 Jun 2020 19:40:17 GMT\"0x8D81C64401E2D27\"unlockedavailable$account-encryption-keyfalsefalsefalse", + "Date" : "Mon, 29 Jun 2020 19:40:17 GMT", + "x-ms-client-request-id" : "76038228-59a8-4809-91f9-a027c0bb4736", + "Content-Type" : "application/xml" + }, + "Exception" : null + }, { + "Method" : "DELETE", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcazureblobfileattributeviewsetblobhttpheaders284195a5240?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "13fc397f-e6bc-4bd8-b7e0-acfb19a2ff58" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "202", + "x-ms-request-id" : "913d5855-501e-00c8-224d-4e802a000000", + "Date" : "Mon, 29 Jun 2020 19:40:17 GMT", + "x-ms-client-request-id" : "13fc397f-e6bc-4bd8-b7e0-acfb19a2ff58" + }, + "Exception" : null + } ], + "variables" : [ "jtcazureblobfileattributeviewsetblobhttpheaders039696ec4c9", "jtcazureblobfileattributeviewsetblobhttpheaders1208245463c", "jtcazureblobfileattributeviewsetblobhttpheaders284195a5240", "javablobazureblobfileattributeviewsetblobhttpheaders398918a3" ] +} \ No newline at end of file diff --git a/sdk/storage/azure-storage-blob-nio/src/test/resources/session-records/AttributeViewTestazureblobfileattributeviewsetblobhttpheaders[1].json b/sdk/storage/azure-storage-blob-nio/src/test/resources/session-records/AttributeViewTestazureblobfileattributeviewsetblobhttpheaders[1].json new file mode 100644 index 0000000000000..577879f5b0e0d --- /dev/null +++ b/sdk/storage/azure-storage-blob-nio/src/test/resources/session-records/AttributeViewTestazureblobfileattributeviewsetblobhttpheaders[1].json @@ -0,0 +1,228 @@ +{ + "networkCallRecords" : [ { + "Method" : "GET", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcazureblobfileattributeviewsetblobhttpheaders1907764599f?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "a44e08a6-5a3f-4504-b739-ba0e91b37266" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-error-code" : "ContainerNotFound", + "retry-after" : "0", + "Content-Length" : "225", + "StatusCode" : "404", + "x-ms-request-id" : "1e49c71e-c01e-00a0-534d-4ede7b000000", + "Body" : "ContainerNotFoundThe specified container does not exist.\nRequestId:1e49c71e-c01e-00a0-534d-4ede7b000000\nTime:2020-06-29T19:40:18.2643838Z", + "Date" : "Mon, 29 Jun 2020 19:40:17 GMT", + "x-ms-client-request-id" : "a44e08a6-5a3f-4504-b739-ba0e91b37266", + "Content-Type" : "application/xml" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcazureblobfileattributeviewsetblobhttpheaders1907764599f?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "1b27b2a3-f051-4dd3-be4e-b468aeeb7cbb" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "ETag" : "0x8D81C6440E8F9B4", + "Last-Modified" : "Mon, 29 Jun 2020 19:40:18 GMT", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "86d8b45a-301e-0014-014d-4ed279000000", + "Date" : "Mon, 29 Jun 2020 19:40:17 GMT", + "x-ms-client-request-id" : "1b27b2a3-f051-4dd3-be4e-b468aeeb7cbb" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcazureblobfileattributeviewsetblobhttpheaders2516891726a?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "77fcf6d3-79c0-4358-ba87-da541cd8edd1" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-error-code" : "ContainerNotFound", + "retry-after" : "0", + "Content-Length" : "225", + "StatusCode" : "404", + "x-ms-request-id" : "82e714e2-f01e-0064-3c4d-4ea1bd000000", + "Body" : "ContainerNotFoundThe specified container does not exist.\nRequestId:82e714e2-f01e-0064-3c4d-4ea1bd000000\nTime:2020-06-29T19:40:18.6100852Z", + "Date" : "Mon, 29 Jun 2020 19:40:17 GMT", + "x-ms-client-request-id" : "77fcf6d3-79c0-4358-ba87-da541cd8edd1", + "Content-Type" : "application/xml" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcazureblobfileattributeviewsetblobhttpheaders2516891726a?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "4cb3648f-57bc-4c0a-9bdb-3f5b31b634ba" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "ETag" : "0x8D81C64411DC5FA", + "Last-Modified" : "Mon, 29 Jun 2020 19:40:18 GMT", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "8e31e70a-c01e-0028-6c4d-4e66a2000000", + "Date" : "Mon, 29 Jun 2020 19:40:18 GMT", + "x-ms-client-request-id" : "4cb3648f-57bc-4c0a-9bdb-3f5b31b634ba" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcazureblobfileattributeviewsetblobhttpheaders1907764599f/javablobazureblobfileattributeviewsetblobhttpheaders305001ad", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "1127283f-5ab4-49f5-a044-1924d9d3a53f", + "Content-Type" : "application/octet-stream" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-content-crc64" : "6RYQPwaVsyQ=", + "Last-Modified" : "Mon, 29 Jun 2020 19:40:18 GMT", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-server-encrypted" : "true", + "Date" : "Mon, 29 Jun 2020 19:40:18 GMT", + "Content-MD5" : "wh+Wm18D0z1D4E+PE252gg==", + "ETag" : "0x8D81C64413609DE", + "Content-Length" : "0", + "x-ms-request-id" : "a6c0b9d6-201e-0000-5e4d-4e111d000000", + "x-ms-client-request-id" : "1127283f-5ab4-49f5-a044-1924d9d3a53f" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcazureblobfileattributeviewsetblobhttpheaders1907764599f/javablobazureblobfileattributeviewsetblobhttpheaders305001ad?comp=properties", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "3fff9b6f-b32a-40a9-bdeb-e3120259bb82" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "ETag" : "0x8D81C64414E0486", + "Last-Modified" : "Mon, 29 Jun 2020 19:40:19 GMT", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "307a6246-101e-0065-154d-4ea040000000", + "Date" : "Mon, 29 Jun 2020 19:40:18 GMT", + "x-ms-client-request-id" : "3fff9b6f-b32a-40a9-bdeb-e3120259bb82" + }, + "Exception" : null + }, { + "Method" : "HEAD", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcazureblobfileattributeviewsetblobhttpheaders1907764599f/javablobazureblobfileattributeviewsetblobhttpheaders305001ad", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "a94200ec-b8f0-4458-b12c-ed4f705cb5b9" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "x-ms-lease-status" : "unlocked", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-lease-state" : "available", + "Last-Modified" : "Mon, 29 Jun 2020 19:40:19 GMT", + "retry-after" : "0", + "StatusCode" : "200", + "Date" : "Mon, 29 Jun 2020 19:40:19 GMT", + "x-ms-blob-type" : "BlockBlob", + "Content-MD5" : "d2grV20xOEQwejFENEUrUEUyNTJnZz09", + "Accept-Ranges" : "bytes", + "x-ms-server-encrypted" : "true", + "Cache-Control" : "control", + "ETag" : "0x8D81C64414E0486", + "Content-Disposition" : "disposition", + "Content-Encoding" : "encoding", + "x-ms-creation-time" : "Mon, 29 Jun 2020 19:40:18 GMT", + "Content-Length" : "7", + "x-ms-request-id" : "30042751-d01e-0051-0e4d-4e0fe8000000", + "x-ms-client-request-id" : "a94200ec-b8f0-4458-b12c-ed4f705cb5b9", + "Content-Language" : "language", + "Content-Type" : "type" + }, + "Exception" : null + }, { + "Method" : "DELETE", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcazureblobfileattributeviewsetblobhttpheaders1907764599f?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "1675a793-63f2-436f-86fd-5e3dd5f029a1" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "202", + "x-ms-request-id" : "0efd6387-301e-003d-6c4d-4ea43b000000", + "Date" : "Mon, 29 Jun 2020 19:40:19 GMT", + "x-ms-client-request-id" : "1675a793-63f2-436f-86fd-5e3dd5f029a1" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.blob.core.windows.net?prefix=jtcazureblobfileattributeviewsetblobhttpheaders&comp=list", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "47d5c593-273b-4766-aec4-44b21627ef56" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "2c71cf8b-d01e-0015-554d-4ed384000000", + "Body" : "jtcazureblobfileattributeviewsetblobhttpheadersjtcazureblobfileattributeviewsetblobhttpheaders2516891726aMon, 29 Jun 2020 19:40:18 GMT\"0x8D81C64411DC5FA\"unlockedavailable$account-encryption-keyfalsefalsefalse", + "Date" : "Mon, 29 Jun 2020 19:40:19 GMT", + "x-ms-client-request-id" : "47d5c593-273b-4766-aec4-44b21627ef56", + "Content-Type" : "application/xml" + }, + "Exception" : null + }, { + "Method" : "DELETE", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcazureblobfileattributeviewsetblobhttpheaders2516891726a?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "ff8f6892-318a-4b40-8884-250f0aa97dfb" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "202", + "x-ms-request-id" : "adbffc80-b01e-008d-724d-4e5dbb000000", + "Date" : "Mon, 29 Jun 2020 19:40:19 GMT", + "x-ms-client-request-id" : "ff8f6892-318a-4b40-8884-250f0aa97dfb" + }, + "Exception" : null + } ], + "variables" : [ "jtcazureblobfileattributeviewsetblobhttpheaders09257322d37", "jtcazureblobfileattributeviewsetblobhttpheaders1907764599f", "jtcazureblobfileattributeviewsetblobhttpheaders2516891726a", "javablobazureblobfileattributeviewsetblobhttpheaders305001ad" ] +} \ No newline at end of file diff --git a/sdk/storage/azure-storage-blob-nio/src/test/resources/session-records/AttributeViewTestazureblobfileattributeviewsetmetadata[0].json b/sdk/storage/azure-storage-blob-nio/src/test/resources/session-records/AttributeViewTestazureblobfileattributeviewsetmetadata[0].json new file mode 100644 index 0000000000000..5f298938eb88b --- /dev/null +++ b/sdk/storage/azure-storage-blob-nio/src/test/resources/session-records/AttributeViewTestazureblobfileattributeviewsetmetadata[0].json @@ -0,0 +1,225 @@ +{ + "networkCallRecords" : [ { + "Method" : "GET", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcazureblobfileattributeviewsetmetadata1287156eea4813?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "70fc84cf-e086-4aa7-b71d-a021d2634eca" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-error-code" : "ContainerNotFound", + "retry-after" : "0", + "Content-Length" : "225", + "StatusCode" : "404", + "x-ms-request-id" : "9c5d4d2a-e01e-0119-074d-4e7b20000000", + "Body" : "ContainerNotFoundThe specified container does not exist.\nRequestId:9c5d4d2a-e01e-0119-074d-4e7b20000000\nTime:2020-06-29T19:40:19.9080338Z", + "Date" : "Mon, 29 Jun 2020 19:40:19 GMT", + "x-ms-client-request-id" : "70fc84cf-e086-4aa7-b71d-a021d2634eca", + "Content-Type" : "application/xml" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcazureblobfileattributeviewsetmetadata1287156eea4813?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "cea179a2-d4a3-43b3-872d-ecc344a65bb1" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "ETag" : "0x8D81C6441E35194", + "Last-Modified" : "Mon, 29 Jun 2020 19:40:20 GMT", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "20195493-001e-003e-214d-4ea73c000000", + "Date" : "Mon, 29 Jun 2020 19:40:19 GMT", + "x-ms-client-request-id" : "cea179a2-d4a3-43b3-872d-ecc344a65bb1" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcazureblobfileattributeviewsetmetadata279163fca7e9da?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "31e18bf9-9111-4625-a3d1-81844f6d8252" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-error-code" : "ContainerNotFound", + "retry-after" : "0", + "Content-Length" : "225", + "StatusCode" : "404", + "x-ms-request-id" : "42e8f18a-901e-00de-3d4d-4e41b4000000", + "Body" : "ContainerNotFoundThe specified container does not exist.\nRequestId:42e8f18a-901e-00de-3d4d-4e41b4000000\nTime:2020-06-29T19:40:20.2172939Z", + "Date" : "Mon, 29 Jun 2020 19:40:19 GMT", + "x-ms-client-request-id" : "31e18bf9-9111-4625-a3d1-81844f6d8252", + "Content-Type" : "application/xml" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcazureblobfileattributeviewsetmetadata279163fca7e9da?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "821c3d5e-70ec-4781-9529-937fa883ca5c" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "ETag" : "0x8D81C644212184A", + "Last-Modified" : "Mon, 29 Jun 2020 19:40:20 GMT", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "986cc358-d01e-011a-604d-4e7827000000", + "Date" : "Mon, 29 Jun 2020 19:40:19 GMT", + "x-ms-client-request-id" : "821c3d5e-70ec-4781-9529-937fa883ca5c" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcazureblobfileattributeviewsetmetadata1287156eea4813/javablobazureblobfileattributeviewsetmetadata3305536d3f34", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "4b86e03a-3fa9-4d1c-af68-190ac9961e63", + "Content-Type" : "application/octet-stream" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-content-crc64" : "6RYQPwaVsyQ=", + "Last-Modified" : "Mon, 29 Jun 2020 19:40:20 GMT", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-server-encrypted" : "true", + "Date" : "Mon, 29 Jun 2020 19:40:19 GMT", + "Content-MD5" : "wh+Wm18D0z1D4E+PE252gg==", + "ETag" : "0x8D81C64422A426C", + "Content-Length" : "0", + "x-ms-request-id" : "59d9eb68-101e-002a-0a4d-4e6458000000", + "x-ms-client-request-id" : "4b86e03a-3fa9-4d1c-af68-190ac9961e63" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcazureblobfileattributeviewsetmetadata1287156eea4813/javablobazureblobfileattributeviewsetmetadata3305536d3f34?comp=metadata", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "f7082177-0d92-448b-b2b2-bdf2b871e39b" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "ETag" : "0x8D81C6442457239", + "Last-Modified" : "Mon, 29 Jun 2020 19:40:20 GMT", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "9148b119-001e-00b6-494d-4e1fe5000000", + "x-ms-request-server-encrypted" : "true", + "Date" : "Mon, 29 Jun 2020 19:40:20 GMT", + "x-ms-client-request-id" : "f7082177-0d92-448b-b2b2-bdf2b871e39b" + }, + "Exception" : null + }, { + "Method" : "HEAD", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcazureblobfileattributeviewsetmetadata1287156eea4813/javablobazureblobfileattributeviewsetmetadata3305536d3f34", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "2a9c4dd5-b1f5-4bb5-b291-a29fb6f2896d" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "x-ms-lease-status" : "unlocked", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-lease-state" : "available", + "Last-Modified" : "Mon, 29 Jun 2020 19:40:20 GMT", + "retry-after" : "0", + "StatusCode" : "200", + "Date" : "Mon, 29 Jun 2020 19:40:20 GMT", + "x-ms-blob-type" : "BlockBlob", + "Content-MD5" : "wh+Wm18D0z1D4E+PE252gg==", + "Accept-Ranges" : "bytes", + "x-ms-server-encrypted" : "true", + "ETag" : "0x8D81C6442457239", + "x-ms-creation-time" : "Mon, 29 Jun 2020 19:40:20 GMT", + "Content-Length" : "7", + "x-ms-request-id" : "e4abeef3-801e-00ca-464d-4e82d0000000", + "x-ms-client-request-id" : "2a9c4dd5-b1f5-4bb5-b291-a29fb6f2896d", + "Content-Type" : "application/octet-stream" + }, + "Exception" : null + }, { + "Method" : "DELETE", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcazureblobfileattributeviewsetmetadata1287156eea4813?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "894b6be7-ee03-4422-a8cd-3d53f9d7bb7c" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "202", + "x-ms-request-id" : "2988c8f8-f01e-0002-184d-4e13e7000000", + "Date" : "Mon, 29 Jun 2020 19:40:20 GMT", + "x-ms-client-request-id" : "894b6be7-ee03-4422-a8cd-3d53f9d7bb7c" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.blob.core.windows.net?prefix=jtcazureblobfileattributeviewsetmetadata&comp=list", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "f22db0d1-0a67-4b63-bae2-6e7810f46a25" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "e1d980e7-001e-00f2-584d-4ec389000000", + "Body" : "jtcazureblobfileattributeviewsetmetadatajtcazureblobfileattributeviewsetmetadata279163fca7e9daMon, 29 Jun 2020 19:40:20 GMT\"0x8D81C644212184A\"unlockedavailable$account-encryption-keyfalsefalsefalse", + "Date" : "Mon, 29 Jun 2020 19:40:21 GMT", + "x-ms-client-request-id" : "f22db0d1-0a67-4b63-bae2-6e7810f46a25", + "Content-Type" : "application/xml" + }, + "Exception" : null + }, { + "Method" : "DELETE", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcazureblobfileattributeviewsetmetadata279163fca7e9da?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "175a560c-bfee-4712-8199-350af34f8d20" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "202", + "x-ms-request-id" : "f66e798a-301e-011b-474d-4e79da000000", + "Date" : "Mon, 29 Jun 2020 19:40:20 GMT", + "x-ms-client-request-id" : "175a560c-bfee-4712-8199-350af34f8d20" + }, + "Exception" : null + } ], + "variables" : [ "jtcazureblobfileattributeviewsetmetadata00333393f5fe0b", "jtcazureblobfileattributeviewsetmetadata1287156eea4813", "jtcazureblobfileattributeviewsetmetadata279163fca7e9da", "javablobazureblobfileattributeviewsetmetadata3305536d3f34" ] +} \ No newline at end of file diff --git a/sdk/storage/azure-storage-blob-nio/src/test/resources/session-records/AttributeViewTestazureblobfileattributeviewsetmetadata[1].json b/sdk/storage/azure-storage-blob-nio/src/test/resources/session-records/AttributeViewTestazureblobfileattributeviewsetmetadata[1].json new file mode 100644 index 0000000000000..3dad97b8493cb --- /dev/null +++ b/sdk/storage/azure-storage-blob-nio/src/test/resources/session-records/AttributeViewTestazureblobfileattributeviewsetmetadata[1].json @@ -0,0 +1,227 @@ +{ + "networkCallRecords" : [ { + "Method" : "GET", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcazureblobfileattributeviewsetmetadata148312f97609d5?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "a22cab92-03cf-4952-97bf-fd928eb319b9" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-error-code" : "ContainerNotFound", + "retry-after" : "0", + "Content-Length" : "225", + "StatusCode" : "404", + "x-ms-request-id" : "e77b3974-c01e-0067-644d-4ea2ba000000", + "Body" : "ContainerNotFoundThe specified container does not exist.\nRequestId:e77b3974-c01e-0067-644d-4ea2ba000000\nTime:2020-06-29T19:40:21.5072183Z", + "Date" : "Mon, 29 Jun 2020 19:40:21 GMT", + "x-ms-client-request-id" : "a22cab92-03cf-4952-97bf-fd928eb319b9", + "Content-Type" : "application/xml" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcazureblobfileattributeviewsetmetadata148312f97609d5?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "1b770d4d-10a6-4714-b628-6410cdeaa384" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "ETag" : "0x8D81C6442D5B8DB", + "Last-Modified" : "Mon, 29 Jun 2020 19:40:21 GMT", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "d2c7066c-f01e-00a3-224d-4edd7c000000", + "Date" : "Mon, 29 Jun 2020 19:40:21 GMT", + "x-ms-client-request-id" : "1b770d4d-10a6-4714-b628-6410cdeaa384" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcazureblobfileattributeviewsetmetadata289903ced97ff8?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "33adbf86-5cb3-4188-a6a6-8bffc6f02b10" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-error-code" : "ContainerNotFound", + "retry-after" : "0", + "Content-Length" : "225", + "StatusCode" : "404", + "x-ms-request-id" : "69ef3223-101e-0003-154d-4e121a000000", + "Body" : "ContainerNotFoundThe specified container does not exist.\nRequestId:69ef3223-101e-0003-154d-4e121a000000\nTime:2020-06-29T19:40:21.8727187Z", + "Date" : "Mon, 29 Jun 2020 19:40:21 GMT", + "x-ms-client-request-id" : "33adbf86-5cb3-4188-a6a6-8bffc6f02b10", + "Content-Type" : "application/xml" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcazureblobfileattributeviewsetmetadata289903ced97ff8?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "4bcf3639-c0b6-4bf7-a7bd-b4bfa543b9e7" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "ETag" : "0x8D81C64430DFBB6", + "Last-Modified" : "Mon, 29 Jun 2020 19:40:22 GMT", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "9f56b4b3-e01e-007b-614d-4e7aad000000", + "Date" : "Mon, 29 Jun 2020 19:40:21 GMT", + "x-ms-client-request-id" : "4bcf3639-c0b6-4bf7-a7bd-b4bfa543b9e7" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcazureblobfileattributeviewsetmetadata148312f97609d5/javablobazureblobfileattributeviewsetmetadata348754339750", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "029e601e-542d-4d65-ae61-2d869efc9972", + "Content-Type" : "application/octet-stream" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-content-crc64" : "6RYQPwaVsyQ=", + "Last-Modified" : "Mon, 29 Jun 2020 19:40:22 GMT", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-server-encrypted" : "true", + "Date" : "Mon, 29 Jun 2020 19:40:21 GMT", + "Content-MD5" : "wh+Wm18D0z1D4E+PE252gg==", + "ETag" : "0x8D81C644327CC24", + "Content-Length" : "0", + "x-ms-request-id" : "561b890e-b01e-00a4-3d4d-4e2bf9000000", + "x-ms-client-request-id" : "029e601e-542d-4d65-ae61-2d869efc9972" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcazureblobfileattributeviewsetmetadata148312f97609d5/javablobazureblobfileattributeviewsetmetadata348754339750?comp=metadata", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "64a15ccc-90cd-45de-958c-755702fda38e" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "ETag" : "0x8D81C64434174E4", + "Last-Modified" : "Mon, 29 Jun 2020 19:40:22 GMT", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "2cd136c1-b01e-00e0-084d-4ef795000000", + "x-ms-request-server-encrypted" : "true", + "Date" : "Mon, 29 Jun 2020 19:40:21 GMT", + "x-ms-client-request-id" : "64a15ccc-90cd-45de-958c-755702fda38e" + }, + "Exception" : null + }, { + "Method" : "HEAD", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcazureblobfileattributeviewsetmetadata148312f97609d5/javablobazureblobfileattributeviewsetmetadata348754339750", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "074acc39-1dfb-45b3-a010-be1a2949d322" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "x-ms-lease-status" : "unlocked", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-lease-state" : "available", + "Last-Modified" : "Mon, 29 Jun 2020 19:40:22 GMT", + "retry-after" : "0", + "StatusCode" : "200", + "Date" : "Mon, 29 Jun 2020 19:40:21 GMT", + "x-ms-meta-foo" : "bar", + "x-ms-blob-type" : "BlockBlob", + "Content-MD5" : "wh+Wm18D0z1D4E+PE252gg==", + "Accept-Ranges" : "bytes", + "x-ms-server-encrypted" : "true", + "ETag" : "0x8D81C64434174E4", + "x-ms-creation-time" : "Mon, 29 Jun 2020 19:40:22 GMT", + "Content-Length" : "7", + "x-ms-request-id" : "a314ec56-701e-0090-544d-4e8451000000", + "x-ms-meta-fizz" : "buzz", + "x-ms-client-request-id" : "074acc39-1dfb-45b3-a010-be1a2949d322", + "Content-Type" : "application/octet-stream" + }, + "Exception" : null + }, { + "Method" : "DELETE", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcazureblobfileattributeviewsetmetadata148312f97609d5?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "1c613d0f-9762-4ce9-8d2e-8c5cc2456074" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "202", + "x-ms-request-id" : "c5abdfd3-701e-011c-3a4d-4e8f5f000000", + "Date" : "Mon, 29 Jun 2020 19:40:22 GMT", + "x-ms-client-request-id" : "1c613d0f-9762-4ce9-8d2e-8c5cc2456074" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.blob.core.windows.net?prefix=jtcazureblobfileattributeviewsetmetadata&comp=list", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "7bd67191-f6eb-46be-87f9-2722a2e52ca7" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "14605306-901e-00b8-4e4d-4ef3ee000000", + "Body" : "jtcazureblobfileattributeviewsetmetadatajtcazureblobfileattributeviewsetmetadata289903ced97ff8Mon, 29 Jun 2020 19:40:22 GMT\"0x8D81C64430DFBB6\"unlockedavailable$account-encryption-keyfalsefalsefalse", + "Date" : "Mon, 29 Jun 2020 19:40:21 GMT", + "x-ms-client-request-id" : "7bd67191-f6eb-46be-87f9-2722a2e52ca7", + "Content-Type" : "application/xml" + }, + "Exception" : null + }, { + "Method" : "DELETE", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcazureblobfileattributeviewsetmetadata289903ced97ff8?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "e3aedc72-f5f2-4e78-8371-b3534c9f53dd" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "202", + "x-ms-request-id" : "d582816d-401e-0054-1b4d-4efb97000000", + "Date" : "Mon, 29 Jun 2020 19:40:22 GMT", + "x-ms-client-request-id" : "e3aedc72-f5f2-4e78-8371-b3534c9f53dd" + }, + "Exception" : null + } ], + "variables" : [ "jtcazureblobfileattributeviewsetmetadata0727936d06d434", "jtcazureblobfileattributeviewsetmetadata148312f97609d5", "jtcazureblobfileattributeviewsetmetadata289903ced97ff8", "javablobazureblobfileattributeviewsetmetadata348754339750" ] +} \ No newline at end of file diff --git a/sdk/storage/azure-storage-blob-nio/src/test/resources/session-records/AttributeViewTestazureblobfileattributeviewsetmetadata[2].json b/sdk/storage/azure-storage-blob-nio/src/test/resources/session-records/AttributeViewTestazureblobfileattributeviewsetmetadata[2].json new file mode 100644 index 0000000000000..fbcba48165d18 --- /dev/null +++ b/sdk/storage/azure-storage-blob-nio/src/test/resources/session-records/AttributeViewTestazureblobfileattributeviewsetmetadata[2].json @@ -0,0 +1,227 @@ +{ + "networkCallRecords" : [ { + "Method" : "GET", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcazureblobfileattributeviewsetmetadata142301485adc3d?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "dc77676e-ad75-4e76-819f-fd596ae57e37" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-error-code" : "ContainerNotFound", + "retry-after" : "0", + "Content-Length" : "225", + "StatusCode" : "404", + "x-ms-request-id" : "f47dc1f5-b01e-0068-2e4d-4e4f4c000000", + "Body" : "ContainerNotFoundThe specified container does not exist.\nRequestId:f47dc1f5-b01e-0068-2e4d-4e4f4c000000\nTime:2020-06-29T19:40:23.1728842Z", + "Date" : "Mon, 29 Jun 2020 19:40:23 GMT", + "x-ms-client-request-id" : "dc77676e-ad75-4e76-819f-fd596ae57e37", + "Content-Type" : "application/xml" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcazureblobfileattributeviewsetmetadata142301485adc3d?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "090ac837-bbd3-4e48-a76f-8bba73bf7b75" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "ETag" : "0x8D81C6443D4C551", + "Last-Modified" : "Mon, 29 Jun 2020 19:40:23 GMT", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "81d02ca4-501e-00e1-474d-4ef668000000", + "Date" : "Mon, 29 Jun 2020 19:40:22 GMT", + "x-ms-client-request-id" : "090ac837-bbd3-4e48-a76f-8bba73bf7b75" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcazureblobfileattributeviewsetmetadata25792548be6df6?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "54694ec0-f88b-40e5-86db-4908f41577af" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-error-code" : "ContainerNotFound", + "retry-after" : "0", + "Content-Length" : "225", + "StatusCode" : "404", + "x-ms-request-id" : "98da0bb8-501e-00a5-5a4d-4e2a04000000", + "Body" : "ContainerNotFoundThe specified container does not exist.\nRequestId:98da0bb8-501e-00a5-5a4d-4e2a04000000\nTime:2020-06-29T19:40:23.4748585Z", + "Date" : "Mon, 29 Jun 2020 19:40:23 GMT", + "x-ms-client-request-id" : "54694ec0-f88b-40e5-86db-4908f41577af", + "Content-Type" : "application/xml" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcazureblobfileattributeviewsetmetadata25792548be6df6?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "1b447276-7b06-4d55-b2d5-a5854487f981" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "ETag" : "0x8D81C64440592A4", + "Last-Modified" : "Mon, 29 Jun 2020 19:40:23 GMT", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "5badda8c-b01e-0005-1f4d-4ee562000000", + "Date" : "Mon, 29 Jun 2020 19:40:23 GMT", + "x-ms-client-request-id" : "1b447276-7b06-4d55-b2d5-a5854487f981" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcazureblobfileattributeviewsetmetadata142301485adc3d/javablobazureblobfileattributeviewsetmetadata380542cec541", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "51e0672f-4b99-4738-8ceb-7a2f4160a6a0", + "Content-Type" : "application/octet-stream" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-content-crc64" : "6RYQPwaVsyQ=", + "Last-Modified" : "Mon, 29 Jun 2020 19:40:23 GMT", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-server-encrypted" : "true", + "Date" : "Mon, 29 Jun 2020 19:40:23 GMT", + "Content-MD5" : "wh+Wm18D0z1D4E+PE252gg==", + "ETag" : "0x8D81C64441E4F37", + "Content-Length" : "0", + "x-ms-request-id" : "6fb867c2-b01e-0041-5a4d-4e390e000000", + "x-ms-client-request-id" : "51e0672f-4b99-4738-8ceb-7a2f4160a6a0" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcazureblobfileattributeviewsetmetadata142301485adc3d/javablobazureblobfileattributeviewsetmetadata380542cec541?comp=metadata", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "888419c8-632d-4349-a6cb-a5e053fc9451" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "ETag" : "0x8D81C644435AD83", + "Last-Modified" : "Mon, 29 Jun 2020 19:40:23 GMT", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "bb253f8b-801e-0109-624d-4e4dc6000000", + "x-ms-request-server-encrypted" : "true", + "Date" : "Mon, 29 Jun 2020 19:40:23 GMT", + "x-ms-client-request-id" : "888419c8-632d-4349-a6cb-a5e053fc9451" + }, + "Exception" : null + }, { + "Method" : "HEAD", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcazureblobfileattributeviewsetmetadata142301485adc3d/javablobazureblobfileattributeviewsetmetadata380542cec541", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "3ce915d2-140a-43fd-a25d-a8df6588d4ad" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "x-ms-lease-status" : "unlocked", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-lease-state" : "available", + "Last-Modified" : "Mon, 29 Jun 2020 19:40:23 GMT", + "retry-after" : "0", + "StatusCode" : "200", + "x-ms-meta-i_" : "a", + "Date" : "Mon, 29 Jun 2020 19:40:23 GMT", + "x-ms-blob-type" : "BlockBlob", + "Content-MD5" : "wh+Wm18D0z1D4E+PE252gg==", + "Accept-Ranges" : "bytes", + "x-ms-server-encrypted" : "true", + "ETag" : "0x8D81C644435AD83", + "x-ms-creation-time" : "Mon, 29 Jun 2020 19:40:23 GMT", + "Content-Length" : "7", + "x-ms-meta-i0" : "a", + "x-ms-request-id" : "266d4e72-501e-0069-554d-4e4eb1000000", + "x-ms-client-request-id" : "3ce915d2-140a-43fd-a25d-a8df6588d4ad", + "Content-Type" : "application/octet-stream" + }, + "Exception" : null + }, { + "Method" : "DELETE", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcazureblobfileattributeviewsetmetadata142301485adc3d?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "c67477dc-9985-4a8f-9d1c-373df50adaf3" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "202", + "x-ms-request-id" : "ef11234d-901e-0019-144d-4e3d75000000", + "Date" : "Mon, 29 Jun 2020 19:40:23 GMT", + "x-ms-client-request-id" : "c67477dc-9985-4a8f-9d1c-373df50adaf3" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.blob.core.windows.net?prefix=jtcazureblobfileattributeviewsetmetadata&comp=list", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "fb40324c-de86-427a-a354-a4179fb5aa5c" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "4e738b91-601e-00e2-774d-4ef56f000000", + "Body" : "jtcazureblobfileattributeviewsetmetadatajtcazureblobfileattributeviewsetmetadata25792548be6df6Mon, 29 Jun 2020 19:40:23 GMT\"0x8D81C64440592A4\"unlockedavailable$account-encryption-keyfalsefalsefalse", + "Date" : "Mon, 29 Jun 2020 19:40:23 GMT", + "x-ms-client-request-id" : "fb40324c-de86-427a-a354-a4179fb5aa5c", + "Content-Type" : "application/xml" + }, + "Exception" : null + }, { + "Method" : "DELETE", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcazureblobfileattributeviewsetmetadata25792548be6df6?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "7e3bf435-3366-4a33-85ff-2d49644a7613" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "202", + "x-ms-request-id" : "99295a1b-401e-00ba-384d-4ef114000000", + "Date" : "Mon, 29 Jun 2020 19:40:24 GMT", + "x-ms-client-request-id" : "7e3bf435-3366-4a33-85ff-2d49644a7613" + }, + "Exception" : null + } ], + "variables" : [ "jtcazureblobfileattributeviewsetmetadata0838483b91d445", "jtcazureblobfileattributeviewsetmetadata142301485adc3d", "jtcazureblobfileattributeviewsetmetadata25792548be6df6", "javablobazureblobfileattributeviewsetmetadata380542cec541" ] +} \ No newline at end of file diff --git a/sdk/storage/azure-storage-blob-nio/src/test/resources/session-records/AttributeViewTestazureblobfileattributeviewsettier[0].json b/sdk/storage/azure-storage-blob-nio/src/test/resources/session-records/AttributeViewTestazureblobfileattributeviewsettier[0].json new file mode 100644 index 0000000000000..d25d1f4febd2d --- /dev/null +++ b/sdk/storage/azure-storage-blob-nio/src/test/resources/session-records/AttributeViewTestazureblobfileattributeviewsettier[0].json @@ -0,0 +1,224 @@ +{ + "networkCallRecords" : [ { + "Method" : "GET", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcazureblobfileattributeviewsettier16403717bac9fde3?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "e67a1913-8d3a-4d86-bc4a-cc31e5535e32" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-error-code" : "ContainerNotFound", + "retry-after" : "0", + "Content-Length" : "225", + "StatusCode" : "404", + "x-ms-request-id" : "94ab526a-801e-0087-804d-4e01fb000000", + "Body" : "ContainerNotFoundThe specified container does not exist.\nRequestId:94ab526a-801e-0087-804d-4e01fb000000\nTime:2020-06-29T19:42:05.6979964Z", + "Date" : "Mon, 29 Jun 2020 19:42:05 GMT", + "x-ms-client-request-id" : "e67a1913-8d3a-4d86-bc4a-cc31e5535e32", + "Content-Type" : "application/xml" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcazureblobfileattributeviewsettier16403717bac9fde3?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "d12ffd05-80d4-4582-af0f-f528e1f77efe" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "ETag" : "0x8D81C648105E4EC", + "Last-Modified" : "Mon, 29 Jun 2020 19:42:05 GMT", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "9503a53d-001e-005a-064d-4e5255000000", + "Date" : "Mon, 29 Jun 2020 19:42:05 GMT", + "x-ms-client-request-id" : "d12ffd05-80d4-4582-af0f-f528e1f77efe" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcazureblobfileattributeviewsettier28785554ed0c1983?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "75f9a02b-b3a2-4c18-8611-14f02768dd19" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-error-code" : "ContainerNotFound", + "retry-after" : "0", + "Content-Length" : "225", + "StatusCode" : "404", + "x-ms-request-id" : "aab76c63-301e-0130-3d4d-4e48ab000000", + "Body" : "ContainerNotFoundThe specified container does not exist.\nRequestId:aab76c63-301e-0130-3d4d-4e48ab000000\nTime:2020-06-29T19:42:06.2673923Z", + "Date" : "Mon, 29 Jun 2020 19:42:05 GMT", + "x-ms-client-request-id" : "75f9a02b-b3a2-4c18-8611-14f02768dd19", + "Content-Type" : "application/xml" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcazureblobfileattributeviewsettier28785554ed0c1983?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "eff4608b-ee70-4ea8-b96a-01e149987561" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "ETag" : "0x8D81C64814BB9B9", + "Last-Modified" : "Mon, 29 Jun 2020 19:42:06 GMT", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "996947dc-601e-0027-544d-4ece9d000000", + "Date" : "Mon, 29 Jun 2020 19:42:05 GMT", + "x-ms-client-request-id" : "eff4608b-ee70-4ea8-b96a-01e149987561" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcazureblobfileattributeviewsettier16403717bac9fde3/javablobazureblobfileattributeviewsettier3622648397f146", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "02e713bf-9d6a-44d0-a572-b5f65d2fec55", + "Content-Type" : "application/octet-stream" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-content-crc64" : "6RYQPwaVsyQ=", + "Last-Modified" : "Mon, 29 Jun 2020 19:42:06 GMT", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-server-encrypted" : "true", + "Date" : "Mon, 29 Jun 2020 19:42:06 GMT", + "Content-MD5" : "wh+Wm18D0z1D4E+PE252gg==", + "ETag" : "0x8D81C64817623DD", + "Content-Length" : "0", + "x-ms-request-id" : "d02510fa-001e-0111-524d-4e259a000000", + "x-ms-client-request-id" : "02e713bf-9d6a-44d0-a572-b5f65d2fec55" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcazureblobfileattributeviewsettier16403717bac9fde3/javablobazureblobfileattributeviewsettier3622648397f146?comp=tier", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "ab3ef49b-eeb2-4797-988b-6abc27f67104" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "f976cd99-001e-0133-554d-4e4bac000000", + "Date" : "Mon, 29 Jun 2020 19:42:06 GMT", + "x-ms-client-request-id" : "ab3ef49b-eeb2-4797-988b-6abc27f67104" + }, + "Exception" : null + }, { + "Method" : "HEAD", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcazureblobfileattributeviewsettier16403717bac9fde3/javablobazureblobfileattributeviewsettier3622648397f146", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "2ae52def-193b-4684-8c00-38735b056980" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "x-ms-lease-status" : "unlocked", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-lease-state" : "available", + "Last-Modified" : "Mon, 29 Jun 2020 19:42:06 GMT", + "retry-after" : "0", + "x-ms-access-tier-change-time" : "Mon, 29 Jun 2020 19:42:06 GMT", + "StatusCode" : "200", + "Date" : "Mon, 29 Jun 2020 19:42:06 GMT", + "x-ms-blob-type" : "BlockBlob", + "Content-MD5" : "wh+Wm18D0z1D4E+PE252gg==", + "Accept-Ranges" : "bytes", + "x-ms-server-encrypted" : "true", + "x-ms-access-tier" : "Hot", + "ETag" : "0x8D81C64817623DD", + "x-ms-creation-time" : "Mon, 29 Jun 2020 19:42:06 GMT", + "Content-Length" : "7", + "x-ms-request-id" : "d9b42df1-f01e-0066-314d-4ee68e000000", + "x-ms-client-request-id" : "2ae52def-193b-4684-8c00-38735b056980", + "Content-Type" : "application/octet-stream" + }, + "Exception" : null + }, { + "Method" : "DELETE", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcazureblobfileattributeviewsettier16403717bac9fde3?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "3d14d0ba-00af-4ccf-8c17-78d24cd91d58" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "202", + "x-ms-request-id" : "35599041-e01e-001f-6f4d-4e8fc4000000", + "Date" : "Mon, 29 Jun 2020 19:42:06 GMT", + "x-ms-client-request-id" : "3d14d0ba-00af-4ccf-8c17-78d24cd91d58" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.blob.core.windows.net?prefix=jtcazureblobfileattributeviewsettier&comp=list", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "f60989f8-b3be-420d-ad50-6e228e01c22f" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "f154804f-f01e-004f-0b4d-4e90cc000000", + "Body" : "jtcazureblobfileattributeviewsettierjtcazureblobfileattributeviewsettier28785554ed0c1983Mon, 29 Jun 2020 19:42:06 GMT\"0x8D81C64814BB9B9\"unlockedavailable$account-encryption-keyfalsefalsefalse", + "Date" : "Mon, 29 Jun 2020 19:42:07 GMT", + "x-ms-client-request-id" : "f60989f8-b3be-420d-ad50-6e228e01c22f", + "Content-Type" : "application/xml" + }, + "Exception" : null + }, { + "Method" : "DELETE", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcazureblobfileattributeviewsettier28785554ed0c1983?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "0d7bc3ea-6ce9-40df-afb1-c382aa186013" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "202", + "x-ms-request-id" : "e1aa1f9c-f01e-0022-2b4d-4e3ae2000000", + "Date" : "Mon, 29 Jun 2020 19:42:07 GMT", + "x-ms-client-request-id" : "0d7bc3ea-6ce9-40df-afb1-c382aa186013" + }, + "Exception" : null + } ], + "variables" : [ "jtcazureblobfileattributeviewsettier05054601aef07cf2", "jtcazureblobfileattributeviewsettier16403717bac9fde3", "jtcazureblobfileattributeviewsettier28785554ed0c1983", "javablobazureblobfileattributeviewsettier3622648397f146" ] +} \ No newline at end of file diff --git a/sdk/storage/azure-storage-blob-nio/src/test/resources/session-records/AttributeViewTestazureblobfileattributeviewsettier[1].json b/sdk/storage/azure-storage-blob-nio/src/test/resources/session-records/AttributeViewTestazureblobfileattributeviewsettier[1].json new file mode 100644 index 0000000000000..02bec207e7908 --- /dev/null +++ b/sdk/storage/azure-storage-blob-nio/src/test/resources/session-records/AttributeViewTestazureblobfileattributeviewsettier[1].json @@ -0,0 +1,224 @@ +{ + "networkCallRecords" : [ { + "Method" : "GET", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcazureblobfileattributeviewsettier1757622a024031c6?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "9d4216ba-e55e-4b9f-aa98-d86c32b25d54" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-error-code" : "ContainerNotFound", + "retry-after" : "0", + "Content-Length" : "225", + "StatusCode" : "404", + "x-ms-request-id" : "2b562259-d01e-001c-1a4d-4e8cc3000000", + "Body" : "ContainerNotFoundThe specified container does not exist.\nRequestId:2b562259-d01e-001c-1a4d-4e8cc3000000\nTime:2020-06-29T19:42:07.9535880Z", + "Date" : "Mon, 29 Jun 2020 19:42:07 GMT", + "x-ms-client-request-id" : "9d4216ba-e55e-4b9f-aa98-d86c32b25d54", + "Content-Type" : "application/xml" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcazureblobfileattributeviewsettier1757622a024031c6?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "c57cb720-d23d-408e-b259-cfcf07d82987" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "ETag" : "0x8D81C64824DFE73", + "Last-Modified" : "Mon, 29 Jun 2020 19:42:08 GMT", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "73b50610-d01e-007a-564d-4e3e99000000", + "Date" : "Mon, 29 Jun 2020 19:42:07 GMT", + "x-ms-client-request-id" : "c57cb720-d23d-408e-b259-cfcf07d82987" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcazureblobfileattributeviewsettier2330897c44b6c432?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "e6d2124c-48c4-47e7-b6be-2d3d03cc30d8" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-error-code" : "ContainerNotFound", + "retry-after" : "0", + "Content-Length" : "225", + "StatusCode" : "404", + "x-ms-request-id" : "9ddcf8c6-a01e-0075-464d-4ed36f000000", + "Body" : "ContainerNotFoundThe specified container does not exist.\nRequestId:9ddcf8c6-a01e-0075-464d-4ed36f000000\nTime:2020-06-29T19:42:08.3300756Z", + "Date" : "Mon, 29 Jun 2020 19:42:08 GMT", + "x-ms-client-request-id" : "e6d2124c-48c4-47e7-b6be-2d3d03cc30d8", + "Content-Type" : "application/xml" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcazureblobfileattributeviewsettier2330897c44b6c432?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "55a0701c-bdf9-41a1-961b-2d66b06678b1" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "ETag" : "0x8D81C6482838410", + "Last-Modified" : "Mon, 29 Jun 2020 19:42:08 GMT", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "5c614b57-e01e-0097-5e4d-4e371d000000", + "Date" : "Mon, 29 Jun 2020 19:42:07 GMT", + "x-ms-client-request-id" : "55a0701c-bdf9-41a1-961b-2d66b06678b1" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcazureblobfileattributeviewsettier1757622a024031c6/javablobazureblobfileattributeviewsettier346219b60f98ce", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "9c61684a-c4c3-4ebf-9cb8-72c70980cfa3", + "Content-Type" : "application/octet-stream" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-content-crc64" : "6RYQPwaVsyQ=", + "Last-Modified" : "Mon, 29 Jun 2020 19:42:08 GMT", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-server-encrypted" : "true", + "Date" : "Mon, 29 Jun 2020 19:42:08 GMT", + "Content-MD5" : "wh+Wm18D0z1D4E+PE252gg==", + "ETag" : "0x8D81C64829ED551", + "Content-Length" : "0", + "x-ms-request-id" : "fd473b76-501e-0042-544d-4e7fc0000000", + "x-ms-client-request-id" : "9c61684a-c4c3-4ebf-9cb8-72c70980cfa3" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcazureblobfileattributeviewsettier1757622a024031c6/javablobazureblobfileattributeviewsettier346219b60f98ce?comp=tier", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "c821b4c7-a09f-450c-87b4-9c2f43a2f4c7" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "0d141355-101e-00a0-2a4d-4e9bb2000000", + "Date" : "Mon, 29 Jun 2020 19:42:08 GMT", + "x-ms-client-request-id" : "c821b4c7-a09f-450c-87b4-9c2f43a2f4c7" + }, + "Exception" : null + }, { + "Method" : "HEAD", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcazureblobfileattributeviewsettier1757622a024031c6/javablobazureblobfileattributeviewsettier346219b60f98ce", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "d2ff5e6b-48c0-4b38-be5c-1350e01ff144" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "x-ms-lease-status" : "unlocked", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-lease-state" : "available", + "Last-Modified" : "Mon, 29 Jun 2020 19:42:08 GMT", + "retry-after" : "0", + "x-ms-access-tier-change-time" : "Mon, 29 Jun 2020 19:42:08 GMT", + "StatusCode" : "200", + "Date" : "Mon, 29 Jun 2020 19:42:08 GMT", + "x-ms-blob-type" : "BlockBlob", + "Content-MD5" : "wh+Wm18D0z1D4E+PE252gg==", + "Accept-Ranges" : "bytes", + "x-ms-server-encrypted" : "true", + "x-ms-access-tier" : "Cool", + "ETag" : "0x8D81C64829ED551", + "x-ms-creation-time" : "Mon, 29 Jun 2020 19:42:08 GMT", + "Content-Length" : "7", + "x-ms-request-id" : "23f41045-601e-004a-794d-4e64b3000000", + "x-ms-client-request-id" : "d2ff5e6b-48c0-4b38-be5c-1350e01ff144", + "Content-Type" : "application/octet-stream" + }, + "Exception" : null + }, { + "Method" : "DELETE", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcazureblobfileattributeviewsettier1757622a024031c6?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "897a88be-aebe-45c4-bfc7-9397056313e0" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "202", + "x-ms-request-id" : "66c55342-301e-001d-304d-4e8d3e000000", + "Date" : "Mon, 29 Jun 2020 19:42:09 GMT", + "x-ms-client-request-id" : "897a88be-aebe-45c4-bfc7-9397056313e0" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.blob.core.windows.net?prefix=jtcazureblobfileattributeviewsettier&comp=list", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "a87fe5e6-93bb-46a5-8814-617ea0331785" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "fefc6e13-301e-00f3-4e4d-4e87bd000000", + "Body" : "jtcazureblobfileattributeviewsettierjtcazureblobfileattributeviewsettier2330897c44b6c432Mon, 29 Jun 2020 19:42:08 GMT\"0x8D81C6482838410\"unlockedavailable$account-encryption-keyfalsefalsefalse", + "Date" : "Mon, 29 Jun 2020 19:42:08 GMT", + "x-ms-client-request-id" : "a87fe5e6-93bb-46a5-8814-617ea0331785", + "Content-Type" : "application/xml" + }, + "Exception" : null + }, { + "Method" : "DELETE", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcazureblobfileattributeviewsettier2330897c44b6c432?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "0e57924e-6aad-4f0c-b0d0-4f43bca9cec6" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "202", + "x-ms-request-id" : "2c4d3e4b-901e-00b1-344d-4eaca9000000", + "Date" : "Mon, 29 Jun 2020 19:42:08 GMT", + "x-ms-client-request-id" : "0e57924e-6aad-4f0c-b0d0-4f43bca9cec6" + }, + "Exception" : null + } ], + "variables" : [ "jtcazureblobfileattributeviewsettier0324329d575cd932", "jtcazureblobfileattributeviewsettier1757622a024031c6", "jtcazureblobfileattributeviewsettier2330897c44b6c432", "javablobazureblobfileattributeviewsettier346219b60f98ce" ] +} \ No newline at end of file diff --git a/sdk/storage/azure-storage-blob-nio/src/test/resources/session-records/AzureFileSystemProviderTestgetattributeview[0].json b/sdk/storage/azure-storage-blob-nio/src/test/resources/session-records/AzureFileSystemProviderTestgetattributeview[0].json new file mode 100644 index 0000000000000..d0c6b839c2c10 --- /dev/null +++ b/sdk/storage/azure-storage-blob-nio/src/test/resources/session-records/AzureFileSystemProviderTestgetattributeview[0].json @@ -0,0 +1,149 @@ +{ + "networkCallRecords" : [ { + "Method" : "GET", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcgetattributeview1827023ff8b88e0ee844bd849?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "919109d6-f52c-474e-8ac5-eafb661f9556" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-error-code" : "ContainerNotFound", + "retry-after" : "0", + "Content-Length" : "225", + "StatusCode" : "404", + "x-ms-request-id" : "c79c8124-901e-00dc-1f4d-4e0687000000", + "Body" : "ContainerNotFoundThe specified container does not exist.\nRequestId:c79c8124-901e-00dc-1f4d-4e0687000000\nTime:2020-06-29T19:45:31.7824720Z", + "Date" : "Mon, 29 Jun 2020 19:45:31 GMT", + "x-ms-client-request-id" : "919109d6-f52c-474e-8ac5-eafb661f9556", + "Content-Type" : "application/xml" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcgetattributeview1827023ff8b88e0ee844bd849?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "d2e77d49-0dfb-45f3-8233-0bb4d884b8b3" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "ETag" : "0x8D81C64FBC6A221", + "Last-Modified" : "Mon, 29 Jun 2020 19:45:31 GMT", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "36bb7247-101e-0127-544d-4e88c8000000", + "Date" : "Mon, 29 Jun 2020 19:45:31 GMT", + "x-ms-client-request-id" : "d2e77d49-0dfb-45f3-8233-0bb4d884b8b3" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcgetattributeview299157358ef0c781e245f8b49?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "52e1deac-f712-451b-8f2d-a5a18099fbf5" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-error-code" : "ContainerNotFound", + "retry-after" : "0", + "Content-Length" : "225", + "StatusCode" : "404", + "x-ms-request-id" : "3b34bc79-101e-0045-184d-4e8945000000", + "Body" : "ContainerNotFoundThe specified container does not exist.\nRequestId:3b34bc79-101e-0045-184d-4e8945000000\nTime:2020-06-29T19:45:32.1182007Z", + "Date" : "Mon, 29 Jun 2020 19:45:31 GMT", + "x-ms-client-request-id" : "52e1deac-f712-451b-8f2d-a5a18099fbf5", + "Content-Type" : "application/xml" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcgetattributeview299157358ef0c781e245f8b49?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "c282bc41-035d-409a-af11-a0056b3ccf07" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "ETag" : "0x8D81C64FBFA09FB", + "Last-Modified" : "Mon, 29 Jun 2020 19:45:32 GMT", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "f602f130-d01e-0017-804d-4e94b7000000", + "Date" : "Mon, 29 Jun 2020 19:45:31 GMT", + "x-ms-client-request-id" : "c282bc41-035d-409a-af11-a0056b3ccf07" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.blob.core.windows.net?prefix=jtcgetattributeview&comp=list", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "f5f14aec-4bb3-4f44-b830-16aba06d9420" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "f71e29fc-201e-008a-434d-4eeef7000000", + "Body" : "jtcgetattributeviewjtcgetattributeview1827023ff8b88e0ee844bd849Mon, 29 Jun 2020 19:45:31 GMT\"0x8D81C64FBC6A221\"unlockedavailable$account-encryption-keyfalsefalsefalsejtcgetattributeview299157358ef0c781e245f8b49Mon, 29 Jun 2020 19:45:32 GMT\"0x8D81C64FBFA09FB\"unlockedavailable$account-encryption-keyfalsefalsefalse", + "Date" : "Mon, 29 Jun 2020 19:45:31 GMT", + "x-ms-client-request-id" : "f5f14aec-4bb3-4f44-b830-16aba06d9420", + "Content-Type" : "application/xml" + }, + "Exception" : null + }, { + "Method" : "DELETE", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcgetattributeview1827023ff8b88e0ee844bd849?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "7c74e59d-374b-434e-af9b-9d187ed7d013" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "202", + "x-ms-request-id" : "8ccc5dc4-001e-0138-3b4d-4e53d8000000", + "Date" : "Mon, 29 Jun 2020 19:45:32 GMT", + "x-ms-client-request-id" : "7c74e59d-374b-434e-af9b-9d187ed7d013" + }, + "Exception" : null + }, { + "Method" : "DELETE", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcgetattributeview299157358ef0c781e245f8b49?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "48fa325b-fa23-422b-948b-648c3957abcd" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "202", + "x-ms-request-id" : "1c1c0428-b01e-0043-584d-4e7e3d000000", + "Date" : "Mon, 29 Jun 2020 19:45:32 GMT", + "x-ms-client-request-id" : "48fa325b-fa23-422b-948b-648c3957abcd" + }, + "Exception" : null + } ], + "variables" : [ "jtcgetattributeview0505232cefeeac4acc4777980", "jtcgetattributeview1827023ff8b88e0ee844bd849", "jtcgetattributeview299157358ef0c781e245f8b49" ] +} \ No newline at end of file diff --git a/sdk/storage/azure-storage-blob-nio/src/test/resources/session-records/AzureFileSystemProviderTestgetattributeview[1].json b/sdk/storage/azure-storage-blob-nio/src/test/resources/session-records/AzureFileSystemProviderTestgetattributeview[1].json new file mode 100644 index 0000000000000..02b1b86bafd2d --- /dev/null +++ b/sdk/storage/azure-storage-blob-nio/src/test/resources/session-records/AzureFileSystemProviderTestgetattributeview[1].json @@ -0,0 +1,149 @@ +{ + "networkCallRecords" : [ { + "Method" : "GET", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcgetattributeview1721429ff3dcd4f42b4c77826?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "4b8734a6-107b-47f0-ae12-c2b71508db18" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-error-code" : "ContainerNotFound", + "retry-after" : "0", + "Content-Length" : "225", + "StatusCode" : "404", + "x-ms-request-id" : "33a3e1a3-e01e-00f1-534d-4e8547000000", + "Body" : "ContainerNotFoundThe specified container does not exist.\nRequestId:33a3e1a3-e01e-00f1-534d-4e8547000000\nTime:2020-06-29T19:45:32.9264757Z", + "Date" : "Mon, 29 Jun 2020 19:45:32 GMT", + "x-ms-client-request-id" : "4b8734a6-107b-47f0-ae12-c2b71508db18", + "Content-Type" : "application/xml" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcgetattributeview1721429ff3dcd4f42b4c77826?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "c7fcd0e5-bd14-4061-9cff-4bf310cb6245" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "ETag" : "0x8D81C64FC75C8C3", + "Last-Modified" : "Mon, 29 Jun 2020 19:45:33 GMT", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "c6bc61da-a01e-009b-634d-4ed9ec000000", + "Date" : "Mon, 29 Jun 2020 19:45:32 GMT", + "x-ms-client-request-id" : "c7fcd0e5-bd14-4061-9cff-4bf310cb6245" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcgetattributeview2351514c448dc0352e44a49fe?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "8a1b7de2-0164-401b-93ea-4587cd9ae3aa" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-error-code" : "ContainerNotFound", + "retry-after" : "0", + "Content-Length" : "225", + "StatusCode" : "404", + "x-ms-request-id" : "489b55fb-101e-000a-0b4d-4e4d5d000000", + "Body" : "ContainerNotFoundThe specified container does not exist.\nRequestId:489b55fb-101e-000a-0b4d-4e4d5d000000\nTime:2020-06-29T19:45:33.2324703Z", + "Date" : "Mon, 29 Jun 2020 19:45:32 GMT", + "x-ms-client-request-id" : "8a1b7de2-0164-401b-93ea-4587cd9ae3aa", + "Content-Type" : "application/xml" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcgetattributeview2351514c448dc0352e44a49fe?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "7caef204-3769-41d9-a5b2-4148b824798d" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "ETag" : "0x8D81C64FCA55265", + "Last-Modified" : "Mon, 29 Jun 2020 19:45:33 GMT", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "373fdf96-601e-002c-504d-4ed6e9000000", + "Date" : "Mon, 29 Jun 2020 19:45:33 GMT", + "x-ms-client-request-id" : "7caef204-3769-41d9-a5b2-4148b824798d" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.blob.core.windows.net?prefix=jtcgetattributeview&comp=list", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "9e984eaa-0331-4d7d-846a-2818e614496d" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "9d0cb172-901e-0076-104d-4ed068000000", + "Body" : "jtcgetattributeviewjtcgetattributeview1721429ff3dcd4f42b4c77826Mon, 29 Jun 2020 19:45:33 GMT\"0x8D81C64FC75C8C3\"unlockedavailable$account-encryption-keyfalsefalsefalsejtcgetattributeview2351514c448dc0352e44a49feMon, 29 Jun 2020 19:45:33 GMT\"0x8D81C64FCA55265\"unlockedavailable$account-encryption-keyfalsefalsefalse", + "Date" : "Mon, 29 Jun 2020 19:45:32 GMT", + "x-ms-client-request-id" : "9e984eaa-0331-4d7d-846a-2818e614496d", + "Content-Type" : "application/xml" + }, + "Exception" : null + }, { + "Method" : "DELETE", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcgetattributeview1721429ff3dcd4f42b4c77826?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "0b379038-bb62-4682-9d6f-5488aed702e4" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "202", + "x-ms-request-id" : "dae7ece7-c01e-0021-194d-4e39e5000000", + "Date" : "Mon, 29 Jun 2020 19:45:33 GMT", + "x-ms-client-request-id" : "0b379038-bb62-4682-9d6f-5488aed702e4" + }, + "Exception" : null + }, { + "Method" : "DELETE", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcgetattributeview2351514c448dc0352e44a49fe?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "043f3a00-f55e-41b2-b278-7c560a4d08eb" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "202", + "x-ms-request-id" : "74e2a720-b01e-0007-134d-4ea251000000", + "Date" : "Mon, 29 Jun 2020 19:45:33 GMT", + "x-ms-client-request-id" : "043f3a00-f55e-41b2-b278-7c560a4d08eb" + }, + "Exception" : null + } ], + "variables" : [ "jtcgetattributeview08965633c78a85d79e4864aff", "jtcgetattributeview1721429ff3dcd4f42b4c77826", "jtcgetattributeview2351514c448dc0352e44a49fe" ] +} \ No newline at end of file diff --git a/sdk/storage/azure-storage-blob-nio/src/test/resources/session-records/AzureFileSystemProviderTestgetattributeview[2].json b/sdk/storage/azure-storage-blob-nio/src/test/resources/session-records/AzureFileSystemProviderTestgetattributeview[2].json new file mode 100644 index 0000000000000..e8d664a2e8352 --- /dev/null +++ b/sdk/storage/azure-storage-blob-nio/src/test/resources/session-records/AzureFileSystemProviderTestgetattributeview[2].json @@ -0,0 +1,149 @@ +{ + "networkCallRecords" : [ { + "Method" : "GET", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcgetattributeview14190618282686d1264fdfb77?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "172f8eb2-d379-43dc-ab86-9837d670f047" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-error-code" : "ContainerNotFound", + "retry-after" : "0", + "Content-Length" : "225", + "StatusCode" : "404", + "x-ms-request-id" : "49882869-c01e-002a-484d-4e2191000000", + "Body" : "ContainerNotFoundThe specified container does not exist.\nRequestId:49882869-c01e-002a-484d-4e2191000000\nTime:2020-06-29T19:45:34.0847958Z", + "Date" : "Mon, 29 Jun 2020 19:45:33 GMT", + "x-ms-client-request-id" : "172f8eb2-d379-43dc-ab86-9837d670f047", + "Content-Type" : "application/xml" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcgetattributeview14190618282686d1264fdfb77?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "c741d296-e6a9-4e71-8e32-92eeb5c0923f" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "ETag" : "0x8D81C64FD274EB5", + "Last-Modified" : "Mon, 29 Jun 2020 19:45:34 GMT", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "f9c5ee71-901e-0010-6b4d-4e6232000000", + "Date" : "Mon, 29 Jun 2020 19:45:33 GMT", + "x-ms-client-request-id" : "c741d296-e6a9-4e71-8e32-92eeb5c0923f" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcgetattributeview238785f95f5967d1f44512a23?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "5c6d7b43-6377-48c9-b47f-b158465ac75d" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-error-code" : "ContainerNotFound", + "retry-after" : "0", + "Content-Length" : "225", + "StatusCode" : "404", + "x-ms-request-id" : "2ed4943d-101e-010e-6f4d-4efe8a000000", + "Body" : "ContainerNotFoundThe specified container does not exist.\nRequestId:2ed4943d-101e-010e-6f4d-4efe8a000000\nTime:2020-06-29T19:45:34.4057381Z", + "Date" : "Mon, 29 Jun 2020 19:45:34 GMT", + "x-ms-client-request-id" : "5c6d7b43-6377-48c9-b47f-b158465ac75d", + "Content-Type" : "application/xml" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcgetattributeview238785f95f5967d1f44512a23?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "ac0d4317-ea62-4e74-89f4-30e2bd5a3046" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "ETag" : "0x8D81C64FD56F5B1", + "Last-Modified" : "Mon, 29 Jun 2020 19:45:34 GMT", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "344d69e5-801e-00a5-7c4d-4e6fcd000000", + "Date" : "Mon, 29 Jun 2020 19:45:34 GMT", + "x-ms-client-request-id" : "ac0d4317-ea62-4e74-89f4-30e2bd5a3046" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.blob.core.windows.net?prefix=jtcgetattributeview&comp=list", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "314db43c-4903-4347-893e-c67e744adf39" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "464e79de-501e-012b-5a4d-4e6639000000", + "Body" : "jtcgetattributeviewjtcgetattributeview14190618282686d1264fdfb77Mon, 29 Jun 2020 19:45:34 GMT\"0x8D81C64FD274EB5\"unlockedavailable$account-encryption-keyfalsefalsefalsejtcgetattributeview238785f95f5967d1f44512a23Mon, 29 Jun 2020 19:45:34 GMT\"0x8D81C64FD56F5B1\"unlockedavailable$account-encryption-keyfalsefalsefalse", + "Date" : "Mon, 29 Jun 2020 19:45:34 GMT", + "x-ms-client-request-id" : "314db43c-4903-4347-893e-c67e744adf39", + "Content-Type" : "application/xml" + }, + "Exception" : null + }, { + "Method" : "DELETE", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcgetattributeview14190618282686d1264fdfb77?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "932eaef7-388a-45df-b469-1a2df095aff5" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "202", + "x-ms-request-id" : "b9f03348-e01e-0139-794d-4e5225000000", + "Date" : "Mon, 29 Jun 2020 19:45:34 GMT", + "x-ms-client-request-id" : "932eaef7-388a-45df-b469-1a2df095aff5" + }, + "Exception" : null + }, { + "Method" : "DELETE", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcgetattributeview238785f95f5967d1f44512a23?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "75d0e120-2ead-4c21-bf5a-e741715dea61" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "202", + "x-ms-request-id" : "448600de-101e-006c-6e4d-4eff07000000", + "Date" : "Mon, 29 Jun 2020 19:45:35 GMT", + "x-ms-client-request-id" : "75d0e120-2ead-4c21-bf5a-e741715dea61" + }, + "Exception" : null + } ], + "variables" : [ "jtcgetattributeview082365367a3876622347139b6", "jtcgetattributeview14190618282686d1264fdfb77", "jtcgetattributeview238785f95f5967d1f44512a23" ] +} \ No newline at end of file diff --git a/sdk/storage/azure-storage-blob-nio/src/test/resources/session-records/AzureFileSystemProviderTestgetattributeviewfail.json b/sdk/storage/azure-storage-blob-nio/src/test/resources/session-records/AzureFileSystemProviderTestgetattributeviewfail.json new file mode 100644 index 0000000000000..3bea5cec87365 --- /dev/null +++ b/sdk/storage/azure-storage-blob-nio/src/test/resources/session-records/AzureFileSystemProviderTestgetattributeviewfail.json @@ -0,0 +1,149 @@ +{ + "networkCallRecords" : [ { + "Method" : "GET", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcgetattributeviewfail156895e91684fbfd724bcca?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "a3b49de1-6ce6-47a8-aa92-ab3adadaffa3" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-error-code" : "ContainerNotFound", + "retry-after" : "0", + "Content-Length" : "225", + "StatusCode" : "404", + "x-ms-request-id" : "0f9dcdd8-c01e-00a2-7c4d-4e9948000000", + "Body" : "ContainerNotFoundThe specified container does not exist.\nRequestId:0f9dcdd8-c01e-00a2-7c4d-4e9948000000\nTime:2020-06-29T19:45:35.2906740Z", + "Date" : "Mon, 29 Jun 2020 19:45:34 GMT", + "x-ms-client-request-id" : "a3b49de1-6ce6-47a8-aa92-ab3adadaffa3", + "Content-Type" : "application/xml" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcgetattributeviewfail156895e91684fbfd724bcca?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "42ad1d5f-acb2-45c8-a3a7-b783e0a30500" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "ETag" : "0x8D81C64FDDEDE20", + "Last-Modified" : "Mon, 29 Jun 2020 19:45:35 GMT", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "12d65cac-201e-00ec-3b4d-4e5cad000000", + "Date" : "Mon, 29 Jun 2020 19:45:34 GMT", + "x-ms-client-request-id" : "42ad1d5f-acb2-45c8-a3a7-b783e0a30500" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcgetattributeviewfail24734322f202a38c4941a28?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "0174281e-f209-44c9-aef4-8dc640c7ac2d" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-error-code" : "ContainerNotFound", + "retry-after" : "0", + "Content-Length" : "225", + "StatusCode" : "404", + "x-ms-request-id" : "fa3f01b6-701e-0137-424d-4ebe2e000000", + "Body" : "ContainerNotFoundThe specified container does not exist.\nRequestId:fa3f01b6-701e-0137-424d-4ebe2e000000\nTime:2020-06-29T19:45:35.6081996Z", + "Date" : "Mon, 29 Jun 2020 19:45:35 GMT", + "x-ms-client-request-id" : "0174281e-f209-44c9-aef4-8dc640c7ac2d", + "Content-Type" : "application/xml" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcgetattributeviewfail24734322f202a38c4941a28?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "966605ab-c303-4c30-8d86-38f34d190e8e" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "ETag" : "0x8D81C64FE10E9E4", + "Last-Modified" : "Mon, 29 Jun 2020 19:45:35 GMT", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "d18ee765-a01e-00b9-014d-4eb7da000000", + "Date" : "Mon, 29 Jun 2020 19:45:35 GMT", + "x-ms-client-request-id" : "966605ab-c303-4c30-8d86-38f34d190e8e" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.blob.core.windows.net?prefix=jtcgetattributeviewfail&comp=list", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "dbde5fb0-a89e-4560-88f8-fd12da230fcf" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "98e74895-f01e-0000-484d-4e54d4000000", + "Body" : "jtcgetattributeviewfailjtcgetattributeviewfail156895e91684fbfd724bccaMon, 29 Jun 2020 19:45:35 GMT\"0x8D81C64FDDEDE20\"unlockedavailable$account-encryption-keyfalsefalsefalsejtcgetattributeviewfail24734322f202a38c4941a28Mon, 29 Jun 2020 19:45:35 GMT\"0x8D81C64FE10E9E4\"unlockedavailable$account-encryption-keyfalsefalsefalse", + "Date" : "Mon, 29 Jun 2020 19:45:35 GMT", + "x-ms-client-request-id" : "dbde5fb0-a89e-4560-88f8-fd12da230fcf", + "Content-Type" : "application/xml" + }, + "Exception" : null + }, { + "Method" : "DELETE", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcgetattributeviewfail156895e91684fbfd724bcca?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "8b31b859-25ea-4479-976e-fbb3768bb3b5" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "202", + "x-ms-request-id" : "5e64d9d4-d01e-013a-7a4d-4e5122000000", + "Date" : "Mon, 29 Jun 2020 19:45:35 GMT", + "x-ms-client-request-id" : "8b31b859-25ea-4479-976e-fbb3768bb3b5" + }, + "Exception" : null + }, { + "Method" : "DELETE", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcgetattributeviewfail24734322f202a38c4941a28?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "dadf4174-5e71-4a73-b465-c6a92a04d129" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "202", + "x-ms-request-id" : "93efcd44-d01e-0058-014d-4e50af000000", + "Date" : "Mon, 29 Jun 2020 19:45:36 GMT", + "x-ms-client-request-id" : "dadf4174-5e71-4a73-b465-c6a92a04d129" + }, + "Exception" : null + } ], + "variables" : [ "jtcgetattributeviewfail0358107f8dc065e633464c9", "jtcgetattributeviewfail156895e91684fbfd724bcca", "jtcgetattributeviewfail24734322f202a38c4941a28" ] +} \ No newline at end of file diff --git a/sdk/storage/azure-storage-blob-nio/src/test/resources/session-records/AzureFileSystemProviderTestreadattributes[0].json b/sdk/storage/azure-storage-blob-nio/src/test/resources/session-records/AzureFileSystemProviderTestreadattributes[0].json new file mode 100644 index 0000000000000..c0314b940817e --- /dev/null +++ b/sdk/storage/azure-storage-blob-nio/src/test/resources/session-records/AzureFileSystemProviderTestreadattributes[0].json @@ -0,0 +1,226 @@ +{ + "networkCallRecords" : [ { + "Method" : "GET", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcreadattributes1701372bf64e5ff9c9491c8e30?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "5ebf5246-af1d-40da-8b7d-3a2b6331870b" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-error-code" : "ContainerNotFound", + "retry-after" : "0", + "Content-Length" : "225", + "StatusCode" : "404", + "x-ms-request-id" : "a7368318-e01e-011b-384d-4e3c13000000", + "Body" : "ContainerNotFoundThe specified container does not exist.\nRequestId:a7368318-e01e-011b-384d-4e3c13000000\nTime:2020-06-29T19:45:36.4498207Z", + "Date" : "Mon, 29 Jun 2020 19:45:35 GMT", + "x-ms-client-request-id" : "5ebf5246-af1d-40da-8b7d-3a2b6331870b", + "Content-Type" : "application/xml" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcreadattributes1701372bf64e5ff9c9491c8e30?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "8822fc42-9917-4b51-914d-c1d0b488a6df" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "ETag" : "0x8D81C64FE8E8FF5", + "Last-Modified" : "Mon, 29 Jun 2020 19:45:36 GMT", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "e081ee5e-901e-0039-504d-4e1470000000", + "Date" : "Mon, 29 Jun 2020 19:45:36 GMT", + "x-ms-client-request-id" : "8822fc42-9917-4b51-914d-c1d0b488a6df" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcreadattributes24408765e81ae966394273ad0f?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "2a4a00b1-cfce-4c82-9c17-58659025e417" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-error-code" : "ContainerNotFound", + "retry-after" : "0", + "Content-Length" : "225", + "StatusCode" : "404", + "x-ms-request-id" : "d026901e-a01e-00d4-674d-4e1df4000000", + "Body" : "ContainerNotFoundThe specified container does not exist.\nRequestId:d026901e-a01e-00d4-674d-4e1df4000000\nTime:2020-06-29T19:45:36.7652195Z", + "Date" : "Mon, 29 Jun 2020 19:45:36 GMT", + "x-ms-client-request-id" : "2a4a00b1-cfce-4c82-9c17-58659025e417", + "Content-Type" : "application/xml" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcreadattributes24408765e81ae966394273ad0f?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "a3bdb9c0-1c8a-479c-9dd2-86134b5b6def" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "ETag" : "0x8D81C64FEBF99DD", + "Last-Modified" : "Mon, 29 Jun 2020 19:45:36 GMT", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "d692dba9-701e-011e-584d-4ec86c000000", + "Date" : "Mon, 29 Jun 2020 19:45:36 GMT", + "x-ms-client-request-id" : "a3bdb9c0-1c8a-479c-9dd2-86134b5b6def" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcreadattributes1701372bf64e5ff9c9491c8e30?prefix=javablobreadattributes3693385eb34037e92e4a88b&delimiter=/&maxresults=2&include=metadata&restype=container&comp=list", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "789af3cf-f516-4d9c-84fd-93bde30c4efd" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "c56d9bfe-101e-012c-104d-4e90bc000000", + "Body" : "javablobreadattributes3693385eb34037e92e4a88b2/", + "Date" : "Mon, 29 Jun 2020 19:45:36 GMT", + "x-ms-client-request-id" : "789af3cf-f516-4d9c-84fd-93bde30c4efd", + "Content-Type" : "application/xml" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcreadattributes1701372bf64e5ff9c9491c8e30/javablobreadattributes3693385eb34037e92e4a88b", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "8ba5ea6f-1675-4741-b61b-6ce459984804", + "Content-Type" : "application/octet-stream" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-content-crc64" : "AAAAAAAAAAA=", + "Last-Modified" : "Mon, 29 Jun 2020 19:45:37 GMT", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-server-encrypted" : "true", + "Date" : "Mon, 29 Jun 2020 19:45:36 GMT", + "Content-MD5" : "1B2M2Y8AsgTpgAmY7PhCfg==", + "ETag" : "0x8D81C64FEEE9E23", + "Content-Length" : "0", + "x-ms-request-id" : "4ed71c9c-901e-005f-804d-4ea62a000000", + "x-ms-client-request-id" : "8ba5ea6f-1675-4741-b61b-6ce459984804" + }, + "Exception" : null + }, { + "Method" : "HEAD", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcreadattributes1701372bf64e5ff9c9491c8e30/javablobreadattributes3693385eb34037e92e4a88b", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "9855ca12-5fa6-4e07-a2a4-87cfc301262a" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "x-ms-lease-status" : "unlocked", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-lease-state" : "available", + "Last-Modified" : "Mon, 29 Jun 2020 19:45:37 GMT", + "retry-after" : "0", + "StatusCode" : "200", + "Date" : "Mon, 29 Jun 2020 19:45:36 GMT", + "x-ms-blob-type" : "BlockBlob", + "Content-MD5" : "1B2M2Y8AsgTpgAmY7PhCfg==", + "Accept-Ranges" : "bytes", + "x-ms-server-encrypted" : "true", + "x-ms-access-tier-inferred" : "true", + "x-ms-access-tier" : "Hot", + "ETag" : "0x8D81C64FEEE9E23", + "x-ms-creation-time" : "Mon, 29 Jun 2020 19:45:37 GMT", + "Content-Length" : "0", + "x-ms-request-id" : "85bebb0e-a01e-0135-7d4d-4ebcd4000000", + "x-ms-client-request-id" : "9855ca12-5fa6-4e07-a2a4-87cfc301262a", + "Content-Type" : "application/octet-stream" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.blob.core.windows.net?prefix=jtcreadattributes&comp=list", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "996f094f-99e5-4498-b9dd-9085cb44b672" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "3814873c-b01e-008f-594d-4e1a88000000", + "Body" : "jtcreadattributesjtcreadattributes1701372bf64e5ff9c9491c8e30Mon, 29 Jun 2020 19:45:36 GMT\"0x8D81C64FE8E8FF5\"unlockedavailable$account-encryption-keyfalsefalsefalsejtcreadattributes24408765e81ae966394273ad0fMon, 29 Jun 2020 19:45:36 GMT\"0x8D81C64FEBF99DD\"unlockedavailable$account-encryption-keyfalsefalsefalse", + "Date" : "Mon, 29 Jun 2020 19:45:36 GMT", + "x-ms-client-request-id" : "996f094f-99e5-4498-b9dd-9085cb44b672", + "Content-Type" : "application/xml" + }, + "Exception" : null + }, { + "Method" : "DELETE", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcreadattributes1701372bf64e5ff9c9491c8e30?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "451227d9-0cf4-4175-9923-1583a146052b" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "202", + "x-ms-request-id" : "fc01e6c2-101e-00c6-1d4d-4e29e8000000", + "Date" : "Mon, 29 Jun 2020 19:45:37 GMT", + "x-ms-client-request-id" : "451227d9-0cf4-4175-9923-1583a146052b" + }, + "Exception" : null + }, { + "Method" : "DELETE", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcreadattributes24408765e81ae966394273ad0f?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "d912a0c6-5540-4285-89a5-d7c6e8cfe4da" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "202", + "x-ms-request-id" : "963db55e-501e-00e8-564d-4ea92f000000", + "Date" : "Mon, 29 Jun 2020 19:45:37 GMT", + "x-ms-client-request-id" : "d912a0c6-5540-4285-89a5-d7c6e8cfe4da" + }, + "Exception" : null + } ], + "variables" : [ "jtcreadattributes0317549337817c77e8481fbc4f", "jtcreadattributes1701372bf64e5ff9c9491c8e30", "jtcreadattributes24408765e81ae966394273ad0f", "javablobreadattributes3693385eb34037e92e4a88b" ] +} \ No newline at end of file diff --git a/sdk/storage/azure-storage-blob-nio/src/test/resources/session-records/AzureFileSystemProviderTestreadattributes[1].json b/sdk/storage/azure-storage-blob-nio/src/test/resources/session-records/AzureFileSystemProviderTestreadattributes[1].json new file mode 100644 index 0000000000000..7f0e5640495a8 --- /dev/null +++ b/sdk/storage/azure-storage-blob-nio/src/test/resources/session-records/AzureFileSystemProviderTestreadattributes[1].json @@ -0,0 +1,226 @@ +{ + "networkCallRecords" : [ { + "Method" : "GET", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcreadattributes188730e6217dbdcf414473ad26?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "8f37e18b-e22a-496e-afe5-364f562079ee" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-error-code" : "ContainerNotFound", + "retry-after" : "0", + "Content-Length" : "225", + "StatusCode" : "404", + "x-ms-request-id" : "8d3595d3-701e-001a-304d-4e7bbb000000", + "Body" : "ContainerNotFoundThe specified container does not exist.\nRequestId:8d3595d3-701e-001a-304d-4e7bbb000000\nTime:2020-06-29T19:45:38.0408267Z", + "Date" : "Mon, 29 Jun 2020 19:45:37 GMT", + "x-ms-client-request-id" : "8f37e18b-e22a-496e-afe5-364f562079ee", + "Content-Type" : "application/xml" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcreadattributes188730e6217dbdcf414473ad26?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "c212d180-a01b-4568-8113-f33ffc2090f9" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "ETag" : "0x8D81C64FF81E251", + "Last-Modified" : "Mon, 29 Jun 2020 19:45:38 GMT", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "b4674025-e01e-0079-134d-4e3d9e000000", + "Date" : "Mon, 29 Jun 2020 19:45:37 GMT", + "x-ms-client-request-id" : "c212d180-a01b-4568-8113-f33ffc2090f9" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcreadattributes28969347c47658b8c04cecb7f7?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "f866213f-8d3e-4de4-8a82-57f9f1740385" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-error-code" : "ContainerNotFound", + "retry-after" : "0", + "Content-Length" : "225", + "StatusCode" : "404", + "x-ms-request-id" : "8de9392f-601e-00af-2f4d-4e7644000000", + "Body" : "ContainerNotFoundThe specified container does not exist.\nRequestId:8de9392f-601e-00af-2f4d-4e7644000000\nTime:2020-06-29T19:45:38.4168297Z", + "Date" : "Mon, 29 Jun 2020 19:45:38 GMT", + "x-ms-client-request-id" : "f866213f-8d3e-4de4-8a82-57f9f1740385", + "Content-Type" : "application/xml" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcreadattributes28969347c47658b8c04cecb7f7?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "efc0856d-0c1b-4d32-8f03-0d2298c037a6" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "ETag" : "0x8D81C64FFBAB970", + "Last-Modified" : "Mon, 29 Jun 2020 19:45:38 GMT", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "c5bb1034-101e-0082-2d4d-4ef584000000", + "Date" : "Mon, 29 Jun 2020 19:45:37 GMT", + "x-ms-client-request-id" : "efc0856d-0c1b-4d32-8f03-0d2298c037a6" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcreadattributes188730e6217dbdcf414473ad26?prefix=javablobreadattributes3342827d9aa5914c1244308&delimiter=/&maxresults=2&include=metadata&restype=container&comp=list", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "039543d5-9394-4ab9-bda3-798048d4c1a4" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "325aedef-001e-00d2-184d-4eea8c000000", + "Body" : "javablobreadattributes3342827d9aa5914c12443082/", + "Date" : "Mon, 29 Jun 2020 19:45:38 GMT", + "x-ms-client-request-id" : "039543d5-9394-4ab9-bda3-798048d4c1a4", + "Content-Type" : "application/xml" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcreadattributes188730e6217dbdcf414473ad26/javablobreadattributes3342827d9aa5914c1244308", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "c2fc7258-558f-4876-992d-3b07027f6ebb", + "Content-Type" : "application/octet-stream" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-content-crc64" : "AAAAAAAAAAA=", + "Last-Modified" : "Mon, 29 Jun 2020 19:45:38 GMT", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-server-encrypted" : "true", + "Date" : "Mon, 29 Jun 2020 19:45:38 GMT", + "Content-MD5" : "1B2M2Y8AsgTpgAmY7PhCfg==", + "ETag" : "0x8D81C64FFEC400A", + "Content-Length" : "0", + "x-ms-request-id" : "a8598dac-f01e-00cc-4a4d-4e3061000000", + "x-ms-client-request-id" : "c2fc7258-558f-4876-992d-3b07027f6ebb" + }, + "Exception" : null + }, { + "Method" : "HEAD", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcreadattributes188730e6217dbdcf414473ad26/javablobreadattributes3342827d9aa5914c1244308", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "5b2d59a5-d439-442b-8135-8f46ead3415e" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "x-ms-lease-status" : "unlocked", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-lease-state" : "available", + "Last-Modified" : "Mon, 29 Jun 2020 19:45:38 GMT", + "retry-after" : "0", + "StatusCode" : "200", + "Date" : "Mon, 29 Jun 2020 19:45:38 GMT", + "x-ms-blob-type" : "BlockBlob", + "Content-MD5" : "1B2M2Y8AsgTpgAmY7PhCfg==", + "Accept-Ranges" : "bytes", + "x-ms-server-encrypted" : "true", + "x-ms-access-tier-inferred" : "true", + "x-ms-access-tier" : "Hot", + "ETag" : "0x8D81C64FFEC400A", + "x-ms-creation-time" : "Mon, 29 Jun 2020 19:45:38 GMT", + "Content-Length" : "0", + "x-ms-request-id" : "2c1c1843-101e-00ef-804d-4e5faa000000", + "x-ms-client-request-id" : "5b2d59a5-d439-442b-8135-8f46ead3415e", + "Content-Type" : "application/octet-stream" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.blob.core.windows.net?prefix=jtcreadattributes&comp=list", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "0ea33eba-9495-4f76-bb0e-4a090d9f1a12" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "ef2254a6-501e-00c1-044d-4edf6d000000", + "Body" : "jtcreadattributesjtcreadattributes188730e6217dbdcf414473ad26Mon, 29 Jun 2020 19:45:38 GMT\"0x8D81C64FF81E251\"unlockedavailable$account-encryption-keyfalsefalsefalsejtcreadattributes28969347c47658b8c04cecb7f7Mon, 29 Jun 2020 19:45:38 GMT\"0x8D81C64FFBAB970\"unlockedavailable$account-encryption-keyfalsefalsefalse", + "Date" : "Mon, 29 Jun 2020 19:45:38 GMT", + "x-ms-client-request-id" : "0ea33eba-9495-4f76-bb0e-4a090d9f1a12", + "Content-Type" : "application/xml" + }, + "Exception" : null + }, { + "Method" : "DELETE", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcreadattributes188730e6217dbdcf414473ad26?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "d29b0a23-f8e0-42bc-ae2a-17e253dabdfa" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "202", + "x-ms-request-id" : "d436d6ec-401e-0134-434d-4ebd29000000", + "Date" : "Mon, 29 Jun 2020 19:45:38 GMT", + "x-ms-client-request-id" : "d29b0a23-f8e0-42bc-ae2a-17e253dabdfa" + }, + "Exception" : null + }, { + "Method" : "DELETE", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcreadattributes28969347c47658b8c04cecb7f7?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "9c0c872a-9fde-410a-b11a-0fb5443a4c4d" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "202", + "x-ms-request-id" : "de6193bf-001e-011a-144d-4e3dee000000", + "Date" : "Mon, 29 Jun 2020 19:45:39 GMT", + "x-ms-client-request-id" : "9c0c872a-9fde-410a-b11a-0fb5443a4c4d" + }, + "Exception" : null + } ], + "variables" : [ "jtcreadattributes001507e20f03db712b4d67a87e", "jtcreadattributes188730e6217dbdcf414473ad26", "jtcreadattributes28969347c47658b8c04cecb7f7", "javablobreadattributes3342827d9aa5914c1244308" ] +} \ No newline at end of file diff --git a/sdk/storage/azure-storage-blob-nio/src/test/resources/session-records/AzureFileSystemProviderTestreadattributes[2].json b/sdk/storage/azure-storage-blob-nio/src/test/resources/session-records/AzureFileSystemProviderTestreadattributes[2].json new file mode 100644 index 0000000000000..47465f92176f2 --- /dev/null +++ b/sdk/storage/azure-storage-blob-nio/src/test/resources/session-records/AzureFileSystemProviderTestreadattributes[2].json @@ -0,0 +1,226 @@ +{ + "networkCallRecords" : [ { + "Method" : "GET", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcreadattributes1249039482debd86814bbeaec3?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "217e6fee-e6b6-4567-a6ea-3c0a115a88c3" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-error-code" : "ContainerNotFound", + "retry-after" : "0", + "Content-Length" : "225", + "StatusCode" : "404", + "x-ms-request-id" : "2b313f3a-c01e-00c4-0a4d-4e2b12000000", + "Body" : "ContainerNotFoundThe specified container does not exist.\nRequestId:2b313f3a-c01e-00c4-0a4d-4e2b12000000\nTime:2020-06-29T19:45:39.6906407Z", + "Date" : "Mon, 29 Jun 2020 19:45:39 GMT", + "x-ms-client-request-id" : "217e6fee-e6b6-4567-a6ea-3c0a115a88c3", + "Content-Type" : "application/xml" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcreadattributes1249039482debd86814bbeaec3?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "ba4077f1-698a-496e-8952-e4d415430238" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "ETag" : "0x8D81C6500814B57", + "Last-Modified" : "Mon, 29 Jun 2020 19:45:39 GMT", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "0ff6ee00-f01e-000b-384d-4e4ca0000000", + "Date" : "Mon, 29 Jun 2020 19:45:39 GMT", + "x-ms-client-request-id" : "ba4077f1-698a-496e-8952-e4d415430238" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcreadattributes2336411fa00cf302254d739da4?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "fe87a3c3-c865-4b89-a66f-070c9eed54f6" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-error-code" : "ContainerNotFound", + "retry-after" : "0", + "Content-Length" : "225", + "StatusCode" : "404", + "x-ms-request-id" : "4b82c03e-701e-0055-2b4d-4ebfa3000000", + "Body" : "ContainerNotFoundThe specified container does not exist.\nRequestId:4b82c03e-701e-0055-2b4d-4ebfa3000000\nTime:2020-06-29T19:45:40.0472253Z", + "Date" : "Mon, 29 Jun 2020 19:45:39 GMT", + "x-ms-client-request-id" : "fe87a3c3-c865-4b89-a66f-070c9eed54f6", + "Content-Type" : "application/xml" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcreadattributes2336411fa00cf302254d739da4?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "cd9e8401-5b30-4b19-bbc9-091c4528fca5" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "ETag" : "0x8D81C6500B47482", + "Last-Modified" : "Mon, 29 Jun 2020 19:45:40 GMT", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "0173c7ca-d01e-009f-134d-4e2c6e000000", + "Date" : "Mon, 29 Jun 2020 19:45:39 GMT", + "x-ms-client-request-id" : "cd9e8401-5b30-4b19-bbc9-091c4528fca5" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcreadattributes1249039482debd86814bbeaec3?prefix=javablobreadattributes37757417d0194ecbdb478e9&delimiter=/&maxresults=2&include=metadata&restype=container&comp=list", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "48c186ed-4b55-4cfa-9111-444453749b4c" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "2f1a627b-601e-0086-4f4d-4e0006000000", + "Body" : "javablobreadattributes37757417d0194ecbdb478e92/", + "Date" : "Mon, 29 Jun 2020 19:45:40 GMT", + "x-ms-client-request-id" : "48c186ed-4b55-4cfa-9111-444453749b4c", + "Content-Type" : "application/xml" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcreadattributes1249039482debd86814bbeaec3/javablobreadattributes37757417d0194ecbdb478e9", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "0ebb452e-b3aa-4982-a5cd-848ebe3a3b1a", + "Content-Type" : "application/octet-stream" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-content-crc64" : "AAAAAAAAAAA=", + "Last-Modified" : "Mon, 29 Jun 2020 19:45:40 GMT", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-server-encrypted" : "true", + "Date" : "Mon, 29 Jun 2020 19:45:39 GMT", + "Content-MD5" : "1B2M2Y8AsgTpgAmY7PhCfg==", + "ETag" : "0x8D81C6500E329DF", + "Content-Length" : "0", + "x-ms-request-id" : "33a59dec-201e-00a8-0f4d-4e80c1000000", + "x-ms-client-request-id" : "0ebb452e-b3aa-4982-a5cd-848ebe3a3b1a" + }, + "Exception" : null + }, { + "Method" : "HEAD", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcreadattributes1249039482debd86814bbeaec3/javablobreadattributes37757417d0194ecbdb478e9", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "8995a16f-7749-46d5-b538-1943c8e0a133" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "x-ms-lease-status" : "unlocked", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-lease-state" : "available", + "Last-Modified" : "Mon, 29 Jun 2020 19:45:40 GMT", + "retry-after" : "0", + "StatusCode" : "200", + "Date" : "Mon, 29 Jun 2020 19:45:40 GMT", + "x-ms-blob-type" : "BlockBlob", + "Content-MD5" : "1B2M2Y8AsgTpgAmY7PhCfg==", + "Accept-Ranges" : "bytes", + "x-ms-server-encrypted" : "true", + "x-ms-access-tier-inferred" : "true", + "x-ms-access-tier" : "Hot", + "ETag" : "0x8D81C6500E329DF", + "x-ms-creation-time" : "Mon, 29 Jun 2020 19:45:40 GMT", + "Content-Length" : "0", + "x-ms-request-id" : "1b7f9427-201e-00a3-2c4d-4e98b5000000", + "x-ms-client-request-id" : "8995a16f-7749-46d5-b538-1943c8e0a133", + "Content-Type" : "application/octet-stream" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.blob.core.windows.net?prefix=jtcreadattributes&comp=list", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "2b35bb39-2197-40c2-a127-3ec2eff93a17" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "b459d9cb-901e-013d-634d-4ea7a7000000", + "Body" : "jtcreadattributesjtcreadattributes1249039482debd86814bbeaec3Mon, 29 Jun 2020 19:45:39 GMT\"0x8D81C6500814B57\"unlockedavailable$account-encryption-keyfalsefalsefalsejtcreadattributes2336411fa00cf302254d739da4Mon, 29 Jun 2020 19:45:40 GMT\"0x8D81C6500B47482\"unlockedavailable$account-encryption-keyfalsefalsefalse", + "Date" : "Mon, 29 Jun 2020 19:45:40 GMT", + "x-ms-client-request-id" : "2b35bb39-2197-40c2-a127-3ec2eff93a17", + "Content-Type" : "application/xml" + }, + "Exception" : null + }, { + "Method" : "DELETE", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcreadattributes1249039482debd86814bbeaec3?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "444d63b1-2b24-4f83-8741-393dee6974c8" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "202", + "x-ms-request-id" : "9ca18bbb-e01e-00d3-764d-4eeb71000000", + "Date" : "Mon, 29 Jun 2020 19:45:40 GMT", + "x-ms-client-request-id" : "444d63b1-2b24-4f83-8741-393dee6974c8" + }, + "Exception" : null + }, { + "Method" : "DELETE", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcreadattributes2336411fa00cf302254d739da4?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "8f3904fe-e4b6-40d9-ab3f-27332c9606cf" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "202", + "x-ms-request-id" : "79fb9928-b01e-00e2-1c4d-4eb0a6000000", + "Date" : "Mon, 29 Jun 2020 19:45:41 GMT", + "x-ms-client-request-id" : "8f3904fe-e4b6-40d9-ab3f-27332c9606cf" + }, + "Exception" : null + } ], + "variables" : [ "jtcreadattributes002837e88f0423c88d40d48faf", "jtcreadattributes1249039482debd86814bbeaec3", "jtcreadattributes2336411fa00cf302254d739da4", "javablobreadattributes37757417d0194ecbdb478e9" ] +} \ No newline at end of file diff --git a/sdk/storage/azure-storage-blob-nio/src/test/resources/session-records/AzureFileSystemProviderTestreadattributesdirectory.json b/sdk/storage/azure-storage-blob-nio/src/test/resources/session-records/AzureFileSystemProviderTestreadattributesdirectory.json new file mode 100644 index 0000000000000..6c51f79994419 --- /dev/null +++ b/sdk/storage/azure-storage-blob-nio/src/test/resources/session-records/AzureFileSystemProviderTestreadattributesdirectory.json @@ -0,0 +1,204 @@ +{ + "networkCallRecords" : [ { + "Method" : "GET", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcreadattributesdirectory162437360ab1310d42475?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "7e7d43bd-3d74-4904-9294-50462edaf1e5" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-error-code" : "ContainerNotFound", + "retry-after" : "0", + "Content-Length" : "225", + "StatusCode" : "404", + "x-ms-request-id" : "b9b81df8-e01e-0014-2f4d-4e97b0000000", + "Body" : "ContainerNotFoundThe specified container does not exist.\nRequestId:b9b81df8-e01e-0014-2f4d-4e97b0000000\nTime:2020-06-29T19:45:41.3119277Z", + "Date" : "Mon, 29 Jun 2020 19:45:40 GMT", + "x-ms-client-request-id" : "7e7d43bd-3d74-4904-9294-50462edaf1e5", + "Content-Type" : "application/xml" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcreadattributesdirectory162437360ab1310d42475?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "9d194481-2242-4bd1-8a5d-5136286e2b97" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "ETag" : "0x8D81C650175B149", + "Last-Modified" : "Mon, 29 Jun 2020 19:45:41 GMT", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "59d8b0b8-e01e-0036-5d4d-4ef986000000", + "Date" : "Mon, 29 Jun 2020 19:45:41 GMT", + "x-ms-client-request-id" : "9d194481-2242-4bd1-8a5d-5136286e2b97" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcreadattributesdirectory27186960f0a7d13bab4d8?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "e52a9c9e-cf58-4f73-8df3-8f18bd1cb3be" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-error-code" : "ContainerNotFound", + "retry-after" : "0", + "Content-Length" : "225", + "StatusCode" : "404", + "x-ms-request-id" : "3bd7dfcb-201e-0081-3b4d-4ef683000000", + "Body" : "ContainerNotFoundThe specified container does not exist.\nRequestId:3bd7dfcb-201e-0081-3b4d-4ef683000000\nTime:2020-06-29T19:45:41.7794948Z", + "Date" : "Mon, 29 Jun 2020 19:45:41 GMT", + "x-ms-client-request-id" : "e52a9c9e-cf58-4f73-8df3-8f18bd1cb3be", + "Content-Type" : "application/xml" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcreadattributesdirectory27186960f0a7d13bab4d8?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "7c073c45-8783-4b1e-b0d4-35fac081b0a4" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "ETag" : "0x8D81C6501BEDDDE", + "Last-Modified" : "Mon, 29 Jun 2020 19:45:41 GMT", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "30e3af5e-301e-00b7-444d-4e5bd1000000", + "Date" : "Mon, 29 Jun 2020 19:45:41 GMT", + "x-ms-client-request-id" : "7c073c45-8783-4b1e-b0d4-35fac081b0a4" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcreadattributesdirectory162437360ab1310d42475/javablobreadattributesdirectory327075ca52baf00cc14?comp=blocklist", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "3c5e983e-7e58-4698-8f91-1a80d1dba2e2", + "Content-Type" : "application/xml; charset=utf-8" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "ETag" : "0x8D81C6501D72D28", + "x-ms-content-crc64" : "p1vsGtjjPsk=", + "Last-Modified" : "Mon, 29 Jun 2020 19:45:42 GMT", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "40a34408-801e-0026-594d-4ecf60000000", + "x-ms-request-server-encrypted" : "true", + "Date" : "Mon, 29 Jun 2020 19:45:42 GMT", + "x-ms-client-request-id" : "3c5e983e-7e58-4698-8f91-1a80d1dba2e2" + }, + "Exception" : null + }, { + "Method" : "HEAD", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcreadattributesdirectory162437360ab1310d42475/javablobreadattributesdirectory327075ca52baf00cc14", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "c575a2a1-9201-451e-acfc-976f794c67a7" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "x-ms-lease-status" : "unlocked", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-lease-state" : "available", + "Last-Modified" : "Mon, 29 Jun 2020 19:45:42 GMT", + "retry-after" : "0", + "StatusCode" : "200", + "Date" : "Mon, 29 Jun 2020 19:45:42 GMT", + "x-ms-blob-type" : "BlockBlob", + "Accept-Ranges" : "bytes", + "x-ms-server-encrypted" : "true", + "x-ms-meta-hdi_isfolder" : "true", + "x-ms-access-tier-inferred" : "true", + "x-ms-access-tier" : "Hot", + "ETag" : "0x8D81C6501D72D28", + "x-ms-creation-time" : "Mon, 29 Jun 2020 19:45:42 GMT", + "Content-Length" : "0", + "x-ms-request-id" : "68597a5a-201e-0020-2b4d-4e3818000000", + "x-ms-client-request-id" : "c575a2a1-9201-451e-acfc-976f794c67a7", + "Content-Type" : "application/octet-stream" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.blob.core.windows.net?prefix=jtcreadattributesdirectory&comp=list", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "98a569fc-e9cb-45ee-983b-be8d52edc3ef" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "2b70da53-901e-00ba-354d-4eb4dd000000", + "Body" : "jtcreadattributesdirectoryjtcreadattributesdirectory162437360ab1310d42475Mon, 29 Jun 2020 19:45:41 GMT\"0x8D81C650175B149\"unlockedavailable$account-encryption-keyfalsefalsefalsejtcreadattributesdirectory27186960f0a7d13bab4d8Mon, 29 Jun 2020 19:45:41 GMT\"0x8D81C6501BEDDDE\"unlockedavailable$account-encryption-keyfalsefalsefalse", + "Date" : "Mon, 29 Jun 2020 19:45:42 GMT", + "x-ms-client-request-id" : "98a569fc-e9cb-45ee-983b-be8d52edc3ef", + "Content-Type" : "application/xml" + }, + "Exception" : null + }, { + "Method" : "DELETE", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcreadattributesdirectory162437360ab1310d42475?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "f30b7b92-f6fc-4d04-bbd2-92911d2a4077" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "202", + "x-ms-request-id" : "4353650a-301e-0119-2f4d-4e3ee9000000", + "Date" : "Mon, 29 Jun 2020 19:45:41 GMT", + "x-ms-client-request-id" : "f30b7b92-f6fc-4d04-bbd2-92911d2a4077" + }, + "Exception" : null + }, { + "Method" : "DELETE", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcreadattributesdirectory27186960f0a7d13bab4d8?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "6a01d731-4643-4c89-a7ee-0c2f51a2a339" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "202", + "x-ms-request-id" : "50338e76-101e-0023-714d-4e3b1f000000", + "Date" : "Mon, 29 Jun 2020 19:45:41 GMT", + "x-ms-client-request-id" : "6a01d731-4643-4c89-a7ee-0c2f51a2a339" + }, + "Exception" : null + } ], + "variables" : [ "jtcreadattributesdirectory05749974cef0f23e5a463", "jtcreadattributesdirectory162437360ab1310d42475", "jtcreadattributesdirectory27186960f0a7d13bab4d8", "javablobreadattributesdirectory327075ca52baf00cc14" ] +} \ No newline at end of file diff --git a/sdk/storage/azure-storage-blob-nio/src/test/resources/session-records/AzureFileSystemProviderTestreadattributesioexception.json b/sdk/storage/azure-storage-blob-nio/src/test/resources/session-records/AzureFileSystemProviderTestreadattributesioexception.json new file mode 100644 index 0000000000000..52fd0b8c70e70 --- /dev/null +++ b/sdk/storage/azure-storage-blob-nio/src/test/resources/session-records/AzureFileSystemProviderTestreadattributesioexception.json @@ -0,0 +1,168 @@ +{ + "networkCallRecords" : [ { + "Method" : "GET", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcreadattributesioexception1645772aa59e3137fe49?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "8b159379-fd00-4224-839d-70f3e2dc60a1" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-error-code" : "ContainerNotFound", + "retry-after" : "0", + "Content-Length" : "225", + "StatusCode" : "404", + "x-ms-request-id" : "11dd51d8-001e-001e-554d-4e8e39000000", + "Body" : "ContainerNotFoundThe specified container does not exist.\nRequestId:11dd51d8-001e-001e-554d-4e8e39000000\nTime:2020-06-29T19:45:44.0362766Z", + "Date" : "Mon, 29 Jun 2020 19:45:43 GMT", + "x-ms-client-request-id" : "8b159379-fd00-4224-839d-70f3e2dc60a1", + "Content-Type" : "application/xml" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcreadattributesioexception1645772aa59e3137fe49?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "7c043cc0-298e-49d7-9798-1f0dc1efe7bb" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "ETag" : "0x8D81C65031402B8", + "Last-Modified" : "Mon, 29 Jun 2020 19:45:44 GMT", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "9c39190e-701e-00f4-344d-4e7138000000", + "Date" : "Mon, 29 Jun 2020 19:45:43 GMT", + "x-ms-client-request-id" : "7c043cc0-298e-49d7-9798-1f0dc1efe7bb" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcreadattributesioexception2146718c5b5586c54347?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "d120c6d0-6b04-4860-bd10-655db57ca6df" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-error-code" : "ContainerNotFound", + "retry-after" : "0", + "Content-Length" : "225", + "StatusCode" : "404", + "x-ms-request-id" : "3ec94882-601e-0063-2a4d-4e12f1000000", + "Body" : "ContainerNotFoundThe specified container does not exist.\nRequestId:3ec94882-601e-0063-2a4d-4e12f1000000\nTime:2020-06-29T19:45:44.3361724Z", + "Date" : "Mon, 29 Jun 2020 19:45:43 GMT", + "x-ms-client-request-id" : "d120c6d0-6b04-4860-bd10-655db57ca6df", + "Content-Type" : "application/xml" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcreadattributesioexception2146718c5b5586c54347?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "a3e3e72c-9c9d-4972-8db3-a10cc1ce73ae" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "ETag" : "0x8D81C650344176F", + "Last-Modified" : "Mon, 29 Jun 2020 19:45:44 GMT", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "ef34da3c-401e-00d5-6f4d-4e1c09000000", + "Date" : "Mon, 29 Jun 2020 19:45:43 GMT", + "x-ms-client-request-id" : "a3e3e72c-9c9d-4972-8db3-a10cc1ce73ae" + }, + "Exception" : null + }, { + "Method" : "HEAD", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcreadattributesioexception1645772aa59e3137fe49/path", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "44a8b5d2-67fe-417c-8b26-9f59f4edc7c5" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-error-code" : "BlobNotFound", + "retry-after" : "0", + "StatusCode" : "404", + "x-ms-request-id" : "8d8857f6-c01e-0080-014d-4ef77e000000", + "Date" : "Mon, 29 Jun 2020 19:45:44 GMT", + "x-ms-client-request-id" : "44a8b5d2-67fe-417c-8b26-9f59f4edc7c5" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.blob.core.windows.net?prefix=jtcreadattributesioexception&comp=list", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "e0d1c4e1-d01a-41f4-831f-cd44b78e66bc" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "45c1fe3b-301e-0052-194d-4e4926000000", + "Body" : "jtcreadattributesioexceptionjtcreadattributesioexception1645772aa59e3137fe49Mon, 29 Jun 2020 19:45:44 GMT\"0x8D81C65031402B8\"unlockedavailable$account-encryption-keyfalsefalsefalsejtcreadattributesioexception2146718c5b5586c54347Mon, 29 Jun 2020 19:45:44 GMT\"0x8D81C650344176F\"unlockedavailable$account-encryption-keyfalsefalsefalse", + "Date" : "Mon, 29 Jun 2020 19:45:44 GMT", + "x-ms-client-request-id" : "e0d1c4e1-d01a-41f4-831f-cd44b78e66bc", + "Content-Type" : "application/xml" + }, + "Exception" : null + }, { + "Method" : "DELETE", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcreadattributesioexception1645772aa59e3137fe49?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "2706d3f4-fa84-47a4-a2c4-a64786c1512a" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "202", + "x-ms-request-id" : "ff35b983-f01e-0088-7e4d-4eec0d000000", + "Date" : "Mon, 29 Jun 2020 19:45:44 GMT", + "x-ms-client-request-id" : "2706d3f4-fa84-47a4-a2c4-a64786c1512a" + }, + "Exception" : null + }, { + "Method" : "DELETE", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcreadattributesioexception2146718c5b5586c54347?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "998e9ddd-50e1-44f0-a6d7-bd73ac0b5b22" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "202", + "x-ms-request-id" : "ba026985-001e-00fb-794d-4e9cce000000", + "Date" : "Mon, 29 Jun 2020 19:45:44 GMT", + "x-ms-client-request-id" : "998e9ddd-50e1-44f0-a6d7-bd73ac0b5b22" + }, + "Exception" : null + } ], + "variables" : [ "jtcreadattributesioexception034559c3dc66b8a10646", "jtcreadattributesioexception1645772aa59e3137fe49", "jtcreadattributesioexception2146718c5b5586c54347" ] +} \ No newline at end of file diff --git a/sdk/storage/azure-storage-blob-nio/src/test/resources/session-records/AzureFileSystemProviderTestreadattributesstrdirectory.json b/sdk/storage/azure-storage-blob-nio/src/test/resources/session-records/AzureFileSystemProviderTestreadattributesstrdirectory.json new file mode 100644 index 0000000000000..c01f9630e6ea0 --- /dev/null +++ b/sdk/storage/azure-storage-blob-nio/src/test/resources/session-records/AzureFileSystemProviderTestreadattributesstrdirectory.json @@ -0,0 +1,204 @@ +{ + "networkCallRecords" : [ { + "Method" : "GET", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcreadattributesstrdirectory1288954a09bcd8e8dd43?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "20e5688a-8a18-46e3-9be3-57791e02321c" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-error-code" : "ContainerNotFound", + "retry-after" : "0", + "Content-Length" : "225", + "StatusCode" : "404", + "x-ms-request-id" : "565222fd-301e-013b-484d-4e50df000000", + "Body" : "ContainerNotFoundThe specified container does not exist.\nRequestId:565222fd-301e-013b-484d-4e50df000000\nTime:2020-06-29T19:46:00.1386865Z", + "Date" : "Mon, 29 Jun 2020 19:46:00 GMT", + "x-ms-client-request-id" : "20e5688a-8a18-46e3-9be3-57791e02321c", + "Content-Type" : "application/xml" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcreadattributesstrdirectory1288954a09bcd8e8dd43?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "be90cec9-c2d2-4277-8434-64b113831c90" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "ETag" : "0x8D81C650CAF4F5D", + "Last-Modified" : "Mon, 29 Jun 2020 19:46:00 GMT", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "fe3da62c-301e-0059-0f4d-4e5152000000", + "Date" : "Mon, 29 Jun 2020 19:46:00 GMT", + "x-ms-client-request-id" : "be90cec9-c2d2-4277-8434-64b113831c90" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcreadattributesstrdirectory258201710c9c2e59554c?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "89582767-41f0-403d-ab96-ffd2b7bcb10d" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-error-code" : "ContainerNotFound", + "retry-after" : "0", + "Content-Length" : "225", + "StatusCode" : "404", + "x-ms-request-id" : "1206af24-801e-0004-284d-4ea156000000", + "Body" : "ContainerNotFoundThe specified container does not exist.\nRequestId:1206af24-801e-0004-284d-4ea156000000\nTime:2020-06-29T19:46:00.4566065Z", + "Date" : "Mon, 29 Jun 2020 19:45:59 GMT", + "x-ms-client-request-id" : "89582767-41f0-403d-ab96-ffd2b7bcb10d", + "Content-Type" : "application/xml" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcreadattributesstrdirectory258201710c9c2e59554c?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "bd31e406-1de4-4958-8bbe-b52886c6384d" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "ETag" : "0x8D81C650CDE708A", + "Last-Modified" : "Mon, 29 Jun 2020 19:46:00 GMT", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "018590b4-801e-0062-324d-4e130c000000", + "Date" : "Mon, 29 Jun 2020 19:46:00 GMT", + "x-ms-client-request-id" : "bd31e406-1de4-4958-8bbe-b52886c6384d" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcreadattributesstrdirectory1288954a09bcd8e8dd43/javablobreadattributesstrdirectory391788216c5da8933?comp=blocklist", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "108313bb-7a2b-4367-9b35-6cb5f4810ba2", + "Content-Type" : "application/xml; charset=utf-8" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "ETag" : "0x8D81C650D00C79D", + "x-ms-content-crc64" : "p1vsGtjjPsk=", + "Last-Modified" : "Mon, 29 Jun 2020 19:46:00 GMT", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "0d3d1dae-b01e-000c-644d-4eba25000000", + "x-ms-request-server-encrypted" : "true", + "Date" : "Mon, 29 Jun 2020 19:46:00 GMT", + "x-ms-client-request-id" : "108313bb-7a2b-4367-9b35-6cb5f4810ba2" + }, + "Exception" : null + }, { + "Method" : "HEAD", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcreadattributesstrdirectory1288954a09bcd8e8dd43/javablobreadattributesstrdirectory391788216c5da8933", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "1f0b4f4d-4603-4f08-95d4-dd3b20cef7fa" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "x-ms-lease-status" : "unlocked", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-lease-state" : "available", + "Last-Modified" : "Mon, 29 Jun 2020 19:46:00 GMT", + "retry-after" : "0", + "StatusCode" : "200", + "Date" : "Mon, 29 Jun 2020 19:46:00 GMT", + "x-ms-blob-type" : "BlockBlob", + "Accept-Ranges" : "bytes", + "x-ms-server-encrypted" : "true", + "x-ms-meta-hdi_isfolder" : "true", + "x-ms-access-tier-inferred" : "true", + "x-ms-access-tier" : "Hot", + "ETag" : "0x8D81C650D00C79D", + "x-ms-creation-time" : "Mon, 29 Jun 2020 19:46:00 GMT", + "Content-Length" : "0", + "x-ms-request-id" : "837d4c67-501e-002f-144d-4ed5ee000000", + "x-ms-client-request-id" : "1f0b4f4d-4603-4f08-95d4-dd3b20cef7fa", + "Content-Type" : "application/octet-stream" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.blob.core.windows.net?prefix=jtcreadattributesstrdirectory&comp=list", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "729f161e-20e2-46c6-82b3-37a45bf77713" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "81f3ce43-e01e-003d-0b4d-4ee1f2000000", + "Body" : "jtcreadattributesstrdirectoryjtcreadattributesstrdirectory1288954a09bcd8e8dd43Mon, 29 Jun 2020 19:46:00 GMT\"0x8D81C650CAF4F5D\"unlockedavailable$account-encryption-keyfalsefalsefalsejtcreadattributesstrdirectory258201710c9c2e59554cMon, 29 Jun 2020 19:46:00 GMT\"0x8D81C650CDE708A\"unlockedavailable$account-encryption-keyfalsefalsefalse", + "Date" : "Mon, 29 Jun 2020 19:46:00 GMT", + "x-ms-client-request-id" : "729f161e-20e2-46c6-82b3-37a45bf77713", + "Content-Type" : "application/xml" + }, + "Exception" : null + }, { + "Method" : "DELETE", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcreadattributesstrdirectory1288954a09bcd8e8dd43?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "f6058650-4153-4f82-be6a-9e771d602241" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "202", + "x-ms-request-id" : "94ad1887-801e-0087-804d-4e01fb000000", + "Date" : "Mon, 29 Jun 2020 19:46:00 GMT", + "x-ms-client-request-id" : "f6058650-4153-4f82-be6a-9e771d602241" + }, + "Exception" : null + }, { + "Method" : "DELETE", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcreadattributesstrdirectory258201710c9c2e59554c?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "57d9931d-79eb-4307-a970-3102bf6c8f6c" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "202", + "x-ms-request-id" : "5cc003d5-901e-0114-654d-4ed1e5000000", + "Date" : "Mon, 29 Jun 2020 19:46:00 GMT", + "x-ms-client-request-id" : "57d9931d-79eb-4307-a970-3102bf6c8f6c" + }, + "Exception" : null + } ], + "variables" : [ "jtcreadattributesstrdirectory054503ad87649db68d4f", "jtcreadattributesstrdirectory1288954a09bcd8e8dd43", "jtcreadattributesstrdirectory258201710c9c2e59554c", "javablobreadattributesstrdirectory391788216c5da8933" ] +} \ No newline at end of file diff --git a/sdk/storage/azure-storage-blob-nio/src/test/resources/session-records/AzureFileSystemProviderTestreadattributesstria[0].json b/sdk/storage/azure-storage-blob-nio/src/test/resources/session-records/AzureFileSystemProviderTestreadattributesstria[0].json new file mode 100644 index 0000000000000..c7872046b065d --- /dev/null +++ b/sdk/storage/azure-storage-blob-nio/src/test/resources/session-records/AzureFileSystemProviderTestreadattributesstria[0].json @@ -0,0 +1,149 @@ +{ + "networkCallRecords" : [ { + "Method" : "GET", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcreadattributesstria1063257e4e44d5fe5d4204a?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "8eb3d0f3-ebc8-4e0a-bf3e-a4913bfc0afa" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-error-code" : "ContainerNotFound", + "retry-after" : "0", + "Content-Length" : "225", + "StatusCode" : "404", + "x-ms-request-id" : "7f542411-f01e-010f-414d-4eff77000000", + "Body" : "ContainerNotFoundThe specified container does not exist.\nRequestId:7f542411-f01e-010f-414d-4eff77000000\nTime:2020-06-29T19:46:01.6479718Z", + "Date" : "Mon, 29 Jun 2020 19:46:01 GMT", + "x-ms-client-request-id" : "8eb3d0f3-ebc8-4e0a-bf3e-a4913bfc0afa", + "Content-Type" : "application/xml" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcreadattributesstria1063257e4e44d5fe5d4204a?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "5b1a134c-f594-4fe7-8670-b7cecb51331f" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "ETag" : "0x8D81C650D9560F3", + "Last-Modified" : "Mon, 29 Jun 2020 19:46:01 GMT", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "dbf768e9-401e-0091-5f4d-4ec065000000", + "Date" : "Mon, 29 Jun 2020 19:46:01 GMT", + "x-ms-client-request-id" : "5b1a134c-f594-4fe7-8670-b7cecb51331f" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcreadattributesstria2255822cba2dc284d845ee8?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "75d6dbd2-453d-4064-9db5-ffd760f80ae8" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-error-code" : "ContainerNotFound", + "retry-after" : "0", + "Content-Length" : "225", + "StatusCode" : "404", + "x-ms-request-id" : "970ec66a-401e-013f-5e4d-4ea55d000000", + "Body" : "ContainerNotFoundThe specified container does not exist.\nRequestId:970ec66a-401e-013f-5e4d-4ea55d000000\nTime:2020-06-29T19:46:01.9811699Z", + "Date" : "Mon, 29 Jun 2020 19:46:01 GMT", + "x-ms-client-request-id" : "75d6dbd2-453d-4064-9db5-ffd760f80ae8", + "Content-Type" : "application/xml" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcreadattributesstria2255822cba2dc284d845ee8?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "68088a83-2830-421f-9abd-95431d35dc0a" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "ETag" : "0x8D81C650DC71747", + "Last-Modified" : "Mon, 29 Jun 2020 19:46:02 GMT", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "0b5c4108-501e-0085-664d-4e0301000000", + "Date" : "Mon, 29 Jun 2020 19:46:01 GMT", + "x-ms-client-request-id" : "68088a83-2830-421f-9abd-95431d35dc0a" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.blob.core.windows.net?prefix=jtcreadattributesstria&comp=list", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "e410daa0-b9d5-4c23-9911-6df946008abe" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "0317e4e9-101e-00e4-664d-4e47de000000", + "Body" : "jtcreadattributesstriajtcreadattributesstria1063257e4e44d5fe5d4204aMon, 29 Jun 2020 19:46:01 GMT\"0x8D81C650D9560F3\"unlockedavailable$account-encryption-keyfalsefalsefalsejtcreadattributesstria2255822cba2dc284d845ee8Mon, 29 Jun 2020 19:46:02 GMT\"0x8D81C650DC71747\"unlockedavailable$account-encryption-keyfalsefalsefalse", + "Date" : "Mon, 29 Jun 2020 19:46:02 GMT", + "x-ms-client-request-id" : "e410daa0-b9d5-4c23-9911-6df946008abe", + "Content-Type" : "application/xml" + }, + "Exception" : null + }, { + "Method" : "DELETE", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcreadattributesstria1063257e4e44d5fe5d4204a?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "4c5ba2bd-1478-4381-94ae-baef847e4296" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "202", + "x-ms-request-id" : "7053979e-301e-0016-0f4d-4e954a000000", + "Date" : "Mon, 29 Jun 2020 19:46:02 GMT", + "x-ms-client-request-id" : "4c5ba2bd-1478-4381-94ae-baef847e4296" + }, + "Exception" : null + }, { + "Method" : "DELETE", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcreadattributesstria2255822cba2dc284d845ee8?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "564803e8-d76c-489b-882c-e0b44e6b602d" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "202", + "x-ms-request-id" : "0f5c0d7a-b01e-0025-044d-4ecc67000000", + "Date" : "Mon, 29 Jun 2020 19:46:02 GMT", + "x-ms-client-request-id" : "564803e8-d76c-489b-882c-e0b44e6b602d" + }, + "Exception" : null + } ], + "variables" : [ "jtcreadattributesstria03801473cad8121c064f358", "jtcreadattributesstria1063257e4e44d5fe5d4204a", "jtcreadattributesstria2255822cba2dc284d845ee8", "javablobreadattributesstria3174865accc9ffb1264d3" ] +} \ No newline at end of file diff --git a/sdk/storage/azure-storage-blob-nio/src/test/resources/session-records/AzureFileSystemProviderTestreadattributesstria[1].json b/sdk/storage/azure-storage-blob-nio/src/test/resources/session-records/AzureFileSystemProviderTestreadattributesstria[1].json new file mode 100644 index 0000000000000..d20e48ff2eacf --- /dev/null +++ b/sdk/storage/azure-storage-blob-nio/src/test/resources/session-records/AzureFileSystemProviderTestreadattributesstria[1].json @@ -0,0 +1,149 @@ +{ + "networkCallRecords" : [ { + "Method" : "GET", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcreadattributesstria122127a643a84684ea488ab?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "0f437c6c-8b0b-4253-a823-64b446b5a1dd" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-error-code" : "ContainerNotFound", + "retry-after" : "0", + "Content-Length" : "225", + "StatusCode" : "404", + "x-ms-request-id" : "b6714767-701e-0033-7d4d-4e0df9000000", + "Body" : "ContainerNotFoundThe specified container does not exist.\nRequestId:b6714767-701e-0033-7d4d-4e0df9000000\nTime:2020-06-29T19:46:02.8418164Z", + "Date" : "Mon, 29 Jun 2020 19:46:01 GMT", + "x-ms-client-request-id" : "0f437c6c-8b0b-4253-a823-64b446b5a1dd", + "Content-Type" : "application/xml" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcreadattributesstria122127a643a84684ea488ab?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "1e5a6fd7-e458-454d-ba04-f0485a3fe7c8" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "ETag" : "0x8D81C650E494FDC", + "Last-Modified" : "Mon, 29 Jun 2020 19:46:02 GMT", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "79e48092-101e-00cd-4d4d-4e319c000000", + "Date" : "Mon, 29 Jun 2020 19:46:02 GMT", + "x-ms-client-request-id" : "1e5a6fd7-e458-454d-ba04-f0485a3fe7c8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcreadattributesstria213211dbb6827b3f7644148?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "371b1314-4d25-4f47-87e8-4b858a2f38b4" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-error-code" : "ContainerNotFound", + "retry-after" : "0", + "Content-Length" : "225", + "StatusCode" : "404", + "x-ms-request-id" : "e4297890-e01e-0050-364d-4e4bdc000000", + "Body" : "ContainerNotFoundThe specified container does not exist.\nRequestId:e4297890-e01e-0050-364d-4e4bdc000000\nTime:2020-06-29T19:46:03.1775361Z", + "Date" : "Mon, 29 Jun 2020 19:46:03 GMT", + "x-ms-client-request-id" : "371b1314-4d25-4f47-87e8-4b858a2f38b4", + "Content-Type" : "application/xml" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcreadattributesstria213211dbb6827b3f7644148?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "5b9087ca-2a29-40e4-8402-685a93fd55fd" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "ETag" : "0x8D81C650E802AA0", + "Last-Modified" : "Mon, 29 Jun 2020 19:46:03 GMT", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "7391d095-e01e-0072-334d-4e25ea000000", + "Date" : "Mon, 29 Jun 2020 19:46:02 GMT", + "x-ms-client-request-id" : "5b9087ca-2a29-40e4-8402-685a93fd55fd" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.blob.core.windows.net?prefix=jtcreadattributesstria&comp=list", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "cda3221c-365c-4360-ada0-d2000e1b2aa8" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "c9a3b711-d01e-00bd-464d-4e4258000000", + "Body" : "jtcreadattributesstriajtcreadattributesstria122127a643a84684ea488abMon, 29 Jun 2020 19:46:02 GMT\"0x8D81C650E494FDC\"unlockedavailable$account-encryption-keyfalsefalsefalsejtcreadattributesstria213211dbb6827b3f7644148Mon, 29 Jun 2020 19:46:03 GMT\"0x8D81C650E802AA0\"unlockedavailable$account-encryption-keyfalsefalsefalse", + "Date" : "Mon, 29 Jun 2020 19:46:03 GMT", + "x-ms-client-request-id" : "cda3221c-365c-4360-ada0-d2000e1b2aa8", + "Content-Type" : "application/xml" + }, + "Exception" : null + }, { + "Method" : "DELETE", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcreadattributesstria122127a643a84684ea488ab?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "91425939-e86e-48f6-a1a1-648d27cffd04" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "202", + "x-ms-request-id" : "9c24674a-201e-002b-764d-4e206c000000", + "Date" : "Mon, 29 Jun 2020 19:46:03 GMT", + "x-ms-client-request-id" : "91425939-e86e-48f6-a1a1-648d27cffd04" + }, + "Exception" : null + }, { + "Method" : "DELETE", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcreadattributesstria213211dbb6827b3f7644148?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "b16b1a20-abd0-466b-8d4c-4544c86d255e" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "202", + "x-ms-request-id" : "fdbd510a-b01e-0061-584d-4e100b000000", + "Date" : "Mon, 29 Jun 2020 19:46:03 GMT", + "x-ms-client-request-id" : "b16b1a20-abd0-466b-8d4c-4544c86d255e" + }, + "Exception" : null + } ], + "variables" : [ "jtcreadattributesstria030767f48d0b5856cf4c9db", "jtcreadattributesstria122127a643a84684ea488ab", "jtcreadattributesstria213211dbb6827b3f7644148", "javablobreadattributesstria3099491e6b18c72e704d9" ] +} \ No newline at end of file diff --git a/sdk/storage/azure-storage-blob-nio/src/test/resources/session-records/AzureFileSystemProviderTestreadattributesstria[2].json b/sdk/storage/azure-storage-blob-nio/src/test/resources/session-records/AzureFileSystemProviderTestreadattributesstria[2].json new file mode 100644 index 0000000000000..28ff87721f21e --- /dev/null +++ b/sdk/storage/azure-storage-blob-nio/src/test/resources/session-records/AzureFileSystemProviderTestreadattributesstria[2].json @@ -0,0 +1,149 @@ +{ + "networkCallRecords" : [ { + "Method" : "GET", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcreadattributesstria101057ca8847ea7734413fb?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "ab94dda3-33d4-4fcc-9555-ca5ca9647449" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-error-code" : "ContainerNotFound", + "retry-after" : "0", + "Content-Length" : "225", + "StatusCode" : "404", + "x-ms-request-id" : "3d033f35-301e-0034-3a4d-4efb7c000000", + "Body" : "ContainerNotFoundThe specified container does not exist.\nRequestId:3d033f35-301e-0034-3a4d-4efb7c000000\nTime:2020-06-29T19:46:03.9901542Z", + "Date" : "Mon, 29 Jun 2020 19:46:03 GMT", + "x-ms-client-request-id" : "ab94dda3-33d4-4fcc-9555-ca5ca9647449", + "Content-Type" : "application/xml" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcreadattributesstria101057ca8847ea7734413fb?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "1d3f809c-35b9-4176-908e-42c1e1a6845c" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "ETag" : "0x8D81C650EF9E2D2", + "Last-Modified" : "Mon, 29 Jun 2020 19:46:04 GMT", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "3fd19be6-b01e-006a-214d-4e087f000000", + "Date" : "Mon, 29 Jun 2020 19:46:03 GMT", + "x-ms-client-request-id" : "1d3f809c-35b9-4176-908e-42c1e1a6845c" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcreadattributesstria204232aa0cee27e7874599a?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "ef68eb25-55e8-4063-8f0f-1b57bffb450b" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-error-code" : "ContainerNotFound", + "retry-after" : "0", + "Content-Length" : "225", + "StatusCode" : "404", + "x-ms-request-id" : "f174ad8f-d01e-0118-054d-4e3f14000000", + "Body" : "ContainerNotFoundThe specified container does not exist.\nRequestId:f174ad8f-d01e-0118-054d-4e3f14000000\nTime:2020-06-29T19:46:04.3008958Z", + "Date" : "Mon, 29 Jun 2020 19:46:03 GMT", + "x-ms-client-request-id" : "ef68eb25-55e8-4063-8f0f-1b57bffb450b", + "Content-Type" : "application/xml" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcreadattributesstria204232aa0cee27e7874599a?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "c2d536d8-291b-46b0-941d-b0fa116a50d8" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "ETag" : "0x8D81C650F2BEFEE", + "Last-Modified" : "Mon, 29 Jun 2020 19:46:04 GMT", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "89c224ee-001e-0037-484d-4ef87b000000", + "Date" : "Mon, 29 Jun 2020 19:46:04 GMT", + "x-ms-client-request-id" : "c2d536d8-291b-46b0-941d-b0fa116a50d8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.blob.core.windows.net?prefix=jtcreadattributesstria&comp=list", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "174f64eb-3bdb-45e1-8aa7-3487931f16af" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "cad683bc-201e-010d-424d-4efd8d000000", + "Body" : "jtcreadattributesstriajtcreadattributesstria101057ca8847ea7734413fbMon, 29 Jun 2020 19:46:04 GMT\"0x8D81C650EF9E2D2\"unlockedavailable$account-encryption-keyfalsefalsefalsejtcreadattributesstria204232aa0cee27e7874599aMon, 29 Jun 2020 19:46:04 GMT\"0x8D81C650F2BEFEE\"unlockedavailable$account-encryption-keyfalsefalsefalse", + "Date" : "Mon, 29 Jun 2020 19:46:04 GMT", + "x-ms-client-request-id" : "174f64eb-3bdb-45e1-8aa7-3487931f16af", + "Content-Type" : "application/xml" + }, + "Exception" : null + }, { + "Method" : "DELETE", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcreadattributesstria101057ca8847ea7734413fb?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "71ef133f-a485-415f-abf4-83a8c5b625de" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "202", + "x-ms-request-id" : "fc6e357e-a01e-0090-1c4d-4ec198000000", + "Date" : "Mon, 29 Jun 2020 19:46:04 GMT", + "x-ms-client-request-id" : "71ef133f-a485-415f-abf4-83a8c5b625de" + }, + "Exception" : null + }, { + "Method" : "DELETE", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcreadattributesstria204232aa0cee27e7874599a?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "a5159cae-5498-4296-a9c7-7c5fa50dfdbd" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "202", + "x-ms-request-id" : "52fca39d-a01e-003a-4c4d-4e1777000000", + "Date" : "Mon, 29 Jun 2020 19:46:04 GMT", + "x-ms-client-request-id" : "a5159cae-5498-4296-a9c7-7c5fa50dfdbd" + }, + "Exception" : null + } ], + "variables" : [ "jtcreadattributesstria0559611e5910f7ff6f48cbb", "jtcreadattributesstria101057ca8847ea7734413fb", "jtcreadattributesstria204232aa0cee27e7874599a", "javablobreadattributesstria3270706fecab428fb84e4" ] +} \ No newline at end of file diff --git a/sdk/storage/azure-storage-blob-nio/src/test/resources/session-records/AzureFileSystemProviderTestreadattributesstrinvalidview.json b/sdk/storage/azure-storage-blob-nio/src/test/resources/session-records/AzureFileSystemProviderTestreadattributesstrinvalidview.json new file mode 100644 index 0000000000000..1419e225bc538 --- /dev/null +++ b/sdk/storage/azure-storage-blob-nio/src/test/resources/session-records/AzureFileSystemProviderTestreadattributesstrinvalidview.json @@ -0,0 +1,149 @@ +{ + "networkCallRecords" : [ { + "Method" : "GET", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcreadattributesstrinvalidview1268437afbbc40b1784?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "698a651e-9ec0-4273-9898-2490ab55969b" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-error-code" : "ContainerNotFound", + "retry-after" : "0", + "Content-Length" : "225", + "StatusCode" : "404", + "x-ms-request-id" : "af9d43f8-501e-00ac-0d4d-4e7543000000", + "Body" : "ContainerNotFoundThe specified container does not exist.\nRequestId:af9d43f8-501e-00ac-0d4d-4e7543000000\nTime:2020-06-29T19:46:05.1177092Z", + "Date" : "Mon, 29 Jun 2020 19:46:04 GMT", + "x-ms-client-request-id" : "698a651e-9ec0-4273-9898-2490ab55969b", + "Content-Type" : "application/xml" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcreadattributesstrinvalidview1268437afbbc40b1784?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "00099c01-569b-4534-b5a0-29ff30bef8b1" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "ETag" : "0x8D81C650FA50D80", + "Last-Modified" : "Mon, 29 Jun 2020 19:46:05 GMT", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "fc46908b-a01e-0057-764d-4ebd59000000", + "Date" : "Mon, 29 Jun 2020 19:46:05 GMT", + "x-ms-client-request-id" : "00099c01-569b-4534-b5a0-29ff30bef8b1" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcreadattributesstrinvalidview214629e2fad2cfcef34?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "e8e0a70d-17f1-453c-9265-7b4ec4e10e76" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-error-code" : "ContainerNotFound", + "retry-after" : "0", + "Content-Length" : "225", + "StatusCode" : "404", + "x-ms-request-id" : "02d29d5e-f01e-012d-354d-4e9141000000", + "Body" : "ContainerNotFoundThe specified container does not exist.\nRequestId:02d29d5e-f01e-012d-354d-4e9141000000\nTime:2020-06-29T19:46:05.4201804Z", + "Date" : "Mon, 29 Jun 2020 19:46:05 GMT", + "x-ms-client-request-id" : "e8e0a70d-17f1-453c-9265-7b4ec4e10e76", + "Content-Type" : "application/xml" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcreadattributesstrinvalidview214629e2fad2cfcef34?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "6737f5ed-9fef-48c7-b936-bf68f8f14109" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "ETag" : "0x8D81C650FD4F916", + "Last-Modified" : "Mon, 29 Jun 2020 19:46:05 GMT", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "ce8eadff-801e-000f-774d-4eb922000000", + "Date" : "Mon, 29 Jun 2020 19:46:05 GMT", + "x-ms-client-request-id" : "6737f5ed-9fef-48c7-b936-bf68f8f14109" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.blob.core.windows.net?prefix=jtcreadattributesstrinvalidview&comp=list", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "3fcbe570-b9c6-4678-87e9-545d902e6d22" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "bbd9111a-e01e-00be-804d-4e415f000000", + "Body" : "jtcreadattributesstrinvalidviewjtcreadattributesstrinvalidview1268437afbbc40b1784Mon, 29 Jun 2020 19:46:05 GMT\"0x8D81C650FA50D80\"unlockedavailable$account-encryption-keyfalsefalsefalsejtcreadattributesstrinvalidview214629e2fad2cfcef34Mon, 29 Jun 2020 19:46:05 GMT\"0x8D81C650FD4F916\"unlockedavailable$account-encryption-keyfalsefalsefalse", + "Date" : "Mon, 29 Jun 2020 19:46:04 GMT", + "x-ms-client-request-id" : "3fcbe570-b9c6-4678-87e9-545d902e6d22", + "Content-Type" : "application/xml" + }, + "Exception" : null + }, { + "Method" : "DELETE", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcreadattributesstrinvalidview1268437afbbc40b1784?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "15548c2c-c779-4060-a620-eb86bad04fb5" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "202", + "x-ms-request-id" : "55e794f3-a01e-0018-684d-4e7941000000", + "Date" : "Mon, 29 Jun 2020 19:46:05 GMT", + "x-ms-client-request-id" : "15548c2c-c779-4060-a620-eb86bad04fb5" + }, + "Exception" : null + }, { + "Method" : "DELETE", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcreadattributesstrinvalidview214629e2fad2cfcef34?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "8858ecd6-a113-45b2-a387-974be40edaf7" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "202", + "x-ms-request-id" : "6501e0ac-b01e-012a-664d-4e67c4000000", + "Date" : "Mon, 29 Jun 2020 19:46:05 GMT", + "x-ms-client-request-id" : "8858ecd6-a113-45b2-a387-974be40edaf7" + }, + "Exception" : null + } ], + "variables" : [ "jtcreadattributesstrinvalidview043222224583d43f824", "jtcreadattributesstrinvalidview1268437afbbc40b1784", "jtcreadattributesstrinvalidview214629e2fad2cfcef34", "javablobreadattributesstrinvalidview3096368095bd22cf" ] +} \ No newline at end of file diff --git a/sdk/storage/azure-storage-blob-nio/src/test/resources/session-records/AzureFileSystemProviderTestreadattributesstrioexception.json b/sdk/storage/azure-storage-blob-nio/src/test/resources/session-records/AzureFileSystemProviderTestreadattributesstrioexception.json new file mode 100644 index 0000000000000..602c82aa1fd01 --- /dev/null +++ b/sdk/storage/azure-storage-blob-nio/src/test/resources/session-records/AzureFileSystemProviderTestreadattributesstrioexception.json @@ -0,0 +1,168 @@ +{ + "networkCallRecords" : [ { + "Method" : "GET", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcreadattributesstrioexception11836991ef307f61714?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "6a95aa2b-0c7d-4bf9-9ce2-8decb3f9f916" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-error-code" : "ContainerNotFound", + "retry-after" : "0", + "Content-Length" : "225", + "StatusCode" : "404", + "x-ms-request-id" : "5c61dd58-701e-0099-6a4d-4edb16000000", + "Body" : "ContainerNotFoundThe specified container does not exist.\nRequestId:5c61dd58-701e-0099-6a4d-4edb16000000\nTime:2020-06-29T19:46:06.1998142Z", + "Date" : "Mon, 29 Jun 2020 19:46:05 GMT", + "x-ms-client-request-id" : "6a95aa2b-0c7d-4bf9-9ce2-8decb3f9f916", + "Content-Type" : "application/xml" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcreadattributesstrioexception11836991ef307f61714?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "cfbf51e6-e270-4c0f-8cba-34270e3ba7ac" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "ETag" : "0x8D81C65104A5778", + "Last-Modified" : "Mon, 29 Jun 2020 19:46:06 GMT", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "fff86a37-901e-001b-284d-4e7a46000000", + "Date" : "Mon, 29 Jun 2020 19:46:05 GMT", + "x-ms-client-request-id" : "cfbf51e6-e270-4c0f-8cba-34270e3ba7ac" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcreadattributesstrioexception2208528d849c033c194?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "6712417e-7626-4c31-a8a2-055508eb1016" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-error-code" : "ContainerNotFound", + "retry-after" : "0", + "Content-Length" : "225", + "StatusCode" : "404", + "x-ms-request-id" : "178dae0c-201e-0002-294d-4e562e000000", + "Body" : "ContainerNotFoundThe specified container does not exist.\nRequestId:178dae0c-201e-0002-294d-4e562e000000\nTime:2020-06-29T19:46:06.5040571Z", + "Date" : "Mon, 29 Jun 2020 19:46:05 GMT", + "x-ms-client-request-id" : "6712417e-7626-4c31-a8a2-055508eb1016", + "Content-Type" : "application/xml" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcreadattributesstrioexception2208528d849c033c194?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "b6ba9532-244b-4ff6-b847-2b2a331a977e" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "ETag" : "0x8D81C65107943D2", + "Last-Modified" : "Mon, 29 Jun 2020 19:46:06 GMT", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "97b9c603-401e-0074-024d-4ed292000000", + "Date" : "Mon, 29 Jun 2020 19:46:06 GMT", + "x-ms-client-request-id" : "b6ba9532-244b-4ff6-b847-2b2a331a977e" + }, + "Exception" : null + }, { + "Method" : "HEAD", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcreadattributesstrioexception11836991ef307f61714/path", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "d93ec05d-25c5-4faa-8575-c05f766bc270" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-error-code" : "BlobNotFound", + "retry-after" : "0", + "StatusCode" : "404", + "x-ms-request-id" : "605823a0-c01e-006e-6a4d-4efdfd000000", + "Date" : "Mon, 29 Jun 2020 19:46:06 GMT", + "x-ms-client-request-id" : "d93ec05d-25c5-4faa-8575-c05f766bc270" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.blob.core.windows.net?prefix=jtcreadattributesstrioexception&comp=list", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "a4a3fbf4-d522-43a5-9707-87ac1e198caf" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "76b9ae6f-801e-002d-254d-4ed714000000", + "Body" : "jtcreadattributesstrioexceptionjtcreadattributesstrioexception11836991ef307f61714Mon, 29 Jun 2020 19:46:06 GMT\"0x8D81C65104A5778\"unlockedavailable$account-encryption-keyfalsefalsefalsejtcreadattributesstrioexception2208528d849c033c194Mon, 29 Jun 2020 19:46:06 GMT\"0x8D81C65107943D2\"unlockedavailable$account-encryption-keyfalsefalsefalse", + "Date" : "Mon, 29 Jun 2020 19:46:06 GMT", + "x-ms-client-request-id" : "a4a3fbf4-d522-43a5-9707-87ac1e198caf", + "Content-Type" : "application/xml" + }, + "Exception" : null + }, { + "Method" : "DELETE", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcreadattributesstrioexception11836991ef307f61714?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "fadb441d-cc5c-4ac0-b7c4-8190ad15c993" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "202", + "x-ms-request-id" : "0f5320ad-a01e-0013-4d4d-4e6135000000", + "Date" : "Mon, 29 Jun 2020 19:46:06 GMT", + "x-ms-client-request-id" : "fadb441d-cc5c-4ac0-b7c4-8190ad15c993" + }, + "Exception" : null + }, { + "Method" : "DELETE", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcreadattributesstrioexception2208528d849c033c194?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "6ae3ef8b-61c8-4dbc-8033-58db9dfed3d1" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "202", + "x-ms-request-id" : "1f3f41f7-501e-000d-6f4d-4ebbd8000000", + "Date" : "Mon, 29 Jun 2020 19:46:06 GMT", + "x-ms-client-request-id" : "6ae3ef8b-61c8-4dbc-8033-58db9dfed3d1" + }, + "Exception" : null + } ], + "variables" : [ "jtcreadattributesstrioexception04135470eda43b8f984", "jtcreadattributesstrioexception11836991ef307f61714", "jtcreadattributesstrioexception2208528d849c033c194" ] +} \ No newline at end of file diff --git a/sdk/storage/azure-storage-blob-nio/src/test/resources/session-records/AzureFileSystemProviderTestreadattributesstrparsing[0].json b/sdk/storage/azure-storage-blob-nio/src/test/resources/session-records/AzureFileSystemProviderTestreadattributesstrparsing[0].json new file mode 100644 index 0000000000000..a10f381105b64 --- /dev/null +++ b/sdk/storage/azure-storage-blob-nio/src/test/resources/session-records/AzureFileSystemProviderTestreadattributesstrparsing[0].json @@ -0,0 +1,226 @@ +{ + "networkCallRecords" : [ { + "Method" : "GET", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcreadattributesstrparsing1599825bbe9ce55c12422?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "05933fa5-1d3b-498c-8b9f-c6fb68feaf9f" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-error-code" : "ContainerNotFound", + "retry-after" : "0", + "Content-Length" : "225", + "StatusCode" : "404", + "x-ms-request-id" : "718b90fd-801e-0069-194d-4e0b78000000", + "Body" : "ContainerNotFoundThe specified container does not exist.\nRequestId:718b90fd-801e-0069-194d-4e0b78000000\nTime:2020-06-29T19:45:45.2854397Z", + "Date" : "Mon, 29 Jun 2020 19:45:44 GMT", + "x-ms-client-request-id" : "05933fa5-1d3b-498c-8b9f-c6fb68feaf9f", + "Content-Type" : "application/xml" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcreadattributesstrparsing1599825bbe9ce55c12422?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "7b728e47-e0ea-4186-8140-e0d962c49f3d" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "ETag" : "0x8D81C6503D73609", + "Last-Modified" : "Mon, 29 Jun 2020 19:45:45 GMT", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "81d20bd3-701e-0077-524d-4ed195000000", + "Date" : "Mon, 29 Jun 2020 19:45:45 GMT", + "x-ms-client-request-id" : "7b728e47-e0ea-4186-8140-e0d962c49f3d" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcreadattributesstrparsing27031942a3041d9cbb4de?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "d7de70ab-4aec-4902-9a48-b6bbdc979bc7" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-error-code" : "ContainerNotFound", + "retry-after" : "0", + "Content-Length" : "225", + "StatusCode" : "404", + "x-ms-request-id" : "adabe838-601e-00c2-144d-4edc6a000000", + "Body" : "ContainerNotFoundThe specified container does not exist.\nRequestId:adabe838-601e-00c2-144d-4edc6a000000\nTime:2020-06-29T19:45:45.6263562Z", + "Date" : "Mon, 29 Jun 2020 19:45:45 GMT", + "x-ms-client-request-id" : "d7de70ab-4aec-4902-9a48-b6bbdc979bc7", + "Content-Type" : "application/xml" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcreadattributesstrparsing27031942a3041d9cbb4de?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "6155a69f-4533-45b5-84c8-29d6808f47c5" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "ETag" : "0x8D81C65040A8320", + "Last-Modified" : "Mon, 29 Jun 2020 19:45:45 GMT", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "0817200e-501e-0120-174d-4e7e4d000000", + "Date" : "Mon, 29 Jun 2020 19:45:45 GMT", + "x-ms-client-request-id" : "6155a69f-4533-45b5-84c8-29d6808f47c5" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcreadattributesstrparsing1599825bbe9ce55c12422?prefix=javablobreadattributesstrparsing33406094c10292fdc8&delimiter=/&maxresults=2&include=metadata&restype=container&comp=list", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "d1fc373c-52ee-4f33-8d30-59c940bd8e65" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "5dc8087d-201e-012f-174d-4e93bb000000", + "Body" : "javablobreadattributesstrparsing33406094c10292fdc82/", + "Date" : "Mon, 29 Jun 2020 19:45:45 GMT", + "x-ms-client-request-id" : "d1fc373c-52ee-4f33-8d30-59c940bd8e65", + "Content-Type" : "application/xml" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcreadattributesstrparsing1599825bbe9ce55c12422/javablobreadattributesstrparsing33406094c10292fdc8", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "a7376577-1e86-45a6-b37a-0799a48d77e8", + "Content-Type" : "application/octet-stream" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-content-crc64" : "AAAAAAAAAAA=", + "Last-Modified" : "Mon, 29 Jun 2020 19:45:46 GMT", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-server-encrypted" : "true", + "Date" : "Mon, 29 Jun 2020 19:45:45 GMT", + "Content-MD5" : "1B2M2Y8AsgTpgAmY7PhCfg==", + "ETag" : "0x8D81C65043EDB6A", + "Content-Length" : "0", + "x-ms-request-id" : "b860c49d-201e-00c5-3a4d-4e2aef000000", + "x-ms-client-request-id" : "a7376577-1e86-45a6-b37a-0799a48d77e8" + }, + "Exception" : null + }, { + "Method" : "HEAD", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcreadattributesstrparsing1599825bbe9ce55c12422/javablobreadattributesstrparsing33406094c10292fdc8", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "04897224-d8e7-4114-966f-37138727bd5a" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "x-ms-lease-status" : "unlocked", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-lease-state" : "available", + "Last-Modified" : "Mon, 29 Jun 2020 19:45:46 GMT", + "retry-after" : "0", + "StatusCode" : "200", + "Date" : "Mon, 29 Jun 2020 19:45:45 GMT", + "x-ms-blob-type" : "BlockBlob", + "Content-MD5" : "1B2M2Y8AsgTpgAmY7PhCfg==", + "Accept-Ranges" : "bytes", + "x-ms-server-encrypted" : "true", + "x-ms-access-tier-inferred" : "true", + "x-ms-access-tier" : "Hot", + "ETag" : "0x8D81C65043EDB6A", + "x-ms-creation-time" : "Mon, 29 Jun 2020 19:45:46 GMT", + "Content-Length" : "0", + "x-ms-request-id" : "1d82a6f2-101e-00ab-384d-4e83c6000000", + "x-ms-client-request-id" : "04897224-d8e7-4114-966f-37138727bd5a", + "Content-Type" : "application/octet-stream" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.blob.core.windows.net?prefix=jtcreadattributesstrparsing&comp=list", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "236ea21f-4424-493f-830e-dbc184f7cd5b" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "bc3f8b67-b01e-002e-304d-4ed413000000", + "Body" : "jtcreadattributesstrparsingjtcreadattributesstrparsing1599825bbe9ce55c12422Mon, 29 Jun 2020 19:45:45 GMT\"0x8D81C6503D73609\"unlockedavailable$account-encryption-keyfalsefalsefalsejtcreadattributesstrparsing27031942a3041d9cbb4deMon, 29 Jun 2020 19:45:45 GMT\"0x8D81C65040A8320\"unlockedavailable$account-encryption-keyfalsefalsefalse", + "Date" : "Mon, 29 Jun 2020 19:45:46 GMT", + "x-ms-client-request-id" : "236ea21f-4424-493f-830e-dbc184f7cd5b", + "Content-Type" : "application/xml" + }, + "Exception" : null + }, { + "Method" : "DELETE", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcreadattributesstrparsing1599825bbe9ce55c12422?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "bff959c1-a15a-47a3-80d3-a0d1442216ec" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "202", + "x-ms-request-id" : "74b6fd8d-801e-00c8-354d-4ec5e3000000", + "Date" : "Mon, 29 Jun 2020 19:45:46 GMT", + "x-ms-client-request-id" : "bff959c1-a15a-47a3-80d3-a0d1442216ec" + }, + "Exception" : null + }, { + "Method" : "DELETE", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcreadattributesstrparsing27031942a3041d9cbb4de?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "d83d83f0-b82a-45c7-a79f-22720c7d6081" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "202", + "x-ms-request-id" : "0ba9978d-f01e-0126-704d-4e8935000000", + "Date" : "Mon, 29 Jun 2020 19:45:46 GMT", + "x-ms-client-request-id" : "d83d83f0-b82a-45c7-a79f-22720c7d6081" + }, + "Exception" : null + } ], + "variables" : [ "jtcreadattributesstrparsing062721e7ac1272bdaa4af", "jtcreadattributesstrparsing1599825bbe9ce55c12422", "jtcreadattributesstrparsing27031942a3041d9cbb4de", "javablobreadattributesstrparsing33406094c10292fdc8" ] +} \ No newline at end of file diff --git a/sdk/storage/azure-storage-blob-nio/src/test/resources/session-records/AzureFileSystemProviderTestreadattributesstrparsing[1].json b/sdk/storage/azure-storage-blob-nio/src/test/resources/session-records/AzureFileSystemProviderTestreadattributesstrparsing[1].json new file mode 100644 index 0000000000000..d42cd547472da --- /dev/null +++ b/sdk/storage/azure-storage-blob-nio/src/test/resources/session-records/AzureFileSystemProviderTestreadattributesstrparsing[1].json @@ -0,0 +1,226 @@ +{ + "networkCallRecords" : [ { + "Method" : "GET", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcreadattributesstrparsing12464428ddc82da870406?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "71163638-fa80-4f47-bc32-aecdcf3cd6ec" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-error-code" : "ContainerNotFound", + "retry-after" : "0", + "Content-Length" : "225", + "StatusCode" : "404", + "x-ms-request-id" : "dbd2c7c8-301e-0095-804d-4e35e7000000", + "Body" : "ContainerNotFoundThe specified container does not exist.\nRequestId:dbd2c7c8-301e-0095-804d-4e35e7000000\nTime:2020-06-29T19:45:47.0185976Z", + "Date" : "Mon, 29 Jun 2020 19:45:46 GMT", + "x-ms-client-request-id" : "71163638-fa80-4f47-bc32-aecdcf3cd6ec", + "Content-Type" : "application/xml" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcreadattributesstrparsing12464428ddc82da870406?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "f0ce797b-8561-433c-bc13-f45f5facc964" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "ETag" : "0x8D81C6504DA985F", + "Last-Modified" : "Mon, 29 Jun 2020 19:45:47 GMT", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "5202a330-b01e-00cb-604d-4ec6e4000000", + "Date" : "Mon, 29 Jun 2020 19:45:46 GMT", + "x-ms-client-request-id" : "f0ce797b-8561-433c-bc13-f45f5facc964" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcreadattributesstrparsing233861aa64407f7ae747c?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "508a440e-8a25-4a58-9b7a-2104b557fb58" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-error-code" : "ContainerNotFound", + "retry-after" : "0", + "Content-Length" : "225", + "StatusCode" : "404", + "x-ms-request-id" : "10cdb53a-601e-0101-644d-4e137c000000", + "Body" : "ContainerNotFoundThe specified container does not exist.\nRequestId:10cdb53a-601e-0101-644d-4e137c000000\nTime:2020-06-29T19:45:47.3307274Z", + "Date" : "Mon, 29 Jun 2020 19:45:46 GMT", + "x-ms-client-request-id" : "508a440e-8a25-4a58-9b7a-2104b557fb58", + "Content-Type" : "application/xml" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcreadattributesstrparsing233861aa64407f7ae747c?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "f1176cb0-8302-4d58-963b-7fadd29f29ed" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "ETag" : "0x8D81C65050AB4CF", + "Last-Modified" : "Mon, 29 Jun 2020 19:45:47 GMT", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "718c3cc4-301e-0070-5a4d-4e2710000000", + "Date" : "Mon, 29 Jun 2020 19:45:47 GMT", + "x-ms-client-request-id" : "f1176cb0-8302-4d58-963b-7fadd29f29ed" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcreadattributesstrparsing12464428ddc82da870406?prefix=javablobreadattributesstrparsing3896495c7f0942432d&delimiter=/&maxresults=2&include=metadata&restype=container&comp=list", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "549fc9ae-255e-45eb-b402-92ee430941ed" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "9fd291ac-701e-0092-124d-4ec362000000", + "Body" : "javablobreadattributesstrparsing3896495c7f0942432d2/", + "Date" : "Mon, 29 Jun 2020 19:45:46 GMT", + "x-ms-client-request-id" : "549fc9ae-255e-45eb-b402-92ee430941ed", + "Content-Type" : "application/xml" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcreadattributesstrparsing12464428ddc82da870406/javablobreadattributesstrparsing3896495c7f0942432d", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "e7616fe0-c5e3-41ea-93e7-23c7357126bf", + "Content-Type" : "application/octet-stream" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-content-crc64" : "AAAAAAAAAAA=", + "Last-Modified" : "Mon, 29 Jun 2020 19:45:47 GMT", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-server-encrypted" : "true", + "Date" : "Mon, 29 Jun 2020 19:45:47 GMT", + "Content-MD5" : "1B2M2Y8AsgTpgAmY7PhCfg==", + "ETag" : "0x8D81C65053D40FB", + "Content-Length" : "0", + "x-ms-request-id" : "905de893-001e-0051-2e4d-4e4a21000000", + "x-ms-client-request-id" : "e7616fe0-c5e3-41ea-93e7-23c7357126bf" + }, + "Exception" : null + }, { + "Method" : "HEAD", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcreadattributesstrparsing12464428ddc82da870406/javablobreadattributesstrparsing3896495c7f0942432d", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "0077dc19-3eba-4b35-91d1-276049803745" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "x-ms-lease-status" : "unlocked", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-lease-state" : "available", + "Last-Modified" : "Mon, 29 Jun 2020 19:45:47 GMT", + "retry-after" : "0", + "StatusCode" : "200", + "Date" : "Mon, 29 Jun 2020 19:45:47 GMT", + "x-ms-blob-type" : "BlockBlob", + "Content-MD5" : "1B2M2Y8AsgTpgAmY7PhCfg==", + "Accept-Ranges" : "bytes", + "x-ms-server-encrypted" : "true", + "x-ms-access-tier-inferred" : "true", + "x-ms-access-tier" : "Hot", + "ETag" : "0x8D81C65053D40FB", + "x-ms-creation-time" : "Mon, 29 Jun 2020 19:45:47 GMT", + "Content-Length" : "0", + "x-ms-request-id" : "e3fff69b-601e-00eb-3a4d-4eaa28000000", + "x-ms-client-request-id" : "0077dc19-3eba-4b35-91d1-276049803745", + "Content-Type" : "application/octet-stream" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.blob.core.windows.net?prefix=jtcreadattributesstrparsing&comp=list", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "429c45bd-702a-4dc7-ae18-880aa8b63584" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "9ef2eb5d-f01e-006d-124d-4efefa000000", + "Body" : "jtcreadattributesstrparsingjtcreadattributesstrparsing12464428ddc82da870406Mon, 29 Jun 2020 19:45:47 GMT\"0x8D81C6504DA985F\"unlockedavailable$account-encryption-keyfalsefalsefalsejtcreadattributesstrparsing233861aa64407f7ae747cMon, 29 Jun 2020 19:45:47 GMT\"0x8D81C65050AB4CF\"unlockedavailable$account-encryption-keyfalsefalsefalse", + "Date" : "Mon, 29 Jun 2020 19:45:47 GMT", + "x-ms-client-request-id" : "429c45bd-702a-4dc7-ae18-880aa8b63584", + "Content-Type" : "application/xml" + }, + "Exception" : null + }, { + "Method" : "DELETE", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcreadattributesstrparsing12464428ddc82da870406?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "d9eb347c-2560-4d10-b4d8-37d73669b989" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "202", + "x-ms-request-id" : "54ab23b1-601e-0068-624d-4e0a85000000", + "Date" : "Mon, 29 Jun 2020 19:45:48 GMT", + "x-ms-client-request-id" : "d9eb347c-2560-4d10-b4d8-37d73669b989" + }, + "Exception" : null + }, { + "Method" : "DELETE", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcreadattributesstrparsing233861aa64407f7ae747c?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "4bf2327b-21cd-47c5-80a6-f98738c55c95" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "202", + "x-ms-request-id" : "830b098b-401e-0116-7d4d-4ed31f000000", + "Date" : "Mon, 29 Jun 2020 19:45:47 GMT", + "x-ms-client-request-id" : "4bf2327b-21cd-47c5-80a6-f98738c55c95" + }, + "Exception" : null + } ], + "variables" : [ "jtcreadattributesstrparsing038408dffeb0759784405", "jtcreadattributesstrparsing12464428ddc82da870406", "jtcreadattributesstrparsing233861aa64407f7ae747c", "javablobreadattributesstrparsing3896495c7f0942432d" ] +} \ No newline at end of file diff --git a/sdk/storage/azure-storage-blob-nio/src/test/resources/session-records/AzureFileSystemProviderTestreadattributesstrparsing[2].json b/sdk/storage/azure-storage-blob-nio/src/test/resources/session-records/AzureFileSystemProviderTestreadattributesstrparsing[2].json new file mode 100644 index 0000000000000..50d4ef598a515 --- /dev/null +++ b/sdk/storage/azure-storage-blob-nio/src/test/resources/session-records/AzureFileSystemProviderTestreadattributesstrparsing[2].json @@ -0,0 +1,226 @@ +{ + "networkCallRecords" : [ { + "Method" : "GET", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcreadattributesstrparsing149586db092918bda1457?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "b7f73e74-e66f-4fa6-a14d-a09bb0692966" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-error-code" : "ContainerNotFound", + "retry-after" : "0", + "Content-Length" : "225", + "StatusCode" : "404", + "x-ms-request-id" : "cb00cba2-401e-005d-3a4d-4ea4d0000000", + "Body" : "ContainerNotFoundThe specified container does not exist.\nRequestId:cb00cba2-401e-005d-3a4d-4ea4d0000000\nTime:2020-06-29T19:45:48.7324680Z", + "Date" : "Mon, 29 Jun 2020 19:45:48 GMT", + "x-ms-client-request-id" : "b7f73e74-e66f-4fa6-a14d-a09bb0692966", + "Content-Type" : "application/xml" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcreadattributesstrparsing149586db092918bda1457?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "d80e825a-3878-47c9-86ec-28d8d599dcf0" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "ETag" : "0x8D81C6505E19B5A", + "Last-Modified" : "Mon, 29 Jun 2020 19:45:48 GMT", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "2e3c772f-901e-0093-0a4d-4ec29f000000", + "Date" : "Mon, 29 Jun 2020 19:45:48 GMT", + "x-ms-client-request-id" : "d80e825a-3878-47c9-86ec-28d8d599dcf0" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcreadattributesstrparsing216357e08fe9ef94344a6?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "50c69155-760b-4cdc-8b24-fcb8b4940a73" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-error-code" : "ContainerNotFound", + "retry-after" : "0", + "Content-Length" : "225", + "StatusCode" : "404", + "x-ms-request-id" : "d74355b3-101e-0105-3f4d-4ee6fe000000", + "Body" : "ContainerNotFoundThe specified container does not exist.\nRequestId:d74355b3-101e-0105-3f4d-4ee6fe000000\nTime:2020-06-29T19:45:49.0434646Z", + "Date" : "Mon, 29 Jun 2020 19:45:48 GMT", + "x-ms-client-request-id" : "50c69155-760b-4cdc-8b24-fcb8b4940a73", + "Content-Type" : "application/xml" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcreadattributesstrparsing216357e08fe9ef94344a6?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "00f7e147-9409-47ba-b104-9d7551a6c2c9" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "ETag" : "0x8D81C650610CA15", + "Last-Modified" : "Mon, 29 Jun 2020 19:45:49 GMT", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "22053958-601e-0128-5a4d-4e653e000000", + "Date" : "Mon, 29 Jun 2020 19:45:48 GMT", + "x-ms-client-request-id" : "00f7e147-9409-47ba-b104-9d7551a6c2c9" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcreadattributesstrparsing149586db092918bda1457?prefix=javablobreadattributesstrparsing332083e51890468dfb&delimiter=/&maxresults=2&include=metadata&restype=container&comp=list", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "001ca767-23d3-4f97-b618-b26adcde88c3" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "8a1f0469-901e-0032-264d-4e0c04000000", + "Body" : "javablobreadattributesstrparsing332083e51890468dfb2/", + "Date" : "Mon, 29 Jun 2020 19:45:48 GMT", + "x-ms-client-request-id" : "001ca767-23d3-4f97-b618-b26adcde88c3", + "Content-Type" : "application/xml" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcreadattributesstrparsing149586db092918bda1457/javablobreadattributesstrparsing332083e51890468dfb", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "b63a2aee-1270-45fa-9368-aaa2c6726a80", + "Content-Type" : "application/octet-stream" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-content-crc64" : "AAAAAAAAAAA=", + "Last-Modified" : "Mon, 29 Jun 2020 19:45:49 GMT", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-server-encrypted" : "true", + "Date" : "Mon, 29 Jun 2020 19:45:48 GMT", + "Content-MD5" : "1B2M2Y8AsgTpgAmY7PhCfg==", + "ETag" : "0x8D81C650641C1E6", + "Content-Length" : "0", + "x-ms-request-id" : "b3f5007e-b01e-0108-7f4d-4e09f2000000", + "x-ms-client-request-id" : "b63a2aee-1270-45fa-9368-aaa2c6726a80" + }, + "Exception" : null + }, { + "Method" : "HEAD", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcreadattributesstrparsing149586db092918bda1457/javablobreadattributesstrparsing332083e51890468dfb", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "5e0f67dc-df73-4e44-b9e3-c542700f4160" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "x-ms-lease-status" : "unlocked", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-lease-state" : "available", + "Last-Modified" : "Mon, 29 Jun 2020 19:45:49 GMT", + "retry-after" : "0", + "StatusCode" : "200", + "Date" : "Mon, 29 Jun 2020 19:45:49 GMT", + "x-ms-blob-type" : "BlockBlob", + "Content-MD5" : "1B2M2Y8AsgTpgAmY7PhCfg==", + "Accept-Ranges" : "bytes", + "x-ms-server-encrypted" : "true", + "x-ms-access-tier-inferred" : "true", + "x-ms-access-tier" : "Hot", + "ETag" : "0x8D81C650641C1E6", + "x-ms-creation-time" : "Mon, 29 Jun 2020 19:45:49 GMT", + "Content-Length" : "0", + "x-ms-request-id" : "12592d92-b01e-0103-714d-4e1186000000", + "x-ms-client-request-id" : "5e0f67dc-df73-4e44-b9e3-c542700f4160", + "Content-Type" : "application/octet-stream" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.blob.core.windows.net?prefix=jtcreadattributesstrparsing&comp=list", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "7fa27b2f-c4c6-4a76-9e86-bb035140462a" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "e8a4b06c-a01e-00fd-2e4d-4e6bb6000000", + "Body" : "jtcreadattributesstrparsingjtcreadattributesstrparsing149586db092918bda1457Mon, 29 Jun 2020 19:45:48 GMT\"0x8D81C6505E19B5A\"unlockedavailable$account-encryption-keyfalsefalsefalsejtcreadattributesstrparsing216357e08fe9ef94344a6Mon, 29 Jun 2020 19:45:49 GMT\"0x8D81C650610CA15\"unlockedavailable$account-encryption-keyfalsefalsefalse", + "Date" : "Mon, 29 Jun 2020 19:45:49 GMT", + "x-ms-client-request-id" : "7fa27b2f-c4c6-4a76-9e86-bb035140462a", + "Content-Type" : "application/xml" + }, + "Exception" : null + }, { + "Method" : "DELETE", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcreadattributesstrparsing149586db092918bda1457?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "3a0f2524-0ecf-4fe0-8ddb-3cef2651e295" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "202", + "x-ms-request-id" : "fa8da8fe-401e-00f7-604d-4e723f000000", + "Date" : "Mon, 29 Jun 2020 19:45:49 GMT", + "x-ms-client-request-id" : "3a0f2524-0ecf-4fe0-8ddb-3cef2651e295" + }, + "Exception" : null + }, { + "Method" : "DELETE", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcreadattributesstrparsing216357e08fe9ef94344a6?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "4deccebd-a849-4a74-abb7-4b796fcf642c" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "202", + "x-ms-request-id" : "71c3463f-d01e-003e-544d-4ee2f5000000", + "Date" : "Mon, 29 Jun 2020 19:45:49 GMT", + "x-ms-client-request-id" : "4deccebd-a849-4a74-abb7-4b796fcf642c" + }, + "Exception" : null + } ], + "variables" : [ "jtcreadattributesstrparsing0923923f1cdcf6c932468", "jtcreadattributesstrparsing149586db092918bda1457", "jtcreadattributesstrparsing216357e08fe9ef94344a6", "javablobreadattributesstrparsing332083e51890468dfb" ] +} \ No newline at end of file diff --git a/sdk/storage/azure-storage-blob-nio/src/test/resources/session-records/AzureFileSystemProviderTestreadattributesstrparsing[3].json b/sdk/storage/azure-storage-blob-nio/src/test/resources/session-records/AzureFileSystemProviderTestreadattributesstrparsing[3].json new file mode 100644 index 0000000000000..25bf6b08262ab --- /dev/null +++ b/sdk/storage/azure-storage-blob-nio/src/test/resources/session-records/AzureFileSystemProviderTestreadattributesstrparsing[3].json @@ -0,0 +1,226 @@ +{ + "networkCallRecords" : [ { + "Method" : "GET", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcreadattributesstrparsing16675405bf0ecd64a8495?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "103f0e52-6ce5-4c68-97a9-982cbac0a434" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-error-code" : "ContainerNotFound", + "retry-after" : "0", + "Content-Length" : "225", + "StatusCode" : "404", + "x-ms-request-id" : "6d6fd6d3-e01e-00d8-204d-4ef305000000", + "Body" : "ContainerNotFoundThe specified container does not exist.\nRequestId:6d6fd6d3-e01e-00d8-204d-4ef305000000\nTime:2020-06-29T19:45:50.3425003Z", + "Date" : "Mon, 29 Jun 2020 19:45:50 GMT", + "x-ms-client-request-id" : "103f0e52-6ce5-4c68-97a9-982cbac0a434", + "Content-Type" : "application/xml" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcreadattributesstrparsing16675405bf0ecd64a8495?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "ab449581-7934-4046-a0a6-3c7afdc602b0" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "ETag" : "0x8D81C6506D6D266", + "Last-Modified" : "Mon, 29 Jun 2020 19:45:50 GMT", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "69847465-201e-006f-0d4d-4efc00000000", + "Date" : "Mon, 29 Jun 2020 19:45:49 GMT", + "x-ms-client-request-id" : "ab449581-7934-4046-a0a6-3c7afdc602b0" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcreadattributesstrparsing271835abf5db0fba0946f?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "d126d336-fe24-4847-8f67-178cb9281145" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-error-code" : "ContainerNotFound", + "retry-after" : "0", + "Content-Length" : "225", + "StatusCode" : "404", + "x-ms-request-id" : "974b69e9-601e-0005-4e4d-4ea0ab000000", + "Body" : "ContainerNotFoundThe specified container does not exist.\nRequestId:974b69e9-601e-0005-4e4d-4ea0ab000000\nTime:2020-06-29T19:45:50.6575389Z", + "Date" : "Mon, 29 Jun 2020 19:45:50 GMT", + "x-ms-client-request-id" : "d126d336-fe24-4847-8f67-178cb9281145", + "Content-Type" : "application/xml" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcreadattributesstrparsing271835abf5db0fba0946f?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "686c76f3-5c2f-48c9-a557-0aa54fb0097b" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "ETag" : "0x8D81C650708F641", + "Last-Modified" : "Mon, 29 Jun 2020 19:45:50 GMT", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "4694580c-401e-00b3-494d-4eae53000000", + "Date" : "Mon, 29 Jun 2020 19:45:50 GMT", + "x-ms-client-request-id" : "686c76f3-5c2f-48c9-a557-0aa54fb0097b" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcreadattributesstrparsing16675405bf0ecd64a8495?prefix=javablobreadattributesstrparsing328094f63c91872f06&delimiter=/&maxresults=2&include=metadata&restype=container&comp=list", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "fc657eef-db05-4751-9ca5-b8d0f6606b80" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "04e8dbeb-901e-00fe-214d-4e68b1000000", + "Body" : "javablobreadattributesstrparsing328094f63c91872f062/", + "Date" : "Mon, 29 Jun 2020 19:45:50 GMT", + "x-ms-client-request-id" : "fc657eef-db05-4751-9ca5-b8d0f6606b80", + "Content-Type" : "application/xml" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcreadattributesstrparsing16675405bf0ecd64a8495/javablobreadattributesstrparsing328094f63c91872f06", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "92a6af7d-f6ca-4964-aeee-67e847795442", + "Content-Type" : "application/octet-stream" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-content-crc64" : "AAAAAAAAAAA=", + "Last-Modified" : "Mon, 29 Jun 2020 19:45:51 GMT", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-server-encrypted" : "true", + "Date" : "Mon, 29 Jun 2020 19:45:51 GMT", + "Content-MD5" : "1B2M2Y8AsgTpgAmY7PhCfg==", + "ETag" : "0x8D81C65073B6B5D", + "Content-Length" : "0", + "x-ms-request-id" : "05b4ff47-d01e-0094-764d-4e341a000000", + "x-ms-client-request-id" : "92a6af7d-f6ca-4964-aeee-67e847795442" + }, + "Exception" : null + }, { + "Method" : "HEAD", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcreadattributesstrparsing16675405bf0ecd64a8495/javablobreadattributesstrparsing328094f63c91872f06", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "3eaf57c3-0072-4dfa-96a2-5663f397729a" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "x-ms-lease-status" : "unlocked", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-lease-state" : "available", + "Last-Modified" : "Mon, 29 Jun 2020 19:45:51 GMT", + "retry-after" : "0", + "StatusCode" : "200", + "Date" : "Mon, 29 Jun 2020 19:45:50 GMT", + "x-ms-blob-type" : "BlockBlob", + "Content-MD5" : "1B2M2Y8AsgTpgAmY7PhCfg==", + "Accept-Ranges" : "bytes", + "x-ms-server-encrypted" : "true", + "x-ms-access-tier-inferred" : "true", + "x-ms-access-tier" : "Hot", + "ETag" : "0x8D81C65073B6B5D", + "x-ms-creation-time" : "Mon, 29 Jun 2020 19:45:51 GMT", + "Content-Length" : "0", + "x-ms-request-id" : "8b6336ff-d01e-00b6-264d-4e5a2c000000", + "x-ms-client-request-id" : "3eaf57c3-0072-4dfa-96a2-5663f397729a", + "Content-Type" : "application/octet-stream" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.blob.core.windows.net?prefix=jtcreadattributesstrparsing&comp=list", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "bc0d52c4-4b57-476f-b311-2028ef228781" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "16f4023c-701e-0011-204d-4e63cf000000", + "Body" : "jtcreadattributesstrparsingjtcreadattributesstrparsing16675405bf0ecd64a8495Mon, 29 Jun 2020 19:45:50 GMT\"0x8D81C6506D6D266\"unlockedavailable$account-encryption-keyfalsefalsefalsejtcreadattributesstrparsing271835abf5db0fba0946fMon, 29 Jun 2020 19:45:50 GMT\"0x8D81C650708F641\"unlockedavailable$account-encryption-keyfalsefalsefalse", + "Date" : "Mon, 29 Jun 2020 19:45:50 GMT", + "x-ms-client-request-id" : "bc0d52c4-4b57-476f-b311-2028ef228781", + "Content-Type" : "application/xml" + }, + "Exception" : null + }, { + "Method" : "DELETE", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcreadattributesstrparsing16675405bf0ecd64a8495?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "859de538-e342-4625-817c-8b300fccffc7" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "202", + "x-ms-request-id" : "2b6340ae-001e-00bf-724d-4e40a2000000", + "Date" : "Mon, 29 Jun 2020 19:45:51 GMT", + "x-ms-client-request-id" : "859de538-e342-4625-817c-8b300fccffc7" + }, + "Exception" : null + }, { + "Method" : "DELETE", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcreadattributesstrparsing271835abf5db0fba0946f?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "802b3a6a-961f-4ad8-a181-d4385b479be6" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "202", + "x-ms-request-id" : "82f8538f-601e-010a-3c4d-4e0b08000000", + "Date" : "Mon, 29 Jun 2020 19:45:51 GMT", + "x-ms-client-request-id" : "802b3a6a-961f-4ad8-a181-d4385b479be6" + }, + "Exception" : null + } ], + "variables" : [ "jtcreadattributesstrparsing050764d51d97fda8a341c", "jtcreadattributesstrparsing16675405bf0ecd64a8495", "jtcreadattributesstrparsing271835abf5db0fba0946f", "javablobreadattributesstrparsing328094f63c91872f06" ] +} \ No newline at end of file diff --git a/sdk/storage/azure-storage-blob-nio/src/test/resources/session-records/AzureFileSystemProviderTestreadattributesstrparsing[4].json b/sdk/storage/azure-storage-blob-nio/src/test/resources/session-records/AzureFileSystemProviderTestreadattributesstrparsing[4].json new file mode 100644 index 0000000000000..f7d3032b7312c --- /dev/null +++ b/sdk/storage/azure-storage-blob-nio/src/test/resources/session-records/AzureFileSystemProviderTestreadattributesstrparsing[4].json @@ -0,0 +1,226 @@ +{ + "networkCallRecords" : [ { + "Method" : "GET", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcreadattributesstrparsing133804b1153ac902fe497?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "9d2d009e-1d74-4a78-ab85-8763248bd995" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-error-code" : "ContainerNotFound", + "retry-after" : "0", + "Content-Length" : "225", + "StatusCode" : "404", + "x-ms-request-id" : "87607b05-201e-0064-384d-4ee474000000", + "Body" : "ContainerNotFoundThe specified container does not exist.\nRequestId:87607b05-201e-0064-384d-4ee474000000\nTime:2020-06-29T19:45:51.9802102Z", + "Date" : "Mon, 29 Jun 2020 19:45:51 GMT", + "x-ms-client-request-id" : "9d2d009e-1d74-4a78-ab85-8763248bd995", + "Content-Type" : "application/xml" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcreadattributesstrparsing133804b1153ac902fe497?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "984e2026-6813-4912-84b3-8a606720849c" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "ETag" : "0x8D81C6507D0DE51", + "Last-Modified" : "Mon, 29 Jun 2020 19:45:52 GMT", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "c7b7bc3f-801e-00ae-444d-4e77b9000000", + "Date" : "Mon, 29 Jun 2020 19:45:51 GMT", + "x-ms-client-request-id" : "984e2026-6813-4912-84b3-8a606720849c" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcreadattributesstrparsing2977318cb3e7517e3947e?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "8b20b8e3-e269-4afa-af17-617d7b409f98" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-error-code" : "ContainerNotFound", + "retry-after" : "0", + "Content-Length" : "225", + "StatusCode" : "404", + "x-ms-request-id" : "7b3e54ef-301e-00d1-7d4d-4ee98b000000", + "Body" : "ContainerNotFoundThe specified container does not exist.\nRequestId:7b3e54ef-301e-00d1-7d4d-4ee98b000000\nTime:2020-06-29T19:45:52.3588220Z", + "Date" : "Mon, 29 Jun 2020 19:45:51 GMT", + "x-ms-client-request-id" : "8b20b8e3-e269-4afa-af17-617d7b409f98", + "Content-Type" : "application/xml" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcreadattributesstrparsing2977318cb3e7517e3947e?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "a848b8d3-0227-42e3-b453-4223d4aa2cac" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "ETag" : "0x8D81C65080B1250", + "Last-Modified" : "Mon, 29 Jun 2020 19:45:52 GMT", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "b27fa243-d01e-0053-6a4d-4e48db000000", + "Date" : "Mon, 29 Jun 2020 19:45:52 GMT", + "x-ms-client-request-id" : "a848b8d3-0227-42e3-b453-4223d4aa2cac" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcreadattributesstrparsing133804b1153ac902fe497?prefix=javablobreadattributesstrparsing3959986138e04c5c8e&delimiter=/&maxresults=2&include=metadata&restype=container&comp=list", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "3f61f556-56d0-4729-9dc8-fadc48a70518" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "7e5a4ea8-001e-00d9-0e4d-4ef2f8000000", + "Body" : "javablobreadattributesstrparsing3959986138e04c5c8e2/", + "Date" : "Mon, 29 Jun 2020 19:45:52 GMT", + "x-ms-client-request-id" : "3f61f556-56d0-4729-9dc8-fadc48a70518", + "Content-Type" : "application/xml" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcreadattributesstrparsing133804b1153ac902fe497/javablobreadattributesstrparsing3959986138e04c5c8e", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "9bf3f342-37af-4ea9-a6b0-8f55a4dffb26", + "Content-Type" : "application/octet-stream" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-content-crc64" : "AAAAAAAAAAA=", + "Last-Modified" : "Mon, 29 Jun 2020 19:45:52 GMT", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-server-encrypted" : "true", + "Date" : "Mon, 29 Jun 2020 19:45:52 GMT", + "Content-MD5" : "1B2M2Y8AsgTpgAmY7PhCfg==", + "ETag" : "0x8D81C65084A008F", + "Content-Length" : "0", + "x-ms-request-id" : "daf113d0-901e-0098-564d-4edaeb000000", + "x-ms-client-request-id" : "9bf3f342-37af-4ea9-a6b0-8f55a4dffb26" + }, + "Exception" : null + }, { + "Method" : "HEAD", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcreadattributesstrparsing133804b1153ac902fe497/javablobreadattributesstrparsing3959986138e04c5c8e", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "9b37ac53-b760-41af-a20b-1533eb9dabfd" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "x-ms-lease-status" : "unlocked", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-lease-state" : "available", + "Last-Modified" : "Mon, 29 Jun 2020 19:45:52 GMT", + "retry-after" : "0", + "StatusCode" : "200", + "Date" : "Mon, 29 Jun 2020 19:45:52 GMT", + "x-ms-blob-type" : "BlockBlob", + "Content-MD5" : "1B2M2Y8AsgTpgAmY7PhCfg==", + "Accept-Ranges" : "bytes", + "x-ms-server-encrypted" : "true", + "x-ms-access-tier-inferred" : "true", + "x-ms-access-tier" : "Hot", + "ETag" : "0x8D81C65084A008F", + "x-ms-creation-time" : "Mon, 29 Jun 2020 19:45:52 GMT", + "Content-Length" : "0", + "x-ms-request-id" : "af998795-501e-0006-3b4d-4ea3ac000000", + "x-ms-client-request-id" : "9b37ac53-b760-41af-a20b-1533eb9dabfd", + "Content-Type" : "application/octet-stream" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.blob.core.windows.net?prefix=jtcreadattributesstrparsing&comp=list", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "761c8cd2-3ce9-4dff-869c-a0a8b3cacbe7" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "c7a64da0-101e-0001-354d-4e5529000000", + "Body" : "jtcreadattributesstrparsingjtcreadattributesstrparsing133804b1153ac902fe497Mon, 29 Jun 2020 19:45:52 GMT\"0x8D81C6507D0DE51\"unlockedavailable$account-encryption-keyfalsefalsefalsejtcreadattributesstrparsing2977318cb3e7517e3947eMon, 29 Jun 2020 19:45:52 GMT\"0x8D81C65080B1250\"unlockedavailable$account-encryption-keyfalsefalsefalse", + "Date" : "Mon, 29 Jun 2020 19:45:53 GMT", + "x-ms-client-request-id" : "761c8cd2-3ce9-4dff-869c-a0a8b3cacbe7", + "Content-Type" : "application/xml" + }, + "Exception" : null + }, { + "Method" : "DELETE", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcreadattributesstrparsing133804b1153ac902fe497?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "5333482d-bf9d-4aaa-918e-177c7d5685bd" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "202", + "x-ms-request-id" : "4aaa45e5-901e-00d7-654d-4e1ef3000000", + "Date" : "Mon, 29 Jun 2020 19:45:52 GMT", + "x-ms-client-request-id" : "5333482d-bf9d-4aaa-918e-177c7d5685bd" + }, + "Exception" : null + }, { + "Method" : "DELETE", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcreadattributesstrparsing2977318cb3e7517e3947e?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "bcaea292-6ecd-468a-b2b6-0f5e3f4f348a" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "202", + "x-ms-request-id" : "2b083647-201e-0009-594d-4e4e5a000000", + "Date" : "Mon, 29 Jun 2020 19:45:53 GMT", + "x-ms-client-request-id" : "bcaea292-6ecd-468a-b2b6-0f5e3f4f348a" + }, + "Exception" : null + } ], + "variables" : [ "jtcreadattributesstrparsing058758baa3f357c4c14ef", "jtcreadattributesstrparsing133804b1153ac902fe497", "jtcreadattributesstrparsing2977318cb3e7517e3947e", "javablobreadattributesstrparsing3959986138e04c5c8e" ] +} \ No newline at end of file diff --git a/sdk/storage/azure-storage-blob-nio/src/test/resources/session-records/AzureFileSystemProviderTestreadattributesstrparsing[5].json b/sdk/storage/azure-storage-blob-nio/src/test/resources/session-records/AzureFileSystemProviderTestreadattributesstrparsing[5].json new file mode 100644 index 0000000000000..13aad4e17f735 --- /dev/null +++ b/sdk/storage/azure-storage-blob-nio/src/test/resources/session-records/AzureFileSystemProviderTestreadattributesstrparsing[5].json @@ -0,0 +1,226 @@ +{ + "networkCallRecords" : [ { + "Method" : "GET", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcreadattributesstrparsing1200198131a07776d5409?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "d3167a15-9bdd-43dd-98fc-04b091eabcc2" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-error-code" : "ContainerNotFound", + "retry-after" : "0", + "Content-Length" : "225", + "StatusCode" : "404", + "x-ms-request-id" : "7fce459b-601e-00a4-454d-4e6e30000000", + "Body" : "ContainerNotFoundThe specified container does not exist.\nRequestId:7fce459b-601e-00a4-454d-4e6e30000000\nTime:2020-06-29T19:45:54.8036995Z", + "Date" : "Mon, 29 Jun 2020 19:45:54 GMT", + "x-ms-client-request-id" : "d3167a15-9bdd-43dd-98fc-04b091eabcc2", + "Content-Type" : "application/xml" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcreadattributesstrparsing1200198131a07776d5409?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "6af93c08-8eb9-4be5-ac6b-0f2ad6a7b759" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "ETag" : "0x8D81C65097F4F2F", + "Last-Modified" : "Mon, 29 Jun 2020 19:45:54 GMT", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "f0c66984-a01e-013e-7e4d-4ea4a0000000", + "Date" : "Mon, 29 Jun 2020 19:45:54 GMT", + "x-ms-client-request-id" : "6af93c08-8eb9-4be5-ac6b-0f2ad6a7b759" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcreadattributesstrparsing2929762b48d08a9359439?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "79e2f1e1-8d63-4c28-bc01-2d13590bc88c" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-error-code" : "ContainerNotFound", + "retry-after" : "0", + "Content-Length" : "225", + "StatusCode" : "404", + "x-ms-request-id" : "890c4593-e01e-0110-634d-4e2467000000", + "Body" : "ContainerNotFoundThe specified container does not exist.\nRequestId:890c4593-e01e-0110-634d-4e2467000000\nTime:2020-06-29T19:45:55.1348170Z", + "Date" : "Mon, 29 Jun 2020 19:45:54 GMT", + "x-ms-client-request-id" : "79e2f1e1-8d63-4c28-bc01-2d13590bc88c", + "Content-Type" : "application/xml" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcreadattributesstrparsing2929762b48d08a9359439?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "abd73142-a669-4ba4-b8a9-38cb43a1cfd8" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "ETag" : "0x8D81C6509B24373", + "Last-Modified" : "Mon, 29 Jun 2020 19:45:55 GMT", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "c3bba817-501e-00a7-1f4d-4e6d37000000", + "Date" : "Mon, 29 Jun 2020 19:45:54 GMT", + "x-ms-client-request-id" : "abd73142-a669-4ba4-b8a9-38cb43a1cfd8" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcreadattributesstrparsing1200198131a07776d5409?prefix=javablobreadattributesstrparsing371954c0faa80697ab&delimiter=/&maxresults=2&include=metadata&restype=container&comp=list", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "50c9a484-c686-4a81-85c4-cbb76296d9ca" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "4b2434ef-f01e-00a1-354d-4e9a4f000000", + "Body" : "javablobreadattributesstrparsing371954c0faa80697ab2/", + "Date" : "Mon, 29 Jun 2020 19:45:55 GMT", + "x-ms-client-request-id" : "50c9a484-c686-4a81-85c4-cbb76296d9ca", + "Content-Type" : "application/xml" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcreadattributesstrparsing1200198131a07776d5409/javablobreadattributesstrparsing371954c0faa80697ab", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "7e42ee5e-264c-46b2-9372-ae2aa6f2cc0a", + "Content-Type" : "application/octet-stream" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-content-crc64" : "AAAAAAAAAAA=", + "Last-Modified" : "Mon, 29 Jun 2020 19:45:55 GMT", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-server-encrypted" : "true", + "Date" : "Mon, 29 Jun 2020 19:45:54 GMT", + "Content-MD5" : "1B2M2Y8AsgTpgAmY7PhCfg==", + "ETag" : "0x8D81C6509E7345D", + "Content-Length" : "0", + "x-ms-request-id" : "2a49b2a8-d01e-0113-5e4d-4e2760000000", + "x-ms-client-request-id" : "7e42ee5e-264c-46b2-9372-ae2aa6f2cc0a" + }, + "Exception" : null + }, { + "Method" : "HEAD", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcreadattributesstrparsing1200198131a07776d5409/javablobreadattributesstrparsing371954c0faa80697ab", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "d4cc3c4f-8574-438d-9248-291358c03f3c" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "x-ms-lease-status" : "unlocked", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-lease-state" : "available", + "Last-Modified" : "Mon, 29 Jun 2020 19:45:55 GMT", + "retry-after" : "0", + "StatusCode" : "200", + "Date" : "Mon, 29 Jun 2020 19:45:55 GMT", + "x-ms-blob-type" : "BlockBlob", + "Content-MD5" : "1B2M2Y8AsgTpgAmY7PhCfg==", + "Accept-Ranges" : "bytes", + "x-ms-server-encrypted" : "true", + "x-ms-access-tier-inferred" : "true", + "x-ms-access-tier" : "Hot", + "ETag" : "0x8D81C6509E7345D", + "x-ms-creation-time" : "Mon, 29 Jun 2020 19:45:55 GMT", + "Content-Length" : "0", + "x-ms-request-id" : "95056e1d-001e-005a-434d-4e5255000000", + "x-ms-client-request-id" : "d4cc3c4f-8574-438d-9248-291358c03f3c", + "Content-Type" : "application/octet-stream" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.blob.core.windows.net?prefix=jtcreadattributesstrparsing&comp=list", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "0ac05e59-b79d-4887-9865-2be9f0c4a220" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "aab876e1-301e-0130-694d-4e48ab000000", + "Body" : "jtcreadattributesstrparsingjtcreadattributesstrparsing1200198131a07776d5409Mon, 29 Jun 2020 19:45:54 GMT\"0x8D81C65097F4F2F\"unlockedavailable$account-encryption-keyfalsefalsefalsejtcreadattributesstrparsing2929762b48d08a9359439Mon, 29 Jun 2020 19:45:55 GMT\"0x8D81C6509B24373\"unlockedavailable$account-encryption-keyfalsefalsefalse", + "Date" : "Mon, 29 Jun 2020 19:45:55 GMT", + "x-ms-client-request-id" : "0ac05e59-b79d-4887-9865-2be9f0c4a220", + "Content-Type" : "application/xml" + }, + "Exception" : null + }, { + "Method" : "DELETE", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcreadattributesstrparsing1200198131a07776d5409?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "688faff2-c113-45fd-b1e0-5f7a0208e368" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "202", + "x-ms-request-id" : "996bd7ea-601e-0027-1c4d-4ece9d000000", + "Date" : "Mon, 29 Jun 2020 19:45:55 GMT", + "x-ms-client-request-id" : "688faff2-c113-45fd-b1e0-5f7a0208e368" + }, + "Exception" : null + }, { + "Method" : "DELETE", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcreadattributesstrparsing2929762b48d08a9359439?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "637dc294-5dbe-47ea-a113-bf3eb77d5e6d" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "202", + "x-ms-request-id" : "d027a5fa-001e-0111-574d-4e259a000000", + "Date" : "Mon, 29 Jun 2020 19:45:55 GMT", + "x-ms-client-request-id" : "637dc294-5dbe-47ea-a113-bf3eb77d5e6d" + }, + "Exception" : null + } ], + "variables" : [ "jtcreadattributesstrparsing0228370c759517a46e439", "jtcreadattributesstrparsing1200198131a07776d5409", "jtcreadattributesstrparsing2929762b48d08a9359439", "javablobreadattributesstrparsing371954c0faa80697ab" ] +} \ No newline at end of file diff --git a/sdk/storage/azure-storage-blob-nio/src/test/resources/session-records/AzureFileSystemProviderTestreadattributesstrparsing[6].json b/sdk/storage/azure-storage-blob-nio/src/test/resources/session-records/AzureFileSystemProviderTestreadattributesstrparsing[6].json new file mode 100644 index 0000000000000..299986d739068 --- /dev/null +++ b/sdk/storage/azure-storage-blob-nio/src/test/resources/session-records/AzureFileSystemProviderTestreadattributesstrparsing[6].json @@ -0,0 +1,226 @@ +{ + "networkCallRecords" : [ { + "Method" : "GET", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcreadattributesstrparsing1633256c19c31cbfd9424?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "4662b9ec-4233-4b57-8db6-c980820bfed0" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-error-code" : "ContainerNotFound", + "retry-after" : "0", + "Content-Length" : "225", + "StatusCode" : "404", + "x-ms-request-id" : "f979e035-001e-0133-2e4d-4e4bac000000", + "Body" : "ContainerNotFoundThe specified container does not exist.\nRequestId:f979e035-001e-0133-2e4d-4e4bac000000\nTime:2020-06-29T19:45:56.7178339Z", + "Date" : "Mon, 29 Jun 2020 19:45:55 GMT", + "x-ms-client-request-id" : "4662b9ec-4233-4b57-8db6-c980820bfed0", + "Content-Type" : "application/xml" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcreadattributesstrparsing1633256c19c31cbfd9424?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "3dae43e3-09ca-422d-b062-09cfe0da4240" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "ETag" : "0x8D81C650AA3A296", + "Last-Modified" : "Mon, 29 Jun 2020 19:45:56 GMT", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "d9b670f2-f01e-0066-0d4d-4ee68e000000", + "Date" : "Mon, 29 Jun 2020 19:45:56 GMT", + "x-ms-client-request-id" : "3dae43e3-09ca-422d-b062-09cfe0da4240" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcreadattributesstrparsing265256429b07ba3f994b3?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "1bd6382b-ee13-4269-8204-e8522f5ff34a" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-error-code" : "ContainerNotFound", + "retry-after" : "0", + "Content-Length" : "225", + "StatusCode" : "404", + "x-ms-request-id" : "aac9b7de-701e-0038-434d-4e158d000000", + "Body" : "ContainerNotFoundThe specified container does not exist.\nRequestId:aac9b7de-701e-0038-434d-4e158d000000\nTime:2020-06-29T19:45:57.1486609Z", + "Date" : "Mon, 29 Jun 2020 19:45:56 GMT", + "x-ms-client-request-id" : "1bd6382b-ee13-4269-8204-e8522f5ff34a", + "Content-Type" : "application/xml" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcreadattributesstrparsing265256429b07ba3f994b3?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "3d4fadfd-c55b-4ad2-974c-fe1e59fa889e" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "ETag" : "0x8D81C650AE5BE71", + "Last-Modified" : "Mon, 29 Jun 2020 19:45:57 GMT", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "355c8bb2-e01e-001f-2c4d-4e8fc4000000", + "Date" : "Mon, 29 Jun 2020 19:45:56 GMT", + "x-ms-client-request-id" : "3d4fadfd-c55b-4ad2-974c-fe1e59fa889e" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcreadattributesstrparsing1633256c19c31cbfd9424?prefix=javablobreadattributesstrparsing32471202c51554913b&delimiter=/&maxresults=2&include=metadata&restype=container&comp=list", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "8c8d270f-8725-4a1a-ba9d-c5243df742dd" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "f20f134b-901e-007d-2b4d-4ec81c000000", + "Body" : "javablobreadattributesstrparsing32471202c51554913b2/", + "Date" : "Mon, 29 Jun 2020 19:45:57 GMT", + "x-ms-client-request-id" : "8c8d270f-8725-4a1a-ba9d-c5243df742dd", + "Content-Type" : "application/xml" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcreadattributesstrparsing1633256c19c31cbfd9424/javablobreadattributesstrparsing32471202c51554913b", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "f83b2870-9be2-4dda-b8b7-1c062e740906", + "Content-Type" : "application/octet-stream" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-content-crc64" : "AAAAAAAAAAA=", + "Last-Modified" : "Mon, 29 Jun 2020 19:45:57 GMT", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-server-encrypted" : "true", + "Date" : "Mon, 29 Jun 2020 19:45:57 GMT", + "Content-MD5" : "1B2M2Y8AsgTpgAmY7PhCfg==", + "ETag" : "0x8D81C650B21EAB6", + "Content-Length" : "0", + "x-ms-request-id" : "f157b301-f01e-004f-734d-4e90cc000000", + "x-ms-client-request-id" : "f83b2870-9be2-4dda-b8b7-1c062e740906" + }, + "Exception" : null + }, { + "Method" : "HEAD", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcreadattributesstrparsing1633256c19c31cbfd9424/javablobreadattributesstrparsing32471202c51554913b", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "c53c39bd-811c-40ac-ac2e-4c4b7a3c39fd" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "x-ms-lease-status" : "unlocked", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-lease-state" : "available", + "Last-Modified" : "Mon, 29 Jun 2020 19:45:57 GMT", + "retry-after" : "0", + "StatusCode" : "200", + "Date" : "Mon, 29 Jun 2020 19:45:57 GMT", + "x-ms-blob-type" : "BlockBlob", + "Content-MD5" : "1B2M2Y8AsgTpgAmY7PhCfg==", + "Accept-Ranges" : "bytes", + "x-ms-server-encrypted" : "true", + "x-ms-access-tier-inferred" : "true", + "x-ms-access-tier" : "Hot", + "ETag" : "0x8D81C650B21EAB6", + "x-ms-creation-time" : "Mon, 29 Jun 2020 19:45:57 GMT", + "Content-Length" : "0", + "x-ms-request-id" : "e1ac61ba-f01e-0022-7a4d-4e3ae2000000", + "x-ms-client-request-id" : "c53c39bd-811c-40ac-ac2e-4c4b7a3c39fd", + "Content-Type" : "application/octet-stream" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.blob.core.windows.net?prefix=jtcreadattributesstrparsing&comp=list", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "222ddd39-9d29-42a8-bc27-8681d98e146d" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "2b596be5-d01e-001c-3c4d-4e8cc3000000", + "Body" : "jtcreadattributesstrparsingjtcreadattributesstrparsing1633256c19c31cbfd9424Mon, 29 Jun 2020 19:45:56 GMT\"0x8D81C650AA3A296\"unlockedavailable$account-encryption-keyfalsefalsefalsejtcreadattributesstrparsing265256429b07ba3f994b3Mon, 29 Jun 2020 19:45:57 GMT\"0x8D81C650AE5BE71\"unlockedavailable$account-encryption-keyfalsefalsefalse", + "Date" : "Mon, 29 Jun 2020 19:45:57 GMT", + "x-ms-client-request-id" : "222ddd39-9d29-42a8-bc27-8681d98e146d", + "Content-Type" : "application/xml" + }, + "Exception" : null + }, { + "Method" : "DELETE", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcreadattributesstrparsing1633256c19c31cbfd9424?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "f168138b-4249-4512-a820-c7773b8451af" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "202", + "x-ms-request-id" : "73b8104f-d01e-007a-044d-4e3e99000000", + "Date" : "Mon, 29 Jun 2020 19:45:57 GMT", + "x-ms-client-request-id" : "f168138b-4249-4512-a820-c7773b8451af" + }, + "Exception" : null + }, { + "Method" : "DELETE", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcreadattributesstrparsing265256429b07ba3f994b3?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "7c6bfe45-c10b-49a2-b30b-4f0338e25f64" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "202", + "x-ms-request-id" : "3e91f47d-201e-004d-244d-4e9236000000", + "Date" : "Mon, 29 Jun 2020 19:45:58 GMT", + "x-ms-client-request-id" : "7c6bfe45-c10b-49a2-b30b-4f0338e25f64" + }, + "Exception" : null + } ], + "variables" : [ "jtcreadattributesstrparsing096523654c178d9dde4a9", "jtcreadattributesstrparsing1633256c19c31cbfd9424", "jtcreadattributesstrparsing265256429b07ba3f994b3", "javablobreadattributesstrparsing32471202c51554913b" ] +} \ No newline at end of file diff --git a/sdk/storage/azure-storage-blob-nio/src/test/resources/session-records/AzureFileSystemProviderTestreadattributesstrparsing[7].json b/sdk/storage/azure-storage-blob-nio/src/test/resources/session-records/AzureFileSystemProviderTestreadattributesstrparsing[7].json new file mode 100644 index 0000000000000..9f10e0638fcba --- /dev/null +++ b/sdk/storage/azure-storage-blob-nio/src/test/resources/session-records/AzureFileSystemProviderTestreadattributesstrparsing[7].json @@ -0,0 +1,226 @@ +{ + "networkCallRecords" : [ { + "Method" : "GET", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcreadattributesstrparsing195374cd18ae750a5b4ef?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "0a543490-5165-4fe5-96e0-a62868eae5f8" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-error-code" : "ContainerNotFound", + "retry-after" : "0", + "Content-Length" : "225", + "StatusCode" : "404", + "x-ms-request-id" : "5c629bc2-e01e-0097-0d4d-4e371d000000", + "Body" : "ContainerNotFoundThe specified container does not exist.\nRequestId:5c629bc2-e01e-0097-0d4d-4e371d000000\nTime:2020-06-29T19:45:58.4885041Z", + "Date" : "Mon, 29 Jun 2020 19:45:58 GMT", + "x-ms-client-request-id" : "0a543490-5165-4fe5-96e0-a62868eae5f8", + "Content-Type" : "application/xml" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcreadattributesstrparsing195374cd18ae750a5b4ef?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "689b951c-5478-4183-8078-b450038e1823" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "ETag" : "0x8D81C650BB3088F", + "Last-Modified" : "Mon, 29 Jun 2020 19:45:58 GMT", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "fd48d9ed-501e-0042-0d4d-4e7fc0000000", + "Date" : "Mon, 29 Jun 2020 19:45:58 GMT", + "x-ms-client-request-id" : "689b951c-5478-4183-8078-b450038e1823" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcreadattributesstrparsing204292b1a8608c41b245a?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "38a8e382-04c1-478d-ad87-9922ca05cf0e" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-error-code" : "ContainerNotFound", + "retry-after" : "0", + "Content-Length" : "225", + "StatusCode" : "404", + "x-ms-request-id" : "0d15b57a-101e-00a0-3e4d-4e9bb2000000", + "Body" : "ContainerNotFoundThe specified container does not exist.\nRequestId:0d15b57a-101e-00a0-3e4d-4e9bb2000000\nTime:2020-06-29T19:45:58.8007445Z", + "Date" : "Mon, 29 Jun 2020 19:45:58 GMT", + "x-ms-client-request-id" : "38a8e382-04c1-478d-ad87-9922ca05cf0e", + "Content-Type" : "application/xml" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcreadattributesstrparsing204292b1a8608c41b245a?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "9d239ef9-775e-4aad-ad49-2ea0b2948836" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "ETag" : "0x8D81C650BE1A493", + "Last-Modified" : "Mon, 29 Jun 2020 19:45:58 GMT", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "74f45c32-401e-009a-544d-4ed811000000", + "Date" : "Mon, 29 Jun 2020 19:45:58 GMT", + "x-ms-client-request-id" : "9d239ef9-775e-4aad-ad49-2ea0b2948836" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcreadattributesstrparsing195374cd18ae750a5b4ef?prefix=javablobreadattributesstrparsing34827756c39bd8e59f&delimiter=/&maxresults=2&include=metadata&restype=container&comp=list", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "7554f6dc-40b4-4429-88bd-fef864b02ca4" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "66c74b72-301e-001d-7a4d-4e8d3e000000", + "Body" : "javablobreadattributesstrparsing34827756c39bd8e59f2/", + "Date" : "Mon, 29 Jun 2020 19:45:58 GMT", + "x-ms-client-request-id" : "7554f6dc-40b4-4429-88bd-fef864b02ca4", + "Content-Type" : "application/xml" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcreadattributesstrparsing195374cd18ae750a5b4ef/javablobreadattributesstrparsing34827756c39bd8e59f", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "1c4a2a6d-6bb7-4c1f-b5c1-965cb86b9ae5", + "Content-Type" : "application/octet-stream" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-content-crc64" : "AAAAAAAAAAA=", + "Last-Modified" : "Mon, 29 Jun 2020 19:45:59 GMT", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-server-encrypted" : "true", + "Date" : "Mon, 29 Jun 2020 19:45:58 GMT", + "Content-MD5" : "1B2M2Y8AsgTpgAmY7PhCfg==", + "ETag" : "0x8D81C650C150352", + "Content-Length" : "0", + "x-ms-request-id" : "feff2579-301e-00f3-754d-4e87bd000000", + "x-ms-client-request-id" : "1c4a2a6d-6bb7-4c1f-b5c1-965cb86b9ae5" + }, + "Exception" : null + }, { + "Method" : "HEAD", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcreadattributesstrparsing195374cd18ae750a5b4ef/javablobreadattributesstrparsing34827756c39bd8e59f", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "7ea0025e-6d52-4509-a79e-79198f580b9b" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "x-ms-lease-status" : "unlocked", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-lease-state" : "available", + "Last-Modified" : "Mon, 29 Jun 2020 19:45:59 GMT", + "retry-after" : "0", + "StatusCode" : "200", + "Date" : "Mon, 29 Jun 2020 19:45:59 GMT", + "x-ms-blob-type" : "BlockBlob", + "Content-MD5" : "1B2M2Y8AsgTpgAmY7PhCfg==", + "Accept-Ranges" : "bytes", + "x-ms-server-encrypted" : "true", + "x-ms-access-tier-inferred" : "true", + "x-ms-access-tier" : "Hot", + "ETag" : "0x8D81C650C150352", + "x-ms-creation-time" : "Mon, 29 Jun 2020 19:45:59 GMT", + "Content-Length" : "0", + "x-ms-request-id" : "18fbdc08-001e-009d-424d-4e2e94000000", + "x-ms-client-request-id" : "7ea0025e-6d52-4509-a79e-79198f580b9b", + "Content-Type" : "application/octet-stream" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.blob.core.windows.net?prefix=jtcreadattributesstrparsing&comp=list", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "36691de3-3aff-4071-b420-244eadd6da37" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "5e5db541-201e-0124-344d-4e8bcf000000", + "Body" : "jtcreadattributesstrparsingjtcreadattributesstrparsing195374cd18ae750a5b4efMon, 29 Jun 2020 19:45:58 GMT\"0x8D81C650BB3088F\"unlockedavailable$account-encryption-keyfalsefalsefalsejtcreadattributesstrparsing204292b1a8608c41b245aMon, 29 Jun 2020 19:45:58 GMT\"0x8D81C650BE1A493\"unlockedavailable$account-encryption-keyfalsefalsefalse", + "Date" : "Mon, 29 Jun 2020 19:45:59 GMT", + "x-ms-client-request-id" : "36691de3-3aff-4071-b420-244eadd6da37", + "Content-Type" : "application/xml" + }, + "Exception" : null + }, { + "Method" : "DELETE", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcreadattributesstrparsing195374cd18ae750a5b4ef?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "ab09e2bd-24e1-4b40-b5ce-184337262d1b" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "202", + "x-ms-request-id" : "fc2f7398-201e-00ce-634d-4e329b000000", + "Date" : "Mon, 29 Jun 2020 19:45:59 GMT", + "x-ms-client-request-id" : "ab09e2bd-24e1-4b40-b5ce-184337262d1b" + }, + "Exception" : null + }, { + "Method" : "DELETE", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcreadattributesstrparsing204292b1a8608c41b245a?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "09ec0f61-37aa-4189-9843-956ec7d838df" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "202", + "x-ms-request-id" : "500a9dc2-c01e-0065-064d-4ee589000000", + "Date" : "Mon, 29 Jun 2020 19:45:59 GMT", + "x-ms-client-request-id" : "09ec0f61-37aa-4189-9843-956ec7d838df" + }, + "Exception" : null + } ], + "variables" : [ "jtcreadattributesstrparsing065375d2a2758cd48b45f", "jtcreadattributesstrparsing195374cd18ae750a5b4ef", "jtcreadattributesstrparsing204292b1a8608c41b245a", "javablobreadattributesstrparsing34827756c39bd8e59f" ] +} \ No newline at end of file diff --git a/sdk/storage/azure-storage-blob-nio/src/test/resources/session-records/AzureFileSystemProviderTestreadattributesunsupported.json b/sdk/storage/azure-storage-blob-nio/src/test/resources/session-records/AzureFileSystemProviderTestreadattributesunsupported.json new file mode 100644 index 0000000000000..803712c7ce417 --- /dev/null +++ b/sdk/storage/azure-storage-blob-nio/src/test/resources/session-records/AzureFileSystemProviderTestreadattributesunsupported.json @@ -0,0 +1,149 @@ +{ + "networkCallRecords" : [ { + "Method" : "GET", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcreadattributesunsupported164923c34882698db54a?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "cf3bf2da-3e0b-475a-a145-9e12a5c816e9" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-error-code" : "ContainerNotFound", + "retry-after" : "0", + "Content-Length" : "225", + "StatusCode" : "404", + "x-ms-request-id" : "f3c418d3-f01e-00aa-2b4d-4e823b000000", + "Body" : "ContainerNotFoundThe specified container does not exist.\nRequestId:f3c418d3-f01e-00aa-2b4d-4e823b000000\nTime:2020-06-29T19:45:42.9355595Z", + "Date" : "Mon, 29 Jun 2020 19:45:42 GMT", + "x-ms-client-request-id" : "cf3bf2da-3e0b-475a-a145-9e12a5c816e9", + "Content-Type" : "application/xml" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcreadattributesunsupported164923c34882698db54a?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "40c7ab51-6981-45e2-9cf9-345dc8168d96" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "ETag" : "0x8D81C65026DCDEB", + "Last-Modified" : "Mon, 29 Jun 2020 19:45:43 GMT", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "c12dd213-a01e-011c-494d-4eca96000000", + "Date" : "Mon, 29 Jun 2020 19:45:43 GMT", + "x-ms-client-request-id" : "40c7ab51-6981-45e2-9cf9-345dc8168d96" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcreadattributesunsupported246930c0b44fefe7a64b?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "28075f0e-fe4b-4766-8954-7f2115925ae4" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-error-code" : "ContainerNotFound", + "retry-after" : "0", + "Content-Length" : "225", + "StatusCode" : "404", + "x-ms-request-id" : "0003baed-301e-009e-544d-4e2d93000000", + "Body" : "ContainerNotFoundThe specified container does not exist.\nRequestId:0003baed-301e-009e-544d-4e2d93000000\nTime:2020-06-29T19:45:43.2570938Z", + "Date" : "Mon, 29 Jun 2020 19:45:42 GMT", + "x-ms-client-request-id" : "28075f0e-fe4b-4766-8954-7f2115925ae4", + "Content-Type" : "application/xml" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcreadattributesunsupported246930c0b44fefe7a64b?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "703b2a73-4b4b-4144-9783-8ee99457f942" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "ETag" : "0x8D81C65029F07C7", + "Last-Modified" : "Mon, 29 Jun 2020 19:45:43 GMT", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "7db2c778-d01e-0035-3d4d-4efa81000000", + "Date" : "Mon, 29 Jun 2020 19:45:43 GMT", + "x-ms-client-request-id" : "703b2a73-4b4b-4144-9783-8ee99457f942" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.blob.core.windows.net?prefix=jtcreadattributesunsupported&comp=list", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "4aec31a5-9225-4cdb-b36e-78caaf901dad" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "f8c3e7a1-401e-007f-6f4d-4ecae6000000", + "Body" : "jtcreadattributesunsupportedjtcreadattributesunsupported164923c34882698db54aMon, 29 Jun 2020 19:45:43 GMT\"0x8D81C65026DCDEB\"unlockedavailable$account-encryption-keyfalsefalsefalsejtcreadattributesunsupported246930c0b44fefe7a64bMon, 29 Jun 2020 19:45:43 GMT\"0x8D81C65029F07C7\"unlockedavailable$account-encryption-keyfalsefalsefalse", + "Date" : "Mon, 29 Jun 2020 19:45:42 GMT", + "x-ms-client-request-id" : "4aec31a5-9225-4cdb-b36e-78caaf901dad", + "Content-Type" : "application/xml" + }, + "Exception" : null + }, { + "Method" : "DELETE", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcreadattributesunsupported164923c34882698db54a?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "d20b9358-8564-491a-887c-ab4d277d3ccd" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "202", + "x-ms-request-id" : "3d526401-e01e-00b5-564d-4e592b000000", + "Date" : "Mon, 29 Jun 2020 19:45:43 GMT", + "x-ms-client-request-id" : "d20b9358-8564-491a-887c-ab4d277d3ccd" + }, + "Exception" : null + }, { + "Method" : "DELETE", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcreadattributesunsupported246930c0b44fefe7a64b?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "6e2cec86-3d8b-426c-902a-9c0db631c228" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "202", + "x-ms-request-id" : "575cd768-701e-013c-4d4d-4ea65a000000", + "Date" : "Mon, 29 Jun 2020 19:45:43 GMT", + "x-ms-client-request-id" : "6e2cec86-3d8b-426c-902a-9c0db631c228" + }, + "Exception" : null + } ], + "variables" : [ "jtcreadattributesunsupported045742a8798ea960cf46", "jtcreadattributesunsupported164923c34882698db54a", "jtcreadattributesunsupported246930c0b44fefe7a64b" ] +} \ No newline at end of file diff --git a/sdk/storage/azure-storage-blob-nio/src/test/resources/session-records/AzureFileSystemProviderTestsetattributesdirectory.json b/sdk/storage/azure-storage-blob-nio/src/test/resources/session-records/AzureFileSystemProviderTestsetattributesdirectory.json new file mode 100644 index 0000000000000..69b59952ba076 --- /dev/null +++ b/sdk/storage/azure-storage-blob-nio/src/test/resources/session-records/AzureFileSystemProviderTestsetattributesdirectory.json @@ -0,0 +1,192 @@ +{ + "networkCallRecords" : [ { + "Method" : "GET", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcsetattributesdirectory166595c040d69d3c414eac?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "1a4b56e0-5e6d-497c-9dfd-508b592fd9f5" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-error-code" : "ContainerNotFound", + "retry-after" : "0", + "Content-Length" : "225", + "StatusCode" : "404", + "x-ms-request-id" : "39d762f6-301e-0112-4b4d-4e269d000000", + "Body" : "ContainerNotFoundThe specified container does not exist.\nRequestId:39d762f6-301e-0112-4b4d-4e269d000000\nTime:2020-06-29T19:46:20.3613308Z", + "Date" : "Mon, 29 Jun 2020 19:46:19 GMT", + "x-ms-client-request-id" : "1a4b56e0-5e6d-497c-9dfd-508b592fd9f5", + "Content-Type" : "application/xml" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcsetattributesdirectory166595c040d69d3c414eac?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "72e0be11-d371-4227-9c22-a4d1ebc4ae0e" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "ETag" : "0x8D81C6518BB067A", + "Last-Modified" : "Mon, 29 Jun 2020 19:46:20 GMT", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "9017a3f9-b01e-0121-034d-4e7fb0000000", + "Date" : "Mon, 29 Jun 2020 19:46:20 GMT", + "x-ms-client-request-id" : "72e0be11-d371-4227-9c22-a4d1ebc4ae0e" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcsetattributesdirectory285721ecd8f4ec22d54cd1?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "8d0f7c74-2530-4419-a880-faffcf7c9496" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-error-code" : "ContainerNotFound", + "retry-after" : "0", + "Content-Length" : "225", + "StatusCode" : "404", + "x-ms-request-id" : "6922d245-c01e-0003-554d-4e57d3000000", + "Body" : "ContainerNotFoundThe specified container does not exist.\nRequestId:6922d245-c01e-0003-554d-4e57d3000000\nTime:2020-06-29T19:46:20.6675576Z", + "Date" : "Mon, 29 Jun 2020 19:46:20 GMT", + "x-ms-client-request-id" : "8d0f7c74-2530-4419-a880-faffcf7c9496", + "Content-Type" : "application/xml" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcsetattributesdirectory285721ecd8f4ec22d54cd1?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "9c046eda-7ad5-4bb5-b3ab-6723c9d9f0be" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "ETag" : "0x8D81C6518EAE7C9", + "Last-Modified" : "Mon, 29 Jun 2020 19:46:20 GMT", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "d99fa4e0-101e-004e-0e4d-4e9131000000", + "Date" : "Mon, 29 Jun 2020 19:46:20 GMT", + "x-ms-client-request-id" : "9c046eda-7ad5-4bb5-b3ab-6723c9d9f0be" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcsetattributesdirectory166595c040d69d3c414eac/javablobsetattributesdirectory332512e8b07c487d964?comp=blocklist", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "5efcd4cf-e5a0-44dd-b8cf-833fc4cfbb8d", + "Content-Type" : "application/xml; charset=utf-8" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "ETag" : "0x8D81C65190581A0", + "x-ms-content-crc64" : "p1vsGtjjPsk=", + "Last-Modified" : "Mon, 29 Jun 2020 19:46:20 GMT", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "30d848ad-b01e-0084-4d4d-4e02fc000000", + "x-ms-request-server-encrypted" : "true", + "Date" : "Mon, 29 Jun 2020 19:46:20 GMT", + "x-ms-client-request-id" : "5efcd4cf-e5a0-44dd-b8cf-833fc4cfbb8d" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcsetattributesdirectory166595c040d69d3c414eac/javablobsetattributesdirectory332512e8b07c487d964?comp=tier", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "cee29a72-4f13-4f21-a061-cbc109918b39" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "d86f8ff1-b01e-00a6-294d-4e6cca000000", + "Date" : "Mon, 29 Jun 2020 19:46:20 GMT", + "x-ms-client-request-id" : "cee29a72-4f13-4f21-a061-cbc109918b39" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.blob.core.windows.net?prefix=jtcsetattributesdirectory&comp=list", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "e4f7489b-c9c6-497e-80fa-09acadbbeb89" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "5535c9ad-701e-00dd-234d-4e077a000000", + "Body" : "jtcsetattributesdirectoryjtcsetattributesdirectory166595c040d69d3c414eacMon, 29 Jun 2020 19:46:20 GMT\"0x8D81C6518BB067A\"unlockedavailable$account-encryption-keyfalsefalsefalsejtcsetattributesdirectory285721ecd8f4ec22d54cd1Mon, 29 Jun 2020 19:46:20 GMT\"0x8D81C6518EAE7C9\"unlockedavailable$account-encryption-keyfalsefalsefalse", + "Date" : "Mon, 29 Jun 2020 19:46:20 GMT", + "x-ms-client-request-id" : "e4f7489b-c9c6-497e-80fa-09acadbbeb89", + "Content-Type" : "application/xml" + }, + "Exception" : null + }, { + "Method" : "DELETE", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcsetattributesdirectory166595c040d69d3c414eac?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "94d72afe-4c05-4410-bc8e-b751ce12bae5" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "202", + "x-ms-request-id" : "0d2d7c6b-801e-00c3-204d-4edd97000000", + "Date" : "Mon, 29 Jun 2020 19:46:21 GMT", + "x-ms-client-request-id" : "94d72afe-4c05-4410-bc8e-b751ce12bae5" + }, + "Exception" : null + }, { + "Method" : "DELETE", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcsetattributesdirectory285721ecd8f4ec22d54cd1?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "a04d8526-b98f-46b2-b369-84e8e54697c3" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "202", + "x-ms-request-id" : "080e018d-c01e-00e6-494d-4e4524000000", + "Date" : "Mon, 29 Jun 2020 19:46:20 GMT", + "x-ms-client-request-id" : "a04d8526-b98f-46b2-b369-84e8e54697c3" + }, + "Exception" : null + } ], + "variables" : [ "jtcsetattributesdirectory054127802b12bf68f44bfa", "jtcsetattributesdirectory166595c040d69d3c414eac", "jtcsetattributesdirectory285721ecd8f4ec22d54cd1", "javablobsetattributesdirectory332512e8b07c487d964" ] +} \ No newline at end of file diff --git a/sdk/storage/azure-storage-blob-nio/src/test/resources/session-records/AzureFileSystemProviderTestsetattributesheaders[0].json b/sdk/storage/azure-storage-blob-nio/src/test/resources/session-records/AzureFileSystemProviderTestsetattributesheaders[0].json new file mode 100644 index 0000000000000..499a89dc7e2aa --- /dev/null +++ b/sdk/storage/azure-storage-blob-nio/src/test/resources/session-records/AzureFileSystemProviderTestsetattributesheaders[0].json @@ -0,0 +1,245 @@ +{ + "networkCallRecords" : [ { + "Method" : "GET", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcsetattributesheaders139367cc0595bb7033488c8?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "9f3170e5-e810-43c2-8291-6c6b3c8780c5" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-error-code" : "ContainerNotFound", + "retry-after" : "0", + "Content-Length" : "225", + "StatusCode" : "404", + "x-ms-request-id" : "2b5d0acc-c01e-0008-734d-4e4fa7000000", + "Body" : "ContainerNotFoundThe specified container does not exist.\nRequestId:2b5d0acc-c01e-0008-734d-4e4fa7000000\nTime:2020-06-29T19:46:07.5174812Z", + "Date" : "Mon, 29 Jun 2020 19:46:06 GMT", + "x-ms-client-request-id" : "9f3170e5-e810-43c2-8291-6c6b3c8780c5", + "Content-Type" : "application/xml" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcsetattributesheaders139367cc0595bb7033488c8?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "5097795f-ac1d-4b4f-83f2-b8971eef8160" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "ETag" : "0x8D81C6511156EF0", + "Last-Modified" : "Mon, 29 Jun 2020 19:46:07 GMT", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "fe4cdcfb-d01e-00f2-184d-4e8640000000", + "Date" : "Mon, 29 Jun 2020 19:46:07 GMT", + "x-ms-client-request-id" : "5097795f-ac1d-4b4f-83f2-b8971eef8160" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcsetattributesheaders292182f5f82bede16443d8a?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "74c09439-28e7-4443-a230-84b639f2588c" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-error-code" : "ContainerNotFound", + "retry-after" : "0", + "Content-Length" : "225", + "StatusCode" : "404", + "x-ms-request-id" : "1d87bf6d-e01e-009c-284d-4e2f69000000", + "Body" : "ContainerNotFoundThe specified container does not exist.\nRequestId:1d87bf6d-e01e-009c-284d-4e2f69000000\nTime:2020-06-29T19:46:07.9150846Z", + "Date" : "Mon, 29 Jun 2020 19:46:07 GMT", + "x-ms-client-request-id" : "74c09439-28e7-4443-a230-84b639f2588c", + "Content-Type" : "application/xml" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcsetattributesheaders292182f5f82bede16443d8a?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "2e1591b5-7bc8-4e00-ac92-2edb15e92515" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "ETag" : "0x8D81C6511511EBC", + "Last-Modified" : "Mon, 29 Jun 2020 19:46:08 GMT", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "4e96fb3c-601e-0123-184d-4e7d4a000000", + "Date" : "Mon, 29 Jun 2020 19:46:07 GMT", + "x-ms-client-request-id" : "2e1591b5-7bc8-4e00-ac92-2edb15e92515" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcsetattributesheaders139367cc0595bb7033488c8?prefix=javablobsetattributesheaders3043924aad8d41482d41&delimiter=/&maxresults=2&include=metadata&restype=container&comp=list", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "2b960956-d95f-470c-b885-6c9c96f470db" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "0e9a2078-401e-011d-6d4d-4ecb6b000000", + "Body" : "javablobsetattributesheaders3043924aad8d41482d412/", + "Date" : "Mon, 29 Jun 2020 19:46:07 GMT", + "x-ms-client-request-id" : "2b960956-d95f-470c-b885-6c9c96f470db", + "Content-Type" : "application/xml" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcsetattributesheaders139367cc0595bb7033488c8/javablobsetattributesheaders3043924aad8d41482d41", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "dc0eda63-f971-472c-b385-b43bd1bbaf49", + "Content-Type" : "application/octet-stream" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-content-crc64" : "AAAAAAAAAAA=", + "Last-Modified" : "Mon, 29 Jun 2020 19:46:08 GMT", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-server-encrypted" : "true", + "Date" : "Mon, 29 Jun 2020 19:46:08 GMT", + "Content-MD5" : "1B2M2Y8AsgTpgAmY7PhCfg==", + "ETag" : "0x8D81C6511818098", + "Content-Length" : "0", + "x-ms-request-id" : "b7434ca6-101e-0028-2e4d-4e236b000000", + "x-ms-client-request-id" : "dc0eda63-f971-472c-b385-b43bd1bbaf49" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcsetattributesheaders139367cc0595bb7033488c8/javablobsetattributesheaders3043924aad8d41482d41?comp=properties", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "f2bd53b7-ae7e-4b3d-a426-07c7b32c4660" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "ETag" : "0x8D81C65119DC06A", + "Last-Modified" : "Mon, 29 Jun 2020 19:46:08 GMT", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "a1e89ba3-701e-00d6-5c4d-4e1f0e000000", + "Date" : "Mon, 29 Jun 2020 19:46:08 GMT", + "x-ms-client-request-id" : "f2bd53b7-ae7e-4b3d-a426-07c7b32c4660" + }, + "Exception" : null + }, { + "Method" : "HEAD", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcsetattributesheaders139367cc0595bb7033488c8/javablobsetattributesheaders3043924aad8d41482d41", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "bad5828f-f8e0-4246-bd9d-ff951b95cce6" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "x-ms-lease-status" : "unlocked", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-lease-state" : "available", + "Last-Modified" : "Mon, 29 Jun 2020 19:46:08 GMT", + "retry-after" : "0", + "StatusCode" : "200", + "Date" : "Mon, 29 Jun 2020 19:46:08 GMT", + "x-ms-blob-type" : "BlockBlob", + "Accept-Ranges" : "bytes", + "x-ms-server-encrypted" : "true", + "x-ms-access-tier-inferred" : "true", + "x-ms-access-tier" : "Hot", + "ETag" : "0x8D81C65119DC06A", + "x-ms-creation-time" : "Mon, 29 Jun 2020 19:46:08 GMT", + "Content-Length" : "0", + "x-ms-request-id" : "a728a49d-c01e-010c-024d-4efc70000000", + "x-ms-client-request-id" : "bad5828f-f8e0-4246-bd9d-ff951b95cce6" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.blob.core.windows.net?prefix=jtcsetattributesheaders&comp=list", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "7dad69e3-c8df-42af-837c-c5fac5d9533a" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "a87a006c-101e-0067-1b4d-4ee773000000", + "Body" : "jtcsetattributesheadersjtcsetattributesheaders139367cc0595bb7033488c8Mon, 29 Jun 2020 19:46:07 GMT\"0x8D81C6511156EF0\"unlockedavailable$account-encryption-keyfalsefalsefalsejtcsetattributesheaders292182f5f82bede16443d8aMon, 29 Jun 2020 19:46:08 GMT\"0x8D81C6511511EBC\"unlockedavailable$account-encryption-keyfalsefalsefalse", + "Date" : "Mon, 29 Jun 2020 19:46:08 GMT", + "x-ms-client-request-id" : "7dad69e3-c8df-42af-837c-c5fac5d9533a", + "Content-Type" : "application/xml" + }, + "Exception" : null + }, { + "Method" : "DELETE", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcsetattributesheaders139367cc0595bb7033488c8?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "d2789f64-3257-4514-abd0-ac7f9ee3bea0" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "202", + "x-ms-request-id" : "13164c9b-101e-0089-234d-4eedf0000000", + "Date" : "Mon, 29 Jun 2020 19:46:08 GMT", + "x-ms-client-request-id" : "d2789f64-3257-4514-abd0-ac7f9ee3bea0" + }, + "Exception" : null + }, { + "Method" : "DELETE", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcsetattributesheaders292182f5f82bede16443d8a?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "92b434d8-9e20-4a93-964d-8c19faa4825f" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "202", + "x-ms-request-id" : "9c7a537e-a01e-005c-754d-4ea52d000000", + "Date" : "Mon, 29 Jun 2020 19:46:08 GMT", + "x-ms-client-request-id" : "92b434d8-9e20-4a93-964d-8c19faa4825f" + }, + "Exception" : null + } ], + "variables" : [ "jtcsetattributesheaders010671ad08ddbcaaad4e7a8", "jtcsetattributesheaders139367cc0595bb7033488c8", "jtcsetattributesheaders292182f5f82bede16443d8a", "javablobsetattributesheaders3043924aad8d41482d41" ] +} \ No newline at end of file diff --git a/sdk/storage/azure-storage-blob-nio/src/test/resources/session-records/AzureFileSystemProviderTestsetattributesheaders[1].json b/sdk/storage/azure-storage-blob-nio/src/test/resources/session-records/AzureFileSystemProviderTestsetattributesheaders[1].json new file mode 100644 index 0000000000000..14ba2f780116c --- /dev/null +++ b/sdk/storage/azure-storage-blob-nio/src/test/resources/session-records/AzureFileSystemProviderTestsetattributesheaders[1].json @@ -0,0 +1,251 @@ +{ + "networkCallRecords" : [ { + "Method" : "GET", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcsetattributesheaders1785294f40da8ca21046d3b?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "a30c8293-730c-4238-83e6-923c5e5d4b66" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-error-code" : "ContainerNotFound", + "retry-after" : "0", + "Content-Length" : "225", + "StatusCode" : "404", + "x-ms-request-id" : "657020c5-401e-0056-614d-4ebca4000000", + "Body" : "ContainerNotFoundThe specified container does not exist.\nRequestId:657020c5-401e-0056-614d-4ebca4000000\nTime:2020-06-29T19:46:09.3766519Z", + "Date" : "Mon, 29 Jun 2020 19:46:09 GMT", + "x-ms-client-request-id" : "a30c8293-730c-4238-83e6-923c5e5d4b66", + "Content-Type" : "application/xml" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcsetattributesheaders1785294f40da8ca21046d3b?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "cb3415c8-bed4-4718-95d8-8ded67439c58" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "ETag" : "0x8D81C6512323072", + "Last-Modified" : "Mon, 29 Jun 2020 19:46:09 GMT", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "c79ce22b-901e-00dc-4d4d-4e0687000000", + "Date" : "Mon, 29 Jun 2020 19:46:09 GMT", + "x-ms-client-request-id" : "cb3415c8-bed4-4718-95d8-8ded67439c58" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcsetattributesheaders26576677ed2fcbd1e747fb9?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "2fb9b2d6-6b08-4342-8402-caeaa38e6dde" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-error-code" : "ContainerNotFound", + "retry-after" : "0", + "Content-Length" : "225", + "StatusCode" : "404", + "x-ms-request-id" : "36bbe296-101e-0127-284d-4e88c8000000", + "Body" : "ContainerNotFoundThe specified container does not exist.\nRequestId:36bbe296-101e-0127-284d-4e88c8000000\nTime:2020-06-29T19:46:09.7043334Z", + "Date" : "Mon, 29 Jun 2020 19:46:08 GMT", + "x-ms-client-request-id" : "2fb9b2d6-6b08-4342-8402-caeaa38e6dde", + "Content-Type" : "application/xml" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcsetattributesheaders26576677ed2fcbd1e747fb9?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "406c629b-7b7c-4ac2-b198-4d7859d3d207" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "ETag" : "0x8D81C651261C44F", + "Last-Modified" : "Mon, 29 Jun 2020 19:46:09 GMT", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "3b35239a-101e-0045-0b4d-4e8945000000", + "Date" : "Mon, 29 Jun 2020 19:46:08 GMT", + "x-ms-client-request-id" : "406c629b-7b7c-4ac2-b198-4d7859d3d207" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcsetattributesheaders1785294f40da8ca21046d3b?prefix=javablobsetattributesheaders381324cc426dc48db34b&delimiter=/&maxresults=2&include=metadata&restype=container&comp=list", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "f8a7532c-0fbe-48e4-8405-905186cb770a" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "f6031899-d01e-0017-5d4d-4e94b7000000", + "Body" : "javablobsetattributesheaders381324cc426dc48db34b2/", + "Date" : "Mon, 29 Jun 2020 19:46:09 GMT", + "x-ms-client-request-id" : "f8a7532c-0fbe-48e4-8405-905186cb770a", + "Content-Type" : "application/xml" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcsetattributesheaders1785294f40da8ca21046d3b/javablobsetattributesheaders381324cc426dc48db34b", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "5fb7d9fa-ac81-4e8c-b82b-b99bea032448", + "Content-Type" : "application/octet-stream" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-content-crc64" : "AAAAAAAAAAA=", + "Last-Modified" : "Mon, 29 Jun 2020 19:46:10 GMT", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-server-encrypted" : "true", + "Date" : "Mon, 29 Jun 2020 19:46:09 GMT", + "Content-MD5" : "1B2M2Y8AsgTpgAmY7PhCfg==", + "ETag" : "0x8D81C651292D523", + "Content-Length" : "0", + "x-ms-request-id" : "f71e7dc1-201e-008a-474d-4eeef7000000", + "x-ms-client-request-id" : "5fb7d9fa-ac81-4e8c-b82b-b99bea032448" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcsetattributesheaders1785294f40da8ca21046d3b/javablobsetattributesheaders381324cc426dc48db34b?comp=properties", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "e63bba33-723f-4545-9e43-9029baee3528" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "ETag" : "0x8D81C6512AF14F9", + "Last-Modified" : "Mon, 29 Jun 2020 19:46:10 GMT", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "8cccc8b7-001e-0138-764d-4e53d8000000", + "Date" : "Mon, 29 Jun 2020 19:46:09 GMT", + "x-ms-client-request-id" : "e63bba33-723f-4545-9e43-9029baee3528" + }, + "Exception" : null + }, { + "Method" : "HEAD", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcsetattributesheaders1785294f40da8ca21046d3b/javablobsetattributesheaders381324cc426dc48db34b", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "cb11112f-4c74-4084-baf6-e9a29743e51f" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "x-ms-lease-status" : "unlocked", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-lease-state" : "available", + "Last-Modified" : "Mon, 29 Jun 2020 19:46:10 GMT", + "retry-after" : "0", + "StatusCode" : "200", + "Date" : "Mon, 29 Jun 2020 19:46:10 GMT", + "x-ms-blob-type" : "BlockBlob", + "Content-MD5" : "d2grV20xOEQwejFENEUrUEUyNTJnZz09", + "Accept-Ranges" : "bytes", + "x-ms-server-encrypted" : "true", + "x-ms-access-tier-inferred" : "true", + "x-ms-access-tier" : "Hot", + "Cache-Control" : "control", + "ETag" : "0x8D81C6512AF14F9", + "Content-Disposition" : "disposition", + "Content-Encoding" : "encoding", + "x-ms-creation-time" : "Mon, 29 Jun 2020 19:46:10 GMT", + "Content-Length" : "0", + "x-ms-request-id" : "1c1c4bc7-b01e-0043-214d-4e7e3d000000", + "x-ms-client-request-id" : "cb11112f-4c74-4084-baf6-e9a29743e51f", + "Content-Language" : "language", + "Content-Type" : "type" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.blob.core.windows.net?prefix=jtcsetattributesheaders&comp=list", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "1237a329-fbf8-4612-b8aa-e8fed9b578fe" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "33a43d4c-e01e-00f1-2a4d-4e8547000000", + "Body" : "jtcsetattributesheadersjtcsetattributesheaders1785294f40da8ca21046d3bMon, 29 Jun 2020 19:46:09 GMT\"0x8D81C6512323072\"unlockedavailable$account-encryption-keyfalsefalsefalsejtcsetattributesheaders26576677ed2fcbd1e747fb9Mon, 29 Jun 2020 19:46:09 GMT\"0x8D81C651261C44F\"unlockedavailable$account-encryption-keyfalsefalsefalse", + "Date" : "Mon, 29 Jun 2020 19:46:10 GMT", + "x-ms-client-request-id" : "1237a329-fbf8-4612-b8aa-e8fed9b578fe", + "Content-Type" : "application/xml" + }, + "Exception" : null + }, { + "Method" : "DELETE", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcsetattributesheaders1785294f40da8ca21046d3b?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "e3a0ee10-5b76-45f9-b81d-9da8804a0ac4" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "202", + "x-ms-request-id" : "c6bca916-a01e-009b-164d-4ed9ec000000", + "Date" : "Mon, 29 Jun 2020 19:46:10 GMT", + "x-ms-client-request-id" : "e3a0ee10-5b76-45f9-b81d-9da8804a0ac4" + }, + "Exception" : null + }, { + "Method" : "DELETE", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcsetattributesheaders26576677ed2fcbd1e747fb9?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "14adc144-7959-4f07-89e9-bdbcd8e6d27b" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "202", + "x-ms-request-id" : "489bab3e-101e-000a-414d-4e4d5d000000", + "Date" : "Mon, 29 Jun 2020 19:46:10 GMT", + "x-ms-client-request-id" : "14adc144-7959-4f07-89e9-bdbcd8e6d27b" + }, + "Exception" : null + } ], + "variables" : [ "jtcsetattributesheaders042989951874eeca4b436eb", "jtcsetattributesheaders1785294f40da8ca21046d3b", "jtcsetattributesheaders26576677ed2fcbd1e747fb9", "javablobsetattributesheaders381324cc426dc48db34b" ] +} \ No newline at end of file diff --git a/sdk/storage/azure-storage-blob-nio/src/test/resources/session-records/AzureFileSystemProviderTestsetattributesia[0].json b/sdk/storage/azure-storage-blob-nio/src/test/resources/session-records/AzureFileSystemProviderTestsetattributesia[0].json new file mode 100644 index 0000000000000..76868814dc602 --- /dev/null +++ b/sdk/storage/azure-storage-blob-nio/src/test/resources/session-records/AzureFileSystemProviderTestsetattributesia[0].json @@ -0,0 +1,149 @@ +{ + "networkCallRecords" : [ { + "Method" : "GET", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcsetattributesia1431794a4f70fb31454f11a62?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "e9305356-998b-4a2f-9f3c-a8dc7d5015aa" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-error-code" : "ContainerNotFound", + "retry-after" : "0", + "Content-Length" : "225", + "StatusCode" : "404", + "x-ms-request-id" : "2661b124-701e-007c-2e4d-4ec9e1000000", + "Body" : "ContainerNotFoundThe specified container does not exist.\nRequestId:2661b124-701e-007c-2e4d-4ec9e1000000\nTime:2020-06-29T19:46:21.8051013Z", + "Date" : "Mon, 29 Jun 2020 19:46:21 GMT", + "x-ms-client-request-id" : "e9305356-998b-4a2f-9f3c-a8dc7d5015aa", + "Content-Type" : "application/xml" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcsetattributesia1431794a4f70fb31454f11a62?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "3c7fd169-3243-4a73-a8c5-d706387cb743" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "ETag" : "0x8D81C65199802DE", + "Last-Modified" : "Mon, 29 Jun 2020 19:46:21 GMT", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "49bc7c4b-401e-0012-664d-4e60c8000000", + "Date" : "Mon, 29 Jun 2020 19:46:21 GMT", + "x-ms-client-request-id" : "3c7fd169-3243-4a73-a8c5-d706387cb743" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcsetattributesia26338965e416068c9b406fae4?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "c825a53b-33e1-4260-86c9-c2f3764673b9" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-error-code" : "ContainerNotFound", + "retry-after" : "0", + "Content-Length" : "225", + "StatusCode" : "404", + "x-ms-request-id" : "ef14c393-d01e-0071-284d-4e26ed000000", + "Body" : "ContainerNotFoundThe specified container does not exist.\nRequestId:ef14c393-d01e-0071-284d-4e26ed000000\nTime:2020-06-29T19:46:22.1114342Z", + "Date" : "Mon, 29 Jun 2020 19:46:21 GMT", + "x-ms-client-request-id" : "c825a53b-33e1-4260-86c9-c2f3764673b9", + "Content-Type" : "application/xml" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcsetattributesia26338965e416068c9b406fae4?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "f3cd4232-763a-4216-a07c-352859207fa5" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "ETag" : "0x8D81C6519CD838E", + "Last-Modified" : "Mon, 29 Jun 2020 19:46:22 GMT", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "731f6aff-501e-00e3-154d-4eb15b000000", + "Date" : "Mon, 29 Jun 2020 19:46:21 GMT", + "x-ms-client-request-id" : "f3cd4232-763a-4216-a07c-352859207fa5" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.blob.core.windows.net?prefix=jtcsetattributesia&comp=list", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "ba5d8845-27a7-487e-a998-b719ae22b4b3" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "59c83c85-f01e-0029-6f4d-4e2296000000", + "Body" : "jtcsetattributesiajtcsetattributesia1431794a4f70fb31454f11a62Mon, 29 Jun 2020 19:46:21 GMT\"0x8D81C65199802DE\"unlockedavailable$account-encryption-keyfalsefalsefalsejtcsetattributesia26338965e416068c9b406fae4Mon, 29 Jun 2020 19:46:22 GMT\"0x8D81C6519CD838E\"unlockedavailable$account-encryption-keyfalsefalsefalse", + "Date" : "Mon, 29 Jun 2020 19:46:21 GMT", + "x-ms-client-request-id" : "ba5d8845-27a7-487e-a998-b719ae22b4b3", + "Content-Type" : "application/xml" + }, + "Exception" : null + }, { + "Method" : "DELETE", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcsetattributesia1431794a4f70fb31454f11a62?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "1452c74c-ce61-4a17-b1ba-6f63191cf6c2" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "202", + "x-ms-request-id" : "45c25a73-301e-0052-794d-4e4926000000", + "Date" : "Mon, 29 Jun 2020 19:46:22 GMT", + "x-ms-client-request-id" : "1452c74c-ce61-4a17-b1ba-6f63191cf6c2" + }, + "Exception" : null + }, { + "Method" : "DELETE", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcsetattributesia26338965e416068c9b406fae4?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "2159208a-b405-483f-a1ac-45db89ad031f" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "202", + "x-ms-request-id" : "ff35fcab-f01e-0088-3d4d-4eec0d000000", + "Date" : "Mon, 29 Jun 2020 19:46:22 GMT", + "x-ms-client-request-id" : "2159208a-b405-483f-a1ac-45db89ad031f" + }, + "Exception" : null + } ], + "variables" : [ "jtcsetattributesia02607084ea496dc25443da931", "jtcsetattributesia1431794a4f70fb31454f11a62", "jtcsetattributesia26338965e416068c9b406fae4", "javablobsetattributesia356667236fe2034d184d909" ] +} \ No newline at end of file diff --git a/sdk/storage/azure-storage-blob-nio/src/test/resources/session-records/AzureFileSystemProviderTestsetattributesia[1].json b/sdk/storage/azure-storage-blob-nio/src/test/resources/session-records/AzureFileSystemProviderTestsetattributesia[1].json new file mode 100644 index 0000000000000..de367230ad140 --- /dev/null +++ b/sdk/storage/azure-storage-blob-nio/src/test/resources/session-records/AzureFileSystemProviderTestsetattributesia[1].json @@ -0,0 +1,149 @@ +{ + "networkCallRecords" : [ { + "Method" : "GET", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcsetattributesia189608499d330175354b47b29?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "01d441fb-33bb-4c1a-8beb-12a404f2ed39" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-error-code" : "ContainerNotFound", + "retry-after" : "0", + "Content-Length" : "225", + "StatusCode" : "404", + "x-ms-request-id" : "ba02a953-001e-00fb-4f4d-4e9cce000000", + "Body" : "ContainerNotFoundThe specified container does not exist.\nRequestId:ba02a953-001e-00fb-4f4d-4e9cce000000\nTime:2020-06-29T19:46:22.9716996Z", + "Date" : "Mon, 29 Jun 2020 19:46:22 GMT", + "x-ms-client-request-id" : "01d441fb-33bb-4c1a-8beb-12a404f2ed39", + "Content-Type" : "application/xml" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcsetattributesia189608499d330175354b47b29?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "4f53b443-6fd4-4969-9847-73e9443010f5" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "ETag" : "0x8D81C651A4A3BEF", + "Last-Modified" : "Mon, 29 Jun 2020 19:46:23 GMT", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "718c19ae-801e-0069-274d-4e0b78000000", + "Date" : "Mon, 29 Jun 2020 19:46:22 GMT", + "x-ms-client-request-id" : "4f53b443-6fd4-4969-9847-73e9443010f5" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcsetattributesia2126696cd46c7020b3461cbe6?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "82cebbd2-22ec-4760-9c65-b5332ea43d31" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-error-code" : "ContainerNotFound", + "retry-after" : "0", + "Content-Length" : "225", + "StatusCode" : "404", + "x-ms-request-id" : "81d230e8-701e-0077-4e4d-4ed195000000", + "Body" : "ContainerNotFoundThe specified container does not exist.\nRequestId:81d230e8-701e-0077-4e4d-4ed195000000\nTime:2020-06-29T19:46:23.2786451Z", + "Date" : "Mon, 29 Jun 2020 19:46:23 GMT", + "x-ms-client-request-id" : "82cebbd2-22ec-4760-9c65-b5332ea43d31", + "Content-Type" : "application/xml" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcsetattributesia2126696cd46c7020b3461cbe6?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "fd5926e7-da69-4059-b305-3e263a2cabac" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "ETag" : "0x8D81C651A798B64", + "Last-Modified" : "Mon, 29 Jun 2020 19:46:23 GMT", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "adac49c1-601e-00c2-474d-4edc6a000000", + "Date" : "Mon, 29 Jun 2020 19:46:22 GMT", + "x-ms-client-request-id" : "fd5926e7-da69-4059-b305-3e263a2cabac" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.blob.core.windows.net?prefix=jtcsetattributesia&comp=list", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "5225e43a-9496-4a0b-8629-d5a07ac2dbae" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "08179c1f-501e-0120-5b4d-4e7e4d000000", + "Body" : "jtcsetattributesiajtcsetattributesia189608499d330175354b47b29Mon, 29 Jun 2020 19:46:23 GMT\"0x8D81C651A4A3BEF\"unlockedavailable$account-encryption-keyfalsefalsefalsejtcsetattributesia2126696cd46c7020b3461cbe6Mon, 29 Jun 2020 19:46:23 GMT\"0x8D81C651A798B64\"unlockedavailable$account-encryption-keyfalsefalsefalse", + "Date" : "Mon, 29 Jun 2020 19:46:22 GMT", + "x-ms-client-request-id" : "5225e43a-9496-4a0b-8629-d5a07ac2dbae", + "Content-Type" : "application/xml" + }, + "Exception" : null + }, { + "Method" : "DELETE", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcsetattributesia189608499d330175354b47b29?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "375015d7-b06e-4b39-83d2-c2640b0e540b" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "202", + "x-ms-request-id" : "5dc83080-201e-012f-134d-4e93bb000000", + "Date" : "Mon, 29 Jun 2020 19:46:23 GMT", + "x-ms-client-request-id" : "375015d7-b06e-4b39-83d2-c2640b0e540b" + }, + "Exception" : null + }, { + "Method" : "DELETE", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcsetattributesia2126696cd46c7020b3461cbe6?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "034da564-1ae9-4ad3-9902-eb188c77e76a" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "202", + "x-ms-request-id" : "b86111a9-201e-00c5-4f4d-4e2aef000000", + "Date" : "Mon, 29 Jun 2020 19:46:23 GMT", + "x-ms-client-request-id" : "034da564-1ae9-4ad3-9902-eb188c77e76a" + }, + "Exception" : null + } ], + "variables" : [ "jtcsetattributesia047710d7f5d19b926145b5afb", "jtcsetattributesia189608499d330175354b47b29", "jtcsetattributesia2126696cd46c7020b3461cbe6", "javablobsetattributesia345110b3ee9bcef06c4f1e9" ] +} \ No newline at end of file diff --git a/sdk/storage/azure-storage-blob-nio/src/test/resources/session-records/AzureFileSystemProviderTestsetattributesia[2].json b/sdk/storage/azure-storage-blob-nio/src/test/resources/session-records/AzureFileSystemProviderTestsetattributesia[2].json new file mode 100644 index 0000000000000..e79a2cc8374ac --- /dev/null +++ b/sdk/storage/azure-storage-blob-nio/src/test/resources/session-records/AzureFileSystemProviderTestsetattributesia[2].json @@ -0,0 +1,149 @@ +{ + "networkCallRecords" : [ { + "Method" : "GET", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcsetattributesia1097105d22c32fd1d94491a14?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "adabd76d-e150-4901-8234-a198c60f1649" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-error-code" : "ContainerNotFound", + "retry-after" : "0", + "Content-Length" : "225", + "StatusCode" : "404", + "x-ms-request-id" : "1d82f792-101e-00ab-324d-4e83c6000000", + "Body" : "ContainerNotFoundThe specified container does not exist.\nRequestId:1d82f792-101e-00ab-324d-4e83c6000000\nTime:2020-06-29T19:46:24.1097423Z", + "Date" : "Mon, 29 Jun 2020 19:46:23 GMT", + "x-ms-client-request-id" : "adabd76d-e150-4901-8234-a198c60f1649", + "Content-Type" : "application/xml" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcsetattributesia1097105d22c32fd1d94491a14?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "b74be643-8b03-41e3-8062-352c642751c2" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "ETag" : "0x8D81C651AFC7B60", + "Last-Modified" : "Mon, 29 Jun 2020 19:46:24 GMT", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "bc400346-b01e-002e-2a4d-4ed413000000", + "Date" : "Mon, 29 Jun 2020 19:46:23 GMT", + "x-ms-client-request-id" : "b74be643-8b03-41e3-8062-352c642751c2" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcsetattributesia212576b9ef23cd182c45ee888?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "09a5d45e-cea9-4507-a140-ec9099671eb7" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-error-code" : "ContainerNotFound", + "retry-after" : "0", + "Content-Length" : "225", + "StatusCode" : "404", + "x-ms-request-id" : "74b75b91-801e-00c8-254d-4ec5e3000000", + "Body" : "ContainerNotFoundThe specified container does not exist.\nRequestId:74b75b91-801e-00c8-254d-4ec5e3000000\nTime:2020-06-29T19:46:24.4737862Z", + "Date" : "Mon, 29 Jun 2020 19:46:23 GMT", + "x-ms-client-request-id" : "09a5d45e-cea9-4507-a140-ec9099671eb7", + "Content-Type" : "application/xml" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcsetattributesia212576b9ef23cd182c45ee888?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "f41d9259-1a7e-40cc-8904-e5e9409d5df5" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "ETag" : "0x8D81C651B2FE432", + "Last-Modified" : "Mon, 29 Jun 2020 19:46:24 GMT", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "0ba9ee25-f01e-0126-3a4d-4e8935000000", + "Date" : "Mon, 29 Jun 2020 19:46:23 GMT", + "x-ms-client-request-id" : "f41d9259-1a7e-40cc-8904-e5e9409d5df5" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.blob.core.windows.net?prefix=jtcsetattributesia&comp=list", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "2f6c30a0-cfc6-42c8-9286-00996a266d04" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "dbd2f875-301e-0095-014d-4e35e7000000", + "Body" : "jtcsetattributesiajtcsetattributesia1097105d22c32fd1d94491a14Mon, 29 Jun 2020 19:46:24 GMT\"0x8D81C651AFC7B60\"unlockedavailable$account-encryption-keyfalsefalsefalsejtcsetattributesia212576b9ef23cd182c45ee888Mon, 29 Jun 2020 19:46:24 GMT\"0x8D81C651B2FE432\"unlockedavailable$account-encryption-keyfalsefalsefalse", + "Date" : "Mon, 29 Jun 2020 19:46:24 GMT", + "x-ms-client-request-id" : "2f6c30a0-cfc6-42c8-9286-00996a266d04", + "Content-Type" : "application/xml" + }, + "Exception" : null + }, { + "Method" : "DELETE", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcsetattributesia1097105d22c32fd1d94491a14?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "b3aaa4a9-21d9-48f1-a9e7-e61df300e4ce" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "202", + "x-ms-request-id" : "5203057b-b01e-00cb-294d-4ec6e4000000", + "Date" : "Mon, 29 Jun 2020 19:46:24 GMT", + "x-ms-client-request-id" : "b3aaa4a9-21d9-48f1-a9e7-e61df300e4ce" + }, + "Exception" : null + }, { + "Method" : "DELETE", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcsetattributesia212576b9ef23cd182c45ee888?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "ed6e3228-9817-4082-b18b-c47a46e881c6" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "202", + "x-ms-request-id" : "10ce243b-601e-0101-694d-4e137c000000", + "Date" : "Mon, 29 Jun 2020 19:46:24 GMT", + "x-ms-client-request-id" : "ed6e3228-9817-4082-b18b-c47a46e881c6" + }, + "Exception" : null + } ], + "variables" : [ "jtcsetattributesia015307cfecd7b5676b4099850", "jtcsetattributesia1097105d22c32fd1d94491a14", "jtcsetattributesia212576b9ef23cd182c45ee888", "javablobsetattributesia30885792ae4c6d643a4d59a" ] +} \ No newline at end of file diff --git a/sdk/storage/azure-storage-blob-nio/src/test/resources/session-records/AzureFileSystemProviderTestsetattributesinvalidview.json b/sdk/storage/azure-storage-blob-nio/src/test/resources/session-records/AzureFileSystemProviderTestsetattributesinvalidview.json new file mode 100644 index 0000000000000..c85b6c43c6e95 --- /dev/null +++ b/sdk/storage/azure-storage-blob-nio/src/test/resources/session-records/AzureFileSystemProviderTestsetattributesinvalidview.json @@ -0,0 +1,149 @@ +{ + "networkCallRecords" : [ { + "Method" : "GET", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcsetattributesinvalidview10195996dce7a2667c456?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "56024e7d-127d-4ccf-8af7-29519bc8780c" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-error-code" : "ContainerNotFound", + "retry-after" : "0", + "Content-Length" : "225", + "StatusCode" : "404", + "x-ms-request-id" : "718cb782-301e-0070-2a4d-4e2710000000", + "Body" : "ContainerNotFoundThe specified container does not exist.\nRequestId:718cb782-301e-0070-2a4d-4e2710000000\nTime:2020-06-29T19:46:25.2902253Z", + "Date" : "Mon, 29 Jun 2020 19:46:24 GMT", + "x-ms-client-request-id" : "56024e7d-127d-4ccf-8af7-29519bc8780c", + "Content-Type" : "application/xml" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcsetattributesinvalidview10195996dce7a2667c456?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "4f34ae47-08f6-45fa-a1d8-221d64f1664a" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "ETag" : "0x8D81C651BAB80D1", + "Last-Modified" : "Mon, 29 Jun 2020 19:46:25 GMT", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "9fd30435-701e-0092-7a4d-4ec362000000", + "Date" : "Mon, 29 Jun 2020 19:46:24 GMT", + "x-ms-client-request-id" : "4f34ae47-08f6-45fa-a1d8-221d64f1664a" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcsetattributesinvalidview239979f211dd4a30334ec?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "970f8af5-e479-4cf9-8961-24a83e82cfbf" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-error-code" : "ContainerNotFound", + "retry-after" : "0", + "Content-Length" : "225", + "StatusCode" : "404", + "x-ms-request-id" : "905e3889-001e-0051-4c4d-4e4a21000000", + "Body" : "ContainerNotFoundThe specified container does not exist.\nRequestId:905e3889-001e-0051-4c4d-4e4a21000000\nTime:2020-06-29T19:46:25.6061533Z", + "Date" : "Mon, 29 Jun 2020 19:46:25 GMT", + "x-ms-client-request-id" : "970f8af5-e479-4cf9-8961-24a83e82cfbf", + "Content-Type" : "application/xml" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcsetattributesinvalidview239979f211dd4a30334ec?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "9377ae76-07b3-47d9-8304-84e9dba8e9f9" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "ETag" : "0x8D81C651BDFADA6", + "Last-Modified" : "Mon, 29 Jun 2020 19:46:25 GMT", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "e400634d-601e-00eb-794d-4eaa28000000", + "Date" : "Mon, 29 Jun 2020 19:46:25 GMT", + "x-ms-client-request-id" : "9377ae76-07b3-47d9-8304-84e9dba8e9f9" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.blob.core.windows.net?prefix=jtcsetattributesinvalidview&comp=list", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "b1a0c7b3-1937-4f81-af15-01292c731d56" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "9ef3506c-f01e-006d-234d-4efefa000000", + "Body" : "jtcsetattributesinvalidviewjtcsetattributesinvalidview10195996dce7a2667c456Mon, 29 Jun 2020 19:46:25 GMT\"0x8D81C651BAB80D1\"unlockedavailable$account-encryption-keyfalsefalsefalsejtcsetattributesinvalidview239979f211dd4a30334ecMon, 29 Jun 2020 19:46:25 GMT\"0x8D81C651BDFADA6\"unlockedavailable$account-encryption-keyfalsefalsefalse", + "Date" : "Mon, 29 Jun 2020 19:46:25 GMT", + "x-ms-client-request-id" : "b1a0c7b3-1937-4f81-af15-01292c731d56", + "Content-Type" : "application/xml" + }, + "Exception" : null + }, { + "Method" : "DELETE", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcsetattributesinvalidview10195996dce7a2667c456?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "b2a1a9a3-9657-4f43-b1dc-607c8882471b" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "202", + "x-ms-request-id" : "54ababd7-601e-0068-554d-4e0a85000000", + "Date" : "Mon, 29 Jun 2020 19:46:25 GMT", + "x-ms-client-request-id" : "b2a1a9a3-9657-4f43-b1dc-607c8882471b" + }, + "Exception" : null + }, { + "Method" : "DELETE", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcsetattributesinvalidview239979f211dd4a30334ec?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "f12a485b-e273-40c0-b9b2-014eef7b2337" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "202", + "x-ms-request-id" : "830b54e3-401e-0116-164d-4ed31f000000", + "Date" : "Mon, 29 Jun 2020 19:46:25 GMT", + "x-ms-client-request-id" : "f12a485b-e273-40c0-b9b2-014eef7b2337" + }, + "Exception" : null + } ], + "variables" : [ "jtcsetattributesinvalidview03556455e76d600eee417", "jtcsetattributesinvalidview10195996dce7a2667c456", "jtcsetattributesinvalidview239979f211dd4a30334ec", "javablobsetattributesinvalidview31079768cb82c94fdc" ] +} \ No newline at end of file diff --git a/sdk/storage/azure-storage-blob-nio/src/test/resources/session-records/AzureFileSystemProviderTestsetattributesioexception.json b/sdk/storage/azure-storage-blob-nio/src/test/resources/session-records/AzureFileSystemProviderTestsetattributesioexception.json new file mode 100644 index 0000000000000..2594f31bbeb5b --- /dev/null +++ b/sdk/storage/azure-storage-blob-nio/src/test/resources/session-records/AzureFileSystemProviderTestsetattributesioexception.json @@ -0,0 +1,171 @@ +{ + "networkCallRecords" : [ { + "Method" : "GET", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcsetattributesioexception13246557fd78d1281e4e7?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "e0f3a2a6-11df-4094-807c-921331950359" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-error-code" : "ContainerNotFound", + "retry-after" : "0", + "Content-Length" : "225", + "StatusCode" : "404", + "x-ms-request-id" : "cb0141d9-401e-005d-474d-4ea4d0000000", + "Body" : "ContainerNotFoundThe specified container does not exist.\nRequestId:cb0141d9-401e-005d-474d-4ea4d0000000\nTime:2020-06-29T19:46:26.4552276Z", + "Date" : "Mon, 29 Jun 2020 19:46:25 GMT", + "x-ms-client-request-id" : "e0f3a2a6-11df-4094-807c-921331950359", + "Content-Type" : "application/xml" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcsetattributesioexception13246557fd78d1281e4e7?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "35cd546b-c07e-406e-8460-4edec5e8c835" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "ETag" : "0x8D81C651C5C3834", + "Last-Modified" : "Mon, 29 Jun 2020 19:46:26 GMT", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "d743a70f-101e-0105-584d-4ee6fe000000", + "Date" : "Mon, 29 Jun 2020 19:46:25 GMT", + "x-ms-client-request-id" : "35cd546b-c07e-406e-8460-4edec5e8c835" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcsetattributesioexception297532009d1c1bcd324c1?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "813f297f-1b80-4603-82f3-90c5b638ce28" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-error-code" : "ContainerNotFound", + "retry-after" : "0", + "Content-Length" : "225", + "StatusCode" : "404", + "x-ms-request-id" : "2205a733-601e-0128-384d-4e653e000000", + "Body" : "ContainerNotFoundThe specified container does not exist.\nRequestId:2205a733-601e-0128-384d-4e653e000000\nTime:2020-06-29T19:46:26.7623851Z", + "Date" : "Mon, 29 Jun 2020 19:46:26 GMT", + "x-ms-client-request-id" : "813f297f-1b80-4603-82f3-90c5b638ce28", + "Content-Type" : "application/xml" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcsetattributesioexception297532009d1c1bcd324c1?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "45ba9e32-8625-4b69-b6b3-f3e34d0070d6" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "ETag" : "0x8D81C651C8E23F5", + "Last-Modified" : "Mon, 29 Jun 2020 19:46:26 GMT", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "8a1f8208-901e-0032-6f4d-4e0c04000000", + "Date" : "Mon, 29 Jun 2020 19:46:26 GMT", + "x-ms-client-request-id" : "45ba9e32-8625-4b69-b6b3-f3e34d0070d6" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcsetattributesioexception13246557fd78d1281e4e7/path?comp=metadata", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "e0bb7c7d-a5fa-4b20-a748-6e0d517c4c18" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-error-code" : "BlobNotFound", + "retry-after" : "0", + "Content-Length" : "215", + "StatusCode" : "404", + "x-ms-request-id" : "b3f58cf0-b01e-0108-294d-4e09f2000000", + "Body" : "BlobNotFoundThe specified blob does not exist.\nRequestId:b3f58cf0-b01e-0108-294d-4e09f2000000\nTime:2020-06-29T19:46:27.0966509Z", + "Date" : "Mon, 29 Jun 2020 19:46:26 GMT", + "x-ms-client-request-id" : "e0bb7c7d-a5fa-4b20-a748-6e0d517c4c18", + "Content-Type" : "application/xml" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.blob.core.windows.net?prefix=jtcsetattributesioexception&comp=list", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "fc00eec3-6989-41c0-833b-4ba793b73c73" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "1259689e-b01e-0103-2f4d-4e1186000000", + "Body" : "jtcsetattributesioexceptionjtcsetattributesioexception13246557fd78d1281e4e7Mon, 29 Jun 2020 19:46:26 GMT\"0x8D81C651C5C3834\"unlockedavailable$account-encryption-keyfalsefalsefalsejtcsetattributesioexception297532009d1c1bcd324c1Mon, 29 Jun 2020 19:46:26 GMT\"0x8D81C651C8E23F5\"unlockedavailable$account-encryption-keyfalsefalsefalse", + "Date" : "Mon, 29 Jun 2020 19:46:27 GMT", + "x-ms-client-request-id" : "fc00eec3-6989-41c0-833b-4ba793b73c73", + "Content-Type" : "application/xml" + }, + "Exception" : null + }, { + "Method" : "DELETE", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcsetattributesioexception13246557fd78d1281e4e7?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "7b8b5e4d-115f-4c9b-9ec0-d54f816a7065" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "202", + "x-ms-request-id" : "e8a51b17-a01e-00fd-064d-4e6bb6000000", + "Date" : "Mon, 29 Jun 2020 19:46:27 GMT", + "x-ms-client-request-id" : "7b8b5e4d-115f-4c9b-9ec0-d54f816a7065" + }, + "Exception" : null + }, { + "Method" : "DELETE", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcsetattributesioexception297532009d1c1bcd324c1?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "c2eefbcb-7fa3-43c3-8cf3-3abd264ce104" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "202", + "x-ms-request-id" : "fa8de6a7-401e-00f7-7a4d-4e723f000000", + "Date" : "Mon, 29 Jun 2020 19:46:26 GMT", + "x-ms-client-request-id" : "c2eefbcb-7fa3-43c3-8cf3-3abd264ce104" + }, + "Exception" : null + } ], + "variables" : [ "jtcsetattributesioexception03109155dc124b9bdb446", "jtcsetattributesioexception13246557fd78d1281e4e7", "jtcsetattributesioexception297532009d1c1bcd324c1" ] +} \ No newline at end of file diff --git a/sdk/storage/azure-storage-blob-nio/src/test/resources/session-records/AzureFileSystemProviderTestsetattributesmetadata[0].json b/sdk/storage/azure-storage-blob-nio/src/test/resources/session-records/AzureFileSystemProviderTestsetattributesmetadata[0].json new file mode 100644 index 0000000000000..01844f4cd605d --- /dev/null +++ b/sdk/storage/azure-storage-blob-nio/src/test/resources/session-records/AzureFileSystemProviderTestsetattributesmetadata[0].json @@ -0,0 +1,248 @@ +{ + "networkCallRecords" : [ { + "Method" : "GET", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcsetattributesmetadata1311914e9520535e7941f7?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "275de155-7ef2-4aac-8555-0ed20cb0b6a2" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-error-code" : "ContainerNotFound", + "retry-after" : "0", + "Content-Length" : "225", + "StatusCode" : "404", + "x-ms-request-id" : "37401f95-601e-002c-2d4d-4ed6e9000000", + "Body" : "ContainerNotFoundThe specified container does not exist.\nRequestId:37401f95-601e-002c-2d4d-4ed6e9000000\nTime:2020-06-29T19:46:11.1587958Z", + "Date" : "Mon, 29 Jun 2020 19:46:10 GMT", + "x-ms-client-request-id" : "275de155-7ef2-4aac-8555-0ed20cb0b6a2", + "Content-Type" : "application/xml" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcsetattributesmetadata1311914e9520535e7941f7?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "002ba182-c514-4c23-a481-e1d8d3c7e814" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "ETag" : "0x8D81C651340D21D", + "Last-Modified" : "Mon, 29 Jun 2020 19:46:11 GMT", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "9d0ce495-901e-0076-654d-4ed068000000", + "Date" : "Mon, 29 Jun 2020 19:46:10 GMT", + "x-ms-client-request-id" : "002ba182-c514-4c23-a481-e1d8d3c7e814" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcsetattributesmetadata228246a7ce7818ff554076?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "a8d8d1e2-4ceb-4c83-bdff-ed36cff3176a" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-error-code" : "ContainerNotFound", + "retry-after" : "0", + "Content-Length" : "225", + "StatusCode" : "404", + "x-ms-request-id" : "dae87fd7-c01e-0021-304d-4e39e5000000", + "Body" : "ContainerNotFoundThe specified container does not exist.\nRequestId:dae87fd7-c01e-0021-304d-4e39e5000000\nTime:2020-06-29T19:46:11.4780606Z", + "Date" : "Mon, 29 Jun 2020 19:46:10 GMT", + "x-ms-client-request-id" : "a8d8d1e2-4ceb-4c83-bdff-ed36cff3176a", + "Content-Type" : "application/xml" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcsetattributesmetadata228246a7ce7818ff554076?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "a7fd3177-e609-4d69-ae7e-dd913a6028b5" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "ETag" : "0x8D81C65136FCA51", + "Last-Modified" : "Mon, 29 Jun 2020 19:46:11 GMT", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "74e2ff42-b01e-0007-024d-4ea251000000", + "Date" : "Mon, 29 Jun 2020 19:46:10 GMT", + "x-ms-client-request-id" : "a7fd3177-e609-4d69-ae7e-dd913a6028b5" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcsetattributesmetadata1311914e9520535e7941f7?prefix=javablobsetattributesmetadata373507c87ccd01513d42&delimiter=/&maxresults=2&include=metadata&restype=container&comp=list", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "64dce5ec-022e-4abb-9f24-1f55ac357034" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "4988749b-c01e-002a-314d-4e2191000000", + "Body" : "javablobsetattributesmetadata373507c87ccd01513d422/", + "Date" : "Mon, 29 Jun 2020 19:46:11 GMT", + "x-ms-client-request-id" : "64dce5ec-022e-4abb-9f24-1f55ac357034", + "Content-Type" : "application/xml" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcsetattributesmetadata1311914e9520535e7941f7/javablobsetattributesmetadata373507c87ccd01513d42", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "e8ccb93d-ab33-48de-bc6e-a3080d80cf49", + "Content-Type" : "application/octet-stream" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-content-crc64" : "AAAAAAAAAAA=", + "Last-Modified" : "Mon, 29 Jun 2020 19:46:11 GMT", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-server-encrypted" : "true", + "Date" : "Mon, 29 Jun 2020 19:46:11 GMT", + "Content-MD5" : "1B2M2Y8AsgTpgAmY7PhCfg==", + "ETag" : "0x8D81C65139DC027", + "Content-Length" : "0", + "x-ms-request-id" : "f9c65c16-901e-0010-114d-4e6232000000", + "x-ms-client-request-id" : "e8ccb93d-ab33-48de-bc6e-a3080d80cf49" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcsetattributesmetadata1311914e9520535e7941f7/javablobsetattributesmetadata373507c87ccd01513d42?comp=metadata", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "e46c5681-5e92-4a6f-9acd-d2c552dfd160" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "ETag" : "0x8D81C6513B7193A", + "Last-Modified" : "Mon, 29 Jun 2020 19:46:12 GMT", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "2ed50b2b-101e-010e-6c4d-4efe8a000000", + "x-ms-request-server-encrypted" : "true", + "Date" : "Mon, 29 Jun 2020 19:46:11 GMT", + "x-ms-client-request-id" : "e46c5681-5e92-4a6f-9acd-d2c552dfd160" + }, + "Exception" : null + }, { + "Method" : "HEAD", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcsetattributesmetadata1311914e9520535e7941f7/javablobsetattributesmetadata373507c87ccd01513d42", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "afe9dfdf-15d5-402b-b772-d4fcf1d42727" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "x-ms-lease-status" : "unlocked", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-lease-state" : "available", + "Last-Modified" : "Mon, 29 Jun 2020 19:46:12 GMT", + "retry-after" : "0", + "StatusCode" : "200", + "Date" : "Mon, 29 Jun 2020 19:46:11 GMT", + "x-ms-blob-type" : "BlockBlob", + "Content-MD5" : "1B2M2Y8AsgTpgAmY7PhCfg==", + "Accept-Ranges" : "bytes", + "x-ms-server-encrypted" : "true", + "x-ms-access-tier-inferred" : "true", + "x-ms-access-tier" : "Hot", + "ETag" : "0x8D81C6513B7193A", + "x-ms-creation-time" : "Mon, 29 Jun 2020 19:46:11 GMT", + "Content-Length" : "0", + "x-ms-request-id" : "344d94d4-801e-00a5-5f4d-4e6fcd000000", + "x-ms-client-request-id" : "afe9dfdf-15d5-402b-b772-d4fcf1d42727", + "Content-Type" : "application/octet-stream" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.blob.core.windows.net?prefix=jtcsetattributesmetadata&comp=list", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "e230c591-71ff-4f2c-91f8-388ff1692a3a" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "464ecc53-501e-012b-694d-4e6639000000", + "Body" : "jtcsetattributesmetadatajtcsetattributesmetadata1311914e9520535e7941f7Mon, 29 Jun 2020 19:46:11 GMT\"0x8D81C651340D21D\"unlockedavailable$account-encryption-keyfalsefalsefalsejtcsetattributesmetadata228246a7ce7818ff554076Mon, 29 Jun 2020 19:46:11 GMT\"0x8D81C65136FCA51\"unlockedavailable$account-encryption-keyfalsefalsefalse", + "Date" : "Mon, 29 Jun 2020 19:46:11 GMT", + "x-ms-client-request-id" : "e230c591-71ff-4f2c-91f8-388ff1692a3a", + "Content-Type" : "application/xml" + }, + "Exception" : null + }, { + "Method" : "DELETE", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcsetattributesmetadata1311914e9520535e7941f7?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "46f0a37f-cf9d-4984-bd8c-b1091a82a370" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "202", + "x-ms-request-id" : "b9f0c41d-e01e-0139-344d-4e5225000000", + "Date" : "Mon, 29 Jun 2020 19:46:12 GMT", + "x-ms-client-request-id" : "46f0a37f-cf9d-4984-bd8c-b1091a82a370" + }, + "Exception" : null + }, { + "Method" : "DELETE", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcsetattributesmetadata228246a7ce7818ff554076?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "d4b9842a-f98e-4f09-a3d0-841f50fb84a1" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "202", + "x-ms-request-id" : "4486704f-101e-006c-6c4d-4eff07000000", + "Date" : "Mon, 29 Jun 2020 19:46:12 GMT", + "x-ms-client-request-id" : "d4b9842a-f98e-4f09-a3d0-841f50fb84a1" + }, + "Exception" : null + } ], + "variables" : [ "jtcsetattributesmetadata082602b72d220f87d742e7", "jtcsetattributesmetadata1311914e9520535e7941f7", "jtcsetattributesmetadata228246a7ce7818ff554076", "javablobsetattributesmetadata373507c87ccd01513d42" ] +} \ No newline at end of file diff --git a/sdk/storage/azure-storage-blob-nio/src/test/resources/session-records/AzureFileSystemProviderTestsetattributesmetadata[1].json b/sdk/storage/azure-storage-blob-nio/src/test/resources/session-records/AzureFileSystemProviderTestsetattributesmetadata[1].json new file mode 100644 index 0000000000000..7bec711cb4a43 --- /dev/null +++ b/sdk/storage/azure-storage-blob-nio/src/test/resources/session-records/AzureFileSystemProviderTestsetattributesmetadata[1].json @@ -0,0 +1,250 @@ +{ + "networkCallRecords" : [ { + "Method" : "GET", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcsetattributesmetadata196747e58e60b41a2645d4?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "63bcb1fa-4740-4dee-894c-be6691ebf8c0" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-error-code" : "ContainerNotFound", + "retry-after" : "0", + "Content-Length" : "225", + "StatusCode" : "404", + "x-ms-request-id" : "0f9e28b4-c01e-00a2-0d4d-4e9948000000", + "Body" : "ContainerNotFoundThe specified container does not exist.\nRequestId:0f9e28b4-c01e-00a2-0d4d-4e9948000000\nTime:2020-06-29T19:46:13.1023701Z", + "Date" : "Mon, 29 Jun 2020 19:46:12 GMT", + "x-ms-client-request-id" : "63bcb1fa-4740-4dee-894c-be6691ebf8c0", + "Content-Type" : "application/xml" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcsetattributesmetadata196747e58e60b41a2645d4?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "41e8e88b-7f70-4c8e-86b9-12c9d6888906" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "ETag" : "0x8D81C651467AF50", + "Last-Modified" : "Mon, 29 Jun 2020 19:46:13 GMT", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "12d6dd8f-201e-00ec-4a4d-4e5cad000000", + "Date" : "Mon, 29 Jun 2020 19:46:12 GMT", + "x-ms-client-request-id" : "41e8e88b-7f70-4c8e-86b9-12c9d6888906" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcsetattributesmetadata272618ac80c21c9cbe47f5?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "44a50224-1e3a-4823-9a44-cf6454bacb42" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-error-code" : "ContainerNotFound", + "retry-after" : "0", + "Content-Length" : "225", + "StatusCode" : "404", + "x-ms-request-id" : "fa3f7bcf-701e-0137-6a4d-4ebe2e000000", + "Body" : "ContainerNotFoundThe specified container does not exist.\nRequestId:fa3f7bcf-701e-0137-6a4d-4ebe2e000000\nTime:2020-06-29T19:46:13.4434999Z", + "Date" : "Mon, 29 Jun 2020 19:46:12 GMT", + "x-ms-client-request-id" : "44a50224-1e3a-4823-9a44-cf6454bacb42", + "Content-Type" : "application/xml" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcsetattributesmetadata272618ac80c21c9cbe47f5?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "204aacd3-de14-4c33-af35-29d321b473c7" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "ETag" : "0x8D81C65149B277B", + "Last-Modified" : "Mon, 29 Jun 2020 19:46:13 GMT", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "d18f3c42-a01e-00b9-334d-4eb7da000000", + "Date" : "Mon, 29 Jun 2020 19:46:13 GMT", + "x-ms-client-request-id" : "204aacd3-de14-4c33-af35-29d321b473c7" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcsetattributesmetadata196747e58e60b41a2645d4?prefix=javablobsetattributesmetadata3748048f5c4070dd334c&delimiter=/&maxresults=2&include=metadata&restype=container&comp=list", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "dd23ddab-10b5-4d2d-ac63-dac127504d2a" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "98e7a47e-f01e-0000-6d4d-4e54d4000000", + "Body" : "javablobsetattributesmetadata3748048f5c4070dd334c2/", + "Date" : "Mon, 29 Jun 2020 19:46:12 GMT", + "x-ms-client-request-id" : "dd23ddab-10b5-4d2d-ac63-dac127504d2a", + "Content-Type" : "application/xml" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcsetattributesmetadata196747e58e60b41a2645d4/javablobsetattributesmetadata3748048f5c4070dd334c", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "81f7ed01-89bb-4dbb-9822-196b2d4585d7", + "Content-Type" : "application/octet-stream" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-content-crc64" : "AAAAAAAAAAA=", + "Last-Modified" : "Mon, 29 Jun 2020 19:46:13 GMT", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-server-encrypted" : "true", + "Date" : "Mon, 29 Jun 2020 19:46:13 GMT", + "Content-MD5" : "1B2M2Y8AsgTpgAmY7PhCfg==", + "ETag" : "0x8D81C6514CC17F8", + "Content-Length" : "0", + "x-ms-request-id" : "5e6559e7-d01e-013a-2c4d-4e5122000000", + "x-ms-client-request-id" : "81f7ed01-89bb-4dbb-9822-196b2d4585d7" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcsetattributesmetadata196747e58e60b41a2645d4/javablobsetattributesmetadata3748048f5c4070dd334c?comp=metadata", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "f5be4230-e13b-4949-97a7-e5a382ce53a5" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "ETag" : "0x8D81C6514E48684", + "Last-Modified" : "Mon, 29 Jun 2020 19:46:14 GMT", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "93f0515d-d01e-0058-484d-4e50af000000", + "x-ms-request-server-encrypted" : "true", + "Date" : "Mon, 29 Jun 2020 19:46:13 GMT", + "x-ms-client-request-id" : "f5be4230-e13b-4949-97a7-e5a382ce53a5" + }, + "Exception" : null + }, { + "Method" : "HEAD", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcsetattributesmetadata196747e58e60b41a2645d4/javablobsetattributesmetadata3748048f5c4070dd334c", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "271baa3a-639e-4bdd-bcb9-75c4da19f8ec" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "x-ms-lease-status" : "unlocked", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-lease-state" : "available", + "Last-Modified" : "Mon, 29 Jun 2020 19:46:14 GMT", + "retry-after" : "0", + "StatusCode" : "200", + "Date" : "Mon, 29 Jun 2020 19:46:13 GMT", + "x-ms-meta-foo" : "bar", + "x-ms-blob-type" : "BlockBlob", + "Content-MD5" : "1B2M2Y8AsgTpgAmY7PhCfg==", + "Accept-Ranges" : "bytes", + "x-ms-server-encrypted" : "true", + "x-ms-access-tier-inferred" : "true", + "x-ms-access-tier" : "Hot", + "ETag" : "0x8D81C6514E48684", + "x-ms-creation-time" : "Mon, 29 Jun 2020 19:46:13 GMT", + "Content-Length" : "0", + "x-ms-request-id" : "a736c263-e01e-011b-6e4d-4e3c13000000", + "x-ms-meta-fizz" : "buzz", + "x-ms-client-request-id" : "271baa3a-639e-4bdd-bcb9-75c4da19f8ec", + "Content-Type" : "application/octet-stream" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.blob.core.windows.net?prefix=jtcsetattributesmetadata&comp=list", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "27679aa2-a967-4a89-9790-9d19dc4c8971" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "e0822f65-901e-0039-524d-4e1470000000", + "Body" : "jtcsetattributesmetadatajtcsetattributesmetadata196747e58e60b41a2645d4Mon, 29 Jun 2020 19:46:13 GMT\"0x8D81C651467AF50\"unlockedavailable$account-encryption-keyfalsefalsefalsejtcsetattributesmetadata272618ac80c21c9cbe47f5Mon, 29 Jun 2020 19:46:13 GMT\"0x8D81C65149B277B\"unlockedavailable$account-encryption-keyfalsefalsefalse", + "Date" : "Mon, 29 Jun 2020 19:46:14 GMT", + "x-ms-client-request-id" : "27679aa2-a967-4a89-9790-9d19dc4c8971", + "Content-Type" : "application/xml" + }, + "Exception" : null + }, { + "Method" : "DELETE", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcsetattributesmetadata196747e58e60b41a2645d4?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "56ed206e-2f80-4baf-84d7-b51e11e2cd6b" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "202", + "x-ms-request-id" : "d026ad7b-a01e-00d4-074d-4e1df4000000", + "Date" : "Mon, 29 Jun 2020 19:46:14 GMT", + "x-ms-client-request-id" : "56ed206e-2f80-4baf-84d7-b51e11e2cd6b" + }, + "Exception" : null + }, { + "Method" : "DELETE", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcsetattributesmetadata272618ac80c21c9cbe47f5?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "9bc5588c-a535-43b6-8e6c-8ed1b08c4b92" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "202", + "x-ms-request-id" : "d69336ed-701e-011e-704d-4ec86c000000", + "Date" : "Mon, 29 Jun 2020 19:46:14 GMT", + "x-ms-client-request-id" : "9bc5588c-a535-43b6-8e6c-8ed1b08c4b92" + }, + "Exception" : null + } ], + "variables" : [ "jtcsetattributesmetadata0478544438f0549bad48d4", "jtcsetattributesmetadata196747e58e60b41a2645d4", "jtcsetattributesmetadata272618ac80c21c9cbe47f5", "javablobsetattributesmetadata3748048f5c4070dd334c" ] +} \ No newline at end of file diff --git a/sdk/storage/azure-storage-blob-nio/src/test/resources/session-records/AzureFileSystemProviderTestsetattributesmetadata[2].json b/sdk/storage/azure-storage-blob-nio/src/test/resources/session-records/AzureFileSystemProviderTestsetattributesmetadata[2].json new file mode 100644 index 0000000000000..d33041f1cdf35 --- /dev/null +++ b/sdk/storage/azure-storage-blob-nio/src/test/resources/session-records/AzureFileSystemProviderTestsetattributesmetadata[2].json @@ -0,0 +1,250 @@ +{ + "networkCallRecords" : [ { + "Method" : "GET", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcsetattributesmetadata141366e01eb71353304929?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "6e9c5ee1-196a-4d0c-81d5-fa0aebbe9de0" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-error-code" : "ContainerNotFound", + "retry-after" : "0", + "Content-Length" : "225", + "StatusCode" : "404", + "x-ms-request-id" : "c56e1f54-101e-012c-4b4d-4e90bc000000", + "Body" : "ContainerNotFoundThe specified container does not exist.\nRequestId:c56e1f54-101e-012c-4b4d-4e90bc000000\nTime:2020-06-29T19:46:14.9113988Z", + "Date" : "Mon, 29 Jun 2020 19:46:14 GMT", + "x-ms-client-request-id" : "6e9c5ee1-196a-4d0c-81d5-fa0aebbe9de0", + "Content-Type" : "application/xml" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcsetattributesmetadata141366e01eb71353304929?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "89f8dcda-62f0-457a-bfc4-b468628cc137" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "ETag" : "0x8D81C65157C1E76", + "Last-Modified" : "Mon, 29 Jun 2020 19:46:15 GMT", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "4ed79c4c-901e-005f-294d-4ea62a000000", + "Date" : "Mon, 29 Jun 2020 19:46:14 GMT", + "x-ms-client-request-id" : "89f8dcda-62f0-457a-bfc4-b468628cc137" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcsetattributesmetadata2146885d426326a3664511?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "94a00740-7281-440f-affd-3ef1ab40e59c" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-error-code" : "ContainerNotFound", + "retry-after" : "0", + "Content-Length" : "225", + "StatusCode" : "404", + "x-ms-request-id" : "85bf0f9b-a01e-0135-244d-4ebcd4000000", + "Body" : "ContainerNotFoundThe specified container does not exist.\nRequestId:85bf0f9b-a01e-0135-244d-4ebcd4000000\nTime:2020-06-29T19:46:15.2443686Z", + "Date" : "Mon, 29 Jun 2020 19:46:14 GMT", + "x-ms-client-request-id" : "94a00740-7281-440f-affd-3ef1ab40e59c", + "Content-Type" : "application/xml" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcsetattributesmetadata2146885d426326a3664511?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "83b395b4-5cc1-42fa-8527-aa4f3f32198d" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "ETag" : "0x8D81C6515AE8A69", + "Last-Modified" : "Mon, 29 Jun 2020 19:46:15 GMT", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "38152eca-b01e-008f-3d4d-4e1a88000000", + "Date" : "Mon, 29 Jun 2020 19:46:14 GMT", + "x-ms-client-request-id" : "83b395b4-5cc1-42fa-8527-aa4f3f32198d" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcsetattributesmetadata141366e01eb71353304929?prefix=javablobsetattributesmetadata3672317595b94457274d&delimiter=/&maxresults=2&include=metadata&restype=container&comp=list", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "354153d1-6a90-4692-a214-c2ca1d4db14a" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "fc022a6a-101e-00c6-354d-4e29e8000000", + "Body" : "javablobsetattributesmetadata3672317595b94457274d2/", + "Date" : "Mon, 29 Jun 2020 19:46:14 GMT", + "x-ms-client-request-id" : "354153d1-6a90-4692-a214-c2ca1d4db14a", + "Content-Type" : "application/xml" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcsetattributesmetadata141366e01eb71353304929/javablobsetattributesmetadata3672317595b94457274d", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "06e66a70-5b32-4d09-9c34-e385927b4001", + "Content-Type" : "application/octet-stream" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-content-crc64" : "AAAAAAAAAAA=", + "Last-Modified" : "Mon, 29 Jun 2020 19:46:15 GMT", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-server-encrypted" : "true", + "Date" : "Mon, 29 Jun 2020 19:46:15 GMT", + "Content-MD5" : "1B2M2Y8AsgTpgAmY7PhCfg==", + "ETag" : "0x8D81C6515DCF781", + "Content-Length" : "0", + "x-ms-request-id" : "963e2eb3-501e-00e8-514d-4ea92f000000", + "x-ms-client-request-id" : "06e66a70-5b32-4d09-9c34-e385927b4001" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcsetattributesmetadata141366e01eb71353304929/javablobsetattributesmetadata3672317595b94457274d?comp=metadata", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "b5b8ac5e-57aa-4b92-bbff-0fee475f7f78" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "ETag" : "0x8D81C6515F3B80A", + "Last-Modified" : "Mon, 29 Jun 2020 19:46:15 GMT", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "8d3601e6-701e-001a-6a4d-4e7bbb000000", + "x-ms-request-server-encrypted" : "true", + "Date" : "Mon, 29 Jun 2020 19:46:15 GMT", + "x-ms-client-request-id" : "b5b8ac5e-57aa-4b92-bbff-0fee475f7f78" + }, + "Exception" : null + }, { + "Method" : "HEAD", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcsetattributesmetadata141366e01eb71353304929/javablobsetattributesmetadata3672317595b94457274d", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "a4e05a8a-a29c-44aa-909e-5f24db1e8a69" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "x-ms-lease-status" : "unlocked", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-lease-state" : "available", + "Last-Modified" : "Mon, 29 Jun 2020 19:46:15 GMT", + "retry-after" : "0", + "StatusCode" : "200", + "x-ms-meta-i_" : "a", + "Date" : "Mon, 29 Jun 2020 19:46:15 GMT", + "x-ms-blob-type" : "BlockBlob", + "Content-MD5" : "1B2M2Y8AsgTpgAmY7PhCfg==", + "Accept-Ranges" : "bytes", + "x-ms-server-encrypted" : "true", + "x-ms-access-tier-inferred" : "true", + "x-ms-access-tier" : "Hot", + "ETag" : "0x8D81C6515F3B80A", + "x-ms-creation-time" : "Mon, 29 Jun 2020 19:46:15 GMT", + "Content-Length" : "0", + "x-ms-meta-i0" : "a", + "x-ms-request-id" : "b4678826-e01e-0079-6c4d-4e3d9e000000", + "x-ms-client-request-id" : "a4e05a8a-a29c-44aa-909e-5f24db1e8a69", + "Content-Type" : "application/octet-stream" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.blob.core.windows.net?prefix=jtcsetattributesmetadata&comp=list", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "4ef005c7-a1f8-4c78-81ac-70288fc47e8a" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "8de971c6-601e-00af-154d-4e7644000000", + "Body" : "jtcsetattributesmetadatajtcsetattributesmetadata141366e01eb71353304929Mon, 29 Jun 2020 19:46:15 GMT\"0x8D81C65157C1E76\"unlockedavailable$account-encryption-keyfalsefalsefalsejtcsetattributesmetadata2146885d426326a3664511Mon, 29 Jun 2020 19:46:15 GMT\"0x8D81C6515AE8A69\"unlockedavailable$account-encryption-keyfalsefalsefalse", + "Date" : "Mon, 29 Jun 2020 19:46:16 GMT", + "x-ms-client-request-id" : "4ef005c7-a1f8-4c78-81ac-70288fc47e8a", + "Content-Type" : "application/xml" + }, + "Exception" : null + }, { + "Method" : "DELETE", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcsetattributesmetadata141366e01eb71353304929?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "2537a2c9-357a-4b80-9d71-32fcefae7c83" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "202", + "x-ms-request-id" : "c5bb8a62-101e-0082-024d-4ef584000000", + "Date" : "Mon, 29 Jun 2020 19:46:15 GMT", + "x-ms-client-request-id" : "2537a2c9-357a-4b80-9d71-32fcefae7c83" + }, + "Exception" : null + }, { + "Method" : "DELETE", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcsetattributesmetadata2146885d426326a3664511?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "a763c0b9-16ad-4d4f-b9b2-2a93de9253b1" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "202", + "x-ms-request-id" : "9b47d6cc-601e-00e0-014d-4eb25c000000", + "Date" : "Mon, 29 Jun 2020 19:46:16 GMT", + "x-ms-client-request-id" : "a763c0b9-16ad-4d4f-b9b2-2a93de9253b1" + }, + "Exception" : null + } ], + "variables" : [ "jtcsetattributesmetadata07353875b964b6b2b944a8", "jtcsetattributesmetadata141366e01eb71353304929", "jtcsetattributesmetadata2146885d426326a3664511", "javablobsetattributesmetadata3672317595b94457274d" ] +} \ No newline at end of file diff --git a/sdk/storage/azure-storage-blob-nio/src/test/resources/session-records/AzureFileSystemProviderTestsetattributestier[0].json b/sdk/storage/azure-storage-blob-nio/src/test/resources/session-records/AzureFileSystemProviderTestsetattributestier[0].json new file mode 100644 index 0000000000000..8f38ca076108e --- /dev/null +++ b/sdk/storage/azure-storage-blob-nio/src/test/resources/session-records/AzureFileSystemProviderTestsetattributestier[0].json @@ -0,0 +1,245 @@ +{ + "networkCallRecords" : [ { + "Method" : "GET", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcsetattributestier176543170d623ad8ca4c8189?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "343963db-741d-42c2-900d-9a40468af16c" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-error-code" : "ContainerNotFound", + "retry-after" : "0", + "Content-Length" : "225", + "StatusCode" : "404", + "x-ms-request-id" : "0aee2122-a01e-00b2-014d-4eafae000000", + "Body" : "ContainerNotFoundThe specified container does not exist.\nRequestId:0aee2122-a01e-00b2-014d-4eafae000000\nTime:2020-06-29T19:46:16.7075047Z", + "Date" : "Mon, 29 Jun 2020 19:46:16 GMT", + "x-ms-client-request-id" : "343963db-741d-42c2-900d-9a40468af16c", + "Content-Type" : "application/xml" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcsetattributestier176543170d623ad8ca4c8189?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "1418d70a-7466-4ab8-89a7-29497bd59c1f" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "ETag" : "0x8D81C651691AFF7", + "Last-Modified" : "Mon, 29 Jun 2020 19:46:16 GMT", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "97221a66-b01e-00e9-154d-4ea8d2000000", + "Date" : "Mon, 29 Jun 2020 19:46:16 GMT", + "x-ms-client-request-id" : "1418d70a-7466-4ab8-89a7-29497bd59c1f" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcsetattributestier230215e86c170cccf34365ad?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "8b538eeb-405e-4d59-aa70-5005931f1885" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-error-code" : "ContainerNotFound", + "retry-after" : "0", + "Content-Length" : "225", + "StatusCode" : "404", + "x-ms-request-id" : "f3a61ec8-901e-011f-364d-4ec991000000", + "Body" : "ContainerNotFoundThe specified container does not exist.\nRequestId:f3a61ec8-901e-011f-364d-4ec991000000\nTime:2020-06-29T19:46:17.0484707Z", + "Date" : "Mon, 29 Jun 2020 19:46:16 GMT", + "x-ms-client-request-id" : "8b538eeb-405e-4d59-aa70-5005931f1885", + "Content-Type" : "application/xml" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcsetattributestier230215e86c170cccf34365ad?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "a1c8f333-0f2c-47d6-aa21-bab60afcf100" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "ETag" : "0x8D81C6516C1D0F9", + "Last-Modified" : "Mon, 29 Jun 2020 19:46:17 GMT", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "1ec194f7-001e-0015-1b4d-4e964d000000", + "Date" : "Mon, 29 Jun 2020 19:46:16 GMT", + "x-ms-client-request-id" : "a1c8f333-0f2c-47d6-aa21-bab60afcf100" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcsetattributestier176543170d623ad8ca4c8189?prefix=javablobsetattributestier379276d28bd9a0f26a463f&delimiter=/&maxresults=2&include=metadata&restype=container&comp=list", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "ed94f1bf-e623-4f27-be72-c681f7b27962" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "5bc8c390-701e-00b0-774d-4ead54000000", + "Body" : "javablobsetattributestier379276d28bd9a0f26a463f2/", + "Date" : "Mon, 29 Jun 2020 19:46:16 GMT", + "x-ms-client-request-id" : "ed94f1bf-e623-4f27-be72-c681f7b27962", + "Content-Type" : "application/xml" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcsetattributestier176543170d623ad8ca4c8189/javablobsetattributestier379276d28bd9a0f26a463f", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "fe6f1a5c-ea70-4522-8926-b11f38ef3773", + "Content-Type" : "application/octet-stream" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-content-crc64" : "AAAAAAAAAAA=", + "Last-Modified" : "Mon, 29 Jun 2020 19:46:17 GMT", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-server-encrypted" : "true", + "Date" : "Mon, 29 Jun 2020 19:46:16 GMT", + "Content-MD5" : "1B2M2Y8AsgTpgAmY7PhCfg==", + "ETag" : "0x8D81C6516F10BB8", + "Content-Length" : "0", + "x-ms-request-id" : "d1893959-e01e-00fa-044d-4e9d33000000", + "x-ms-client-request-id" : "fe6f1a5c-ea70-4522-8926-b11f38ef3773" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcsetattributestier176543170d623ad8ca4c8189/javablobsetattributestier379276d28bd9a0f26a463f?comp=tier", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "3d29e599-ffb6-4d7a-a43b-254097a838f9" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "2dcb72f0-501e-0109-694d-4e080f000000", + "Date" : "Mon, 29 Jun 2020 19:46:17 GMT", + "x-ms-client-request-id" : "3d29e599-ffb6-4d7a-a43b-254097a838f9" + }, + "Exception" : null + }, { + "Method" : "HEAD", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcsetattributestier176543170d623ad8ca4c8189/javablobsetattributestier379276d28bd9a0f26a463f", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "8134e33f-9bb8-4966-968f-758e61905b21" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "x-ms-lease-status" : "unlocked", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-lease-state" : "available", + "Last-Modified" : "Mon, 29 Jun 2020 19:46:17 GMT", + "retry-after" : "0", + "x-ms-access-tier-change-time" : "Mon, 29 Jun 2020 19:46:17 GMT", + "StatusCode" : "200", + "Date" : "Mon, 29 Jun 2020 19:46:17 GMT", + "x-ms-blob-type" : "BlockBlob", + "Content-MD5" : "1B2M2Y8AsgTpgAmY7PhCfg==", + "Accept-Ranges" : "bytes", + "x-ms-server-encrypted" : "true", + "x-ms-access-tier" : "Hot", + "ETag" : "0x8D81C6516F10BB8", + "x-ms-creation-time" : "Mon, 29 Jun 2020 19:46:17 GMT", + "Content-Length" : "0", + "x-ms-request-id" : "7c7684a6-d01e-00db-604d-4ef002000000", + "x-ms-client-request-id" : "8134e33f-9bb8-4966-968f-758e61905b21", + "Content-Type" : "application/octet-stream" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.blob.core.windows.net?prefix=jtcsetattributestier&comp=list", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "499441a9-ee83-46fa-9257-b4b15a2c08a8" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "e900f6eb-c01e-0125-1e4d-4e8a32000000", + "Body" : "jtcsetattributestierjtcsetattributestier176543170d623ad8ca4c8189Mon, 29 Jun 2020 19:46:16 GMT\"0x8D81C651691AFF7\"unlockedavailable$account-encryption-keyfalsefalsefalsejtcsetattributestier230215e86c170cccf34365adMon, 29 Jun 2020 19:46:17 GMT\"0x8D81C6516C1D0F9\"unlockedavailable$account-encryption-keyfalsefalsefalse", + "Date" : "Mon, 29 Jun 2020 19:46:17 GMT", + "x-ms-client-request-id" : "499441a9-ee83-46fa-9257-b4b15a2c08a8", + "Content-Type" : "application/xml" + }, + "Exception" : null + }, { + "Method" : "DELETE", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcsetattributestier176543170d623ad8ca4c8189?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "546fe4ee-05e6-40db-9ee4-1a17f9142724" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "202", + "x-ms-request-id" : "1f0d2206-301e-00bc-4f4d-4e43a5000000", + "Date" : "Mon, 29 Jun 2020 19:46:17 GMT", + "x-ms-client-request-id" : "546fe4ee-05e6-40db-9ee4-1a17f9142724" + }, + "Exception" : null + }, { + "Method" : "DELETE", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcsetattributestier230215e86c170cccf34365ad?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "58bc7106-354b-4eff-86fa-f6ee1118e5fe" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "202", + "x-ms-request-id" : "162fbf69-401e-00de-764d-4e047d000000", + "Date" : "Mon, 29 Jun 2020 19:46:17 GMT", + "x-ms-client-request-id" : "58bc7106-354b-4eff-86fa-f6ee1118e5fe" + }, + "Exception" : null + } ], + "variables" : [ "jtcsetattributestier0081433bee3e6eb21548bca1", "jtcsetattributestier176543170d623ad8ca4c8189", "jtcsetattributestier230215e86c170cccf34365ad", "javablobsetattributestier379276d28bd9a0f26a463f" ] +} \ No newline at end of file diff --git a/sdk/storage/azure-storage-blob-nio/src/test/resources/session-records/AzureFileSystemProviderTestsetattributestier[1].json b/sdk/storage/azure-storage-blob-nio/src/test/resources/session-records/AzureFileSystemProviderTestsetattributestier[1].json new file mode 100644 index 0000000000000..cd3c0b1e0631e --- /dev/null +++ b/sdk/storage/azure-storage-blob-nio/src/test/resources/session-records/AzureFileSystemProviderTestsetattributestier[1].json @@ -0,0 +1,245 @@ +{ + "networkCallRecords" : [ { + "Method" : "GET", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcsetattributestier1265167a3a4062e6f84979ba?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "1ea3fde9-fd0b-4d4f-a58f-863385ae7f9b" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-error-code" : "ContainerNotFound", + "retry-after" : "0", + "Content-Length" : "225", + "StatusCode" : "404", + "x-ms-request-id" : "d5b2a734-c01e-004c-014d-4e93cb000000", + "Body" : "ContainerNotFoundThe specified container does not exist.\nRequestId:d5b2a734-c01e-004c-014d-4e93cb000000\nTime:2020-06-29T19:46:18.5968275Z", + "Date" : "Mon, 29 Jun 2020 19:46:17 GMT", + "x-ms-client-request-id" : "1ea3fde9-fd0b-4d4f-a58f-863385ae7f9b", + "Content-Type" : "application/xml" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcsetattributestier1265167a3a4062e6f84979ba?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "62dc58f1-ddc4-450f-a8ec-47c7cb511b62" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "ETag" : "0x8D81C6517AF36C5", + "Last-Modified" : "Mon, 29 Jun 2020 19:46:18 GMT", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "73228f54-e01e-005b-6d4d-4e53a8000000", + "Date" : "Mon, 29 Jun 2020 19:46:17 GMT", + "x-ms-client-request-id" : "62dc58f1-ddc4-450f-a8ec-47c7cb511b62" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcsetattributestier2335647de98cc16afc4b5f93?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "f82e977d-4e03-4b90-b252-c2bae2cb02b1" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-error-code" : "ContainerNotFound", + "retry-after" : "0", + "Content-Length" : "225", + "StatusCode" : "404", + "x-ms-request-id" : "efaf363c-401e-0019-3c4d-4e78bc000000", + "Body" : "ContainerNotFoundThe specified container does not exist.\nRequestId:efaf363c-401e-0019-3c4d-4e78bc000000\nTime:2020-06-29T19:46:18.9259593Z", + "Date" : "Mon, 29 Jun 2020 19:46:18 GMT", + "x-ms-client-request-id" : "f82e977d-4e03-4b90-b252-c2bae2cb02b1", + "Content-Type" : "application/xml" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcsetattributestier2335647de98cc16afc4b5f93?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "f9ad87ef-0ae4-4d40-9a93-fe86c46b5d3f" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "ETag" : "0x8D81C6517DFA2C4", + "Last-Modified" : "Mon, 29 Jun 2020 19:46:19 GMT", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "7cd9e1c7-001e-0078-1b4d-4e3c63000000", + "Date" : "Mon, 29 Jun 2020 19:46:18 GMT", + "x-ms-client-request-id" : "f9ad87ef-0ae4-4d40-9a93-fe86c46b5d3f" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcsetattributestier1265167a3a4062e6f84979ba?prefix=javablobsetattributestier357352b9c3df5a075948bf&delimiter=/&maxresults=2&include=metadata&restype=container&comp=list", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "799f1998-fe71-4ca1-ac83-73a72bf5d4e0" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "b45a2cc4-601e-000e-674d-4eb8df000000", + "Body" : "javablobsetattributestier357352b9c3df5a075948bf2/", + "Date" : "Mon, 29 Jun 2020 19:46:19 GMT", + "x-ms-client-request-id" : "799f1998-fe71-4ca1-ac83-73a72bf5d4e0", + "Content-Type" : "application/xml" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcsetattributestier1265167a3a4062e6f84979ba/javablobsetattributestier357352b9c3df5a075948bf", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "62296a57-60da-42ca-91f0-2cc2aa8b8b3d", + "Content-Type" : "application/octet-stream" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-content-crc64" : "AAAAAAAAAAA=", + "Last-Modified" : "Mon, 29 Jun 2020 19:46:19 GMT", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-server-encrypted" : "true", + "Date" : "Mon, 29 Jun 2020 19:46:18 GMT", + "Content-MD5" : "1B2M2Y8AsgTpgAmY7PhCfg==", + "ETag" : "0x8D81C65180FD041", + "Content-Length" : "0", + "x-ms-request-id" : "3d82ed59-f01e-0044-654d-4e88b8000000", + "x-ms-client-request-id" : "62296a57-60da-42ca-91f0-2cc2aa8b8b3d" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcsetattributestier1265167a3a4062e6f84979ba/javablobsetattributestier357352b9c3df5a075948bf?comp=tier", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "d6e52437-c1c5-49b9-9f7d-a46b844f62e4" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "997a7963-a01e-00df-694d-4e0580000000", + "Date" : "Mon, 29 Jun 2020 19:46:19 GMT", + "x-ms-client-request-id" : "d6e52437-c1c5-49b9-9f7d-a46b844f62e4" + }, + "Exception" : null + }, { + "Method" : "HEAD", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcsetattributestier1265167a3a4062e6f84979ba/javablobsetattributestier357352b9c3df5a075948bf", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "eb6a1802-5771-44da-95a8-67b86a2fcda8" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "x-ms-lease-status" : "unlocked", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-lease-state" : "available", + "Last-Modified" : "Mon, 29 Jun 2020 19:46:19 GMT", + "retry-after" : "0", + "x-ms-access-tier-change-time" : "Mon, 29 Jun 2020 19:46:19 GMT", + "StatusCode" : "200", + "Date" : "Mon, 29 Jun 2020 19:46:19 GMT", + "x-ms-blob-type" : "BlockBlob", + "Content-MD5" : "1B2M2Y8AsgTpgAmY7PhCfg==", + "Accept-Ranges" : "bytes", + "x-ms-server-encrypted" : "true", + "x-ms-access-tier" : "Cool", + "ETag" : "0x8D81C65180FD041", + "x-ms-creation-time" : "Mon, 29 Jun 2020 19:46:19 GMT", + "Content-Length" : "0", + "x-ms-request-id" : "e0a7bb31-701e-0115-654d-4ed018000000", + "x-ms-client-request-id" : "eb6a1802-5771-44da-95a8-67b86a2fcda8", + "Content-Type" : "application/octet-stream" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.blob.core.windows.net?prefix=jtcsetattributestier&comp=list", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "d029cbd1-ca6a-4a8a-a901-7a016ec997b8" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "76377f44-f01e-0083-104d-4ef479000000", + "Body" : "jtcsetattributestierjtcsetattributestier1265167a3a4062e6f84979baMon, 29 Jun 2020 19:46:18 GMT\"0x8D81C6517AF36C5\"unlockedavailable$account-encryption-keyfalsefalsefalsejtcsetattributestier2335647de98cc16afc4b5f93Mon, 29 Jun 2020 19:46:19 GMT\"0x8D81C6517DFA2C4\"unlockedavailable$account-encryption-keyfalsefalsefalse", + "Date" : "Mon, 29 Jun 2020 19:46:19 GMT", + "x-ms-client-request-id" : "d029cbd1-ca6a-4a8a-a901-7a016ec997b8", + "Content-Type" : "application/xml" + }, + "Exception" : null + }, { + "Method" : "DELETE", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcsetattributestier1265167a3a4062e6f84979ba?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "23b242d9-2a1c-4117-8c8f-c8fab0e18952" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "202", + "x-ms-request-id" : "b59cc5f7-a01e-007e-644d-4ecb1b000000", + "Date" : "Mon, 29 Jun 2020 19:46:19 GMT", + "x-ms-client-request-id" : "23b242d9-2a1c-4117-8c8f-c8fab0e18952" + }, + "Exception" : null + }, { + "Method" : "DELETE", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcsetattributestier2335647de98cc16afc4b5f93?restype=container", + "Headers" : { + "x-ms-version" : "2019-07-07", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.1 (11.0.5; Windows 10 10.0)", + "x-ms-client-request-id" : "8a1a28a7-04bb-4779-8df9-7c3e0c49b57c" + }, + "Response" : { + "x-ms-version" : "2019-07-07", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "202", + "x-ms-request-id" : "b86012a1-801e-008c-394d-4e198f000000", + "Date" : "Mon, 29 Jun 2020 19:46:19 GMT", + "x-ms-client-request-id" : "8a1a28a7-04bb-4779-8df9-7c3e0c49b57c" + }, + "Exception" : null + } ], + "variables" : [ "jtcsetattributestier024530bf4858d2ab9147a68c", "jtcsetattributestier1265167a3a4062e6f84979ba", "jtcsetattributestier2335647de98cc16afc4b5f93", "javablobsetattributestier357352b9c3df5a075948bf" ] +} \ No newline at end of file From afe7b5964710686a53aa5dbe6839d5429eab85db Mon Sep 17 00:00:00 2001 From: Shawn Fang <45607042+mssfang@users.noreply.github.com> Date: Tue, 7 Jul 2020 15:01:21 -0700 Subject: [PATCH 038/129] July patch release preparation for AppConfig, TA and FR (#12833) * July Release for AppConfig and Text Analytics * update Identity version and form recognizer version --- eng/jacoco-test-coverage/pom.xml | 4 ++-- eng/versioning/version_client.txt | 4 ++-- sdk/appconfiguration/azure-data-appconfiguration/CHANGELOG.md | 4 ++-- sdk/appconfiguration/azure-data-appconfiguration/README.md | 4 ++-- sdk/appconfiguration/azure-data-appconfiguration/pom.xml | 2 +- sdk/formrecognizer/azure-ai-formrecognizer/CHANGELOG.md | 2 +- sdk/formrecognizer/azure-ai-formrecognizer/README.md | 4 ++-- sdk/textanalytics/azure-ai-textanalytics/CHANGELOG.md | 4 ++-- sdk/textanalytics/azure-ai-textanalytics/README.md | 4 ++-- sdk/textanalytics/azure-ai-textanalytics/pom.xml | 2 +- 10 files changed, 17 insertions(+), 17 deletions(-) diff --git a/eng/jacoco-test-coverage/pom.xml b/eng/jacoco-test-coverage/pom.xml index b809161b44bf7..9900539c27f1c 100644 --- a/eng/jacoco-test-coverage/pom.xml +++ b/eng/jacoco-test-coverage/pom.xml @@ -44,7 +44,7 @@ com.azure azure-ai-textanalytics - 1.1.0-beta.1 + 1.0.1 com.azure @@ -114,7 +114,7 @@ com.azure azure-data-appconfiguration - 1.2.0-beta.1 + 1.1.3 com.azure diff --git a/eng/versioning/version_client.txt b/eng/versioning/version_client.txt index 0786533fc8e38..b63301d48273e 100644 --- a/eng/versioning/version_client.txt +++ b/eng/versioning/version_client.txt @@ -5,7 +5,7 @@ com.azure:azure-sdk-all;1.0.0;1.0.0 com.azure:azure-sdk-parent;1.6.0;1.6.0 com.azure:azure-client-sdk-parent;1.7.0;1.7.0 com.azure:azure-ai-formrecognizer;1.0.0-beta.3;1.0.0-beta.4 -com.azure:azure-ai-textanalytics;1.0.0;1.1.0-beta.1 +com.azure:azure-ai-textanalytics;1.0.0;1.0.1 com.azure:azure-core;1.6.0;1.7.0-beta.1 com.azure:azure-core-amqp;1.3.0;1.4.0-beta.1 com.azure:azure-core-experimental;1.0.0-beta.1;1.0.0-beta.2 @@ -21,7 +21,7 @@ com.azure:azure-core-test;1.3.1;1.4.0-beta.1 com.azure:azure-core-tracing-opentelemetry;1.0.0-beta.5;1.0.0-beta.6 com.azure:azure-cosmos;4.1.0;4.2.0-beta.1 com.azure:azure-cosmos-benchmark;4.0.1-beta.1;4.0.1-beta.1 -com.azure:azure-data-appconfiguration;1.1.2;1.2.0-beta.1 +com.azure:azure-data-appconfiguration;1.1.2;1.1.3 com.azure:azure-data-schemaregistry;1.0.0-beta.2;1.0.0-beta.3 com.azure:azure-data-schemaregistry-avro;1.0.0-beta.2;1.0.0-beta.3 com.azure:azure-data-tables;1.0.0-beta.1;1.0.0-beta.1 diff --git a/sdk/appconfiguration/azure-data-appconfiguration/CHANGELOG.md b/sdk/appconfiguration/azure-data-appconfiguration/CHANGELOG.md index cdaca54464699..9007d51c636ef 100644 --- a/sdk/appconfiguration/azure-data-appconfiguration/CHANGELOG.md +++ b/sdk/appconfiguration/azure-data-appconfiguration/CHANGELOG.md @@ -1,6 +1,6 @@ # Release History -## 1.2.0-beta.1 (Unreleased) - +## 1.1.3 (2020-07-07) +- Update dependency version, `azure-core` to 1.6.0 and `azure-core-http-netty` to 1.5.3. ## 1.1.2 (2020-06-09) - Update dependency version, `azure-core` to 1.5.1 and `azure-core-http-netty` to 1.5.2. diff --git a/sdk/appconfiguration/azure-data-appconfiguration/README.md b/sdk/appconfiguration/azure-data-appconfiguration/README.md index 832dc3c61cdc9..feee8189cf24f 100644 --- a/sdk/appconfiguration/azure-data-appconfiguration/README.md +++ b/sdk/appconfiguration/azure-data-appconfiguration/README.md @@ -23,12 +23,12 @@ Use the client library for App Configuration to create and manage application co com.azure azure-data-appconfiguration - 1.1.2 + 1.1.3 ``` [//]: # ({x-version-update-end}) -### Create an App Configuration Store +#### Create an App Configuration Store To create a Configuration Store you can use the Azure Portal or [Azure CLI][azure_cli]. diff --git a/sdk/appconfiguration/azure-data-appconfiguration/pom.xml b/sdk/appconfiguration/azure-data-appconfiguration/pom.xml index d2e314817ee95..84d0bfd1a5137 100644 --- a/sdk/appconfiguration/azure-data-appconfiguration/pom.xml +++ b/sdk/appconfiguration/azure-data-appconfiguration/pom.xml @@ -13,7 +13,7 @@ com.azure azure-data-appconfiguration - 1.2.0-beta.1 + 1.1.3 Microsoft Azure client library for App Configuration This package contains the Microsoft Azure App Configuration client library. diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/CHANGELOG.md b/sdk/formrecognizer/azure-ai-formrecognizer/CHANGELOG.md index 3cb44caee64fd..3d72df697577f 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/CHANGELOG.md +++ b/sdk/formrecognizer/azure-ai-formrecognizer/CHANGELOG.md @@ -1,6 +1,6 @@ # Release History -## 1.0.0-beta.4 (Unreleased) +## 1.0.0-beta.4 (2020-07-07) ### Breaking Changes - `beginRecognizeReceipt` APIs now return a `RecognizedForm` model instead of a `RecognizedReceipt`. See [this](https://github.com/Azure/azure-sdk-for-java/sdk/formrecognizer/azure-ai-formrecognizer/src/samples/java/com/azure/ai/formrecognizer/StronglyTypedRecognizedFormUSReceipt.java) diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/README.md b/sdk/formrecognizer/azure-ai-formrecognizer/README.md index 6fef4de94f21e..48541a47825db 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/README.md +++ b/sdk/formrecognizer/azure-ai-formrecognizer/README.md @@ -23,7 +23,7 @@ from form documents. It includes the following main functionalities: com.azure azure-ai-formrecognizer - 1.0.0-beta.3 + 1.0.0-beta.4 ``` [//]: # ({x-version-update-end}) @@ -121,7 +121,7 @@ Authentication with AAD requires some initial setup: com.azure azure-identity - 1.0.6 + 1.0.8 ``` [//]: # ({x-version-update-end}) diff --git a/sdk/textanalytics/azure-ai-textanalytics/CHANGELOG.md b/sdk/textanalytics/azure-ai-textanalytics/CHANGELOG.md index 0f5364ca432a3..30495e3675a5d 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/CHANGELOG.md +++ b/sdk/textanalytics/azure-ai-textanalytics/CHANGELOG.md @@ -1,7 +1,7 @@ # Release History -## 1.1.0-beta.1 (Unreleased) - +## 1.0.1 (2020-07-07) +- Update dependency version, `azure-core` to 1.6.0 and `azure-core-http-netty` to 1.5.3. ## 1.0.0 (2020-06-09) - First stable release of `azure-ai-textanalytics`. diff --git a/sdk/textanalytics/azure-ai-textanalytics/README.md b/sdk/textanalytics/azure-ai-textanalytics/README.md index fd1cb6b396c24..5097a35032ffb 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/README.md +++ b/sdk/textanalytics/azure-ai-textanalytics/README.md @@ -55,7 +55,7 @@ az cognitiveservices account create \ com.azure azure-ai-textanalytics - 1.0.0 + 1.0.1 ``` [//]: # ({x-version-update-end}) @@ -116,7 +116,7 @@ Authentication with AAD requires some initial setup: com.azure azure-identity - 1.0.6 + 1.0.8 ``` [//]: # ({x-version-update-end}) diff --git a/sdk/textanalytics/azure-ai-textanalytics/pom.xml b/sdk/textanalytics/azure-ai-textanalytics/pom.xml index 215b304ea4881..df143a1c1f4b8 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/pom.xml +++ b/sdk/textanalytics/azure-ai-textanalytics/pom.xml @@ -13,7 +13,7 @@ com.azure azure-ai-textanalytics - 1.1.0-beta.1 + 1.0.1 Microsoft Azure client library for Text Analytics This package contains the Microsoft Azure Cognitive Services Text Analytics SDK. From 5dfe115febc9ebc7becec91840cf4566e69ee887 Mon Sep 17 00:00:00 2001 From: Azure SDK Bot <53356347+azure-sdk@users.noreply.github.com> Date: Tue, 7 Jul 2020 15:14:52 -0700 Subject: [PATCH 039/129] Sync eng/common directory with azure-sdk-tools repository (#12870) --- eng/common/scripts/Verify-ChangeLog.ps1 | 1 + eng/common/scripts/modules/Package-Properties.psm1 | 11 +++++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/eng/common/scripts/Verify-ChangeLog.ps1 b/eng/common/scripts/Verify-ChangeLog.ps1 index 816a82f5bcb25..7a821a1d54b06 100644 --- a/eng/common/scripts/Verify-ChangeLog.ps1 +++ b/eng/common/scripts/Verify-ChangeLog.ps1 @@ -11,6 +11,7 @@ param ( [boolean]$ForRelease=$False ) +$ProgressPreference = "SilentlyContinue" . (Join-Path $PSScriptRoot SemVer.ps1) Import-Module (Join-Path $PSScriptRoot modules ChangeLog-Operations.psm1) diff --git a/eng/common/scripts/modules/Package-Properties.psm1 b/eng/common/scripts/modules/Package-Properties.psm1 index dca123f929f71..01865594f6cf3 100644 --- a/eng/common/scripts/modules/Package-Properties.psm1 +++ b/eng/common/scripts/modules/Package-Properties.psm1 @@ -45,6 +45,7 @@ class PackageProps } } +$ProgressPreference = "SilentlyContinue" Install-Module -Name powershell-yaml -RequiredVersion 0.4.1 -Force -Scope CurrentUser function Extract-PkgProps ($pkgPath, $serviceName, $pkgName, $lang) @@ -239,8 +240,14 @@ function Get-PkgListFromYml ($ciYmlPath) { $ciYmlContent = Get-Content $ciYmlPath -Raw $ciYmlObj = ConvertFrom-Yaml $ciYmlContent -Ordered - $artifactsInCI = $ciYmlObj["stages"][0]["parameters"]["Artifacts"] - + if ($ciYmlObj.Contains("stages")) + { + $artifactsInCI = $ciYmlObj["stages"][0]["parameters"]["Artifacts"] + } + elseif ($ciYmlObj.Contains("extends")) + { + $artifactsInCI = $ciYmlObj["extends"]["parameters"]["Artifacts"] + } if ($artifactsInCI -eq $null) { Write-Error "Failed to retrive package names in ci $ciYmlPath" From 9009f126126aa693e7b5e03b051a163d097d1017 Mon Sep 17 00:00:00 2001 From: Gauri Prasad <51212198+gapra-msft@users.noreply.github.com> Date: Tue, 7 Jul 2020 17:17:16 -0700 Subject: [PATCH 040/129] Add plugin to internal avro to add empty javadoc (#12879) --- .../azure-storage-internal-avro/pom.xml | 75 +++++++++++++++++++ 1 file changed, 75 insertions(+) diff --git a/sdk/storage/azure-storage-internal-avro/pom.xml b/sdk/storage/azure-storage-internal-avro/pom.xml index 66540523c8a0d..600a9f5b78105 100644 --- a/sdk/storage/azure-storage-internal-avro/pom.xml +++ b/sdk/storage/azure-storage-internal-avro/pom.xml @@ -56,4 +56,79 @@ test + + + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 3.1.1 + + + attach-javadocs + + jar + + + true + + + + + + org.apache.maven.plugins + maven-jar-plugin + 3.1.2 + + + empty-javadoc-jar-with-readme + package + + jar + + + javadoc + ${project.basedir}/javadocTemp + + + + + + org.apache.maven.plugins + maven-antrun-plugin + 1.8 + + + copy-readme-to-javadocTemp + prepare-package + + + Deleting existing ${project.basedir}/javadocTemp + + + + Copying ${project.basedir}/README.md to + ${project.basedir}/javadocTemp/README.md + + + + + + run + + + + + + +
From 34e989405a2db8928e4ecaaf77d0ca5e63cd87bd Mon Sep 17 00:00:00 2001 From: Chidozie Ononiwu <31145988+chidozieononiwu@users.noreply.github.com> Date: Tue, 7 Jul 2020 17:38:38 -0700 Subject: [PATCH 041/129] Add missing changelogs (#12876) --- sdk/parents/azure-arm-parent/CHANGELOG.md | 3 +++ sdk/parents/azure-client-sdk-parent/CHANGELOG.md | 3 +++ sdk/parents/azure-data-sdk-parent/CHANGELOG.md | 3 +++ 3 files changed, 9 insertions(+) create mode 100644 sdk/parents/azure-arm-parent/CHANGELOG.md create mode 100644 sdk/parents/azure-client-sdk-parent/CHANGELOG.md create mode 100644 sdk/parents/azure-data-sdk-parent/CHANGELOG.md diff --git a/sdk/parents/azure-arm-parent/CHANGELOG.md b/sdk/parents/azure-arm-parent/CHANGELOG.md new file mode 100644 index 0000000000000..c51d4b22dcf4e --- /dev/null +++ b/sdk/parents/azure-arm-parent/CHANGELOG.md @@ -0,0 +1,3 @@ +# Release History + +## 1.3.2 (Unreleased) \ No newline at end of file diff --git a/sdk/parents/azure-client-sdk-parent/CHANGELOG.md b/sdk/parents/azure-client-sdk-parent/CHANGELOG.md new file mode 100644 index 0000000000000..a48fd29ad0e5f --- /dev/null +++ b/sdk/parents/azure-client-sdk-parent/CHANGELOG.md @@ -0,0 +1,3 @@ +# Release History + +## 1.7.0 (Unreleased) \ No newline at end of file diff --git a/sdk/parents/azure-data-sdk-parent/CHANGELOG.md b/sdk/parents/azure-data-sdk-parent/CHANGELOG.md new file mode 100644 index 0000000000000..436d86f052f3c --- /dev/null +++ b/sdk/parents/azure-data-sdk-parent/CHANGELOG.md @@ -0,0 +1,3 @@ +# Release History + +## 1.3.0 (Unreleased) \ No newline at end of file From 6aea90fd57ad6d3532c291192b18bbaa6aa349a4 Mon Sep 17 00:00:00 2001 From: Mitch Denny Date: Wed, 8 Jul 2020 11:39:03 +1000 Subject: [PATCH 042/129] SpotBugs step to use the Maven proxy. (#12889) --- eng/pipelines/templates/jobs/archetype-sdk-client.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eng/pipelines/templates/jobs/archetype-sdk-client.yml b/eng/pipelines/templates/jobs/archetype-sdk-client.yml index 67173c57d2c41..99ced06cfdb73 100644 --- a/eng/pipelines/templates/jobs/archetype-sdk-client.yml +++ b/eng/pipelines/templates/jobs/archetype-sdk-client.yml @@ -193,7 +193,7 @@ jobs: displayName: 'Run SpotBugs, Checkstyle, RevApi, and Javadoc' inputs: mavenPomFile: pom.xml - options: '--no-transfer-progress -DskipTests -Dgpg.skip -Dverify-readme-windows -pl $(ProjectList)' + options: '$(DefaultOptions) --no-transfer-progress -DskipTests -Dgpg.skip -Dverify-readme-windows -pl $(ProjectList)' mavenOptions: '$(MemoryOptions)' javaHomeOption: 'JDKVersion' jdkVersionOption: $(JavaBuildVersion) From f5fcfa2c021d0342c5aacc43b0fcca8759b0ca66 Mon Sep 17 00:00:00 2001 From: Azure SDK Bot <53356347+azure-sdk@users.noreply.github.com> Date: Tue, 7 Jul 2020 19:29:37 -0700 Subject: [PATCH 043/129] Increment package version after release of com.azure azure-ai-textanalytics (#12886) --- eng/jacoco-test-coverage/pom.xml | 2 +- eng/versioning/version_client.txt | 2 +- sdk/textanalytics/azure-ai-textanalytics/CHANGELOG.md | 3 +++ sdk/textanalytics/azure-ai-textanalytics/pom.xml | 2 +- 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/eng/jacoco-test-coverage/pom.xml b/eng/jacoco-test-coverage/pom.xml index 9900539c27f1c..8a3348549e007 100644 --- a/eng/jacoco-test-coverage/pom.xml +++ b/eng/jacoco-test-coverage/pom.xml @@ -44,7 +44,7 @@ com.azure azure-ai-textanalytics - 1.0.1 + 1.1.0-beta.1 com.azure diff --git a/eng/versioning/version_client.txt b/eng/versioning/version_client.txt index b63301d48273e..55242a20b2c4b 100644 --- a/eng/versioning/version_client.txt +++ b/eng/versioning/version_client.txt @@ -5,7 +5,7 @@ com.azure:azure-sdk-all;1.0.0;1.0.0 com.azure:azure-sdk-parent;1.6.0;1.6.0 com.azure:azure-client-sdk-parent;1.7.0;1.7.0 com.azure:azure-ai-formrecognizer;1.0.0-beta.3;1.0.0-beta.4 -com.azure:azure-ai-textanalytics;1.0.0;1.0.1 +com.azure:azure-ai-textanalytics;1.0.1;1.1.0-beta.1 com.azure:azure-core;1.6.0;1.7.0-beta.1 com.azure:azure-core-amqp;1.3.0;1.4.0-beta.1 com.azure:azure-core-experimental;1.0.0-beta.1;1.0.0-beta.2 diff --git a/sdk/textanalytics/azure-ai-textanalytics/CHANGELOG.md b/sdk/textanalytics/azure-ai-textanalytics/CHANGELOG.md index 30495e3675a5d..8d503689eedda 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/CHANGELOG.md +++ b/sdk/textanalytics/azure-ai-textanalytics/CHANGELOG.md @@ -1,5 +1,8 @@ # Release History +## 1.1.0-beta.1 (Unreleased) + + ## 1.0.1 (2020-07-07) - Update dependency version, `azure-core` to 1.6.0 and `azure-core-http-netty` to 1.5.3. diff --git a/sdk/textanalytics/azure-ai-textanalytics/pom.xml b/sdk/textanalytics/azure-ai-textanalytics/pom.xml index df143a1c1f4b8..215b304ea4881 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/pom.xml +++ b/sdk/textanalytics/azure-ai-textanalytics/pom.xml @@ -13,7 +13,7 @@ com.azure azure-ai-textanalytics - 1.0.1 + 1.1.0-beta.1 Microsoft Azure client library for Text Analytics This package contains the Microsoft Azure Cognitive Services Text Analytics SDK. From f8c7aae7e58232a094e9a5766b8e66be13ed6dae Mon Sep 17 00:00:00 2001 From: Azure SDK Bot <53356347+azure-sdk@users.noreply.github.com> Date: Tue, 7 Jul 2020 20:00:14 -0700 Subject: [PATCH 044/129] Increment version for storage releases (#12877) --- eng/jacoco-test-coverage/pom.xml | 18 +++++++++--------- eng/versioning/version_client.txt | 18 +++++++++--------- .../pom.xml | 2 +- .../pom.xml | 2 +- .../azure-storage-blob-batch/CHANGELOG.md | 3 +++ sdk/storage/azure-storage-blob-batch/pom.xml | 4 ++-- .../azure-storage-blob-changefeed/CHANGELOG.md | 3 +++ .../azure-storage-blob-changefeed/pom.xml | 4 ++-- .../CHANGELOG.md | 3 +++ .../azure-storage-blob-cryptography/pom.xml | 4 ++-- sdk/storage/azure-storage-blob-nio/pom.xml | 2 +- sdk/storage/azure-storage-blob/CHANGELOG.md | 3 +++ sdk/storage/azure-storage-blob/pom.xml | 6 +++--- sdk/storage/azure-storage-common/CHANGELOG.md | 3 +++ sdk/storage/azure-storage-common/pom.xml | 2 +- .../azure-storage-file-datalake/CHANGELOG.md | 3 +++ .../azure-storage-file-datalake/pom.xml | 4 ++-- .../azure-storage-file-share/CHANGELOG.md | 3 +++ sdk/storage/azure-storage-file-share/pom.xml | 4 ++-- .../azure-storage-internal-avro/CHANGELOG.md | 3 +++ .../azure-storage-internal-avro/pom.xml | 4 ++-- sdk/storage/azure-storage-perf/pom.xml | 2 +- sdk/storage/azure-storage-queue/CHANGELOG.md | 3 +++ sdk/storage/azure-storage-queue/pom.xml | 4 ++-- sdk/tables/azure-data-tables/pom.xml | 2 +- 25 files changed, 68 insertions(+), 41 deletions(-) diff --git a/eng/jacoco-test-coverage/pom.xml b/eng/jacoco-test-coverage/pom.xml index 8a3348549e007..6121e1b7a27e0 100644 --- a/eng/jacoco-test-coverage/pom.xml +++ b/eng/jacoco-test-coverage/pom.xml @@ -174,27 +174,27 @@ com.azure azure-storage-common - 12.8.0-beta.1 + 12.8.0-beta.2 com.azure azure-storage-blob - 12.8.0-beta.1 + 12.8.0-beta.2 com.azure azure-storage-blob-batch - 12.6.0-beta.1 + 12.6.0-beta.2 com.azure azure-storage-blob-changefeed - 12.0.0-beta.1 + 12.0.0-beta.2 com.azure azure-storage-blob-cryptography - 12.8.0-beta.1 + 12.8.0-beta.2 @@ -205,22 +205,22 @@ com.azure azure-storage-file-share - 12.6.0-beta.1 + 12.6.0-beta.2 com.azure azure-storage-file-datalake - 12.2.0-beta.1 + 12.2.0-beta.2 com.azure azure-storage-internal-avro - 12.0.0-beta.1 + 12.0.0-beta.2 com.azure azure-storage-queue - 12.6.0-beta.1 + 12.6.0-beta.2 com.azure diff --git a/eng/versioning/version_client.txt b/eng/versioning/version_client.txt index 55242a20b2c4b..27a58ba719638 100644 --- a/eng/versioning/version_client.txt +++ b/eng/versioning/version_client.txt @@ -36,17 +36,17 @@ com.azure:azure-security-keyvault-certificates;4.0.4;4.1.0-beta.4 com.azure:azure-security-keyvault-keys;4.1.4;4.2.0-beta.5 com.azure:azure-security-keyvault-secrets;4.1.4;4.2.0-beta.4 com.azure:azure-sdk-template;1.0.4-beta.19;1.0.4-beta.20 -com.azure:azure-storage-blob;12.7.0;12.8.0-beta.1 -com.azure:azure-storage-blob-batch;12.5.2;12.6.0-beta.1 -com.azure:azure-storage-blob-changefeed;12.0.0-beta.1;12.0.0-beta.1 -com.azure:azure-storage-blob-cryptography;12.7.0;12.8.0-beta.1 +com.azure:azure-storage-blob;12.8.0-beta.1;12.8.0-beta.2 +com.azure:azure-storage-blob-batch;12.6.0-beta.1;12.6.0-beta.2 +com.azure:azure-storage-blob-changefeed;12.0.0-beta.1;12.0.0-beta.2 +com.azure:azure-storage-blob-cryptography;12.8.0-beta.1;12.8.0-beta.2 com.azure:azure-storage-blob-nio;12.0.0-beta.1;12.0.0-beta.1 -com.azure:azure-storage-common;12.7.0;12.8.0-beta.1 -com.azure:azure-storage-file-share;12.5.0;12.6.0-beta.1 -com.azure:azure-storage-file-datalake;12.1.2;12.2.0-beta.1 -com.azure:azure-storage-internal-avro;12.0.0-beta.1;12.0.0-beta.1 +com.azure:azure-storage-common;12.8.0-beta.1;12.8.0-beta.2 +com.azure:azure-storage-file-share;12.6.0-beta.1;12.6.0-beta.2 +com.azure:azure-storage-file-datalake;12.2.0-beta.1;12.2.0-beta.2 +com.azure:azure-storage-internal-avro;12.0.0-beta.1;12.0.0-beta.2 com.azure:azure-storage-perf;1.0.0-beta.1;1.0.0-beta.1 -com.azure:azure-storage-queue;12.5.2;12.6.0-beta.1 +com.azure:azure-storage-queue;12.6.0-beta.1;12.6.0-beta.2 com.azure:perf-test-core;1.0.0-beta.1;1.0.0-beta.1 com.azure:azure-test-watcher;1.0.0-beta.1;1.0.0-beta.1 com.microsoft.azure:azure-spring-boot;2.3.2;2.3.3-beta.1 diff --git a/sdk/eventhubs/azure-messaging-eventhubs-checkpointstore-blob/pom.xml b/sdk/eventhubs/azure-messaging-eventhubs-checkpointstore-blob/pom.xml index 6ee4b3c6c99a8..4c11b5e81cf0c 100644 --- a/sdk/eventhubs/azure-messaging-eventhubs-checkpointstore-blob/pom.xml +++ b/sdk/eventhubs/azure-messaging-eventhubs-checkpointstore-blob/pom.xml @@ -45,7 +45,7 @@ com.azure azure-storage-blob - 12.7.0 + 12.8.0-beta.1 diff --git a/sdk/spring/azure-spring-boot-samples/azure-spring-boot-sample-storage-blob/pom.xml b/sdk/spring/azure-spring-boot-samples/azure-spring-boot-sample-storage-blob/pom.xml index f8f4145b82f80..edc525785e1b7 100644 --- a/sdk/spring/azure-spring-boot-samples/azure-spring-boot-sample-storage-blob/pom.xml +++ b/sdk/spring/azure-spring-boot-samples/azure-spring-boot-sample-storage-blob/pom.xml @@ -30,7 +30,7 @@ com.azure azure-storage-blob - 12.7.0 + 12.8.0-beta.1 diff --git a/sdk/storage/azure-storage-blob-batch/CHANGELOG.md b/sdk/storage/azure-storage-blob-batch/CHANGELOG.md index 2aa7e631edc0e..e8ff9375b1d5e 100644 --- a/sdk/storage/azure-storage-blob-batch/CHANGELOG.md +++ b/sdk/storage/azure-storage-blob-batch/CHANGELOG.md @@ -1,5 +1,8 @@ # Release History +## 12.6.0-beta.2 (Unreleased) + + ## 12.6.0-beta.1 (2020-07-07) - Updated azure-storage-common and azure-storage-blob dependencies to add support for the 2019-12-12 service version. diff --git a/sdk/storage/azure-storage-blob-batch/pom.xml b/sdk/storage/azure-storage-blob-batch/pom.xml index d7e99ec5192c6..ef2fa6ab8a8cb 100644 --- a/sdk/storage/azure-storage-blob-batch/pom.xml +++ b/sdk/storage/azure-storage-blob-batch/pom.xml @@ -13,7 +13,7 @@ com.azure azure-storage-blob-batch - 12.6.0-beta.1 + 12.6.0-beta.2 Microsoft Azure client library for Blob Storage batching This module contains client library for Microsoft Azure Blob Storage batching. @@ -65,7 +65,7 @@ com.azure azure-storage-blob - 12.8.0-beta.1 + 12.8.0-beta.2 + 12.0.0-beta.2 Microsoft Azure client library for Blob Storage changefeed This module contains client library for Microsoft Azure Blob Storage changefeed. @@ -65,7 +65,7 @@ com.azure azure-storage-blob - 12.8.0-beta.1 + 12.8.0-beta.2 + 12.8.0-beta.2 Microsoft Azure client library for Blob Storage cryptography This module contains client library for Microsoft Azure Blob Storage cryptography. @@ -51,7 +51,7 @@ com.azure azure-storage-blob - 12.8.0-beta.1 + 12.8.0-beta.2 com.azure diff --git a/sdk/storage/azure-storage-blob-nio/pom.xml b/sdk/storage/azure-storage-blob-nio/pom.xml index 2d88682682454..9b04ff9c4c40e 100644 --- a/sdk/storage/azure-storage-blob-nio/pom.xml +++ b/sdk/storage/azure-storage-blob-nio/pom.xml @@ -54,7 +54,7 @@ com.azure azure-storage-blob - 12.8.0-beta.1 + 12.8.0-beta.2 diff --git a/sdk/storage/azure-storage-blob/CHANGELOG.md b/sdk/storage/azure-storage-blob/CHANGELOG.md index 96a2a9fa02263..3b4cc6ce59c2b 100644 --- a/sdk/storage/azure-storage-blob/CHANGELOG.md +++ b/sdk/storage/azure-storage-blob/CHANGELOG.md @@ -1,5 +1,8 @@ # Release History +## 12.8.0-beta.2 (Unreleased) + + ## 12.8.0-beta.1 (2020-07-07) - Added support for the 2019-12-12 service version. - Added support for blob tags. Added get/setTags method to Blob(Async)ClientBase. Added filterTags api to BlobServiceClient. Added ability to specify tags on all methods that create a blob. Tag count returned on getProperties/getBlob. Option to include returning tags on listing. diff --git a/sdk/storage/azure-storage-blob/pom.xml b/sdk/storage/azure-storage-blob/pom.xml index 9c5827fe38b63..b8a61c39f2e38 100644 --- a/sdk/storage/azure-storage-blob/pom.xml +++ b/sdk/storage/azure-storage-blob/pom.xml @@ -13,7 +13,7 @@ com.azure azure-storage-blob - 12.8.0-beta.1 + 12.8.0-beta.2 Microsoft Azure client library for Blob Storage This module contains client library for Microsoft Azure Blob Storage. @@ -60,12 +60,12 @@ com.azure azure-storage-common - 12.8.0-beta.1 + 12.8.0-beta.2 com.azure azure-storage-internal-avro - 12.0.0-beta.1 + 12.0.0-beta.2 + 12.8.0-beta.2 Microsoft Azure common module for Storage This module contains common code based for all Microsoft Azure Storage client libraries. diff --git a/sdk/storage/azure-storage-file-datalake/CHANGELOG.md b/sdk/storage/azure-storage-file-datalake/CHANGELOG.md index 04b7bbcd75433..136b79699aca1 100644 --- a/sdk/storage/azure-storage-file-datalake/CHANGELOG.md +++ b/sdk/storage/azure-storage-file-datalake/CHANGELOG.md @@ -1,5 +1,8 @@ # Release History +## 12.2.0-beta.2 (Unreleased) + + ## 12.2.0-beta.1 (2019-07-07) - Added support for the 2019-12-12 service version. - Added support to query a file. diff --git a/sdk/storage/azure-storage-file-datalake/pom.xml b/sdk/storage/azure-storage-file-datalake/pom.xml index a2eec8ff6284b..6ccc6e418a332 100644 --- a/sdk/storage/azure-storage-file-datalake/pom.xml +++ b/sdk/storage/azure-storage-file-datalake/pom.xml @@ -13,7 +13,7 @@ com.azure azure-storage-file-datalake - 12.2.0-beta.1 + 12.2.0-beta.2 Microsoft Azure client library for File Storage Data Lake This module contains client library for Microsoft Azure File Storage Data Lake. @@ -55,7 +55,7 @@ com.azure azure-storage-blob - 12.8.0-beta.1 + 12.8.0-beta.2 + 12.6.0-beta.2 Microsoft Azure client library for File Share Storage This module contains client library for Microsoft Azure File Share Storage. @@ -36,7 +36,7 @@ com.azure azure-storage-common - 12.8.0-beta.1 + 12.8.0-beta.2 + 12.0.0-beta.2 Microsoft Azure internal Avro module for Storage This module contains internal use only avro parser code based for Microsoft Azure Storage client libraries. @@ -41,7 +41,7 @@ com.azure azure-storage-common - 12.8.0-beta.1 + 12.8.0-beta.2 io.projectreactor diff --git a/sdk/storage/azure-storage-perf/pom.xml b/sdk/storage/azure-storage-perf/pom.xml index 807c5466a99fc..fba784702f283 100644 --- a/sdk/storage/azure-storage-perf/pom.xml +++ b/sdk/storage/azure-storage-perf/pom.xml @@ -27,7 +27,7 @@ com.azure azure-storage-blob - 12.8.0-beta.1 + 12.8.0-beta.2 com.azure diff --git a/sdk/storage/azure-storage-queue/CHANGELOG.md b/sdk/storage/azure-storage-queue/CHANGELOG.md index 4aab944f6f307..21c3c2865e93e 100644 --- a/sdk/storage/azure-storage-queue/CHANGELOG.md +++ b/sdk/storage/azure-storage-queue/CHANGELOG.md @@ -1,5 +1,8 @@ # Release History +## 12.6.0-beta.2 (Unreleased) + + ## 12.6.0-beta.1 (2019-07-07) - Added support for the 2019-12-12 service version. diff --git a/sdk/storage/azure-storage-queue/pom.xml b/sdk/storage/azure-storage-queue/pom.xml index cd814256e79f6..df3c30028d1de 100644 --- a/sdk/storage/azure-storage-queue/pom.xml +++ b/sdk/storage/azure-storage-queue/pom.xml @@ -13,7 +13,7 @@ com.azure azure-storage-queue - 12.6.0-beta.1 + 12.6.0-beta.2 Microsoft Azure client library for Queue Storage This module contains client library for Microsoft Azure Queue Storage. @@ -41,7 +41,7 @@ com.azure azure-storage-common - 12.8.0-beta.1 + 12.8.0-beta.2 com.azure diff --git a/sdk/tables/azure-data-tables/pom.xml b/sdk/tables/azure-data-tables/pom.xml index 4b6bc21b2d876..f8569c52af8fa 100644 --- a/sdk/tables/azure-data-tables/pom.xml +++ b/sdk/tables/azure-data-tables/pom.xml @@ -45,7 +45,7 @@ Licensed under the MIT License. com.azure azure-storage-common - 12.7.0 + 12.8.0-beta.1 org.junit.jupiter From 3221338dccf5545f146f01bf5d4f6d257c579fb8 Mon Sep 17 00:00:00 2001 From: Connie Yau Date: Tue, 7 Jul 2020 20:08:50 -0700 Subject: [PATCH 045/129] Remove ServiceBusMessageProcessor (#12885) * Remove unneeded ServiceBusMessageProcessor. --- .../servicebus/ServiceBusAsyncConsumer.java | 41 +- .../ServiceBusReceiverAsyncClient.java | 14 +- .../servicebus/UnnamedSessionReceiver.java | 19 +- .../ServiceBusMessageProcessor.java | 457 ------------------ .../ServiceBusAsyncConsumerTest.java | 53 +- .../ServiceBusMessageProcessorTest.java | 284 ----------- 6 files changed, 13 insertions(+), 855 deletions(-) delete mode 100644 sdk/servicebus/azure-messaging-servicebus/src/main/java/com/azure/messaging/servicebus/implementation/ServiceBusMessageProcessor.java delete mode 100644 sdk/servicebus/azure-messaging-servicebus/src/test/java/com/azure/messaging/servicebus/implementation/ServiceBusMessageProcessorTest.java diff --git a/sdk/servicebus/azure-messaging-servicebus/src/main/java/com/azure/messaging/servicebus/ServiceBusAsyncConsumer.java b/sdk/servicebus/azure-messaging-servicebus/src/main/java/com/azure/messaging/servicebus/ServiceBusAsyncConsumer.java index 033f19b397ff4..1f3bb0bffdb42 100644 --- a/sdk/servicebus/azure-messaging-servicebus/src/main/java/com/azure/messaging/servicebus/ServiceBusAsyncConsumer.java +++ b/sdk/servicebus/azure-messaging-servicebus/src/main/java/com/azure/messaging/servicebus/ServiceBusAsyncConsumer.java @@ -3,23 +3,17 @@ package com.azure.messaging.servicebus; -import com.azure.core.amqp.AmqpRetryOptions; import com.azure.core.amqp.implementation.MessageSerializer; import com.azure.core.util.logging.ClientLogger; import com.azure.messaging.servicebus.implementation.DispositionStatus; -import com.azure.messaging.servicebus.implementation.MessageManagementOperations; import com.azure.messaging.servicebus.implementation.MessageUtils; -import com.azure.messaging.servicebus.implementation.ServiceBusMessageProcessor; import com.azure.messaging.servicebus.implementation.ServiceBusReceiveLinkProcessor; import org.apache.qpid.proton.amqp.transport.DeliveryState; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; -import java.time.Duration; -import java.time.Instant; import java.util.Map; import java.util.concurrent.atomic.AtomicBoolean; -import java.util.function.BiFunction; import static com.azure.core.util.FluxUtil.monoError; @@ -32,22 +26,17 @@ class ServiceBusAsyncConsumer implements AutoCloseable { private final String linkName; private final ServiceBusReceiveLinkProcessor linkProcessor; private final MessageSerializer messageSerializer; - private final ServiceBusMessageProcessor processor; + private final Flux processor; ServiceBusAsyncConsumer(String linkName, ServiceBusReceiveLinkProcessor linkProcessor, - MessageSerializer messageSerializer, boolean isAutoComplete, boolean autoLockRenewal, - Duration maxAutoLockRenewDuration, AmqpRetryOptions retryOptions, - BiFunction> renewMessageLock) { + MessageSerializer messageSerializer) { this.linkName = linkName; this.linkProcessor = linkProcessor; this.messageSerializer = messageSerializer; - - final MessageManagement messageManagement = new MessageManagement(linkProcessor, renewMessageLock); - this.processor = linkProcessor .map(message -> this.messageSerializer.deserialize(message, ServiceBusReceivedMessage.class)) - .subscribeWith(new ServiceBusMessageProcessor(linkName, isAutoComplete, autoLockRenewal, - maxAutoLockRenewDuration, retryOptions, linkProcessor.getErrorContext(), messageManagement)); + .publish() + .autoConnect(1); } /** @@ -88,29 +77,7 @@ Mono updateDisposition(String lockToken, DispositionStatus dispositionStat @Override public void close() { if (!isDisposed.getAndSet(true)) { - processor.onComplete(); linkProcessor.cancel(); } } - - private static final class MessageManagement implements MessageManagementOperations { - private final ServiceBusReceiveLinkProcessor link; - private final BiFunction> renewMessageLock; - - private MessageManagement(ServiceBusReceiveLinkProcessor link, - BiFunction> renewMessageLock) { - this.link = link; - this.renewMessageLock = renewMessageLock; - } - - @Override - public Mono updateDisposition(String lockToken, DeliveryState deliveryState) { - return link.updateDisposition(lockToken, deliveryState); - } - - @Override - public Mono renewMessageLock(String lockToken, String associatedLinkName) { - return renewMessageLock.apply(lockToken, associatedLinkName); - } - } } diff --git a/sdk/servicebus/azure-messaging-servicebus/src/main/java/com/azure/messaging/servicebus/ServiceBusReceiverAsyncClient.java b/sdk/servicebus/azure-messaging-servicebus/src/main/java/com/azure/messaging/servicebus/ServiceBusReceiverAsyncClient.java index 5206e8ab6c0ed..9a4c29faade1d 100644 --- a/sdk/servicebus/azure-messaging-servicebus/src/main/java/com/azure/messaging/servicebus/ServiceBusReceiverAsyncClient.java +++ b/sdk/servicebus/azure-messaging-servicebus/src/main/java/com/azure/messaging/servicebus/ServiceBusReceiverAsyncClient.java @@ -1262,9 +1262,7 @@ private ServiceBusAsyncConsumer getOrCreateConsumer() { new ServiceBusReceiveLinkProcessor(receiverOptions.getPrefetchCount(), retryPolicy, connectionProcessor, context)); final ServiceBusAsyncConsumer newConsumer = new ServiceBusAsyncConsumer(linkName, linkMessageProcessor, - messageSerializer, false, receiverOptions.autoLockRenewalEnabled(), - receiverOptions.getMaxAutoLockRenewalDuration(), connectionProcessor.getRetryOptions(), - (token, associatedLinkName) -> renewMessageLock(token, associatedLinkName)); + messageSerializer); // There could have been multiple threads trying to create this async consumer when the result was null. // If another one had set the value while we were creating this resource, dispose of newConsumer. @@ -1283,16 +1281,6 @@ ReceiverOptions getReceiverOptions() { return receiverOptions; } - /** - * Renews the message lock, and updates its value in the container. - */ - private Mono renewMessageLock(String lockToken, String linkName) { - return connectionProcessor - .flatMap(connection -> connection.getManagementNode(entityPath, entityType)) - .flatMap(serviceBusManagementNode -> - serviceBusManagementNode.renewMessageLock(lockToken, linkName)); - } - /** * If the receiver has not connected via {@link #receiveMessages()}, all its current operations have been performed * through the management node. diff --git a/sdk/servicebus/azure-messaging-servicebus/src/main/java/com/azure/messaging/servicebus/UnnamedSessionReceiver.java b/sdk/servicebus/azure-messaging-servicebus/src/main/java/com/azure/messaging/servicebus/UnnamedSessionReceiver.java index 5166b252999cb..079ae05b268d8 100644 --- a/sdk/servicebus/azure-messaging-servicebus/src/main/java/com/azure/messaging/servicebus/UnnamedSessionReceiver.java +++ b/sdk/servicebus/azure-messaging-servicebus/src/main/java/com/azure/messaging/servicebus/UnnamedSessionReceiver.java @@ -3,8 +3,6 @@ package com.azure.messaging.servicebus; import com.azure.core.amqp.AmqpRetryOptions; -import com.azure.core.amqp.exception.AmqpErrorContext; -import com.azure.core.amqp.exception.LinkErrorContext; import com.azure.core.amqp.implementation.MessageSerializer; import com.azure.core.util.CoreUtils; import com.azure.core.util.logging.ClientLogger; @@ -12,7 +10,6 @@ import com.azure.messaging.servicebus.implementation.MessageManagementOperations; import com.azure.messaging.servicebus.implementation.MessageUtils; import com.azure.messaging.servicebus.implementation.ServiceBusConstants; -import com.azure.messaging.servicebus.implementation.ServiceBusMessageProcessor; import com.azure.messaging.servicebus.implementation.ServiceBusReceiveLink; import org.apache.qpid.proton.amqp.transport.DeliveryState; import reactor.core.Disposable; @@ -75,10 +72,6 @@ class UnnamedSessionReceiver implements AutoCloseable { this.renewSessionLock = renewSessionLock; this.lockContainer = new MessageLockContainer(ServiceBusConstants.OPERATION_TIMEOUT); - final AmqpErrorContext errorContext = new LinkErrorContext(receiveLink.getHostname(), - receiveLink.getEntityPath(), null, null); - final SessionMessageManagement messageManagement = new SessionMessageManagement(receiveLink); - receiveLink.setEmptyCreditListener(() -> 1); final Flux receivedMessagesFlux = receiveLink @@ -89,15 +82,15 @@ class UnnamedSessionReceiver implements AutoCloseable { receiveLink.addCredits(prefetch); }) .takeUntilOther(cancelReceiveProcessor) - .map(message -> messageSerializer.deserialize(message, ServiceBusReceivedMessage.class)) - .subscribeWith(new ServiceBusMessageProcessor(receiveLink.getLinkName(), false, false, - Duration.ZERO, retryOptions, errorContext, messageManagement)) .map(message -> { - if (!CoreUtils.isNullOrEmpty(message.getLockToken())) { - lockContainer.addOrUpdate(message.getLockToken(), message.getLockedUntil()); + final ServiceBusReceivedMessage deserialized = messageSerializer.deserialize(message, + ServiceBusReceivedMessage.class); + + if (!CoreUtils.isNullOrEmpty(deserialized.getLockToken())) { + lockContainer.addOrUpdate(deserialized.getLockToken(), deserialized.getLockedUntil()); } - return new ServiceBusReceivedMessageContext(message); + return new ServiceBusReceivedMessageContext(deserialized); }) .onErrorResume(error -> { logger.warning("sessionId[{}]. Error occurred. Ending session.", sessionId, error); diff --git a/sdk/servicebus/azure-messaging-servicebus/src/main/java/com/azure/messaging/servicebus/implementation/ServiceBusMessageProcessor.java b/sdk/servicebus/azure-messaging-servicebus/src/main/java/com/azure/messaging/servicebus/implementation/ServiceBusMessageProcessor.java deleted file mode 100644 index fdff1753338e3..0000000000000 --- a/sdk/servicebus/azure-messaging-servicebus/src/main/java/com/azure/messaging/servicebus/implementation/ServiceBusMessageProcessor.java +++ /dev/null @@ -1,457 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.messaging.servicebus.implementation; - -import com.azure.core.amqp.AmqpRetryOptions; -import com.azure.core.amqp.exception.AmqpErrorCondition; -import com.azure.core.amqp.exception.AmqpErrorContext; -import com.azure.core.amqp.exception.AmqpException; -import com.azure.core.util.CoreUtils; -import com.azure.core.util.logging.ClientLogger; -import com.azure.messaging.servicebus.ServiceBusReceivedMessage; -import org.apache.qpid.proton.amqp.transport.DeliveryState; -import org.reactivestreams.Subscription; -import reactor.core.CoreSubscriber; -import reactor.core.Disposable; -import reactor.core.Disposables; -import reactor.core.Exceptions; -import reactor.core.publisher.EmitterProcessor; -import reactor.core.publisher.Flux; -import reactor.core.publisher.FluxProcessor; -import reactor.core.publisher.FluxSink; -import reactor.core.publisher.Mono; -import reactor.core.publisher.Operators; -import reactor.util.context.Context; - -import java.time.Duration; -import java.time.Instant; -import java.util.Deque; -import java.util.Objects; -import java.util.concurrent.ConcurrentLinkedDeque; -import java.util.concurrent.atomic.AtomicBoolean; -import java.util.concurrent.atomic.AtomicIntegerFieldUpdater; -import java.util.concurrent.atomic.AtomicLongFieldUpdater; -import java.util.concurrent.atomic.AtomicReferenceFieldUpdater; - -/** - * Processor that listens to upstream messages, pushes them downstream then completes it if necessary. - */ -public class ServiceBusMessageProcessor extends FluxProcessor - implements Subscription { - private final ClientLogger logger = new ClientLogger(ServiceBusMessageProcessor.class); - private final boolean isAutoComplete; - private final String linkName; - private final AmqpRetryOptions retryOptions; - private final AmqpErrorContext errorContext; - private final Deque messageQueue = new ConcurrentLinkedDeque<>(); - private final boolean isAutoRenewLock; - private final Duration maxAutoLockRenewal; - private final MessageManagementOperations managementOperations; - - public ServiceBusMessageProcessor(String linkName, boolean isAutoComplete, boolean isAutoRenewLock, - Duration maxAutoLockRenewal, AmqpRetryOptions retryOptions, AmqpErrorContext errorContext, - MessageManagementOperations managementOperations) { - - super(); - this.linkName = linkName; - - this.retryOptions = Objects.requireNonNull(retryOptions, "'retryOptions' cannot be null."); - this.errorContext = Objects.requireNonNull(errorContext, "'errorContext' cannot be null."); - this.managementOperations = managementOperations; - - this.isAutoComplete = isAutoComplete; - this.isAutoRenewLock = isAutoRenewLock; - this.maxAutoLockRenewal = maxAutoLockRenewal; - } - - private volatile boolean isDone; - private volatile CoreSubscriber downstream; - private volatile boolean isCancelled; - - volatile Subscription upstream; - private static final AtomicReferenceFieldUpdater UPSTREAM = - AtomicReferenceFieldUpdater.newUpdater(ServiceBusMessageProcessor.class, Subscription.class, - "upstream"); - - volatile int once; - static final AtomicIntegerFieldUpdater ONCE = - AtomicIntegerFieldUpdater.newUpdater(ServiceBusMessageProcessor.class, "once"); - - volatile int wip; - static final AtomicIntegerFieldUpdater WIP = - AtomicIntegerFieldUpdater.newUpdater(ServiceBusMessageProcessor.class, "wip"); - - volatile long requested; - static final AtomicLongFieldUpdater REQUESTED = - AtomicLongFieldUpdater.newUpdater(ServiceBusMessageProcessor.class, "requested"); - - volatile Throwable error; - static final AtomicReferenceFieldUpdater ERROR = - AtomicReferenceFieldUpdater.newUpdater(ServiceBusMessageProcessor.class, Throwable.class, "error"); - - /** - * Invoked when this subscribes to an upstream publisher. - * - * @param subscription Subscription for the upstream publisher. - */ - @Override - public void onSubscribe(Subscription subscription) { - Objects.requireNonNull(subscription, "'subscription' cannot be null."); - - if (Operators.setOnce(UPSTREAM, this, subscription)) { - subscription.request(1); - } else { - final Throwable error = logger.logExceptionAsError(new IllegalStateException( - "Processor cannot be subscribed to with multiple upstreams.")); - - onError(Operators.onOperatorError(subscription, error, Context.empty())); - } - } - - @Override - public boolean isTerminated() { - return isDone || isCancelled; - } - - @Override - public void onNext(ServiceBusReceivedMessage message) { - if (isTerminated()) { - final Context context = downstream == null ? currentContext() : downstream.currentContext(); - Operators.onNextDropped(message, context); - - return; - } - - messageQueue.add(message); - drain(); - } - - /** - * Invoked when an error occurs upstream. - * - * @param throwable Error that occurred upstream. - */ - @Override - public void onError(Throwable throwable) { - if (isDone || isCancelled) { - logger.error("Exception occurred from upstream when this is already terminated.", throwable); - Operators.onErrorDropped(throwable, currentContext()); - return; - } - - if (Exceptions.addThrowable(ERROR, this, throwable)) { - isDone = true; - } else { - Operators.onErrorDropped(throwable, currentContext()); - } - - drain(); - } - - /** - * Invoked when upstream has finished emitting items. - */ - @Override - public void onComplete() { - if (isDone) { - return; - } - - isDone = true; - drain(); - } - - @Override - public void request(long request) { - logger.info("Back-pressure request: {}", request); - if (Operators.validate(request)) { - Operators.addCap(REQUESTED, this, request); - - if (upstream != null) { - upstream.request(request); - } - - drain(); - } - } - - @Override - public void cancel() { - if (isCancelled) { - return; - } - - logger.verbose("Cancelling subscription."); - isCancelled = true; - drain(); - } - - @Override - public void dispose() { - if (isDone) { - return; - } - - logger.verbose("Disposing subscription."); - isDone = true; - drain(); - } - - @Override - public boolean isDisposed() { - return isDone || isCancelled; - } - - @Override - public void subscribe(CoreSubscriber downstream) { - Objects.requireNonNull(downstream, "'downstream' cannot be null."); - if (once == 0 && ONCE.compareAndSet(this, 0, 1)) { - this.downstream = downstream; - downstream.onSubscribe(this); - if (isCancelled) { - this.downstream = null; - } else { - drain(); - } - } else { - Operators.error(downstream, - new IllegalStateException("ServiceBusMessageSubscriber can only have one subscriber.")); - } - } - - private void drain() { - // If someone is already in this loop, then we are already clearing the queue. - if (!WIP.compareAndSet(this, 0, 1)) { - return; - } - - try { - drainQueue(); - } finally { - if (WIP.decrementAndGet(this) != 0) { - logger.warning("There is another worker in drainLoop. But there should only be 1 worker."); - } - } - } - - private void drainQueue() { - if (downstream == null) { - return; - } - - while (true) { - if (messageQueue.isEmpty()) { - break; - } - - long amountRequested = REQUESTED.get(this); - long emitted = drainRequested(amountRequested); - - // We emitted the correct number that was requested. - // Nothing more requested since. - if (REQUESTED.addAndGet(this, -emitted) == 0) { - break; - } - - if (isDone) { - break; - } - } - - if (isDone) { - if (error != null) { - downstream.onError(error); - } else if (messageQueue.peekLast() == null) { - downstream.onComplete(); - } else { - Operators.onDiscardQueueWithClear(messageQueue, downstream.currentContext(), null); - } - - downstream = null; - } - } - - /** - * Drains the queue of the requested amount and returns the number taken. - * - * @param numberRequested Number of items requested. - * - * @return The number of items emitted. - */ - private long drainRequested(long numberRequested) { - long numberEmitted = 0L; - - if (numberRequested == 0L) { - return numberEmitted; - } - - for (; numberEmitted < numberRequested; numberEmitted++) { - if (isDone) { - return numberEmitted; - } - - final ServiceBusReceivedMessage message = messageQueue.poll(); - if (message == null) { - break; - } - - if (isCancelled) { - Operators.onDiscard(message, downstream.currentContext()); - Operators.onDiscardQueueWithClear(messageQueue, downstream.currentContext(), null); - break; - } - - try { - next(message); - } catch (Exception e) { - setInternalError(e); - break; - } - } - - return numberEmitted; - } - - private void next(ServiceBusReceivedMessage message) { - final long sequenceNumber = message.getSequenceNumber(); - final String lockToken = message.getLockToken(); - final Instant initialLockedUntil = message.getLockedUntil(); - - if (isAutoComplete && CoreUtils.isNullOrEmpty(lockToken)) { - throw logger.logExceptionAsError(new IllegalStateException( - "Cannot auto-complete message without a lock token on message. Sequence number: " + sequenceNumber)); - } - - final AtomicBoolean hasError = new AtomicBoolean(); - final Disposable renewLockOperation = getRenewLockOperation(message, initialLockedUntil, hasError); - - try { - downstream.onNext(message); - } catch (Exception e) { - hasError.set(true); - logger.error("Exception occurred while handling downstream onNext operation.", e); - - if (isAutoComplete) { - logger.info("Abandoning message lock: {}", lockToken); - - final DeliveryState deliveryState = MessageUtils.getDeliveryState(DispositionStatus.ABANDONED, - null, null, null, null); - - managementOperations.updateDisposition(lockToken, deliveryState) - .onErrorContinue((error, item) -> { - logger.warning("Could not abandon message with lock: {}", lockToken, error); - setInternalError(error); - }) - .doFinally(signal -> logger.info("lock[{}]. Abandon status: [{}]", lockToken, signal)) - .block(retryOptions.getTryTimeout()); - } else { - setInternalError(e); - } - } finally { - renewLockOperation.dispose(); - } - - // An error occurred in downstream.onNext, while abandoning the message, - // or timed out while processing. We return. - if (hasError.get()) { - return; - } - - if (isAutoComplete) { - logger.info("sequenceNumber[{}]. lock[{}]. Completing message.", sequenceNumber, lockToken); - - final DeliveryState deliveryState = MessageUtils.getDeliveryState(DispositionStatus.COMPLETED, - null, null, null, null); - - managementOperations.updateDisposition(lockToken, deliveryState) - .onErrorResume(error -> { - logger.warning("Could not complete message with lock: {}", lockToken, error); - setInternalError(error); - return Mono.empty(); - }) - .doFinally(signal -> logger.verbose("lock[{}]. Complete status: [{}]", lockToken, signal)) - .block(retryOptions.getTryTimeout()); - } - } - - private Disposable getRenewLockOperation(ServiceBusReceivedMessage message, Instant initialLockedUntil, - AtomicBoolean hasError) { - - if (!isAutoRenewLock) { - return Disposables.disposed(); - } - - final String lockToken = message.getLockToken(); - - if (initialLockedUntil == null) { - throw logger.logExceptionAsError(new IllegalStateException( - "Cannot renew lock token without a value for 'message.getLockedUntil()'")); - } - - final Instant now = Instant.now(); - Duration initialInterval = Duration.between(now, initialLockedUntil); - if (initialInterval.isNegative()) { - logger.info("Duration was negative. now[{}] lockedUntil[{}]", now, initialLockedUntil); - initialInterval = Duration.ZERO; - } else { - final Duration adjusted = MessageUtils.adjustServerTimeout(initialInterval); - if (adjusted.isNegative()) { - logger.info("Adjusted duration is negative. Adjusted: {}ms", initialInterval.toMillis()); - } else { - initialInterval = adjusted; - } - } - - logger.info("lockToken[{}]. lockedUntil[{}]. firstInterval[{}].", lockToken, initialLockedUntil, - initialInterval); - - final EmitterProcessor emitterProcessor = EmitterProcessor.create(); - final FluxSink sink = emitterProcessor.sink(FluxSink.OverflowStrategy.BUFFER); - - // Adjust the interval, so we can buffer time for the time it'll take to refresh. - sink.next(MessageUtils.adjustServerTimeout(initialInterval)); - - final Disposable timeoutOperation = Mono.delay(maxAutoLockRenewal) - .subscribe(l -> { - if (!sink.isCancelled()) { - sink.error(new AmqpException(true, AmqpErrorCondition.TIMEOUT_ERROR, - "Could not complete within renewal time. Max renewal time: " + maxAutoLockRenewal, - errorContext)); - } - }); - - final Disposable renewLockSubscription = Flux.switchOnNext(emitterProcessor.map(i -> Flux.interval(i))) - .flatMap(delay -> { - logger.info("lockToken[{}]. now[{}]. Starting lock renewal.", lockToken, Instant.now()); - return managementOperations.renewMessageLock(lockToken, linkName); - }) - .map(instant -> { - final Duration next = Duration.between(Instant.now(), instant); - logger.info("lockToken[{}]. nextExpiration[{}]. Next renewal: [{}]", - lockToken, instant, next); - - sink.next(MessageUtils.adjustServerTimeout(next)); - return instant; - }) - .subscribe(lockedUntil -> { - logger.verbose("lockToken[{}]. lockedUntil[{}]. Lock renewal successful.", lockToken, - lockedUntil); - }, - error -> { - logger.error("Error occurred while renewing lock token.", error); - hasError.set(true); - setInternalError(error); - }, - () -> logger.info("Renewing lock token task completed.")); - - return Disposables.composite(renewLockSubscription, timeoutOperation); - } - - private void setInternalError(Throwable error) { - if (Exceptions.addThrowable(ERROR, this, error)) { - isDone = true; - } else { - Operators.onErrorDropped(error, downstream.currentContext()); - } - } -} diff --git a/sdk/servicebus/azure-messaging-servicebus/src/test/java/com/azure/messaging/servicebus/ServiceBusAsyncConsumerTest.java b/sdk/servicebus/azure-messaging-servicebus/src/test/java/com/azure/messaging/servicebus/ServiceBusAsyncConsumerTest.java index 9f3b99edb4f5e..97bd84a354205 100644 --- a/sdk/servicebus/azure-messaging-servicebus/src/test/java/com/azure/messaging/servicebus/ServiceBusAsyncConsumerTest.java +++ b/sdk/servicebus/azure-messaging-servicebus/src/test/java/com/azure/messaging/servicebus/ServiceBusAsyncConsumerTest.java @@ -4,7 +4,6 @@ package com.azure.messaging.servicebus; import com.azure.core.amqp.AmqpEndpointState; -import com.azure.core.amqp.AmqpRetryOptions; import com.azure.core.amqp.AmqpRetryPolicy; import com.azure.core.amqp.exception.AmqpErrorContext; import com.azure.core.amqp.implementation.MessageSerializer; @@ -32,13 +31,10 @@ import reactor.test.StepVerifier; import java.time.Duration; -import java.time.Instant; import java.util.UUID; -import java.util.function.BiFunction; import static org.mockito.ArgumentMatchers.any; import static org.mockito.ArgumentMatchers.anyString; -import static org.mockito.ArgumentMatchers.eq; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.never; import static org.mockito.Mockito.verify; @@ -54,8 +50,6 @@ class ServiceBusAsyncConsumerTest { private final EmitterProcessor endpointProcessor = EmitterProcessor.create(); private final FluxSink endpointProcessorSink = endpointProcessor.sink(); private final ClientLogger logger = new ClientLogger(ServiceBusAsyncConsumer.class); - private final AmqpRetryOptions retryOptions = new AmqpRetryOptions(); - private final Duration renewDuration = Duration.ofSeconds(5); private ServiceBusReceiveLinkProcessor linkProcessor; @@ -69,8 +63,6 @@ class ServiceBusAsyncConsumerTest { private Disposable parentConnection; @Mock private MessageSerializer serializer; - @Mock - private BiFunction> renewMessageLock; @BeforeAll static void beforeAll() { @@ -107,52 +99,13 @@ void teardown(TestInfo testInfo) { Mockito.framework().clearInlineMocks(); } - /** - * Verifies that we can receive messages from the processor and auto complete them. - */ - @Test - void receiveAutoComplete() { - // Arrange - final boolean isAutoComplete = true; - final ServiceBusAsyncConsumer consumer = new ServiceBusAsyncConsumer(LINK_NAME, linkProcessor, - serializer, isAutoComplete, false, renewDuration, retryOptions, renewMessageLock); - - when(link.getCredits()).thenReturn(1); - - final Message message1 = mock(Message.class); - final Message message2 = mock(Message.class); - final ServiceBusReceivedMessage receivedMessage1 = mock(ServiceBusReceivedMessage.class); - final String lockToken1 = UUID.randomUUID().toString(); - final ServiceBusReceivedMessage receivedMessage2 = mock(ServiceBusReceivedMessage.class); - final String lockToken2 = UUID.randomUUID().toString(); - - when(receivedMessage1.getLockToken()).thenReturn(lockToken1); - when(receivedMessage2.getLockToken()).thenReturn(lockToken2); - - when(serializer.deserialize(message1, ServiceBusReceivedMessage.class)).thenReturn(receivedMessage1); - when(serializer.deserialize(message2, ServiceBusReceivedMessage.class)).thenReturn(receivedMessage2); - - // Act and Assert - StepVerifier.create(consumer.receive().take(2)) - .then(() -> { - messageProcessorSink.next(message1); - messageProcessorSink.next(message2); - }) - .expectNext(receivedMessage1, receivedMessage2) - .verifyComplete(); - - verify(link).updateDisposition(eq(lockToken1), eq(Accepted.getInstance())); - } - /** * Verifies that we can receive messages from the processor and it does not auto complete them. */ @Test void receiveNoAutoComplete() { // Arrange - final boolean isAutoComplete = false; - final ServiceBusAsyncConsumer consumer = new ServiceBusAsyncConsumer(LINK_NAME, linkProcessor, serializer, - isAutoComplete, false, renewDuration, retryOptions, renewMessageLock); + final ServiceBusAsyncConsumer consumer = new ServiceBusAsyncConsumer(LINK_NAME, linkProcessor, serializer); final Message message1 = mock(Message.class); final Message message2 = mock(Message.class); @@ -185,13 +138,11 @@ void receiveNoAutoComplete() { @Test void canDispose() { // Arrange - final boolean isAutoComplete = false; final String lockToken = UUID.randomUUID().toString(); when(linkProcessor.updateDisposition(lockToken, Accepted.getInstance())) .thenReturn(Mono.error(new IllegalArgumentException("Should not have called complete."))); - final ServiceBusAsyncConsumer consumer = new ServiceBusAsyncConsumer(LINK_NAME, linkProcessor, - serializer, isAutoComplete, false, renewDuration, retryOptions, renewMessageLock); + final ServiceBusAsyncConsumer consumer = new ServiceBusAsyncConsumer(LINK_NAME, linkProcessor, serializer); final Message message1 = mock(Message.class); final ServiceBusReceivedMessage receivedMessage1 = mock(ServiceBusReceivedMessage.class); diff --git a/sdk/servicebus/azure-messaging-servicebus/src/test/java/com/azure/messaging/servicebus/implementation/ServiceBusMessageProcessorTest.java b/sdk/servicebus/azure-messaging-servicebus/src/test/java/com/azure/messaging/servicebus/implementation/ServiceBusMessageProcessorTest.java deleted file mode 100644 index e458b17cc77ae..0000000000000 --- a/sdk/servicebus/azure-messaging-servicebus/src/test/java/com/azure/messaging/servicebus/implementation/ServiceBusMessageProcessorTest.java +++ /dev/null @@ -1,284 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.messaging.servicebus.implementation; - -import com.azure.core.amqp.AmqpRetryOptions; -import com.azure.core.amqp.exception.AmqpErrorCondition; -import com.azure.core.amqp.exception.AmqpErrorContext; -import com.azure.core.amqp.exception.AmqpException; -import com.azure.core.amqp.exception.LinkErrorContext; -import com.azure.core.util.logging.ClientLogger; -import com.azure.messaging.servicebus.ServiceBusReceivedMessage; -import org.apache.qpid.proton.amqp.messaging.Accepted; -import org.apache.qpid.proton.amqp.transport.DeliveryState; -import org.junit.jupiter.api.AfterEach; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; -import org.mockito.Mock; -import org.mockito.Mockito; -import org.mockito.MockitoAnnotations; -import reactor.core.publisher.Mono; -import reactor.test.StepVerifier; - -import java.time.Duration; -import java.time.Instant; -import java.util.UUID; -import java.util.concurrent.TimeUnit; - -import static com.azure.messaging.servicebus.TestUtils.createMessageSink; -import static org.mockito.ArgumentMatchers.any; -import static org.mockito.ArgumentMatchers.anyString; -import static org.mockito.Mockito.atLeast; -import static org.mockito.Mockito.never; -import static org.mockito.Mockito.verify; -import static org.mockito.Mockito.verifyZeroInteractions; -import static org.mockito.Mockito.when; - -class ServiceBusMessageProcessorTest { - private static final String LINK_NAME = "some-link"; - @Mock - private ServiceBusReceivedMessage message1; - @Mock - private ServiceBusReceivedMessage message2; - @Mock - private ServiceBusReceivedMessage message3; - @Mock - private ServiceBusReceivedMessage message4; - - @Mock - private MessageManagementOperations messageManagementOperations; - - private final AmqpErrorContext errorContext = new LinkErrorContext("foo", "bar", "link-name", 10); - private final ClientLogger logger = new ClientLogger(ServiceBusMessageProcessorTest.class); - private final AmqpRetryOptions retryOptions = new AmqpRetryOptions(); - - @BeforeEach - void setup() { - MockitoAnnotations.initMocks(this); - when(messageManagementOperations.updateDisposition(anyString(), any(DeliveryState.class))) - .thenReturn(Mono.empty()); - } - - @AfterEach - void teardown() { - Mockito.framework().clearInlineMocks(); - } - - /** - * Verifies that all messages are emitted downstream. - */ - @Test - void autoCompletesNoAutoRenew() { - // Arrange - final String lock1 = UUID.randomUUID().toString(); - final String lock2 = UUID.randomUUID().toString(); - final String lock3 = UUID.randomUUID().toString(); - final String lock4 = UUID.randomUUID().toString(); - - when(message1.getLockToken()).thenReturn(lock1); - when(message2.getLockToken()).thenReturn(lock2); - when(message3.getLockToken()).thenReturn(lock3); - when(message4.getLockToken()).thenReturn(lock4); - - final ServiceBusMessageProcessor processor = createMessageSink(message1, message2, message3, message4) - .subscribeWith(new ServiceBusMessageProcessor(LINK_NAME, true, false, Duration.ZERO, - retryOptions, errorContext, messageManagementOperations)); - - // Act & Assert - StepVerifier.create(processor) - .expectNext(message1, message2, message3, message4) - .verifyComplete(); - - verify(messageManagementOperations).updateDisposition(lock1, Accepted.getInstance()); - verify(messageManagementOperations).updateDisposition(lock2, Accepted.getInstance()); - verify(messageManagementOperations).updateDisposition(lock3, Accepted.getInstance()); - } - - /** - * Verifies that all messages are emitted downstream. - */ - @Disabled("Fails on Ubuntu 18") - @Test - void autoCompletesAndAutoRenews() { - // Arrange - final Duration maxRenewDuration = Duration.ofSeconds(60); - - final String lock1 = UUID.randomUUID().toString(); - final String lock2 = UUID.randomUUID().toString(); - when(message1.getLockToken()).thenReturn(lock1); - when(message1.getLockedUntil()).thenAnswer(invocationOnMock -> Instant.now().plusSeconds(3)); - - when(message2.getLockToken()).thenReturn(lock2); - when(message2.getLockedUntil()).thenAnswer(invocationOnMock -> Instant.now().plusSeconds(5)); - - when(messageManagementOperations.renewMessageLock(lock1, LINK_NAME)) - .thenAnswer(invocationOnMock -> Mono.just(Instant.now().plusSeconds(3))); - - final ServiceBusMessageProcessor processor = createMessageSink(message1, message2) - .subscribeWith(new ServiceBusMessageProcessor(LINK_NAME, true, true, maxRenewDuration, - retryOptions, errorContext, messageManagementOperations)); - - // Act & Assert - StepVerifier.create(processor) - .assertNext(m -> { - Assertions.assertSame(message1, m); - - logger.info("Now: {}", Instant.now()); - try { - TimeUnit.SECONDS.sleep(15); - } catch (InterruptedException ignored) { - } - logger.info("After: {}", Instant.now()); - }) - .expectNext(message2) - .verifyComplete(); - - verify(messageManagementOperations, atLeast(3)).renewMessageLock(lock1, LINK_NAME); - verify(messageManagementOperations).updateDisposition(lock1, Accepted.getInstance()); - verify(messageManagementOperations).updateDisposition(lock2, Accepted.getInstance()); - } - - /** - * Verifies that all messages are emitted downstream and auto complete is not invoked. - */ - @Test - void emitsDoesNotAutoCompleteOrRenew() { - // Arrange - final ServiceBusMessageProcessor processor = createMessageSink(message1, message2, message3, message4) - .subscribeWith(new ServiceBusMessageProcessor(LINK_NAME, false, false, Duration.ZERO, - retryOptions, errorContext, messageManagementOperations)); - - // Act & Assert - StepVerifier.create(processor) - .expectNext(message1, message2, message3, message4) - .verifyComplete(); - - verifyZeroInteractions(messageManagementOperations); - } - - /** - * When the max auto-renewal time has elapsed, we throw an error. - */ - @Disabled("Fails on Ubuntu 18") - @Test - void autoRenewExpires() { - // Arrange - final Duration maxRenewDuration = Duration.ofSeconds(4); - final String lock1 = UUID.randomUUID().toString(); - final String lock2 = UUID.randomUUID().toString(); - when(message1.getLockToken()).thenReturn(lock1); - when(message1.getLockedUntil()).thenAnswer(invocationOnMock -> Instant.now().plusSeconds(3)); - - when(message2.getLockToken()).thenReturn(lock2); - when(message2.getLockedUntil()).thenAnswer(invocationOnMock -> Instant.now().plusSeconds(5)); - - when(messageManagementOperations.renewMessageLock(lock1, LINK_NAME)) - .thenAnswer(invocationOnMock -> Mono.just(Instant.now().plusSeconds(7))); - - final ServiceBusMessageProcessor processor = createMessageSink(message1, message2) - .subscribeWith(new ServiceBusMessageProcessor(LINK_NAME, true, true, maxRenewDuration, - retryOptions, errorContext, messageManagementOperations)); - - // Act & Assert - StepVerifier.create(processor) - .assertNext(m -> { - Assertions.assertSame(message1, m); - - logger.info("Now: {}", Instant.now()); - try { - TimeUnit.SECONDS.sleep(6); - } catch (InterruptedException ignored) { - } - logger.info("After: {}", Instant.now()); - }) - .expectErrorSatisfies(error -> { - Assertions.assertTrue(error instanceof AmqpException); - Assertions.assertEquals(AmqpErrorCondition.TIMEOUT_ERROR, ((AmqpException) error).getErrorCondition()); - }) - .verify(); - - verify(messageManagementOperations).renewMessageLock(lock1, LINK_NAME); - verifyZeroInteractions(message2); - verify(messageManagementOperations, never()).updateDisposition(anyString(), any()); - } - - /** - * When an error occurs in auto-renew lock we stop processing the next items. - */ - @Disabled("Fails on Ubuntu 18") - @Test - void autoRenewOperationErrors() { - // Arrange - final Duration maxRenewDuration = Duration.ofSeconds(20); - final String lock1 = UUID.randomUUID().toString(); - final String lock2 = UUID.randomUUID().toString(); - when(message1.getLockToken()).thenReturn(lock1); - when(message1.getLockedUntil()).thenAnswer(invocationOnMock -> Instant.now().plusSeconds(3)); - - when(message2.getLockToken()).thenReturn(lock2); - when(message2.getLockedUntil()).thenAnswer(invocationOnMock -> Instant.now().plusSeconds(5)); - - when(messageManagementOperations.renewMessageLock(anyString(), any())) - .thenAnswer(invocationOnMock -> Mono.error(new IllegalArgumentException("Test error occurred."))); - - final ServiceBusMessageProcessor processor = createMessageSink(message1, message2) - .subscribeWith(new ServiceBusMessageProcessor(LINK_NAME, true, true, maxRenewDuration, - retryOptions, errorContext, messageManagementOperations)); - - // Act & Assert - StepVerifier.create(processor) - .assertNext(m -> { - Assertions.assertSame(message1, m); - - logger.info("Now: {}", Instant.now()); - try { - TimeUnit.SECONDS.sleep(10); - } catch (InterruptedException ignored) { - } - logger.info("After: {}", Instant.now()); - }) - .expectError(IllegalArgumentException.class) - .verify(); - - verifyZeroInteractions(message2); - verify(messageManagementOperations, never()).updateDisposition(lock1, Accepted.getInstance()); - } - - /** - * When an error occurs in complete, we stop processing the next items. - */ - @Test - void completeOperationErrors() { - // Arrange - final Duration maxRenewDuration = Duration.ofSeconds(10); - final String lock1 = UUID.randomUUID().toString(); - final String lock2 = UUID.randomUUID().toString(); - when(message1.getLockToken()).thenReturn(lock1); - when(message1.getLockedUntil()).thenAnswer(invocationOnMock -> Instant.now().plusSeconds(3)); - - when(message2.getLockToken()).thenReturn(lock2); - when(message2.getLockedUntil()).thenAnswer(invocationOnMock -> Instant.now().plusSeconds(5)); - - when(messageManagementOperations.updateDisposition(lock1, Accepted.getInstance())).thenAnswer( - invocationOnMock -> Mono.error(new IllegalArgumentException("Test error occurred."))); - - when(messageManagementOperations.renewMessageLock(anyString(), anyString())).thenReturn(Mono.empty()); - - final ServiceBusMessageProcessor processor = createMessageSink(message1, message2) - .subscribeWith(new ServiceBusMessageProcessor(LINK_NAME, true, true, maxRenewDuration, - retryOptions, errorContext, messageManagementOperations)); - - // Act & Assert - StepVerifier.create(processor) - .expectNext(message1) - .expectError(IllegalArgumentException.class) - .verify(); - - verify(messageManagementOperations).updateDisposition(lock1, Accepted.getInstance()); - - verifyZeroInteractions(message2); - verify(messageManagementOperations, never()).renewMessageLock(anyString(), anyString()); - } -} From dc84cf7dbff8e0932c199bfd68b196ff5be2e61b Mon Sep 17 00:00:00 2001 From: Azure SDK Bot <53356347+azure-sdk@users.noreply.github.com> Date: Tue, 7 Jul 2020 21:42:47 -0700 Subject: [PATCH 046/129] Increment package version after release of com.azure azure-data-appconfiguration (#12888) --- eng/jacoco-test-coverage/pom.xml | 2 +- eng/versioning/version_client.txt | 2 +- sdk/appconfiguration/azure-data-appconfiguration/CHANGELOG.md | 3 +++ sdk/appconfiguration/azure-data-appconfiguration/pom.xml | 2 +- 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/eng/jacoco-test-coverage/pom.xml b/eng/jacoco-test-coverage/pom.xml index 6121e1b7a27e0..087e1e930345e 100644 --- a/eng/jacoco-test-coverage/pom.xml +++ b/eng/jacoco-test-coverage/pom.xml @@ -114,7 +114,7 @@ com.azure azure-data-appconfiguration - 1.1.3 + 1.2.0-beta.1 com.azure diff --git a/eng/versioning/version_client.txt b/eng/versioning/version_client.txt index 27a58ba719638..fde00a4e1bb60 100644 --- a/eng/versioning/version_client.txt +++ b/eng/versioning/version_client.txt @@ -21,7 +21,7 @@ com.azure:azure-core-test;1.3.1;1.4.0-beta.1 com.azure:azure-core-tracing-opentelemetry;1.0.0-beta.5;1.0.0-beta.6 com.azure:azure-cosmos;4.1.0;4.2.0-beta.1 com.azure:azure-cosmos-benchmark;4.0.1-beta.1;4.0.1-beta.1 -com.azure:azure-data-appconfiguration;1.1.2;1.1.3 +com.azure:azure-data-appconfiguration;1.1.3;1.2.0-beta.1 com.azure:azure-data-schemaregistry;1.0.0-beta.2;1.0.0-beta.3 com.azure:azure-data-schemaregistry-avro;1.0.0-beta.2;1.0.0-beta.3 com.azure:azure-data-tables;1.0.0-beta.1;1.0.0-beta.1 diff --git a/sdk/appconfiguration/azure-data-appconfiguration/CHANGELOG.md b/sdk/appconfiguration/azure-data-appconfiguration/CHANGELOG.md index 9007d51c636ef..cefee3c235221 100644 --- a/sdk/appconfiguration/azure-data-appconfiguration/CHANGELOG.md +++ b/sdk/appconfiguration/azure-data-appconfiguration/CHANGELOG.md @@ -1,4 +1,7 @@ # Release History +## 1.2.0-beta.1 (Unreleased) + + ## 1.1.3 (2020-07-07) - Update dependency version, `azure-core` to 1.6.0 and `azure-core-http-netty` to 1.5.3. diff --git a/sdk/appconfiguration/azure-data-appconfiguration/pom.xml b/sdk/appconfiguration/azure-data-appconfiguration/pom.xml index 84d0bfd1a5137..d2e314817ee95 100644 --- a/sdk/appconfiguration/azure-data-appconfiguration/pom.xml +++ b/sdk/appconfiguration/azure-data-appconfiguration/pom.xml @@ -13,7 +13,7 @@ com.azure azure-data-appconfiguration - 1.1.3 + 1.2.0-beta.1 Microsoft Azure client library for App Configuration This package contains the Microsoft Azure App Configuration client library. From 67ab775ce4661a0f147992a11c062eb3d067de11 Mon Sep 17 00:00:00 2001 From: Weidong Xu Date: Wed, 8 Jul 2020 13:31:35 +0800 Subject: [PATCH 047/129] open to azure-core, for f.setAccessible(true); in FlatteningSerializer (#12863) --- .../src/main/java/module-info.java | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/sdk/core/azure-core-management/src/main/java/module-info.java b/sdk/core/azure-core-management/src/main/java/module-info.java index c4cad3ac196e2..4c3b3e3480bbe 100644 --- a/sdk/core/azure-core-management/src/main/java/module-info.java +++ b/sdk/core/azure-core-management/src/main/java/module-info.java @@ -9,9 +9,14 @@ exports com.azure.core.management.serializer; exports com.azure.core.management.exception; - opens com.azure.core.management to com.fasterxml.jackson.databind; - opens com.azure.core.management.exception to com.fasterxml.jackson.databind; - opens com.azure.core.management.implementation.polling to com.fasterxml.jackson.databind; + opens com.azure.core.management to + com.fasterxml.jackson.databind, + com.azure.core; + opens com.azure.core.management.exception to + com.fasterxml.jackson.databind, + com.azure.core; + opens com.azure.core.management.implementation.polling to + com.fasterxml.jackson.databind; uses com.azure.core.http.HttpClientProvider; } From d59bd7c75452f4ac1d676e20f4f4279fb95b57ec Mon Sep 17 00:00:00 2001 From: Weidong Xu Date: Wed, 8 Jul 2020 17:18:27 +0800 Subject: [PATCH 048/129] move AzureServiceClient to fluentcore (#12908) --- .../AppPlatformManagementClient.java | 2 +- .../appservice/WebSiteManagementClient.java | 2 +- .../AuthorizationManagementClient.java | 2 +- .../GraphRbacManagementClient.java | 2 +- .../compute/ComputeManagementClient.java | 2 +- .../ContainerRegistryManagementClient.java | 2 +- .../ContainerServiceManagementClient.java | 2 +- .../cosmos/CosmosDBManagementClient.java | 2 +- .../dns/DnsManagementClient.java | 2 +- .../keyvault/KeyVaultManagementClient.java | 2 +- .../msi/ManagedServiceIdentityClient.java | 2 +- .../monitor/MonitorClient.java | 2 +- .../network/NetworkManagementClient.java | 2 +- .../azure/resourcemanager/package-info.java | 8 --- .../resources/FeatureClient.java | 2 +- .../resources/PolicyClient.java | 2 +- .../resources/ResourceManagementClient.java | 2 +- .../resources/SubscriptionClient.java | 2 +- .../fluentcore}/AzureServiceClient.java | 56 +------------------ .../resources/fluentcore/package-info.java | 7 +++ .../sql/SqlManagementClient.java | 2 +- .../storage/StorageManagementClient.java | 2 +- 22 files changed, 29 insertions(+), 80 deletions(-) delete mode 100644 sdk/resources/mgmt/src/main/java/com/azure/resourcemanager/package-info.java rename sdk/resources/mgmt/src/main/java/com/azure/resourcemanager/{ => resources/fluentcore}/AzureServiceClient.java (79%) create mode 100644 sdk/resources/mgmt/src/main/java/com/azure/resourcemanager/resources/fluentcore/package-info.java diff --git a/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/AppPlatformManagementClient.java b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/AppPlatformManagementClient.java index 4954f555b43b7..9283a8306343f 100644 --- a/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/AppPlatformManagementClient.java +++ b/sdk/appplatform/mgmt/src/main/java/com/azure/resourcemanager/appplatform/AppPlatformManagementClient.java @@ -8,7 +8,7 @@ import com.azure.core.http.HttpPipeline; import com.azure.core.management.AzureEnvironment; import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.AzureServiceClient; +import com.azure.resourcemanager.resources.fluentcore.AzureServiceClient; import com.azure.resourcemanager.appplatform.fluent.AppsClient; import com.azure.resourcemanager.appplatform.fluent.BindingsClient; import com.azure.resourcemanager.appplatform.fluent.CertificatesClient; diff --git a/sdk/appservice/mgmt/src/main/java/com/azure/resourcemanager/appservice/WebSiteManagementClient.java b/sdk/appservice/mgmt/src/main/java/com/azure/resourcemanager/appservice/WebSiteManagementClient.java index cc535c6cd6a4b..0381c1d7c68c3 100644 --- a/sdk/appservice/mgmt/src/main/java/com/azure/resourcemanager/appservice/WebSiteManagementClient.java +++ b/sdk/appservice/mgmt/src/main/java/com/azure/resourcemanager/appservice/WebSiteManagementClient.java @@ -8,7 +8,7 @@ import com.azure.core.http.HttpPipeline; import com.azure.core.management.AzureEnvironment; import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.AzureServiceClient; +import com.azure.resourcemanager.resources.fluentcore.AzureServiceClient; import com.azure.resourcemanager.appservice.fluent.AppServiceCertificateOrdersClient; import com.azure.resourcemanager.appservice.fluent.AppServiceEnvironmentsClient; import com.azure.resourcemanager.appservice.fluent.AppServicePlansClient; diff --git a/sdk/authorization/mgmt/src/main/java/com/azure/resourcemanager/authorization/AuthorizationManagementClient.java b/sdk/authorization/mgmt/src/main/java/com/azure/resourcemanager/authorization/AuthorizationManagementClient.java index b066d4f1efc7d..771fd39411678 100644 --- a/sdk/authorization/mgmt/src/main/java/com/azure/resourcemanager/authorization/AuthorizationManagementClient.java +++ b/sdk/authorization/mgmt/src/main/java/com/azure/resourcemanager/authorization/AuthorizationManagementClient.java @@ -8,7 +8,7 @@ import com.azure.core.http.HttpPipeline; import com.azure.core.management.AzureEnvironment; import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.AzureServiceClient; +import com.azure.resourcemanager.resources.fluentcore.AzureServiceClient; import com.azure.resourcemanager.authorization.fluent.ClassicAdministratorsClient; import com.azure.resourcemanager.authorization.fluent.GlobalAdministratorsClient; import com.azure.resourcemanager.authorization.fluent.PermissionsClient; diff --git a/sdk/authorization/mgmt/src/main/java/com/azure/resourcemanager/authorization/GraphRbacManagementClient.java b/sdk/authorization/mgmt/src/main/java/com/azure/resourcemanager/authorization/GraphRbacManagementClient.java index 06134b8541e79..4f970c456d802 100644 --- a/sdk/authorization/mgmt/src/main/java/com/azure/resourcemanager/authorization/GraphRbacManagementClient.java +++ b/sdk/authorization/mgmt/src/main/java/com/azure/resourcemanager/authorization/GraphRbacManagementClient.java @@ -8,7 +8,7 @@ import com.azure.core.http.HttpPipeline; import com.azure.core.management.AzureEnvironment; import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.AzureServiceClient; +import com.azure.resourcemanager.resources.fluentcore.AzureServiceClient; import com.azure.resourcemanager.authorization.fluent.ApplicationsClient; import com.azure.resourcemanager.authorization.fluent.DeletedApplicationsClient; import com.azure.resourcemanager.authorization.fluent.DomainsClient; diff --git a/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/ComputeManagementClient.java b/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/ComputeManagementClient.java index 5b16ce322a013..c2c288d7c6fe2 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/ComputeManagementClient.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/ComputeManagementClient.java @@ -8,7 +8,7 @@ import com.azure.core.http.HttpPipeline; import com.azure.core.management.AzureEnvironment; import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.AzureServiceClient; +import com.azure.resourcemanager.resources.fluentcore.AzureServiceClient; import com.azure.resourcemanager.compute.fluent.AvailabilitySetsClient; import com.azure.resourcemanager.compute.fluent.ContainerServicesClient; import com.azure.resourcemanager.compute.fluent.DedicatedHostGroupsClient; diff --git a/sdk/containerregistry/mgmt/src/main/java/com/azure/resourcemanager/containerregistry/ContainerRegistryManagementClient.java b/sdk/containerregistry/mgmt/src/main/java/com/azure/resourcemanager/containerregistry/ContainerRegistryManagementClient.java index 4b9dcf1a63c45..18360da80224d 100644 --- a/sdk/containerregistry/mgmt/src/main/java/com/azure/resourcemanager/containerregistry/ContainerRegistryManagementClient.java +++ b/sdk/containerregistry/mgmt/src/main/java/com/azure/resourcemanager/containerregistry/ContainerRegistryManagementClient.java @@ -8,7 +8,7 @@ import com.azure.core.http.HttpPipeline; import com.azure.core.management.AzureEnvironment; import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.AzureServiceClient; +import com.azure.resourcemanager.resources.fluentcore.AzureServiceClient; import com.azure.resourcemanager.containerregistry.fluent.OperationsClient; import com.azure.resourcemanager.containerregistry.fluent.RegistriesClient; import com.azure.resourcemanager.containerregistry.fluent.ReplicationsClient; diff --git a/sdk/containerservice/mgmt/src/main/java/com/azure/resourcemanager/containerservice/ContainerServiceManagementClient.java b/sdk/containerservice/mgmt/src/main/java/com/azure/resourcemanager/containerservice/ContainerServiceManagementClient.java index 9903234e609c7..82e9c1d84092e 100644 --- a/sdk/containerservice/mgmt/src/main/java/com/azure/resourcemanager/containerservice/ContainerServiceManagementClient.java +++ b/sdk/containerservice/mgmt/src/main/java/com/azure/resourcemanager/containerservice/ContainerServiceManagementClient.java @@ -8,7 +8,7 @@ import com.azure.core.http.HttpPipeline; import com.azure.core.management.AzureEnvironment; import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.AzureServiceClient; +import com.azure.resourcemanager.resources.fluentcore.AzureServiceClient; import com.azure.resourcemanager.containerservice.fluent.AgentPoolsClient; import com.azure.resourcemanager.containerservice.fluent.ContainerServicesClient; import com.azure.resourcemanager.containerservice.fluent.ManagedClustersClient; diff --git a/sdk/cosmos/mgmt/src/main/java/com/azure/resourcemanager/cosmos/CosmosDBManagementClient.java b/sdk/cosmos/mgmt/src/main/java/com/azure/resourcemanager/cosmos/CosmosDBManagementClient.java index ec633089b9416..32bdc2f406e24 100644 --- a/sdk/cosmos/mgmt/src/main/java/com/azure/resourcemanager/cosmos/CosmosDBManagementClient.java +++ b/sdk/cosmos/mgmt/src/main/java/com/azure/resourcemanager/cosmos/CosmosDBManagementClient.java @@ -8,7 +8,7 @@ import com.azure.core.http.HttpPipeline; import com.azure.core.management.AzureEnvironment; import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.AzureServiceClient; +import com.azure.resourcemanager.resources.fluentcore.AzureServiceClient; import com.azure.resourcemanager.cosmos.fluent.CassandraResourcesClient; import com.azure.resourcemanager.cosmos.fluent.CollectionPartitionRegionsClient; import com.azure.resourcemanager.cosmos.fluent.CollectionPartitionsClient; diff --git a/sdk/dns/mgmt/src/main/java/com/azure/resourcemanager/dns/DnsManagementClient.java b/sdk/dns/mgmt/src/main/java/com/azure/resourcemanager/dns/DnsManagementClient.java index 8a82220944c3f..f1e04727b8965 100644 --- a/sdk/dns/mgmt/src/main/java/com/azure/resourcemanager/dns/DnsManagementClient.java +++ b/sdk/dns/mgmt/src/main/java/com/azure/resourcemanager/dns/DnsManagementClient.java @@ -8,7 +8,7 @@ import com.azure.core.http.HttpPipeline; import com.azure.core.management.AzureEnvironment; import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.AzureServiceClient; +import com.azure.resourcemanager.resources.fluentcore.AzureServiceClient; import com.azure.resourcemanager.dns.fluent.RecordSetsClient; import com.azure.resourcemanager.dns.fluent.ZonesClient; diff --git a/sdk/keyvault/mgmt/src/main/java/com/azure/resourcemanager/keyvault/KeyVaultManagementClient.java b/sdk/keyvault/mgmt/src/main/java/com/azure/resourcemanager/keyvault/KeyVaultManagementClient.java index 7087cb2f411ff..08385e8b095c7 100644 --- a/sdk/keyvault/mgmt/src/main/java/com/azure/resourcemanager/keyvault/KeyVaultManagementClient.java +++ b/sdk/keyvault/mgmt/src/main/java/com/azure/resourcemanager/keyvault/KeyVaultManagementClient.java @@ -8,7 +8,7 @@ import com.azure.core.http.HttpPipeline; import com.azure.core.management.AzureEnvironment; import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.AzureServiceClient; +import com.azure.resourcemanager.resources.fluentcore.AzureServiceClient; import com.azure.resourcemanager.keyvault.fluent.OperationsClient; import com.azure.resourcemanager.keyvault.fluent.PrivateEndpointConnectionsClient; import com.azure.resourcemanager.keyvault.fluent.PrivateLinkResourcesClient; diff --git a/sdk/managedserviceidentity/mgmt/src/main/java/com/azure/resourcemanager/msi/ManagedServiceIdentityClient.java b/sdk/managedserviceidentity/mgmt/src/main/java/com/azure/resourcemanager/msi/ManagedServiceIdentityClient.java index 43a5c1f9c6eb8..fb7ecbe32f5b0 100644 --- a/sdk/managedserviceidentity/mgmt/src/main/java/com/azure/resourcemanager/msi/ManagedServiceIdentityClient.java +++ b/sdk/managedserviceidentity/mgmt/src/main/java/com/azure/resourcemanager/msi/ManagedServiceIdentityClient.java @@ -8,7 +8,7 @@ import com.azure.core.http.HttpPipeline; import com.azure.core.management.AzureEnvironment; import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.AzureServiceClient; +import com.azure.resourcemanager.resources.fluentcore.AzureServiceClient; import com.azure.resourcemanager.msi.fluent.OperationsClient; import com.azure.resourcemanager.msi.fluent.SystemAssignedIdentitiesClient; import com.azure.resourcemanager.msi.fluent.UserAssignedIdentitiesClient; diff --git a/sdk/monitor/mgmt/src/main/java/com/azure/resourcemanager/monitor/MonitorClient.java b/sdk/monitor/mgmt/src/main/java/com/azure/resourcemanager/monitor/MonitorClient.java index f1181b9a9fedf..209b257180c24 100644 --- a/sdk/monitor/mgmt/src/main/java/com/azure/resourcemanager/monitor/MonitorClient.java +++ b/sdk/monitor/mgmt/src/main/java/com/azure/resourcemanager/monitor/MonitorClient.java @@ -8,7 +8,7 @@ import com.azure.core.http.HttpPipeline; import com.azure.core.management.AzureEnvironment; import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.AzureServiceClient; +import com.azure.resourcemanager.resources.fluentcore.AzureServiceClient; import com.azure.resourcemanager.monitor.fluent.ActionGroupsClient; import com.azure.resourcemanager.monitor.fluent.ActivityLogAlertsClient; import com.azure.resourcemanager.monitor.fluent.ActivityLogsClient; diff --git a/sdk/network/mgmt/src/main/java/com/azure/resourcemanager/network/NetworkManagementClient.java b/sdk/network/mgmt/src/main/java/com/azure/resourcemanager/network/NetworkManagementClient.java index 0a9c2bb1bf026..3eeb315c35510 100644 --- a/sdk/network/mgmt/src/main/java/com/azure/resourcemanager/network/NetworkManagementClient.java +++ b/sdk/network/mgmt/src/main/java/com/azure/resourcemanager/network/NetworkManagementClient.java @@ -33,7 +33,7 @@ import com.azure.core.util.logging.ClientLogger; import com.azure.core.util.polling.PollerFlux; import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.AzureServiceClient; +import com.azure.resourcemanager.resources.fluentcore.AzureServiceClient; import com.azure.resourcemanager.network.fluent.ApplicationGatewaysClient; import com.azure.resourcemanager.network.fluent.ApplicationSecurityGroupsClient; import com.azure.resourcemanager.network.fluent.AvailableDelegationsClient; diff --git a/sdk/resources/mgmt/src/main/java/com/azure/resourcemanager/package-info.java b/sdk/resources/mgmt/src/main/java/com/azure/resourcemanager/package-info.java deleted file mode 100644 index 5e7574c51433c..0000000000000 --- a/sdk/resources/mgmt/src/main/java/com/azure/resourcemanager/package-info.java +++ /dev/null @@ -1,8 +0,0 @@ -// 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 base classes for management sdk. - */ -package com.azure.resourcemanager; diff --git a/sdk/resources/mgmt/src/main/java/com/azure/resourcemanager/resources/FeatureClient.java b/sdk/resources/mgmt/src/main/java/com/azure/resourcemanager/resources/FeatureClient.java index ee1313e560467..d428e72304303 100644 --- a/sdk/resources/mgmt/src/main/java/com/azure/resourcemanager/resources/FeatureClient.java +++ b/sdk/resources/mgmt/src/main/java/com/azure/resourcemanager/resources/FeatureClient.java @@ -28,7 +28,7 @@ import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.AzureServiceClient; +import com.azure.resourcemanager.resources.fluentcore.AzureServiceClient; import com.azure.resourcemanager.resources.fluent.FeaturesClient; import com.azure.resourcemanager.resources.fluent.inner.OperationInner; import com.azure.resourcemanager.resources.fluent.inner.OperationListResultInner; diff --git a/sdk/resources/mgmt/src/main/java/com/azure/resourcemanager/resources/PolicyClient.java b/sdk/resources/mgmt/src/main/java/com/azure/resourcemanager/resources/PolicyClient.java index eea782a9840a9..a4f8ceb91829f 100644 --- a/sdk/resources/mgmt/src/main/java/com/azure/resourcemanager/resources/PolicyClient.java +++ b/sdk/resources/mgmt/src/main/java/com/azure/resourcemanager/resources/PolicyClient.java @@ -8,7 +8,7 @@ import com.azure.core.http.HttpPipeline; import com.azure.core.management.AzureEnvironment; import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.AzureServiceClient; +import com.azure.resourcemanager.resources.fluentcore.AzureServiceClient; import com.azure.resourcemanager.resources.fluent.PolicyAssignmentsClient; import com.azure.resourcemanager.resources.fluent.PolicyDefinitionsClient; import com.azure.resourcemanager.resources.fluent.PolicySetDefinitionsClient; diff --git a/sdk/resources/mgmt/src/main/java/com/azure/resourcemanager/resources/ResourceManagementClient.java b/sdk/resources/mgmt/src/main/java/com/azure/resourcemanager/resources/ResourceManagementClient.java index e1258f9b928d2..09f0cc3d76b56 100644 --- a/sdk/resources/mgmt/src/main/java/com/azure/resourcemanager/resources/ResourceManagementClient.java +++ b/sdk/resources/mgmt/src/main/java/com/azure/resourcemanager/resources/ResourceManagementClient.java @@ -8,7 +8,7 @@ import com.azure.core.http.HttpPipeline; import com.azure.core.management.AzureEnvironment; import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.AzureServiceClient; +import com.azure.resourcemanager.resources.fluentcore.AzureServiceClient; import com.azure.resourcemanager.resources.fluent.DeploymentOperationsClient; import com.azure.resourcemanager.resources.fluent.DeploymentsClient; import com.azure.resourcemanager.resources.fluent.OperationsClient; diff --git a/sdk/resources/mgmt/src/main/java/com/azure/resourcemanager/resources/SubscriptionClient.java b/sdk/resources/mgmt/src/main/java/com/azure/resourcemanager/resources/SubscriptionClient.java index b790dbe353651..41589bc4bd2c8 100644 --- a/sdk/resources/mgmt/src/main/java/com/azure/resourcemanager/resources/SubscriptionClient.java +++ b/sdk/resources/mgmt/src/main/java/com/azure/resourcemanager/resources/SubscriptionClient.java @@ -8,7 +8,7 @@ import com.azure.core.http.HttpPipeline; import com.azure.core.management.AzureEnvironment; import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.AzureServiceClient; +import com.azure.resourcemanager.resources.fluentcore.AzureServiceClient; import com.azure.resourcemanager.resources.fluent.SubscriptionsClient; import com.azure.resourcemanager.resources.fluent.TenantsClient; diff --git a/sdk/resources/mgmt/src/main/java/com/azure/resourcemanager/AzureServiceClient.java b/sdk/resources/mgmt/src/main/java/com/azure/resourcemanager/resources/fluentcore/AzureServiceClient.java similarity index 79% rename from sdk/resources/mgmt/src/main/java/com/azure/resourcemanager/AzureServiceClient.java rename to sdk/resources/mgmt/src/main/java/com/azure/resourcemanager/resources/fluentcore/AzureServiceClient.java index db8fe10693d92..9ec1a0f8ac038 100644 --- a/sdk/resources/mgmt/src/main/java/com/azure/resourcemanager/AzureServiceClient.java +++ b/sdk/resources/mgmt/src/main/java/com/azure/resourcemanager/resources/fluentcore/AzureServiceClient.java @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.azure.resourcemanager; +package com.azure.resourcemanager.resources.fluentcore; import com.azure.core.http.HttpPipeline; import com.azure.core.http.rest.Response; @@ -28,20 +28,15 @@ import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; -import javax.xml.bind.annotation.adapters.HexBinaryAdapter; import java.io.IOException; import java.lang.reflect.Type; -import java.net.NetworkInterface; import java.nio.ByteBuffer; -import java.security.MessageDigest; -import java.security.NoSuchAlgorithmException; import java.time.LocalDateTime; import java.time.OffsetDateTime; import java.time.ZoneOffset; import java.time.format.DateTimeFormatter; import java.time.temporal.TemporalAccessor; import java.time.temporal.TemporalQueries; -import java.util.Enumeration; /** * ServiceClient is the abstraction for accessing REST operations and their payload data types. @@ -54,20 +49,6 @@ protected AzureServiceClient(HttpPipeline httpPipeline, AzureEnvironment environ ((AzureJacksonAdapter) serializerAdapter).serializer().registerModule(DateTimeDeserializer.getModule()); } - /** - * The default User-Agent header. Override this method to override the user agent. - * - * @return the user agent string. - */ - public String userAgent() { - return String.format("Azure-SDK-For-Java/%s OS:%s MacAddressHash:%s Java:%s", - getClass().getPackage().getImplementationVersion(), - OS, - MAC_ADDRESS_HASH, - JAVA_VERSION); - } - - private static final String MAC_ADDRESS_HASH; private static final String OS; private static final String OS_NAME; private static final String OS_VERSION; @@ -78,22 +59,6 @@ public String userAgent() { OS_NAME = System.getProperty("os.name"); OS_VERSION = System.getProperty("os.version"); OS = OS_NAME + "/" + OS_VERSION; - String macAddress = "Unknown"; - try { - Enumeration networks = NetworkInterface.getNetworkInterfaces(); - while (networks.hasMoreElements()) { - NetworkInterface network = networks.nextElement(); - byte[] mac = network.getHardwareAddress(); - - if (mac != null) { - macAddress = getSha256(mac); - break; - } - } - } catch (Throwable t) { - // It's okay ignore mac address hash telemetry - } - MAC_ADDRESS_HASH = macAddress; String version = System.getProperty("java.version"); JAVA_VERSION = version != null ? version : "Unknown"; } @@ -148,7 +113,7 @@ public Context getContext() { * @param type of final result. * @return poller flux for poll result and final result. */ - public PollerFlux, U> getLroResultAsync(Mono>> lroInit, + public PollerFlux, U> getLroResultAsync(Mono>> lroInit, HttpPipeline httpPipeline, Type pollResultType, Type finalResultType) { return PollerFactory.create( @@ -157,25 +122,10 @@ public PollerFlux, U> getLroResultAsync(Mono>> activationOperation(Mono>> lroInit) { - return lroInit.flatMap(fluxSimpleResponse -> Mono.just(fluxSimpleResponse)); - } - - private static String getSha256(byte[] bytes) { - MessageDigest messageDigest; - try { - messageDigest = MessageDigest.getInstance("SHA-256"); - return new HexBinaryAdapter().marshal(messageDigest.digest(bytes)); - } catch (NoSuchAlgorithmException e) { - e.printStackTrace(); - } - return "Unknown"; - } - /** * Gets the final result, or an error, based on last async poll response. * diff --git a/sdk/resources/mgmt/src/main/java/com/azure/resourcemanager/resources/fluentcore/package-info.java b/sdk/resources/mgmt/src/main/java/com/azure/resourcemanager/resources/fluentcore/package-info.java new file mode 100644 index 0000000000000..14e02d9495947 --- /dev/null +++ b/sdk/resources/mgmt/src/main/java/com/azure/resourcemanager/resources/fluentcore/package-info.java @@ -0,0 +1,7 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +/** + * This package contains the base classes for management sdk. + */ +package com.azure.resourcemanager.resources.fluentcore; diff --git a/sdk/sql/mgmt/src/main/java/com/azure/resourcemanager/sql/SqlManagementClient.java b/sdk/sql/mgmt/src/main/java/com/azure/resourcemanager/sql/SqlManagementClient.java index d67792b394e71..2468a97fc933b 100644 --- a/sdk/sql/mgmt/src/main/java/com/azure/resourcemanager/sql/SqlManagementClient.java +++ b/sdk/sql/mgmt/src/main/java/com/azure/resourcemanager/sql/SqlManagementClient.java @@ -8,7 +8,7 @@ import com.azure.core.http.HttpPipeline; import com.azure.core.management.AzureEnvironment; import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.AzureServiceClient; +import com.azure.resourcemanager.resources.fluentcore.AzureServiceClient; import com.azure.resourcemanager.sql.fluent.BackupLongTermRetentionPoliciesClient; import com.azure.resourcemanager.sql.fluent.BackupShortTermRetentionPoliciesClient; import com.azure.resourcemanager.sql.fluent.CapabilitiesClient; diff --git a/sdk/storage/mgmt/src/main/java/com/azure/resourcemanager/storage/StorageManagementClient.java b/sdk/storage/mgmt/src/main/java/com/azure/resourcemanager/storage/StorageManagementClient.java index 4613c657d02a5..1a25aea6004a7 100644 --- a/sdk/storage/mgmt/src/main/java/com/azure/resourcemanager/storage/StorageManagementClient.java +++ b/sdk/storage/mgmt/src/main/java/com/azure/resourcemanager/storage/StorageManagementClient.java @@ -8,7 +8,7 @@ import com.azure.core.http.HttpPipeline; import com.azure.core.management.AzureEnvironment; import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.AzureServiceClient; +import com.azure.resourcemanager.resources.fluentcore.AzureServiceClient; import com.azure.resourcemanager.storage.fluent.BlobContainersClient; import com.azure.resourcemanager.storage.fluent.BlobServicesClient; import com.azure.resourcemanager.storage.fluent.EncryptionScopesClient; From ff484b6f1e65d29bfcfe627457c12bc2e6b21b62 Mon Sep 17 00:00:00 2001 From: Alan Zimmer <48699787+alzimmermsft@users.noreply.github.com> Date: Wed, 8 Jul 2020 11:37:08 -0700 Subject: [PATCH 049/129] Add Javadoc Escapes to README Overview (#12627) * Add invalid Javadoc character escaping to the README overview injection * Replace leading '@' with Javadoc safe '{@literal @}' * Remove Azure Core README test text, updated regex to retain leading whitespace --- eng/pipelines/scripts/generate_overview_from_readme.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/eng/pipelines/scripts/generate_overview_from_readme.py b/eng/pipelines/scripts/generate_overview_from_readme.py index e75b3aff75190..6b606a98777ca 100644 --- a/eng/pipelines/scripts/generate_overview_from_readme.py +++ b/eng/pipelines/scripts/generate_overview_from_readme.py @@ -1,10 +1,10 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. -# Use case: Given a README.md file, generate a readme_overview.html file and place it next +# Use case: Given a README.md file, generate a readme_overview.html file and place it next # to the README.md. This will allow the javadocs jar step to append the contents of the # readme onto the landing page. -# +# # This script is necessary, instead of just invoking python markdown2 directly from the # command line because the generated overview.html file needs to be enclosed inside of # tags. When the attach-javadocs runs with the overview option it will append it the contents @@ -19,6 +19,7 @@ import markdown2 import os.path from io import open +import re import sys def generate_overview(readme_file, version): @@ -40,7 +41,7 @@ def generate_overview(readme_file, version): # markdown2.markdown will create html from the readme.md file. The fenced-code-blocks # extras being passed into the markdown call is necessary to deal with the embedded # code blocks within the readme so they'll displaye correctly in the html - html_readme_content = markdown2.markdown(readme_content, extras=["fenced-code-blocks"]) + html_readme_content = markdown2.markdown(re.sub(pattern='^(\s*)@', repl='\g<1>{@literal @}', string=readme_content, flags=re.MULTILINE), extras=["fenced-code-blocks"]) # Due to javadoc's iFrames the links need to target new tabs otherwise hilarity ensues soup = BeautifulSoup(html_readme_content, "html.parser") From 04bf47f309db793085c9c17a181657d88f76f625 Mon Sep 17 00:00:00 2001 From: Sameeksha Vaity Date: Wed, 8 Jul 2020 12:19:09 -0700 Subject: [PATCH 050/129] Increment version for formrecognizer release (#12916) --- eng/jacoco-test-coverage/pom.xml | 2 +- eng/versioning/version_client.txt | 2 +- sdk/formrecognizer/azure-ai-formrecognizer/CHANGELOG.md | 3 +++ sdk/formrecognizer/azure-ai-formrecognizer/pom.xml | 2 +- 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/eng/jacoco-test-coverage/pom.xml b/eng/jacoco-test-coverage/pom.xml index 087e1e930345e..65e39dc8769ac 100644 --- a/eng/jacoco-test-coverage/pom.xml +++ b/eng/jacoco-test-coverage/pom.xml @@ -39,7 +39,7 @@ com.azure azure-ai-formrecognizer - 1.0.0-beta.4 + 1.0.0-beta.5 com.azure diff --git a/eng/versioning/version_client.txt b/eng/versioning/version_client.txt index fde00a4e1bb60..7b76d7a8cf435 100644 --- a/eng/versioning/version_client.txt +++ b/eng/versioning/version_client.txt @@ -4,7 +4,7 @@ com.azure:azure-sdk-all;1.0.0;1.0.0 com.azure:azure-sdk-parent;1.6.0;1.6.0 com.azure:azure-client-sdk-parent;1.7.0;1.7.0 -com.azure:azure-ai-formrecognizer;1.0.0-beta.3;1.0.0-beta.4 +com.azure:azure-ai-formrecognizer;1.0.0-beta.4;1.0.0-beta.5 com.azure:azure-ai-textanalytics;1.0.1;1.1.0-beta.1 com.azure:azure-core;1.6.0;1.7.0-beta.1 com.azure:azure-core-amqp;1.3.0;1.4.0-beta.1 diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/CHANGELOG.md b/sdk/formrecognizer/azure-ai-formrecognizer/CHANGELOG.md index 3d72df697577f..11a6b1faf6d47 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/CHANGELOG.md +++ b/sdk/formrecognizer/azure-ai-formrecognizer/CHANGELOG.md @@ -1,5 +1,8 @@ # Release History +## 1.0.0-beta.5 (Unreleased) + + ## 1.0.0-beta.4 (2020-07-07) ### Breaking Changes - `beginRecognizeReceipt` APIs now return a `RecognizedForm` model instead of a `RecognizedReceipt`. See diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/pom.xml b/sdk/formrecognizer/azure-ai-formrecognizer/pom.xml index b66a00efe5339..db95a0ab98a6e 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/pom.xml +++ b/sdk/formrecognizer/azure-ai-formrecognizer/pom.xml @@ -13,7 +13,7 @@ com.azure azure-ai-formrecognizer - 1.0.0-beta.4 + 1.0.0-beta.5 Microsoft Azure client library for Form Recognizer This package contains the Microsoft Azure Cognitive Services Form Recognizer SDK. From 3df5560c6dde9df82a8f528568bc566173138f63 Mon Sep 17 00:00:00 2001 From: Gauri Prasad <51212198+gapra-msft@users.noreply.github.com> Date: Wed, 8 Jul 2020 12:21:20 -0700 Subject: [PATCH 051/129] Ignored flaky CF tests (#12915) --- .../azure/storage/blob/changefeed/ChangefeedNetworkTest.groovy | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sdk/storage/azure-storage-blob-changefeed/src/test/java/com/azure/storage/blob/changefeed/ChangefeedNetworkTest.groovy b/sdk/storage/azure-storage-blob-changefeed/src/test/java/com/azure/storage/blob/changefeed/ChangefeedNetworkTest.groovy index 8445bd10aa58d..fcdea2d5b68b8 100644 --- a/sdk/storage/azure-storage-blob-changefeed/src/test/java/com/azure/storage/blob/changefeed/ChangefeedNetworkTest.groovy +++ b/sdk/storage/azure-storage-blob-changefeed/src/test/java/com/azure/storage/blob/changefeed/ChangefeedNetworkTest.groovy @@ -1,5 +1,6 @@ package com.azure.storage.blob.changefeed +import spock.lang.Ignore import reactor.test.StepVerifier import spock.lang.Requires import spock.lang.Unroll @@ -73,6 +74,7 @@ class ChangefeedNetworkTest extends APISpec { @Unroll @Requires( { playbackMode() }) + @Ignore("flaky in CI") def "get continuationToken"() { when: BlobChangefeedPagedIterable iterable = new BlobChangefeedClientBuilder(primaryBlobServiceClient) @@ -101,6 +103,7 @@ class ChangefeedNetworkTest extends APISpec { @Unroll @Requires( { playbackMode() }) + @Ignore("flaky in CI") def "resume continuationToken"() { when: BlobChangefeedPagedFlux flux = new BlobChangefeedClientBuilder(primaryBlobServiceAsyncClient) From 2a3e40b137ab9dc1efce7d0f5cebda908b1fe22b Mon Sep 17 00:00:00 2001 From: Kushagra Thapar Date: Wed, 8 Jul 2020 12:26:35 -0700 Subject: [PATCH 052/129] Renamed azure-spring-data-cosmosdb to azure-spring-data-cosmos (#12881) * Renamed azure-spring-data-cosmosdb to azure-spring-data-cosmos. Renamed directory structure and package structure to track 2 structure * Fixed changelog version, contributing path * Updating tests.yml * Reverted safeName change and will update it in part 2 --- .github/CODEOWNERS | 2 +- .../checkstyle/checkstyle-suppressions.xml | 12 +-- .../src/main/resources/revapi/revapi.json | 4 +- eng/jacoco-test-coverage/pom.xml | 2 +- eng/versioning/version_client.txt | 2 +- .../azure-spring-data-cosmos/CHANGELOG.md | 3 + .../Contributing.md | 6 +- .../README.md | 0 .../pom.xml | 8 +- .../azure/spring/data/cosmos}/Constants.java | 2 +- .../spring/data/cosmos}/CosmosDbFactory.java | 10 +-- .../data/cosmos}/common/CosmosdbUtils.java | 10 +-- .../cosmos}/common/ExpressionResolver.java | 2 +- .../data/cosmos}/common/MacAddress.java | 2 +- .../spring/data/cosmos}/common/Memoizer.java | 2 +- .../data/cosmos}/common/PropertyLoader.java | 2 +- .../cosmos}/common/TelemetryEventData.java | 2 +- .../data/cosmos}/common/TelemetrySender.java | 4 +- .../data/cosmos}/common/package-info.java | 2 +- .../config/AbstractCosmosConfiguration.java | 12 +-- .../config/CosmosConfigurationSupport.java | 6 +- .../data/cosmos}/config/CosmosDBConfig.java | 6 +- .../data/cosmos}/config/package-info.java | 2 +- .../data/cosmos}/core/CosmosOperations.java | 8 +- .../data/cosmos}/core/CosmosTemplate.java | 88 +++++++++---------- .../core/ReactiveCosmosOperations.java | 8 +- .../cosmos}/core/ReactiveCosmosTemplate.java | 88 +++++++++---------- .../cosmos}/core/ResponseDiagnostics.java | 2 +- .../core/ResponseDiagnosticsProcessor.java | 2 +- .../core/convert/MappingCosmosConverter.java | 12 +-- .../core/convert/ObjectMapperFactory.java | 2 +- .../cosmos}/core/convert/package-info.java | 2 +- .../generator/AbstractQueryGenerator.java | 12 +-- .../core/generator/CountQueryGenerator.java | 4 +- .../generator/FindQuerySpecGenerator.java | 4 +- .../core/generator/QuerySpecGenerator.java | 4 +- .../cosmos}/core/generator/package-info.java | 2 +- .../mapping/BasicCosmosPersistentEntity.java | 2 +- .../BasicCosmosPersistentProperty.java | 4 +- .../core/mapping/CosmosMappingContext.java | 2 +- .../core/mapping/CosmosPersistentEntity.java | 2 +- .../mapping/CosmosPersistentProperty.java | 2 +- .../data/cosmos}/core/mapping/Document.java | 4 +- .../core/mapping/DocumentIndexingPolicy.java | 4 +- .../cosmos}/core/mapping/PartitionKey.java | 2 +- .../cosmos}/core/mapping/package-info.java | 2 +- .../data/cosmos}/core/package-info.java | 2 +- .../cosmos}/core/query/CosmosPageImpl.java | 2 +- .../cosmos}/core/query/CosmosPageRequest.java | 2 +- .../data/cosmos}/core/query/Criteria.java | 2 +- .../data/cosmos}/core/query/CriteriaType.java | 2 +- .../cosmos}/core/query/DocumentQuery.java | 2 +- .../data/cosmos}/core/query/package-info.java | 2 +- .../exception/ConfigurationException.java | 2 +- .../exception/CosmosDBAccessException.java | 8 +- .../exception/CosmosDBExceptionUtils.java | 2 +- .../exception/DatabaseCreationException.java | 2 +- .../exception/IllegalCollectionException.java | 2 +- .../exception/IllegalQueryException.java | 2 +- .../data/cosmos}/exception/package-info.java | 2 +- .../spring/data/cosmos}/package-info.java | 2 +- .../cosmos}/repository/CosmosRepository.java | 2 +- .../repository/ReactiveCosmosRepository.java | 2 +- .../config/CosmosRepositoriesRegistrar.java | 2 +- ...osmosRepositoryConfigurationExtension.java | 10 +-- .../config/EnableCosmosRepositories.java | 6 +- .../EnableReactiveCosmosRepositories.java | 6 +- .../ReactiveCosmosRepositoriesRegistrar.java | 2 +- ...osmosRepositoryConfigurationExtension.java | 10 +-- .../repository/config/package-info.java | 2 +- .../data/cosmos}/repository/package-info.java | 2 +- .../repository/query/AbstractCosmosQuery.java | 6 +- .../query/AbstractReactiveCosmosQuery.java | 6 +- .../query/CosmosEntityMetadata.java | 2 +- .../repository/query/CosmosParameter.java | 2 +- .../query/CosmosParameterAccessor.java | 2 +- .../CosmosParameterParameterAccessor.java | 2 +- .../repository/query/CosmosParameters.java | 2 +- .../repository/query/CosmosQueryCreator.java | 16 ++-- .../query/CosmosQueryExecution.java | 8 +- .../repository/query/CosmosQueryMethod.java | 4 +- .../repository/query/PartTreeCosmosQuery.java | 8 +- .../query/PartTreeReactiveCosmosQuery.java | 8 +- .../query/ReactiveCosmosEntityMetadata.java | 2 +- .../ReactiveCosmosParameterAccessor.java | 2 +- ...ctiveCosmosParameterParameterAccessor.java | 2 +- .../query/ReactiveCosmosQueryCreator.java | 16 ++-- .../query/ReactiveCosmosQueryExecution.java | 6 +- .../query/ReactiveCosmosQueryMethod.java | 4 +- .../query/SimpleCosmosEntityMetadata.java | 4 +- .../SimpleReactiveCosmosEntityMetadata.java | 4 +- .../repository/query/package-info.java | 2 +- .../support/CosmosEntityInformation.java | 12 +-- .../support/CosmosRepositoryFactory.java | 8 +- .../support/CosmosRepositoryFactoryBean.java | 6 +- .../ReactiveCosmosRepositoryFactory.java | 8 +- .../ReactiveCosmosRepositoryFactoryBean.java | 6 +- .../support/SimpleCosmosRepository.java | 12 +-- .../SimpleReactiveCosmosRepository.java | 12 +-- .../repository/support/package-info.java | 2 +- .../resources/META-INF/project.properties | 0 .../main/resources/META-INF/spring.factories | 1 + .../src/main/resources/telemetry.config | 0 .../data/cosmos}/CosmosDbFactoryTestIT.java | 21 ++--- .../spring/data/cosmos}/UserAgentTestIT.java | 13 ++- .../data/cosmos}/common/DynamicContainer.java | 2 +- .../common/ExpressionResolverUnitTest.java | 2 +- .../data/cosmos}/common/MemoizerUnitTest.java | 2 +- .../data/cosmos}/common/PageTestUtils.java | 4 +- .../common/PropertyLoaderUnitTest.java | 2 +- .../common/ResponseDiagnosticsTestUtils.java | 6 +- .../data/cosmos}/common/TestConstants.java | 4 +- .../spring/data/cosmos}/common/TestUtils.java | 2 +- .../config/AbstractCosmosConfigurationIT.java | 10 +-- .../data/cosmos}/core/CosmosTemplateIT.java | 45 +++++----- .../core/CosmosTemplateIllegalTest.java | 13 ++- .../core/CosmosTemplatePartitionIT.java | 42 +++++---- .../cosmos}/core/CosmosTemplateUnitTest.java | 8 +- .../core/ReactiveCosmosTemplateIT.java | 84 +++++++++--------- .../ReactiveCosmosTemplatePartitionIT.java | 44 +++++----- .../ZonedDateTimeDeserializerTest.java | 4 +- .../MappingCosmosConverterUnitTest.java | 14 +-- .../BasicCosmosPersistentEntityUnitTest.java | 4 +- .../mapping/CosmosMappingContextUnitTest.java | 2 +- .../cosmos}/core/query/CriteriaUnitTest.java | 10 +-- .../core/query/DocumentQueryUnitTest.java | 6 +- .../spring/data/cosmos}/domain/Address.java | 6 +- .../spring/data/cosmos}/domain/Contact.java | 4 +- .../spring/data/cosmos}/domain/Course.java | 6 +- .../spring/data/cosmos}/domain/Customer.java | 2 +- .../data/cosmos}/domain/Importance.java | 2 +- .../data/cosmos}/domain/IntegerIdDomain.java | 4 +- .../spring/data/cosmos}/domain/Memo.java | 4 +- .../cosmos}/domain/NoDBAnnotationPerson.java | 2 +- .../data/cosmos}/domain/PageableAddress.java | 6 +- .../data/cosmos}/domain/PageableMemo.java | 4 +- .../data/cosmos}/domain/PageablePerson.java | 10 +-- .../data/cosmos}/domain/PartitionPerson.java | 6 +- .../spring/data/cosmos}/domain/Person.java | 10 +-- .../spring/data/cosmos}/domain/Project.java | 10 +-- .../spring/data/cosmos}/domain/Question.java | 8 +- .../spring/data/cosmos}/domain/Role.java | 10 +-- .../data/cosmos}/domain/SortedProject.java | 10 +-- .../data/cosmos}/domain/SpELBeanStudent.java | 4 +- .../cosmos}/domain/SpELPropertyStudent.java | 4 +- .../spring/data/cosmos}/domain/Student.java | 6 +- .../data/cosmos}/domain/TimeToLiveSample.java | 6 +- .../cosmos}/domain/inheritance/Shape.java | 2 +- .../cosmos}/domain/inheritance/Square.java | 2 +- .../performance/PerfConfiguration.java | 10 +-- .../performance/PerformanceCompare.java | 74 ++++++++-------- .../performance/PerformanceReport.java | 2 +- .../performance/domain/PerfPerson.java | 10 +-- .../repository/PerfPersonRepository.java | 6 +- .../performance/service/SdkService.java | 6 +- .../cosmos}/performance/utils/Constants.java | 2 +- .../performance/utils/DatabaseUtils.java | 4 +- .../performance/utils/FunctionUtils.java | 2 +- .../performance/utils/PerfDataProvider.java | 4 +- .../repository/CosmosAnnotationUnitTest.java | 18 ++-- .../SimpleCosmosRepositoryIllegalTest.java | 10 +-- .../SimpleCosmosRepositoryUnitTest.java | 16 ++-- .../repository/TestRepositoryConfig.java | 16 ++-- ...ositoryConfigurationExtensionUnitTest.java | 4 +- ...ositoryConfigurationExtensionUnitTest.java | 4 +- .../integration/AddressRepositoryIT.java | 16 ++-- .../integration/ContactRepositoryIT.java | 16 ++-- .../integration/CosmosAnnotationIT.java | 24 ++--- .../integration/CustomerRepositoryIT.java | 12 +-- .../IntegerIdDomainRepositoryIT.java | 18 ++-- .../integration/MemoRepositoryIT.java | 22 ++--- .../PageableAddressRepositoryIT.java | 28 +++--- .../integration/PageableMemoRepositoryIT.java | 18 ++-- .../PageablePersonRepositoryIT.java | 18 ++-- .../integration/PersonRepositoryIT.java | 2 +- .../integration/ProjectRepositoryIT.java | 12 +-- .../integration/ProjectRepositorySortIT.java | 20 ++--- .../integration/QuestionRepositoryIT.java | 16 ++-- .../ReactiveCourseRepositoryIT.java | 14 +-- .../integration/SpELCosmosDBAnnotationIT.java | 26 +++--- .../integration/SquareRepositoryIT.java | 14 +-- .../integration/StudentRepositoryIT.java | 12 +-- .../repository/AddressRepository.java | 6 +- .../repository/ContactRepository.java | 6 +- .../repository/CustomerRepository.java | 6 +- .../repository/IntegerIdDomainRepository.java | 6 +- .../repository/repository/MemoRepository.java | 8 +- .../repository/PageableAddressRepository.java | 4 +- .../repository/PageableMemoRepository.java | 4 +- .../repository/PageablePersonRepository.java | 4 +- .../repository/PartitionPersonRepository.java | 6 +- .../repository/PersonRepository.java | 6 +- .../repository/ProjectRepository.java | 6 +- .../repository/QuestionRepository.java | 9 ++ .../repository/ReactiveCourseRepository.java | 6 +- .../repository/SortedProjectRepository.java | 6 +- .../repository/SquareRepository.java | 6 +- .../repository/StudentRepository.java | 6 +- .../CosmosEntityInformationUnitTest.java | 16 ++-- .../CosmosRepositoryFactoryBeanUnitTest.java | 6 +- .../CosmosRepositoryFactoryUnitTest.java | 6 +- .../src/test/resources/application.properties | 0 .../src/test/resources/application.yml | 0 .../src/test/resources/logback-test.xml | 0 .../azure-spring-data-cosmosdb/CHANGELOG.md | 3 - .../main/resources/META-INF/spring.factories | 1 - .../repository/QuestionRepository.java | 9 -- sdk/cosmos/ci.yml | 2 +- sdk/cosmos/pom.xml | 2 +- .../README.md | 2 +- 210 files changed, 854 insertions(+), 856 deletions(-) create mode 100644 sdk/cosmos/azure-spring-data-cosmos/CHANGELOG.md rename sdk/cosmos/{azure-spring-data-cosmosdb => azure-spring-data-cosmos}/Contributing.md (96%) rename sdk/cosmos/{azure-spring-data-cosmosdb => azure-spring-data-cosmos}/README.md (100%) rename sdk/cosmos/{azure-spring-data-cosmosdb => azure-spring-data-cosmos}/pom.xml (97%) rename sdk/cosmos/{azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb => azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos}/Constants.java (96%) rename sdk/cosmos/{azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb => azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos}/CosmosDbFactory.java (92%) rename sdk/cosmos/{azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb => azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos}/common/CosmosdbUtils.java (89%) rename sdk/cosmos/{azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb => azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos}/common/ExpressionResolver.java (96%) rename sdk/cosmos/{azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb => azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos}/common/MacAddress.java (98%) rename sdk/cosmos/{azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb => azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos}/common/Memoizer.java (94%) rename sdk/cosmos/{azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb => azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos}/common/PropertyLoader.java (97%) rename sdk/cosmos/{azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb => azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos}/common/TelemetryEventData.java (98%) rename sdk/cosmos/{azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb => azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos}/common/TelemetrySender.java (96%) rename sdk/cosmos/{azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb => azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos}/common/package-info.java (74%) rename sdk/cosmos/{azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb => azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos}/config/AbstractCosmosConfiguration.java (87%) rename sdk/cosmos/{azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb => azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos}/config/CosmosConfigurationSupport.java (94%) rename sdk/cosmos/{azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb => azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos}/config/CosmosDBConfig.java (98%) rename sdk/cosmos/{azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb => azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos}/config/package-info.java (75%) rename sdk/cosmos/{azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb => azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos}/core/CosmosOperations.java (96%) rename sdk/cosmos/{azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb => azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos}/core/CosmosTemplate.java (88%) rename sdk/cosmos/{azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb => azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos}/core/ReactiveCosmosOperations.java (95%) rename sdk/cosmos/{azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb => azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos}/core/ReactiveCosmosTemplate.java (86%) rename sdk/cosmos/{azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb => azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos}/core/ResponseDiagnostics.java (98%) rename sdk/cosmos/{azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb => azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos}/core/ResponseDiagnosticsProcessor.java (93%) rename sdk/cosmos/{azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb => azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos}/core/convert/MappingCosmosConverter.java (94%) rename sdk/cosmos/{azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb => azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos}/core/convert/ObjectMapperFactory.java (94%) rename sdk/cosmos/{azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb => azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos}/core/convert/package-info.java (72%) rename sdk/cosmos/{azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb => azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos}/core/generator/AbstractQueryGenerator.java (95%) rename sdk/cosmos/{azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb => azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos}/core/generator/CountQueryGenerator.java (75%) rename sdk/cosmos/{azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb => azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos}/core/generator/FindQuerySpecGenerator.java (78%) rename sdk/cosmos/{azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb => azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos}/core/generator/QuerySpecGenerator.java (76%) rename sdk/cosmos/{azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb => azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos}/core/generator/package-info.java (71%) rename sdk/cosmos/{azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb => azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos}/core/mapping/BasicCosmosPersistentEntity.java (96%) rename sdk/cosmos/{azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb => azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos}/core/mapping/BasicCosmosPersistentProperty.java (92%) rename sdk/cosmos/{azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb => azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos}/core/mapping/CosmosMappingContext.java (96%) rename sdk/cosmos/{azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb => azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos}/core/mapping/CosmosPersistentEntity.java (91%) rename sdk/cosmos/{azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb => azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos}/core/mapping/CosmosPersistentProperty.java (83%) rename sdk/cosmos/{azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb => azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos}/core/mapping/Document.java (90%) rename sdk/cosmos/{azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb => azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos}/core/mapping/DocumentIndexingPolicy.java (90%) rename sdk/cosmos/{azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb => azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos}/core/mapping/PartitionKey.java (91%) rename sdk/cosmos/{azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb => azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos}/core/mapping/package-info.java (74%) rename sdk/cosmos/{azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb => azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos}/core/package-info.java (80%) rename sdk/cosmos/{azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb => azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos}/core/query/CosmosPageImpl.java (97%) rename sdk/cosmos/{azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb => azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos}/core/query/CosmosPageRequest.java (98%) rename sdk/cosmos/{azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb => azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos}/core/query/Criteria.java (97%) rename sdk/cosmos/{azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb => azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos}/core/query/CriteriaType.java (98%) rename sdk/cosmos/{azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb => azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos}/core/query/DocumentQuery.java (98%) rename sdk/cosmos/{azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb => azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos}/core/query/package-info.java (73%) rename sdk/cosmos/{azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb => azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos}/exception/ConfigurationException.java (93%) rename sdk/cosmos/{azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb => azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos}/exception/CosmosDBAccessException.java (89%) rename sdk/cosmos/{azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb => azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos}/exception/CosmosDBExceptionUtils.java (97%) rename sdk/cosmos/{azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb => azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos}/exception/DatabaseCreationException.java (93%) rename sdk/cosmos/{azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb => azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos}/exception/IllegalCollectionException.java (93%) rename sdk/cosmos/{azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb => azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos}/exception/IllegalQueryException.java (93%) rename sdk/cosmos/{azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb => azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos}/exception/package-info.java (73%) rename sdk/cosmos/{azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb => azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos}/package-info.java (72%) rename sdk/cosmos/{azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb => azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos}/repository/CosmosRepository.java (96%) rename sdk/cosmos/{azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb => azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos}/repository/ReactiveCosmosRepository.java (96%) rename sdk/cosmos/{azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb => azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos}/repository/config/CosmosRepositoriesRegistrar.java (92%) rename sdk/cosmos/{azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb => azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos}/repository/config/CosmosRepositoryConfigurationExtension.java (88%) rename sdk/cosmos/{azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb => azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos}/repository/config/EnableCosmosRepositories.java (91%) rename sdk/cosmos/{azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb => azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos}/repository/config/EnableReactiveCosmosRepositories.java (91%) rename sdk/cosmos/{azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb => azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos}/repository/config/ReactiveCosmosRepositoriesRegistrar.java (92%) rename sdk/cosmos/{azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb => azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos}/repository/config/ReactiveCosmosRepositoryConfigurationExtension.java (87%) rename sdk/cosmos/{azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb => azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos}/repository/config/package-info.java (73%) rename sdk/cosmos/{azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb => azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos}/repository/package-info.java (76%) rename sdk/cosmos/{azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb => azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos}/repository/query/AbstractCosmosQuery.java (91%) rename sdk/cosmos/{azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb => azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos}/repository/query/AbstractReactiveCosmosQuery.java (92%) rename sdk/cosmos/{azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb => azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos}/repository/query/CosmosEntityMetadata.java (90%) rename sdk/cosmos/{azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb => azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos}/repository/query/CosmosParameter.java (90%) rename sdk/cosmos/{azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb => azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos}/repository/query/CosmosParameterAccessor.java (87%) rename sdk/cosmos/{azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb => azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos}/repository/query/CosmosParameterParameterAccessor.java (93%) rename sdk/cosmos/{azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb => azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos}/repository/query/CosmosParameters.java (94%) rename sdk/cosmos/{azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb => azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos}/repository/query/CosmosQueryCreator.java (87%) rename sdk/cosmos/{azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb => azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos}/repository/query/CosmosQueryExecution.java (92%) rename sdk/cosmos/{azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb => azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos}/repository/query/CosmosQueryMethod.java (90%) rename sdk/cosmos/{azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb => azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos}/repository/query/PartTreeCosmosQuery.java (86%) rename sdk/cosmos/{azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb => azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos}/repository/query/PartTreeReactiveCosmosQuery.java (86%) rename sdk/cosmos/{azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb => azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos}/repository/query/ReactiveCosmosEntityMetadata.java (90%) rename sdk/cosmos/{azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb => azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos}/repository/query/ReactiveCosmosParameterAccessor.java (87%) rename sdk/cosmos/{azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb => azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos}/repository/query/ReactiveCosmosParameterParameterAccessor.java (94%) rename sdk/cosmos/{azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb => azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos}/repository/query/ReactiveCosmosQueryCreator.java (87%) rename sdk/cosmos/{azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb => azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos}/repository/query/ReactiveCosmosQueryExecution.java (92%) rename sdk/cosmos/{azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb => azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos}/repository/query/ReactiveCosmosQueryMethod.java (90%) rename sdk/cosmos/{azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb => azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos}/repository/query/SimpleCosmosEntityMetadata.java (90%) rename sdk/cosmos/{azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb => azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos}/repository/query/SimpleReactiveCosmosEntityMetadata.java (90%) rename sdk/cosmos/{azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb => azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos}/repository/query/package-info.java (70%) rename sdk/cosmos/{azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb => azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos}/repository/support/CosmosEntityInformation.java (96%) rename sdk/cosmos/{azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb => azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos}/repository/support/CosmosRepositoryFactory.java (91%) rename sdk/cosmos/{azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb => azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos}/repository/support/CosmosRepositoryFactoryBean.java (92%) rename sdk/cosmos/{azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb => azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos}/repository/support/ReactiveCosmosRepositoryFactory.java (91%) rename sdk/cosmos/{azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb => azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos}/repository/support/ReactiveCosmosRepositoryFactoryBean.java (92%) rename sdk/cosmos/{azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb => azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos}/repository/support/SimpleCosmosRepository.java (95%) rename sdk/cosmos/{azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb => azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos}/repository/support/SimpleReactiveCosmosRepository.java (94%) rename sdk/cosmos/{azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb => azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos}/repository/support/package-info.java (74%) rename sdk/cosmos/{azure-spring-data-cosmosdb => azure-spring-data-cosmos}/src/main/resources/META-INF/project.properties (100%) create mode 100644 sdk/cosmos/azure-spring-data-cosmos/src/main/resources/META-INF/spring.factories rename sdk/cosmos/{azure-spring-data-cosmosdb => azure-spring-data-cosmos}/src/main/resources/telemetry.config (100%) rename sdk/cosmos/{azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb => azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos}/CosmosDbFactoryTestIT.java (67%) rename sdk/cosmos/{azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb => azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos}/UserAgentTestIT.java (76%) rename sdk/cosmos/{azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb => azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos}/common/DynamicContainer.java (85%) rename sdk/cosmos/{azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb => azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos}/common/ExpressionResolverUnitTest.java (96%) rename sdk/cosmos/{azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb => azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos}/common/MemoizerUnitTest.java (96%) rename sdk/cosmos/{azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb => azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos}/common/PageTestUtils.java (91%) rename sdk/cosmos/{azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb => azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos}/common/PropertyLoaderUnitTest.java (91%) rename sdk/cosmos/{azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb => azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos}/common/ResponseDiagnosticsTestUtils.java (85%) rename sdk/cosmos/{azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb => azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos}/common/TestConstants.java (98%) rename sdk/cosmos/{azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb => azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos}/common/TestUtils.java (96%) rename sdk/cosmos/{azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb => azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos}/config/AbstractCosmosConfigurationIT.java (94%) rename sdk/cosmos/{azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb => azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos}/core/CosmosTemplateIT.java (92%) rename sdk/cosmos/{azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb => azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos}/core/CosmosTemplateIllegalTest.java (90%) rename sdk/cosmos/{azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb => azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos}/core/CosmosTemplatePartitionIT.java (84%) rename sdk/cosmos/{azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb => azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos}/core/CosmosTemplateUnitTest.java (70%) rename sdk/cosmos/{azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb => azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos}/core/ReactiveCosmosTemplateIT.java (80%) rename sdk/cosmos/{azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb => azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos}/core/ReactiveCosmosTemplatePartitionIT.java (82%) rename sdk/cosmos/{azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb => azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos}/core/convert/ZonedDateTimeDeserializerTest.java (90%) rename sdk/cosmos/{azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb => azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos}/core/converter/MappingCosmosConverterUnitTest.java (90%) rename sdk/cosmos/{azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb => azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos}/core/mapping/BasicCosmosPersistentEntityUnitTest.java (86%) rename sdk/cosmos/{azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb => azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos}/core/mapping/CosmosMappingContextUnitTest.java (91%) rename sdk/cosmos/{azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb => azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos}/core/query/CriteriaUnitTest.java (86%) rename sdk/cosmos/{azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb => azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos}/core/query/DocumentQueryUnitTest.java (75%) rename sdk/cosmos/{azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb => azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos}/domain/Address.java (89%) rename sdk/cosmos/{azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb => azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos}/domain/Contact.java (91%) rename sdk/cosmos/{azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb => azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos}/domain/Course.java (89%) rename sdk/cosmos/{azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb => azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos}/domain/Customer.java (98%) rename sdk/cosmos/{azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb => azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos}/domain/Importance.java (72%) rename sdk/cosmos/{azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb => azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos}/domain/IntegerIdDomain.java (91%) rename sdk/cosmos/{azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb => azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos}/domain/Memo.java (93%) rename sdk/cosmos/{azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb => azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos}/domain/NoDBAnnotationPerson.java (97%) rename sdk/cosmos/{azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb => azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos}/domain/PageableAddress.java (90%) rename sdk/cosmos/{azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb => azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos}/domain/PageableMemo.java (94%) rename sdk/cosmos/{azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb => azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos}/domain/PageablePerson.java (89%) rename sdk/cosmos/{azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb => azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos}/domain/PartitionPerson.java (92%) rename sdk/cosmos/{azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb => azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos}/domain/Person.java (89%) rename sdk/cosmos/{azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb => azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos}/domain/Project.java (88%) rename sdk/cosmos/{azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb => azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos}/domain/Question.java (83%) rename sdk/cosmos/{azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb => azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos}/domain/Role.java (85%) rename sdk/cosmos/{azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb => azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos}/domain/SortedProject.java (88%) rename sdk/cosmos/{azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb => azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos}/domain/SpELBeanStudent.java (93%) rename sdk/cosmos/{azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb => azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos}/domain/SpELPropertyStudent.java (93%) rename sdk/cosmos/{azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb => azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos}/domain/Student.java (89%) rename sdk/cosmos/{azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb => azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos}/domain/TimeToLiveSample.java (68%) rename sdk/cosmos/{azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb => azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos}/domain/inheritance/Shape.java (92%) rename sdk/cosmos/{azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb => azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos}/domain/inheritance/Square.java (95%) rename sdk/cosmos/{azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb => azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos}/performance/PerfConfiguration.java (67%) rename sdk/cosmos/{azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb => azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos}/performance/PerformanceCompare.java (70%) rename sdk/cosmos/{azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb => azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos}/performance/PerformanceReport.java (98%) rename sdk/cosmos/{azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb => azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos}/performance/domain/PerfPerson.java (78%) rename sdk/cosmos/{azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb => azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos}/performance/repository/PerfPersonRepository.java (63%) rename sdk/cosmos/{azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb => azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos}/performance/service/SdkService.java (97%) rename sdk/cosmos/{azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb => azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos}/performance/utils/Constants.java (83%) rename sdk/cosmos/{azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb => azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos}/performance/utils/DatabaseUtils.java (92%) rename sdk/cosmos/{azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb => azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos}/performance/utils/FunctionUtils.java (98%) rename sdk/cosmos/{azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb => azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos}/performance/utils/PerfDataProvider.java (88%) rename sdk/cosmos/{azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb => azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos}/repository/CosmosAnnotationUnitTest.java (89%) rename sdk/cosmos/{azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb => azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos}/repository/SimpleCosmosRepositoryIllegalTest.java (82%) rename sdk/cosmos/{azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb => azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos}/repository/SimpleCosmosRepositoryUnitTest.java (87%) rename sdk/cosmos/{azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb => azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos}/repository/TestRepositoryConfig.java (79%) rename sdk/cosmos/{azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb => azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos}/repository/config/CosmosRepositoryConfigurationExtensionUnitTest.java (94%) rename sdk/cosmos/{azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb => azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos}/repository/config/ReactiveCosmosRepositoryConfigurationExtensionUnitTest.java (94%) rename sdk/cosmos/{azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb => azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos}/repository/integration/AddressRepositoryIT.java (93%) rename sdk/cosmos/{azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb => azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos}/repository/integration/ContactRepositoryIT.java (92%) rename sdk/cosmos/{azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb => azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos}/repository/integration/CosmosAnnotationIT.java (81%) rename sdk/cosmos/{azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb => azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos}/repository/integration/CustomerRepositoryIT.java (87%) rename sdk/cosmos/{azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb => azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos}/repository/integration/IntegerIdDomainRepositoryIT.java (92%) rename sdk/cosmos/{azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb => azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos}/repository/integration/MemoRepositoryIT.java (92%) rename sdk/cosmos/{azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb => azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos}/repository/integration/PageableAddressRepositoryIT.java (87%) rename sdk/cosmos/{azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb => azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos}/repository/integration/PageableMemoRepositoryIT.java (89%) rename sdk/cosmos/{azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb => azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos}/repository/integration/PageablePersonRepositoryIT.java (87%) rename sdk/cosmos/{azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb => azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos}/repository/integration/PersonRepositoryIT.java (64%) rename sdk/cosmos/{azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb => azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos}/repository/integration/ProjectRepositoryIT.java (97%) rename sdk/cosmos/{azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb => azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos}/repository/integration/ProjectRepositorySortIT.java (92%) rename sdk/cosmos/{azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb => azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos}/repository/integration/QuestionRepositoryIT.java (83%) rename sdk/cosmos/{azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb => azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos}/repository/integration/ReactiveCourseRepositoryIT.java (94%) rename sdk/cosmos/{azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb => azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos}/repository/integration/SpELCosmosDBAnnotationIT.java (81%) rename sdk/cosmos/{azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb => azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos}/repository/integration/SquareRepositoryIT.java (80%) rename sdk/cosmos/{azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb => azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos}/repository/integration/StudentRepositoryIT.java (92%) rename sdk/cosmos/{azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb => azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos}/repository/repository/AddressRepository.java (74%) rename sdk/cosmos/{azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb => azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos}/repository/repository/ContactRepository.java (59%) rename sdk/cosmos/{azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb => azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos}/repository/repository/CustomerRepository.java (54%) rename sdk/cosmos/{azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb => azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos}/repository/repository/IntegerIdDomainRepository.java (53%) rename sdk/cosmos/{azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb => azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos}/repository/repository/MemoRepository.java (79%) rename sdk/cosmos/{azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb => azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos}/repository/repository/PageableAddressRepository.java (80%) rename sdk/cosmos/{azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb => azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos}/repository/repository/PageableMemoRepository.java (70%) rename sdk/cosmos/{azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb => azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos}/repository/repository/PageablePersonRepository.java (70%) rename sdk/cosmos/{azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb => azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos}/repository/repository/PartitionPersonRepository.java (53%) rename sdk/cosmos/{azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb => azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos}/repository/repository/PersonRepository.java (52%) rename sdk/cosmos/{azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb => azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos}/repository/repository/ProjectRepository.java (93%) create mode 100644 sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/repository/repository/QuestionRepository.java rename sdk/cosmos/{azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb => azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos}/repository/repository/ReactiveCourseRepository.java (59%) rename sdk/cosmos/{azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb => azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos}/repository/repository/SortedProjectRepository.java (75%) rename sdk/cosmos/{azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb => azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos}/repository/repository/SquareRepository.java (51%) rename sdk/cosmos/{azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb => azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos}/repository/repository/StudentRepository.java (83%) rename sdk/cosmos/{azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb => azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos}/repository/support/CosmosEntityInformationUnitTest.java (95%) rename sdk/cosmos/{azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb => azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos}/repository/support/CosmosRepositoryFactoryBeanUnitTest.java (79%) rename sdk/cosmos/{azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb => azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos}/repository/support/CosmosRepositoryFactoryUnitTest.java (83%) rename sdk/cosmos/{azure-spring-data-cosmosdb => azure-spring-data-cosmos}/src/test/resources/application.properties (100%) rename sdk/cosmos/{azure-spring-data-cosmosdb => azure-spring-data-cosmos}/src/test/resources/application.yml (100%) rename sdk/cosmos/{azure-spring-data-cosmosdb => azure-spring-data-cosmos}/src/test/resources/logback-test.xml (100%) delete mode 100644 sdk/cosmos/azure-spring-data-cosmosdb/CHANGELOG.md delete mode 100644 sdk/cosmos/azure-spring-data-cosmosdb/src/main/resources/META-INF/spring.factories delete mode 100644 sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/repository/repository/QuestionRepository.java diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index e05646bfe713a..40b3f441380eb 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -17,7 +17,7 @@ /sdk/core/ @alzimmermsft @jianghaolu @srnagar @hemanttanwar @anuchandy /sdk/core/azure-core-tracing-opentelemetry/ @samvaity @alzimmermsft /sdk/cosmos/ @moderakh @kushagraThapar @David-Noble-at-work @kirankumarkolli @mbhaskar -/sdk/cosmos/azure-spring-data-cosmosdb/ @kushagraThapar @saragluna @yiliuTo @chenrujun @zhoufenqin @jialindai +/sdk/cosmos/azure-spring-data-cosmos/ @kushagraThapar @saragluna @yiliuTo @chenrujun @zhoufenqin @jialindai /sdk/eventhubs/ @conniey @srnagar @mssfang /sdk/formrecognizer/ @samvaity @mssfang @sima-zhu /sdk/identity/ @schaabs @g2vinay @jianghaolu diff --git a/eng/code-quality-reports/src/main/resources/checkstyle/checkstyle-suppressions.xml b/eng/code-quality-reports/src/main/resources/checkstyle/checkstyle-suppressions.xml index e7baf627fd477..ae6c3fffe457a 100755 --- a/eng/code-quality-reports/src/main/resources/checkstyle/checkstyle-suppressions.xml +++ b/eng/code-quality-reports/src/main/resources/checkstyle/checkstyle-suppressions.xml @@ -474,9 +474,9 @@ + files="com.azure.spring.data.cosmos.config.AbstractCosmosConfiguration.java"/> + files="com.azure.spring.data.cosmos.core.query.CosmosPageRequest.java"/> @@ -485,9 +485,9 @@ - - - - + + + + diff --git a/eng/code-quality-reports/src/main/resources/revapi/revapi.json b/eng/code-quality-reports/src/main/resources/revapi/revapi.json index 20d914254b043..e5f86b0a9328b 100644 --- a/eng/code-quality-reports/src/main/resources/revapi/revapi.json +++ b/eng/code-quality-reports/src/main/resources/revapi/revapi.json @@ -16,7 +16,9 @@ "com\\.microsoft\\.spring\\..+", "javax\\.jms(\\..+)?", "javax\\.servlet(\\..+)?", - "io\\.micrometer(\\..+)?" + "io\\.micrometer(\\..+)?", + "com\\.azure\\.data\\.cosmos(\\..+)?", + "com\\.azure\\.spring\\.data\\.cosmos\\..+" ] } } diff --git a/eng/jacoco-test-coverage/pom.xml b/eng/jacoco-test-coverage/pom.xml index 65e39dc8769ac..775fdce6c59df 100644 --- a/eng/jacoco-test-coverage/pom.xml +++ b/eng/jacoco-test-coverage/pom.xml @@ -276,7 +276,7 @@ com.microsoft.azure spring-data-cosmosdb - 2.3.1-beta.1 + 3.0.0-beta.1 diff --git a/eng/versioning/version_client.txt b/eng/versioning/version_client.txt index 7b76d7a8cf435..c4c3bf7c04864 100644 --- a/eng/versioning/version_client.txt +++ b/eng/versioning/version_client.txt @@ -60,7 +60,7 @@ com.microsoft.azure:azure-servicebus-jms-spring-boot-starter;2.3.2;2.3.3-beta.1 com.microsoft.azure:azure-spring-boot-metrics-starter;2.3.2;2.3.3-beta.1 com.microsoft.azure:azure-spring-boot-tests;2.3.2;2.3.3-beta.1 com.microsoft.azure:azure-spring-boot-test-core;2.3.2;2.3.3-beta.1 -com.microsoft.azure:spring-data-cosmosdb;2.3.0;2.3.1-beta.1 +com.microsoft.azure:spring-data-cosmosdb;3.0.0-beta.1;3.0.0-beta.1 # Unreleased dependencies: Copy the entry from above, prepend "unreleased_" and remove the current # version. Unreleased dependencies are only valid for dependency versions. diff --git a/sdk/cosmos/azure-spring-data-cosmos/CHANGELOG.md b/sdk/cosmos/azure-spring-data-cosmos/CHANGELOG.md new file mode 100644 index 0000000000000..02434784717da --- /dev/null +++ b/sdk/cosmos/azure-spring-data-cosmos/CHANGELOG.md @@ -0,0 +1,3 @@ +# Release History + +## 3.0.0-beta.1 (Unreleased) diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/Contributing.md b/sdk/cosmos/azure-spring-data-cosmos/Contributing.md similarity index 96% rename from sdk/cosmos/azure-spring-data-cosmosdb/Contributing.md rename to sdk/cosmos/azure-spring-data-cosmos/Contributing.md index b22da7d47c965..daad18919bf44 100644 --- a/sdk/cosmos/azure-spring-data-cosmosdb/Contributing.md +++ b/sdk/cosmos/azure-spring-data-cosmos/Contributing.md @@ -10,7 +10,7 @@ To build the project, run maven commands. ```bash git clone https://github.com/Azure/azure-sdk-for-java.git -cd sdk/cosmos/azure-spring-data-cosmosdb +cd sdk/cosmos/azure-spring-data-cosmos mvnw clean install ``` @@ -19,7 +19,7 @@ There're integration tests on azure and on emulator to trigger integration test - Run unit tests ```bash -mvnw clean install +mvn clean install -Dgpg.skip ``` - Run integration tests @@ -52,7 +52,7 @@ mvnw clean install - Skip tests execution ```bash -mvnw clean install -DskipTests +mvn clean install -Dgpg.skip-DskipTests ``` ## Version management diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/README.md b/sdk/cosmos/azure-spring-data-cosmos/README.md similarity index 100% rename from sdk/cosmos/azure-spring-data-cosmosdb/README.md rename to sdk/cosmos/azure-spring-data-cosmos/README.md diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/pom.xml b/sdk/cosmos/azure-spring-data-cosmos/pom.xml similarity index 97% rename from sdk/cosmos/azure-spring-data-cosmosdb/pom.xml rename to sdk/cosmos/azure-spring-data-cosmos/pom.xml index bd96baf15b134..b0798a2bfbd3b 100644 --- a/sdk/cosmos/azure-spring-data-cosmosdb/pom.xml +++ b/sdk/cosmos/azure-spring-data-cosmos/pom.xml @@ -12,18 +12,18 @@ com.microsoft.azure spring-data-cosmosdb - 2.3.1-beta.1 + 3.0.0-beta.1 jar Spring Data for Azure Cosmos DB SQL API Spring Data for Azure Cosmos DB SQL API - https://github.com/Microsoft/spring-data-cosmosdb + https://github.com/Azure/azure-sdk-for-java/tree/master/sdk/cosmos/azure-spring-data-cosmos MM-dd-HH-mm-ss 0.17 0.18 - spring-data-cosmosdb-test + azure-spring-data-cosmos-test testdb-${maven.build.timestamp} true false @@ -238,7 +238,7 @@ 3.1.1 - com/microsoft/azure/spring/data/cosmosdb/core/mapping/BasicCosmosPersistentProperty.java + com/azure/spring/data/cosmos/core/mapping/BasicCosmosPersistentProperty.java diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/Constants.java b/sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/Constants.java similarity index 96% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/Constants.java rename to sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/Constants.java index 63001bddc981f..58b945d2d507f 100644 --- a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/Constants.java +++ b/sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/Constants.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.microsoft.azure.spring.data.cosmosdb; +package com.azure.spring.data.cosmos; import com.azure.data.cosmos.IndexingMode; diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/CosmosDbFactory.java b/sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/CosmosDbFactory.java similarity index 92% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/CosmosDbFactory.java rename to sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/CosmosDbFactory.java index 20ca217535040..9c2d185320a29 100644 --- a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/CosmosDbFactory.java +++ b/sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/CosmosDbFactory.java @@ -1,15 +1,15 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.microsoft.azure.spring.data.cosmosdb; +package com.azure.spring.data.cosmos; import com.azure.data.cosmos.ConnectionPolicy; import com.azure.data.cosmos.CosmosClient; import com.azure.data.cosmos.sync.CosmosSyncClient; -import com.microsoft.azure.spring.data.cosmosdb.common.MacAddress; -import com.microsoft.azure.spring.data.cosmosdb.common.PropertyLoader; -import com.microsoft.azure.spring.data.cosmosdb.common.TelemetrySender; -import com.microsoft.azure.spring.data.cosmosdb.config.CosmosDBConfig; +import com.azure.spring.data.cosmos.common.MacAddress; +import com.azure.spring.data.cosmos.common.PropertyLoader; +import com.azure.spring.data.cosmos.common.TelemetrySender; +import com.azure.spring.data.cosmos.config.CosmosDBConfig; import org.springframework.lang.NonNull; import org.springframework.util.Assert; diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/common/CosmosdbUtils.java b/sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/common/CosmosdbUtils.java similarity index 89% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/common/CosmosdbUtils.java rename to sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/common/CosmosdbUtils.java index 446a675394375..6e0e052d80256 100644 --- a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/common/CosmosdbUtils.java +++ b/sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/common/CosmosdbUtils.java @@ -1,17 +1,17 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.microsoft.azure.spring.data.cosmosdb.common; +package com.azure.spring.data.cosmos.common; import com.azure.data.cosmos.CosmosResponse; import com.azure.data.cosmos.CosmosResponseDiagnostics; import com.azure.data.cosmos.FeedResponse; import com.azure.data.cosmos.FeedResponseDiagnostics; import com.azure.data.cosmos.Resource; +import com.azure.spring.data.cosmos.core.convert.ObjectMapperFactory; +import com.azure.spring.data.cosmos.exception.ConfigurationException; import com.fasterxml.jackson.databind.ObjectMapper; -import com.microsoft.azure.spring.data.cosmosdb.core.ResponseDiagnostics; -import com.microsoft.azure.spring.data.cosmosdb.core.ResponseDiagnosticsProcessor; -import com.microsoft.azure.spring.data.cosmosdb.core.convert.ObjectMapperFactory; -import com.microsoft.azure.spring.data.cosmosdb.exception.ConfigurationException; +import com.azure.spring.data.cosmos.core.ResponseDiagnostics; +import com.azure.spring.data.cosmos.core.ResponseDiagnosticsProcessor; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.lang.NonNull; diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/common/ExpressionResolver.java b/sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/common/ExpressionResolver.java similarity index 96% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/common/ExpressionResolver.java rename to sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/common/ExpressionResolver.java index c992ae5eaa4a0..2d4261016a726 100644 --- a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/common/ExpressionResolver.java +++ b/sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/common/ExpressionResolver.java @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.microsoft.azure.spring.data.cosmosdb.common; +package com.azure.spring.data.cosmos.common; import org.springframework.beans.factory.BeanFactory; import org.springframework.beans.factory.config.ConfigurableBeanFactory; diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/common/MacAddress.java b/sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/common/MacAddress.java similarity index 98% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/common/MacAddress.java rename to sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/common/MacAddress.java index 9db4d22a09efe..41ff8997e1867 100644 --- a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/common/MacAddress.java +++ b/sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/common/MacAddress.java @@ -7,7 +7,7 @@ * Location in the repo: /Utils/azuretools-core/src/com/microsoft/azuretools/azurecommons/util/MacAddress.java */ -package com.microsoft.azure.spring.data.cosmosdb.common; +package com.azure.spring.data.cosmos.common; import org.springframework.lang.NonNull; import org.springframework.util.Assert; diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/common/Memoizer.java b/sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/common/Memoizer.java similarity index 94% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/common/Memoizer.java rename to sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/common/Memoizer.java index ce3530647e724..f628528e0e042 100644 --- a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/common/Memoizer.java +++ b/sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/common/Memoizer.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.microsoft.azure.spring.data.cosmosdb.common; +package com.azure.spring.data.cosmos.common; import java.util.Map; import java.util.concurrent.ConcurrentHashMap; diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/common/PropertyLoader.java b/sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/common/PropertyLoader.java similarity index 97% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/common/PropertyLoader.java rename to sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/common/PropertyLoader.java index e01c5bba32210..58446d470828e 100644 --- a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/common/PropertyLoader.java +++ b/sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/common/PropertyLoader.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.microsoft.azure.spring.data.cosmosdb.common; +package com.azure.spring.data.cosmos.common; import org.springframework.lang.NonNull; diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/common/TelemetryEventData.java b/sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/common/TelemetryEventData.java similarity index 98% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/common/TelemetryEventData.java rename to sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/common/TelemetryEventData.java index 56a980dcd3d0c..bb6af01be6cbf 100644 --- a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/common/TelemetryEventData.java +++ b/sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/common/TelemetryEventData.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.microsoft.azure.spring.data.cosmosdb.common; +package com.azure.spring.data.cosmos.common; import com.fasterxml.jackson.annotation.JsonProperty; import org.springframework.lang.NonNull; diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/common/TelemetrySender.java b/sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/common/TelemetrySender.java similarity index 96% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/common/TelemetrySender.java rename to sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/common/TelemetrySender.java index d6ef8baac1736..c57df311ff78f 100644 --- a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/common/TelemetrySender.java +++ b/sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/common/TelemetrySender.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.microsoft.azure.spring.data.cosmosdb.common; +package com.azure.spring.data.cosmos.common; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; @@ -33,7 +33,7 @@ public class TelemetrySender { private static final String PROPERTY_SERVICE_NAME = "serviceName"; - private static final String PROJECT_INFO = "spring-data-cosmosdb/" + private static final String PROJECT_INFO = "azure-spring-data-cosmos/" + PropertyLoader.getProjectVersion(); private static final String TELEMETRY_TARGET_URL = "https://dc.services.visualstudio.com/v2/track"; diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/common/package-info.java b/sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/common/package-info.java similarity index 74% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/common/package-info.java rename to sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/common/package-info.java index bbfa061b299a0..8d421f5a0492f 100644 --- a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/common/package-info.java +++ b/sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/common/package-info.java @@ -4,4 +4,4 @@ /** * This package contains the classes of utils for cosmosdb */ -package com.microsoft.azure.spring.data.cosmosdb.common; +package com.azure.spring.data.cosmos.common; diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/config/AbstractCosmosConfiguration.java b/sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/config/AbstractCosmosConfiguration.java similarity index 87% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/config/AbstractCosmosConfiguration.java rename to sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/config/AbstractCosmosConfiguration.java index 0053988578897..cf9b204e4b2d6 100644 --- a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/config/AbstractCosmosConfiguration.java +++ b/sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/config/AbstractCosmosConfiguration.java @@ -1,16 +1,16 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.microsoft.azure.spring.data.cosmosdb.config; +package com.azure.spring.data.cosmos.config; import com.azure.data.cosmos.CosmosClient; import com.azure.data.cosmos.sync.CosmosSyncClient; +import com.azure.spring.data.cosmos.core.convert.MappingCosmosConverter; import com.fasterxml.jackson.databind.ObjectMapper; -import com.microsoft.azure.spring.data.cosmosdb.Constants; -import com.microsoft.azure.spring.data.cosmosdb.CosmosDbFactory; -import com.microsoft.azure.spring.data.cosmosdb.core.CosmosTemplate; -import com.microsoft.azure.spring.data.cosmosdb.core.ReactiveCosmosTemplate; -import com.microsoft.azure.spring.data.cosmosdb.core.convert.MappingCosmosConverter; +import com.azure.spring.data.cosmos.CosmosDbFactory; +import com.azure.spring.data.cosmos.Constants; +import com.azure.spring.data.cosmos.core.CosmosTemplate; +import com.azure.spring.data.cosmos.core.ReactiveCosmosTemplate; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.context.annotation.Bean; diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/config/CosmosConfigurationSupport.java b/sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/config/CosmosConfigurationSupport.java similarity index 94% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/config/CosmosConfigurationSupport.java rename to sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/config/CosmosConfigurationSupport.java index 458cc27cb2536..07bd795e99fc2 100644 --- a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/config/CosmosConfigurationSupport.java +++ b/sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/config/CosmosConfigurationSupport.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.microsoft.azure.spring.data.cosmosdb.config; +package com.azure.spring.data.cosmos.config; -import com.microsoft.azure.spring.data.cosmosdb.common.ExpressionResolver; -import com.microsoft.azure.spring.data.cosmosdb.core.mapping.CosmosMappingContext; +import com.azure.spring.data.cosmos.core.mapping.CosmosMappingContext; +import com.azure.spring.data.cosmos.common.ExpressionResolver; import org.springframework.beans.factory.BeanFactory; import org.springframework.beans.factory.config.BeanDefinition; import org.springframework.context.annotation.Bean; diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/config/CosmosDBConfig.java b/sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/config/CosmosDBConfig.java similarity index 98% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/config/CosmosDBConfig.java rename to sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/config/CosmosDBConfig.java index d8b607986dd7c..2cab7cb3466c0 100644 --- a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/config/CosmosDBConfig.java +++ b/sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/config/CosmosDBConfig.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.microsoft.azure.spring.data.cosmosdb.config; +package com.azure.spring.data.cosmos.config; import com.azure.data.cosmos.ConnectionPolicy; import com.azure.data.cosmos.ConsistencyLevel; import com.azure.data.cosmos.CosmosKeyCredential; import com.azure.data.cosmos.internal.RequestOptions; -import com.microsoft.azure.spring.data.cosmosdb.core.ResponseDiagnosticsProcessor; -import com.microsoft.azure.spring.data.cosmosdb.exception.CosmosDBAccessException; +import com.azure.spring.data.cosmos.core.ResponseDiagnosticsProcessor; +import com.azure.spring.data.cosmos.exception.CosmosDBAccessException; import org.springframework.util.Assert; import java.beans.ConstructorProperties; diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/config/package-info.java b/sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/config/package-info.java similarity index 75% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/config/package-info.java rename to sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/config/package-info.java index f2fcbfbf67540..af2cccf865d6c 100644 --- a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/config/package-info.java +++ b/sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/config/package-info.java @@ -4,4 +4,4 @@ /** * This package contains the classes to configure properties of cosmos db */ -package com.microsoft.azure.spring.data.cosmosdb.config; +package com.azure.spring.data.cosmos.config; diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/core/CosmosOperations.java b/sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/core/CosmosOperations.java similarity index 96% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/core/CosmosOperations.java rename to sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/core/CosmosOperations.java index 458e29377112a..b723c4d9423e3 100644 --- a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/core/CosmosOperations.java +++ b/sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/core/CosmosOperations.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.microsoft.azure.spring.data.cosmosdb.core; +package com.azure.spring.data.cosmos.core; import com.azure.data.cosmos.CosmosContainerProperties; import com.azure.data.cosmos.PartitionKey; -import com.microsoft.azure.spring.data.cosmosdb.core.convert.MappingCosmosConverter; -import com.microsoft.azure.spring.data.cosmosdb.core.query.DocumentQuery; -import com.microsoft.azure.spring.data.cosmosdb.repository.support.CosmosEntityInformation; +import com.azure.spring.data.cosmos.core.convert.MappingCosmosConverter; +import com.azure.spring.data.cosmos.core.query.DocumentQuery; +import com.azure.spring.data.cosmos.repository.support.CosmosEntityInformation; import org.springframework.data.domain.Page; import org.springframework.data.domain.Pageable; diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/core/CosmosTemplate.java b/sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/core/CosmosTemplate.java similarity index 88% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/core/CosmosTemplate.java rename to sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/core/CosmosTemplate.java index 2e3a5c116cb78..2fbe470dc45af 100644 --- a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/core/CosmosTemplate.java +++ b/sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/core/CosmosTemplate.java @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.microsoft.azure.spring.data.cosmosdb.core; +package com.azure.spring.data.cosmos.core; import com.azure.data.cosmos.CosmosItemResponse; import com.azure.data.cosmos.AccessCondition; @@ -15,17 +15,19 @@ import com.azure.data.cosmos.CosmosContainerProperties; import com.azure.data.cosmos.CosmosContainerResponse; import com.azure.data.cosmos.PartitionKey; -import com.microsoft.azure.spring.data.cosmosdb.CosmosDbFactory; -import com.microsoft.azure.spring.data.cosmosdb.common.Memoizer; -import com.microsoft.azure.spring.data.cosmosdb.core.convert.MappingCosmosConverter; -import com.microsoft.azure.spring.data.cosmosdb.core.generator.CountQueryGenerator; -import com.microsoft.azure.spring.data.cosmosdb.core.generator.FindQuerySpecGenerator; -import com.microsoft.azure.spring.data.cosmosdb.core.query.Criteria; -import com.microsoft.azure.spring.data.cosmosdb.core.query.CosmosPageImpl; -import com.microsoft.azure.spring.data.cosmosdb.core.query.CriteriaType; -import com.microsoft.azure.spring.data.cosmosdb.core.query.DocumentQuery; -import com.microsoft.azure.spring.data.cosmosdb.core.query.CosmosPageRequest; -import com.microsoft.azure.spring.data.cosmosdb.repository.support.CosmosEntityInformation; +import com.azure.spring.data.cosmos.common.CosmosdbUtils; +import com.azure.spring.data.cosmos.common.Memoizer; +import com.azure.spring.data.cosmos.core.convert.MappingCosmosConverter; +import com.azure.spring.data.cosmos.core.generator.CountQueryGenerator; +import com.azure.spring.data.cosmos.core.generator.FindQuerySpecGenerator; +import com.azure.spring.data.cosmos.core.query.CosmosPageImpl; +import com.azure.spring.data.cosmos.core.query.CosmosPageRequest; +import com.azure.spring.data.cosmos.core.query.Criteria; +import com.azure.spring.data.cosmos.core.query.CriteriaType; +import com.azure.spring.data.cosmos.core.query.DocumentQuery; +import com.azure.spring.data.cosmos.exception.CosmosDBExceptionUtils; +import com.azure.spring.data.cosmos.repository.support.CosmosEntityInformation; +import com.azure.spring.data.cosmos.CosmosDbFactory; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.BeansException; @@ -46,10 +48,6 @@ import java.util.function.Function; import java.util.stream.Collectors; -import static com.microsoft.azure.spring.data.cosmosdb.common.CosmosdbUtils.fillAndProcessResponseDiagnostics; -import static com.microsoft.azure.spring.data.cosmosdb.exception.CosmosDBExceptionUtils.exceptionHandler; -import static com.microsoft.azure.spring.data.cosmosdb.exception.CosmosDBExceptionUtils.findAPIExceptionHandler; - /** * Template class for cosmos db */ @@ -136,10 +134,11 @@ public T insert(String containerName, T objectToSave, PartitionKey partition .getDatabase(this.databaseName) .getContainer(containerName) .createItem(originalItem, options) - .doOnNext(cosmosItemResponse -> fillAndProcessResponseDiagnostics(responseDiagnosticsProcessor, - cosmosItemResponse, null)) + .doOnNext(cosmosItemResponse -> + CosmosdbUtils.fillAndProcessResponseDiagnostics(responseDiagnosticsProcessor, + cosmosItemResponse, null)) .onErrorResume(throwable -> - exceptionHandler("Failed to insert item", throwable)) + CosmosDBExceptionUtils.exceptionHandler("Failed to insert item", throwable)) .block(); assert response != null; @@ -172,13 +171,13 @@ public T findById(Object id, Class domainType, PartitionKey partitionKey) .getItem(id.toString(), partitionKey) .read() .flatMap(cosmosItemResponse -> { - fillAndProcessResponseDiagnostics(responseDiagnosticsProcessor, + CosmosdbUtils.fillAndProcessResponseDiagnostics(responseDiagnosticsProcessor, cosmosItemResponse, null); return Mono.justOrEmpty(toDomainObject(domainType, cosmosItemResponse.properties())); }) .onErrorResume(throwable -> - findAPIExceptionHandler("Failed to find item", throwable)) + CosmosDBExceptionUtils.findAPIExceptionHandler("Failed to find item", throwable)) .block(); } @@ -204,7 +203,7 @@ public T findById(String containerName, Object id, Class domainType) { .getContainer(containerName) .queryItems(query, options) .flatMap(cosmosItemFeedResponse -> { - fillAndProcessResponseDiagnostics(responseDiagnosticsProcessor, + CosmosdbUtils.fillAndProcessResponseDiagnostics(responseDiagnosticsProcessor, null, cosmosItemFeedResponse); return Mono.justOrEmpty(cosmosItemFeedResponse .results() @@ -213,7 +212,7 @@ public T findById(String containerName, Object id, Class domainType) { .findFirst()); }) .onErrorResume(throwable -> - findAPIExceptionHandler("Failed to find item", throwable)) + CosmosDBExceptionUtils.findAPIExceptionHandler("Failed to find item", throwable)) .blockFirst(); } @@ -267,9 +266,9 @@ public T upsertAndReturnEntity(String containerName, T object, PartitionKey .getDatabase(this.databaseName) .getContainer(containerName) .upsertItem(originalItem, options) - .doOnNext(response -> fillAndProcessResponseDiagnostics(responseDiagnosticsProcessor, + .doOnNext(response -> CosmosdbUtils.fillAndProcessResponseDiagnostics(responseDiagnosticsProcessor, response, null)) - .onErrorResume(throwable -> exceptionHandler("Failed to upsert item", throwable)) + .onErrorResume(throwable -> CosmosDBExceptionUtils.exceptionHandler("Failed to upsert item", throwable)) .block(); assert cosmosItemResponse != null; @@ -325,13 +324,13 @@ public List findAll(PartitionKey partitionKey, final Class domainType) .getContainer(containerName) .readAllItems(feedOptions) .flatMap(cosmosItemFeedResponse -> { - fillAndProcessResponseDiagnostics(responseDiagnosticsProcessor, + CosmosdbUtils.fillAndProcessResponseDiagnostics(responseDiagnosticsProcessor, null, cosmosItemFeedResponse); return Flux.fromIterable(cosmosItemFeedResponse.results()); }) .map(cosmosItemProperties -> toDomainObject(domainType, cosmosItemProperties)) .onErrorResume(throwable -> - exceptionHandler("Failed to find items", throwable)) + CosmosDBExceptionUtils.exceptionHandler("Failed to find items", throwable)) .collectList() .block(); } @@ -361,10 +360,10 @@ public void deleteContainer(@NonNull String containerName) { cosmosClient.getDatabase(this.databaseName) .getContainer(containerName) .delete() - .doOnNext(response -> fillAndProcessResponseDiagnostics(responseDiagnosticsProcessor, + .doOnNext(response -> CosmosdbUtils.fillAndProcessResponseDiagnostics(responseDiagnosticsProcessor, response, null)) .onErrorResume(throwable -> - exceptionHandler("Failed to delete container", throwable)) + CosmosDBExceptionUtils.exceptionHandler("Failed to delete container", throwable)) .block(); } @@ -394,9 +393,9 @@ public CosmosContainerProperties createContainerIfNotExists(CosmosEntityInformat final CosmosContainerResponse response = cosmosClient .createDatabaseIfNotExists(this.databaseName) .onErrorResume(throwable -> - exceptionHandler("Failed to create database", throwable)) + CosmosDBExceptionUtils.exceptionHandler("Failed to create database", throwable)) .flatMap(cosmosDatabaseResponse -> { - fillAndProcessResponseDiagnostics(responseDiagnosticsProcessor, + CosmosdbUtils.fillAndProcessResponseDiagnostics(responseDiagnosticsProcessor, cosmosDatabaseResponse, null); final CosmosContainerProperties cosmosContainerProperties = new CosmosContainerProperties( information.getContainerName(), "/" @@ -407,9 +406,9 @@ public CosmosContainerProperties createContainerIfNotExists(CosmosEntityInformat .database() .createContainerIfNotExists(cosmosContainerProperties, information.getRequestUnit()) .onErrorResume(throwable -> - exceptionHandler("Failed to create container", throwable)) + CosmosDBExceptionUtils.exceptionHandler("Failed to create container", throwable)) .doOnNext(cosmosContainerResponse -> - fillAndProcessResponseDiagnostics(responseDiagnosticsProcessor, + CosmosdbUtils.fillAndProcessResponseDiagnostics(responseDiagnosticsProcessor, cosmosContainerResponse, null)); }) .block(); @@ -440,10 +439,10 @@ public void deleteById(String containerName, Object id, PartitionKey partitionKe .getContainer(containerName) .getItem(id.toString(), partitionKey) .delete(options) - .doOnNext(response -> fillAndProcessResponseDiagnostics(responseDiagnosticsProcessor, + .doOnNext(response -> CosmosdbUtils.fillAndProcessResponseDiagnostics(responseDiagnosticsProcessor, response, null)) .onErrorResume(throwable -> - exceptionHandler("Failed to delete item", throwable)) + CosmosDBExceptionUtils.exceptionHandler("Failed to delete item", throwable)) .block(); } @@ -547,10 +546,11 @@ public Page paginationQuery(DocumentQuery query, Class domainType, Str .getDatabase(this.databaseName) .getContainer(containerName) .queryItems(sqlQuerySpec, feedOptions) - .doOnNext(propertiesFeedResponse -> fillAndProcessResponseDiagnostics(responseDiagnosticsProcessor, + .doOnNext(propertiesFeedResponse -> + CosmosdbUtils.fillAndProcessResponseDiagnostics(responseDiagnosticsProcessor, null, propertiesFeedResponse)) .onErrorResume(throwable -> - exceptionHandler("Failed to query items", throwable)) + CosmosDBExceptionUtils.exceptionHandler("Failed to query items", throwable)) .next() .block(); @@ -632,8 +632,8 @@ private Long getCountValue(DocumentQuery query, boolean isCrossPartitionQuery, S return executeQuery(querySpec, containerName, options) .onErrorResume(throwable -> - exceptionHandler("Failed to get count value", throwable)) - .doOnNext(response -> fillAndProcessResponseDiagnostics(responseDiagnosticsProcessor, + CosmosDBExceptionUtils.exceptionHandler("Failed to get count value", throwable)) + .doOnNext(response -> CosmosdbUtils.fillAndProcessResponseDiagnostics(responseDiagnosticsProcessor, null, response)) .next() .map(r -> r.results().get(0).getLong(COUNT_VALUE_KEY)) @@ -646,7 +646,7 @@ private Flux> executeQuery(SqlQuerySpec sqlQu .getContainer(containerName) .queryItems(sqlQuerySpec, options) .onErrorResume(throwable -> - exceptionHandler("Failed to execute query", throwable)); + CosmosDBExceptionUtils.exceptionHandler("Failed to execute query", throwable)); } private List getPartitionKeyNames(Class domainType) { @@ -681,12 +681,12 @@ private List findItems(@NonNull DocumentQuery query, .getContainer(containerName) .queryItems(sqlQuerySpec, feedOptions) .flatMap(cosmosItemFeedResponse -> { - fillAndProcessResponseDiagnostics(responseDiagnosticsProcessor, + CosmosdbUtils.fillAndProcessResponseDiagnostics(responseDiagnosticsProcessor, null, cosmosItemFeedResponse); return Flux.fromIterable(cosmosItemFeedResponse.results()); }) .onErrorResume(throwable -> - exceptionHandler("Failed to find items", throwable)) + CosmosDBExceptionUtils.exceptionHandler("Failed to find items", throwable)) .collectList() .block(); } @@ -716,10 +716,10 @@ private CosmosItemResponse deleteItem(@NonNull CosmosItemProperties cosmosItemPr .getContainer(containerName) .getItem(cosmosItemProperties.id(), partitionKey) .delete(options) - .doOnNext(response -> fillAndProcessResponseDiagnostics(responseDiagnosticsProcessor, + .doOnNext(response -> CosmosdbUtils.fillAndProcessResponseDiagnostics(responseDiagnosticsProcessor, response, null)) .onErrorResume(throwable -> - exceptionHandler("Failed to delete item", throwable)) + CosmosDBExceptionUtils.exceptionHandler("Failed to delete item", throwable)) .block(); } diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/core/ReactiveCosmosOperations.java b/sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/core/ReactiveCosmosOperations.java similarity index 95% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/core/ReactiveCosmosOperations.java rename to sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/core/ReactiveCosmosOperations.java index e2320fd6c6792..04b4a447db3c9 100644 --- a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/core/ReactiveCosmosOperations.java +++ b/sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/core/ReactiveCosmosOperations.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.microsoft.azure.spring.data.cosmosdb.core; +package com.azure.spring.data.cosmos.core; import com.azure.data.cosmos.CosmosContainerResponse; import com.azure.data.cosmos.PartitionKey; -import com.microsoft.azure.spring.data.cosmosdb.core.convert.MappingCosmosConverter; -import com.microsoft.azure.spring.data.cosmosdb.core.query.DocumentQuery; -import com.microsoft.azure.spring.data.cosmosdb.repository.support.CosmosEntityInformation; +import com.azure.spring.data.cosmos.core.convert.MappingCosmosConverter; +import com.azure.spring.data.cosmos.core.query.DocumentQuery; +import com.azure.spring.data.cosmos.repository.support.CosmosEntityInformation; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/core/ReactiveCosmosTemplate.java b/sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/core/ReactiveCosmosTemplate.java similarity index 86% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/core/ReactiveCosmosTemplate.java rename to sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/core/ReactiveCosmosTemplate.java index 38200f453b31f..d7f5528d8c056 100644 --- a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/core/ReactiveCosmosTemplate.java +++ b/sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/core/ReactiveCosmosTemplate.java @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.microsoft.azure.spring.data.cosmosdb.core; +package com.azure.spring.data.cosmos.core; import com.azure.data.cosmos.AccessCondition; import com.azure.data.cosmos.AccessConditionType; @@ -14,15 +14,17 @@ import com.azure.data.cosmos.CosmosContainerProperties; import com.azure.data.cosmos.CosmosContainerResponse; import com.azure.data.cosmos.PartitionKey; -import com.microsoft.azure.spring.data.cosmosdb.CosmosDbFactory; -import com.microsoft.azure.spring.data.cosmosdb.common.Memoizer; -import com.microsoft.azure.spring.data.cosmosdb.core.convert.MappingCosmosConverter; -import com.microsoft.azure.spring.data.cosmosdb.core.generator.CountQueryGenerator; -import com.microsoft.azure.spring.data.cosmosdb.core.generator.FindQuerySpecGenerator; -import com.microsoft.azure.spring.data.cosmosdb.core.query.Criteria; -import com.microsoft.azure.spring.data.cosmosdb.core.query.CriteriaType; -import com.microsoft.azure.spring.data.cosmosdb.core.query.DocumentQuery; -import com.microsoft.azure.spring.data.cosmosdb.repository.support.CosmosEntityInformation; +import com.azure.spring.data.cosmos.common.CosmosdbUtils; +import com.azure.spring.data.cosmos.common.Memoizer; +import com.azure.spring.data.cosmos.core.convert.MappingCosmosConverter; +import com.azure.spring.data.cosmos.core.generator.CountQueryGenerator; +import com.azure.spring.data.cosmos.core.generator.FindQuerySpecGenerator; +import com.azure.spring.data.cosmos.core.query.Criteria; +import com.azure.spring.data.cosmos.core.query.CriteriaType; +import com.azure.spring.data.cosmos.core.query.DocumentQuery; +import com.azure.spring.data.cosmos.exception.CosmosDBExceptionUtils; +import com.azure.spring.data.cosmos.repository.support.CosmosEntityInformation; +import com.azure.spring.data.cosmos.CosmosDbFactory; import org.springframework.beans.BeansException; import org.springframework.context.ApplicationContext; import org.springframework.context.ApplicationContextAware; @@ -37,10 +39,6 @@ import java.util.List; import java.util.function.Function; -import static com.microsoft.azure.spring.data.cosmosdb.common.CosmosdbUtils.fillAndProcessResponseDiagnostics; -import static com.microsoft.azure.spring.data.cosmosdb.exception.CosmosDBExceptionUtils.exceptionHandler; -import static com.microsoft.azure.spring.data.cosmosdb.exception.CosmosDBExceptionUtils.findAPIExceptionHandler; - /** * Template class of reactive cosmos */ @@ -113,9 +111,9 @@ public Mono createContainerIfNotExists(CosmosEntityInfo return cosmosClient .createDatabaseIfNotExists(this.databaseName) .onErrorResume(throwable -> - exceptionHandler("Failed to create database", throwable)) + CosmosDBExceptionUtils.exceptionHandler("Failed to create database", throwable)) .flatMap(cosmosDatabaseResponse -> { - fillAndProcessResponseDiagnostics(responseDiagnosticsProcessor, + CosmosdbUtils.fillAndProcessResponseDiagnostics(responseDiagnosticsProcessor, cosmosDatabaseResponse, null); final CosmosContainerProperties cosmosContainerProperties = new CosmosContainerProperties( information.getContainerName(), @@ -126,13 +124,13 @@ public Mono createContainerIfNotExists(CosmosEntityInfo .database() .createContainerIfNotExists(cosmosContainerProperties, information.getRequestUnit()) .map(cosmosContainerResponse -> { - fillAndProcessResponseDiagnostics(responseDiagnosticsProcessor, + CosmosdbUtils.fillAndProcessResponseDiagnostics(responseDiagnosticsProcessor, cosmosContainerResponse, null); this.containerNameCache.add(information.getContainerName()); return cosmosContainerResponse; }) .onErrorResume(throwable -> - exceptionHandler("Failed to create container", throwable)); + CosmosDBExceptionUtils.exceptionHandler("Failed to create container", throwable)); }); } @@ -178,13 +176,13 @@ public Flux findAll(PartitionKey partitionKey, Class domainType) { .getContainer(containerName) .readAllItems(feedOptions) .flatMap(cosmosItemFeedResponse -> { - fillAndProcessResponseDiagnostics(responseDiagnosticsProcessor, + CosmosdbUtils.fillAndProcessResponseDiagnostics(responseDiagnosticsProcessor, null, cosmosItemFeedResponse); return Flux.fromIterable(cosmosItemFeedResponse.results()); }) .map(cosmosItemProperties -> toDomainObject(domainType, cosmosItemProperties)) .onErrorResume(throwable -> - exceptionHandler("Failed to find items", throwable)); + CosmosDBExceptionUtils.exceptionHandler("Failed to find items", throwable)); } /** @@ -223,7 +221,7 @@ public Mono findById(String containerName, Object id, Class domainType .getContainer(containerName) .queryItems(query, options) .flatMap(cosmosItemFeedResponse -> { - fillAndProcessResponseDiagnostics(responseDiagnosticsProcessor, + CosmosdbUtils.fillAndProcessResponseDiagnostics(responseDiagnosticsProcessor, null, cosmosItemFeedResponse); return Mono.justOrEmpty(cosmosItemFeedResponse .results() @@ -232,7 +230,7 @@ public Mono findById(String containerName, Object id, Class domainType .findFirst()); }) .onErrorResume(throwable -> - findAPIExceptionHandler("Failed to find item", throwable)) + CosmosDBExceptionUtils.findAPIExceptionHandler("Failed to find item", throwable)) .next(); } @@ -255,13 +253,13 @@ public Mono findById(Object id, Class domainType, PartitionKey partiti .getItem(id.toString(), partitionKey) .read() .flatMap(cosmosItemResponse -> { - fillAndProcessResponseDiagnostics(responseDiagnosticsProcessor, + CosmosdbUtils.fillAndProcessResponseDiagnostics(responseDiagnosticsProcessor, cosmosItemResponse, null); return Mono.justOrEmpty(toDomainObject(domainType, cosmosItemResponse.properties())); }) .onErrorResume(throwable -> - findAPIExceptionHandler("Failed to find item", throwable)); + CosmosDBExceptionUtils.findAPIExceptionHandler("Failed to find item", throwable)); } /** @@ -294,9 +292,9 @@ public Mono insert(T objectToSave) { .getContainer(getContainerName(objectToSave.getClass())) .createItem(originalItem, new CosmosItemRequestOptions()) .onErrorResume(throwable -> - exceptionHandler("Failed to insert item", throwable)) + CosmosDBExceptionUtils.exceptionHandler("Failed to insert item", throwable)) .flatMap(cosmosItemResponse -> { - fillAndProcessResponseDiagnostics(responseDiagnosticsProcessor, + CosmosdbUtils.fillAndProcessResponseDiagnostics(responseDiagnosticsProcessor, cosmosItemResponse, null); return Mono.just(toDomainObject(domainType, cosmosItemResponse.properties())); }); @@ -325,9 +323,9 @@ public Mono insert(String containerName, Object objectToSave, PartitionKe .getContainer(containerName) .createItem(originalItem, options) .onErrorResume(throwable -> - exceptionHandler("Failed to insert item", throwable)) + CosmosDBExceptionUtils.exceptionHandler("Failed to insert item", throwable)) .flatMap(cosmosItemResponse -> { - fillAndProcessResponseDiagnostics(responseDiagnosticsProcessor, + CosmosdbUtils.fillAndProcessResponseDiagnostics(responseDiagnosticsProcessor, cosmosItemResponse, null); return Mono.just(toDomainObject(domainType, cosmosItemResponse.properties())); }); @@ -368,12 +366,12 @@ public Mono upsert(String containerName, T object, PartitionKey partition .getContainer(containerName) .upsertItem(originalItem, options) .flatMap(cosmosItemResponse -> { - fillAndProcessResponseDiagnostics(responseDiagnosticsProcessor, + CosmosdbUtils.fillAndProcessResponseDiagnostics(responseDiagnosticsProcessor, cosmosItemResponse, null); return Mono.just(toDomainObject(domainType, cosmosItemResponse.properties())); }) .onErrorResume(throwable -> - exceptionHandler("Failed to upsert item", throwable)); + CosmosDBExceptionUtils.exceptionHandler("Failed to upsert item", throwable)); } /** @@ -400,10 +398,10 @@ public Mono deleteById(String containerName, Object id, PartitionKey parti .getItem(id.toString(), partitionKey) .delete(options) .doOnNext(cosmosItemResponse -> - fillAndProcessResponseDiagnostics(responseDiagnosticsProcessor, + CosmosdbUtils.fillAndProcessResponseDiagnostics(responseDiagnosticsProcessor, cosmosItemResponse, null)) .onErrorResume(throwable -> - exceptionHandler("Failed to delete item", throwable)) + CosmosDBExceptionUtils.exceptionHandler("Failed to delete item", throwable)) .then(); } @@ -430,9 +428,9 @@ public Mono deleteAll(String containerName, String partitionKeyName) { .getContainer(containerName) .queryItems(sqlQuerySpec, options) .onErrorResume(throwable -> - exceptionHandler("Failed to query items", throwable)) + CosmosDBExceptionUtils.exceptionHandler("Failed to query items", throwable)) .flatMap(cosmosItemFeedResponse -> { - fillAndProcessResponseDiagnostics(responseDiagnosticsProcessor, + CosmosdbUtils.fillAndProcessResponseDiagnostics(responseDiagnosticsProcessor, null, cosmosItemFeedResponse); return Flux.fromIterable(cosmosItemFeedResponse.results()); }) @@ -442,10 +440,10 @@ public Mono deleteAll(String containerName, String partitionKeyName) { .getItem(cosmosItemProperties.id(), cosmosItemProperties.get(partitionKeyName)) .delete() .doOnNext(cosmosItemResponse -> - fillAndProcessResponseDiagnostics(responseDiagnosticsProcessor, + CosmosdbUtils.fillAndProcessResponseDiagnostics(responseDiagnosticsProcessor, cosmosItemResponse, null)) .onErrorResume(throwable -> - exceptionHandler("Failed to delete items", throwable))) + CosmosDBExceptionUtils.exceptionHandler("Failed to delete items", throwable))) .then(); } @@ -558,10 +556,10 @@ private Mono getCountValue(DocumentQuery query, boolean isCrossPartitionQu options.populateQueryMetrics(isPopulateQueryMetrics); return executeQuery(querySpec, containerName, options) - .doOnNext(feedResponse -> fillAndProcessResponseDiagnostics(responseDiagnosticsProcessor, + .doOnNext(feedResponse -> CosmosdbUtils.fillAndProcessResponseDiagnostics(responseDiagnosticsProcessor, null, feedResponse)) .onErrorResume(throwable -> - exceptionHandler("Failed to get count value", throwable)) + CosmosDBExceptionUtils.exceptionHandler("Failed to get count value", throwable)) .next() .map(r -> r.results().get(0).getLong(COUNT_VALUE_KEY)); } @@ -573,7 +571,7 @@ private Flux> executeQuery(SqlQuerySpec sqlQu .getContainer(containerName) .queryItems(sqlQuerySpec, options) .onErrorResume(throwable -> - exceptionHandler("Failed to execute query", throwable)); + CosmosDBExceptionUtils.exceptionHandler("Failed to execute query", throwable)); } /** @@ -588,10 +586,10 @@ public void deleteContainer(@NonNull String containerName) { .getContainer(containerName) .delete() .doOnNext(cosmosContainerResponse -> - fillAndProcessResponseDiagnostics(responseDiagnosticsProcessor, + CosmosdbUtils.fillAndProcessResponseDiagnostics(responseDiagnosticsProcessor, cosmosContainerResponse, null)) .onErrorResume(throwable -> - exceptionHandler("Failed to delete container", throwable)) + CosmosDBExceptionUtils.exceptionHandler("Failed to delete container", throwable)) .block(); this.containerNameCache.remove(containerName); } @@ -619,12 +617,12 @@ private Flux findItems(@NonNull DocumentQuery query, @NonN .getContainer(containerName) .queryItems(sqlQuerySpec, feedOptions) .flatMap(cosmosItemFeedResponse -> { - fillAndProcessResponseDiagnostics(responseDiagnosticsProcessor, + CosmosdbUtils.fillAndProcessResponseDiagnostics(responseDiagnosticsProcessor, null, cosmosItemFeedResponse); return Flux.fromIterable(cosmosItemFeedResponse.results()); }) .onErrorResume(throwable -> - exceptionHandler("Failed to query items", throwable)); + CosmosDBExceptionUtils.exceptionHandler("Failed to query items", throwable)); } private void assertValidId(Object id) { @@ -665,12 +663,12 @@ private Mono deleteItem(@NonNull CosmosItemProperties cosm .getItem(cosmosItemProperties.id(), partitionKey) .delete(options) .map(cosmosItemResponse -> { - fillAndProcessResponseDiagnostics(responseDiagnosticsProcessor, + CosmosdbUtils.fillAndProcessResponseDiagnostics(responseDiagnosticsProcessor, cosmosItemResponse, null); return cosmosItemProperties; }) .onErrorResume(throwable -> - exceptionHandler("Failed to delete item", throwable)); + CosmosDBExceptionUtils.exceptionHandler("Failed to delete item", throwable)); } private T toDomainObject(@NonNull Class domainType, CosmosItemProperties cosmosItemProperties) { diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/core/ResponseDiagnostics.java b/sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/core/ResponseDiagnostics.java similarity index 98% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/core/ResponseDiagnostics.java rename to sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/core/ResponseDiagnostics.java index 316eee94c4f1b..c5c990c6b66d1 100644 --- a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/core/ResponseDiagnostics.java +++ b/sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/core/ResponseDiagnostics.java @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.microsoft.azure.spring.data.cosmosdb.core; +package com.azure.spring.data.cosmos.core; import com.azure.data.cosmos.CosmosResponseDiagnostics; import com.azure.data.cosmos.FeedResponse; diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/core/ResponseDiagnosticsProcessor.java b/sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/core/ResponseDiagnosticsProcessor.java similarity index 93% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/core/ResponseDiagnosticsProcessor.java rename to sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/core/ResponseDiagnosticsProcessor.java index b8407cc36c034..1eb96b4098090 100644 --- a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/core/ResponseDiagnosticsProcessor.java +++ b/sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/core/ResponseDiagnosticsProcessor.java @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.microsoft.azure.spring.data.cosmosdb.core; +package com.azure.spring.data.cosmos.core; import javax.annotation.Nullable; diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/core/convert/MappingCosmosConverter.java b/sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/core/convert/MappingCosmosConverter.java similarity index 94% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/core/convert/MappingCosmosConverter.java rename to sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/core/convert/MappingCosmosConverter.java index a09e3f8e4de5d..8fae263e43d53 100644 --- a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/core/convert/MappingCosmosConverter.java +++ b/sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/core/convert/MappingCosmosConverter.java @@ -1,14 +1,14 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.microsoft.azure.spring.data.cosmosdb.core.convert; +package com.azure.spring.data.cosmos.core.convert; import com.azure.data.cosmos.CosmosItemProperties; +import com.azure.spring.data.cosmos.core.mapping.CosmosPersistentProperty; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; -import com.microsoft.azure.spring.data.cosmosdb.Constants; -import com.microsoft.azure.spring.data.cosmosdb.core.mapping.CosmosPersistentEntity; -import com.microsoft.azure.spring.data.cosmosdb.core.mapping.CosmosPersistentProperty; -import com.microsoft.azure.spring.data.cosmosdb.exception.CosmosDBAccessException; +import com.azure.spring.data.cosmos.Constants; +import com.azure.spring.data.cosmos.core.mapping.CosmosPersistentEntity; +import com.azure.spring.data.cosmos.exception.CosmosDBAccessException; import org.json.JSONObject; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.context.ApplicationContext; @@ -27,7 +27,7 @@ import java.time.format.DateTimeFormatter; import java.util.Date; -import static com.microsoft.azure.spring.data.cosmosdb.Constants.ISO_8601_COMPATIBLE_DATE_PATTERN; +import static com.azure.spring.data.cosmos.Constants.ISO_8601_COMPATIBLE_DATE_PATTERN; /** * A converter class between common types and cosmosItemProperties diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/core/convert/ObjectMapperFactory.java b/sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/core/convert/ObjectMapperFactory.java similarity index 94% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/core/convert/ObjectMapperFactory.java rename to sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/core/convert/ObjectMapperFactory.java index 7cdef7ced6f30..0a17f100a468c 100644 --- a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/core/convert/ObjectMapperFactory.java +++ b/sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/core/convert/ObjectMapperFactory.java @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.microsoft.azure.spring.data.cosmosdb.core.convert; +package com.azure.spring.data.cosmos.core.convert; import com.fasterxml.jackson.databind.DeserializationFeature; import com.fasterxml.jackson.databind.ObjectMapper; diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/core/convert/package-info.java b/sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/core/convert/package-info.java similarity index 72% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/core/convert/package-info.java rename to sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/core/convert/package-info.java index dc67fc7294707..5218f5599bbd1 100644 --- a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/core/convert/package-info.java +++ b/sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/core/convert/package-info.java @@ -4,4 +4,4 @@ /** * This package contains the converter classes of cosmos db */ -package com.microsoft.azure.spring.data.cosmosdb.core.convert; +package com.azure.spring.data.cosmos.core.convert; diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/core/generator/AbstractQueryGenerator.java b/sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/core/generator/AbstractQueryGenerator.java similarity index 95% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/core/generator/AbstractQueryGenerator.java rename to sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/core/generator/AbstractQueryGenerator.java index c28b1f6ed1f8a..680ec4045ac52 100644 --- a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/core/generator/AbstractQueryGenerator.java +++ b/sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/core/generator/AbstractQueryGenerator.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.microsoft.azure.spring.data.cosmosdb.core.generator; +package com.azure.spring.data.cosmos.core.generator; import com.azure.data.cosmos.SqlParameterList; import com.azure.data.cosmos.SqlQuerySpec; -import com.microsoft.azure.spring.data.cosmosdb.core.query.Criteria; -import com.microsoft.azure.spring.data.cosmosdb.core.query.CriteriaType; -import com.microsoft.azure.spring.data.cosmosdb.core.query.DocumentQuery; -import com.microsoft.azure.spring.data.cosmosdb.exception.IllegalQueryException; +import com.azure.spring.data.cosmos.core.query.Criteria; +import com.azure.spring.data.cosmos.core.query.CriteriaType; +import com.azure.spring.data.cosmos.core.query.DocumentQuery; +import com.azure.spring.data.cosmos.exception.IllegalQueryException; import org.javatuples.Pair; import org.springframework.data.domain.Sort; import org.springframework.lang.NonNull; @@ -19,7 +19,7 @@ import java.util.List; import java.util.stream.Collectors; -import static com.microsoft.azure.spring.data.cosmosdb.core.convert.MappingCosmosConverter.toCosmosDbValue; +import static com.azure.spring.data.cosmos.core.convert.MappingCosmosConverter.toCosmosDbValue; /** * Base class for generating sql query diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/core/generator/CountQueryGenerator.java b/sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/core/generator/CountQueryGenerator.java similarity index 75% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/core/generator/CountQueryGenerator.java rename to sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/core/generator/CountQueryGenerator.java index bddecf136e4c8..c8f0d25d928fa 100644 --- a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/core/generator/CountQueryGenerator.java +++ b/sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/core/generator/CountQueryGenerator.java @@ -1,9 +1,9 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.microsoft.azure.spring.data.cosmosdb.core.generator; +package com.azure.spring.data.cosmos.core.generator; import com.azure.data.cosmos.SqlQuerySpec; -import com.microsoft.azure.spring.data.cosmosdb.core.query.DocumentQuery; +import com.azure.spring.data.cosmos.core.query.DocumentQuery; /** * Generate count query diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/core/generator/FindQuerySpecGenerator.java b/sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/core/generator/FindQuerySpecGenerator.java similarity index 78% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/core/generator/FindQuerySpecGenerator.java rename to sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/core/generator/FindQuerySpecGenerator.java index 3296e23e89b2f..ff5e128bead15 100644 --- a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/core/generator/FindQuerySpecGenerator.java +++ b/sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/core/generator/FindQuerySpecGenerator.java @@ -1,9 +1,9 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.microsoft.azure.spring.data.cosmosdb.core.generator; +package com.azure.spring.data.cosmos.core.generator; import com.azure.data.cosmos.SqlQuerySpec; -import com.microsoft.azure.spring.data.cosmosdb.core.query.DocumentQuery; +import com.azure.spring.data.cosmos.core.query.DocumentQuery; /** * Generate sql find query diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/core/generator/QuerySpecGenerator.java b/sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/core/generator/QuerySpecGenerator.java similarity index 76% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/core/generator/QuerySpecGenerator.java rename to sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/core/generator/QuerySpecGenerator.java index a1cf9e8e0e2f4..d460d2e266b37 100644 --- a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/core/generator/QuerySpecGenerator.java +++ b/sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/core/generator/QuerySpecGenerator.java @@ -1,9 +1,9 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.microsoft.azure.spring.data.cosmosdb.core.generator; +package com.azure.spring.data.cosmos.core.generator; import com.azure.data.cosmos.SqlQuerySpec; -import com.microsoft.azure.spring.data.cosmosdb.core.query.DocumentQuery; +import com.azure.spring.data.cosmos.core.query.DocumentQuery; /** * Interface of generating SqlQuerySpec diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/core/generator/package-info.java b/sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/core/generator/package-info.java similarity index 71% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/core/generator/package-info.java rename to sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/core/generator/package-info.java index b67e5a92e7e3f..4992691e70dba 100644 --- a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/core/generator/package-info.java +++ b/sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/core/generator/package-info.java @@ -4,4 +4,4 @@ /** * This package contains the generator classes of cosmos db */ -package com.microsoft.azure.spring.data.cosmosdb.core.generator; +package com.azure.spring.data.cosmos.core.generator; diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/core/mapping/BasicCosmosPersistentEntity.java b/sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/core/mapping/BasicCosmosPersistentEntity.java similarity index 96% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/core/mapping/BasicCosmosPersistentEntity.java rename to sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/core/mapping/BasicCosmosPersistentEntity.java index 89ccc99ada710..b550e9a6239c2 100644 --- a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/core/mapping/BasicCosmosPersistentEntity.java +++ b/sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/core/mapping/BasicCosmosPersistentEntity.java @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.microsoft.azure.spring.data.cosmosdb.core.mapping; +package com.azure.spring.data.cosmos.core.mapping; import org.springframework.beans.BeansException; import org.springframework.context.ApplicationContext; diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/core/mapping/BasicCosmosPersistentProperty.java b/sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/core/mapping/BasicCosmosPersistentProperty.java similarity index 92% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/core/mapping/BasicCosmosPersistentProperty.java rename to sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/core/mapping/BasicCosmosPersistentProperty.java index 7b5fd02c173ef..092bf4e3b2d88 100644 --- a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/core/mapping/BasicCosmosPersistentProperty.java +++ b/sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/core/mapping/BasicCosmosPersistentProperty.java @@ -1,9 +1,9 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.microsoft.azure.spring.data.cosmosdb.core.mapping; +package com.azure.spring.data.cosmos.core.mapping; -import com.microsoft.azure.spring.data.cosmosdb.Constants; +import com.azure.spring.data.cosmos.Constants; import org.springframework.data.mapping.Association; import org.springframework.data.mapping.model.AnnotationBasedPersistentProperty; import org.springframework.data.mapping.model.Property; diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/core/mapping/CosmosMappingContext.java b/sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/core/mapping/CosmosMappingContext.java similarity index 96% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/core/mapping/CosmosMappingContext.java rename to sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/core/mapping/CosmosMappingContext.java index f2c1c7bf2bb49..050aa03cc3f04 100644 --- a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/core/mapping/CosmosMappingContext.java +++ b/sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/core/mapping/CosmosMappingContext.java @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.microsoft.azure.spring.data.cosmosdb.core.mapping; +package com.azure.spring.data.cosmos.core.mapping; import org.springframework.context.ApplicationContext; import org.springframework.data.mapping.context.AbstractMappingContext; diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/core/mapping/CosmosPersistentEntity.java b/sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/core/mapping/CosmosPersistentEntity.java similarity index 91% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/core/mapping/CosmosPersistentEntity.java rename to sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/core/mapping/CosmosPersistentEntity.java index 3418648de325b..189febbf8ce3f 100644 --- a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/core/mapping/CosmosPersistentEntity.java +++ b/sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/core/mapping/CosmosPersistentEntity.java @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.microsoft.azure.spring.data.cosmosdb.core.mapping; +package com.azure.spring.data.cosmos.core.mapping; import org.springframework.data.mapping.PersistentEntity; diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/core/mapping/CosmosPersistentProperty.java b/sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/core/mapping/CosmosPersistentProperty.java similarity index 83% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/core/mapping/CosmosPersistentProperty.java rename to sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/core/mapping/CosmosPersistentProperty.java index 31ce39f31037c..780b8cbd8137c 100644 --- a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/core/mapping/CosmosPersistentProperty.java +++ b/sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/core/mapping/CosmosPersistentProperty.java @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.microsoft.azure.spring.data.cosmosdb.core.mapping; +package com.azure.spring.data.cosmos.core.mapping; import org.springframework.data.mapping.PersistentProperty; diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/core/mapping/Document.java b/sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/core/mapping/Document.java similarity index 90% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/core/mapping/Document.java rename to sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/core/mapping/Document.java index 79cd9534e794a..3a1740610df5d 100644 --- a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/core/mapping/Document.java +++ b/sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/core/mapping/Document.java @@ -1,8 +1,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.microsoft.azure.spring.data.cosmosdb.core.mapping; +package com.azure.spring.data.cosmos.core.mapping; -import com.microsoft.azure.spring.data.cosmosdb.Constants; +import com.azure.spring.data.cosmos.Constants; import org.springframework.data.annotation.Persistent; import java.lang.annotation.Inherited; diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/core/mapping/DocumentIndexingPolicy.java b/sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/core/mapping/DocumentIndexingPolicy.java similarity index 90% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/core/mapping/DocumentIndexingPolicy.java rename to sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/core/mapping/DocumentIndexingPolicy.java index e578cdb409330..1e794e2d14e61 100644 --- a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/core/mapping/DocumentIndexingPolicy.java +++ b/sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/core/mapping/DocumentIndexingPolicy.java @@ -1,9 +1,9 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.microsoft.azure.spring.data.cosmosdb.core.mapping; +package com.azure.spring.data.cosmos.core.mapping; import com.azure.data.cosmos.IndexingMode; -import com.microsoft.azure.spring.data.cosmosdb.Constants; +import com.azure.spring.data.cosmos.Constants; import org.springframework.data.annotation.Persistent; import java.lang.annotation.Inherited; diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/core/mapping/PartitionKey.java b/sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/core/mapping/PartitionKey.java similarity index 91% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/core/mapping/PartitionKey.java rename to sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/core/mapping/PartitionKey.java index 6ae69dd61509a..680b06ec2471e 100644 --- a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/core/mapping/PartitionKey.java +++ b/sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/core/mapping/PartitionKey.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.microsoft.azure.spring.data.cosmosdb.core.mapping; +package com.azure.spring.data.cosmos.core.mapping; import java.lang.annotation.Inherited; import java.lang.annotation.Retention; diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/core/mapping/package-info.java b/sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/core/mapping/package-info.java similarity index 74% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/core/mapping/package-info.java rename to sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/core/mapping/package-info.java index e7a0f48b4da86..673ed782e3838 100644 --- a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/core/mapping/package-info.java +++ b/sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/core/mapping/package-info.java @@ -4,4 +4,4 @@ /** * This package contains the mapping classes of cosmos persistent entities */ -package com.microsoft.azure.spring.data.cosmosdb.core.mapping; +package com.azure.spring.data.cosmos.core.mapping; diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/core/package-info.java b/sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/core/package-info.java similarity index 80% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/core/package-info.java rename to sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/core/package-info.java index 0a5a2dee562e1..e198fccd17911 100644 --- a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/core/package-info.java +++ b/sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/core/package-info.java @@ -5,4 +5,4 @@ * This package contains the core classes of cosmos db, includes converters, * query generators and mapping to cosmos entities */ -package com.microsoft.azure.spring.data.cosmosdb.core; +package com.azure.spring.data.cosmos.core; diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/core/query/CosmosPageImpl.java b/sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/core/query/CosmosPageImpl.java similarity index 97% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/core/query/CosmosPageImpl.java rename to sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/core/query/CosmosPageImpl.java index 771e53910e519..2a7ba3a1d1f0b 100644 --- a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/core/query/CosmosPageImpl.java +++ b/sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/core/query/CosmosPageImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.microsoft.azure.spring.data.cosmosdb.core.query; +package com.azure.spring.data.cosmos.core.query; import org.springframework.data.domain.PageImpl; import org.springframework.data.domain.Pageable; diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/core/query/CosmosPageRequest.java b/sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/core/query/CosmosPageRequest.java similarity index 98% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/core/query/CosmosPageRequest.java rename to sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/core/query/CosmosPageRequest.java index 68d98dea0c30f..5f42092af3c37 100644 --- a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/core/query/CosmosPageRequest.java +++ b/sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/core/query/CosmosPageRequest.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.microsoft.azure.spring.data.cosmosdb.core.query; +package com.azure.spring.data.cosmos.core.query; import com.azure.data.cosmos.FeedResponse; import org.springframework.data.domain.PageRequest; diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/core/query/Criteria.java b/sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/core/query/Criteria.java similarity index 97% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/core/query/Criteria.java rename to sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/core/query/Criteria.java index 5a0d7b8c5a315..0028d67f5379c 100644 --- a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/core/query/Criteria.java +++ b/sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/core/query/Criteria.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.microsoft.azure.spring.data.cosmosdb.core.query; +package com.azure.spring.data.cosmos.core.query; import org.springframework.lang.NonNull; diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/core/query/CriteriaType.java b/sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/core/query/CriteriaType.java similarity index 98% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/core/query/CriteriaType.java rename to sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/core/query/CriteriaType.java index caf6c927875ea..153a76b94909c 100644 --- a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/core/query/CriteriaType.java +++ b/sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/core/query/CriteriaType.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.microsoft.azure.spring.data.cosmosdb.core.query; +package com.azure.spring.data.cosmos.core.query; import org.springframework.lang.NonNull; import org.springframework.data.repository.query.parser.Part; diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/core/query/DocumentQuery.java b/sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/core/query/DocumentQuery.java similarity index 98% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/core/query/DocumentQuery.java rename to sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/core/query/DocumentQuery.java index 8adfb92d93b7f..9bced79adc02e 100644 --- a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/core/query/DocumentQuery.java +++ b/sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/core/query/DocumentQuery.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.microsoft.azure.spring.data.cosmosdb.core.query; +package com.azure.spring.data.cosmos.core.query; import org.springframework.data.domain.Pageable; import org.springframework.data.domain.Sort; diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/core/query/package-info.java b/sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/core/query/package-info.java similarity index 73% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/core/query/package-info.java rename to sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/core/query/package-info.java index bbd03f8b278fc..c1c80354c766a 100644 --- a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/core/query/package-info.java +++ b/sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/core/query/package-info.java @@ -4,4 +4,4 @@ /** * This package contains the query classes of cosmos db document */ -package com.microsoft.azure.spring.data.cosmosdb.core.query; +package com.azure.spring.data.cosmos.core.query; diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/exception/ConfigurationException.java b/sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/exception/ConfigurationException.java similarity index 93% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/exception/ConfigurationException.java rename to sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/exception/ConfigurationException.java index 3aea8e557a7ff..f6bd7e1bf6c7a 100644 --- a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/exception/ConfigurationException.java +++ b/sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/exception/ConfigurationException.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.microsoft.azure.spring.data.cosmosdb.exception; +package com.azure.spring.data.cosmos.exception; import org.springframework.dao.DataAccessException; diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/exception/CosmosDBAccessException.java b/sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/exception/CosmosDBAccessException.java similarity index 89% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/exception/CosmosDBAccessException.java rename to sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/exception/CosmosDBAccessException.java index f20791008ab84..0a0d29725f39b 100644 --- a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/exception/CosmosDBAccessException.java +++ b/sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/exception/CosmosDBAccessException.java @@ -1,15 +1,17 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.microsoft.azure.spring.data.cosmosdb.exception; +package com.azure.spring.data.cosmos.exception; import com.azure.data.cosmos.CosmosClientException; +import com.azure.spring.data.cosmos.repository.CosmosRepository; +import com.azure.spring.data.cosmos.repository.ReactiveCosmosRepository; import org.springframework.dao.DataAccessException; import org.springframework.lang.Nullable; /** * Public class extending DataAccessException, exposes innerException. - * Every API in {@link com.microsoft.azure.spring.data.cosmosdb.repository.CosmosRepository} - * and {@link com.microsoft.azure.spring.data.cosmosdb.repository.ReactiveCosmosRepository} + * Every API in {@link CosmosRepository} + * and {@link ReactiveCosmosRepository} * should throw {@link CosmosDBAccessException}. * innerException refers to the exception thrown by CosmosDB SDK. Callers of repository APIs can * rely on innerException for any retriable logic, or for more details on the failure of diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/exception/CosmosDBExceptionUtils.java b/sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/exception/CosmosDBExceptionUtils.java similarity index 97% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/exception/CosmosDBExceptionUtils.java rename to sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/exception/CosmosDBExceptionUtils.java index 4e11eca0c4e65..84c1dfae68ca4 100644 --- a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/exception/CosmosDBExceptionUtils.java +++ b/sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/exception/CosmosDBExceptionUtils.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.microsoft.azure.spring.data.cosmosdb.exception; +package com.azure.spring.data.cosmos.exception; import com.azure.data.cosmos.CosmosClientException; import com.azure.data.cosmos.internal.HttpConstants; diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/exception/DatabaseCreationException.java b/sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/exception/DatabaseCreationException.java similarity index 93% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/exception/DatabaseCreationException.java rename to sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/exception/DatabaseCreationException.java index d0230725cf977..0e3968dc47706 100644 --- a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/exception/DatabaseCreationException.java +++ b/sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/exception/DatabaseCreationException.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.microsoft.azure.spring.data.cosmosdb.exception; +package com.azure.spring.data.cosmos.exception; import org.springframework.dao.DataAccessException; import org.springframework.lang.Nullable; diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/exception/IllegalCollectionException.java b/sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/exception/IllegalCollectionException.java similarity index 93% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/exception/IllegalCollectionException.java rename to sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/exception/IllegalCollectionException.java index c447f2d5d2916..0344ff842f502 100644 --- a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/exception/IllegalCollectionException.java +++ b/sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/exception/IllegalCollectionException.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.microsoft.azure.spring.data.cosmosdb.exception; +package com.azure.spring.data.cosmos.exception; import org.springframework.dao.DataAccessException; import org.springframework.lang.Nullable; diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/exception/IllegalQueryException.java b/sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/exception/IllegalQueryException.java similarity index 93% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/exception/IllegalQueryException.java rename to sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/exception/IllegalQueryException.java index 75c33a0bb5e9d..59c95cb9c5af9 100644 --- a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/exception/IllegalQueryException.java +++ b/sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/exception/IllegalQueryException.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.microsoft.azure.spring.data.cosmosdb.exception; +package com.azure.spring.data.cosmos.exception; import org.springframework.dao.DataAccessException; import org.springframework.lang.Nullable; diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/exception/package-info.java b/sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/exception/package-info.java similarity index 73% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/exception/package-info.java rename to sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/exception/package-info.java index a420e54064b76..3094644570a78 100644 --- a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/exception/package-info.java +++ b/sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/exception/package-info.java @@ -4,4 +4,4 @@ /** * This package contains the exception classes of cosmos db */ -package com.microsoft.azure.spring.data.cosmosdb.exception; +package com.azure.spring.data.cosmos.exception; diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/package-info.java b/sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/package-info.java similarity index 72% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/package-info.java rename to sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/package-info.java index 12dc2276157d7..04018a5aed64f 100644 --- a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/package-info.java +++ b/sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/package-info.java @@ -4,4 +4,4 @@ /** * Cosmosdb class for spring */ -package com.microsoft.azure.spring.data.cosmosdb; +package com.azure.spring.data.cosmos; diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/repository/CosmosRepository.java b/sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/repository/CosmosRepository.java similarity index 96% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/repository/CosmosRepository.java rename to sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/repository/CosmosRepository.java index 85274905a3c16..2591d8502cda3 100644 --- a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/repository/CosmosRepository.java +++ b/sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/repository/CosmosRepository.java @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.microsoft.azure.spring.data.cosmosdb.repository; +package com.azure.spring.data.cosmos.repository; import com.azure.data.cosmos.PartitionKey; import org.springframework.data.repository.NoRepositoryBean; diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/repository/ReactiveCosmosRepository.java b/sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/repository/ReactiveCosmosRepository.java similarity index 96% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/repository/ReactiveCosmosRepository.java rename to sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/repository/ReactiveCosmosRepository.java index b963adc03fcde..4b35604e0f3a9 100644 --- a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/repository/ReactiveCosmosRepository.java +++ b/sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/repository/ReactiveCosmosRepository.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.microsoft.azure.spring.data.cosmosdb.repository; +package com.azure.spring.data.cosmos.repository; import com.azure.data.cosmos.PartitionKey; import org.springframework.data.repository.NoRepositoryBean; diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/repository/config/CosmosRepositoriesRegistrar.java b/sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/repository/config/CosmosRepositoriesRegistrar.java similarity index 92% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/repository/config/CosmosRepositoriesRegistrar.java rename to sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/repository/config/CosmosRepositoriesRegistrar.java index ba20dd2797858..9975dfbf92b2b 100644 --- a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/repository/config/CosmosRepositoriesRegistrar.java +++ b/sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/repository/config/CosmosRepositoriesRegistrar.java @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.microsoft.azure.spring.data.cosmosdb.repository.config; +package com.azure.spring.data.cosmos.repository.config; import org.springframework.data.repository.config.RepositoryBeanDefinitionRegistrarSupport; import org.springframework.data.repository.config.RepositoryConfigurationExtension; diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/repository/config/CosmosRepositoryConfigurationExtension.java b/sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/repository/config/CosmosRepositoryConfigurationExtension.java similarity index 88% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/repository/config/CosmosRepositoryConfigurationExtension.java rename to sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/repository/config/CosmosRepositoryConfigurationExtension.java index 2c479f88887b3..20466b9231776 100644 --- a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/repository/config/CosmosRepositoryConfigurationExtension.java +++ b/sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/repository/config/CosmosRepositoryConfigurationExtension.java @@ -1,12 +1,12 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.microsoft.azure.spring.data.cosmosdb.repository.config; +package com.azure.spring.data.cosmos.repository.config; -import com.microsoft.azure.spring.data.cosmosdb.Constants; -import com.microsoft.azure.spring.data.cosmosdb.core.mapping.CosmosMappingContext; -import com.microsoft.azure.spring.data.cosmosdb.repository.CosmosRepository; -import com.microsoft.azure.spring.data.cosmosdb.repository.support.CosmosRepositoryFactoryBean; +import com.azure.spring.data.cosmos.repository.support.CosmosRepositoryFactoryBean; +import com.azure.spring.data.cosmos.Constants; +import com.azure.spring.data.cosmos.core.mapping.CosmosMappingContext; +import com.azure.spring.data.cosmos.repository.CosmosRepository; import org.springframework.beans.factory.support.AbstractBeanDefinition; import org.springframework.beans.factory.support.BeanDefinitionBuilder; import org.springframework.beans.factory.support.BeanDefinitionRegistry; diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/repository/config/EnableCosmosRepositories.java b/sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/repository/config/EnableCosmosRepositories.java similarity index 91% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/repository/config/EnableCosmosRepositories.java rename to sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/repository/config/EnableCosmosRepositories.java index 14eca66377906..5ac564c4aac25 100644 --- a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/repository/config/EnableCosmosRepositories.java +++ b/sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/repository/config/EnableCosmosRepositories.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.microsoft.azure.spring.data.cosmosdb.repository.config; +package com.azure.spring.data.cosmos.repository.config; -import com.microsoft.azure.spring.data.cosmosdb.Constants; -import com.microsoft.azure.spring.data.cosmosdb.repository.support.CosmosRepositoryFactoryBean; +import com.azure.spring.data.cosmos.repository.support.CosmosRepositoryFactoryBean; +import com.azure.spring.data.cosmos.Constants; import org.springframework.context.annotation.ComponentScan.Filter; import org.springframework.context.annotation.Import; import org.springframework.data.repository.config.DefaultRepositoryBaseClass; diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/repository/config/EnableReactiveCosmosRepositories.java b/sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/repository/config/EnableReactiveCosmosRepositories.java similarity index 91% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/repository/config/EnableReactiveCosmosRepositories.java rename to sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/repository/config/EnableReactiveCosmosRepositories.java index 7eb05a3118321..c1c9d5aae91b0 100644 --- a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/repository/config/EnableReactiveCosmosRepositories.java +++ b/sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/repository/config/EnableReactiveCosmosRepositories.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.microsoft.azure.spring.data.cosmosdb.repository.config; +package com.azure.spring.data.cosmos.repository.config; -import com.microsoft.azure.spring.data.cosmosdb.Constants; -import com.microsoft.azure.spring.data.cosmosdb.repository.support.ReactiveCosmosRepositoryFactoryBean; +import com.azure.spring.data.cosmos.repository.support.ReactiveCosmosRepositoryFactoryBean; +import com.azure.spring.data.cosmos.Constants; import org.springframework.context.annotation.ComponentScan.Filter; import org.springframework.context.annotation.Import; import org.springframework.data.repository.config.DefaultRepositoryBaseClass; diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/repository/config/ReactiveCosmosRepositoriesRegistrar.java b/sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/repository/config/ReactiveCosmosRepositoriesRegistrar.java similarity index 92% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/repository/config/ReactiveCosmosRepositoriesRegistrar.java rename to sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/repository/config/ReactiveCosmosRepositoriesRegistrar.java index bbcb6b2b84f43..60b59a81726a0 100644 --- a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/repository/config/ReactiveCosmosRepositoriesRegistrar.java +++ b/sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/repository/config/ReactiveCosmosRepositoriesRegistrar.java @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.microsoft.azure.spring.data.cosmosdb.repository.config; +package com.azure.spring.data.cosmos.repository.config; import org.springframework.data.repository.config.RepositoryBeanDefinitionRegistrarSupport; import org.springframework.data.repository.config.RepositoryConfigurationExtension; diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/repository/config/ReactiveCosmosRepositoryConfigurationExtension.java b/sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/repository/config/ReactiveCosmosRepositoryConfigurationExtension.java similarity index 87% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/repository/config/ReactiveCosmosRepositoryConfigurationExtension.java rename to sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/repository/config/ReactiveCosmosRepositoryConfigurationExtension.java index e9a5b87faa595..c195bc1339f94 100644 --- a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/repository/config/ReactiveCosmosRepositoryConfigurationExtension.java +++ b/sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/repository/config/ReactiveCosmosRepositoryConfigurationExtension.java @@ -1,12 +1,12 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.microsoft.azure.spring.data.cosmosdb.repository.config; +package com.azure.spring.data.cosmos.repository.config; -import com.microsoft.azure.spring.data.cosmosdb.Constants; -import com.microsoft.azure.spring.data.cosmosdb.core.mapping.CosmosMappingContext; -import com.microsoft.azure.spring.data.cosmosdb.repository.ReactiveCosmosRepository; -import com.microsoft.azure.spring.data.cosmosdb.repository.support.ReactiveCosmosRepositoryFactoryBean; +import com.azure.spring.data.cosmos.repository.support.ReactiveCosmosRepositoryFactoryBean; +import com.azure.spring.data.cosmos.Constants; +import com.azure.spring.data.cosmos.core.mapping.CosmosMappingContext; +import com.azure.spring.data.cosmos.repository.ReactiveCosmosRepository; import org.springframework.beans.factory.support.AbstractBeanDefinition; import org.springframework.beans.factory.support.BeanDefinitionBuilder; import org.springframework.beans.factory.support.BeanDefinitionRegistry; diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/repository/config/package-info.java b/sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/repository/config/package-info.java similarity index 73% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/repository/config/package-info.java rename to sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/repository/config/package-info.java index 7891cc7d30ad6..1a285bce25570 100644 --- a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/repository/config/package-info.java +++ b/sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/repository/config/package-info.java @@ -4,4 +4,4 @@ /** * This package contains the config classes of setting up cosmosdb repositories */ -package com.microsoft.azure.spring.data.cosmosdb.repository.config; +package com.azure.spring.data.cosmos.repository.config; diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/repository/package-info.java b/sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/repository/package-info.java similarity index 76% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/repository/package-info.java rename to sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/repository/package-info.java index fa885616b3087..18d6925d30f9b 100644 --- a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/repository/package-info.java +++ b/sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/repository/package-info.java @@ -4,4 +4,4 @@ /** * This package contains the support, query and config classes of setting up cosmosdb repositories */ -package com.microsoft.azure.spring.data.cosmosdb.repository; +package com.azure.spring.data.cosmos.repository; diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/repository/query/AbstractCosmosQuery.java b/sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/repository/query/AbstractCosmosQuery.java similarity index 91% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/repository/query/AbstractCosmosQuery.java rename to sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/repository/query/AbstractCosmosQuery.java index 55e012d185e65..36090a3653f4c 100644 --- a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/repository/query/AbstractCosmosQuery.java +++ b/sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/repository/query/AbstractCosmosQuery.java @@ -1,9 +1,9 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.microsoft.azure.spring.data.cosmosdb.repository.query; +package com.azure.spring.data.cosmos.repository.query; -import com.microsoft.azure.spring.data.cosmosdb.core.CosmosOperations; -import com.microsoft.azure.spring.data.cosmosdb.core.query.DocumentQuery; +import com.azure.spring.data.cosmos.core.CosmosOperations; +import com.azure.spring.data.cosmos.core.query.DocumentQuery; import org.springframework.data.repository.query.RepositoryQuery; import org.springframework.data.repository.query.ResultProcessor; diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/repository/query/AbstractReactiveCosmosQuery.java b/sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/repository/query/AbstractReactiveCosmosQuery.java similarity index 92% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/repository/query/AbstractReactiveCosmosQuery.java rename to sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/repository/query/AbstractReactiveCosmosQuery.java index 8b0d92e6f18a0..5d98980e2357a 100644 --- a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/repository/query/AbstractReactiveCosmosQuery.java +++ b/sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/repository/query/AbstractReactiveCosmosQuery.java @@ -1,9 +1,9 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.microsoft.azure.spring.data.cosmosdb.repository.query; +package com.azure.spring.data.cosmos.repository.query; -import com.microsoft.azure.spring.data.cosmosdb.core.ReactiveCosmosOperations; -import com.microsoft.azure.spring.data.cosmosdb.core.query.DocumentQuery; +import com.azure.spring.data.cosmos.core.ReactiveCosmosOperations; +import com.azure.spring.data.cosmos.core.query.DocumentQuery; import org.springframework.data.repository.query.RepositoryQuery; import org.springframework.data.repository.query.ResultProcessor; diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/repository/query/CosmosEntityMetadata.java b/sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/repository/query/CosmosEntityMetadata.java similarity index 90% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/repository/query/CosmosEntityMetadata.java rename to sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/repository/query/CosmosEntityMetadata.java index af36f066e50f1..db59937c57386 100644 --- a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/repository/query/CosmosEntityMetadata.java +++ b/sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/repository/query/CosmosEntityMetadata.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.microsoft.azure.spring.data.cosmosdb.repository.query; +package com.azure.spring.data.cosmos.repository.query; import org.springframework.data.repository.core.EntityMetadata; diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/repository/query/CosmosParameter.java b/sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/repository/query/CosmosParameter.java similarity index 90% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/repository/query/CosmosParameter.java rename to sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/repository/query/CosmosParameter.java index d667df89a9933..90a3dddc29868 100644 --- a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/repository/query/CosmosParameter.java +++ b/sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/repository/query/CosmosParameter.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.microsoft.azure.spring.data.cosmosdb.repository.query; +package com.azure.spring.data.cosmos.repository.query; import org.springframework.core.MethodParameter; import org.springframework.data.repository.query.Parameter; diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/repository/query/CosmosParameterAccessor.java b/sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/repository/query/CosmosParameterAccessor.java similarity index 87% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/repository/query/CosmosParameterAccessor.java rename to sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/repository/query/CosmosParameterAccessor.java index 0cb40ad1db77c..9f112e1084e3f 100644 --- a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/repository/query/CosmosParameterAccessor.java +++ b/sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/repository/query/CosmosParameterAccessor.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.microsoft.azure.spring.data.cosmosdb.repository.query; +package com.azure.spring.data.cosmos.repository.query; import org.springframework.data.repository.query.ParameterAccessor; diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/repository/query/CosmosParameterParameterAccessor.java b/sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/repository/query/CosmosParameterParameterAccessor.java similarity index 93% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/repository/query/CosmosParameterParameterAccessor.java rename to sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/repository/query/CosmosParameterParameterAccessor.java index 2ce2d081ec3e6..57da9662636c7 100644 --- a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/repository/query/CosmosParameterParameterAccessor.java +++ b/sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/repository/query/CosmosParameterParameterAccessor.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.microsoft.azure.spring.data.cosmosdb.repository.query; +package com.azure.spring.data.cosmos.repository.query; import org.springframework.data.repository.query.ParametersParameterAccessor; diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/repository/query/CosmosParameters.java b/sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/repository/query/CosmosParameters.java similarity index 94% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/repository/query/CosmosParameters.java rename to sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/repository/query/CosmosParameters.java index 55386969f85d2..4ed1187a79699 100644 --- a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/repository/query/CosmosParameters.java +++ b/sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/repository/query/CosmosParameters.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.microsoft.azure.spring.data.cosmosdb.repository.query; +package com.azure.spring.data.cosmos.repository.query; import org.springframework.core.MethodParameter; import org.springframework.data.repository.query.Parameters; diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/repository/query/CosmosQueryCreator.java b/sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/repository/query/CosmosQueryCreator.java similarity index 87% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/repository/query/CosmosQueryCreator.java rename to sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/repository/query/CosmosQueryCreator.java index 828917f1b2d1f..ceafd6096c327 100644 --- a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/repository/query/CosmosQueryCreator.java +++ b/sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/repository/query/CosmosQueryCreator.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.microsoft.azure.spring.data.cosmosdb.repository.query; - -import com.microsoft.azure.spring.data.cosmosdb.Constants; -import com.microsoft.azure.spring.data.cosmosdb.core.mapping.CosmosPersistentProperty; -import com.microsoft.azure.spring.data.cosmosdb.core.query.Criteria; -import com.microsoft.azure.spring.data.cosmosdb.core.query.CriteriaType; -import com.microsoft.azure.spring.data.cosmosdb.core.query.DocumentQuery; -import com.microsoft.azure.spring.data.cosmosdb.repository.support.CosmosEntityInformation; +package com.azure.spring.data.cosmos.repository.query; + +import com.azure.spring.data.cosmos.repository.support.CosmosEntityInformation; +import com.azure.spring.data.cosmos.Constants; +import com.azure.spring.data.cosmos.core.mapping.CosmosPersistentProperty; +import com.azure.spring.data.cosmos.core.query.Criteria; +import com.azure.spring.data.cosmos.core.query.CriteriaType; +import com.azure.spring.data.cosmos.core.query.DocumentQuery; import org.springframework.data.domain.Sort; import org.springframework.data.mapping.context.MappingContext; import org.springframework.data.repository.query.parser.AbstractQueryCreator; diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/repository/query/CosmosQueryExecution.java b/sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/repository/query/CosmosQueryExecution.java similarity index 92% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/repository/query/CosmosQueryExecution.java rename to sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/repository/query/CosmosQueryExecution.java index 6d3ae6f3ed6fb..0306e8c2e4c3d 100644 --- a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/repository/query/CosmosQueryExecution.java +++ b/sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/repository/query/CosmosQueryExecution.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.microsoft.azure.spring.data.cosmosdb.repository.query; +package com.azure.spring.data.cosmos.repository.query; -import com.microsoft.azure.spring.data.cosmosdb.core.CosmosOperations; -import com.microsoft.azure.spring.data.cosmosdb.core.query.CosmosPageRequest; -import com.microsoft.azure.spring.data.cosmosdb.core.query.DocumentQuery; +import com.azure.spring.data.cosmos.core.CosmosOperations; +import com.azure.spring.data.cosmos.core.query.CosmosPageRequest; +import com.azure.spring.data.cosmos.core.query.DocumentQuery; import org.springframework.data.domain.Pageable; /** diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/repository/query/CosmosQueryMethod.java b/sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/repository/query/CosmosQueryMethod.java similarity index 90% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/repository/query/CosmosQueryMethod.java rename to sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/repository/query/CosmosQueryMethod.java index 033b38282c9e6..ebce667e0520a 100644 --- a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/repository/query/CosmosQueryMethod.java +++ b/sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/repository/query/CosmosQueryMethod.java @@ -1,8 +1,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.microsoft.azure.spring.data.cosmosdb.repository.query; +package com.azure.spring.data.cosmos.repository.query; -import com.microsoft.azure.spring.data.cosmosdb.repository.support.CosmosEntityInformation; +import com.azure.spring.data.cosmos.repository.support.CosmosEntityInformation; import org.springframework.data.projection.ProjectionFactory; import org.springframework.data.repository.core.EntityMetadata; import org.springframework.data.repository.core.RepositoryMetadata; diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/repository/query/PartTreeCosmosQuery.java b/sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/repository/query/PartTreeCosmosQuery.java similarity index 86% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/repository/query/PartTreeCosmosQuery.java rename to sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/repository/query/PartTreeCosmosQuery.java index 6618f5528ef37..ad4d06a2c7773 100644 --- a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/repository/query/PartTreeCosmosQuery.java +++ b/sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/repository/query/PartTreeCosmosQuery.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.microsoft.azure.spring.data.cosmosdb.repository.query; +package com.azure.spring.data.cosmos.repository.query; -import com.microsoft.azure.spring.data.cosmosdb.core.CosmosOperations; -import com.microsoft.azure.spring.data.cosmosdb.core.query.DocumentQuery; -import com.microsoft.azure.spring.data.cosmosdb.core.mapping.CosmosPersistentProperty; +import com.azure.spring.data.cosmos.core.CosmosOperations; +import com.azure.spring.data.cosmos.core.query.DocumentQuery; +import com.azure.spring.data.cosmos.core.mapping.CosmosPersistentProperty; import org.apache.commons.lang3.NotImplementedException; import org.springframework.data.mapping.context.MappingContext; import org.springframework.data.repository.query.ResultProcessor; diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/repository/query/PartTreeReactiveCosmosQuery.java b/sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/repository/query/PartTreeReactiveCosmosQuery.java similarity index 86% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/repository/query/PartTreeReactiveCosmosQuery.java rename to sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/repository/query/PartTreeReactiveCosmosQuery.java index 7ee24913e199e..0611a21b5cc79 100644 --- a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/repository/query/PartTreeReactiveCosmosQuery.java +++ b/sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/repository/query/PartTreeReactiveCosmosQuery.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.microsoft.azure.spring.data.cosmosdb.repository.query; +package com.azure.spring.data.cosmos.repository.query; -import com.microsoft.azure.spring.data.cosmosdb.core.ReactiveCosmosOperations; -import com.microsoft.azure.spring.data.cosmosdb.core.mapping.CosmosPersistentProperty; -import com.microsoft.azure.spring.data.cosmosdb.core.query.DocumentQuery; +import com.azure.spring.data.cosmos.core.ReactiveCosmosOperations; +import com.azure.spring.data.cosmos.core.mapping.CosmosPersistentProperty; +import com.azure.spring.data.cosmos.core.query.DocumentQuery; import org.apache.commons.lang3.NotImplementedException; import org.springframework.data.mapping.context.MappingContext; import org.springframework.data.repository.query.ResultProcessor; diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/repository/query/ReactiveCosmosEntityMetadata.java b/sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/repository/query/ReactiveCosmosEntityMetadata.java similarity index 90% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/repository/query/ReactiveCosmosEntityMetadata.java rename to sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/repository/query/ReactiveCosmosEntityMetadata.java index 62c6b844e12ab..d7adefad76fca 100644 --- a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/repository/query/ReactiveCosmosEntityMetadata.java +++ b/sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/repository/query/ReactiveCosmosEntityMetadata.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.microsoft.azure.spring.data.cosmosdb.repository.query; +package com.azure.spring.data.cosmos.repository.query; import org.springframework.data.repository.core.EntityMetadata; diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/repository/query/ReactiveCosmosParameterAccessor.java b/sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/repository/query/ReactiveCosmosParameterAccessor.java similarity index 87% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/repository/query/ReactiveCosmosParameterAccessor.java rename to sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/repository/query/ReactiveCosmosParameterAccessor.java index fc90b7d55de12..9222078ea1a2d 100644 --- a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/repository/query/ReactiveCosmosParameterAccessor.java +++ b/sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/repository/query/ReactiveCosmosParameterAccessor.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.microsoft.azure.spring.data.cosmosdb.repository.query; +package com.azure.spring.data.cosmos.repository.query; import org.springframework.data.repository.query.ParameterAccessor; diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/repository/query/ReactiveCosmosParameterParameterAccessor.java b/sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/repository/query/ReactiveCosmosParameterParameterAccessor.java similarity index 94% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/repository/query/ReactiveCosmosParameterParameterAccessor.java rename to sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/repository/query/ReactiveCosmosParameterParameterAccessor.java index 9d31c6381d326..979314e13c46b 100644 --- a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/repository/query/ReactiveCosmosParameterParameterAccessor.java +++ b/sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/repository/query/ReactiveCosmosParameterParameterAccessor.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.microsoft.azure.spring.data.cosmosdb.repository.query; +package com.azure.spring.data.cosmos.repository.query; import org.springframework.data.repository.query.ParametersParameterAccessor; diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/repository/query/ReactiveCosmosQueryCreator.java b/sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/repository/query/ReactiveCosmosQueryCreator.java similarity index 87% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/repository/query/ReactiveCosmosQueryCreator.java rename to sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/repository/query/ReactiveCosmosQueryCreator.java index be36e333bcf77..300651feefffa 100644 --- a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/repository/query/ReactiveCosmosQueryCreator.java +++ b/sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/repository/query/ReactiveCosmosQueryCreator.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.microsoft.azure.spring.data.cosmosdb.repository.query; - -import com.microsoft.azure.spring.data.cosmosdb.Constants; -import com.microsoft.azure.spring.data.cosmosdb.core.mapping.CosmosPersistentProperty; -import com.microsoft.azure.spring.data.cosmosdb.core.query.Criteria; -import com.microsoft.azure.spring.data.cosmosdb.core.query.CriteriaType; -import com.microsoft.azure.spring.data.cosmosdb.core.query.DocumentQuery; -import com.microsoft.azure.spring.data.cosmosdb.repository.support.CosmosEntityInformation; +package com.azure.spring.data.cosmos.repository.query; + +import com.azure.spring.data.cosmos.repository.support.CosmosEntityInformation; +import com.azure.spring.data.cosmos.Constants; +import com.azure.spring.data.cosmos.core.mapping.CosmosPersistentProperty; +import com.azure.spring.data.cosmos.core.query.Criteria; +import com.azure.spring.data.cosmos.core.query.CriteriaType; +import com.azure.spring.data.cosmos.core.query.DocumentQuery; import org.springframework.data.domain.Sort; import org.springframework.data.mapping.context.MappingContext; import org.springframework.data.repository.query.parser.AbstractQueryCreator; diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/repository/query/ReactiveCosmosQueryExecution.java b/sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/repository/query/ReactiveCosmosQueryExecution.java similarity index 92% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/repository/query/ReactiveCosmosQueryExecution.java rename to sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/repository/query/ReactiveCosmosQueryExecution.java index bf615fae2dbe1..ec1546046c3fe 100644 --- a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/repository/query/ReactiveCosmosQueryExecution.java +++ b/sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/repository/query/ReactiveCosmosQueryExecution.java @@ -1,9 +1,9 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.microsoft.azure.spring.data.cosmosdb.repository.query; +package com.azure.spring.data.cosmos.repository.query; -import com.microsoft.azure.spring.data.cosmosdb.core.ReactiveCosmosOperations; -import com.microsoft.azure.spring.data.cosmosdb.core.query.DocumentQuery; +import com.azure.spring.data.cosmos.core.ReactiveCosmosOperations; +import com.azure.spring.data.cosmos.core.query.DocumentQuery; /** * Interface to execute reactive cosmos query operations diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/repository/query/ReactiveCosmosQueryMethod.java b/sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/repository/query/ReactiveCosmosQueryMethod.java similarity index 90% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/repository/query/ReactiveCosmosQueryMethod.java rename to sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/repository/query/ReactiveCosmosQueryMethod.java index 288fa02d75644..9ef769b4c9ad6 100644 --- a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/repository/query/ReactiveCosmosQueryMethod.java +++ b/sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/repository/query/ReactiveCosmosQueryMethod.java @@ -1,8 +1,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.microsoft.azure.spring.data.cosmosdb.repository.query; +package com.azure.spring.data.cosmos.repository.query; -import com.microsoft.azure.spring.data.cosmosdb.repository.support.CosmosEntityInformation; +import com.azure.spring.data.cosmos.repository.support.CosmosEntityInformation; import org.springframework.data.projection.ProjectionFactory; import org.springframework.data.repository.core.EntityMetadata; import org.springframework.data.repository.core.RepositoryMetadata; diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/repository/query/SimpleCosmosEntityMetadata.java b/sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/repository/query/SimpleCosmosEntityMetadata.java similarity index 90% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/repository/query/SimpleCosmosEntityMetadata.java rename to sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/repository/query/SimpleCosmosEntityMetadata.java index c027a1bc7a50e..45658a1df22a8 100644 --- a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/repository/query/SimpleCosmosEntityMetadata.java +++ b/sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/repository/query/SimpleCosmosEntityMetadata.java @@ -1,8 +1,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.microsoft.azure.spring.data.cosmosdb.repository.query; +package com.azure.spring.data.cosmos.repository.query; -import com.microsoft.azure.spring.data.cosmosdb.repository.support.CosmosEntityInformation; +import com.azure.spring.data.cosmos.repository.support.CosmosEntityInformation; import org.springframework.util.Assert; /** diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/repository/query/SimpleReactiveCosmosEntityMetadata.java b/sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/repository/query/SimpleReactiveCosmosEntityMetadata.java similarity index 90% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/repository/query/SimpleReactiveCosmosEntityMetadata.java rename to sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/repository/query/SimpleReactiveCosmosEntityMetadata.java index 36294fcdc6ec4..f1f34110daaf7 100644 --- a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/repository/query/SimpleReactiveCosmosEntityMetadata.java +++ b/sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/repository/query/SimpleReactiveCosmosEntityMetadata.java @@ -1,8 +1,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.microsoft.azure.spring.data.cosmosdb.repository.query; +package com.azure.spring.data.cosmos.repository.query; -import com.microsoft.azure.spring.data.cosmosdb.repository.support.CosmosEntityInformation; +import com.azure.spring.data.cosmos.repository.support.CosmosEntityInformation; import org.springframework.util.Assert; /** diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/repository/query/package-info.java b/sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/repository/query/package-info.java similarity index 70% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/repository/query/package-info.java rename to sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/repository/query/package-info.java index 18fb93d328721..7d75b179a8009 100644 --- a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/repository/query/package-info.java +++ b/sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/repository/query/package-info.java @@ -4,4 +4,4 @@ /** * This package contains the process cosmos queries */ -package com.microsoft.azure.spring.data.cosmosdb.repository.query; +package com.azure.spring.data.cosmos.repository.query; diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/repository/support/CosmosEntityInformation.java b/sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/repository/support/CosmosEntityInformation.java similarity index 96% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/repository/support/CosmosEntityInformation.java rename to sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/repository/support/CosmosEntityInformation.java index 14dd833c76bcf..940e9e91b7515 100644 --- a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/repository/support/CosmosEntityInformation.java +++ b/sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/repository/support/CosmosEntityInformation.java @@ -1,16 +1,16 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.microsoft.azure.spring.data.cosmosdb.repository.support; +package com.azure.spring.data.cosmos.repository.support; import com.azure.data.cosmos.ExcludedPath; import com.azure.data.cosmos.IncludedPath; import com.azure.data.cosmos.IndexingMode; import com.azure.data.cosmos.IndexingPolicy; -import com.microsoft.azure.spring.data.cosmosdb.Constants; -import com.microsoft.azure.spring.data.cosmosdb.core.mapping.Document; -import com.microsoft.azure.spring.data.cosmosdb.core.mapping.DocumentIndexingPolicy; -import com.microsoft.azure.spring.data.cosmosdb.core.mapping.PartitionKey; +import com.azure.spring.data.cosmos.Constants; +import com.azure.spring.data.cosmos.core.mapping.Document; +import com.azure.spring.data.cosmos.core.mapping.DocumentIndexingPolicy; +import com.azure.spring.data.cosmos.core.mapping.PartitionKey; import org.apache.commons.lang3.reflect.FieldUtils; import org.json.JSONObject; @@ -20,7 +20,7 @@ import org.springframework.lang.NonNull; import org.springframework.util.ReflectionUtils; -import static com.microsoft.azure.spring.data.cosmosdb.common.ExpressionResolver.resolveExpression; +import static com.azure.spring.data.cosmos.common.ExpressionResolver.resolveExpression; import java.lang.reflect.Field; import java.util.ArrayList; diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/repository/support/CosmosRepositoryFactory.java b/sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/repository/support/CosmosRepositoryFactory.java similarity index 91% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/repository/support/CosmosRepositoryFactory.java rename to sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/repository/support/CosmosRepositoryFactory.java index 2ca611f65cd54..924aa773ed490 100644 --- a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/repository/support/CosmosRepositoryFactory.java +++ b/sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/repository/support/CosmosRepositoryFactory.java @@ -1,11 +1,11 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.microsoft.azure.spring.data.cosmosdb.repository.support; +package com.azure.spring.data.cosmos.repository.support; -import com.microsoft.azure.spring.data.cosmosdb.core.CosmosOperations; -import com.microsoft.azure.spring.data.cosmosdb.repository.query.CosmosQueryMethod; -import com.microsoft.azure.spring.data.cosmosdb.repository.query.PartTreeCosmosQuery; +import com.azure.spring.data.cosmos.core.CosmosOperations; +import com.azure.spring.data.cosmos.repository.query.CosmosQueryMethod; +import com.azure.spring.data.cosmos.repository.query.PartTreeCosmosQuery; import org.springframework.context.ApplicationContext; import org.springframework.data.projection.ProjectionFactory; import org.springframework.data.repository.core.EntityInformation; diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/repository/support/CosmosRepositoryFactoryBean.java b/sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/repository/support/CosmosRepositoryFactoryBean.java similarity index 92% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/repository/support/CosmosRepositoryFactoryBean.java rename to sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/repository/support/CosmosRepositoryFactoryBean.java index 717c9c499b042..93c62e6294e25 100644 --- a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/repository/support/CosmosRepositoryFactoryBean.java +++ b/sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/repository/support/CosmosRepositoryFactoryBean.java @@ -1,9 +1,9 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.microsoft.azure.spring.data.cosmosdb.repository.support; +package com.azure.spring.data.cosmos.repository.support; -import com.microsoft.azure.spring.data.cosmosdb.core.CosmosOperations; -import com.microsoft.azure.spring.data.cosmosdb.core.mapping.CosmosMappingContext; +import com.azure.spring.data.cosmos.core.CosmosOperations; +import com.azure.spring.data.cosmos.core.mapping.CosmosMappingContext; import org.springframework.beans.BeansException; import org.springframework.beans.factory.FactoryBean; import org.springframework.beans.factory.annotation.Autowired; diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/repository/support/ReactiveCosmosRepositoryFactory.java b/sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/repository/support/ReactiveCosmosRepositoryFactory.java similarity index 91% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/repository/support/ReactiveCosmosRepositoryFactory.java rename to sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/repository/support/ReactiveCosmosRepositoryFactory.java index 7ba254bf0d808..6b13c5f98c009 100644 --- a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/repository/support/ReactiveCosmosRepositoryFactory.java +++ b/sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/repository/support/ReactiveCosmosRepositoryFactory.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.microsoft.azure.spring.data.cosmosdb.repository.support; +package com.azure.spring.data.cosmos.repository.support; -import com.microsoft.azure.spring.data.cosmosdb.core.ReactiveCosmosOperations; -import com.microsoft.azure.spring.data.cosmosdb.repository.query.PartTreeReactiveCosmosQuery; -import com.microsoft.azure.spring.data.cosmosdb.repository.query.ReactiveCosmosQueryMethod; +import com.azure.spring.data.cosmos.core.ReactiveCosmosOperations; +import com.azure.spring.data.cosmos.repository.query.PartTreeReactiveCosmosQuery; +import com.azure.spring.data.cosmos.repository.query.ReactiveCosmosQueryMethod; import org.springframework.context.ApplicationContext; import org.springframework.data.projection.ProjectionFactory; import org.springframework.data.repository.core.EntityInformation; diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/repository/support/ReactiveCosmosRepositoryFactoryBean.java b/sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/repository/support/ReactiveCosmosRepositoryFactoryBean.java similarity index 92% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/repository/support/ReactiveCosmosRepositoryFactoryBean.java rename to sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/repository/support/ReactiveCosmosRepositoryFactoryBean.java index 2e23b3f81acd8..20b191d066f24 100644 --- a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/repository/support/ReactiveCosmosRepositoryFactoryBean.java +++ b/sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/repository/support/ReactiveCosmosRepositoryFactoryBean.java @@ -1,9 +1,9 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.microsoft.azure.spring.data.cosmosdb.repository.support; +package com.azure.spring.data.cosmos.repository.support; -import com.microsoft.azure.spring.data.cosmosdb.core.ReactiveCosmosOperations; -import com.microsoft.azure.spring.data.cosmosdb.core.mapping.CosmosMappingContext; +import com.azure.spring.data.cosmos.core.ReactiveCosmosOperations; +import com.azure.spring.data.cosmos.core.mapping.CosmosMappingContext; import org.springframework.beans.BeansException; import org.springframework.beans.factory.FactoryBean; import org.springframework.beans.factory.annotation.Autowired; diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/repository/support/SimpleCosmosRepository.java b/sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/repository/support/SimpleCosmosRepository.java similarity index 95% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/repository/support/SimpleCosmosRepository.java rename to sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/repository/support/SimpleCosmosRepository.java index 92689a1e4f8e8..ecf21da9d1109 100644 --- a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/repository/support/SimpleCosmosRepository.java +++ b/sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/repository/support/SimpleCosmosRepository.java @@ -1,15 +1,15 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.microsoft.azure.spring.data.cosmosdb.repository.support; +package com.azure.spring.data.cosmos.repository.support; import com.azure.data.cosmos.CosmosContainerProperties; import com.azure.data.cosmos.PartitionKey; -import com.microsoft.azure.spring.data.cosmosdb.core.CosmosOperations; -import com.microsoft.azure.spring.data.cosmosdb.core.query.Criteria; -import com.microsoft.azure.spring.data.cosmosdb.core.query.CriteriaType; -import com.microsoft.azure.spring.data.cosmosdb.core.query.DocumentQuery; -import com.microsoft.azure.spring.data.cosmosdb.repository.CosmosRepository; +import com.azure.spring.data.cosmos.core.CosmosOperations; +import com.azure.spring.data.cosmos.core.query.Criteria; +import com.azure.spring.data.cosmos.core.query.CriteriaType; +import com.azure.spring.data.cosmos.core.query.DocumentQuery; +import com.azure.spring.data.cosmos.repository.CosmosRepository; import org.springframework.context.ApplicationContext; import org.springframework.data.domain.Page; import org.springframework.data.domain.Pageable; diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/repository/support/SimpleReactiveCosmosRepository.java b/sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/repository/support/SimpleReactiveCosmosRepository.java similarity index 94% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/repository/support/SimpleReactiveCosmosRepository.java rename to sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/repository/support/SimpleReactiveCosmosRepository.java index fa57ae3925cd1..27bfe96521072 100644 --- a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/repository/support/SimpleReactiveCosmosRepository.java +++ b/sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/repository/support/SimpleReactiveCosmosRepository.java @@ -1,14 +1,14 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.microsoft.azure.spring.data.cosmosdb.repository.support; +package com.azure.spring.data.cosmos.repository.support; import com.azure.data.cosmos.CosmosContainerResponse; import com.azure.data.cosmos.PartitionKey; -import com.microsoft.azure.spring.data.cosmosdb.core.ReactiveCosmosOperations; -import com.microsoft.azure.spring.data.cosmosdb.core.query.Criteria; -import com.microsoft.azure.spring.data.cosmosdb.core.query.CriteriaType; -import com.microsoft.azure.spring.data.cosmosdb.core.query.DocumentQuery; -import com.microsoft.azure.spring.data.cosmosdb.repository.ReactiveCosmosRepository; +import com.azure.spring.data.cosmos.core.ReactiveCosmosOperations; +import com.azure.spring.data.cosmos.core.query.Criteria; +import com.azure.spring.data.cosmos.core.query.CriteriaType; +import com.azure.spring.data.cosmos.core.query.DocumentQuery; +import com.azure.spring.data.cosmos.repository.ReactiveCosmosRepository; import org.reactivestreams.Publisher; import org.springframework.context.ApplicationContext; import org.springframework.data.domain.Sort; diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/repository/support/package-info.java b/sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/repository/support/package-info.java similarity index 74% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/repository/support/package-info.java rename to sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/repository/support/package-info.java index 55c98f6a55cb3..9e71adafb2cdf 100644 --- a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/java/com/microsoft/azure/spring/data/cosmosdb/repository/support/package-info.java +++ b/sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/repository/support/package-info.java @@ -4,4 +4,4 @@ /** * This package contains the support classes of setting up cosmosdb repositories and factories */ -package com.microsoft.azure.spring.data.cosmosdb.repository.support; +package com.azure.spring.data.cosmos.repository.support; diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/resources/META-INF/project.properties b/sdk/cosmos/azure-spring-data-cosmos/src/main/resources/META-INF/project.properties similarity index 100% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/main/resources/META-INF/project.properties rename to sdk/cosmos/azure-spring-data-cosmos/src/main/resources/META-INF/project.properties diff --git a/sdk/cosmos/azure-spring-data-cosmos/src/main/resources/META-INF/spring.factories b/sdk/cosmos/azure-spring-data-cosmos/src/main/resources/META-INF/spring.factories new file mode 100644 index 0000000000000..2b697a960e437 --- /dev/null +++ b/sdk/cosmos/azure-spring-data-cosmos/src/main/resources/META-INF/spring.factories @@ -0,0 +1 @@ +org.springframework.data.repository.core.support.RepositoryFactorySupport=com.azure.spring.data.cosmos.repository.support.CosmosRepositoryFactory \ No newline at end of file diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/resources/telemetry.config b/sdk/cosmos/azure-spring-data-cosmos/src/main/resources/telemetry.config similarity index 100% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/main/resources/telemetry.config rename to sdk/cosmos/azure-spring-data-cosmos/src/main/resources/telemetry.config diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/CosmosDbFactoryTestIT.java b/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/CosmosDbFactoryTestIT.java similarity index 67% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/CosmosDbFactoryTestIT.java rename to sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/CosmosDbFactoryTestIT.java index cd027302ec74a..b1f853dbe4031 100644 --- a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/CosmosDbFactoryTestIT.java +++ b/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/CosmosDbFactoryTestIT.java @@ -1,17 +1,17 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.microsoft.azure.spring.data.cosmosdb; +package com.azure.spring.data.cosmos; -import com.microsoft.azure.spring.data.cosmosdb.config.CosmosDBConfig; -import com.microsoft.azure.spring.data.cosmosdb.exception.CosmosDBAccessException; -import com.microsoft.azure.spring.data.cosmosdb.repository.TestRepositoryConfig; +import com.azure.spring.data.cosmos.common.TestConstants; +import com.azure.spring.data.cosmos.config.CosmosDBConfig; +import com.azure.spring.data.cosmos.exception.CosmosDBAccessException; +import com.azure.spring.data.cosmos.repository.TestRepositoryConfig; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Value; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; -import static com.microsoft.azure.spring.data.cosmosdb.common.TestConstants.*; import static org.assertj.core.api.Assertions.assertThat; @RunWith(SpringJUnit4ClassRunner.class) @@ -26,14 +26,15 @@ public class CosmosDbFactoryTestIT { @Test(expected = IllegalArgumentException.class) public void testEmptyKey() { - final CosmosDBConfig dbConfig = CosmosDBConfig.builder(COSMOSDB_FAKE_HOST, "", DB_NAME).build(); + final CosmosDBConfig dbConfig = CosmosDBConfig.builder(TestConstants.COSMOSDB_FAKE_HOST, + "", TestConstants.DB_NAME).build(); new CosmosDbFactory(dbConfig); } @Test public void testInvalidEndpoint() { final CosmosDBConfig dbConfig = - CosmosDBConfig.builder(COSMOSDB_FAKE_HOST, COSMOSDB_FAKE_KEY, DB_NAME).build(); + CosmosDBConfig.builder(TestConstants.COSMOSDB_FAKE_HOST, TestConstants.COSMOSDB_FAKE_KEY, TestConstants.DB_NAME).build(); final CosmosDbFactory factory = new CosmosDbFactory(dbConfig); assertThat(factory).isNotNull(); @@ -42,7 +43,7 @@ public void testInvalidEndpoint() { @Test public void testConnectWithConnectionString() { final CosmosDBConfig dbConfig = - CosmosDBConfig.builder(COSMOSDB_FAKE_CONNECTION_STRING, DB_NAME).build(); + CosmosDBConfig.builder(TestConstants.COSMOSDB_FAKE_CONNECTION_STRING, TestConstants.DB_NAME).build(); final CosmosDbFactory factory = new CosmosDbFactory(dbConfig); assertThat(factory).isNotNull(); @@ -50,13 +51,13 @@ public void testConnectWithConnectionString() { @Test(expected = CosmosDBAccessException.class) public void testInvalidConnectionString() { - CosmosDBConfig.builder(COSMOSDB_INVALID_FAKE_CONNECTION_STRING, DB_NAME).build(); + CosmosDBConfig.builder(TestConstants.COSMOSDB_INVALID_FAKE_CONNECTION_STRING, TestConstants.DB_NAME).build(); } @Test public void testConnectionPolicyUserAgentKept() { final CosmosDBConfig dbConfig = - CosmosDBConfig.builder(cosmosDbUri, cosmosDbKey, DB_NAME).build(); + CosmosDBConfig.builder(cosmosDbUri, cosmosDbKey, TestConstants.DB_NAME).build(); final CosmosDbFactory factory = new CosmosDbFactory(dbConfig); factory.getCosmosClient(); diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/UserAgentTestIT.java b/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/UserAgentTestIT.java similarity index 76% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/UserAgentTestIT.java rename to sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/UserAgentTestIT.java index 3714460b89965..ba64a333b3039 100644 --- a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/UserAgentTestIT.java +++ b/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/UserAgentTestIT.java @@ -1,10 +1,11 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.microsoft.azure.spring.data.cosmosdb; +package com.azure.spring.data.cosmos; -import com.microsoft.azure.spring.data.cosmosdb.common.PropertyLoader; -import com.microsoft.azure.spring.data.cosmosdb.common.TestConstants; -import com.microsoft.azure.spring.data.cosmosdb.config.CosmosDBConfig; +import com.azure.spring.data.cosmos.common.PropertyLoader; +import com.azure.spring.data.cosmos.common.TestConstants; +import com.azure.spring.data.cosmos.config.CosmosDBConfig; +import org.assertj.core.api.Assertions; import org.junit.Ignore; import org.junit.Test; import org.junit.runner.RunWith; @@ -14,8 +15,6 @@ import org.powermock.modules.junit4.PowerMockRunner; import org.springframework.context.annotation.PropertySource; -import static org.assertj.core.api.Assertions.assertThat; - @Ignore("Cannot use fake uri and key with CosmosDbFactory as it tries the connection on new creation." + "At the same time, cannot use mockito with real values, because it won't prepare PropertyLoader class for mocking") @RunWith(PowerMockRunner.class) @@ -33,7 +32,7 @@ public void testUserAgentSuffixAppended() { TestConstants.COSMOSDB_FAKE_KEY, TestConstants.DB_NAME).build(); final CosmosDbFactory factory = new CosmosDbFactory(dbConfig); factory.getCosmosClient(); - assertThat(factory.getConfig().getConnectionPolicy().userAgentSuffix()).contains(TEST_VERSION); + Assertions.assertThat(factory.getConfig().getConnectionPolicy().userAgentSuffix()).contains(TEST_VERSION); } } diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/common/DynamicContainer.java b/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/common/DynamicContainer.java similarity index 85% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/common/DynamicContainer.java rename to sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/common/DynamicContainer.java index 1f635b5f3a044..40eb9e50e07f6 100644 --- a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/common/DynamicContainer.java +++ b/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/common/DynamicContainer.java @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.microsoft.azure.spring.data.cosmosdb.common; +package com.azure.spring.data.cosmos.common; public class DynamicContainer { private String containerName; diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/common/ExpressionResolverUnitTest.java b/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/common/ExpressionResolverUnitTest.java similarity index 96% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/common/ExpressionResolverUnitTest.java rename to sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/common/ExpressionResolverUnitTest.java index ee4821faabf8f..6526575976625 100644 --- a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/common/ExpressionResolverUnitTest.java +++ b/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/common/ExpressionResolverUnitTest.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.microsoft.azure.spring.data.cosmosdb.common; +package com.azure.spring.data.cosmos.common; import org.junit.Test; import org.springframework.beans.factory.config.ConfigurableBeanFactory; diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/common/MemoizerUnitTest.java b/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/common/MemoizerUnitTest.java similarity index 96% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/common/MemoizerUnitTest.java rename to sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/common/MemoizerUnitTest.java index 05f3cbb9e588c..e29aeed50175e 100644 --- a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/common/MemoizerUnitTest.java +++ b/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/common/MemoizerUnitTest.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.microsoft.azure.spring.data.cosmosdb.common; +package com.azure.spring.data.cosmos.common; import org.junit.Before; import org.junit.Test; diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/common/PageTestUtils.java b/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/common/PageTestUtils.java similarity index 91% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/common/PageTestUtils.java rename to sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/common/PageTestUtils.java index 193369f5978e4..77136280e0954 100644 --- a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/common/PageTestUtils.java +++ b/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/common/PageTestUtils.java @@ -1,8 +1,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.microsoft.azure.spring.data.cosmosdb.common; +package com.azure.spring.data.cosmos.common; -import com.microsoft.azure.spring.data.cosmosdb.core.query.CosmosPageRequest; +import com.azure.spring.data.cosmos.core.query.CosmosPageRequest; import org.json.JSONObject; import org.springframework.data.domain.Page; import org.springframework.data.domain.Pageable; diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/common/PropertyLoaderUnitTest.java b/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/common/PropertyLoaderUnitTest.java similarity index 91% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/common/PropertyLoaderUnitTest.java rename to sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/common/PropertyLoaderUnitTest.java index e66f6d6ece4e7..0a9aa53f51634 100644 --- a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/common/PropertyLoaderUnitTest.java +++ b/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/common/PropertyLoaderUnitTest.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.microsoft.azure.spring.data.cosmosdb.common; +package com.azure.spring.data.cosmos.common; import org.junit.Assert; import org.junit.Test; diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/common/ResponseDiagnosticsTestUtils.java b/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/common/ResponseDiagnosticsTestUtils.java similarity index 85% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/common/ResponseDiagnosticsTestUtils.java rename to sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/common/ResponseDiagnosticsTestUtils.java index 58049b859fb83..af5f731364b2c 100644 --- a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/common/ResponseDiagnosticsTestUtils.java +++ b/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/common/ResponseDiagnosticsTestUtils.java @@ -1,12 +1,12 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.microsoft.azure.spring.data.cosmosdb.common; +package com.azure.spring.data.cosmos.common; import com.azure.data.cosmos.CosmosResponseDiagnostics; import com.azure.data.cosmos.FeedResponseDiagnostics; -import com.microsoft.azure.spring.data.cosmosdb.core.ResponseDiagnostics; -import com.microsoft.azure.spring.data.cosmosdb.core.ResponseDiagnosticsProcessor; +import com.azure.spring.data.cosmos.core.ResponseDiagnostics; +import com.azure.spring.data.cosmos.core.ResponseDiagnosticsProcessor; public class ResponseDiagnosticsTestUtils { diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/common/TestConstants.java b/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/common/TestConstants.java similarity index 98% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/common/TestConstants.java rename to sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/common/TestConstants.java index 5655cbba7a356..477e0a75fa644 100644 --- a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/common/TestConstants.java +++ b/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/common/TestConstants.java @@ -1,9 +1,9 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.microsoft.azure.spring.data.cosmosdb.common; +package com.azure.spring.data.cosmos.common; import com.azure.data.cosmos.IndexingMode; -import com.microsoft.azure.spring.data.cosmosdb.domain.Address; +import com.azure.spring.data.cosmos.domain.Address; import java.util.Arrays; import java.util.List; diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/common/TestUtils.java b/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/common/TestUtils.java similarity index 96% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/common/TestUtils.java rename to sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/common/TestUtils.java index eadb92eeecd15..5f3572b7ddc0f 100644 --- a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/common/TestUtils.java +++ b/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/common/TestUtils.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.microsoft.azure.spring.data.cosmosdb.common; +package com.azure.spring.data.cosmos.common; import org.springframework.util.Assert; diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/config/AbstractCosmosConfigurationIT.java b/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/config/AbstractCosmosConfigurationIT.java similarity index 94% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/config/AbstractCosmosConfigurationIT.java rename to sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/config/AbstractCosmosConfigurationIT.java index 231c587837f5a..734a73707973b 100644 --- a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/config/AbstractCosmosConfigurationIT.java +++ b/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/config/AbstractCosmosConfigurationIT.java @@ -1,16 +1,16 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.microsoft.azure.spring.data.cosmosdb.config; +package com.azure.spring.data.cosmos.config; import com.azure.data.cosmos.ConsistencyLevel; import com.azure.data.cosmos.CosmosClient; import com.azure.data.cosmos.internal.RequestOptions; +import com.azure.spring.data.cosmos.Constants; +import com.azure.spring.data.cosmos.CosmosDbFactory; +import com.azure.spring.data.cosmos.common.ExpressionResolver; import com.fasterxml.jackson.databind.ObjectMapper; -import com.microsoft.azure.spring.data.cosmosdb.Constants; -import com.microsoft.azure.spring.data.cosmosdb.CosmosDbFactory; -import com.microsoft.azure.spring.data.cosmosdb.common.ExpressionResolver; -import com.microsoft.azure.spring.data.cosmosdb.common.TestConstants; +import com.azure.spring.data.cosmos.common.TestConstants; import org.assertj.core.api.Assertions; import org.junit.Rule; import org.junit.Test; diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/core/CosmosTemplateIT.java b/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/core/CosmosTemplateIT.java similarity index 92% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/core/CosmosTemplateIT.java rename to sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/core/CosmosTemplateIT.java index 14da8e2515431..c445b25be9cef 100644 --- a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/core/CosmosTemplateIT.java +++ b/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/core/CosmosTemplateIT.java @@ -1,22 +1,23 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.microsoft.azure.spring.data.cosmosdb.core; +package com.azure.spring.data.cosmos.core; import com.azure.data.cosmos.CosmosClientException; import com.azure.data.cosmos.PartitionKey; -import com.microsoft.azure.spring.data.cosmosdb.CosmosDbFactory; -import com.microsoft.azure.spring.data.cosmosdb.common.ResponseDiagnosticsTestUtils; -import com.microsoft.azure.spring.data.cosmosdb.config.CosmosDBConfig; -import com.microsoft.azure.spring.data.cosmosdb.core.convert.MappingCosmosConverter; -import com.microsoft.azure.spring.data.cosmosdb.core.mapping.CosmosMappingContext; -import com.microsoft.azure.spring.data.cosmosdb.core.query.CosmosPageRequest; -import com.microsoft.azure.spring.data.cosmosdb.core.query.Criteria; -import com.microsoft.azure.spring.data.cosmosdb.core.query.CriteriaType; -import com.microsoft.azure.spring.data.cosmosdb.core.query.DocumentQuery; -import com.microsoft.azure.spring.data.cosmosdb.domain.Person; -import com.microsoft.azure.spring.data.cosmosdb.exception.CosmosDBAccessException; -import com.microsoft.azure.spring.data.cosmosdb.repository.TestRepositoryConfig; -import com.microsoft.azure.spring.data.cosmosdb.repository.support.CosmosEntityInformation; +import com.azure.spring.data.cosmos.CosmosDbFactory; +import com.azure.spring.data.cosmos.common.PageTestUtils; +import com.azure.spring.data.cosmos.common.ResponseDiagnosticsTestUtils; +import com.azure.spring.data.cosmos.config.CosmosDBConfig; +import com.azure.spring.data.cosmos.core.convert.MappingCosmosConverter; +import com.azure.spring.data.cosmos.core.mapping.CosmosMappingContext; +import com.azure.spring.data.cosmos.core.query.CosmosPageRequest; +import com.azure.spring.data.cosmos.core.query.Criteria; +import com.azure.spring.data.cosmos.core.query.CriteriaType; +import com.azure.spring.data.cosmos.core.query.DocumentQuery; +import com.azure.spring.data.cosmos.domain.Person; +import com.azure.spring.data.cosmos.exception.CosmosDBAccessException; +import com.azure.spring.data.cosmos.repository.TestRepositoryConfig; +import com.azure.spring.data.cosmos.repository.support.CosmosEntityInformation; import org.assertj.core.util.Lists; import org.junit.After; import org.junit.AfterClass; @@ -37,9 +38,7 @@ import java.util.List; import java.util.UUID; -import static com.microsoft.azure.spring.data.cosmosdb.common.PageTestUtils.validateLastPage; -import static com.microsoft.azure.spring.data.cosmosdb.common.PageTestUtils.validateNonLastPage; -import static com.microsoft.azure.spring.data.cosmosdb.common.TestConstants.*; +import static com.azure.spring.data.cosmos.common.TestConstants.*; import static org.assertj.core.api.Assertions.assertThat; import static org.junit.Assert.assertEquals; import static org.junit.Assert.fail; @@ -312,7 +311,7 @@ public void testFindAllPageableMultiPages() { final Page page1 = cosmosTemplate.findAll(pageRequest, Person.class, containerName); assertThat(page1.getContent().size()).isEqualTo(PAGE_SIZE_1); - validateNonLastPage(page1, PAGE_SIZE_1); + PageTestUtils.validateNonLastPage(page1, PAGE_SIZE_1); assertThat(responseDiagnosticsTestUtils.getCosmosResponseDiagnostics()).isNull(); assertThat(responseDiagnosticsTestUtils.getFeedResponseDiagnostics()).isNotNull(); @@ -322,7 +321,7 @@ public void testFindAllPageableMultiPages() { final Page page2 = cosmosTemplate.findAll(page1.getPageable(), Person.class, containerName); assertThat(page2.getContent().size()).isEqualTo(1); - validateLastPage(page2, PAGE_SIZE_1); + PageTestUtils.validateLastPage(page2, PAGE_SIZE_1); assertThat(responseDiagnosticsTestUtils.getCosmosResponseDiagnostics()).isNull(); assertThat(responseDiagnosticsTestUtils.getFeedResponseDiagnostics()).isNotNull(); @@ -346,7 +345,7 @@ public void testPaginationQuery() { final Page page = cosmosTemplate.paginationQuery(query, Person.class, containerName); assertThat(page.getContent().size()).isEqualTo(1); - validateLastPage(page, page.getContent().size()); + PageTestUtils.validateLastPage(page, page.getContent().size()); assertThat(responseDiagnosticsTestUtils.getCosmosResponseDiagnostics()).isNull(); assertThat(responseDiagnosticsTestUtils.getFeedResponseDiagnostics()).isNotNull(); @@ -370,7 +369,7 @@ public void testFindAllWithPageableAndSort() { final Page page = cosmosTemplate.findAll(pageRequest, Person.class, containerName); assertThat(page.getContent().size()).isEqualTo(3); - validateLastPage(page, PAGE_SIZE_3); + PageTestUtils.validateLastPage(page, PAGE_SIZE_3); final List result = page.getContent(); assertThat(result.get(0).getFirstName()).isEqualTo(NEW_FIRST_NAME); @@ -405,7 +404,7 @@ public void testFindAllWithTwoPagesAndVerifySortOrder() { containerName); assertThat(firstPage.getContent().size()).isEqualTo(3); - validateNonLastPage(firstPage, firstPage.getContent().size()); + PageTestUtils.validateNonLastPage(firstPage, firstPage.getContent().size()); final List firstPageResults = firstPage.getContent(); assertThat(firstPageResults.get(0).getFirstName()).isEqualTo(testPerson4.getFirstName()); @@ -416,7 +415,7 @@ public void testFindAllWithTwoPagesAndVerifySortOrder() { containerName); assertThat(secondPage.getContent().size()).isEqualTo(2); - validateLastPage(secondPage, secondPage.getContent().size()); + PageTestUtils.validateLastPage(secondPage, secondPage.getContent().size()); final List secondPageResults = secondPage.getContent(); assertThat(secondPageResults.get(0).getFirstName()).isEqualTo(NEW_FIRST_NAME); diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/core/CosmosTemplateIllegalTest.java b/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/core/CosmosTemplateIllegalTest.java similarity index 90% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/core/CosmosTemplateIllegalTest.java rename to sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/core/CosmosTemplateIllegalTest.java index 4b2ad4354ec25..b569f8d211592 100644 --- a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/core/CosmosTemplateIllegalTest.java +++ b/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/core/CosmosTemplateIllegalTest.java @@ -1,11 +1,12 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.microsoft.azure.spring.data.cosmosdb.core; +package com.azure.spring.data.cosmos.core; import com.azure.data.cosmos.PartitionKey; -import com.microsoft.azure.spring.data.cosmosdb.core.query.Criteria; -import com.microsoft.azure.spring.data.cosmosdb.core.query.DocumentQuery; -import com.microsoft.azure.spring.data.cosmosdb.domain.Person; +import com.azure.spring.data.cosmos.core.query.Criteria; +import com.azure.spring.data.cosmos.core.query.CriteriaType; +import com.azure.spring.data.cosmos.core.query.DocumentQuery; +import com.azure.spring.data.cosmos.domain.Person; import org.apache.commons.lang3.StringUtils; import org.junit.Before; import org.junit.Test; @@ -19,8 +20,6 @@ import java.lang.reflect.Method; import java.util.Arrays; -import static com.microsoft.azure.spring.data.cosmosdb.core.query.CriteriaType.IS_EQUAL; - @SuppressWarnings("unchecked") @RunWith(MockitoJUnitRunner.class) public class CosmosTemplateIllegalTest { @@ -44,7 +43,7 @@ public void setUp() { @Test public void deleteIllegalShouldFail() throws NoSuchMethodException { final Method method = dbTemplateClass.getMethod("delete", DocumentQuery.class, Class.class, String.class); - final Criteria criteria = Criteria.getInstance(IS_EQUAL, "faker", Arrays.asList("faker-value")); + final Criteria criteria = Criteria.getInstance(CriteriaType.IS_EQUAL, "faker", Arrays.asList("faker-value")); final DocumentQuery query = new DocumentQuery(criteria); checkIllegalArgument(method, null, Person.class, DUMMY_COLL); diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/core/CosmosTemplatePartitionIT.java b/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/core/CosmosTemplatePartitionIT.java similarity index 84% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/core/CosmosTemplatePartitionIT.java rename to sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/core/CosmosTemplatePartitionIT.java index 2094ff7058c0a..b72787b917ca8 100644 --- a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/core/CosmosTemplatePartitionIT.java +++ b/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/core/CosmosTemplatePartitionIT.java @@ -1,20 +1,21 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.microsoft.azure.spring.data.cosmosdb.core; +package com.azure.spring.data.cosmos.core; import com.azure.data.cosmos.PartitionKey; -import com.microsoft.azure.spring.data.cosmosdb.CosmosDbFactory; -import com.microsoft.azure.spring.data.cosmosdb.config.CosmosDBConfig; -import com.microsoft.azure.spring.data.cosmosdb.core.convert.MappingCosmosConverter; -import com.microsoft.azure.spring.data.cosmosdb.core.mapping.CosmosMappingContext; -import com.microsoft.azure.spring.data.cosmosdb.core.query.CosmosPageRequest; -import com.microsoft.azure.spring.data.cosmosdb.core.query.Criteria; -import com.microsoft.azure.spring.data.cosmosdb.core.query.CriteriaType; -import com.microsoft.azure.spring.data.cosmosdb.core.query.DocumentQuery; -import com.microsoft.azure.spring.data.cosmosdb.domain.PartitionPerson; -import com.microsoft.azure.spring.data.cosmosdb.repository.TestRepositoryConfig; -import com.microsoft.azure.spring.data.cosmosdb.repository.support.CosmosEntityInformation; +import com.azure.spring.data.cosmos.CosmosDbFactory; +import com.azure.spring.data.cosmos.common.PageTestUtils; +import com.azure.spring.data.cosmos.config.CosmosDBConfig; +import com.azure.spring.data.cosmos.core.convert.MappingCosmosConverter; +import com.azure.spring.data.cosmos.core.mapping.CosmosMappingContext; +import com.azure.spring.data.cosmos.core.query.CosmosPageRequest; +import com.azure.spring.data.cosmos.core.query.Criteria; +import com.azure.spring.data.cosmos.core.query.CriteriaType; +import com.azure.spring.data.cosmos.core.query.DocumentQuery; +import com.azure.spring.data.cosmos.domain.PartitionPerson; +import com.azure.spring.data.cosmos.repository.TestRepositoryConfig; +import com.azure.spring.data.cosmos.repository.support.CosmosEntityInformation; import org.junit.After; import org.junit.AfterClass; import org.junit.Before; @@ -33,10 +34,7 @@ import java.util.List; import java.util.UUID; -import static com.microsoft.azure.spring.data.cosmosdb.common.PageTestUtils.validateLastPage; -import static com.microsoft.azure.spring.data.cosmosdb.common.PageTestUtils.validateNonLastPage; -import static com.microsoft.azure.spring.data.cosmosdb.common.TestConstants.*; -import static com.microsoft.azure.spring.data.cosmosdb.core.query.CriteriaType.IS_EQUAL; +import static com.azure.spring.data.cosmos.common.TestConstants.*; import static org.assertj.core.api.Assertions.assertThat; import static org.junit.Assert.assertEquals; @@ -93,7 +91,7 @@ public static void afterClassCleanup() { @Test public void testFindWithPartition() { - Criteria criteria = Criteria.getInstance(IS_EQUAL, PROPERTY_LAST_NAME, Arrays.asList(LAST_NAME)); + Criteria criteria = Criteria.getInstance(CriteriaType.IS_EQUAL, PROPERTY_LAST_NAME, Arrays.asList(LAST_NAME)); DocumentQuery query = new DocumentQuery(criteria); List result = cosmosTemplate.find(query, PartitionPerson.class, PartitionPerson.class.getSimpleName()); @@ -101,7 +99,7 @@ public void testFindWithPartition() { assertThat(result.size()).isEqualTo(1); assertEquals(TEST_PERSON, result.get(0)); - criteria = Criteria.getInstance(IS_EQUAL, PROPERTY_ID, Arrays.asList(ID_1)); + criteria = Criteria.getInstance(CriteriaType.IS_EQUAL, PROPERTY_ID, Arrays.asList(ID_1)); query = new DocumentQuery(criteria); result = cosmosTemplate.find(query, PartitionPerson.class, PartitionPerson.class.getSimpleName()); @@ -121,7 +119,7 @@ public void testFindByIdWithPartition() { @Test public void testFindByNonExistIdWithPartition() { - final Criteria criteria = Criteria.getInstance(IS_EQUAL, PROPERTY_ID, Arrays.asList(NOT_EXIST_ID)); + final Criteria criteria = Criteria.getInstance(CriteriaType.IS_EQUAL, PROPERTY_ID, Arrays.asList(NOT_EXIST_ID)); final DocumentQuery query = new DocumentQuery(criteria); final List result = cosmosTemplate.find(query, PartitionPerson.class, @@ -218,12 +216,12 @@ public void testPartitionedFindAllPageableMultiPages() { final Page page1 = cosmosTemplate.findAll(pageRequest, PartitionPerson.class, containerName); assertThat(page1.getContent().size()).isEqualTo(PAGE_SIZE_1); - validateNonLastPage(page1, PAGE_SIZE_1); + PageTestUtils.validateNonLastPage(page1, PAGE_SIZE_1); final Page page2 = cosmosTemplate.findAll(page1.getPageable(), PartitionPerson.class, containerName); assertThat(page2.getContent().size()).isEqualTo(1); - validateLastPage(page2, PAGE_SIZE_1); + PageTestUtils.validateLastPage(page2, PAGE_SIZE_1); } @Test @@ -237,6 +235,6 @@ public void testPartitionedPaginationQuery() { final Page page = cosmosTemplate.paginationQuery(query, PartitionPerson.class, containerName); assertThat(page.getContent().size()).isEqualTo(1); - validateLastPage(page, page.getContent().size()); + PageTestUtils.validateLastPage(page, page.getContent().size()); } } diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/core/CosmosTemplateUnitTest.java b/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/core/CosmosTemplateUnitTest.java similarity index 70% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/core/CosmosTemplateUnitTest.java rename to sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/core/CosmosTemplateUnitTest.java index 09e796d184ec8..f183b45b3764e 100644 --- a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/core/CosmosTemplateUnitTest.java +++ b/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/core/CosmosTemplateUnitTest.java @@ -1,11 +1,11 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.microsoft.azure.spring.data.cosmosdb.core; +package com.azure.spring.data.cosmos.core; -import com.microsoft.azure.spring.data.cosmosdb.CosmosDbFactory; -import com.microsoft.azure.spring.data.cosmosdb.common.TestConstants; -import com.microsoft.azure.spring.data.cosmosdb.config.CosmosDBConfig; +import com.azure.spring.data.cosmos.CosmosDbFactory; +import com.azure.spring.data.cosmos.common.TestConstants; +import com.azure.spring.data.cosmos.config.CosmosDBConfig; import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.junit.MockitoJUnitRunner; diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/core/ReactiveCosmosTemplateIT.java b/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/core/ReactiveCosmosTemplateIT.java similarity index 80% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/core/ReactiveCosmosTemplateIT.java rename to sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/core/ReactiveCosmosTemplateIT.java index d2442de406c37..46c056d6ac947 100644 --- a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/core/ReactiveCosmosTemplateIT.java +++ b/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/core/ReactiveCosmosTemplateIT.java @@ -1,24 +1,25 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.microsoft.azure.spring.data.cosmosdb.core; +package com.azure.spring.data.cosmos.core; import com.azure.data.cosmos.CosmosClientException; import com.azure.data.cosmos.CosmosKeyCredential; import com.azure.data.cosmos.PartitionKey; -import com.microsoft.azure.spring.data.cosmosdb.CosmosDbFactory; -import com.microsoft.azure.spring.data.cosmosdb.common.ResponseDiagnosticsTestUtils; -import com.microsoft.azure.spring.data.cosmosdb.common.TestConstants; -import com.microsoft.azure.spring.data.cosmosdb.config.CosmosDBConfig; -import com.microsoft.azure.spring.data.cosmosdb.core.convert.MappingCosmosConverter; -import com.microsoft.azure.spring.data.cosmosdb.core.mapping.CosmosMappingContext; -import com.microsoft.azure.spring.data.cosmosdb.core.query.Criteria; -import com.microsoft.azure.spring.data.cosmosdb.core.query.CriteriaType; -import com.microsoft.azure.spring.data.cosmosdb.core.query.DocumentQuery; -import com.microsoft.azure.spring.data.cosmosdb.domain.Person; -import com.microsoft.azure.spring.data.cosmosdb.exception.CosmosDBAccessException; -import com.microsoft.azure.spring.data.cosmosdb.repository.TestRepositoryConfig; -import com.microsoft.azure.spring.data.cosmosdb.repository.support.CosmosEntityInformation; +import com.azure.spring.data.cosmos.CosmosDbFactory; +import com.azure.spring.data.cosmos.common.ResponseDiagnosticsTestUtils; +import com.azure.spring.data.cosmos.common.TestConstants; +import com.azure.spring.data.cosmos.config.CosmosDBConfig; +import com.azure.spring.data.cosmos.core.convert.MappingCosmosConverter; +import com.azure.spring.data.cosmos.core.mapping.CosmosMappingContext; +import com.azure.spring.data.cosmos.core.query.Criteria; +import com.azure.spring.data.cosmos.core.query.CriteriaType; +import com.azure.spring.data.cosmos.core.query.DocumentQuery; +import com.azure.spring.data.cosmos.domain.Person; +import com.azure.spring.data.cosmos.exception.CosmosDBAccessException; +import com.azure.spring.data.cosmos.repository.TestRepositoryConfig; +import com.azure.spring.data.cosmos.repository.support.CosmosEntityInformation; import io.reactivex.subscribers.TestSubscriber; +import org.assertj.core.api.Assertions; import org.junit.*; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; @@ -36,7 +37,6 @@ import java.util.Arrays; import java.util.List; -import static com.microsoft.azure.spring.data.cosmosdb.common.TestConstants.UPDATED_FIRST_NAME; import static org.assertj.core.api.Assertions.assertThat; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.is; @@ -143,8 +143,8 @@ public void testFindByID() { .consumeNextWith(actual -> Assert.assertEquals(actual, TEST_PERSON)) .verifyComplete(); assertThat(responseDiagnosticsTestUtils.getFeedResponseDiagnostics()).isNotNull(); - assertThat(responseDiagnosticsTestUtils.getCosmosResponseStatistics()).isNotNull(); - assertThat(responseDiagnosticsTestUtils.getCosmosResponseStatistics().getRequestCharge()).isGreaterThan(0); + Assertions.assertThat(responseDiagnosticsTestUtils.getCosmosResponseStatistics()).isNotNull(); + Assertions.assertThat(responseDiagnosticsTestUtils.getCosmosResponseStatistics().getRequestCharge()).isGreaterThan(0); } @Test @@ -159,8 +159,8 @@ public void testFindByIDBySecondaryKey() { }).verifyComplete(); assertThat(responseDiagnosticsTestUtils.getFeedResponseDiagnostics()).isNotNull(); - assertThat(responseDiagnosticsTestUtils.getCosmosResponseStatistics()).isNotNull(); - assertThat(responseDiagnosticsTestUtils.getCosmosResponseStatistics().getRequestCharge()).isGreaterThan(0); + Assertions.assertThat(responseDiagnosticsTestUtils.getCosmosResponseStatistics()).isNotNull(); + Assertions.assertThat(responseDiagnosticsTestUtils.getCosmosResponseStatistics().getRequestCharge()).isGreaterThan(0); } @Test @@ -170,8 +170,8 @@ public void testFindAll() { StepVerifier.create(flux).expectNextCount(1).verifyComplete(); assertThat(responseDiagnosticsTestUtils.getFeedResponseDiagnostics()).isNotNull(); - assertThat(responseDiagnosticsTestUtils.getCosmosResponseStatistics()).isNotNull(); - assertThat(responseDiagnosticsTestUtils.getCosmosResponseStatistics().getRequestCharge()).isGreaterThan(0); + Assertions.assertThat(responseDiagnosticsTestUtils.getCosmosResponseStatistics()).isNotNull(); + Assertions.assertThat(responseDiagnosticsTestUtils.getCosmosResponseStatistics().getRequestCharge()).isGreaterThan(0); } @Test @@ -182,8 +182,8 @@ public void testFindByIdWithContainerName() { .verifyComplete(); assertThat(responseDiagnosticsTestUtils.getFeedResponseDiagnostics()).isNotNull(); - assertThat(responseDiagnosticsTestUtils.getCosmosResponseStatistics()).isNotNull(); - assertThat(responseDiagnosticsTestUtils.getCosmosResponseStatistics().getRequestCharge()).isGreaterThan(0); + Assertions.assertThat(responseDiagnosticsTestUtils.getCosmosResponseStatistics()).isNotNull(); + Assertions.assertThat(responseDiagnosticsTestUtils.getCosmosResponseStatistics().getRequestCharge()).isGreaterThan(0); } @Test @@ -193,7 +193,7 @@ public void testInsert() { .expectNext(TEST_PERSON_3).verifyComplete(); assertThat(responseDiagnosticsTestUtils.getFeedResponseDiagnostics()).isNull(); - assertThat(responseDiagnosticsTestUtils.getCosmosResponseStatistics()).isNull(); + Assertions.assertThat(responseDiagnosticsTestUtils.getCosmosResponseStatistics()).isNull(); assertThat(responseDiagnosticsTestUtils.getCosmosResponseDiagnostics()).isNotNull(); } @@ -205,7 +205,7 @@ public void testInsertBySecondaryKey() { .expectNext(TEST_PERSON_3).verifyComplete(); assertThat(responseDiagnosticsTestUtils.getFeedResponseDiagnostics()).isNull(); - assertThat(responseDiagnosticsTestUtils.getCosmosResponseStatistics()).isNull(); + Assertions.assertThat(responseDiagnosticsTestUtils.getCosmosResponseStatistics()).isNull(); assertThat(responseDiagnosticsTestUtils.getCosmosResponseDiagnostics()).isNotNull(); } @@ -216,7 +216,7 @@ public void testInsertWithContainerName() { .expectNext(TEST_PERSON_2).verifyComplete(); assertThat(responseDiagnosticsTestUtils.getFeedResponseDiagnostics()).isNull(); - assertThat(responseDiagnosticsTestUtils.getCosmosResponseStatistics()).isNull(); + Assertions.assertThat(responseDiagnosticsTestUtils.getCosmosResponseStatistics()).isNull(); assertThat(responseDiagnosticsTestUtils.getCosmosResponseDiagnostics()).isNotNull(); } @@ -232,13 +232,13 @@ public void testUpsert() { StepVerifier.create(upsert).expectNextCount(1).verifyComplete(); assertThat(responseDiagnosticsTestUtils.getFeedResponseDiagnostics()).isNull(); - assertThat(responseDiagnosticsTestUtils.getCosmosResponseStatistics()).isNull(); + Assertions.assertThat(responseDiagnosticsTestUtils.getCosmosResponseStatistics()).isNull(); assertThat(responseDiagnosticsTestUtils.getCosmosResponseDiagnostics()).isNotNull(); } @Test public void testOptimisticLockWhenUpdatingWithWrongEtag() { - final Person updated = new Person(TEST_PERSON.getId(), UPDATED_FIRST_NAME, + final Person updated = new Person(TEST_PERSON.getId(), TestConstants.UPDATED_FIRST_NAME, TEST_PERSON.getLastName(), TEST_PERSON.getHobbies(), TEST_PERSON.getShippingAddresses()); updated.set_etag(WRONG_ETAG); @@ -271,7 +271,7 @@ public void testUpsertBySecondaryKey() { StepVerifier.create(upsert).expectNextCount(1).verifyComplete(); assertThat(responseDiagnosticsTestUtils.getFeedResponseDiagnostics()).isNull(); - assertThat(responseDiagnosticsTestUtils.getCosmosResponseStatistics()).isNull(); + Assertions.assertThat(responseDiagnosticsTestUtils.getCosmosResponseStatistics()).isNull(); assertThat(responseDiagnosticsTestUtils.getCosmosResponseDiagnostics()).isNotNull(); } @@ -286,7 +286,7 @@ public void testUpsertWithContainerName() { StepVerifier.create(upsert).expectNextCount(1).verifyComplete(); assertThat(responseDiagnosticsTestUtils.getFeedResponseDiagnostics()).isNull(); - assertThat(responseDiagnosticsTestUtils.getCosmosResponseStatistics()).isNull(); + Assertions.assertThat(responseDiagnosticsTestUtils.getCosmosResponseStatistics()).isNull(); assertThat(responseDiagnosticsTestUtils.getCosmosResponseDiagnostics()).isNotNull(); } @@ -296,15 +296,15 @@ public void testDeleteById() { new PartitionKey(personInfo.getPartitionKeyFieldValue(TEST_PERSON_4))).block(); assertThat(responseDiagnosticsTestUtils.getFeedResponseDiagnostics()).isNull(); - assertThat(responseDiagnosticsTestUtils.getCosmosResponseStatistics()).isNull(); + Assertions.assertThat(responseDiagnosticsTestUtils.getCosmosResponseStatistics()).isNull(); assertThat(responseDiagnosticsTestUtils.getCosmosResponseDiagnostics()).isNotNull(); Flux flux = cosmosTemplate.findAll(Person.class.getSimpleName(), Person.class); StepVerifier.create(flux).expectNextCount(2).verifyComplete(); assertThat(responseDiagnosticsTestUtils.getFeedResponseDiagnostics()).isNotNull(); - assertThat(responseDiagnosticsTestUtils.getCosmosResponseStatistics()).isNotNull(); - assertThat(responseDiagnosticsTestUtils.getCosmosResponseStatistics().getRequestCharge()).isGreaterThan(0); + Assertions.assertThat(responseDiagnosticsTestUtils.getCosmosResponseStatistics()).isNotNull(); + Assertions.assertThat(responseDiagnosticsTestUtils.getCosmosResponseStatistics().getRequestCharge()).isGreaterThan(0); assertThat(responseDiagnosticsTestUtils.getCosmosResponseDiagnostics()).isNull(); final Mono voidMono = cosmosTemplate.deleteById(Person.class.getSimpleName(), @@ -313,15 +313,15 @@ public void testDeleteById() { StepVerifier.create(voidMono).verifyComplete(); assertThat(responseDiagnosticsTestUtils.getFeedResponseDiagnostics()).isNull(); - assertThat(responseDiagnosticsTestUtils.getCosmosResponseStatistics()).isNull(); + Assertions.assertThat(responseDiagnosticsTestUtils.getCosmosResponseStatistics()).isNull(); assertThat(responseDiagnosticsTestUtils.getCosmosResponseDiagnostics()).isNotNull(); flux = cosmosTemplate.findAll(Person.class.getSimpleName(), Person.class); StepVerifier.create(flux).expectNextCount(1).verifyComplete(); assertThat(responseDiagnosticsTestUtils.getFeedResponseDiagnostics()).isNotNull(); - assertThat(responseDiagnosticsTestUtils.getCosmosResponseStatistics()).isNotNull(); - assertThat(responseDiagnosticsTestUtils.getCosmosResponseStatistics().getRequestCharge()).isGreaterThan(0); + Assertions.assertThat(responseDiagnosticsTestUtils.getCosmosResponseStatistics()).isNotNull(); + Assertions.assertThat(responseDiagnosticsTestUtils.getCosmosResponseStatistics().getRequestCharge()).isGreaterThan(0); assertThat(responseDiagnosticsTestUtils.getCosmosResponseDiagnostics()).isNull(); } @@ -350,8 +350,8 @@ public void testFind() { StepVerifier.create(personFlux).expectNextCount(1).verifyComplete(); assertThat(responseDiagnosticsTestUtils.getFeedResponseDiagnostics()).isNotNull(); - assertThat(responseDiagnosticsTestUtils.getCosmosResponseStatistics()).isNotNull(); - assertThat(responseDiagnosticsTestUtils.getCosmosResponseStatistics().getRequestCharge()).isGreaterThan(0); + Assertions.assertThat(responseDiagnosticsTestUtils.getCosmosResponseStatistics()).isNotNull(); + Assertions.assertThat(responseDiagnosticsTestUtils.getCosmosResponseStatistics().getRequestCharge()).isGreaterThan(0); assertThat(responseDiagnosticsTestUtils.getCosmosResponseDiagnostics()).isNull(); } @@ -364,8 +364,8 @@ public void testExists() { StepVerifier.create(exists).expectNext(true).verifyComplete(); assertThat(responseDiagnosticsTestUtils.getFeedResponseDiagnostics()).isNotNull(); - assertThat(responseDiagnosticsTestUtils.getCosmosResponseStatistics()).isNotNull(); - assertThat(responseDiagnosticsTestUtils.getCosmosResponseStatistics().getRequestCharge()).isGreaterThan(0); + Assertions.assertThat(responseDiagnosticsTestUtils.getCosmosResponseStatistics()).isNotNull(); + Assertions.assertThat(responseDiagnosticsTestUtils.getCosmosResponseStatistics().getRequestCharge()).isGreaterThan(0); assertThat(responseDiagnosticsTestUtils.getCosmosResponseDiagnostics()).isNull(); } @@ -375,8 +375,8 @@ public void testCount() { StepVerifier.create(count).expectNext((long) 1).verifyComplete(); assertThat(responseDiagnosticsTestUtils.getFeedResponseDiagnostics()).isNotNull(); - assertThat(responseDiagnosticsTestUtils.getCosmosResponseStatistics()).isNotNull(); - assertThat(responseDiagnosticsTestUtils.getCosmosResponseStatistics().getRequestCharge()).isGreaterThan(0); + Assertions.assertThat(responseDiagnosticsTestUtils.getCosmosResponseStatistics()).isNotNull(); + Assertions.assertThat(responseDiagnosticsTestUtils.getCosmosResponseStatistics().getRequestCharge()).isGreaterThan(0); assertThat(responseDiagnosticsTestUtils.getCosmosResponseDiagnostics()).isNull(); } diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/core/ReactiveCosmosTemplatePartitionIT.java b/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/core/ReactiveCosmosTemplatePartitionIT.java similarity index 82% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/core/ReactiveCosmosTemplatePartitionIT.java rename to sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/core/ReactiveCosmosTemplatePartitionIT.java index 124a85d651725..934b6bb546fd3 100644 --- a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/core/ReactiveCosmosTemplatePartitionIT.java +++ b/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/core/ReactiveCosmosTemplatePartitionIT.java @@ -1,17 +1,19 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.microsoft.azure.spring.data.cosmosdb.core; +package com.azure.spring.data.cosmos.core; import com.azure.data.cosmos.PartitionKey; -import com.microsoft.azure.spring.data.cosmosdb.CosmosDbFactory; -import com.microsoft.azure.spring.data.cosmosdb.config.CosmosDBConfig; -import com.microsoft.azure.spring.data.cosmosdb.core.convert.MappingCosmosConverter; -import com.microsoft.azure.spring.data.cosmosdb.core.mapping.CosmosMappingContext; -import com.microsoft.azure.spring.data.cosmosdb.core.query.Criteria; -import com.microsoft.azure.spring.data.cosmosdb.core.query.DocumentQuery; -import com.microsoft.azure.spring.data.cosmosdb.domain.PartitionPerson; -import com.microsoft.azure.spring.data.cosmosdb.repository.TestRepositoryConfig; -import com.microsoft.azure.spring.data.cosmosdb.repository.support.CosmosEntityInformation; +import com.azure.spring.data.cosmos.CosmosDbFactory; +import com.azure.spring.data.cosmos.common.TestConstants; +import com.azure.spring.data.cosmos.config.CosmosDBConfig; +import com.azure.spring.data.cosmos.core.convert.MappingCosmosConverter; +import com.azure.spring.data.cosmos.core.mapping.CosmosMappingContext; +import com.azure.spring.data.cosmos.core.query.Criteria; +import com.azure.spring.data.cosmos.core.query.CriteriaType; +import com.azure.spring.data.cosmos.core.query.DocumentQuery; +import com.azure.spring.data.cosmos.domain.PartitionPerson; +import com.azure.spring.data.cosmos.repository.TestRepositoryConfig; +import com.azure.spring.data.cosmos.repository.support.CosmosEntityInformation; import org.junit.*; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; @@ -27,8 +29,6 @@ import java.util.Arrays; import java.util.UUID; -import static com.microsoft.azure.spring.data.cosmosdb.common.TestConstants.*; -import static com.microsoft.azure.spring.data.cosmosdb.core.query.CriteriaType.IS_EQUAL; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.is; import static org.junit.Assert.assertTrue; @@ -36,11 +36,11 @@ @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration(classes = TestRepositoryConfig.class) public class ReactiveCosmosTemplatePartitionIT { - private static final PartitionPerson TEST_PERSON = new PartitionPerson(ID_1, FIRST_NAME, LAST_NAME, - HOBBIES, ADDRESSES); + private static final PartitionPerson TEST_PERSON = new PartitionPerson(TestConstants.ID_1, TestConstants.FIRST_NAME, TestConstants.LAST_NAME, + TestConstants.HOBBIES, TestConstants.ADDRESSES); - private static final PartitionPerson TEST_PERSON_2 = new PartitionPerson(ID_2, NEW_FIRST_NAME, - TEST_PERSON.getLastName(), HOBBIES, ADDRESSES); + private static final PartitionPerson TEST_PERSON_2 = new PartitionPerson(TestConstants.ID_2, TestConstants.NEW_FIRST_NAME, + TEST_PERSON.getLastName(), TestConstants.HOBBIES, TestConstants.ADDRESSES); private static ReactiveCosmosTemplate cosmosTemplate; private static String containerName; @@ -88,8 +88,8 @@ public static void afterClassCleanup() { @Test public void testFindWithPartition() { - final Criteria criteria = Criteria.getInstance(IS_EQUAL, PROPERTY_LAST_NAME, - Arrays.asList(LAST_NAME)); + final Criteria criteria = Criteria.getInstance(CriteriaType.IS_EQUAL, TestConstants.PROPERTY_LAST_NAME, + Arrays.asList(TestConstants.LAST_NAME)); final DocumentQuery query = new DocumentQuery(criteria); final Flux partitionPersonFlux = cosmosTemplate.find(query, PartitionPerson.class, @@ -119,9 +119,9 @@ public void testFindByIdWithPartition() { @Test public void testUpsertNewDocumentPartition() { - final String firstName = NEW_FIRST_NAME + "_" + UUID.randomUUID().toString(); + final String firstName = TestConstants.NEW_FIRST_NAME + "_" + UUID.randomUUID().toString(); final PartitionPerson newPerson = new PartitionPerson(UUID.randomUUID().toString(), - firstName, NEW_LAST_NAME, + firstName, TestConstants.NEW_LAST_NAME, null, null); final String partitionKeyValue = newPerson.getLastName(); final Mono upsert = cosmosTemplate.upsert(newPerson, @@ -131,7 +131,7 @@ public void testUpsertNewDocumentPartition() { @Test public void testUpdateWithPartition() { - final PartitionPerson updated = new PartitionPerson(TEST_PERSON.getId(), UPDATED_FIRST_NAME, + final PartitionPerson updated = new PartitionPerson(TEST_PERSON.getId(), TestConstants.UPDATED_FIRST_NAME, TEST_PERSON.getLastName(), TEST_PERSON.getHobbies(), TEST_PERSON.getShippingAddresses()); cosmosTemplate.upsert(updated, new PartitionKey(updated.getLastName())).block(); @@ -180,7 +180,7 @@ public void testCountForPartitionedCollection() { @Test public void testCountForPartitionedCollectionByQuery() { cosmosTemplate.insert(TEST_PERSON_2, new PartitionKey(TEST_PERSON_2.getLastName())).block(); - final Criteria criteria = Criteria.getInstance(IS_EQUAL, "firstName", + final Criteria criteria = Criteria.getInstance(CriteriaType.IS_EQUAL, "firstName", Arrays.asList(TEST_PERSON_2.getFirstName())); final DocumentQuery query = new DocumentQuery(criteria); StepVerifier.create(cosmosTemplate.count(query, containerName)) diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/core/convert/ZonedDateTimeDeserializerTest.java b/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/core/convert/ZonedDateTimeDeserializerTest.java similarity index 90% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/core/convert/ZonedDateTimeDeserializerTest.java rename to sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/core/convert/ZonedDateTimeDeserializerTest.java index dc7622c948a49..64e3478866bac 100644 --- a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/core/convert/ZonedDateTimeDeserializerTest.java +++ b/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/core/convert/ZonedDateTimeDeserializerTest.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.microsoft.azure.spring.data.cosmosdb.core.convert; +package com.azure.spring.data.cosmos.core.convert; import org.junit.Test; @@ -24,7 +24,7 @@ public class ZonedDateTimeDeserializerTest { @Test public void deserializeZonedDateTime() throws IOException { final ZonedDateTimeWrapper wrapper = ObjectMapperFactory.getObjectMapper() - .readValue(ZONED_DATE_TIME_WRAPPER_JSON, ZonedDateTimeWrapper.class); + .readValue(ZONED_DATE_TIME_WRAPPER_JSON, ZonedDateTimeWrapper.class); assertThat(wrapper.getZonedDateTime()).isEqualTo(ZONED_DATE_TIME); } diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/core/converter/MappingCosmosConverterUnitTest.java b/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/core/converter/MappingCosmosConverterUnitTest.java similarity index 90% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/core/converter/MappingCosmosConverterUnitTest.java rename to sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/core/converter/MappingCosmosConverterUnitTest.java index 5b52d9f14a48a..b690633be817e 100644 --- a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/core/converter/MappingCosmosConverterUnitTest.java +++ b/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/core/converter/MappingCosmosConverterUnitTest.java @@ -1,15 +1,15 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.microsoft.azure.spring.data.cosmosdb.core.converter; +package com.azure.spring.data.cosmos.core.converter; import com.azure.data.cosmos.CosmosItemProperties; +import com.azure.spring.data.cosmos.core.convert.MappingCosmosConverter; +import com.azure.spring.data.cosmos.core.mapping.CosmosMappingContext; import com.fasterxml.jackson.databind.ObjectMapper; -import com.microsoft.azure.spring.data.cosmosdb.common.TestConstants; -import com.microsoft.azure.spring.data.cosmosdb.core.convert.MappingCosmosConverter; -import com.microsoft.azure.spring.data.cosmosdb.core.mapping.CosmosMappingContext; -import com.microsoft.azure.spring.data.cosmosdb.domain.Address; -import com.microsoft.azure.spring.data.cosmosdb.domain.Importance; -import com.microsoft.azure.spring.data.cosmosdb.domain.Memo; +import com.azure.spring.data.cosmos.common.TestConstants; +import com.azure.spring.data.cosmos.domain.Address; +import com.azure.spring.data.cosmos.domain.Importance; +import com.azure.spring.data.cosmos.domain.Memo; import org.json.JSONObject; import org.junit.Before; import org.junit.Test; diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/core/mapping/BasicCosmosPersistentEntityUnitTest.java b/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/core/mapping/BasicCosmosPersistentEntityUnitTest.java similarity index 86% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/core/mapping/BasicCosmosPersistentEntityUnitTest.java rename to sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/core/mapping/BasicCosmosPersistentEntityUnitTest.java index 8c5282ff1a1ff..aadb113e5acd5 100644 --- a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/core/mapping/BasicCosmosPersistentEntityUnitTest.java +++ b/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/core/mapping/BasicCosmosPersistentEntityUnitTest.java @@ -1,9 +1,9 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.microsoft.azure.spring.data.cosmosdb.core.mapping; +package com.azure.spring.data.cosmos.core.mapping; -import com.microsoft.azure.spring.data.cosmosdb.domain.Person; +import com.azure.spring.data.cosmos.domain.Person; import org.junit.Test; import org.springframework.data.util.ClassTypeInformation; diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/core/mapping/CosmosMappingContextUnitTest.java b/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/core/mapping/CosmosMappingContextUnitTest.java similarity index 91% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/core/mapping/CosmosMappingContextUnitTest.java rename to sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/core/mapping/CosmosMappingContextUnitTest.java index db6fd8cbed879..2ed4fbbdc9062 100644 --- a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/core/mapping/CosmosMappingContextUnitTest.java +++ b/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/core/mapping/CosmosMappingContextUnitTest.java @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.microsoft.azure.spring.data.cosmosdb.core.mapping; +package com.azure.spring.data.cosmos.core.mapping; import org.junit.Test; import org.mockito.Mock; diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/core/query/CriteriaUnitTest.java b/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/core/query/CriteriaUnitTest.java similarity index 86% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/core/query/CriteriaUnitTest.java rename to sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/core/query/CriteriaUnitTest.java index 7a56dc01436b2..1128cefbf5a5e 100644 --- a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/core/query/CriteriaUnitTest.java +++ b/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/core/query/CriteriaUnitTest.java @@ -1,9 +1,9 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.microsoft.azure.spring.data.cosmosdb.core.query; +package com.azure.spring.data.cosmos.core.query; -import com.microsoft.azure.spring.data.cosmosdb.core.generator.FindQuerySpecGenerator; -import com.microsoft.azure.spring.data.cosmosdb.exception.IllegalQueryException; +import com.azure.spring.data.cosmos.core.generator.FindQuerySpecGenerator; +import com.azure.spring.data.cosmos.exception.IllegalQueryException; import org.junit.Assert; import org.junit.Test; @@ -11,8 +11,8 @@ import java.util.Collections; import java.util.List; -import static com.microsoft.azure.spring.data.cosmosdb.common.TestConstants.CRITERIA_KEY; -import static com.microsoft.azure.spring.data.cosmosdb.common.TestConstants.CRITERIA_OBJECT; +import static com.azure.spring.data.cosmos.common.TestConstants.CRITERIA_KEY; +import static com.azure.spring.data.cosmos.common.TestConstants.CRITERIA_OBJECT; public class CriteriaUnitTest { diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/core/query/DocumentQueryUnitTest.java b/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/core/query/DocumentQueryUnitTest.java similarity index 75% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/core/query/DocumentQueryUnitTest.java rename to sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/core/query/DocumentQueryUnitTest.java index 0f65f3635d0f2..06cdf4370ac63 100644 --- a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/core/query/DocumentQueryUnitTest.java +++ b/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/core/query/DocumentQueryUnitTest.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.microsoft.azure.spring.data.cosmosdb.core.query; +package com.azure.spring.data.cosmos.core.query; import org.junit.Assert; import org.junit.Test; @@ -9,8 +9,8 @@ import java.util.Arrays; -import static com.microsoft.azure.spring.data.cosmosdb.common.TestConstants.CRITERIA_KEY; -import static com.microsoft.azure.spring.data.cosmosdb.common.TestConstants.CRITERIA_OBJECT; +import static com.azure.spring.data.cosmos.common.TestConstants.CRITERIA_KEY; +import static com.azure.spring.data.cosmos.common.TestConstants.CRITERIA_OBJECT; public class DocumentQueryUnitTest { diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/domain/Address.java b/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/domain/Address.java similarity index 89% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/domain/Address.java rename to sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/domain/Address.java index 3539bc569a900..531fa409e6efd 100644 --- a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/domain/Address.java +++ b/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/domain/Address.java @@ -1,9 +1,9 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.microsoft.azure.spring.data.cosmosdb.domain; +package com.azure.spring.data.cosmos.domain; -import com.microsoft.azure.spring.data.cosmosdb.core.mapping.Document; -import com.microsoft.azure.spring.data.cosmosdb.core.mapping.PartitionKey; +import com.azure.spring.data.cosmos.core.mapping.Document; +import com.azure.spring.data.cosmos.core.mapping.PartitionKey; import org.springframework.data.annotation.Id; import java.util.Objects; diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/domain/Contact.java b/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/domain/Contact.java similarity index 91% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/domain/Contact.java rename to sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/domain/Contact.java index 6770f1c528da9..782bf07b20b9b 100644 --- a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/domain/Contact.java +++ b/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/domain/Contact.java @@ -1,8 +1,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.microsoft.azure.spring.data.cosmosdb.domain; +package com.azure.spring.data.cosmos.domain; -import com.microsoft.azure.spring.data.cosmosdb.core.mapping.Document; +import com.azure.spring.data.cosmos.core.mapping.Document; import org.springframework.data.annotation.Id; import java.util.Objects; diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/domain/Course.java b/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/domain/Course.java similarity index 89% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/domain/Course.java rename to sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/domain/Course.java index 872e92b2dd0f4..fa75b73a3934a 100644 --- a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/domain/Course.java +++ b/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/domain/Course.java @@ -1,9 +1,9 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.microsoft.azure.spring.data.cosmosdb.domain; +package com.azure.spring.data.cosmos.domain; -import com.microsoft.azure.spring.data.cosmosdb.core.mapping.Document; -import com.microsoft.azure.spring.data.cosmosdb.core.mapping.PartitionKey; +import com.azure.spring.data.cosmos.core.mapping.Document; +import com.azure.spring.data.cosmos.core.mapping.PartitionKey; import org.springframework.data.annotation.Id; import java.util.Objects; diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/domain/Customer.java b/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/domain/Customer.java similarity index 98% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/domain/Customer.java rename to sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/domain/Customer.java index d31168f085500..a1395e5be571b 100644 --- a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/domain/Customer.java +++ b/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/domain/Customer.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.microsoft.azure.spring.data.cosmosdb.domain; +package com.azure.spring.data.cosmos.domain; import org.springframework.data.annotation.Id; diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/domain/Importance.java b/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/domain/Importance.java similarity index 72% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/domain/Importance.java rename to sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/domain/Importance.java index 0362ff9c4a433..8d4731c396cfd 100644 --- a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/domain/Importance.java +++ b/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/domain/Importance.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.microsoft.azure.spring.data.cosmosdb.domain; +package com.azure.spring.data.cosmos.domain; public enum Importance { HIGH, LOW, NORMAL; diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/domain/IntegerIdDomain.java b/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/domain/IntegerIdDomain.java similarity index 91% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/domain/IntegerIdDomain.java rename to sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/domain/IntegerIdDomain.java index 0dc90ea96a1d2..e676cb962a9a1 100644 --- a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/domain/IntegerIdDomain.java +++ b/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/domain/IntegerIdDomain.java @@ -1,8 +1,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.microsoft.azure.spring.data.cosmosdb.domain; +package com.azure.spring.data.cosmos.domain; -import com.microsoft.azure.spring.data.cosmosdb.core.mapping.Document; +import com.azure.spring.data.cosmos.core.mapping.Document; import org.springframework.data.annotation.Id; import java.util.Objects; diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/domain/Memo.java b/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/domain/Memo.java similarity index 93% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/domain/Memo.java rename to sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/domain/Memo.java index 998b03810ef3b..4e93a6fb523bf 100644 --- a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/domain/Memo.java +++ b/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/domain/Memo.java @@ -1,8 +1,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.microsoft.azure.spring.data.cosmosdb.domain; +package com.azure.spring.data.cosmos.domain; -import com.microsoft.azure.spring.data.cosmosdb.core.mapping.Document; +import com.azure.spring.data.cosmos.core.mapping.Document; import java.util.Date; import java.util.Objects; diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/domain/NoDBAnnotationPerson.java b/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/domain/NoDBAnnotationPerson.java similarity index 97% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/domain/NoDBAnnotationPerson.java rename to sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/domain/NoDBAnnotationPerson.java index bc5eab89003ad..8bc73b7b3a96a 100644 --- a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/domain/NoDBAnnotationPerson.java +++ b/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/domain/NoDBAnnotationPerson.java @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.microsoft.azure.spring.data.cosmosdb.domain; +package com.azure.spring.data.cosmos.domain; import java.util.List; diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/domain/PageableAddress.java b/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/domain/PageableAddress.java similarity index 90% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/domain/PageableAddress.java rename to sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/domain/PageableAddress.java index 7b644336eead9..686661e3b6703 100644 --- a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/domain/PageableAddress.java +++ b/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/domain/PageableAddress.java @@ -1,9 +1,9 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.microsoft.azure.spring.data.cosmosdb.domain; +package com.azure.spring.data.cosmos.domain; -import com.microsoft.azure.spring.data.cosmosdb.core.mapping.Document; -import com.microsoft.azure.spring.data.cosmosdb.core.mapping.PartitionKey; +import com.azure.spring.data.cosmos.core.mapping.Document; +import com.azure.spring.data.cosmos.core.mapping.PartitionKey; import org.springframework.data.annotation.Id; import java.util.Objects; diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/domain/PageableMemo.java b/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/domain/PageableMemo.java similarity index 94% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/domain/PageableMemo.java rename to sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/domain/PageableMemo.java index d1425e5c357c1..b16a0dc8ee80c 100644 --- a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/domain/PageableMemo.java +++ b/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/domain/PageableMemo.java @@ -1,8 +1,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.microsoft.azure.spring.data.cosmosdb.domain; +package com.azure.spring.data.cosmos.domain; -import com.microsoft.azure.spring.data.cosmosdb.core.mapping.Document; +import com.azure.spring.data.cosmos.core.mapping.Document; import java.util.Date; import java.util.Objects; diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/domain/PageablePerson.java b/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/domain/PageablePerson.java similarity index 89% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/domain/PageablePerson.java rename to sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/domain/PageablePerson.java index 44ac9016bbf93..ad7d2197baf44 100644 --- a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/domain/PageablePerson.java +++ b/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/domain/PageablePerson.java @@ -1,12 +1,12 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.microsoft.azure.spring.data.cosmosdb.domain; +package com.azure.spring.data.cosmos.domain; -import com.microsoft.azure.spring.data.cosmosdb.common.TestConstants; -import com.microsoft.azure.spring.data.cosmosdb.core.mapping.Document; -import com.microsoft.azure.spring.data.cosmosdb.core.mapping.DocumentIndexingPolicy; -import com.microsoft.azure.spring.data.cosmosdb.core.mapping.PartitionKey; +import com.azure.spring.data.cosmos.core.mapping.Document; +import com.azure.spring.data.cosmos.core.mapping.DocumentIndexingPolicy; +import com.azure.spring.data.cosmos.core.mapping.PartitionKey; +import com.azure.spring.data.cosmos.common.TestConstants; import org.springframework.data.annotation.Version; import java.util.List; diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/domain/PartitionPerson.java b/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/domain/PartitionPerson.java similarity index 92% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/domain/PartitionPerson.java rename to sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/domain/PartitionPerson.java index 0285512b18345..1470343f063f6 100644 --- a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/domain/PartitionPerson.java +++ b/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/domain/PartitionPerson.java @@ -1,9 +1,9 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.microsoft.azure.spring.data.cosmosdb.domain; +package com.azure.spring.data.cosmos.domain; -import com.microsoft.azure.spring.data.cosmosdb.core.mapping.Document; -import com.microsoft.azure.spring.data.cosmosdb.core.mapping.PartitionKey; +import com.azure.spring.data.cosmos.core.mapping.Document; +import com.azure.spring.data.cosmos.core.mapping.PartitionKey; import java.util.List; import java.util.Objects; diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/domain/Person.java b/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/domain/Person.java similarity index 89% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/domain/Person.java rename to sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/domain/Person.java index 481617488a38b..3a4a64b55ed00 100644 --- a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/domain/Person.java +++ b/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/domain/Person.java @@ -1,12 +1,12 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.microsoft.azure.spring.data.cosmosdb.domain; +package com.azure.spring.data.cosmos.domain; -import com.microsoft.azure.spring.data.cosmosdb.common.TestConstants; -import com.microsoft.azure.spring.data.cosmosdb.core.mapping.Document; -import com.microsoft.azure.spring.data.cosmosdb.core.mapping.DocumentIndexingPolicy; -import com.microsoft.azure.spring.data.cosmosdb.core.mapping.PartitionKey; +import com.azure.spring.data.cosmos.core.mapping.Document; +import com.azure.spring.data.cosmos.core.mapping.DocumentIndexingPolicy; +import com.azure.spring.data.cosmos.core.mapping.PartitionKey; +import com.azure.spring.data.cosmos.common.TestConstants; import org.springframework.data.annotation.Version; import java.util.List; diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/domain/Project.java b/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/domain/Project.java similarity index 88% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/domain/Project.java rename to sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/domain/Project.java index 334cba0bad9da..77b75e914258c 100644 --- a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/domain/Project.java +++ b/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/domain/Project.java @@ -1,11 +1,11 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.microsoft.azure.spring.data.cosmosdb.domain; +package com.azure.spring.data.cosmos.domain; -import com.microsoft.azure.spring.data.cosmosdb.common.TestConstants; -import com.microsoft.azure.spring.data.cosmosdb.core.mapping.Document; -import com.microsoft.azure.spring.data.cosmosdb.core.mapping.DocumentIndexingPolicy; -import com.microsoft.azure.spring.data.cosmosdb.core.mapping.PartitionKey; +import com.azure.spring.data.cosmos.core.mapping.Document; +import com.azure.spring.data.cosmos.core.mapping.DocumentIndexingPolicy; +import com.azure.spring.data.cosmos.core.mapping.PartitionKey; +import com.azure.spring.data.cosmos.common.TestConstants; import org.springframework.data.annotation.Id; import java.util.Objects; diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/domain/Question.java b/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/domain/Question.java similarity index 83% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/domain/Question.java rename to sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/domain/Question.java index 541b32fab8f02..2c1c9f6a63841 100644 --- a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/domain/Question.java +++ b/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/domain/Question.java @@ -1,11 +1,11 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.microsoft.azure.spring.data.cosmosdb.domain; +package com.azure.spring.data.cosmos.domain; import com.azure.data.cosmos.IndexingMode; -import com.microsoft.azure.spring.data.cosmosdb.core.mapping.Document; -import com.microsoft.azure.spring.data.cosmosdb.core.mapping.DocumentIndexingPolicy; -import com.microsoft.azure.spring.data.cosmosdb.core.mapping.PartitionKey; +import com.azure.spring.data.cosmos.core.mapping.Document; +import com.azure.spring.data.cosmos.core.mapping.DocumentIndexingPolicy; +import com.azure.spring.data.cosmos.core.mapping.PartitionKey; import org.springframework.data.annotation.Id; import java.util.Objects; diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/domain/Role.java b/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/domain/Role.java similarity index 85% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/domain/Role.java rename to sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/domain/Role.java index 542885fe92549..1e04be72330f4 100644 --- a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/domain/Role.java +++ b/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/domain/Role.java @@ -1,12 +1,12 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.microsoft.azure.spring.data.cosmosdb.domain; +package com.azure.spring.data.cosmos.domain; import com.azure.data.cosmos.IndexingMode; -import com.microsoft.azure.spring.data.cosmosdb.common.TestConstants; -import com.microsoft.azure.spring.data.cosmosdb.core.mapping.Document; -import com.microsoft.azure.spring.data.cosmosdb.core.mapping.DocumentIndexingPolicy; -import com.microsoft.azure.spring.data.cosmosdb.core.mapping.PartitionKey; +import com.azure.spring.data.cosmos.core.mapping.Document; +import com.azure.spring.data.cosmos.core.mapping.DocumentIndexingPolicy; +import com.azure.spring.data.cosmos.core.mapping.PartitionKey; +import com.azure.spring.data.cosmos.common.TestConstants; import org.springframework.data.annotation.Id; import java.util.Objects; diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/domain/SortedProject.java b/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/domain/SortedProject.java similarity index 88% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/domain/SortedProject.java rename to sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/domain/SortedProject.java index f8def0da26bda..4bf8d7528f758 100644 --- a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/domain/SortedProject.java +++ b/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/domain/SortedProject.java @@ -1,11 +1,11 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.microsoft.azure.spring.data.cosmosdb.domain; +package com.azure.spring.data.cosmos.domain; -import com.microsoft.azure.spring.data.cosmosdb.common.TestConstants; -import com.microsoft.azure.spring.data.cosmosdb.core.mapping.Document; -import com.microsoft.azure.spring.data.cosmosdb.core.mapping.DocumentIndexingPolicy; -import com.microsoft.azure.spring.data.cosmosdb.core.mapping.PartitionKey; +import com.azure.spring.data.cosmos.core.mapping.Document; +import com.azure.spring.data.cosmos.core.mapping.DocumentIndexingPolicy; +import com.azure.spring.data.cosmos.core.mapping.PartitionKey; +import com.azure.spring.data.cosmos.common.TestConstants; import org.springframework.data.annotation.Id; import java.util.Objects; diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/domain/SpELBeanStudent.java b/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/domain/SpELBeanStudent.java similarity index 93% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/domain/SpELBeanStudent.java rename to sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/domain/SpELBeanStudent.java index eb698245156f6..d426b7c241e7f 100644 --- a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/domain/SpELBeanStudent.java +++ b/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/domain/SpELBeanStudent.java @@ -1,9 +1,9 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.microsoft.azure.spring.data.cosmosdb.domain; +package com.azure.spring.data.cosmos.domain; -import com.microsoft.azure.spring.data.cosmosdb.core.mapping.Document; +import com.azure.spring.data.cosmos.core.mapping.Document; import java.util.Objects; diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/domain/SpELPropertyStudent.java b/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/domain/SpELPropertyStudent.java similarity index 93% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/domain/SpELPropertyStudent.java rename to sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/domain/SpELPropertyStudent.java index 83daf0e542d2b..5d1a74296ad97 100644 --- a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/domain/SpELPropertyStudent.java +++ b/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/domain/SpELPropertyStudent.java @@ -1,9 +1,9 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.microsoft.azure.spring.data.cosmosdb.domain; +package com.azure.spring.data.cosmos.domain; -import com.microsoft.azure.spring.data.cosmosdb.core.mapping.Document; +import com.azure.spring.data.cosmos.core.mapping.Document; import java.util.Objects; diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/domain/Student.java b/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/domain/Student.java similarity index 89% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/domain/Student.java rename to sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/domain/Student.java index c531cf58ca45b..d3473617dcd75 100644 --- a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/domain/Student.java +++ b/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/domain/Student.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.microsoft.azure.spring.data.cosmosdb.domain; +package com.azure.spring.data.cosmos.domain; -import com.microsoft.azure.spring.data.cosmosdb.common.TestConstants; -import com.microsoft.azure.spring.data.cosmosdb.core.mapping.DocumentIndexingPolicy; +import com.azure.spring.data.cosmos.core.mapping.DocumentIndexingPolicy; +import com.azure.spring.data.cosmos.common.TestConstants; import java.util.Objects; diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/domain/TimeToLiveSample.java b/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/domain/TimeToLiveSample.java similarity index 68% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/domain/TimeToLiveSample.java rename to sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/domain/TimeToLiveSample.java index 9e1455317e6b6..5c1a97acf7aba 100644 --- a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/domain/TimeToLiveSample.java +++ b/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/domain/TimeToLiveSample.java @@ -1,9 +1,9 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.microsoft.azure.spring.data.cosmosdb.domain; +package com.azure.spring.data.cosmos.domain; -import com.microsoft.azure.spring.data.cosmosdb.common.TestConstants; -import com.microsoft.azure.spring.data.cosmosdb.core.mapping.Document; +import com.azure.spring.data.cosmos.core.mapping.Document; +import com.azure.spring.data.cosmos.common.TestConstants; @Document(timeToLive = TestConstants.TIME_TO_LIVE) public class TimeToLiveSample { diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/domain/inheritance/Shape.java b/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/domain/inheritance/Shape.java similarity index 92% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/domain/inheritance/Shape.java rename to sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/domain/inheritance/Shape.java index 5166e51fb51f6..3ea83f1ba91ab 100644 --- a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/domain/inheritance/Shape.java +++ b/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/domain/inheritance/Shape.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.microsoft.azure.spring.data.cosmosdb.domain.inheritance; +package com.azure.spring.data.cosmos.domain.inheritance; import java.util.Objects; diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/domain/inheritance/Square.java b/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/domain/inheritance/Square.java similarity index 95% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/domain/inheritance/Square.java rename to sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/domain/inheritance/Square.java index e82e168f8fc60..b96d38c4d837b 100644 --- a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/domain/inheritance/Square.java +++ b/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/domain/inheritance/Square.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.microsoft.azure.spring.data.cosmosdb.domain.inheritance; +package com.azure.spring.data.cosmos.domain.inheritance; import org.springframework.data.annotation.Id; diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/performance/PerfConfiguration.java b/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/performance/PerfConfiguration.java similarity index 67% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/performance/PerfConfiguration.java rename to sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/performance/PerfConfiguration.java index d893bbc89282c..d80a8c02da403 100644 --- a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/performance/PerfConfiguration.java +++ b/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/performance/PerfConfiguration.java @@ -1,11 +1,11 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.microsoft.azure.spring.data.cosmosdb.performance; +package com.azure.spring.data.cosmos.performance; -import com.microsoft.azure.spring.data.cosmosdb.config.AbstractCosmosConfiguration; -import com.microsoft.azure.spring.data.cosmosdb.config.CosmosDBConfig; -import com.microsoft.azure.spring.data.cosmosdb.performance.utils.Constants; -import com.microsoft.azure.spring.data.cosmosdb.repository.config.EnableCosmosRepositories; +import com.azure.spring.data.cosmos.config.AbstractCosmosConfiguration; +import com.azure.spring.data.cosmos.config.CosmosDBConfig; +import com.azure.spring.data.cosmos.performance.utils.Constants; +import com.azure.spring.data.cosmos.repository.config.EnableCosmosRepositories; import org.springframework.beans.factory.annotation.Value; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/performance/PerformanceCompare.java b/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/performance/PerformanceCompare.java similarity index 70% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/performance/PerformanceCompare.java rename to sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/performance/PerformanceCompare.java index 97d7698ecf54b..14256feed3451 100644 --- a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/performance/PerformanceCompare.java +++ b/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/performance/PerformanceCompare.java @@ -1,17 +1,18 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.microsoft.azure.spring.data.cosmosdb.performance; +package com.azure.spring.data.cosmos.performance; import com.azure.data.cosmos.CosmosClient; import com.azure.data.cosmos.CosmosClientException; import com.azure.data.cosmos.sync.CosmosSyncClient; -import com.microsoft.azure.spring.data.cosmosdb.core.query.CosmosPageRequest; -import com.microsoft.azure.spring.data.cosmosdb.performance.domain.PerfPerson; -import com.microsoft.azure.spring.data.cosmosdb.performance.repository.PerfPersonRepository; -import com.microsoft.azure.spring.data.cosmosdb.performance.service.SdkService; -import com.microsoft.azure.spring.data.cosmosdb.performance.utils.Constants; -import com.microsoft.azure.spring.data.cosmosdb.performance.utils.DatabaseUtils; -import com.microsoft.azure.spring.data.cosmosdb.performance.utils.PerfDataProvider; +import com.azure.spring.data.cosmos.core.query.CosmosPageRequest; +import com.azure.spring.data.cosmos.performance.domain.PerfPerson; +import com.azure.spring.data.cosmos.performance.repository.PerfPersonRepository; +import com.azure.spring.data.cosmos.performance.service.SdkService; +import com.azure.spring.data.cosmos.performance.utils.Constants; +import com.azure.spring.data.cosmos.performance.utils.DatabaseUtils; +import com.azure.spring.data.cosmos.performance.utils.FunctionUtils; +import com.azure.spring.data.cosmos.performance.utils.PerfDataProvider; import org.junit.After; import org.junit.AfterClass; import org.junit.Before; @@ -31,7 +32,6 @@ import java.util.List; import java.util.stream.Collectors; -import static com.microsoft.azure.spring.data.cosmosdb.performance.utils.FunctionUtils.*; import static org.assertj.core.api.Assertions.assertThat; @RunWith(SpringJUnit4ClassRunner.class) @@ -98,8 +98,8 @@ public static void printReport() { public void saveOneRecordTest() { final List personList = PerfDataProvider.getPerfData(recurTimes); - final long springCost = applyInputListFunc(personList, repository::save); - final long sdkCost = applyInputListFunc(personList, sdkService::save); + final long springCost = FunctionUtils.applyInputListFunc(personList, repository::save); + final long sdkCost = FunctionUtils.applyInputListFunc(personList, sdkService::save); verifyResult(OperationType.SAVE_ONE, springCost, sdkCost, acceptanceDiff); } @@ -108,8 +108,8 @@ public void saveOneRecordTest() { public void saveMultipleRecordsTest() { final List> personList = PerfDataProvider.getMultiPerfData(batchSize, recurTimes); - final long springCost = acceptInputListFunc(personList, repository::saveAll); - final long sdkCost = acceptInputListFunc(personList, sdkService::saveAll); + final long springCost = FunctionUtils.acceptInputListFunc(personList, repository::saveAll); + final long sdkCost = FunctionUtils.acceptInputListFunc(personList, sdkService::saveAll); verifyResult(OperationType.SAVE_ALL, springCost, sdkCost, acceptanceDiff); } @@ -118,8 +118,8 @@ public void saveMultipleRecordsTest() { public void deleteOneRecordTest() { final List personList = prepareListData(recurTimes); - final long springCost = acceptInputListFunc(personList, repository::delete); - final long sdkCost = acceptInputListFunc(personList, sdkService::delete); + final long springCost = FunctionUtils.acceptInputListFunc(personList, repository::delete); + final long sdkCost = FunctionUtils.acceptInputListFunc(personList, sdkService::delete); verifyResult(OperationType.DELETE_ONE, springCost, sdkCost, acceptanceDiff); } @@ -128,8 +128,8 @@ public void deleteOneRecordTest() { public void deleteAllRecordsTest() { final List> personList = prepareListBatchData(recurTimes, batchSize); - final long springCost = acceptInputListFunc(personList, repository::deleteAll); - final long sdkCost = acceptInputListFunc(personList, sdkService::deleteAll); + final long springCost = FunctionUtils.acceptInputListFunc(personList, repository::deleteAll); + final long sdkCost = FunctionUtils.acceptInputListFunc(personList, sdkService::deleteAll); verifyResult(OperationType.DELETE_ALL, springCost, sdkCost, acceptanceDiff); } @@ -139,8 +139,8 @@ public void findByIdTest() { final List idList = prepareListData(recurTimes).stream().map(PerfPerson::getId) .collect(Collectors.toList()); - final long springCost = applyInputListFunc(idList, repository::findById); - final long sdkCost = applyInputListFunc(idList, sdkService::findById); + final long springCost = FunctionUtils.applyInputListFunc(idList, repository::findById); + final long sdkCost = FunctionUtils.applyInputListFunc(idList, sdkService::findById); verifyResult(OperationType.FIND_BY_ID, springCost, sdkCost, acceptanceDiff); } @@ -149,8 +149,8 @@ public void findByIdTest() { public void findByMultipleIdsTest() { final List> idList = listBatchIds(recurTimes, batchSize); - final long springCost = acceptInputListFunc(idList, repository::findAllById); - final long sdkCost = acceptInputListFunc(idList, sdkService::findAllById); + final long springCost = FunctionUtils.acceptInputListFunc(idList, repository::findAllById); + final long sdkCost = FunctionUtils.acceptInputListFunc(idList, sdkService::findAllById); verifyResult(OperationType.FIND_BY_IDS, springCost, sdkCost, acceptanceDiff); } @@ -159,16 +159,16 @@ public void findByMultipleIdsTest() { public void findAllTest() { prepareListData(recurTimes); - final long springCost = getSupplier(recurTimes, repository::findAll); - final long sdkCost = getSupplier(recurTimes, sdkService::findAll); + final long springCost = FunctionUtils.getSupplier(recurTimes, repository::findAll); + final long sdkCost = FunctionUtils.getSupplier(recurTimes, sdkService::findAll); verifyResult(OperationType.FIND_ALL, springCost, sdkCost, acceptanceDiff); } @Test public void deleteAllTest() { - final long springCost = getSupplier(recurTimes, this::springDeleteAll); - final long sdkCost = getSupplier(recurTimes, sdkService::deleteAll); + final long springCost = FunctionUtils.getSupplier(recurTimes, this::springDeleteAll); + final long sdkCost = FunctionUtils.getSupplier(recurTimes, sdkService::deleteAll); verifyResult(OperationType.DELETE_ALL, springCost, sdkCost, acceptanceDiff); } @@ -180,8 +180,8 @@ public void findBySortingTest() { final Sort sort = Sort.by(Sort.Direction.ASC, "name"); final List sortList = buildSortList(sort, recurTimes); - final long springCost = applyInputListFunc(sortList, repository::findAll); - final long sdkCost = applyInputListFunc(sortList, sdkService::searchDocuments); + final long springCost = FunctionUtils.applyInputListFunc(sortList, repository::findAll); + final long sdkCost = FunctionUtils.applyInputListFunc(sortList, sdkService::searchDocuments); verifyResult(OperationType.FIND_BY_SORT, springCost, sdkCost, acceptanceDiff); } @@ -192,8 +192,8 @@ public void findByPagingTest() { int pageSize = recurTimes / 2; pageSize = pageSize >= 1 ? pageSize : 1; - final long springCost = runConsumerForTimes(recurTimes, pageSize, this::queryTwoPages); - final long sdkCost = runConsumerForTimes(recurTimes, pageSize, sdkService::queryTwoPages); + final long springCost = FunctionUtils.runConsumerForTimes(recurTimes, pageSize, this::queryTwoPages); + final long sdkCost = FunctionUtils.runConsumerForTimes(recurTimes, pageSize, sdkService::queryTwoPages); verifyResult(OperationType.FIND_BY_PAGING, springCost, sdkCost, acceptanceDiff); } @@ -204,8 +204,8 @@ public void findByFieldTest() { final String name = data.get(recurTimes / 2).getName(); - final long springCost = runFunctionForTimes(recurTimes, name, repository::findByName); - final long sdkCost = runConsumerForTimes(recurTimes, name, sdkService::findByName); + final long springCost = FunctionUtils.runFunctionForTimes(recurTimes, name, repository::findByName); + final long sdkCost = FunctionUtils.runConsumerForTimes(recurTimes, name, sdkService::findByName); verifyResult(OperationType.FIND_BY_FIELD, springCost, sdkCost, acceptanceDiff); } @@ -214,8 +214,8 @@ public void findByFieldTest() { public void countTest() { prepareListData(recurTimes); - final long springCost = getSupplier(recurTimes, repository::count); - final long sdkCost = getSupplier(recurTimes, sdkService::count); + final long springCost = FunctionUtils.getSupplier(recurTimes, repository::count); + final long sdkCost = FunctionUtils.getSupplier(recurTimes, sdkService::count); verifyResult(OperationType.COUNT, springCost, sdkCost, acceptanceDiff); } @@ -262,8 +262,8 @@ private void queryTwoPages(int pageSize) { private List prepareListData(int count) { final List personList = PerfDataProvider.getPerfData(count); - applyInputListFunc(personList, repository::save); - applyInputListFunc(personList, sdkService::save); + FunctionUtils.applyInputListFunc(personList, repository::save); + FunctionUtils.applyInputListFunc(personList, sdkService::save); return personList; } @@ -272,8 +272,8 @@ private List prepareListData(int count) { private List> prepareListBatchData(int times, int batchSize) { final List> personList = PerfDataProvider.getMultiPerfData(batchSize, times); - applyInputListFunc(personList, repository::saveAll); - applyInputListFunc(personList, sdkService::saveAll); + FunctionUtils.applyInputListFunc(personList, repository::saveAll); + FunctionUtils.applyInputListFunc(personList, sdkService::saveAll); return personList; } diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/performance/PerformanceReport.java b/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/performance/PerformanceReport.java similarity index 98% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/performance/PerformanceReport.java rename to sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/performance/PerformanceReport.java index f992d5b16117b..7a33933abe826 100644 --- a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/performance/PerformanceReport.java +++ b/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/performance/PerformanceReport.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.microsoft.azure.spring.data.cosmosdb.performance; +package com.azure.spring.data.cosmos.performance; import java.util.ArrayList; import java.util.List; diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/performance/domain/PerfPerson.java b/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/performance/domain/PerfPerson.java similarity index 78% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/performance/domain/PerfPerson.java rename to sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/performance/domain/PerfPerson.java index 4be9232067b55..eb6e15ba1a072 100644 --- a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/performance/domain/PerfPerson.java +++ b/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/performance/domain/PerfPerson.java @@ -1,12 +1,12 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.microsoft.azure.spring.data.cosmosdb.performance.domain; +package com.azure.spring.data.cosmos.performance.domain; -import com.microsoft.azure.spring.data.cosmosdb.common.TestConstants; -import com.microsoft.azure.spring.data.cosmosdb.core.mapping.Document; -import com.microsoft.azure.spring.data.cosmosdb.core.mapping.DocumentIndexingPolicy; -import com.microsoft.azure.spring.data.cosmosdb.performance.utils.Constants; +import com.azure.spring.data.cosmos.core.mapping.Document; +import com.azure.spring.data.cosmos.core.mapping.DocumentIndexingPolicy; +import com.azure.spring.data.cosmos.performance.utils.Constants; +import com.azure.spring.data.cosmos.common.TestConstants; import java.util.Objects; diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/performance/repository/PerfPersonRepository.java b/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/performance/repository/PerfPersonRepository.java similarity index 63% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/performance/repository/PerfPersonRepository.java rename to sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/performance/repository/PerfPersonRepository.java index 7f41ee7438008..19cabb78bba7c 100644 --- a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/performance/repository/PerfPersonRepository.java +++ b/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/performance/repository/PerfPersonRepository.java @@ -1,9 +1,9 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.microsoft.azure.spring.data.cosmosdb.performance.repository; +package com.azure.spring.data.cosmos.performance.repository; -import com.microsoft.azure.spring.data.cosmosdb.performance.domain.PerfPerson; -import com.microsoft.azure.spring.data.cosmosdb.repository.CosmosRepository; +import com.azure.spring.data.cosmos.repository.CosmosRepository; +import com.azure.spring.data.cosmos.performance.domain.PerfPerson; import org.springframework.data.domain.Sort; import org.springframework.stereotype.Repository; diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/performance/service/SdkService.java b/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/performance/service/SdkService.java similarity index 97% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/performance/service/SdkService.java rename to sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/performance/service/SdkService.java index 4b37ac7db7207..b9fa8bb4d6b86 100644 --- a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/performance/service/SdkService.java +++ b/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/performance/service/SdkService.java @@ -1,12 +1,12 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.microsoft.azure.spring.data.cosmosdb.performance.service; +package com.azure.spring.data.cosmos.performance.service; import com.azure.data.cosmos.*; import com.azure.data.cosmos.sync.CosmosSyncClient; +import com.azure.spring.data.cosmos.performance.utils.DatabaseUtils; import com.google.gson.Gson; -import com.microsoft.azure.spring.data.cosmosdb.performance.domain.PerfPerson; -import com.microsoft.azure.spring.data.cosmosdb.performance.utils.DatabaseUtils; +import com.azure.spring.data.cosmos.performance.domain.PerfPerson; import org.assertj.core.util.Lists; import org.springframework.data.domain.Sort; diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/performance/utils/Constants.java b/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/performance/utils/Constants.java similarity index 83% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/performance/utils/Constants.java rename to sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/performance/utils/Constants.java index 0813cd7fb40d3..24061701bdb91 100644 --- a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/performance/utils/Constants.java +++ b/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/performance/utils/Constants.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.microsoft.azure.spring.data.cosmosdb.performance.utils; +package com.azure.spring.data.cosmos.performance.utils; public class Constants { public static final String PERF_DATABASE_NAME = "perf_database"; diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/performance/utils/DatabaseUtils.java b/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/performance/utils/DatabaseUtils.java similarity index 92% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/performance/utils/DatabaseUtils.java rename to sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/performance/utils/DatabaseUtils.java index 8c7be5c489857..14ced00fcd8f2 100644 --- a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/performance/utils/DatabaseUtils.java +++ b/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/performance/utils/DatabaseUtils.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.microsoft.azure.spring.data.cosmosdb.performance.utils; +package com.azure.spring.data.cosmos.performance.utils; import com.azure.data.cosmos.*; import com.azure.data.cosmos.internal.RequestOptions; @@ -8,7 +8,7 @@ import java.util.Collections; -import static com.microsoft.azure.spring.data.cosmosdb.common.TestConstants.ORDER_BY_STRING_PATH; +import static com.azure.spring.data.cosmos.common.TestConstants.ORDER_BY_STRING_PATH; public class DatabaseUtils { public static void createDatabase(CosmosSyncClient documentClient, String databaseName) diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/performance/utils/FunctionUtils.java b/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/performance/utils/FunctionUtils.java similarity index 98% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/performance/utils/FunctionUtils.java rename to sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/performance/utils/FunctionUtils.java index ba890c1212158..52b1759d334c7 100644 --- a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/performance/utils/FunctionUtils.java +++ b/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/performance/utils/FunctionUtils.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.microsoft.azure.spring.data.cosmosdb.performance.utils; +package com.azure.spring.data.cosmos.performance.utils; import java.util.List; import java.util.function.Consumer; diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/performance/utils/PerfDataProvider.java b/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/performance/utils/PerfDataProvider.java similarity index 88% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/performance/utils/PerfDataProvider.java rename to sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/performance/utils/PerfDataProvider.java index 3c5472ca84651..7f79f5d70b267 100644 --- a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/performance/utils/PerfDataProvider.java +++ b/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/performance/utils/PerfDataProvider.java @@ -1,8 +1,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.microsoft.azure.spring.data.cosmosdb.performance.utils; +package com.azure.spring.data.cosmos.performance.utils; -import com.microsoft.azure.spring.data.cosmosdb.performance.domain.PerfPerson; +import com.azure.spring.data.cosmos.performance.domain.PerfPerson; import org.assertj.core.util.Lists; import java.util.List; diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/repository/CosmosAnnotationUnitTest.java b/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/repository/CosmosAnnotationUnitTest.java similarity index 89% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/repository/CosmosAnnotationUnitTest.java rename to sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/repository/CosmosAnnotationUnitTest.java index 920fc29a53271..0ffa19fb7a739 100644 --- a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/repository/CosmosAnnotationUnitTest.java +++ b/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/repository/CosmosAnnotationUnitTest.java @@ -1,16 +1,16 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.microsoft.azure.spring.data.cosmosdb.repository; +package com.azure.spring.data.cosmos.repository; import com.azure.data.cosmos.IndexingPolicy; -import com.microsoft.azure.spring.data.cosmosdb.common.TestConstants; -import com.microsoft.azure.spring.data.cosmosdb.common.TestUtils; -import com.microsoft.azure.spring.data.cosmosdb.core.mapping.Document; -import com.microsoft.azure.spring.data.cosmosdb.core.mapping.DocumentIndexingPolicy; -import com.microsoft.azure.spring.data.cosmosdb.domain.NoDBAnnotationPerson; -import com.microsoft.azure.spring.data.cosmosdb.domain.Role; -import com.microsoft.azure.spring.data.cosmosdb.domain.TimeToLiveSample; -import com.microsoft.azure.spring.data.cosmosdb.repository.support.CosmosEntityInformation; +import com.azure.spring.data.cosmos.core.mapping.Document; +import com.azure.spring.data.cosmos.core.mapping.DocumentIndexingPolicy; +import com.azure.spring.data.cosmos.repository.support.CosmosEntityInformation; +import com.azure.spring.data.cosmos.common.TestConstants; +import com.azure.spring.data.cosmos.common.TestUtils; +import com.azure.spring.data.cosmos.domain.NoDBAnnotationPerson; +import com.azure.spring.data.cosmos.domain.Role; +import com.azure.spring.data.cosmos.domain.TimeToLiveSample; import org.junit.Before; import org.junit.Test; import org.springframework.util.Assert; diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/repository/SimpleCosmosRepositoryIllegalTest.java b/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/repository/SimpleCosmosRepositoryIllegalTest.java similarity index 82% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/repository/SimpleCosmosRepositoryIllegalTest.java rename to sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/repository/SimpleCosmosRepositoryIllegalTest.java index 117d3bbf74aee..39291c39e1cd2 100644 --- a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/repository/SimpleCosmosRepositoryIllegalTest.java +++ b/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/repository/SimpleCosmosRepositoryIllegalTest.java @@ -1,11 +1,11 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.microsoft.azure.spring.data.cosmosdb.repository; +package com.azure.spring.data.cosmos.repository; -import com.microsoft.azure.spring.data.cosmosdb.core.CosmosOperations; -import com.microsoft.azure.spring.data.cosmosdb.domain.Person; -import com.microsoft.azure.spring.data.cosmosdb.repository.support.CosmosEntityInformation; -import com.microsoft.azure.spring.data.cosmosdb.repository.support.SimpleCosmosRepository; +import com.azure.spring.data.cosmos.core.CosmosOperations; +import com.azure.spring.data.cosmos.repository.support.CosmosEntityInformation; +import com.azure.spring.data.cosmos.repository.support.SimpleCosmosRepository; +import com.azure.spring.data.cosmos.domain.Person; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/repository/SimpleCosmosRepositoryUnitTest.java b/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/repository/SimpleCosmosRepositoryUnitTest.java similarity index 87% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/repository/SimpleCosmosRepositoryUnitTest.java rename to sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/repository/SimpleCosmosRepositoryUnitTest.java index ca3bd62d503f4..80cb570fe9885 100644 --- a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/repository/SimpleCosmosRepositoryUnitTest.java +++ b/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/repository/SimpleCosmosRepositoryUnitTest.java @@ -1,14 +1,14 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.microsoft.azure.spring.data.cosmosdb.repository; - -import com.microsoft.azure.spring.data.cosmosdb.common.TestConstants; -import com.microsoft.azure.spring.data.cosmosdb.core.CosmosOperations; -import com.microsoft.azure.spring.data.cosmosdb.domain.Address; -import com.microsoft.azure.spring.data.cosmosdb.domain.Person; -import com.microsoft.azure.spring.data.cosmosdb.repository.support.CosmosEntityInformation; -import com.microsoft.azure.spring.data.cosmosdb.repository.support.SimpleCosmosRepository; +package com.azure.spring.data.cosmos.repository; + +import com.azure.spring.data.cosmos.core.CosmosOperations; +import com.azure.spring.data.cosmos.repository.support.CosmosEntityInformation; +import com.azure.spring.data.cosmos.repository.support.SimpleCosmosRepository; +import com.azure.spring.data.cosmos.common.TestConstants; +import com.azure.spring.data.cosmos.domain.Address; +import com.azure.spring.data.cosmos.domain.Person; import org.assertj.core.util.Lists; import org.junit.Before; import org.junit.Rule; diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/repository/TestRepositoryConfig.java b/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/repository/TestRepositoryConfig.java similarity index 79% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/repository/TestRepositoryConfig.java rename to sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/repository/TestRepositoryConfig.java index 7079a4683ec6c..2556f379aa8e9 100644 --- a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/repository/TestRepositoryConfig.java +++ b/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/repository/TestRepositoryConfig.java @@ -1,16 +1,16 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.microsoft.azure.spring.data.cosmosdb.repository; +package com.azure.spring.data.cosmos.repository; import com.azure.data.cosmos.ConsistencyLevel; import com.azure.data.cosmos.internal.RequestOptions; -import com.microsoft.azure.spring.data.cosmosdb.common.DynamicContainer; -import com.microsoft.azure.spring.data.cosmosdb.common.ResponseDiagnosticsTestUtils; -import com.microsoft.azure.spring.data.cosmosdb.common.TestConstants; -import com.microsoft.azure.spring.data.cosmosdb.config.AbstractCosmosConfiguration; -import com.microsoft.azure.spring.data.cosmosdb.config.CosmosDBConfig; -import com.microsoft.azure.spring.data.cosmosdb.repository.config.EnableCosmosRepositories; -import com.microsoft.azure.spring.data.cosmosdb.repository.config.EnableReactiveCosmosRepositories; +import com.azure.spring.data.cosmos.config.AbstractCosmosConfiguration; +import com.azure.spring.data.cosmos.config.CosmosDBConfig; +import com.azure.spring.data.cosmos.repository.config.EnableCosmosRepositories; +import com.azure.spring.data.cosmos.repository.config.EnableReactiveCosmosRepositories; +import com.azure.spring.data.cosmos.common.DynamicContainer; +import com.azure.spring.data.cosmos.common.ResponseDiagnosticsTestUtils; +import com.azure.spring.data.cosmos.common.TestConstants; import org.springframework.beans.factory.annotation.Value; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/repository/config/CosmosRepositoryConfigurationExtensionUnitTest.java b/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/repository/config/CosmosRepositoryConfigurationExtensionUnitTest.java similarity index 94% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/repository/config/CosmosRepositoryConfigurationExtensionUnitTest.java rename to sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/repository/config/CosmosRepositoryConfigurationExtensionUnitTest.java index b6960ab484c36..440cc1d93be99 100644 --- a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/repository/config/CosmosRepositoryConfigurationExtensionUnitTest.java +++ b/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/repository/config/CosmosRepositoryConfigurationExtensionUnitTest.java @@ -1,9 +1,9 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.microsoft.azure.spring.data.cosmosdb.repository.config; +package com.azure.spring.data.cosmos.repository.config; -import com.microsoft.azure.spring.data.cosmosdb.repository.CosmosRepository; +import com.azure.spring.data.cosmos.repository.CosmosRepository; import org.junit.Test; import org.springframework.beans.factory.support.DefaultListableBeanFactory; import org.springframework.core.env.Environment; diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/repository/config/ReactiveCosmosRepositoryConfigurationExtensionUnitTest.java b/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/repository/config/ReactiveCosmosRepositoryConfigurationExtensionUnitTest.java similarity index 94% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/repository/config/ReactiveCosmosRepositoryConfigurationExtensionUnitTest.java rename to sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/repository/config/ReactiveCosmosRepositoryConfigurationExtensionUnitTest.java index 1e32fb0fe25b6..30b78a63900ef 100644 --- a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/repository/config/ReactiveCosmosRepositoryConfigurationExtensionUnitTest.java +++ b/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/repository/config/ReactiveCosmosRepositoryConfigurationExtensionUnitTest.java @@ -1,9 +1,9 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.microsoft.azure.spring.data.cosmosdb.repository.config; +package com.azure.spring.data.cosmos.repository.config; -import com.microsoft.azure.spring.data.cosmosdb.repository.ReactiveCosmosRepository; +import com.azure.spring.data.cosmos.repository.ReactiveCosmosRepository; import org.junit.Test; import org.springframework.beans.factory.support.DefaultListableBeanFactory; import org.springframework.core.env.Environment; diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/repository/integration/AddressRepositoryIT.java b/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/repository/integration/AddressRepositoryIT.java similarity index 93% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/repository/integration/AddressRepositoryIT.java rename to sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/repository/integration/AddressRepositoryIT.java index 90c73e73ab298..0a78bfebcbe8d 100644 --- a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/repository/integration/AddressRepositoryIT.java +++ b/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/repository/integration/AddressRepositoryIT.java @@ -1,15 +1,15 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.microsoft.azure.spring.data.cosmosdb.repository.integration; +package com.azure.spring.data.cosmos.repository.integration; import com.azure.data.cosmos.PartitionKey; -import com.microsoft.azure.spring.data.cosmosdb.common.TestConstants; -import com.microsoft.azure.spring.data.cosmosdb.common.TestUtils; -import com.microsoft.azure.spring.data.cosmosdb.core.CosmosTemplate; -import com.microsoft.azure.spring.data.cosmosdb.domain.Address; -import com.microsoft.azure.spring.data.cosmosdb.repository.TestRepositoryConfig; -import com.microsoft.azure.spring.data.cosmosdb.repository.repository.AddressRepository; -import com.microsoft.azure.spring.data.cosmosdb.repository.support.CosmosEntityInformation; +import com.azure.spring.data.cosmos.core.CosmosTemplate; +import com.azure.spring.data.cosmos.repository.support.CosmosEntityInformation; +import com.azure.spring.data.cosmos.common.TestConstants; +import com.azure.spring.data.cosmos.common.TestUtils; +import com.azure.spring.data.cosmos.domain.Address; +import com.azure.spring.data.cosmos.repository.TestRepositoryConfig; +import com.azure.spring.data.cosmos.repository.repository.AddressRepository; import org.assertj.core.util.Lists; import org.junit.*; import org.junit.rules.ExpectedException; diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/repository/integration/ContactRepositoryIT.java b/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/repository/integration/ContactRepositoryIT.java similarity index 92% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/repository/integration/ContactRepositoryIT.java rename to sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/repository/integration/ContactRepositoryIT.java index 3a7b23df07af3..bbcb0aedadfce 100644 --- a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/repository/integration/ContactRepositoryIT.java +++ b/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/repository/integration/ContactRepositoryIT.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.microsoft.azure.spring.data.cosmosdb.repository.integration; - -import com.microsoft.azure.spring.data.cosmosdb.common.TestUtils; -import com.microsoft.azure.spring.data.cosmosdb.core.CosmosTemplate; -import com.microsoft.azure.spring.data.cosmosdb.domain.Contact; -import com.microsoft.azure.spring.data.cosmosdb.repository.TestRepositoryConfig; -import com.microsoft.azure.spring.data.cosmosdb.repository.repository.ContactRepository; -import com.microsoft.azure.spring.data.cosmosdb.repository.support.CosmosEntityInformation; +package com.azure.spring.data.cosmos.repository.integration; + +import com.azure.spring.data.cosmos.core.CosmosTemplate; +import com.azure.spring.data.cosmos.repository.support.CosmosEntityInformation; +import com.azure.spring.data.cosmos.common.TestUtils; +import com.azure.spring.data.cosmos.domain.Contact; +import com.azure.spring.data.cosmos.repository.TestRepositoryConfig; +import com.azure.spring.data.cosmos.repository.repository.ContactRepository; import org.assertj.core.util.Lists; import org.junit.*; import org.junit.runner.RunWith; diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/repository/integration/CosmosAnnotationIT.java b/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/repository/integration/CosmosAnnotationIT.java similarity index 81% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/repository/integration/CosmosAnnotationIT.java rename to sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/repository/integration/CosmosAnnotationIT.java index 943dfe2072bc2..7c5253e0c1187 100644 --- a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/repository/integration/CosmosAnnotationIT.java +++ b/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/repository/integration/CosmosAnnotationIT.java @@ -1,20 +1,20 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.microsoft.azure.spring.data.cosmosdb.repository.integration; +package com.azure.spring.data.cosmos.repository.integration; import com.azure.data.cosmos.CosmosContainerProperties; import com.azure.data.cosmos.IndexingPolicy; -import com.microsoft.azure.spring.data.cosmosdb.CosmosDbFactory; -import com.microsoft.azure.spring.data.cosmosdb.common.TestConstants; -import com.microsoft.azure.spring.data.cosmosdb.common.TestUtils; -import com.microsoft.azure.spring.data.cosmosdb.config.CosmosDBConfig; -import com.microsoft.azure.spring.data.cosmosdb.core.CosmosTemplate; -import com.microsoft.azure.spring.data.cosmosdb.core.convert.MappingCosmosConverter; -import com.microsoft.azure.spring.data.cosmosdb.core.mapping.CosmosMappingContext; -import com.microsoft.azure.spring.data.cosmosdb.domain.Role; -import com.microsoft.azure.spring.data.cosmosdb.domain.TimeToLiveSample; -import com.microsoft.azure.spring.data.cosmosdb.repository.TestRepositoryConfig; -import com.microsoft.azure.spring.data.cosmosdb.repository.support.CosmosEntityInformation; +import com.azure.spring.data.cosmos.CosmosDbFactory; +import com.azure.spring.data.cosmos.config.CosmosDBConfig; +import com.azure.spring.data.cosmos.core.CosmosTemplate; +import com.azure.spring.data.cosmos.core.convert.MappingCosmosConverter; +import com.azure.spring.data.cosmos.core.mapping.CosmosMappingContext; +import com.azure.spring.data.cosmos.repository.support.CosmosEntityInformation; +import com.azure.spring.data.cosmos.common.TestConstants; +import com.azure.spring.data.cosmos.common.TestUtils; +import com.azure.spring.data.cosmos.domain.Role; +import com.azure.spring.data.cosmos.domain.TimeToLiveSample; +import com.azure.spring.data.cosmos.repository.TestRepositoryConfig; import org.junit.AfterClass; import org.junit.Before; import org.junit.Ignore; diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/repository/integration/CustomerRepositoryIT.java b/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/repository/integration/CustomerRepositoryIT.java similarity index 87% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/repository/integration/CustomerRepositoryIT.java rename to sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/repository/integration/CustomerRepositoryIT.java index aade6e404ee21..5b2eb1866a5e3 100644 --- a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/repository/integration/CustomerRepositoryIT.java +++ b/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/repository/integration/CustomerRepositoryIT.java @@ -1,12 +1,12 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.microsoft.azure.spring.data.cosmosdb.repository.integration; +package com.azure.spring.data.cosmos.repository.integration; -import com.microsoft.azure.spring.data.cosmosdb.core.CosmosTemplate; -import com.microsoft.azure.spring.data.cosmosdb.domain.Customer; -import com.microsoft.azure.spring.data.cosmosdb.repository.TestRepositoryConfig; -import com.microsoft.azure.spring.data.cosmosdb.repository.repository.CustomerRepository; -import com.microsoft.azure.spring.data.cosmosdb.repository.support.CosmosEntityInformation; +import com.azure.spring.data.cosmos.core.CosmosTemplate; +import com.azure.spring.data.cosmos.repository.support.CosmosEntityInformation; +import com.azure.spring.data.cosmos.domain.Customer; +import com.azure.spring.data.cosmos.repository.TestRepositoryConfig; +import com.azure.spring.data.cosmos.repository.repository.CustomerRepository; import org.junit.*; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/repository/integration/IntegerIdDomainRepositoryIT.java b/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/repository/integration/IntegerIdDomainRepositoryIT.java similarity index 92% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/repository/integration/IntegerIdDomainRepositoryIT.java rename to sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/repository/integration/IntegerIdDomainRepositoryIT.java index 4b8cd3b8a4725..ec95314fb903e 100644 --- a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/repository/integration/IntegerIdDomainRepositoryIT.java +++ b/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/repository/integration/IntegerIdDomainRepositoryIT.java @@ -1,14 +1,14 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.microsoft.azure.spring.data.cosmosdb.repository.integration; - -import com.microsoft.azure.spring.data.cosmosdb.core.CosmosTemplate; -import com.microsoft.azure.spring.data.cosmosdb.core.query.CosmosPageRequest; -import com.microsoft.azure.spring.data.cosmosdb.domain.IntegerIdDomain; -import com.microsoft.azure.spring.data.cosmosdb.exception.CosmosDBAccessException; -import com.microsoft.azure.spring.data.cosmosdb.repository.TestRepositoryConfig; -import com.microsoft.azure.spring.data.cosmosdb.repository.repository.IntegerIdDomainRepository; -import com.microsoft.azure.spring.data.cosmosdb.repository.support.CosmosEntityInformation; +package com.azure.spring.data.cosmos.repository.integration; + +import com.azure.spring.data.cosmos.core.CosmosTemplate; +import com.azure.spring.data.cosmos.core.query.CosmosPageRequest; +import com.azure.spring.data.cosmos.exception.CosmosDBAccessException; +import com.azure.spring.data.cosmos.repository.support.CosmosEntityInformation; +import com.azure.spring.data.cosmos.domain.IntegerIdDomain; +import com.azure.spring.data.cosmos.repository.TestRepositoryConfig; +import com.azure.spring.data.cosmos.repository.repository.IntegerIdDomainRepository; import org.junit.*; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/repository/integration/MemoRepositoryIT.java b/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/repository/integration/MemoRepositoryIT.java similarity index 92% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/repository/integration/MemoRepositoryIT.java rename to sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/repository/integration/MemoRepositoryIT.java index 71ce123073bf2..11e0a8a504dd4 100644 --- a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/repository/integration/MemoRepositoryIT.java +++ b/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/repository/integration/MemoRepositoryIT.java @@ -1,16 +1,16 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.microsoft.azure.spring.data.cosmosdb.repository.integration; - -import com.microsoft.azure.spring.data.cosmosdb.common.TestConstants; -import com.microsoft.azure.spring.data.cosmosdb.common.TestUtils; -import com.microsoft.azure.spring.data.cosmosdb.core.CosmosTemplate; -import com.microsoft.azure.spring.data.cosmosdb.domain.Importance; -import com.microsoft.azure.spring.data.cosmosdb.domain.Memo; -import com.microsoft.azure.spring.data.cosmosdb.exception.CosmosDBAccessException; -import com.microsoft.azure.spring.data.cosmosdb.repository.TestRepositoryConfig; -import com.microsoft.azure.spring.data.cosmosdb.repository.repository.MemoRepository; -import com.microsoft.azure.spring.data.cosmosdb.repository.support.CosmosEntityInformation; +package com.azure.spring.data.cosmos.repository.integration; + +import com.azure.spring.data.cosmos.core.CosmosTemplate; +import com.azure.spring.data.cosmos.exception.CosmosDBAccessException; +import com.azure.spring.data.cosmos.repository.support.CosmosEntityInformation; +import com.azure.spring.data.cosmos.common.TestConstants; +import com.azure.spring.data.cosmos.common.TestUtils; +import com.azure.spring.data.cosmos.domain.Importance; +import com.azure.spring.data.cosmos.domain.Memo; +import com.azure.spring.data.cosmos.repository.TestRepositoryConfig; +import com.azure.spring.data.cosmos.repository.repository.MemoRepository; import org.junit.*; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/repository/integration/PageableAddressRepositoryIT.java b/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/repository/integration/PageableAddressRepositoryIT.java similarity index 87% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/repository/integration/PageableAddressRepositoryIT.java rename to sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/repository/integration/PageableAddressRepositoryIT.java index 7e1d9a984a340..dee802834c9a6 100644 --- a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/repository/integration/PageableAddressRepositoryIT.java +++ b/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/repository/integration/PageableAddressRepositoryIT.java @@ -1,20 +1,20 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.microsoft.azure.spring.data.cosmosdb.repository.integration; +package com.azure.spring.data.cosmos.repository.integration; import com.azure.data.cosmos.CosmosClient; import com.azure.data.cosmos.CosmosItemProperties; import com.azure.data.cosmos.FeedOptions; import com.azure.data.cosmos.FeedResponse; -import com.microsoft.azure.spring.data.cosmosdb.common.TestConstants; -import com.microsoft.azure.spring.data.cosmosdb.common.TestUtils; -import com.microsoft.azure.spring.data.cosmosdb.config.CosmosDBConfig; -import com.microsoft.azure.spring.data.cosmosdb.core.CosmosTemplate; -import com.microsoft.azure.spring.data.cosmosdb.core.query.CosmosPageRequest; -import com.microsoft.azure.spring.data.cosmosdb.domain.PageableAddress; -import com.microsoft.azure.spring.data.cosmosdb.repository.TestRepositoryConfig; -import com.microsoft.azure.spring.data.cosmosdb.repository.repository.PageableAddressRepository; -import com.microsoft.azure.spring.data.cosmosdb.repository.support.CosmosEntityInformation; +import com.azure.spring.data.cosmos.config.CosmosDBConfig; +import com.azure.spring.data.cosmos.core.CosmosTemplate; +import com.azure.spring.data.cosmos.core.query.CosmosPageRequest; +import com.azure.spring.data.cosmos.repository.support.CosmosEntityInformation; +import com.azure.spring.data.cosmos.common.TestConstants; +import com.azure.spring.data.cosmos.common.TestUtils; +import com.azure.spring.data.cosmos.domain.PageableAddress; +import com.azure.spring.data.cosmos.repository.TestRepositoryConfig; +import com.azure.spring.data.cosmos.repository.repository.PageableAddressRepository; import org.junit.After; import org.junit.AfterClass; import org.junit.Before; @@ -31,10 +31,10 @@ import java.util.ArrayList; import java.util.List; -import static com.microsoft.azure.spring.data.cosmosdb.common.PageTestUtils.validateLastPage; -import static com.microsoft.azure.spring.data.cosmosdb.common.PageTestUtils.validateNonLastPage; -import static com.microsoft.azure.spring.data.cosmosdb.common.TestConstants.PAGE_SIZE_1; -import static com.microsoft.azure.spring.data.cosmosdb.common.TestConstants.PAGE_SIZE_3; +import static com.azure.spring.data.cosmos.common.PageTestUtils.validateLastPage; +import static com.azure.spring.data.cosmos.common.PageTestUtils.validateNonLastPage; +import static com.azure.spring.data.cosmos.common.TestConstants.PAGE_SIZE_1; +import static com.azure.spring.data.cosmos.common.TestConstants.PAGE_SIZE_3; import static org.assertj.core.api.Assertions.assertThat; @RunWith(SpringJUnit4ClassRunner.class) diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/repository/integration/PageableMemoRepositoryIT.java b/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/repository/integration/PageableMemoRepositoryIT.java similarity index 89% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/repository/integration/PageableMemoRepositoryIT.java rename to sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/repository/integration/PageableMemoRepositoryIT.java index c8c254f7ad2bc..a941af82390b2 100644 --- a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/repository/integration/PageableMemoRepositoryIT.java +++ b/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/repository/integration/PageableMemoRepositoryIT.java @@ -1,19 +1,19 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.microsoft.azure.spring.data.cosmosdb.repository.integration; +package com.azure.spring.data.cosmos.repository.integration; import com.azure.data.cosmos.CosmosClient; import com.azure.data.cosmos.CosmosItemProperties; import com.azure.data.cosmos.FeedOptions; import com.azure.data.cosmos.FeedResponse; -import com.microsoft.azure.spring.data.cosmosdb.config.CosmosDBConfig; -import com.microsoft.azure.spring.data.cosmosdb.core.CosmosTemplate; -import com.microsoft.azure.spring.data.cosmosdb.core.query.CosmosPageRequest; -import com.microsoft.azure.spring.data.cosmosdb.domain.Importance; -import com.microsoft.azure.spring.data.cosmosdb.domain.PageableMemo; -import com.microsoft.azure.spring.data.cosmosdb.repository.TestRepositoryConfig; -import com.microsoft.azure.spring.data.cosmosdb.repository.repository.PageableMemoRepository; -import com.microsoft.azure.spring.data.cosmosdb.repository.support.CosmosEntityInformation; +import com.azure.spring.data.cosmos.config.CosmosDBConfig; +import com.azure.spring.data.cosmos.core.CosmosTemplate; +import com.azure.spring.data.cosmos.core.query.CosmosPageRequest; +import com.azure.spring.data.cosmos.repository.support.CosmosEntityInformation; +import com.azure.spring.data.cosmos.domain.Importance; +import com.azure.spring.data.cosmos.domain.PageableMemo; +import com.azure.spring.data.cosmos.repository.TestRepositoryConfig; +import com.azure.spring.data.cosmos.repository.repository.PageableMemoRepository; import org.junit.AfterClass; import org.junit.Before; import org.junit.Test; diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/repository/integration/PageablePersonRepositoryIT.java b/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/repository/integration/PageablePersonRepositoryIT.java similarity index 87% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/repository/integration/PageablePersonRepositoryIT.java rename to sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/repository/integration/PageablePersonRepositoryIT.java index f3720b6e78b4d..20cc38a9ce36e 100644 --- a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/repository/integration/PageablePersonRepositoryIT.java +++ b/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/repository/integration/PageablePersonRepositoryIT.java @@ -1,14 +1,14 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.microsoft.azure.spring.data.cosmosdb.repository.integration; - -import com.microsoft.azure.spring.data.cosmosdb.core.CosmosTemplate; -import com.microsoft.azure.spring.data.cosmosdb.core.query.CosmosPageRequest; -import com.microsoft.azure.spring.data.cosmosdb.domain.Address; -import com.microsoft.azure.spring.data.cosmosdb.domain.PageablePerson; -import com.microsoft.azure.spring.data.cosmosdb.repository.TestRepositoryConfig; -import com.microsoft.azure.spring.data.cosmosdb.repository.repository.PageablePersonRepository; -import com.microsoft.azure.spring.data.cosmosdb.repository.support.CosmosEntityInformation; +package com.azure.spring.data.cosmos.repository.integration; + +import com.azure.spring.data.cosmos.core.CosmosTemplate; +import com.azure.spring.data.cosmos.core.query.CosmosPageRequest; +import com.azure.spring.data.cosmos.repository.support.CosmosEntityInformation; +import com.azure.spring.data.cosmos.domain.Address; +import com.azure.spring.data.cosmos.domain.PageablePerson; +import com.azure.spring.data.cosmos.repository.TestRepositoryConfig; +import com.azure.spring.data.cosmos.repository.repository.PageablePersonRepository; import org.apache.commons.io.FileUtils; import org.apache.commons.lang3.StringUtils; import org.junit.AfterClass; diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/repository/integration/PersonRepositoryIT.java b/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/repository/integration/PersonRepositoryIT.java similarity index 64% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/repository/integration/PersonRepositoryIT.java rename to sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/repository/integration/PersonRepositoryIT.java index 1ffa716495345..e76bab5a18855 100644 --- a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/repository/integration/PersonRepositoryIT.java +++ b/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/repository/integration/PersonRepositoryIT.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.microsoft.azure.spring.data.cosmosdb.repository.integration; +package com.azure.spring.data.cosmos.repository.integration; public class PersonRepositoryIT { } diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/repository/integration/ProjectRepositoryIT.java b/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/repository/integration/ProjectRepositoryIT.java similarity index 97% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/repository/integration/ProjectRepositoryIT.java rename to sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/repository/integration/ProjectRepositoryIT.java index 64ee38ccc15ea..3910aa2a3be1f 100644 --- a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/repository/integration/ProjectRepositoryIT.java +++ b/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/repository/integration/ProjectRepositoryIT.java @@ -1,14 +1,14 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.microsoft.azure.spring.data.cosmosdb.repository.integration; +package com.azure.spring.data.cosmos.repository.integration; import com.azure.data.cosmos.PartitionKey; +import com.azure.spring.data.cosmos.core.CosmosTemplate; +import com.azure.spring.data.cosmos.repository.support.CosmosEntityInformation; import com.google.common.collect.Lists; -import com.microsoft.azure.spring.data.cosmosdb.core.CosmosTemplate; -import com.microsoft.azure.spring.data.cosmosdb.domain.Project; -import com.microsoft.azure.spring.data.cosmosdb.repository.TestRepositoryConfig; -import com.microsoft.azure.spring.data.cosmosdb.repository.repository.ProjectRepository; -import com.microsoft.azure.spring.data.cosmosdb.repository.support.CosmosEntityInformation; +import com.azure.spring.data.cosmos.domain.Project; +import com.azure.spring.data.cosmos.repository.TestRepositoryConfig; +import com.azure.spring.data.cosmos.repository.repository.ProjectRepository; import org.junit.*; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/repository/integration/ProjectRepositorySortIT.java b/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/repository/integration/ProjectRepositorySortIT.java similarity index 92% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/repository/integration/ProjectRepositorySortIT.java rename to sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/repository/integration/ProjectRepositorySortIT.java index 4da352b4589d9..0402c2c9e8c77 100644 --- a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/repository/integration/ProjectRepositorySortIT.java +++ b/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/repository/integration/ProjectRepositorySortIT.java @@ -1,14 +1,14 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.microsoft.azure.spring.data.cosmosdb.repository.integration; - -import com.microsoft.azure.spring.data.cosmosdb.core.CosmosTemplate; -import com.microsoft.azure.spring.data.cosmosdb.core.query.CosmosPageRequest; -import com.microsoft.azure.spring.data.cosmosdb.domain.SortedProject; -import com.microsoft.azure.spring.data.cosmosdb.exception.CosmosDBAccessException; -import com.microsoft.azure.spring.data.cosmosdb.repository.TestRepositoryConfig; -import com.microsoft.azure.spring.data.cosmosdb.repository.repository.SortedProjectRepository; -import com.microsoft.azure.spring.data.cosmosdb.repository.support.CosmosEntityInformation; +package com.azure.spring.data.cosmos.repository.integration; + +import com.azure.spring.data.cosmos.core.CosmosTemplate; +import com.azure.spring.data.cosmos.core.query.CosmosPageRequest; +import com.azure.spring.data.cosmos.exception.CosmosDBAccessException; +import com.azure.spring.data.cosmos.repository.support.CosmosEntityInformation; +import com.azure.spring.data.cosmos.domain.SortedProject; +import com.azure.spring.data.cosmos.repository.TestRepositoryConfig; +import com.azure.spring.data.cosmos.repository.repository.SortedProjectRepository; import org.assertj.core.util.Lists; import org.junit.*; import org.junit.runner.RunWith; @@ -25,7 +25,7 @@ import java.util.stream.Collectors; import java.util.stream.StreamSupport; -import static com.microsoft.azure.spring.data.cosmosdb.common.PageTestUtils.validateLastPage; +import static com.azure.spring.data.cosmos.common.PageTestUtils.validateLastPage; @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration(classes = TestRepositoryConfig.class) diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/repository/integration/QuestionRepositoryIT.java b/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/repository/integration/QuestionRepositoryIT.java similarity index 83% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/repository/integration/QuestionRepositoryIT.java rename to sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/repository/integration/QuestionRepositoryIT.java index 61b24a271e360..5410ca9f445ef 100644 --- a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/repository/integration/QuestionRepositoryIT.java +++ b/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/repository/integration/QuestionRepositoryIT.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.microsoft.azure.spring.data.cosmosdb.repository.integration; - -import com.microsoft.azure.spring.data.cosmosdb.core.CosmosTemplate; -import com.microsoft.azure.spring.data.cosmosdb.domain.Question; -import com.microsoft.azure.spring.data.cosmosdb.repository.TestRepositoryConfig; -import com.microsoft.azure.spring.data.cosmosdb.repository.repository.ProjectRepository; -import com.microsoft.azure.spring.data.cosmosdb.repository.repository.QuestionRepository; -import com.microsoft.azure.spring.data.cosmosdb.repository.support.CosmosEntityInformation; +package com.azure.spring.data.cosmos.repository.integration; + +import com.azure.spring.data.cosmos.core.CosmosTemplate; +import com.azure.spring.data.cosmos.repository.support.CosmosEntityInformation; +import com.azure.spring.data.cosmos.domain.Question; +import com.azure.spring.data.cosmos.repository.TestRepositoryConfig; +import com.azure.spring.data.cosmos.repository.repository.ProjectRepository; +import com.azure.spring.data.cosmos.repository.repository.QuestionRepository; import org.assertj.core.util.Lists; import org.junit.*; import org.junit.runner.RunWith; diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/repository/integration/ReactiveCourseRepositoryIT.java b/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/repository/integration/ReactiveCourseRepositoryIT.java similarity index 94% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/repository/integration/ReactiveCourseRepositoryIT.java rename to sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/repository/integration/ReactiveCourseRepositoryIT.java index 140cff164df88..df2780cfc2163 100644 --- a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/repository/integration/ReactiveCourseRepositoryIT.java +++ b/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/repository/integration/ReactiveCourseRepositoryIT.java @@ -1,14 +1,14 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.microsoft.azure.spring.data.cosmosdb.repository.integration; +package com.azure.spring.data.cosmos.repository.integration; import com.azure.data.cosmos.PartitionKey; -import com.microsoft.azure.spring.data.cosmosdb.core.ReactiveCosmosTemplate; -import com.microsoft.azure.spring.data.cosmosdb.domain.Course; -import com.microsoft.azure.spring.data.cosmosdb.exception.CosmosDBAccessException; -import com.microsoft.azure.spring.data.cosmosdb.repository.TestRepositoryConfig; -import com.microsoft.azure.spring.data.cosmosdb.repository.repository.ReactiveCourseRepository; -import com.microsoft.azure.spring.data.cosmosdb.repository.support.CosmosEntityInformation; +import com.azure.spring.data.cosmos.core.ReactiveCosmosTemplate; +import com.azure.spring.data.cosmos.exception.CosmosDBAccessException; +import com.azure.spring.data.cosmos.repository.support.CosmosEntityInformation; +import com.azure.spring.data.cosmos.domain.Course; +import com.azure.spring.data.cosmos.repository.TestRepositoryConfig; +import com.azure.spring.data.cosmos.repository.repository.ReactiveCourseRepository; import org.junit.After; import org.junit.AfterClass; import org.junit.Before; diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/repository/integration/SpELCosmosDBAnnotationIT.java b/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/repository/integration/SpELCosmosDBAnnotationIT.java similarity index 81% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/repository/integration/SpELCosmosDBAnnotationIT.java rename to sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/repository/integration/SpELCosmosDBAnnotationIT.java index ab8965c8b67d7..608e26b6b60b0 100644 --- a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/repository/integration/SpELCosmosDBAnnotationIT.java +++ b/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/repository/integration/SpELCosmosDBAnnotationIT.java @@ -1,19 +1,19 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.microsoft.azure.spring.data.cosmosdb.repository.integration; - +package com.azure.spring.data.cosmos.repository.integration; + +import com.azure.spring.data.cosmos.CosmosDbFactory; +import com.azure.spring.data.cosmos.config.CosmosDBConfig; +import com.azure.spring.data.cosmos.core.CosmosTemplate; +import com.azure.spring.data.cosmos.core.convert.MappingCosmosConverter; +import com.azure.spring.data.cosmos.core.convert.ObjectMapperFactory; +import com.azure.spring.data.cosmos.core.mapping.CosmosMappingContext; +import com.azure.spring.data.cosmos.repository.support.CosmosEntityInformation; import com.fasterxml.jackson.databind.ObjectMapper; -import com.microsoft.azure.spring.data.cosmosdb.CosmosDbFactory; -import com.microsoft.azure.spring.data.cosmosdb.common.TestConstants; -import com.microsoft.azure.spring.data.cosmosdb.config.CosmosDBConfig; -import com.microsoft.azure.spring.data.cosmosdb.core.CosmosTemplate; -import com.microsoft.azure.spring.data.cosmosdb.core.convert.MappingCosmosConverter; -import com.microsoft.azure.spring.data.cosmosdb.core.convert.ObjectMapperFactory; -import com.microsoft.azure.spring.data.cosmosdb.core.mapping.CosmosMappingContext; -import com.microsoft.azure.spring.data.cosmosdb.domain.SpELBeanStudent; -import com.microsoft.azure.spring.data.cosmosdb.domain.SpELPropertyStudent; -import com.microsoft.azure.spring.data.cosmosdb.repository.TestRepositoryConfig; -import com.microsoft.azure.spring.data.cosmosdb.repository.support.CosmosEntityInformation; +import com.azure.spring.data.cosmos.common.TestConstants; +import com.azure.spring.data.cosmos.domain.SpELBeanStudent; +import com.azure.spring.data.cosmos.domain.SpELPropertyStudent; +import com.azure.spring.data.cosmos.repository.TestRepositoryConfig; import org.junit.AfterClass; import org.junit.Before; import org.junit.Test; diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/repository/integration/SquareRepositoryIT.java b/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/repository/integration/SquareRepositoryIT.java similarity index 80% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/repository/integration/SquareRepositoryIT.java rename to sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/repository/integration/SquareRepositoryIT.java index b186197af719e..f7a0bbbc9a5c3 100644 --- a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/repository/integration/SquareRepositoryIT.java +++ b/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/repository/integration/SquareRepositoryIT.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.microsoft.azure.spring.data.cosmosdb.repository.integration; +package com.azure.spring.data.cosmos.repository.integration; -import com.microsoft.azure.spring.data.cosmosdb.common.TestUtils; -import com.microsoft.azure.spring.data.cosmosdb.core.CosmosTemplate; -import com.microsoft.azure.spring.data.cosmosdb.domain.inheritance.Square; -import com.microsoft.azure.spring.data.cosmosdb.repository.TestRepositoryConfig; -import com.microsoft.azure.spring.data.cosmosdb.repository.repository.SquareRepository; -import com.microsoft.azure.spring.data.cosmosdb.repository.support.CosmosEntityInformation; +import com.azure.spring.data.cosmos.core.CosmosTemplate; +import com.azure.spring.data.cosmos.repository.support.CosmosEntityInformation; +import com.azure.spring.data.cosmos.common.TestUtils; +import com.azure.spring.data.cosmos.domain.inheritance.Square; +import com.azure.spring.data.cosmos.repository.TestRepositoryConfig; +import com.azure.spring.data.cosmos.repository.repository.SquareRepository; import org.junit.After; import org.junit.AfterClass; import org.junit.Before; diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/repository/integration/StudentRepositoryIT.java b/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/repository/integration/StudentRepositoryIT.java similarity index 92% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/repository/integration/StudentRepositoryIT.java rename to sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/repository/integration/StudentRepositoryIT.java index 45e25aa3cac7d..5da443d21f66a 100644 --- a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/repository/integration/StudentRepositoryIT.java +++ b/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/repository/integration/StudentRepositoryIT.java @@ -1,12 +1,12 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.microsoft.azure.spring.data.cosmosdb.repository.integration; +package com.azure.spring.data.cosmos.repository.integration; -import com.microsoft.azure.spring.data.cosmosdb.core.CosmosTemplate; -import com.microsoft.azure.spring.data.cosmosdb.domain.Student; -import com.microsoft.azure.spring.data.cosmosdb.repository.TestRepositoryConfig; -import com.microsoft.azure.spring.data.cosmosdb.repository.repository.StudentRepository; -import com.microsoft.azure.spring.data.cosmosdb.repository.support.CosmosEntityInformation; +import com.azure.spring.data.cosmos.core.CosmosTemplate; +import com.azure.spring.data.cosmos.repository.support.CosmosEntityInformation; +import com.azure.spring.data.cosmos.domain.Student; +import com.azure.spring.data.cosmos.repository.TestRepositoryConfig; +import com.azure.spring.data.cosmos.repository.repository.StudentRepository; import org.junit.*; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/repository/repository/AddressRepository.java b/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/repository/repository/AddressRepository.java similarity index 74% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/repository/repository/AddressRepository.java rename to sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/repository/repository/AddressRepository.java index 1f7a6055df0e1..69cb5ee06e9e2 100644 --- a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/repository/repository/AddressRepository.java +++ b/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/repository/repository/AddressRepository.java @@ -1,9 +1,9 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.microsoft.azure.spring.data.cosmosdb.repository.repository; +package com.azure.spring.data.cosmos.repository.repository; -import com.microsoft.azure.spring.data.cosmosdb.domain.Address; -import com.microsoft.azure.spring.data.cosmosdb.repository.CosmosRepository; +import com.azure.spring.data.cosmos.repository.CosmosRepository; +import com.azure.spring.data.cosmos.domain.Address; import org.springframework.stereotype.Repository; import java.util.List; diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/repository/repository/ContactRepository.java b/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/repository/repository/ContactRepository.java similarity index 59% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/repository/repository/ContactRepository.java rename to sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/repository/repository/ContactRepository.java index 3d52e998547b7..e13047d28442f 100644 --- a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/repository/repository/ContactRepository.java +++ b/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/repository/repository/ContactRepository.java @@ -1,9 +1,9 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.microsoft.azure.spring.data.cosmosdb.repository.repository; +package com.azure.spring.data.cosmos.repository.repository; -import com.microsoft.azure.spring.data.cosmosdb.domain.Contact; -import com.microsoft.azure.spring.data.cosmosdb.repository.CosmosRepository; +import com.azure.spring.data.cosmos.repository.CosmosRepository; +import com.azure.spring.data.cosmos.domain.Contact; import org.springframework.stereotype.Repository; import java.util.List; diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/repository/repository/CustomerRepository.java b/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/repository/repository/CustomerRepository.java similarity index 54% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/repository/repository/CustomerRepository.java rename to sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/repository/repository/CustomerRepository.java index 9c1a0e5d33e43..6a15bd90b4fae 100644 --- a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/repository/repository/CustomerRepository.java +++ b/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/repository/repository/CustomerRepository.java @@ -1,9 +1,9 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.microsoft.azure.spring.data.cosmosdb.repository.repository; +package com.azure.spring.data.cosmos.repository.repository; -import com.microsoft.azure.spring.data.cosmosdb.domain.Customer; -import com.microsoft.azure.spring.data.cosmosdb.repository.CosmosRepository; +import com.azure.spring.data.cosmos.repository.CosmosRepository; +import com.azure.spring.data.cosmos.domain.Customer; import java.util.List; diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/repository/repository/IntegerIdDomainRepository.java b/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/repository/repository/IntegerIdDomainRepository.java similarity index 53% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/repository/repository/IntegerIdDomainRepository.java rename to sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/repository/repository/IntegerIdDomainRepository.java index 5c7cb1b9a5758..295d7f3d7c66a 100644 --- a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/repository/repository/IntegerIdDomainRepository.java +++ b/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/repository/repository/IntegerIdDomainRepository.java @@ -1,9 +1,9 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.microsoft.azure.spring.data.cosmosdb.repository.repository; +package com.azure.spring.data.cosmos.repository.repository; -import com.microsoft.azure.spring.data.cosmosdb.domain.IntegerIdDomain; -import com.microsoft.azure.spring.data.cosmosdb.repository.CosmosRepository; +import com.azure.spring.data.cosmos.repository.CosmosRepository; +import com.azure.spring.data.cosmos.domain.IntegerIdDomain; import org.springframework.stereotype.Repository; @Repository diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/repository/repository/MemoRepository.java b/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/repository/repository/MemoRepository.java similarity index 79% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/repository/repository/MemoRepository.java rename to sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/repository/repository/MemoRepository.java index 8718388d42a66..56f51bef2f60c 100644 --- a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/repository/repository/MemoRepository.java +++ b/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/repository/repository/MemoRepository.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.microsoft.azure.spring.data.cosmosdb.repository.repository; +package com.azure.spring.data.cosmos.repository.repository; -import com.microsoft.azure.spring.data.cosmosdb.domain.Importance; -import com.microsoft.azure.spring.data.cosmosdb.domain.Memo; -import com.microsoft.azure.spring.data.cosmosdb.repository.CosmosRepository; +import com.azure.spring.data.cosmos.repository.CosmosRepository; +import com.azure.spring.data.cosmos.domain.Importance; +import com.azure.spring.data.cosmos.domain.Memo; import org.springframework.stereotype.Repository; import java.util.Date; diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/repository/repository/PageableAddressRepository.java b/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/repository/repository/PageableAddressRepository.java similarity index 80% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/repository/repository/PageableAddressRepository.java rename to sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/repository/repository/PageableAddressRepository.java index 76d794a6eda10..94adbb0e53a60 100644 --- a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/repository/repository/PageableAddressRepository.java +++ b/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/repository/repository/PageableAddressRepository.java @@ -1,8 +1,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.microsoft.azure.spring.data.cosmosdb.repository.repository; +package com.azure.spring.data.cosmos.repository.repository; -import com.microsoft.azure.spring.data.cosmosdb.domain.PageableAddress; +import com.azure.spring.data.cosmos.domain.PageableAddress; import org.springframework.data.domain.Page; import org.springframework.data.domain.Pageable; import org.springframework.data.repository.PagingAndSortingRepository; diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/repository/repository/PageableMemoRepository.java b/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/repository/repository/PageableMemoRepository.java similarity index 70% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/repository/repository/PageableMemoRepository.java rename to sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/repository/repository/PageableMemoRepository.java index 7630c84672d21..f6b138b9df55b 100644 --- a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/repository/repository/PageableMemoRepository.java +++ b/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/repository/repository/PageableMemoRepository.java @@ -1,8 +1,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.microsoft.azure.spring.data.cosmosdb.repository.repository; +package com.azure.spring.data.cosmos.repository.repository; -import com.microsoft.azure.spring.data.cosmosdb.domain.PageableMemo; +import com.azure.spring.data.cosmos.domain.PageableMemo; import org.springframework.data.repository.PagingAndSortingRepository; import org.springframework.stereotype.Repository; diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/repository/repository/PageablePersonRepository.java b/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/repository/repository/PageablePersonRepository.java similarity index 70% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/repository/repository/PageablePersonRepository.java rename to sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/repository/repository/PageablePersonRepository.java index afc8311582106..74d495199ea8a 100644 --- a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/repository/repository/PageablePersonRepository.java +++ b/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/repository/repository/PageablePersonRepository.java @@ -1,8 +1,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.microsoft.azure.spring.data.cosmosdb.repository.repository; +package com.azure.spring.data.cosmos.repository.repository; -import com.microsoft.azure.spring.data.cosmosdb.domain.PageablePerson; +import com.azure.spring.data.cosmos.domain.PageablePerson; import org.springframework.data.repository.PagingAndSortingRepository; import org.springframework.stereotype.Repository; diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/repository/repository/PartitionPersonRepository.java b/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/repository/repository/PartitionPersonRepository.java similarity index 53% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/repository/repository/PartitionPersonRepository.java rename to sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/repository/repository/PartitionPersonRepository.java index f88f6eb54b799..df1a33f88ae17 100644 --- a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/repository/repository/PartitionPersonRepository.java +++ b/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/repository/repository/PartitionPersonRepository.java @@ -1,9 +1,9 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.microsoft.azure.spring.data.cosmosdb.repository.repository; +package com.azure.spring.data.cosmos.repository.repository; -import com.microsoft.azure.spring.data.cosmosdb.domain.PartitionPerson; -import com.microsoft.azure.spring.data.cosmosdb.repository.CosmosRepository; +import com.azure.spring.data.cosmos.repository.CosmosRepository; +import com.azure.spring.data.cosmos.domain.PartitionPerson; import org.springframework.stereotype.Repository; @Repository diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/repository/repository/PersonRepository.java b/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/repository/repository/PersonRepository.java similarity index 52% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/repository/repository/PersonRepository.java rename to sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/repository/repository/PersonRepository.java index 95cbe3ecc6812..11c63be3e4afa 100644 --- a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/repository/repository/PersonRepository.java +++ b/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/repository/repository/PersonRepository.java @@ -1,9 +1,9 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.microsoft.azure.spring.data.cosmosdb.repository.repository; +package com.azure.spring.data.cosmos.repository.repository; -import com.microsoft.azure.spring.data.cosmosdb.domain.Person; -import com.microsoft.azure.spring.data.cosmosdb.repository.CosmosRepository; +import com.azure.spring.data.cosmos.repository.CosmosRepository; +import com.azure.spring.data.cosmos.domain.Person; import org.springframework.stereotype.Repository; @Repository diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/repository/repository/ProjectRepository.java b/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/repository/repository/ProjectRepository.java similarity index 93% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/repository/repository/ProjectRepository.java rename to sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/repository/repository/ProjectRepository.java index a8b0049754df1..c930ca9d8486e 100644 --- a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/repository/repository/ProjectRepository.java +++ b/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/repository/repository/ProjectRepository.java @@ -1,9 +1,9 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.microsoft.azure.spring.data.cosmosdb.repository.repository; +package com.azure.spring.data.cosmos.repository.repository; -import com.microsoft.azure.spring.data.cosmosdb.domain.Project; -import com.microsoft.azure.spring.data.cosmosdb.repository.CosmosRepository; +import com.azure.spring.data.cosmos.repository.CosmosRepository; +import com.azure.spring.data.cosmos.domain.Project; import org.springframework.data.domain.Page; import org.springframework.data.domain.Pageable; import org.springframework.data.domain.Sort; diff --git a/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/repository/repository/QuestionRepository.java b/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/repository/repository/QuestionRepository.java new file mode 100644 index 0000000000000..0d043875c1288 --- /dev/null +++ b/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/repository/repository/QuestionRepository.java @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +package com.azure.spring.data.cosmos.repository.repository; + +import com.azure.spring.data.cosmos.repository.CosmosRepository; +import com.azure.spring.data.cosmos.domain.Question; + +public interface QuestionRepository extends CosmosRepository { +} diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/repository/repository/ReactiveCourseRepository.java b/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/repository/repository/ReactiveCourseRepository.java similarity index 59% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/repository/repository/ReactiveCourseRepository.java rename to sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/repository/repository/ReactiveCourseRepository.java index 6ad3a66ea4b41..50f589f4b31eb 100644 --- a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/repository/repository/ReactiveCourseRepository.java +++ b/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/repository/repository/ReactiveCourseRepository.java @@ -1,9 +1,9 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.microsoft.azure.spring.data.cosmosdb.repository.repository; +package com.azure.spring.data.cosmos.repository.repository; -import com.microsoft.azure.spring.data.cosmosdb.domain.Course; -import com.microsoft.azure.spring.data.cosmosdb.repository.ReactiveCosmosRepository; +import com.azure.spring.data.cosmos.repository.ReactiveCosmosRepository; +import com.azure.spring.data.cosmos.domain.Course; import reactor.core.publisher.Flux; import java.util.Collection; diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/repository/repository/SortedProjectRepository.java b/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/repository/repository/SortedProjectRepository.java similarity index 75% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/repository/repository/SortedProjectRepository.java rename to sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/repository/repository/SortedProjectRepository.java index b6606d8fe59b8..e841aaab8d2c4 100644 --- a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/repository/repository/SortedProjectRepository.java +++ b/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/repository/repository/SortedProjectRepository.java @@ -1,9 +1,9 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.microsoft.azure.spring.data.cosmosdb.repository.repository; +package com.azure.spring.data.cosmos.repository.repository; -import com.microsoft.azure.spring.data.cosmosdb.domain.SortedProject; -import com.microsoft.azure.spring.data.cosmosdb.repository.CosmosRepository; +import com.azure.spring.data.cosmos.repository.CosmosRepository; +import com.azure.spring.data.cosmos.domain.SortedProject; import org.springframework.data.domain.Page; import org.springframework.data.domain.Pageable; import org.springframework.data.domain.Sort; diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/repository/repository/SquareRepository.java b/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/repository/repository/SquareRepository.java similarity index 51% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/repository/repository/SquareRepository.java rename to sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/repository/repository/SquareRepository.java index 295f881e24a69..0026cc7b8ad13 100644 --- a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/repository/repository/SquareRepository.java +++ b/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/repository/repository/SquareRepository.java @@ -1,9 +1,9 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.microsoft.azure.spring.data.cosmosdb.repository.repository; +package com.azure.spring.data.cosmos.repository.repository; -import com.microsoft.azure.spring.data.cosmosdb.domain.inheritance.Square; -import com.microsoft.azure.spring.data.cosmosdb.repository.CosmosRepository; +import com.azure.spring.data.cosmos.repository.CosmosRepository; +import com.azure.spring.data.cosmos.domain.inheritance.Square; import org.springframework.stereotype.Repository; @Repository diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/repository/repository/StudentRepository.java b/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/repository/repository/StudentRepository.java similarity index 83% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/repository/repository/StudentRepository.java rename to sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/repository/repository/StudentRepository.java index 4428770df3734..f8039bc21388b 100644 --- a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/repository/repository/StudentRepository.java +++ b/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/repository/repository/StudentRepository.java @@ -1,9 +1,9 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.microsoft.azure.spring.data.cosmosdb.repository.repository; +package com.azure.spring.data.cosmos.repository.repository; -import com.microsoft.azure.spring.data.cosmosdb.domain.Student; -import com.microsoft.azure.spring.data.cosmosdb.repository.CosmosRepository; +import com.azure.spring.data.cosmos.repository.CosmosRepository; +import com.azure.spring.data.cosmos.domain.Student; import org.springframework.stereotype.Repository; import java.util.List; diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/repository/support/CosmosEntityInformationUnitTest.java b/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/repository/support/CosmosEntityInformationUnitTest.java similarity index 95% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/repository/support/CosmosEntityInformationUnitTest.java rename to sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/repository/support/CosmosEntityInformationUnitTest.java index e22e573c6d5ac..3a5ecd362fe30 100644 --- a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/repository/support/CosmosEntityInformationUnitTest.java +++ b/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/repository/support/CosmosEntityInformationUnitTest.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.microsoft.azure.spring.data.cosmosdb.repository.support; - -import com.microsoft.azure.spring.data.cosmosdb.common.TestConstants; -import com.microsoft.azure.spring.data.cosmosdb.core.mapping.Document; -import com.microsoft.azure.spring.data.cosmosdb.core.mapping.PartitionKey; -import com.microsoft.azure.spring.data.cosmosdb.domain.Address; -import com.microsoft.azure.spring.data.cosmosdb.domain.Person; -import com.microsoft.azure.spring.data.cosmosdb.domain.Student; +package com.azure.spring.data.cosmos.repository.support; + +import com.azure.spring.data.cosmos.core.mapping.Document; +import com.azure.spring.data.cosmos.core.mapping.PartitionKey; +import com.azure.spring.data.cosmos.common.TestConstants; +import com.azure.spring.data.cosmos.domain.Address; +import com.azure.spring.data.cosmos.domain.Person; +import com.azure.spring.data.cosmos.domain.Student; import org.junit.Test; import org.springframework.data.annotation.Version; diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/repository/support/CosmosRepositoryFactoryBeanUnitTest.java b/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/repository/support/CosmosRepositoryFactoryBeanUnitTest.java similarity index 79% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/repository/support/CosmosRepositoryFactoryBeanUnitTest.java rename to sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/repository/support/CosmosRepositoryFactoryBeanUnitTest.java index e6bbdcaf57874..cb205d625cc98 100644 --- a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/repository/support/CosmosRepositoryFactoryBeanUnitTest.java +++ b/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/repository/support/CosmosRepositoryFactoryBeanUnitTest.java @@ -1,9 +1,9 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.microsoft.azure.spring.data.cosmosdb.repository.support; +package com.azure.spring.data.cosmos.repository.support; -import com.microsoft.azure.spring.data.cosmosdb.core.CosmosTemplate; -import com.microsoft.azure.spring.data.cosmosdb.repository.repository.PersonRepository; +import com.azure.spring.data.cosmos.core.CosmosTemplate; +import com.azure.spring.data.cosmos.repository.repository.PersonRepository; import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.Mock; diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/repository/support/CosmosRepositoryFactoryUnitTest.java b/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/repository/support/CosmosRepositoryFactoryUnitTest.java similarity index 83% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/repository/support/CosmosRepositoryFactoryUnitTest.java rename to sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/repository/support/CosmosRepositoryFactoryUnitTest.java index b9252c4ca758d..086c9cdb29f73 100644 --- a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/repository/support/CosmosRepositoryFactoryUnitTest.java +++ b/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/repository/support/CosmosRepositoryFactoryUnitTest.java @@ -1,9 +1,9 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.microsoft.azure.spring.data.cosmosdb.repository.support; +package com.azure.spring.data.cosmos.repository.support; -import com.microsoft.azure.spring.data.cosmosdb.core.CosmosTemplate; -import com.microsoft.azure.spring.data.cosmosdb.domain.Person; +import com.azure.spring.data.cosmos.core.CosmosTemplate; +import com.azure.spring.data.cosmos.domain.Person; import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.Mock; diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/resources/application.properties b/sdk/cosmos/azure-spring-data-cosmos/src/test/resources/application.properties similarity index 100% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/test/resources/application.properties rename to sdk/cosmos/azure-spring-data-cosmos/src/test/resources/application.properties diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/resources/application.yml b/sdk/cosmos/azure-spring-data-cosmos/src/test/resources/application.yml similarity index 100% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/test/resources/application.yml rename to sdk/cosmos/azure-spring-data-cosmos/src/test/resources/application.yml diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/resources/logback-test.xml b/sdk/cosmos/azure-spring-data-cosmos/src/test/resources/logback-test.xml similarity index 100% rename from sdk/cosmos/azure-spring-data-cosmosdb/src/test/resources/logback-test.xml rename to sdk/cosmos/azure-spring-data-cosmos/src/test/resources/logback-test.xml diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/CHANGELOG.md b/sdk/cosmos/azure-spring-data-cosmosdb/CHANGELOG.md deleted file mode 100644 index d98c3d0f2282e..0000000000000 --- a/sdk/cosmos/azure-spring-data-cosmosdb/CHANGELOG.md +++ /dev/null @@ -1,3 +0,0 @@ -# Release History - -## 2.3.1-beta.1 (Unreleased) diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/resources/META-INF/spring.factories b/sdk/cosmos/azure-spring-data-cosmosdb/src/main/resources/META-INF/spring.factories deleted file mode 100644 index 1884afe05dff4..0000000000000 --- a/sdk/cosmos/azure-spring-data-cosmosdb/src/main/resources/META-INF/spring.factories +++ /dev/null @@ -1 +0,0 @@ -org.springframework.data.repository.core.support.RepositoryFactorySupport=com.microsoft.azure.spring.data.cosmosdb.repository.support.CosmosRepositoryFactory \ No newline at end of file diff --git a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/repository/repository/QuestionRepository.java b/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/repository/repository/QuestionRepository.java deleted file mode 100644 index 0e27bd1381e0b..0000000000000 --- a/sdk/cosmos/azure-spring-data-cosmosdb/src/test/java/com/microsoft/azure/spring/data/cosmosdb/repository/repository/QuestionRepository.java +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.microsoft.azure.spring.data.cosmosdb.repository.repository; - -import com.microsoft.azure.spring.data.cosmosdb.domain.Question; -import com.microsoft.azure.spring.data.cosmosdb.repository.CosmosRepository; - -public interface QuestionRepository extends CosmosRepository { -} diff --git a/sdk/cosmos/ci.yml b/sdk/cosmos/ci.yml index 5fda6a2dcdf85..6791e182ef0e3 100644 --- a/sdk/cosmos/ci.yml +++ b/sdk/cosmos/ci.yml @@ -45,7 +45,7 @@ extends: safeName: azurecosmos - name: spring-data-cosmosdb groupId: com.microsoft.azure - safeName: springdatacosmosdb + safeName: azurespringdatacosmos AdditionalModules: - name: azure-cosmos-benchmark groupId: com.azure diff --git a/sdk/cosmos/pom.xml b/sdk/cosmos/pom.xml index 3ef7f2e8daa9a..025f5523dfa25 100644 --- a/sdk/cosmos/pom.xml +++ b/sdk/cosmos/pom.xml @@ -11,7 +11,7 @@ azure-cosmos azure-cosmos-benchmark - azure-spring-data-cosmosdb + azure-spring-data-cosmos
diff --git a/sdk/spring/azure-spring-boot-starter-cosmosdb/README.md b/sdk/spring/azure-spring-boot-starter-cosmosdb/README.md index c9d20f8580b9e..49a0ee643bf39 100644 --- a/sdk/spring/azure-spring-boot-starter-cosmosdb/README.md +++ b/sdk/spring/azure-spring-boot-starter-cosmosdb/README.md @@ -209,6 +209,6 @@ Find more information about Azure Service Privacy Statement, please check [Micro ## Next steps -Besides using this Azure CosmosDb Spring Boot Starter, you can directly use Spring Data for Azure CosmosDb package for more complex scenarios. Please refer to [Spring Data for Azure CosmosDB](https://github.com/Microsoft/spring-data-cosmosdb) for more details. +Besides using this Azure CosmosDb Spring Boot Starter, you can directly use Spring Data for Azure CosmosDb package for more complex scenarios. Please refer to [Spring Data for Azure CosmosDB](https://github.com/Azure/azure-sdk-for-java/tree/master/sdk/cosmos/azure-spring-data-cosmos) for more details. ## Contributing From 9a509bdf1f241ab84654e1cb43faf56311512d38 Mon Sep 17 00:00:00 2001 From: Azure SDK Bot <53356347+azure-sdk@users.noreply.github.com> Date: Wed, 8 Jul 2020 12:47:51 -0700 Subject: [PATCH 053/129] Sync eng/common directory with azure-sdk-tools repository (#12912) --- eng/common/Update-Change-Log.ps1 | 36 +++++++++++++++++--------------- 1 file changed, 19 insertions(+), 17 deletions(-) diff --git a/eng/common/Update-Change-Log.ps1 b/eng/common/Update-Change-Log.ps1 index d50316f223b7a..a819a05e8bb2e 100644 --- a/eng/common/Update-Change-Log.ps1 +++ b/eng/common/Update-Change-Log.ps1 @@ -27,10 +27,10 @@ function Get-ChangelogPath($Path) { # Check if CHANGELOG.md is present in path $ChangeLogPath = Join-Path -Path $Path -ChildPath "CHANGELOG.md" - if ((Test-Path -Path $ChangeLogPath) -eq $False){ + if ((Test-Path -Path $ChangeLogPath) -eq $False) { # Check if change log exists with name HISTORY.md $ChangeLogPath = Join-Path -Path $Path -ChildPath "HISTORY.md" - if ((Test-Path -Path $ChangeLogPath) -eq $False){ + if ((Test-Path -Path $ChangeLogPath) -eq $False) { Write-Host "Change log is not found in path[$Path]" exit(1) } @@ -45,7 +45,7 @@ function Get-VersionTitle($Version, $Unreleased) { # Generate version title $newVersionTitle = "## $Version $UNRELEASED_TAG" - if ($Unreleased -eq $False){ + if ($Unreleased -eq $False) { $releaseDate = Get-Date -Format "(yyyy-MM-dd)" $newVersionTitle = "## $Version $releaseDate" } @@ -67,10 +67,10 @@ function Get-NewChangeLog( [System.Collections.ArrayList]$ChangelogLines, $Versi # Version increment tool passes replaceversion as False and Unreleased as True $is_version_increment = $ReplaceVersion -eq $False -and $Unreleased -eq $True - for(; $Index -lt $ChangelogLines.Count; $Index++){ - if (Version-Matches($ChangelogLines[$Index])){ + for (; $Index -lt $ChangelogLines.Count; $Index++) { + if (Version-Matches($ChangelogLines[$Index])) { # Find current title in change log - if( -not $CurrentTitle){ + if( -not $CurrentTitle) { $CurrentTitle = $ChangelogLines[$Index] $CurrentIndex = $Index Write-Host "Current Version title: $CurrentTitle" @@ -80,7 +80,7 @@ function Get-NewChangeLog( [System.Collections.ArrayList]$ChangelogLines, $Versi # update change log script is triggered for all packages with current version for Java ( or any language where version is maintained in common file) # and this can cause an issue if someone changes changelog manually to prepare for release without updating actual version in central version file # Do not add new line or replace existing title when version is already present and script is triggered to add new line - if ($is_version_increment -and $ChangelogLines[$Index].Contains($Version)){ + if ($is_version_increment -and $ChangelogLines[$Index].Contains($Version)) { Write-Host "Version is already present in change log." exit(0) } @@ -90,26 +90,24 @@ function Get-NewChangeLog( [System.Collections.ArrayList]$ChangelogLines, $Versi # Generate version title $newVersionTitle = Get-VersionTitle -Version $Version -Unreleased $Unreleased - if( $newVersionTitle -eq $CurrentTitle){ + if( $newVersionTitle -eq $CurrentTitle) { Write-Host "No change is required in change log. Version is already present." exit(0) } - - - if (($ReplaceVersion -eq $True) -and ($Unreleased -eq $False) -and (-not $CurrentTitle.Contains($UNRELEASED_TAG))){ + if (($ReplaceVersion -eq $True) -and ($Unreleased -eq $False) -and $CurrentTitle.Contains($version) -and (-not $CurrentTitle.Contains($UNRELEASED_TAG))) { Write-Host "Version is already present in change log with a release date." exit(0) } # if current version title already has new version then we should replace title to update it - if ($CurrentTitle.Contains($Version) -and $ReplaceVersion -eq $False){ + if ($CurrentTitle.Contains($Version) -and $ReplaceVersion -eq $False) { Write-Host "Version is already present in title. Updating version title" $ReplaceVersion = $True } # if version is already found and not replacing then nothing to do - if ($ReplaceVersion -eq $False){ + if ($ReplaceVersion -eq $False) { Write-Host "Adding version title $newVersionTitle" $ChangelogLines.insert($CurrentIndex, "") $ChangelogLines.insert($CurrentIndex, "") @@ -121,24 +119,28 @@ function Get-NewChangeLog( [System.Collections.ArrayList]$ChangelogLines, $Versi $ChangelogLines[$CurrentIndex] = $newVersionTitle } - return $ChangelogLines + return $ChangelogLines } # Make sure path is valid -if ((Test-Path -Path $ChangeLogPath) -eq $False){ +if ((Test-Path -Path $ChangeLogPath) -eq $False) { Write-Host "Change log path is invalid. [$ChangeLogPath]" exit(1) } # probe change log path if path is directory -if (Test-Path -Path $ChangeLogPath -PathType Container) -{ +if (Test-Path -Path $ChangeLogPath -PathType Container) { $ChangeLogPath = Get-ChangelogPath -Path $ChangeLogPath } # Read current change logs and add/update version $ChangelogLines = [System.Collections.ArrayList](Get-Content -Path $ChangeLogPath) + +if ($null -eq $ChangelogLines) { + $ChangelogLines = @() +} + $NewContents = Get-NewChangeLog -ChangelogLines $ChangelogLines -Version $Version -Unreleased $Unreleased -ReplaceVersion $ReplaceVersion Write-Host "Writing change log to file [$ChangeLogPath]" From c4b3c17540c579f12d7e7ff7d4607ade60982a26 Mon Sep 17 00:00:00 2001 From: Srikanta <51379715+srnagar@users.noreply.github.com> Date: Wed, 8 Jul 2020 13:44:39 -0700 Subject: [PATCH 054/129] Update versions for EH July release (#12913) * Update versions for EH July release * Update version_client.txt --- eng/jacoco-test-coverage/pom.xml | 4 ++-- eng/versioning/version_client.txt | 6 +++--- .../CHANGELOG.md | 4 ++-- .../README.md | 2 +- .../azure-messaging-eventhubs-checkpointstore-blob/pom.xml | 6 +++--- sdk/eventhubs/azure-messaging-eventhubs/CHANGELOG.md | 5 +++-- sdk/eventhubs/azure-messaging-eventhubs/README.md | 2 +- sdk/eventhubs/azure-messaging-eventhubs/pom.xml | 2 +- .../azure-spring-boot-sample-storage-blob/pom.xml | 2 +- 9 files changed, 17 insertions(+), 16 deletions(-) diff --git a/eng/jacoco-test-coverage/pom.xml b/eng/jacoco-test-coverage/pom.xml index 775fdce6c59df..f19f41a65b502 100644 --- a/eng/jacoco-test-coverage/pom.xml +++ b/eng/jacoco-test-coverage/pom.xml @@ -139,12 +139,12 @@ com.azure azure-messaging-eventhubs - 5.2.0-beta.1 + 5.1.2 com.azure azure-messaging-eventhubs-checkpointstore-blob - 1.2.0-beta.1 + 1.1.2 com.azure diff --git a/eng/versioning/version_client.txt b/eng/versioning/version_client.txt index c4c3bf7c04864..34ea209ae0765 100644 --- a/eng/versioning/version_client.txt +++ b/eng/versioning/version_client.txt @@ -28,15 +28,15 @@ com.azure:azure-data-tables;1.0.0-beta.1;1.0.0-beta.1 com.azure:azure-e2e;1.0.0-beta.1;1.0.0-beta.1 com.azure:azure-identity;1.0.8;1.1.0-beta.6 com.azure:azure-identity-perf;1.0.0-beta.1;1.0.0-beta.1 -com.azure:azure-messaging-eventhubs;5.1.1;5.2.0-beta.1 -com.azure:azure-messaging-eventhubs-checkpointstore-blob;1.1.1;1.2.0-beta.1 +com.azure:azure-messaging-eventhubs;5.1.1;5.1.2 +com.azure:azure-messaging-eventhubs-checkpointstore-blob;1.1.1;1.1.2 com.azure:azure-messaging-servicebus;7.0.0-beta.3;7.0.0-beta.4 com.azure:azure-search-documents;1.0.0-beta.4;11.0.0 com.azure:azure-security-keyvault-certificates;4.0.4;4.1.0-beta.4 com.azure:azure-security-keyvault-keys;4.1.4;4.2.0-beta.5 com.azure:azure-security-keyvault-secrets;4.1.4;4.2.0-beta.4 com.azure:azure-sdk-template;1.0.4-beta.19;1.0.4-beta.20 -com.azure:azure-storage-blob;12.8.0-beta.1;12.8.0-beta.2 +com.azure:azure-storage-blob;12.7.0;12.8.0-beta.2 com.azure:azure-storage-blob-batch;12.6.0-beta.1;12.6.0-beta.2 com.azure:azure-storage-blob-changefeed;12.0.0-beta.1;12.0.0-beta.2 com.azure:azure-storage-blob-cryptography;12.8.0-beta.1;12.8.0-beta.2 diff --git a/sdk/eventhubs/azure-messaging-eventhubs-checkpointstore-blob/CHANGELOG.md b/sdk/eventhubs/azure-messaging-eventhubs-checkpointstore-blob/CHANGELOG.md index f1bfc607efe8e..cabb34f3c0bb5 100644 --- a/sdk/eventhubs/azure-messaging-eventhubs-checkpointstore-blob/CHANGELOG.md +++ b/sdk/eventhubs/azure-messaging-eventhubs-checkpointstore-blob/CHANGELOG.md @@ -1,7 +1,7 @@ # Release History -## 1.2.0-beta.1 (Unreleased) - +## 1.1.2 (2020-07-08) +- Updated dependency version of `azure-messaging-eventhubs` to `5.1.2` ## 1.1.1 (2020-06-12) - Updated dependency version of `azure-messaging-eventhubs` to `5.1.1` diff --git a/sdk/eventhubs/azure-messaging-eventhubs-checkpointstore-blob/README.md b/sdk/eventhubs/azure-messaging-eventhubs-checkpointstore-blob/README.md index ffe6d59c2ab56..4ce717a44c16b 100644 --- a/sdk/eventhubs/azure-messaging-eventhubs-checkpointstore-blob/README.md +++ b/sdk/eventhubs/azure-messaging-eventhubs-checkpointstore-blob/README.md @@ -27,7 +27,7 @@ documentation][event_hubs_product_docs] | [Samples][sample_examples] com.azure azure-messaging-eventhubs-checkpointstore-blob - 1.1.1 + 1.1.2 ``` [//]: # ({x-version-update-end}) diff --git a/sdk/eventhubs/azure-messaging-eventhubs-checkpointstore-blob/pom.xml b/sdk/eventhubs/azure-messaging-eventhubs-checkpointstore-blob/pom.xml index 4c11b5e81cf0c..735e6628de1f6 100644 --- a/sdk/eventhubs/azure-messaging-eventhubs-checkpointstore-blob/pom.xml +++ b/sdk/eventhubs/azure-messaging-eventhubs-checkpointstore-blob/pom.xml @@ -17,7 +17,7 @@ com.azure azure-messaging-eventhubs-checkpointstore-blob - 1.2.0-beta.1 + 1.1.2 Microsoft Azure client library for storing checkpoints in Storage Blobs Library for using storing checkpoints in Storage Blobs @@ -40,12 +40,12 @@ com.azure azure-messaging-eventhubs - 5.2.0-beta.1 + 5.1.2 com.azure azure-storage-blob - 12.8.0-beta.1 + 12.7.0 diff --git a/sdk/eventhubs/azure-messaging-eventhubs/CHANGELOG.md b/sdk/eventhubs/azure-messaging-eventhubs/CHANGELOG.md index b1bc3161fa097..f3684e8f8d3b9 100644 --- a/sdk/eventhubs/azure-messaging-eventhubs/CHANGELOG.md +++ b/sdk/eventhubs/azure-messaging-eventhubs/CHANGELOG.md @@ -1,7 +1,8 @@ # Release History -## 5.2.0-beta.1 (Unreleased) - +## 5.1.2 (2020-07-08) +- Updated dependency version of `azure-core-amqp` which has a bug fix for updating User Agent string format. +- Fix bug where batch receive handler runs on non-blocking thread and fails on blocking calls. ## 5.1.1 (2020-06-12) - Fix bug where receiver link fails to add credits to new links created after an existing link is closed. diff --git a/sdk/eventhubs/azure-messaging-eventhubs/README.md b/sdk/eventhubs/azure-messaging-eventhubs/README.md index 8b7987c75542d..032e6312ba21a 100644 --- a/sdk/eventhubs/azure-messaging-eventhubs/README.md +++ b/sdk/eventhubs/azure-messaging-eventhubs/README.md @@ -59,7 +59,7 @@ documentation][event_hubs_product_docs] | [Samples][sample_examples] com.azure azure-messaging-eventhubs - 5.1.1 + 5.1.2 ``` [//]: # ({x-version-update-end}) diff --git a/sdk/eventhubs/azure-messaging-eventhubs/pom.xml b/sdk/eventhubs/azure-messaging-eventhubs/pom.xml index 7d0f5adbebb57..5218c2d2d5a79 100644 --- a/sdk/eventhubs/azure-messaging-eventhubs/pom.xml +++ b/sdk/eventhubs/azure-messaging-eventhubs/pom.xml @@ -14,7 +14,7 @@ com.azure azure-messaging-eventhubs - 5.2.0-beta.1 + 5.1.2 Microsoft Azure client library for Event Hubs Libraries built on Microsoft Azure Event Hubs diff --git a/sdk/spring/azure-spring-boot-samples/azure-spring-boot-sample-storage-blob/pom.xml b/sdk/spring/azure-spring-boot-samples/azure-spring-boot-sample-storage-blob/pom.xml index edc525785e1b7..f8f4145b82f80 100644 --- a/sdk/spring/azure-spring-boot-samples/azure-spring-boot-sample-storage-blob/pom.xml +++ b/sdk/spring/azure-spring-boot-samples/azure-spring-boot-sample-storage-blob/pom.xml @@ -30,7 +30,7 @@ com.azure azure-storage-blob - 12.8.0-beta.1 + 12.7.0 From 2f4f39fd4a79a1b92dac79e5b408b59adb8f4c11 Mon Sep 17 00:00:00 2001 From: Kushagra Thapar Date: Wed, 8 Jul 2020 14:58:40 -0700 Subject: [PATCH 055/129] Added script logging enabled API to CosmosStoredProcedureRequestOptions (#12917) * Added script logging enabled API to CosmosStoredProcedureRequestOptions * Fixed java 8 compilation issue * Updated getScriptLog API to decode before returning the response * Added default value to java docs --- .../StoredProcedureResponse.java | 3 +- .../azure/cosmos/implementation/Utils.java | 18 +++++++ .../CosmosStoredProcedureRequestOptions.java | 28 ++++++++++ .../cosmos/CosmosSyncStoredProcTest.java | 54 ++++++++++++++++--- .../rx/StoredProcedureUpsertReplaceTest.java | 33 ++++++++++++ 5 files changed, 129 insertions(+), 7 deletions(-) diff --git a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/StoredProcedureResponse.java b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/StoredProcedureResponse.java index 90c50a5b0a174..02f2c869ed287 100644 --- a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/StoredProcedureResponse.java +++ b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/StoredProcedureResponse.java @@ -123,7 +123,8 @@ public String getResponseAsString() { * @return the output string from the stored procedure console.log() statements. */ public String getScriptLog() { - return this.response.getResponseHeaders().get(HttpConstants.HttpHeaders.SCRIPT_LOG_RESULTS); + String scriptLog = this.response.getResponseHeaders().get(HttpConstants.HttpHeaders.SCRIPT_LOG_RESULTS); + return Utils.decodeAsUTF8String(scriptLog); } /** diff --git a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/Utils.java b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/Utils.java index b0809bd7eb988..d91327ff08ed4 100644 --- a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/Utils.java +++ b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/Utils.java @@ -16,6 +16,8 @@ import com.fasterxml.jackson.databind.node.ObjectNode; import com.fasterxml.jackson.module.afterburner.AfterburnerModule; import io.netty.buffer.ByteBuf; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import java.io.ByteArrayOutputStream; import java.io.IOException; @@ -23,6 +25,7 @@ import java.io.UnsupportedEncodingException; import java.net.URI; import java.net.URISyntaxException; +import java.net.URLDecoder; import java.net.URLEncoder; import java.nio.ByteBuffer; import java.nio.charset.StandardCharsets; @@ -46,6 +49,9 @@ * This is meant to be internally used only by our sdk. */ public class Utils { + + private final static Logger logger = LoggerFactory.getLogger(Utils.class); + private static final int ONE_KB = 1024; private static final ZoneId GMT_ZONE_ID = ZoneId.of("GMT"); public static final Base64.Encoder Base64Encoder = Base64.getEncoder(); @@ -94,6 +100,18 @@ public static String encodeBase64String(byte[] binaryData) { return encodedString; } + public static String decodeAsUTF8String(String inputString) { + if (inputString == null || inputString.isEmpty()) { + return inputString; + } + try { + return URLDecoder.decode(inputString, StandardCharsets.UTF_8.toString()); + } catch (UnsupportedEncodingException e) { + logger.warn("Error while decoding input string", e); + return inputString; + } + } + /** * Checks whether the specified link is Name based or not * diff --git a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/CosmosStoredProcedureRequestOptions.java b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/CosmosStoredProcedureRequestOptions.java index b68fe54ff8735..23d680ebfca83 100644 --- a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/CosmosStoredProcedureRequestOptions.java +++ b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/CosmosStoredProcedureRequestOptions.java @@ -14,6 +14,7 @@ public final class CosmosStoredProcedureRequestOptions { private String sessionToken; private String ifMatchETag; private String ifNoneMatchETag; + private boolean scriptLoggingEnabled; /** * Gets the If-Match (ETag) associated with the request in the Azure Cosmos DB service. @@ -115,6 +116,32 @@ public CosmosStoredProcedureRequestOptions setSessionToken(String sessionToken) return this; } + /** + * Gets whether Javascript stored procedure logging is enabled for the current request in the Azure Cosmos DB database + * service or not. + * + * Default value is false + * + * @return true if Javascript stored procedure logging is enabled + */ + public boolean isScriptLoggingEnabled() { + return scriptLoggingEnabled; + } + + /** + * Sets whether Javascript stored procedure logging is enabled for the current request in the Azure Cosmos DB database + * service or not. + * + * Default value is false + * + * @param scriptLoggingEnabled true if stored procedure Javascript logging is enabled + * @return the CosmosStoredProcedureRequestOptions. + */ + public CosmosStoredProcedureRequestOptions setScriptLoggingEnabled(boolean scriptLoggingEnabled) { + this.scriptLoggingEnabled = scriptLoggingEnabled; + return this; + } + RequestOptions toRequestOptions() { RequestOptions requestOptions = new RequestOptions(); requestOptions.setIfMatchETag(getIfMatchETag()); @@ -122,6 +149,7 @@ RequestOptions toRequestOptions() { requestOptions.setConsistencyLevel(getConsistencyLevel()); requestOptions.setPartitionKey(partitionKey); requestOptions.setSessionToken(sessionToken); + requestOptions.setScriptLoggingEnabled(scriptLoggingEnabled); return requestOptions; } } diff --git a/sdk/cosmos/azure-cosmos/src/test/java/com/azure/cosmos/CosmosSyncStoredProcTest.java b/sdk/cosmos/azure-cosmos/src/test/java/com/azure/cosmos/CosmosSyncStoredProcTest.java index b05aeeea486e6..f4d84f3e3a6a9 100644 --- a/sdk/cosmos/azure-cosmos/src/test/java/com/azure/cosmos/CosmosSyncStoredProcTest.java +++ b/sdk/cosmos/azure-cosmos/src/test/java/com/azure/cosmos/CosmosSyncStoredProcTest.java @@ -17,6 +17,8 @@ import org.testng.annotations.Factory; import org.testng.annotations.Test; +import java.net.URLDecoder; +import java.nio.charset.StandardCharsets; import java.util.ArrayList; import java.util.List; import java.util.UUID; @@ -148,19 +150,59 @@ public void deleteStoredProcedure() throws Exception { } @Test(groups = {"simple"}, timeOut = TIMEOUT) public void executeStoredProcedure() throws Exception { - CosmosStoredProcedureProperties sproc = new CosmosStoredProcedureProperties( + CosmosStoredProcedureProperties storedProcedure = new CosmosStoredProcedureProperties( UUID.randomUUID().toString(), - "function() {var x = 10;}" - ); - - CosmosStoredProcedureResponse response = container.getScripts().createStoredProcedure(sproc); + "function() {" + + " var mytext = \"x\";" + + " var myval = 1;" + + " try {" + + " console.log(\"The value of %s is %s.\", mytext, myval);" + + " getContext().getResponse().setBody(\"Success!\");" + + " }" + + " catch(err) {" + + " getContext().getResponse().setBody(\"inline err: [\" + err.number + \"] \" + err);" + + " }" + + "}"); + + container.getScripts().createStoredProcedure(storedProcedure); CosmosStoredProcedureRequestOptions options = new CosmosStoredProcedureRequestOptions(); options.setPartitionKey(PartitionKey.NONE); CosmosStoredProcedureResponse executeResponse = container.getScripts() - .getStoredProcedure(sproc.getId()) + .getStoredProcedure(storedProcedure.getId()) .execute(null, options); assertThat(executeResponse.getActivityId()).isNotEmpty(); + assertThat(executeResponse.getScriptLog()).isNull(); + } + + @Test(groups = "simple", timeOut = TIMEOUT) + public void executeStoredProcedureWithScriptLoggingEnabled() throws Exception { + // Create a stored procedure + CosmosStoredProcedureProperties storedProcedure = new CosmosStoredProcedureProperties( + UUID.randomUUID().toString(), + "function() {" + + " var mytext = \"x\";" + + " var myval = 1;" + + " try {" + + " console.log(\"The value of %s is %s.\", mytext, myval);" + + " getContext().getResponse().setBody(\"Success!\");" + + " }" + + " catch(err) {" + + " getContext().getResponse().setBody(\"inline err: [\" + err.number + \"] \" + err);" + + " }" + + "}"); + + container.getScripts().createStoredProcedure(storedProcedure); + CosmosStoredProcedureRequestOptions options = new CosmosStoredProcedureRequestOptions(); + options.setScriptLoggingEnabled(true); + options.setPartitionKey(PartitionKey.NONE); + + CosmosStoredProcedureResponse executeResponse = container.getScripts() + .getStoredProcedure(storedProcedure.getId()) + .execute(null, options); + + String logResult = "The value of x is 1."; + assertThat(executeResponse.getScriptLog()).isEqualTo(logResult); } @Test(groups = {"simple"}, timeOut = TIMEOUT) diff --git a/sdk/cosmos/azure-cosmos/src/test/java/com/azure/cosmos/rx/StoredProcedureUpsertReplaceTest.java b/sdk/cosmos/azure-cosmos/src/test/java/com/azure/cosmos/rx/StoredProcedureUpsertReplaceTest.java index fc32d95fb5011..f943f28f21e6f 100644 --- a/sdk/cosmos/azure-cosmos/src/test/java/com/azure/cosmos/rx/StoredProcedureUpsertReplaceTest.java +++ b/sdk/cosmos/azure-cosmos/src/test/java/com/azure/cosmos/rx/StoredProcedureUpsertReplaceTest.java @@ -18,6 +18,8 @@ import org.testng.annotations.Test; import reactor.core.publisher.Mono; +import java.net.URLDecoder; +import java.nio.charset.StandardCharsets; import java.util.UUID; import static org.assertj.core.api.Assertions.assertThat; @@ -92,6 +94,37 @@ public void executeStoredProcedure() throws Exception { assertThat(result).isEqualTo("\"0123456789\""); } + @Test(groups = "simple", timeOut = TIMEOUT) + public void executeStoredProcedureWithScriptLoggingEnabled() throws Exception { + // Create a stored procedure + CosmosStoredProcedureProperties storedProcedure = new CosmosStoredProcedureProperties( + UUID.randomUUID().toString(), + "function() {" + + " var mytext = \"x\";" + + " var myval = 1;" + + " try {" + + " console.log(\"The value of %s is %s.\", mytext, myval);" + + " getContext().getResponse().setBody(\"Success!\");" + + " }" + + " catch(err) {" + + " getContext().getResponse().setBody(\"inline err: [\" + err.number + \"] \" + err);" + + " }" + + "}"); + + createdCollection.getScripts().createStoredProcedure(storedProcedure).block(); + CosmosStoredProcedureRequestOptions options = new CosmosStoredProcedureRequestOptions(); + options.setScriptLoggingEnabled(true); + options.setPartitionKey(PartitionKey.NONE); + + CosmosStoredProcedureResponse executeResponse = createdCollection.getScripts() + .getStoredProcedure(storedProcedure.getId()) + .execute(null, options).block(); + + String logResult = "The value of x is 1."; + assert executeResponse != null; + assertThat(executeResponse.getScriptLog()).isEqualTo(logResult); + } + @BeforeClass(groups = { "simple" }, timeOut = SETUP_TIMEOUT) public void before_StoredProcedureUpsertReplaceTest() { client = getClientBuilder().buildAsyncClient(); From 2c6eb8aeaeea9c7359d3d397f1be27c6b113c1da Mon Sep 17 00:00:00 2001 From: Naveen Singh Date: Wed, 8 Jul 2020 18:31:59 -0400 Subject: [PATCH 056/129] Creating yml file for ctl image build ci (#12926) * creating yml file for ctl image build ci * Update ctl-image-build.yml Co-authored-by: James Suplizio --- .../ctl-image-build.yml | 45 +++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 sdk/cosmos/azure-cosmos-benchmark/ctl-image-build.yml diff --git a/sdk/cosmos/azure-cosmos-benchmark/ctl-image-build.yml b/sdk/cosmos/azure-cosmos-benchmark/ctl-image-build.yml new file mode 100644 index 0000000000000..e49bb7f1634c9 --- /dev/null +++ b/sdk/cosmos/azure-cosmos-benchmark/ctl-image-build.yml @@ -0,0 +1,45 @@ +jobs: + - job: Cosmos CTL + timeoutInMinutes: 20 + variables: + - template: /eng/pipelines/templates/variables/globals.yml + pool: + vmImage: 'ubuntu-18.04' + + # java-cosmos-container-registry-pwd + variables: + ContainerRegistryName: 'javactl' + ContainerRegistryUserName: 'javactl' + ContainerRegistryUrl: 'javactl.azurecr.io' + + steps: + - task: Maven@3 + displayName: 'Build Cosmos and Benchmark' + inputs: + mavenPomFile: pom.xml + jdkVersionOption: $(JavaBuildVersion) + jdkArchitectureOption: 'x64' + # The -Ppackage-assembly profile packages up both libraries into one package + options: '$(DefaultOptions) -Ppackage-assembly -DskipTests -Dgpg.skip -Dmaven.javadoc.skip=true -Dcheckstyle.skip=true -Dspotbugs.skip=true -Drevapi.skip=true -pl com.azure:azure-cosmos,com.azure:azure-cosmos-benchmark' + + - task: CopyFiles@2 + displayName: 'Copy benchmark jar' + inputs: + SourceFolder: '$(build.sourcesdirectory)/sdk/cosmos/azure-cosmos-benchmark/target' + Contents: '*' + TargetFolder: $(Agent.TempDirectory)/ctl + + - task: CopyFiles@2 + displayName: 'Copy docker config files' + inputs: + SourceFolder: '$(build.sourcesdirectory)/sdk/cosmos/azure-cosmos-benchmark/ctl' + TargetFolder: $(Agent.TempDirectory)/ctl + + # Below will build the image and push it to azure container registry + - pwsh: | + cd $(Agent.TempDirectory)/ctl + docker build . -t java-ctl + az acr login --name $(ContainerRegistryName) -u $(ContainerRegistryUserName) -p $(java-cosmos-container-registry-pwd) + docker tag java-ctl $(ContainerRegistryUrl)/javactl/benchmark + docker push $(ContainerRegistryUrl)/javactl/benchmark + displayName: 'Build and push docker image to registry' From 7a9d5f5a3855085f7a99d5aaee49eb324ffe9a99 Mon Sep 17 00:00:00 2001 From: Srikanta <51379715+srnagar@users.noreply.github.com> Date: Wed, 8 Jul 2020 15:42:57 -0700 Subject: [PATCH 057/129] Revert storabge blob version in version_client.txt (#12928) --- eng/versioning/version_client.txt | 2 +- .../azure-messaging-eventhubs-checkpointstore-blob/pom.xml | 2 +- .../azure-spring-boot-sample-storage-blob/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/eng/versioning/version_client.txt b/eng/versioning/version_client.txt index 34ea209ae0765..f33ba1c580816 100644 --- a/eng/versioning/version_client.txt +++ b/eng/versioning/version_client.txt @@ -36,7 +36,7 @@ com.azure:azure-security-keyvault-certificates;4.0.4;4.1.0-beta.4 com.azure:azure-security-keyvault-keys;4.1.4;4.2.0-beta.5 com.azure:azure-security-keyvault-secrets;4.1.4;4.2.0-beta.4 com.azure:azure-sdk-template;1.0.4-beta.19;1.0.4-beta.20 -com.azure:azure-storage-blob;12.7.0;12.8.0-beta.2 +com.azure:azure-storage-blob;12.8.0-beta.1;12.8.0-beta.2 com.azure:azure-storage-blob-batch;12.6.0-beta.1;12.6.0-beta.2 com.azure:azure-storage-blob-changefeed;12.0.0-beta.1;12.0.0-beta.2 com.azure:azure-storage-blob-cryptography;12.8.0-beta.1;12.8.0-beta.2 diff --git a/sdk/eventhubs/azure-messaging-eventhubs-checkpointstore-blob/pom.xml b/sdk/eventhubs/azure-messaging-eventhubs-checkpointstore-blob/pom.xml index 735e6628de1f6..b8cef0ab4f3c7 100644 --- a/sdk/eventhubs/azure-messaging-eventhubs-checkpointstore-blob/pom.xml +++ b/sdk/eventhubs/azure-messaging-eventhubs-checkpointstore-blob/pom.xml @@ -45,7 +45,7 @@ com.azure azure-storage-blob - 12.7.0 + 12.8.0-beta.1 diff --git a/sdk/spring/azure-spring-boot-samples/azure-spring-boot-sample-storage-blob/pom.xml b/sdk/spring/azure-spring-boot-samples/azure-spring-boot-sample-storage-blob/pom.xml index f8f4145b82f80..edc525785e1b7 100644 --- a/sdk/spring/azure-spring-boot-samples/azure-spring-boot-sample-storage-blob/pom.xml +++ b/sdk/spring/azure-spring-boot-samples/azure-spring-boot-sample-storage-blob/pom.xml @@ -30,7 +30,7 @@ com.azure azure-storage-blob - 12.7.0 + 12.8.0-beta.1 From a1800e51d120655ba499e127648124ae32558445 Mon Sep 17 00:00:00 2001 From: Azure SDK Bot <53356347+azure-sdk@users.noreply.github.com> Date: Wed, 8 Jul 2020 15:54:51 -0700 Subject: [PATCH 058/129] Increment version for eventhubs releases (#12927) * Increment package version after release of com.azure azure-messaging-eventhubs-checkpointstore-blob * Increment package version after release of com.azure azure-messaging-eventhubs --- eng/jacoco-test-coverage/pom.xml | 4 ++-- eng/versioning/version_client.txt | 4 ++-- .../CHANGELOG.md | 3 +++ .../azure-messaging-eventhubs-checkpointstore-blob/pom.xml | 4 ++-- sdk/eventhubs/azure-messaging-eventhubs/CHANGELOG.md | 3 +++ sdk/eventhubs/azure-messaging-eventhubs/pom.xml | 2 +- 6 files changed, 13 insertions(+), 7 deletions(-) diff --git a/eng/jacoco-test-coverage/pom.xml b/eng/jacoco-test-coverage/pom.xml index f19f41a65b502..775fdce6c59df 100644 --- a/eng/jacoco-test-coverage/pom.xml +++ b/eng/jacoco-test-coverage/pom.xml @@ -139,12 +139,12 @@ com.azure azure-messaging-eventhubs - 5.1.2 + 5.2.0-beta.1 com.azure azure-messaging-eventhubs-checkpointstore-blob - 1.1.2 + 1.2.0-beta.1 com.azure diff --git a/eng/versioning/version_client.txt b/eng/versioning/version_client.txt index f33ba1c580816..d943d534d3e8d 100644 --- a/eng/versioning/version_client.txt +++ b/eng/versioning/version_client.txt @@ -28,8 +28,8 @@ com.azure:azure-data-tables;1.0.0-beta.1;1.0.0-beta.1 com.azure:azure-e2e;1.0.0-beta.1;1.0.0-beta.1 com.azure:azure-identity;1.0.8;1.1.0-beta.6 com.azure:azure-identity-perf;1.0.0-beta.1;1.0.0-beta.1 -com.azure:azure-messaging-eventhubs;5.1.1;5.1.2 -com.azure:azure-messaging-eventhubs-checkpointstore-blob;1.1.1;1.1.2 +com.azure:azure-messaging-eventhubs;5.1.2;5.2.0-beta.1 +com.azure:azure-messaging-eventhubs-checkpointstore-blob;1.1.2;1.2.0-beta.1 com.azure:azure-messaging-servicebus;7.0.0-beta.3;7.0.0-beta.4 com.azure:azure-search-documents;1.0.0-beta.4;11.0.0 com.azure:azure-security-keyvault-certificates;4.0.4;4.1.0-beta.4 diff --git a/sdk/eventhubs/azure-messaging-eventhubs-checkpointstore-blob/CHANGELOG.md b/sdk/eventhubs/azure-messaging-eventhubs-checkpointstore-blob/CHANGELOG.md index cabb34f3c0bb5..8096798b8c952 100644 --- a/sdk/eventhubs/azure-messaging-eventhubs-checkpointstore-blob/CHANGELOG.md +++ b/sdk/eventhubs/azure-messaging-eventhubs-checkpointstore-blob/CHANGELOG.md @@ -1,5 +1,8 @@ # Release History +## 1.2.0-beta.1 (Unreleased) + + ## 1.1.2 (2020-07-08) - Updated dependency version of `azure-messaging-eventhubs` to `5.1.2` diff --git a/sdk/eventhubs/azure-messaging-eventhubs-checkpointstore-blob/pom.xml b/sdk/eventhubs/azure-messaging-eventhubs-checkpointstore-blob/pom.xml index b8cef0ab4f3c7..4c11b5e81cf0c 100644 --- a/sdk/eventhubs/azure-messaging-eventhubs-checkpointstore-blob/pom.xml +++ b/sdk/eventhubs/azure-messaging-eventhubs-checkpointstore-blob/pom.xml @@ -17,7 +17,7 @@ com.azure azure-messaging-eventhubs-checkpointstore-blob - 1.1.2 + 1.2.0-beta.1 Microsoft Azure client library for storing checkpoints in Storage Blobs Library for using storing checkpoints in Storage Blobs @@ -40,7 +40,7 @@ com.azure azure-messaging-eventhubs - 5.1.2 + 5.2.0-beta.1 com.azure diff --git a/sdk/eventhubs/azure-messaging-eventhubs/CHANGELOG.md b/sdk/eventhubs/azure-messaging-eventhubs/CHANGELOG.md index f3684e8f8d3b9..ff15808af8dac 100644 --- a/sdk/eventhubs/azure-messaging-eventhubs/CHANGELOG.md +++ b/sdk/eventhubs/azure-messaging-eventhubs/CHANGELOG.md @@ -1,5 +1,8 @@ # Release History +## 5.2.0-beta.1 (Unreleased) + + ## 5.1.2 (2020-07-08) - Updated dependency version of `azure-core-amqp` which has a bug fix for updating User Agent string format. - Fix bug where batch receive handler runs on non-blocking thread and fails on blocking calls. diff --git a/sdk/eventhubs/azure-messaging-eventhubs/pom.xml b/sdk/eventhubs/azure-messaging-eventhubs/pom.xml index 5218c2d2d5a79..7d0f5adbebb57 100644 --- a/sdk/eventhubs/azure-messaging-eventhubs/pom.xml +++ b/sdk/eventhubs/azure-messaging-eventhubs/pom.xml @@ -14,7 +14,7 @@ com.azure azure-messaging-eventhubs - 5.1.2 + 5.2.0-beta.1 Microsoft Azure client library for Event Hubs Libraries built on Microsoft Azure Event Hubs From 1007365bcf5421266e495b5d7ae124ffd04bdc49 Mon Sep 17 00:00:00 2001 From: Daniel Jurek Date: Wed, 8 Jul 2020 15:55:59 -0700 Subject: [PATCH 059/129] Use proper variable syntax (#12930) --- .../azure-cosmos-benchmark/ctl-image-build.yml | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/sdk/cosmos/azure-cosmos-benchmark/ctl-image-build.yml b/sdk/cosmos/azure-cosmos-benchmark/ctl-image-build.yml index e49bb7f1634c9..c8ac3fe5ebd0c 100644 --- a/sdk/cosmos/azure-cosmos-benchmark/ctl-image-build.yml +++ b/sdk/cosmos/azure-cosmos-benchmark/ctl-image-build.yml @@ -3,15 +3,16 @@ jobs: timeoutInMinutes: 20 variables: - template: /eng/pipelines/templates/variables/globals.yml + - name: ContainerRegistryName + value: 'javactl' + - name: ContainerRegistryUserName + value: 'javactl' + - name: ContainerRegistryUrl + value: 'javactl.azurecr.io' + pool: vmImage: 'ubuntu-18.04' - # java-cosmos-container-registry-pwd - variables: - ContainerRegistryName: 'javactl' - ContainerRegistryUserName: 'javactl' - ContainerRegistryUrl: 'javactl.azurecr.io' - steps: - task: Maven@3 displayName: 'Build Cosmos and Benchmark' From e896387644f44c32430ab6fdc6292c798b05cfdf Mon Sep 17 00:00:00 2001 From: James Suplizio Date: Wed, 8 Jul 2020 18:13:55 -0700 Subject: [PATCH 060/129] Tweaking the Java Cosmos CTL pipeline yml (#12933) * adding goal to the maven build command * update job * add -am switch to maven command line --- sdk/cosmos/azure-cosmos-benchmark/ctl-image-build.yml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/sdk/cosmos/azure-cosmos-benchmark/ctl-image-build.yml b/sdk/cosmos/azure-cosmos-benchmark/ctl-image-build.yml index c8ac3fe5ebd0c..1927756e5432e 100644 --- a/sdk/cosmos/azure-cosmos-benchmark/ctl-image-build.yml +++ b/sdk/cosmos/azure-cosmos-benchmark/ctl-image-build.yml @@ -1,5 +1,5 @@ jobs: - - job: Cosmos CTL + - job: Cosmos_CTL timeoutInMinutes: 20 variables: - template: /eng/pipelines/templates/variables/globals.yml @@ -18,10 +18,13 @@ jobs: displayName: 'Build Cosmos and Benchmark' inputs: mavenPomFile: pom.xml + goals: 'package' + # The -Ppackage-assembly profile packages up both libraries into one package + options: '$(DefaultOptions) -Ppackage-assembly -DskipTests -Dgpg.skip -Dmaven.javadoc.skip=true -Dcheckstyle.skip=true -Dspotbugs.skip=true -Drevapi.skip=true -pl com.azure:azure-cosmos,com.azure:azure-cosmos-benchmark -am' + javaHomeOption: 'JDKVersion' jdkVersionOption: $(JavaBuildVersion) jdkArchitectureOption: 'x64' - # The -Ppackage-assembly profile packages up both libraries into one package - options: '$(DefaultOptions) -Ppackage-assembly -DskipTests -Dgpg.skip -Dmaven.javadoc.skip=true -Dcheckstyle.skip=true -Dspotbugs.skip=true -Drevapi.skip=true -pl com.azure:azure-cosmos,com.azure:azure-cosmos-benchmark' + publishJUnitResults: false - task: CopyFiles@2 displayName: 'Copy benchmark jar' From 46e87cfae0a87881ed9e5572ee8a753ff776547e Mon Sep 17 00:00:00 2001 From: Yi Liu Date: Thu, 9 Jul 2020 09:37:04 +0800 Subject: [PATCH 061/129] add CONTRIBUTING.MD for azure-spring-boot (#12901) --- sdk/spring/CONTRIBUTING.md | 74 ++++++++++++++++++++++++++++++++++++++ sdk/spring/README.md | 2 +- 2 files changed, 75 insertions(+), 1 deletion(-) create mode 100644 sdk/spring/CONTRIBUTING.md diff --git a/sdk/spring/CONTRIBUTING.md b/sdk/spring/CONTRIBUTING.md new file mode 100644 index 0000000000000..87b09e0025e9f --- /dev/null +++ b/sdk/spring/CONTRIBUTING.md @@ -0,0 +1,74 @@ +# Contributing + +This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License +Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For +details, visit https://cla.microsoft.com. + +When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate +the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to +do this once across all repositories using our CLA. + +## Code of conduct + +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. + +## Getting started + +Before working on a contribution, it would be beneficial to familiarize yourself with the project so that your +submission is consistent with the project standards and is ready to be accepted with fewer changes requested. + +- [Azure Spring Boot README](./README.md), to learn more about the overall project and processes used. + +## Development environment setup + +### Prerequisites + +- Java Development Kit (JDK) with version 8 or above +- [Maven][maven] +- Git +- Microsoft Azure subscription + - You can create a free account at: https://azure.microsoft.com + +## Building from source + +To build the project, open a command prompt/terminal: +1. Execute `git clone https://github.com/Azure/azure-sdk-for-java.git` +1. Traverse to the spring directory: + * `cd sdk\spring` +1. Build the product by executing: + * `mvn clean package -DskipTests` + +## Running tests + +After following instructions above, you can run the +unit tests by executing: +```shell +mvn clean test +``` + +For unit tests, there are no special considerations; these are self-contained and execute locally without any reliance +on external resources. These tests are run for all PR validations. + + +## FAQ + +When building Spring Boot project, if it fails on the sample `azure-spring-boot-sample-servicebus`, please deploy the +`com.azure:azure-messaging-servicebus` to your local repository manually by: +```shell +cd sdk\servicebus\azure-messaging-service +mvn clean install -DskipTests +``` +This is because the version of `com.azure:azure-messaging-servicebus` library the sample depends on is from this SDK +repository instead of Maven. + +## Version management +Developing version naming convention is like `0.1.2-beta.1`. Release version naming convention is like `0.1.2`. + +## Contribute to code +Contribution is welcome. Please follow +[this instruction](https://github.com/Azure/azure-sdk-for-java/blob/master/CONTRIBUTING.md) to contribute code. + + +[maven]: https://maven.apache.org/ diff --git a/sdk/spring/README.md b/sdk/spring/README.md index 3c908180e6644..3948797d4a82d 100644 --- a/sdk/spring/README.md +++ b/sdk/spring/README.md @@ -59,7 +59,7 @@ You could check below articles to learn more on usage of specific starters. ## Contributing This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.microsoft.com. -Please follow [instructions here](https://github.com/Azure/azure-sdk-for-java/blob/master/CONTRIBUTING.md) to build from source or contribute. +Please follow [instructions here](./CONTRIBUTING.md) to build from source or contribute. ### Filing Issues From 08bba182f92ec95c0cfd28655e2ed621d27821ba Mon Sep 17 00:00:00 2001 From: Jianghao Lu Date: Wed, 8 Jul 2020 18:48:20 -0700 Subject: [PATCH 062/129] Increment azure core version to 1.7.0-beta.2 (#12958) * Increment azure core version to 1.7.0-beta.2 * core management & change log --- eng/jacoco-test-coverage/pom.xml | 2 +- eng/versioning/version_client.txt | 2 +- sdk/core/azure-core-amqp/pom.xml | 2 +- sdk/core/azure-core-experimental/pom.xml | 2 +- sdk/core/azure-core-http-jdk-httpclient/pom.xml | 4 ++-- sdk/core/azure-core-http-netty/pom.xml | 4 ++-- sdk/core/azure-core-http-okhttp/pom.xml | 4 ++-- sdk/core/azure-core-management/pom.xml | 2 +- sdk/core/azure-core-serializer-avro-apache/pom.xml | 2 +- sdk/core/azure-core-serializer-avro-jackson/pom.xml | 2 +- sdk/core/azure-core-serializer-json-gson/pom.xml | 2 +- sdk/core/azure-core-serializer-json-jackson/pom.xml | 2 +- sdk/core/azure-core-test/pom.xml | 2 +- sdk/core/azure-core-tracing-opentelemetry/pom.xml | 2 +- sdk/core/azure-core/CHANGELOG.md | 5 ++++- sdk/core/azure-core/pom.xml | 2 +- sdk/e2e/pom.xml | 2 +- 17 files changed, 23 insertions(+), 20 deletions(-) diff --git a/eng/jacoco-test-coverage/pom.xml b/eng/jacoco-test-coverage/pom.xml index 775fdce6c59df..e1f940f5e687c 100644 --- a/eng/jacoco-test-coverage/pom.xml +++ b/eng/jacoco-test-coverage/pom.xml @@ -49,7 +49,7 @@ com.azure azure-core - 1.7.0-beta.1 + 1.7.0-beta.2 com.azure diff --git a/eng/versioning/version_client.txt b/eng/versioning/version_client.txt index d943d534d3e8d..748e073e4a9d3 100644 --- a/eng/versioning/version_client.txt +++ b/eng/versioning/version_client.txt @@ -6,7 +6,7 @@ com.azure:azure-sdk-parent;1.6.0;1.6.0 com.azure:azure-client-sdk-parent;1.7.0;1.7.0 com.azure:azure-ai-formrecognizer;1.0.0-beta.4;1.0.0-beta.5 com.azure:azure-ai-textanalytics;1.0.1;1.1.0-beta.1 -com.azure:azure-core;1.6.0;1.7.0-beta.1 +com.azure:azure-core;1.6.0;1.7.0-beta.2 com.azure:azure-core-amqp;1.3.0;1.4.0-beta.1 com.azure:azure-core-experimental;1.0.0-beta.1;1.0.0-beta.2 com.azure:azure-core-http-jdk-httpclient;1.0.0-beta.1;1.0.0-beta.1 diff --git a/sdk/core/azure-core-amqp/pom.xml b/sdk/core/azure-core-amqp/pom.xml index a9161b7cdca29..52cbd49021fc9 100644 --- a/sdk/core/azure-core-amqp/pom.xml +++ b/sdk/core/azure-core-amqp/pom.xml @@ -58,7 +58,7 @@ com.azure azure-core - 1.7.0-beta.1 + 1.7.0-beta.2 com.microsoft.azure diff --git a/sdk/core/azure-core-experimental/pom.xml b/sdk/core/azure-core-experimental/pom.xml index 5f4a23951b9c7..40c95bbb8d700 100644 --- a/sdk/core/azure-core-experimental/pom.xml +++ b/sdk/core/azure-core-experimental/pom.xml @@ -58,7 +58,7 @@ com.azure azure-core - 1.7.0-beta.1 + 1.7.0-beta.2 diff --git a/sdk/core/azure-core-http-jdk-httpclient/pom.xml b/sdk/core/azure-core-http-jdk-httpclient/pom.xml index e57873d883858..d16188286a221 100644 --- a/sdk/core/azure-core-http-jdk-httpclient/pom.xml +++ b/sdk/core/azure-core-http-jdk-httpclient/pom.xml @@ -62,14 +62,14 @@ com.azure azure-core - 1.7.0-beta.1 + 1.7.0-beta.2 com.azure azure-core - 1.7.0-beta.1 + 1.7.0-beta.2 test-jar test diff --git a/sdk/core/azure-core-http-netty/pom.xml b/sdk/core/azure-core-http-netty/pom.xml index 1f42d05153771..b72986cae4356 100644 --- a/sdk/core/azure-core-http-netty/pom.xml +++ b/sdk/core/azure-core-http-netty/pom.xml @@ -60,7 +60,7 @@ com.azure azure-core - 1.7.0-beta.1 + 1.7.0-beta.2 @@ -117,7 +117,7 @@ com.azure azure-core - 1.7.0-beta.1 + 1.7.0-beta.2 test-jar test diff --git a/sdk/core/azure-core-http-okhttp/pom.xml b/sdk/core/azure-core-http-okhttp/pom.xml index d4abbfc69a89b..7a320cc730891 100644 --- a/sdk/core/azure-core-http-okhttp/pom.xml +++ b/sdk/core/azure-core-http-okhttp/pom.xml @@ -60,7 +60,7 @@ com.azure azure-core - 1.7.0-beta.1 + 1.7.0-beta.2 @@ -73,7 +73,7 @@ com.azure azure-core - 1.7.0-beta.1 + 1.7.0-beta.2 test-jar test diff --git a/sdk/core/azure-core-management/pom.xml b/sdk/core/azure-core-management/pom.xml index d289d4e28b1c1..cc2f63d127911 100644 --- a/sdk/core/azure-core-management/pom.xml +++ b/sdk/core/azure-core-management/pom.xml @@ -59,7 +59,7 @@ com.azure azure-core - 1.7.0-beta.1 + 1.7.0-beta.2 diff --git a/sdk/core/azure-core-serializer-avro-apache/pom.xml b/sdk/core/azure-core-serializer-avro-apache/pom.xml index a5b115a6b4105..cdc26f0ca9528 100644 --- a/sdk/core/azure-core-serializer-avro-apache/pom.xml +++ b/sdk/core/azure-core-serializer-avro-apache/pom.xml @@ -58,7 +58,7 @@ com.azure azure-core - 1.7.0-beta.1 + 1.7.0-beta.2 com.azure diff --git a/sdk/core/azure-core-serializer-avro-jackson/pom.xml b/sdk/core/azure-core-serializer-avro-jackson/pom.xml index 5c41d67aa0df9..c1fc1800e024c 100644 --- a/sdk/core/azure-core-serializer-avro-jackson/pom.xml +++ b/sdk/core/azure-core-serializer-avro-jackson/pom.xml @@ -58,7 +58,7 @@ com.azure azure-core - 1.7.0-beta.1 + 1.7.0-beta.2 com.azure diff --git a/sdk/core/azure-core-serializer-json-gson/pom.xml b/sdk/core/azure-core-serializer-json-gson/pom.xml index ec9d869d0b215..4e83fcebd97d9 100644 --- a/sdk/core/azure-core-serializer-json-gson/pom.xml +++ b/sdk/core/azure-core-serializer-json-gson/pom.xml @@ -58,7 +58,7 @@ com.azure azure-core - 1.7.0-beta.1 + 1.7.0-beta.2 com.azure diff --git a/sdk/core/azure-core-serializer-json-jackson/pom.xml b/sdk/core/azure-core-serializer-json-jackson/pom.xml index 137d27d00b1e5..e6207c7420b2c 100644 --- a/sdk/core/azure-core-serializer-json-jackson/pom.xml +++ b/sdk/core/azure-core-serializer-json-jackson/pom.xml @@ -58,7 +58,7 @@ com.azure azure-core - 1.7.0-beta.1 + 1.7.0-beta.2 com.azure diff --git a/sdk/core/azure-core-test/pom.xml b/sdk/core/azure-core-test/pom.xml index cdb3b25016ec1..8364cdb34d29f 100644 --- a/sdk/core/azure-core-test/pom.xml +++ b/sdk/core/azure-core-test/pom.xml @@ -37,7 +37,7 @@ com.azure azure-core - 1.7.0-beta.1 + 1.7.0-beta.2 diff --git a/sdk/core/azure-core-tracing-opentelemetry/pom.xml b/sdk/core/azure-core-tracing-opentelemetry/pom.xml index 3453676b9731a..0b06941e1d5cb 100644 --- a/sdk/core/azure-core-tracing-opentelemetry/pom.xml +++ b/sdk/core/azure-core-tracing-opentelemetry/pom.xml @@ -40,7 +40,7 @@ com.azure azure-core - 1.7.0-beta.1 + 1.7.0-beta.2 diff --git a/sdk/core/azure-core/CHANGELOG.md b/sdk/core/azure-core/CHANGELOG.md index c3a2c734ee587..b31f801746025 100644 --- a/sdk/core/azure-core/CHANGELOG.md +++ b/sdk/core/azure-core/CHANGELOG.md @@ -1,7 +1,10 @@ # Release History -## 1.7.0-beta.1 (Unreleased) +## 1.7.0-beta.2 (Unreleased) +## 1.7.0-beta.1 (2020-07-08) + +- Added `TokenRefreshOptions()` to `TokenCredential`, with a default token refresh offset of 2 minutes, and a default token refresh retry timeout of 30 seconds. ## 1.6.0 (2020-07-02) diff --git a/sdk/core/azure-core/pom.xml b/sdk/core/azure-core/pom.xml index 258109d8751ad..e085c9e8a8790 100644 --- a/sdk/core/azure-core/pom.xml +++ b/sdk/core/azure-core/pom.xml @@ -15,7 +15,7 @@ com.azure azure-core jar - 1.7.0-beta.1 + 1.7.0-beta.2 Microsoft Azure Java Core Library This package contains core types for Azure Java clients. diff --git a/sdk/e2e/pom.xml b/sdk/e2e/pom.xml index 9a6e3aaaf8966..c6508af00fd60 100644 --- a/sdk/e2e/pom.xml +++ b/sdk/e2e/pom.xml @@ -23,7 +23,7 @@ com.azure azure-core - 1.7.0-beta.1 + 1.7.0-beta.2 com.azure From 5399396896fa3b4488d38ee3178bbf9109fab3f0 Mon Sep 17 00:00:00 2001 From: Connie Yau Date: Wed, 8 Jul 2020 18:55:16 -0700 Subject: [PATCH 063/129] Close message processor downstream. (#12921) * Use dispose. * Fixing test. --- .../servicebus/ServiceBusAsyncConsumer.java | 2 +- .../ServiceBusAsyncConsumerTest.java | 52 +++++++++++-------- 2 files changed, 31 insertions(+), 23 deletions(-) diff --git a/sdk/servicebus/azure-messaging-servicebus/src/main/java/com/azure/messaging/servicebus/ServiceBusAsyncConsumer.java b/sdk/servicebus/azure-messaging-servicebus/src/main/java/com/azure/messaging/servicebus/ServiceBusAsyncConsumer.java index 1f3bb0bffdb42..590fb39637fab 100644 --- a/sdk/servicebus/azure-messaging-servicebus/src/main/java/com/azure/messaging/servicebus/ServiceBusAsyncConsumer.java +++ b/sdk/servicebus/azure-messaging-servicebus/src/main/java/com/azure/messaging/servicebus/ServiceBusAsyncConsumer.java @@ -77,7 +77,7 @@ Mono updateDisposition(String lockToken, DispositionStatus dispositionStat @Override public void close() { if (!isDisposed.getAndSet(true)) { - linkProcessor.cancel(); + linkProcessor.dispose(); } } } diff --git a/sdk/servicebus/azure-messaging-servicebus/src/test/java/com/azure/messaging/servicebus/ServiceBusAsyncConsumerTest.java b/sdk/servicebus/azure-messaging-servicebus/src/test/java/com/azure/messaging/servicebus/ServiceBusAsyncConsumerTest.java index 97bd84a354205..e0925bdb2d30b 100644 --- a/sdk/servicebus/azure-messaging-servicebus/src/test/java/com/azure/messaging/servicebus/ServiceBusAsyncConsumerTest.java +++ b/sdk/servicebus/azure-messaging-servicebus/src/test/java/com/azure/messaging/servicebus/ServiceBusAsyncConsumerTest.java @@ -11,7 +11,6 @@ import com.azure.messaging.servicebus.implementation.ServiceBusAmqpConnection; import com.azure.messaging.servicebus.implementation.ServiceBusReceiveLink; import com.azure.messaging.servicebus.implementation.ServiceBusReceiveLinkProcessor; -import org.apache.qpid.proton.amqp.messaging.Accepted; import org.apache.qpid.proton.amqp.transport.DeliveryState; import org.apache.qpid.proton.message.Message; import org.junit.jupiter.api.AfterAll; @@ -24,11 +23,10 @@ import org.mockito.Mockito; import org.mockito.MockitoAnnotations; import reactor.core.Disposable; -import reactor.core.publisher.EmitterProcessor; import reactor.core.publisher.Flux; -import reactor.core.publisher.FluxSink; import reactor.core.publisher.Mono; import reactor.test.StepVerifier; +import reactor.test.publisher.TestPublisher; import java.time.Duration; import java.util.UUID; @@ -45,10 +43,13 @@ */ class ServiceBusAsyncConsumerTest { private static final String LINK_NAME = "some-link"; - private final EmitterProcessor messageProcessor = EmitterProcessor.create(); - private final FluxSink messageProcessorSink = messageProcessor.sink(); - private final EmitterProcessor endpointProcessor = EmitterProcessor.create(); - private final FluxSink endpointProcessorSink = endpointProcessor.sink(); + private final TestPublisher linkPublisher = TestPublisher.create(); + private final Flux linkFlux = linkPublisher.flux(); + private final TestPublisher messagePublisher = TestPublisher.create(); + private final Flux messageFlux = messagePublisher.flux(); + private final TestPublisher endpointPublisher = TestPublisher.create(); + private final Flux endpointStateFlux = endpointPublisher.flux(); + private final ClientLogger logger = new ClientLogger(ServiceBusAsyncConsumer.class); private ServiceBusReceiveLinkProcessor linkProcessor; @@ -80,13 +81,10 @@ void setup(TestInfo testInfo) { MockitoAnnotations.initMocks(this); - when(link.getEndpointStates()).thenReturn(endpointProcessor); - when(link.receive()).thenReturn(messageProcessor); - linkProcessor = Flux.create(sink -> sink.onRequest(requested -> { - logger.info("Requested link: {}", requested); - sink.next(link); - })).subscribeWith(new ServiceBusReceiveLinkProcessor(10, retryPolicy, parentConnection, - new AmqpErrorContext("a-namespace"))); + when(link.getEndpointStates()).thenReturn(endpointStateFlux); + when(link.receive()).thenReturn(messageFlux); + linkProcessor = linkFlux.subscribeWith(new ServiceBusReceiveLinkProcessor(10, retryPolicy, + parentConnection, new AmqpErrorContext("a-namespace"))); when(connection.getEndpointStates()).thenReturn(Flux.create(sink -> sink.next(AmqpEndpointState.ACTIVE))); when(link.updateDisposition(anyString(), any(DeliveryState.class))).thenReturn(Mono.empty()); @@ -97,6 +95,11 @@ void teardown(TestInfo testInfo) { logger.info("[{}]: Tearing down.", testInfo.getDisplayName()); Mockito.framework().clearInlineMocks(); + + linkProcessor.dispose(); + linkPublisher.complete(); + endpointPublisher.complete(); + messagePublisher.complete(); } /** @@ -122,9 +125,13 @@ void receiveNoAutoComplete() { // Act and Assert StepVerifier.create(consumer.receive()) - .then(() -> messageProcessorSink.next(message1)) + .then(() -> { + linkPublisher.next(link); + endpointPublisher.next(AmqpEndpointState.ACTIVE); + messagePublisher.next(message1); + }) .expectNext(receivedMessage1) - .then(() -> messageProcessorSink.next(message2)) + .then(() -> messagePublisher.next(message2)) .expectNext(receivedMessage2) .thenCancel() .verify(); @@ -139,9 +146,6 @@ void receiveNoAutoComplete() { void canDispose() { // Arrange final String lockToken = UUID.randomUUID().toString(); - when(linkProcessor.updateDisposition(lockToken, Accepted.getInstance())) - .thenReturn(Mono.error(new IllegalArgumentException("Should not have called complete."))); - final ServiceBusAsyncConsumer consumer = new ServiceBusAsyncConsumer(LINK_NAME, linkProcessor, serializer); final Message message1 = mock(Message.class); @@ -153,11 +157,15 @@ void canDispose() { // Act and Assert StepVerifier.create(consumer.receive()) .then(() -> { - endpointProcessorSink.next(AmqpEndpointState.ACTIVE); - messageProcessorSink.next(message1); + linkPublisher.next(link); + endpointPublisher.next(AmqpEndpointState.ACTIVE); + messagePublisher.next(message1); }) .expectNext(receivedMessage1) - .then(() -> consumer.close()) + .then(() -> { + linkPublisher.complete(); + endpointPublisher.complete(); + }) .verifyComplete(); verify(link, never()).updateDisposition(anyString(), any(DeliveryState.class)); From d2719b25cf982b7528e40ca14106e5b5a149f20b Mon Sep 17 00:00:00 2001 From: Chidozie Ononiwu <31145988+chidozieononiwu@users.noreply.github.com> Date: Wed, 8 Jul 2020 19:00:59 -0700 Subject: [PATCH 064/129] Clean up repository resources (#12892) --- .../templates/steps/daily-dev-build-variable.yml | 12 ++++++++++++ eng/pipelines/client.yml | 8 -------- eng/pipelines/docindex.yml | 12 ++---------- .../templates/jobs/archetype-sdk-client.yml | 2 +- eng/pipelines/templates/jobs/archetype-sdk-data.yml | 2 +- .../templates/jobs/archetype-sdk-pom-only.yml | 2 +- .../templates/stages/archetype-sdk-client.yml | 5 ----- .../templates/stages/archetype-sdk-data.yml | 5 ----- .../templates/stages/archetype-sdk-pom-only.yml | 5 ----- eng/pipelines/templates/stages/cosmos-sdk-client.yml | 5 ----- 10 files changed, 17 insertions(+), 41 deletions(-) create mode 100644 eng/common/pipelines/templates/steps/daily-dev-build-variable.yml diff --git a/eng/common/pipelines/templates/steps/daily-dev-build-variable.yml b/eng/common/pipelines/templates/steps/daily-dev-build-variable.yml new file mode 100644 index 0000000000000..2e10f695c9987 --- /dev/null +++ b/eng/common/pipelines/templates/steps/daily-dev-build-variable.yml @@ -0,0 +1,12 @@ +# This script fragment is used across our repos to set a variable "SetDevVersion" which +# is used when this pipeline is going to be generating and publishing daily dev builds. + +steps: +- pwsh: | + $setDailyDevBuild = "false" + if (('$(Build.Reason)' -eq 'Schedule') -and ('$(System.TeamProject)' -eq 'internal')) { + $setDailyDevBuild = "true" + } + echo "##vso[task.setvariable variable=SetDevVersion]$setDailyDevBuild" + displayName: "Setup Versioning Properties" + condition: eq(variables['SetDevVersion'], '') diff --git a/eng/pipelines/client.yml b/eng/pipelines/client.yml index 65e51ad9d8e7d..b5ed0d6fc4626 100644 --- a/eng/pipelines/client.yml +++ b/eng/pipelines/client.yml @@ -4,14 +4,6 @@ trigger: - master -resources: - repositories: - - repository: azure-sdk-tools - type: github - name: Azure/azure-sdk-tools - endpoint: azure - ref: refs/tags/azure-sdk-tools_20200618.1 - variables: DefaultOptions: '--batch-mode --fail-at-end -Dmaven.wagon.http.pool=false --settings eng/settings.xml' LoggingOptions: '-Dorg.slf4j.simpleLogger.defaultLogLevel=error -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn' diff --git a/eng/pipelines/docindex.yml b/eng/pipelines/docindex.yml index 89fa6c311098f..add650b3cc4d6 100644 --- a/eng/pipelines/docindex.yml +++ b/eng/pipelines/docindex.yml @@ -1,11 +1,3 @@ -resources: - repositories: - - repository: azure-sdk-tools - type: github - name: azure/azure-sdk-tools - ref: refs/tags/azure-sdk-tools_20200618.1 - endpoint: azure - jobs: - job: CreateDocIndex variables: @@ -18,7 +10,7 @@ jobs: inputs: versionSpec: '3.6' - - template: eng/pipelines/templates/scripts/replace-relative-links.yml@azure-sdk-tools + - template: /eng/common/pipelines/templates/steps/replace-relative-links.yml parameters: TargetFolder: . RootFolder: . @@ -39,7 +31,7 @@ jobs: displayName: 'Use Python 3.6' inputs: versionSpec: '3.6' - - template: eng/pipelines/templates/scripts/mashup-doc-index.yml@azure-sdk-tools + - template: /eng/common/pipelines/templates/steps/mashup-doc-index.yml parameters: SourceDirectory: $(Build.SourcesDirectory) - task: CopyFiles@2 diff --git a/eng/pipelines/templates/jobs/archetype-sdk-client.yml b/eng/pipelines/templates/jobs/archetype-sdk-client.yml index 99ced06cfdb73..23e1e2c3d3941 100644 --- a/eng/pipelines/templates/jobs/archetype-sdk-client.yml +++ b/eng/pipelines/templates/jobs/archetype-sdk-client.yml @@ -64,7 +64,7 @@ jobs: inputs: versionSpec: '3.6' - - template: tools/daily-dev-build-variable/daily-dev-build-variable.yml@azure-sdk-tools + - template: /eng/common/pipelines/templates/steps/daily-dev-build-variable.yml - ${{ each artifact in parameters.Artifacts }}: - script: | diff --git a/eng/pipelines/templates/jobs/archetype-sdk-data.yml b/eng/pipelines/templates/jobs/archetype-sdk-data.yml index 5a17aee93df90..c0b0eb195c5ae 100644 --- a/eng/pipelines/templates/jobs/archetype-sdk-data.yml +++ b/eng/pipelines/templates/jobs/archetype-sdk-data.yml @@ -55,7 +55,7 @@ jobs: inputs: versionSpec: '3.6' - - template: tools/daily-dev-build-variable/daily-dev-build-variable.yml@azure-sdk-tools + - template: /eng/common/pipelines/templates/steps/daily-dev-build-variable.yml - ${{ each artifact in parameters.Artifacts }}: - script: | diff --git a/eng/pipelines/templates/jobs/archetype-sdk-pom-only.yml b/eng/pipelines/templates/jobs/archetype-sdk-pom-only.yml index 314aa903aae86..c912ac39997f1 100644 --- a/eng/pipelines/templates/jobs/archetype-sdk-pom-only.yml +++ b/eng/pipelines/templates/jobs/archetype-sdk-pom-only.yml @@ -29,7 +29,7 @@ jobs: inputs: versionSpec: '3.6' - - template: tools/daily-dev-build-variable/daily-dev-build-variable.yml@azure-sdk-tools + - template: /eng/common/pipelines/templates/steps/daily-dev-build-variable.yml - script: | pip install setuptools wheel diff --git a/eng/pipelines/templates/stages/archetype-sdk-client.yml b/eng/pipelines/templates/stages/archetype-sdk-client.yml index dee81478feccf..3f57cf4450bd2 100644 --- a/eng/pipelines/templates/stages/archetype-sdk-client.yml +++ b/eng/pipelines/templates/stages/archetype-sdk-client.yml @@ -4,11 +4,6 @@ resources: type: git name: internal/azure-sdk-build-tools ref: refs/tags/azure-sdk-build-tools_20200618.4 - - repository: azure-sdk-tools - type: github - name: Azure/azure-sdk-tools - endpoint: azure - ref: refs/tags/azure-sdk-tools_20200618.1 parameters: - name: Artifacts diff --git a/eng/pipelines/templates/stages/archetype-sdk-data.yml b/eng/pipelines/templates/stages/archetype-sdk-data.yml index e98003657c37b..f0348c56ac18c 100644 --- a/eng/pipelines/templates/stages/archetype-sdk-data.yml +++ b/eng/pipelines/templates/stages/archetype-sdk-data.yml @@ -4,11 +4,6 @@ resources: type: git name: internal/azure-sdk-build-tools ref: refs/tags/azure-sdk-build-tools_20200618.4 - - repository: azure-sdk-tools - type: github - name: Azure/azure-sdk-tools - endpoint: azure - ref: refs/tags/azure-sdk-tools_20200618.1 parameters: - name: Artifacts diff --git a/eng/pipelines/templates/stages/archetype-sdk-pom-only.yml b/eng/pipelines/templates/stages/archetype-sdk-pom-only.yml index dfb4a0ff63726..32fec8a1900c5 100644 --- a/eng/pipelines/templates/stages/archetype-sdk-pom-only.yml +++ b/eng/pipelines/templates/stages/archetype-sdk-pom-only.yml @@ -4,11 +4,6 @@ resources: type: git name: internal/azure-sdk-build-tools ref: refs/tags/azure-sdk-build-tools_20200618.4 - - repository: azure-sdk-tools - type: github - name: Azure/azure-sdk-tools - endpoint: azure - ref: refs/tags/azure-sdk-tools_20200618.1 parameters: - name: Artifacts diff --git a/eng/pipelines/templates/stages/cosmos-sdk-client.yml b/eng/pipelines/templates/stages/cosmos-sdk-client.yml index d59a746bd1bc7..d135774c22dce 100644 --- a/eng/pipelines/templates/stages/cosmos-sdk-client.yml +++ b/eng/pipelines/templates/stages/cosmos-sdk-client.yml @@ -4,11 +4,6 @@ resources: type: git name: internal/azure-sdk-build-tools ref: refs/tags/azure-sdk-build-tools_20200618.4 - - repository: azure-sdk-tools - type: github - name: Azure/azure-sdk-tools - endpoint: azure - ref: refs/tags/azure-sdk-tools_20200618.1 parameters: - name: Artifacts From 23b351726bcc1c68f976ee66b345fe91663f4357 Mon Sep 17 00:00:00 2001 From: Azure SDK Bot <53356347+azure-sdk@users.noreply.github.com> Date: Wed, 8 Jul 2020 19:01:10 -0700 Subject: [PATCH 065/129] Sync eng/common directory with azure-sdk-tools repository (#12938) --- eng/common/scripts/Verify-ChangeLog.ps1 | 27 ++++++---- .../scripts/modules/ChangeLog-Operations.psm1 | 51 +++++++++++-------- .../scripts/modules/Package-Properties.psm1 | 36 ++++++++++--- 3 files changed, 76 insertions(+), 38 deletions(-) diff --git a/eng/common/scripts/Verify-ChangeLog.ps1 b/eng/common/scripts/Verify-ChangeLog.ps1 index 7a821a1d54b06..c9ad4d2956441 100644 --- a/eng/common/scripts/Verify-ChangeLog.ps1 +++ b/eng/common/scripts/Verify-ChangeLog.ps1 @@ -15,18 +15,25 @@ $ProgressPreference = "SilentlyContinue" . (Join-Path $PSScriptRoot SemVer.ps1) Import-Module (Join-Path $PSScriptRoot modules ChangeLog-Operations.psm1) -if ((Test-Path $ChangeLogLocation) -and -not([System.String]::IsNullOrEmpty($VersionString))) +$validChangeLog = $false +if ($ChangeLogLocation -and $VersionString) { - Confirm-ChangeLogEntry -ChangeLogLocation $ChangeLogLocation -VersionString $VersionString -ForRelease $ForRelease + $validChangeLog = Confirm-ChangeLogEntry -ChangeLogLocation $ChangeLogLocation -VersionString $VersionString -ForRelease $ForRelease } else { - Import-Module (Join-Path $PSScriptRoot modules Package-Properties.psm1) - if ([System.String]::IsNullOrEmpty($Language)) - { - $Language = $RepoName.Substring($RepoName.LastIndexOf('-') + 1) - } + Import-Module (Join-Path $PSScriptRoot modules Package-Properties.psm1) + if ([System.String]::IsNullOrEmpty($Language)) + { + $Language = $RepoName.Substring($RepoName.LastIndexOf('-') + 1) + } - $PackageProp = Get-PkgProperties -PackageName $PackageName -ServiceName $ServiceName -Language $Language -RepoRoot $RepoRoot - Confirm-ChangeLogEntry -ChangeLogLocation $PackageProp.pkgChangeLogPath -VersionString $PackageProp.pkgVersion -ForRelease $ForRelease -} \ No newline at end of file + $PackageProp = Get-PkgProperties -PackageName $PackageName -ServiceName $ServiceName -Language $Language -RepoRoot $RepoRoot + $validChangeLog = Confirm-ChangeLogEntry -ChangeLogLocation $PackageProp.pkgChangeLogPath -VersionString $PackageProp.pkgVersion -ForRelease $ForRelease +} + +if (!$validChangeLog) { + exit 1 +} + +exit 0 \ No newline at end of file diff --git a/eng/common/scripts/modules/ChangeLog-Operations.psm1 b/eng/common/scripts/modules/ChangeLog-Operations.psm1 index e92070b195b33..5aed584d018b1 100644 --- a/eng/common/scripts/modules/ChangeLog-Operations.psm1 +++ b/eng/common/scripts/modules/ChangeLog-Operations.psm1 @@ -11,8 +11,8 @@ function Get-ChangeLogEntries { $changeLogEntries = @{} if (!(Test-Path $ChangeLogLocation)) { - Write-Host "ChangeLog '{0}' was not found" -f $ChangeLogLocation - exit 1 + Write-Error "ChangeLog[${ChangeLogLocation}] does not exist" + return $null } try { @@ -51,14 +51,12 @@ function Get-ChangeLogEntry { [Parameter(Mandatory = $true)] [String]$VersionString ) - $changeLogEntries = Get-ChangeLogEntries -ChangeLogLocation $ChangeLogLocation - if ($changeLogEntries.ContainsKey($VersionString)) { + if ($changeLogEntries -and $changeLogEntries.ContainsKey($VersionString)) { return $changeLogEntries[$VersionString] } - Write-Error "Release Notes for the Specified version ${VersionString} was not found" - exit 1 + return $null } #Returns the changelog for a particular version as string @@ -70,9 +68,16 @@ function Get-ChangeLogEntryAsString { [String]$VersionString ) - $changeLogEntries = Get-ChangeLogEntry -ChangeLogLocation $ChangeLogLocation -VersionString $VersionString - [string]$releaseTitle = $changeLogEntries.ReleaseTitle - [string]$releaseContent = $changeLogEntries.ReleaseContent -Join [Environment]::NewLine + $changeLogEntry = Get-ChangeLogEntry -ChangeLogLocation $ChangeLogLocation -VersionString $VersionString + return ChangeLogEntryAsString $changeLogEntry +} + +function ChangeLogEntryAsString($changeLogEntry) { + if (!$changeLogEntry) { + return "[Missing change log entry]" + } + [string]$releaseTitle = $changeLogEntry.ReleaseTitle + [string]$releaseContent = $changeLogEntry.ReleaseContent -Join [Environment]::NewLine return $releaseTitle, $releaseContent -Join [Environment]::NewLine } @@ -87,27 +92,33 @@ function Confirm-ChangeLogEntry { $changeLogEntry = Get-ChangeLogEntry -ChangeLogLocation $ChangeLogLocation -VersionString $VersionString + if (!$changeLogEntry) { + Write-Error "ChangeLog[${ChangeLogLocation}] does not have an entry for version ${VersionString}." + return $false + } + + Write-Host "Found the following change log entry for version '${VersionString}' in [${ChangeLogLocation}]." + Write-Host "-----" + Write-Host (ChangeLogEntryAsString $changeLogEntry) + Write-Host "-----" + if ([System.String]::IsNullOrEmpty($changeLogEntry.ReleaseStatus)) { - Write-Host ("##[error]Changelog '{0}' has wrong release note title" -f $ChangeLogLocation) - Write-Host "##[info]Ensure the release date is included i.e. (yyyy-MM-dd) or (Unreleased) if not yet released" - exit 1 + Write-Error "Entry does not have a correct release status. Please ensure the status is set to a date '(yyyy-MM-dd)' or '(Unreleased)' if not yet released." + return $false } if ($ForRelease -eq $True) { if ($changeLogEntry.ReleaseStatus -eq "(Unreleased)") { - Write-Host ("##[error]No release date set. Please set a release date with format 'yyyy-MM-dd' in the heading for version '{0}' in the changelog '{1}'." -f $VersionString, $ChangelogLocation) - exit 1 + Write-Error "Entry has no release date set. Please ensure to set a release date with format 'yyyy-MM-dd'." + return $false } if ([System.String]::IsNullOrWhiteSpace($changeLogEntry.ReleaseContent)) { - Write-Host ("##[error]Empty Release Notes for '{0}' in '{1}'" -f $VersionString, $ChangeLogLocation) - Write-Host "##[info]Please ensure there is a release notes entry before releasing the package." - exit 1 + Write-Error "Entry has no content. Please ensure to provide some content of what changed in this version." + return $false } } - - Write-Host $changeLogEntry.ReleaseTitle - Write-Host $changeLogEntry.ReleaseContent + return $true } Export-ModuleMember -Function 'Get-ChangeLogEntries' diff --git a/eng/common/scripts/modules/Package-Properties.psm1 b/eng/common/scripts/modules/Package-Properties.psm1 index 01865594f6cf3..fa6920bec3492 100644 --- a/eng/common/scripts/modules/Package-Properties.psm1 +++ b/eng/common/scripts/modules/Package-Properties.psm1 @@ -3,13 +3,24 @@ class PackageProps { [string]$pkgName - [AzureEngSemanticVersion]$pkgVersion + [string]$pkgVersion [string]$pkgDirectoryPath [string]$pkgServiceName [string]$pkgReadMePath [string]$pkgChangeLogPath + [string]$pkgGroup - PackageProps( + PackageProps([string]$pkgName,[string]$pkgVersion,[string]$pkgDirectoryPath,[string]$pkgServiceName) + { + $this.Initialize($pkgName, $pkgVersion, $pkgDirectoryPath, $pkgServiceName) + } + + PackageProps([string]$pkgName,[string]$pkgVersion,[string]$pkgDirectoryPath,[string]$pkgServiceName,[string]$pkgGroup="") + { + $this.Initialize($pkgName, $pkgVersion, $pkgDirectoryPath, $pkgServiceName, $pkgGroup) + } + + hidden [void]Initialize( [string]$pkgName, [string]$pkgVersion, [string]$pkgDirectoryPath, @@ -17,11 +28,7 @@ class PackageProps ) { $this.pkgName = $pkgName - $this.pkgVersion = [AzureEngSemanticVersion]::ParseVersionString($pkgVersion) - if ($this.pkgVersion -eq $null) - { - Write-Error "Invalid version in $pkgDirectoryPath" - } + $this.pkgVersion = $pkgVersion $this.pkgDirectoryPath = $pkgDirectoryPath $this.pkgServiceName = $pkgServiceName @@ -43,6 +50,18 @@ class PackageProps $this.pkgChangeLogPath = $null } } + + hidden [void]Initialize( + [string]$pkgName, + [string]$pkgVersion, + [string]$pkgDirectoryPath, + [string]$pkgServiceName, + [string]$pkgGroup + ) + { + $this.Initialize($pkgName, $pkgVersion, $pkgDirectoryPath, $pkgServiceName) + $this.pkgGroup = $pkgGroup + } } $ProgressPreference = "SilentlyContinue" @@ -127,10 +146,11 @@ function Extract-JavaPkgProps ($pkgPath, $serviceName, $pkgName) $projectData.load($projectPath) $projectPkgName = $projectData.project.artifactId $pkgVersion = $projectData.project.version + $pkgGroup = $projectData.project.groupId if ($projectPkgName -eq $pkgName) { - return [PackageProps]::new($pkgName, $pkgVersion.ToString(), $pkgPath, $serviceName) + return [PackageProps]::new($pkgName, $pkgVersion.ToString(), $pkgPath, $serviceName, $pkgGroup) } } return $null From 9bdecc51bf239750fcc76b7182e3dca0b64651e9 Mon Sep 17 00:00:00 2001 From: Chuang <54572251+xccc-msft@users.noreply.github.com> Date: Thu, 9 Jul 2020 11:23:39 +0800 Subject: [PATCH 066/129] mgmt support api version detection (#12907) * mgmt support api version detection * fix alignment --- sdk/management/api-specs.json | 3 +- sdk/management/package.json | 6 +- sdk/management/servcheck.js | 108 ++++++++++++++++++++++++++++++++++ 3 files changed, 114 insertions(+), 3 deletions(-) create mode 100644 sdk/management/servcheck.js diff --git a/sdk/management/api-specs.json b/sdk/management/api-specs.json index 349d24690be04..0823f6bb2fedf 100644 --- a/sdk/management/api-specs.json +++ b/sdk/management/api-specs.json @@ -223,7 +223,8 @@ "policy": { "dir": "../resources/mgmt", "source": "specification/resources/resource-manager/readme.md", - "package": "com.azure.resourcemanager.resources --tag=package-policy-2019-09" + "package": "com.azure.resourcemanager.resources", + "args": "--payload-flattening-threshold=1 --tag=package-policy-2019-09" }, "powerbi": { "dir": "../powerbi/mgmt", diff --git a/sdk/management/package.json b/sdk/management/package.json index ee1d9771e9eeb..332c01ceeecf6 100644 --- a/sdk/management/package.json +++ b/sdk/management/package.json @@ -33,7 +33,8 @@ "credcheck_storage": "node credcheck.js --path=../storage/mgmt/src/test/resources/session-records/", "credcheck_azure": "node credcheck.js --path=./azure/src/test/resources/session-records/", "credcheck_samples": "node credcheck.js --path=./samples/src/test/resources/session-records/", - "credcheck_all": "run-s credcheck_appservice credcheck_authorization credcheck_compute credcheck_containerregistry credcheck_containerservice credcheck_cosmos credcheck_dns credcheck_keyvault credcheck_msi credcheck_monitor credcheck_network credcheck_resources credcheck_sql credcheck_storage credcheck_azure credcheck_samples" + "credcheck_all": "run-s credcheck_appservice credcheck_authorization credcheck_compute credcheck_containerregistry credcheck_containerservice credcheck_cosmos credcheck_dns credcheck_keyvault credcheck_msi credcheck_monitor credcheck_network credcheck_resources credcheck_sql credcheck_storage credcheck_azure credcheck_samples", + "servcheck": "node servcheck.js" }, "devDependencies": { "colors": "1.1.2", @@ -45,6 +46,7 @@ "gulp-shell": "^0.8.0", "p-all": "^1.0.0", "yargs": "3.31.0", - "npm-run-all": "4.1.5" + "npm-run-all": "4.1.5", + "pom-parser": "1.2.0" } } diff --git a/sdk/management/servcheck.js b/sdk/management/servcheck.js new file mode 100644 index 0000000000000..0a2b8817eeba8 --- /dev/null +++ b/sdk/management/servcheck.js @@ -0,0 +1,108 @@ +const args = require('yargs').argv; +const os = require('os'); +const fs = require('fs'); +const path = require('path'); +const parser = require("pom-parser"); +const colors = require('colors'); + + +function servcheck() { + console.log('[INFO] starting to check api versions of services...\n'); + readPom(); +} + + +function readPom(callback) { + var opts = { + filePath: __dirname + "/pom.xml", + }; + parser.parse(opts, function(err, response) { + if (err) { + console.log('[ERROR] ' + err); + process.exit(1); + } + console.log('[INFO] reading modules from pom...'); + readProjSpecs(response.pomObject.project.modules.module); + }); +} + +const mappings = require('./api-specs.json'); + +function readProjSpecs(modules) { + console.log('[INFO] reading specs in project...'); + var map = {}; + Object.keys(mappings).forEach(key => { + if (modules.includes(mappings[key].dir)) { + var val = getCurrentApiVersion(mappings[key].args); + if (val !== undefined) { + map[key] = {}; + map[key].name = key; + map[key].tag = val; + map[key].source = mappings[key].source; + } + } + }); + readLatestSpecs(map); +} + +function getCurrentApiVersion(value) { + var res = undefined; + value.split(/\s+/).forEach(item => { + if (item.includes('--tag=')) { + res = item.replace('--tag=', ''); + } + }); + return res; +} + +function readLatestSpecs(map) { + console.log('[INFO] reading specs from swagger root...'); + Object.keys(map).forEach(item => { + readLatestApiVersion(map[item]); + }); +} + +const dir = args['spec-root']; + +function readLatestApiVersion(spec) { + console.log('\n[Service] ' + spec.name); + console.log(' current: ' + spec.tag); + const filePath = path.join(dir, spec.source); + const content = fs.readFileSync(filePath).toString('utf8'); + + var latest = {}; + var allTags = []; + var lines = content.split('\n'); + lines.forEach(line => { + if (line.startsWith('tag:')) { + if (latest.tag === undefined || latest.tag != undefined && line.includes(spec.name)) { + latest.tag = getApiVersion(line, 'tag:'); + } + } + if (line.includes('Tag:') && !line.includes(' and ')) { + allTags.push(getApiVersion(line, '### Tag:')); + } + }); + + console.log(' latest: ' + latest.tag); + + if (spec.tag !== latest.tag) { + allTags.sort().reverse(); + console.log('\n potential versions to upgrade:'); + allTags.forEach(tag => { + if (tag == spec.tag) { + console.log(' ' + tag.bold.underline.yellow); + } else { + console.log(' ' + tag); + } + }); + } + + return latest; +} + +function getApiVersion(value, target) { + return value.replace(target, '').replace('\r', '').trim(); +} + +servcheck(); \ No newline at end of file From 0526b698b4cf241e37e556a4d0d72f43e29dff24 Mon Sep 17 00:00:00 2001 From: nickzhums <56864335+nickzhums@users.noreply.github.com> Date: Thu, 9 Jul 2020 15:16:05 +0800 Subject: [PATCH 067/129] Create Migration Guide from Track 1 to Track 2 (#12909) * Create Migration Guide File --- sdk/management/README.md | 10 +- sdk/management/docs/MIGRATION_GUIDE.md | 293 +++++++++++++++++++++++++ 2 files changed, 302 insertions(+), 1 deletion(-) create mode 100644 sdk/management/docs/MIGRATION_GUIDE.md diff --git a/sdk/management/README.md b/sdk/management/README.md index 874c196e932ac..647a346676d1b 100644 --- a/sdk/management/README.md +++ b/sdk/management/README.md @@ -3,9 +3,17 @@ The Azure Management Libraries for Java is a higher-level, object-oriented API for *managing* Azure resources, that is optimized for ease of use, succinctness and consistency. -- [API reference documentation][docs] +## Documentation + +Various documentation is available to help you get started + +- **[API reference documentation][docs]** - **[Code snippets and samples][sample]** +## Migration from older version of Azure management library + +If you are an existing user of the older version of Azure management library for Java (the namespace of old packages contains ``com.microsoft.azure.management.**``) and you are looking for a migration guide to the new version of the SDK, please refer to [this migration guide here](https://github.com/Azure/azure-sdk-for-java/blob/master/sdk/management/docs/MIGRATION_GUIDE.md) + ## Getting started ### Prerequisites diff --git a/sdk/management/docs/MIGRATION_GUIDE.md b/sdk/management/docs/MIGRATION_GUIDE.md new file mode 100644 index 0000000000000..efd22e608f6ef --- /dev/null +++ b/sdk/management/docs/MIGRATION_GUIDE.md @@ -0,0 +1,293 @@ +## Guide for migrating to `com.azure.resourcemanager.**` from `com.microsoft.azure.management.**` + +This document is intended for users that are familiar with an older version of the Java SDK for managment libraries (`com.microsoft.azure.management.**`) ad wish to migrate their application +to the next version of Azure resource management libraries (`com.azure.resourcemanager.**`) + +For users new to the Java SDK for resource management libraries, please see the [README for 'com.azure.resourcemanager.*`](http://aka.ms/azure-sdk-java-mgmt) + +## Table of contents + +* [Prerequisites](#prerequisites) +* [Updated Maven depedencies](#updated-maven-dependencies) +* [General Changes](#general-changes) + * [Authentication](#authentication) + * [Customized Policy](#customized-policy) + * [Custom HTTP Client](#custom-http-client) + * [Error Handling](#error-handling) + * [rxJava -> Reactor](#rxjava-to-reactor) +* [Additional Samples](#additional-samples) + +## Prerequisites + +Java Development Kit (JDK) with version 8 or above. + +## Updated Maven dependencies + +The latest dependencies for resource management libraries are [available here](https://azure.github.io/azure-sdk/releases/latest/all/java.html). Please look for packages that contains "azure-resourcemanager" in the namespace. + +## General Changes + +The latest Azure Java SDK for management libraries is a result of our efforts to create a resource management client library that is user-friendly and idiomatic to the Java ecosystem. + +Apart from redesigns resulting from the [new Azure SDK Design Guidelines for Java](https://github.com/Azure/azure-sdk-for-java/blob/master/sdk/management/docs/DESIGN.md), the latest version improves on several areas from old version. + +While conforming to the new guideline, we have tried our best to minimize the breaking changes. Most of the interfaces / classes / methods have stayed the same to offer user an easier migration experience. + +The important breaking changes are listed in the following sections: + +### Authentication + +In old version (`com.microsoft.azure.management.**`), ApplicationTokenCredentials is created with all the credential parameters. + +In new version (`com.azure.resourcemanager.**`), in order to provide an unified authentication based on Azure Identity for all Azure Java SDKs, the authentication mechanism has been re-designed and improved to offer a simpler interface. + +To the show the code snippets for the change: + +**In old version (`com.microsoft.azure.management.**`)** + +```java +ApplicationTokenCredential = new ApplicationTokenCredentials("", "", "", AzureEnvironment.AZURE) + .withDefaultSubscriptionId(""); +``` + +**Equivalent in new version (`com.azure.resourcemanager.**`)** + +```java +TokenCredential credential = new ClientSecretCredentialBuilder() + .clientId("") + .clientSecret("") + .tenantId("") + .build(); +AzureProfile profile = new AzureProfile("", "", AzureEnvironment.AZURE); +``` + +In addition to this change, the **support for using auth file has been removed**. In old version, the user can choose to authenticate via the auth file, like this: + +**In old version (`com.microsoft.azure.management.**`)** + +```java +Azure azure = Azure.authenticate(new File("my.azureauth")).withDefaultSubscription(); +``` +**In new version, this feature has been removed.** If this creates concern on your side, please file an issue to let us know. + +For detailed information on the benefits of using the new authentication classes, please refer to [this page](https://github.com/Azure/azure-sdk-for-java/blob/master/sdk/management/docs/AUTH.md) + +## Customized Policy + +Because of adopting Azure Core which is a shared library across all Azure SDKs, there is also a minor change regarding how customized policy in configured. + +In old version (`com.microsoft.azure.management.**`), we use `withInterceptor` and pass the customized interceptor class to the Azure object + +In new version (`com.azure.resourcemanager.**`), we use `WithPolicy` instead and pass the customized policy to the Azure object. It's also worth mentioning that the implementation of `HttpPipelinePolicy` is different from that of `Interceptor` from okhttp. + +So: + +**In old version (`com.microsoft.azure.management.**`)** + +```java +Azure azure = Azure.configure() + .withInterceptor(new CustomizedInterceptor()) + .authenticate(credential) + .withDefaultSubscription(); +``` + +**Equivalent in new version (`com.azure.resourcemanager.**`)** + +```java +Azure azure = Azure.configure() + .withPolicy(new CustomizedPolicy()) + .authenticate(credential, profile) + .withDefaultSubscription(); +``` + +## Custom HTTP Client + +Similar to the customized policy, there are changes regarding how the custom HTTP client is configured as well. The re-designed HTTP client builder in the new version is more flexible and the user can choose their own implementation of HTTP client and plug in what they need into the configuration. + +**In old version (`com.microsoft.azure.management.**`)** + +```java +OkHttpClient.Builder builder = new OkHttpClient.Builder().proxy(new Proxy(Proxy.Type.HTTP, new InetSocketAddress("127.0.0.1", 8888))); +RestClient client = new RestClient.Builder(builder, new Retrofit.Builder()) + .withCredentials(credential) + .build(); + +Azure azure = Azure.authenticate(client, "") + .withDefaultSubscription(); +``` + +**Equivalent in new version (`com.azure.resourcemanager.**`)** + +```java +HttpClient client = new OkHttpAsyncHttpClientBuilder() + .proxy(new ProxyOptions(ProxyOptions.Type.HTTP, new InetSocketAddress("127.0.0.1", 8888))) + .build(); + +Azure azure = Azure.configure() + .withHttpClient(client) + .authenticate(credential, profile) + .withDefaultSubscription(); +``` + +## Error Handling + +There is a minor namespace change in the exception class. To be specific, the previous `CloudException` has been re-named to `ManagementException`. + +**In old version (`com.microsoft.azure.management.**`)** + +```java +final String resourceGroupName = "invalid resource group name"; +try { + azure.resourceGroups().define(resourceGroupName) + .withRegion(Region.US_WEST2) + .create(); +} catch (CloudException e) { + System.err.printf("Response code: %s%n", e.body().code()); + System.err.printf("Response message: %s%n", e.body().message()); +} +``` + +**Equivalent in new version (`com.azure.resourcemanager.**`)** + +```java +final String resourceGroupName = "invalid resource group name"; +try { + azure.resourceGroups().define(resourceGroupName) + .withRegion(Region.US_WEST2) + .create(); +} catch (ManagementException e) { + System.err.printf("Response code: %s%n", e.getValue().getCode()); + System.err.printf("Response message: %s%n", e.getValue().getMessage()); +} +``` + +## rxJava to Reactor + +In old version (`com.microsoft.azure.management.**`), `rxJava` is used for non-blocking applications + +In new version (`com.azure.resourcemanager.**`), we have adopted `Reactor` as the main library in replacement of `rxJava` due to the Azure Core adoption. + +**In old version (`com.microsoft.azure.management.**`)** + +```java +azure.publicIPAddresses() + .define(publicIpName) + .withRegion(region) + .withExistingResourceGroup(rgName) + .withLeafDomainLabel(publicIpName) + .createAsync().flatMap(new Func1 < Indexable, Observable < Indexable >> () { + @Override + public Observable < Indexable > call(Indexable indexable) { + if (indexable instanceof PublicIPAddress) { + PublicIPAddress publicIp = (PublicIPAddress) indexable; + //============================================================= + // Create an Internet facing load balancer with + // One frontend IP address + // Two backend address pools which contain network interfaces for the virtual + // machines to receive HTTP and HTTPS network traffic from the load balancer + // Two load balancing rules for HTTP and HTTPS to map public ports on the load + // balancer to ports in the backend address pool + // Two probes which contain HTTP and HTTPS health probes used to check availability + // of virtual machines in the backend address pool + // Three inbound NAT rules which contain rules that map a public port on the load + // balancer to a port for a specific virtual machine in the backend address pool + // - this provides direct VM connectivity for SSH to port 22 and TELNET to port 23 + + return Observable.merge( + Observable.just(indexable), azure.loadBalancers().define(loadBalancerName1).withRegion(region).withExistingResourceGroup(rgName) + // Add two rules that uses above backend and probe + .defineLoadBalancingRule(httpLoadBalancingRule).withProtocol(TransportProtocol.TCP).fromFrontend(frontendName).fromFrontendPort(80).toBackend(backendPoolName1).withProbe(httpProbe).attach().defineLoadBalancingRule(httpsLoadBalancingRule).withProtocol(TransportProtocol.TCP).fromFrontend(frontendName).fromFrontendPort(443).toBackend(backendPoolName2).withProbe(httpsProbe).attach() + // Add nat pools to enable direct VM connectivity for + // SSH to port 22 and TELNET to port 23 + + .defineInboundNatPool(natPool50XXto22).withProtocol(TransportProtocol.TCP).fromFrontend(frontendName).fromFrontendPortRange(5000, 5099).toBackendPort(22).attach().defineInboundNatPool(natPool60XXto23).withProtocol(TransportProtocol.TCP).fromFrontend(frontendName).fromFrontendPortRange(6000, 6099).toBackendPort(23).attach() + + // Explicitly define the frontend + .definePublicFrontend(frontendName).withExistingPublicIPAddress(publicIp).attach + + // Add two probes one per rule + .defineHttpProbe(httpProbe).withRequestPath("/").withPort(80).attach().defineHttpProbe(httpsProbe).withRequestPath("/").withPort(443).attach() + .createAsync()); + } + return Observable.just(indexable); + } + })).toBlocking().subscribe(new Action1 < Indexable > () { + @Override + public void call(Indexable indexable) { + createdResources.add(indexable); + } +}); +``` + +[**Link to full sample**](https://github.com/Azure/azure-libraries-for-java/blob/master/azure-samples/src/main/java/com/microsoft/azure/management/compute/samples/ManageVirtualMachineScaleSetAsync.java#L100) + + +**Equivalent in new version (`com.azure.resourcemanager.**`)** + +```java +final List < Indexable > createdResources = new ArrayList < > (); +azure.resourceGroups().define(rgName).withRegion(region).create(); +Flux.merge( + azure.networks() + .define(vnetName) + .withRegion(region) + .withExistingResourceGroup(rgName) + .withAddressSpace("172.16.0.0/16") + .defineSubnet("Front-end") + .withAddressPrefix("172.16.1.0/24") + .attach() + .createAsync(), + azure.publicIpAddresses() + .define(publicIpName) + .withRegion(region) + .withExistingResourceGroup(rgName) + .withLeafDomainLabel(publicIpName) + .createAsync().flatMap(indexable - > { + if (indexable instanceof PublicIpAddress) { + PublicIpAddress publicIp = (PublicIpAddress) indexable; + //============================================================= + // Create an Internet facing load balancer with + // One frontend IP address + // Two backend address pools which contain network interfaces for the virtual + // machines to receive HTTP and HTTPS network traffic from the load balancer + // Two load balancing rules for HTTP and HTTPS to map public ports on the load + // balancer to ports in the backend address pool + // Two probes which contain HTTP and HTTPS health probes used to check availability + // of virtual machines in the backend address pool + // Three inbound NAT rules which contain rules that map a public port on the load + // balancer to a port for a specific virtual machine in the backend address pool + // - this provides direct VM connectivity for SSH to port 22 and TELNET to port 23 + + return Flux.merge( + Flux.just(indexable), azure.loadBalancers().define(loadBalancerName1).withRegion(region).withExistingResourceGroup(rgName) + // Add two rules that uses above backend and probe + .defineLoadBalancingRule(httpLoadBalancingRule).withProtocol(TransportProtocol.TCP).fromFrontend(frontendName).fromFrontendPort(80).toBackend(backendPoolName1).withProbe(httpProbe).attach().defineLoadBalancingRule(httpsLoadBalancingRule).withProtocol(TransportProtocol.TCP).fromFrontend(frontendName).fromFrontendPort(443).toBackend(backendPoolName2).withProbe(httpsProbe).attach() + // Add nat pools to enable direct VM connectivity for + // SSH to port 22 and TELNET to port 23 + .defineInboundNatPool(natPool50XXto22).withProtocol(TransportProtocol.TCP).fromFrontend(frontendName).fromFrontendPortRange(5000, 5099).toBackendPort(22).attach().defineInboundNatPool(natPool60XXto23).withProtocol(TransportProtocol.TCP).fromFrontend(frontendName).fromFrontendPortRange(6000, 6099).toBackendPort(23).attach() + + // Explicitly define the frontend + .definePublicFrontend(frontendName).withExistingPublicIpAddress(publicIp).attach() + + // Add two probes one per rule + .defineHttpProbe(httpProbe).withRequestPath("/").withPort(80).attach().defineHttpProbe(httpsProbe).withRequestPath("/").withPort(443).attach().createAsync()); + } + return Flux.just(indexable); + })).flatMap(indexable - > { + createdResources.add(indexable); + return Flux.just(indexable); +}).last().block(); +``` + +[**Link to full sample**](https://github.com/Azure/azure-sdk-for-java/blob/7beda69/sdk/management/samples/src/main/java/com/azure/resourcemanager/compute/samples/ManageVirtualMachineScaleSetAsync.java#L98) + +## Additional Samples + +More samples can be found at : +- [README for new version of SDK](http://aka.ms/azure-sdk-java-mgmt) +- [Code Samples for Resource Management Libraries](https://github.com/Azure/azure-sdk-for-java/blob/master/sdk/management/docs/SAMPLE.md) +- [Authentication Documentation](https://github.com/Azure/azure-sdk-for-java/blob/master/sdk/management/docs/AUTH.md) + +## Need help? + +If you have encountered an issue during migration, please file an issue via [Github Issues](https://github.com/Azure/azure-sdk-for-java/issues) and make sure you add the "Preview" label to the issue From 9361802943f03d39075ae66c05fd2aa1cf5d1ecd Mon Sep 17 00:00:00 2001 From: Tanyi Chen Date: Thu, 9 Jul 2020 17:56:36 +0800 Subject: [PATCH 068/129] add key vault certificate permission (#12965) --- .../keyvault/models/AccessPolicy.java | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/sdk/keyvault/mgmt/src/main/java/com/azure/resourcemanager/keyvault/models/AccessPolicy.java b/sdk/keyvault/mgmt/src/main/java/com/azure/resourcemanager/keyvault/models/AccessPolicy.java index 73ad9eade808f..8ed618c5e4732 100644 --- a/sdk/keyvault/mgmt/src/main/java/com/azure/resourcemanager/keyvault/models/AccessPolicy.java +++ b/sdk/keyvault/mgmt/src/main/java/com/azure/resourcemanager/keyvault/models/AccessPolicy.java @@ -385,6 +385,29 @@ interface WithPermissions { */ WithAttach allowStorageAllPermissions(); + /** + * Allow all permissions for the AD identity to access certificates. + * + * @return the next stage of access policy definition + */ + WithAttach allowCertificateAllPermissions(); + + /** + * Allow a list of permissions for the AD identity to access certificates. + * + * @param permissions the list of permissions allowed + * @return the next stage of access policy definition + */ + WithAttach allowCertificatePermissions(CertificatePermissions... permissions); + + /** + * Allow a list of permissions for the AD identity to access certificates. + * + * @param permissions the list of permissions allowed + * @return the next stage of access policy definition + */ + WithAttach allowCertificatePermissions(List permissions); + /** * Allow a list of permissions for the AD identity to access storage. * From 7d211b4699e17156bca3ccb6a5e11b9b2644b75b Mon Sep 17 00:00:00 2001 From: Arthur Erlendsson <30675661+arerlend@users.noreply.github.com> Date: Thu, 9 Jul 2020 09:55:48 -0700 Subject: [PATCH 069/129] PR for EH + serializer integration (#12205) * create draft PR * fix object batch * temp object serializer * dep on core experimental * temp * getDeserializedObject() * null object in object batch test * remove old SR dep * remove temporary interfaces * rename objectSerializer builder method to serializer * single class imports * fix serializer builder javadoc * rename abstract batch impl * add EventDataBatchBase javadoc * mono TryAdd * fix modifiers * remove send mode * fix object batch javadoc * partition event deserialize to async * uncomment azure core * javadoc syntax * remove temp interface * only core-experimental, not core * checkstyle * update partition event deserialize * monoError for object batch * rename objectSerializer to serializer * add serializer null check in object batch creation * cleanup --- .../azure-messaging-eventhubs/pom.xml | 4 +- .../messaging/eventhubs/EventDataBatch.java | 255 +--------------- .../eventhubs/EventDataBatchBase.java | 284 ++++++++++++++++++ .../eventhubs/EventHubAsyncClient.java | 14 +- .../eventhubs/EventHubClientBuilder.java | 16 +- .../EventHubConsumerAsyncClient.java | 13 +- .../EventHubPartitionAsyncConsumer.java | 13 +- .../EventHubProducerAsyncClient.java | 95 +++++- .../messaging/eventhubs/ObjectBatch.java | 55 ++++ .../eventhubs/models/PartitionEvent.java | 44 ++- .../src/main/java/module-info.java | 1 + ...hTest.java => EventDataBatchBaseTest.java} | 2 +- .../EventHubConsumerAsyncClientTest.java | 18 +- .../eventhubs/EventHubConsumerClientTest.java | 10 +- .../EventHubPartitionAsyncConsumerTest.java | 61 +++- .../EventHubProducerAsyncClientTest.java | 22 +- .../eventhubs/EventHubProducerClientTest.java | 10 +- ...EventProcessorClientErrorHandlingTest.java | 2 +- .../eventhubs/EventProcessorClientTest.java | 2 +- .../messaging/eventhubs/ObjectBatchTest.java | 54 ++++ .../PartitionBasedLoadBalancerTest.java | 12 +- .../SchemaRegistryAvroAsyncSerializer.java | 3 +- 22 files changed, 675 insertions(+), 315 deletions(-) create mode 100644 sdk/eventhubs/azure-messaging-eventhubs/src/main/java/com/azure/messaging/eventhubs/EventDataBatchBase.java create mode 100644 sdk/eventhubs/azure-messaging-eventhubs/src/main/java/com/azure/messaging/eventhubs/ObjectBatch.java rename sdk/eventhubs/azure-messaging-eventhubs/src/test/java/com/azure/messaging/eventhubs/{EventDataBatchTest.java => EventDataBatchBaseTest.java} (98%) create mode 100644 sdk/eventhubs/azure-messaging-eventhubs/src/test/java/com/azure/messaging/eventhubs/ObjectBatchTest.java diff --git a/sdk/eventhubs/azure-messaging-eventhubs/pom.xml b/sdk/eventhubs/azure-messaging-eventhubs/pom.xml index 7d0f5adbebb57..dfb271b9f8aaa 100644 --- a/sdk/eventhubs/azure-messaging-eventhubs/pom.xml +++ b/sdk/eventhubs/azure-messaging-eventhubs/pom.xml @@ -36,8 +36,8 @@ com.azure - azure-core - 1.6.0 + azure-core-experimental + 1.0.0-beta.1 com.azure diff --git a/sdk/eventhubs/azure-messaging-eventhubs/src/main/java/com/azure/messaging/eventhubs/EventDataBatch.java b/sdk/eventhubs/azure-messaging-eventhubs/src/main/java/com/azure/messaging/eventhubs/EventDataBatch.java index 5656e9e588bc9..0c00c696453e3 100644 --- a/sdk/eventhubs/azure-messaging-eventhubs/src/main/java/com/azure/messaging/eventhubs/EventDataBatch.java +++ b/sdk/eventhubs/azure-messaging-eventhubs/src/main/java/com/azure/messaging/eventhubs/EventDataBatch.java @@ -3,38 +3,9 @@ package com.azure.messaging.eventhubs; -import com.azure.core.amqp.AmqpMessageConstant; -import com.azure.core.amqp.exception.AmqpErrorCondition; import com.azure.core.amqp.exception.AmqpException; -import com.azure.core.amqp.implementation.AmqpConstants; import com.azure.core.amqp.implementation.ErrorContextProvider; import com.azure.core.amqp.implementation.TracerProvider; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.core.util.tracing.ProcessKind; -import org.apache.qpid.proton.Proton; -import org.apache.qpid.proton.amqp.Binary; -import org.apache.qpid.proton.amqp.Symbol; -import org.apache.qpid.proton.amqp.messaging.ApplicationProperties; -import org.apache.qpid.proton.amqp.messaging.Data; -import org.apache.qpid.proton.amqp.messaging.MessageAnnotations; -import org.apache.qpid.proton.message.Message; -import reactor.core.publisher.Signal; - -import java.nio.BufferOverflowException; -import java.util.HashMap; -import java.util.LinkedList; -import java.util.List; -import java.util.Locale; -import java.util.Objects; -import java.util.Optional; - -import static com.azure.core.util.tracing.Tracer.AZ_TRACING_NAMESPACE_KEY; -import static com.azure.core.util.tracing.Tracer.DIAGNOSTIC_ID_KEY; -import static com.azure.core.util.tracing.Tracer.ENTITY_PATH_KEY; -import static com.azure.core.util.tracing.Tracer.HOST_NAME_KEY; -import static com.azure.core.util.tracing.Tracer.SPAN_CONTEXT_KEY; -import static com.azure.messaging.eventhubs.implementation.ClientConstants.AZ_NAMESPACE_VALUE; /** * A class for aggregating {@link EventData} into a single, size-limited, batch. It is treated as a single message when @@ -45,59 +16,10 @@ * @see EventHubClientBuilder See EventHubClientBuilder for examples of building an asynchronous or synchronous * producer. */ -public final class EventDataBatch { - private final ClientLogger logger = new ClientLogger(EventDataBatch.class); - private final Object lock = new Object(); - private final int maxMessageSize; - private final String partitionKey; - private final ErrorContextProvider contextProvider; - private final List events; - private final byte[] eventBytes; - private final String partitionId; - private int sizeInBytes; - private final TracerProvider tracerProvider; - private final String entityPath; - private final String hostname; - +public final class EventDataBatch extends EventDataBatchBase { EventDataBatch(int maxMessageSize, String partitionId, String partitionKey, ErrorContextProvider contextProvider, TracerProvider tracerProvider, String entityPath, String hostname) { - this.maxMessageSize = maxMessageSize; - this.partitionKey = partitionKey; - this.partitionId = partitionId; - this.contextProvider = contextProvider; - this.events = new LinkedList<>(); - this.sizeInBytes = (maxMessageSize / 65536) * 1024; // reserve 1KB for every 64KB - this.eventBytes = new byte[maxMessageSize]; - this.tracerProvider = tracerProvider; - this.entityPath = entityPath; - this.hostname = hostname; - } - - /** - * Gets the number of {@link EventData events} in the batch. - * - * @return The number of {@link EventData events} in the batch. - */ - public int getCount() { - return events.size(); - } - - /** - * Gets the maximum size, in bytes, of the {@link EventDataBatch}. - * - * @return The maximum size, in bytes, of the {@link EventDataBatch}. - */ - public int getMaxSizeInBytes() { - return maxMessageSize; - } - - /** - * Gets the size of the {@link EventDataBatch} in bytes. - * - * @return the size of the {@link EventDataBatch} in bytes. - */ - public int getSizeInBytes() { - return this.sizeInBytes; + super(maxMessageSize, partitionId, partitionKey, contextProvider, tracerProvider, entityPath, hostname); } /** @@ -110,177 +32,6 @@ public int getSizeInBytes() { * @throws AmqpException if {@code eventData} is larger than the maximum size of the {@link EventDataBatch}. */ public boolean tryAdd(final EventData eventData) { - if (eventData == null) { - throw logger.logExceptionAsWarning(new IllegalArgumentException("eventData cannot be null")); - } - EventData event = tracerProvider.isEnabled() ? traceMessageSpan(eventData) : eventData; - - final int size; - try { - size = getSize(event, events.isEmpty()); - } catch (BufferOverflowException exception) { - throw logger.logExceptionAsWarning(new AmqpException(false, AmqpErrorCondition.LINK_PAYLOAD_SIZE_EXCEEDED, - String.format(Locale.US, "Size of the payload exceeded maximum message size: %s kb", - maxMessageSize / 1024), - contextProvider.getErrorContext())); - } - - synchronized (lock) { - if (this.sizeInBytes + size > this.maxMessageSize) { - return false; - } - - this.sizeInBytes += size; - } - - this.events.add(event); - return true; - } - - /** - * Method to start and end a "Azure.EventHubs.message" span and add the "DiagnosticId" as a property of the message. - * - * @param eventData The Event to add tracing span for. - * @return the updated event data object. - */ - private EventData traceMessageSpan(EventData eventData) { - Optional eventContextData = eventData.getContext().getData(SPAN_CONTEXT_KEY); - if (eventContextData.isPresent()) { - // if message has context (in case of retries), don't start a message span or add a new context - return eventData; - } else { - // Starting the span makes the sampling decision (nothing is logged at this time) - Context eventContext = eventData.getContext() - .addData(AZ_TRACING_NAMESPACE_KEY, AZ_NAMESPACE_VALUE) - .addData(ENTITY_PATH_KEY, this.entityPath) - .addData(HOST_NAME_KEY, this.hostname); - Context eventSpanContext = tracerProvider.startSpan(eventContext, ProcessKind.MESSAGE); - Optional eventDiagnosticIdOptional = eventSpanContext.getData(DIAGNOSTIC_ID_KEY); - if (eventDiagnosticIdOptional.isPresent()) { - eventData.getProperties().put(DIAGNOSTIC_ID_KEY, eventDiagnosticIdOptional.get().toString()); - tracerProvider.endSpan(eventSpanContext, Signal.complete()); - eventData.addContext(SPAN_CONTEXT_KEY, eventSpanContext); - } - } - - return eventData; - } - - List getEvents() { - return events; - } - - String getPartitionKey() { - return partitionKey; - } - - String getPartitionId() { - return partitionId; - } - - private int getSize(final EventData eventData, final boolean isFirst) { - Objects.requireNonNull(eventData, "'eventData' cannot be null."); - - final Message amqpMessage = createAmqpMessage(eventData, partitionKey); - int eventSize = amqpMessage.encode(this.eventBytes, 0, maxMessageSize); // actual encoded bytes size - eventSize += 16; // data section overhead - - if (isFirst) { - amqpMessage.setBody(null); - amqpMessage.setApplicationProperties(null); - amqpMessage.setProperties(null); - amqpMessage.setDeliveryAnnotations(null); - - eventSize += amqpMessage.encode(this.eventBytes, 0, maxMessageSize); - } - - return eventSize; - } - - /* - * Creates the AMQP message represented by the event data - */ - private Message createAmqpMessage(EventData event, String partitionKey) { - final Message message = Proton.message(); - - if (event.getProperties() != null && !event.getProperties().isEmpty()) { - final ApplicationProperties applicationProperties = new ApplicationProperties(event.getProperties()); - message.setApplicationProperties(applicationProperties); - } - - if (event.getSystemProperties() != null) { - event.getSystemProperties().forEach((key, value) -> { - if (EventData.RESERVED_SYSTEM_PROPERTIES.contains(key)) { - return; - } - - final AmqpMessageConstant constant = AmqpMessageConstant.fromString(key); - - if (constant != null) { - switch (constant) { - case MESSAGE_ID: - message.setMessageId(value); - break; - case USER_ID: - message.setUserId((byte[]) value); - break; - case TO: - message.setAddress((String) value); - break; - case SUBJECT: - message.setSubject((String) value); - break; - case REPLY_TO: - message.setReplyTo((String) value); - break; - case CORRELATION_ID: - message.setCorrelationId(value); - break; - case CONTENT_TYPE: - message.setContentType((String) value); - break; - case CONTENT_ENCODING: - message.setContentEncoding((String) value); - break; - case ABSOLUTE_EXPIRY_TIME: - message.setExpiryTime((long) value); - break; - case CREATION_TIME: - message.setCreationTime((long) value); - break; - case GROUP_ID: - message.setGroupId((String) value); - break; - case GROUP_SEQUENCE: - message.setGroupSequence((long) value); - break; - case REPLY_TO_GROUP_ID: - message.setReplyToGroupId((String) value); - break; - default: - throw logger.logExceptionAsWarning(new IllegalArgumentException(String.format(Locale.US, - "Property is not a recognized reserved property name: %s", key))); - } - } else { - final MessageAnnotations messageAnnotations = (message.getMessageAnnotations() == null) - ? new MessageAnnotations(new HashMap<>()) - : message.getMessageAnnotations(); - messageAnnotations.getValue().put(Symbol.getSymbol(key), value); - message.setMessageAnnotations(messageAnnotations); - } - }); - } - - if (partitionKey != null) { - final MessageAnnotations messageAnnotations = (message.getMessageAnnotations() == null) - ? new MessageAnnotations(new HashMap<>()) - : message.getMessageAnnotations(); - messageAnnotations.getValue().put(AmqpConstants.PARTITION_KEY, partitionKey); - message.setMessageAnnotations(messageAnnotations); - } - - message.setBody(new Data(new Binary(event.getBody()))); - - return message; + return super.tryAdd(eventData); } } diff --git a/sdk/eventhubs/azure-messaging-eventhubs/src/main/java/com/azure/messaging/eventhubs/EventDataBatchBase.java b/sdk/eventhubs/azure-messaging-eventhubs/src/main/java/com/azure/messaging/eventhubs/EventDataBatchBase.java new file mode 100644 index 0000000000000..6964ec79c1719 --- /dev/null +++ b/sdk/eventhubs/azure-messaging-eventhubs/src/main/java/com/azure/messaging/eventhubs/EventDataBatchBase.java @@ -0,0 +1,284 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.messaging.eventhubs; + +import com.azure.core.amqp.AmqpMessageConstant; +import com.azure.core.amqp.exception.AmqpErrorCondition; +import com.azure.core.amqp.exception.AmqpException; +import com.azure.core.amqp.implementation.AmqpConstants; +import com.azure.core.amqp.implementation.ErrorContextProvider; +import com.azure.core.amqp.implementation.TracerProvider; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.tracing.ProcessKind; +import org.apache.qpid.proton.Proton; +import org.apache.qpid.proton.amqp.Binary; +import org.apache.qpid.proton.amqp.Symbol; +import org.apache.qpid.proton.amqp.messaging.ApplicationProperties; +import org.apache.qpid.proton.amqp.messaging.Data; +import org.apache.qpid.proton.amqp.messaging.MessageAnnotations; +import org.apache.qpid.proton.message.Message; +import reactor.core.publisher.Signal; + +import java.nio.BufferOverflowException; +import java.util.HashMap; +import java.util.LinkedList; +import java.util.List; +import java.util.Locale; +import java.util.Objects; +import java.util.Optional; + +import static com.azure.core.util.tracing.Tracer.AZ_TRACING_NAMESPACE_KEY; +import static com.azure.core.util.tracing.Tracer.DIAGNOSTIC_ID_KEY; +import static com.azure.core.util.tracing.Tracer.ENTITY_PATH_KEY; +import static com.azure.core.util.tracing.Tracer.HOST_NAME_KEY; +import static com.azure.core.util.tracing.Tracer.SPAN_CONTEXT_KEY; +import static com.azure.messaging.eventhubs.implementation.ClientConstants.AZ_NAMESPACE_VALUE; + +/** + * Base class containing common implementation for batch sending. + * + * Implemented by {@link ObjectBatch} and {@link EventDataBatch}. + */ +abstract class EventDataBatchBase { + private final ClientLogger logger = new ClientLogger(this.getClass()); + private final Object lock = new Object(); + private final int maxMessageSize; + private final String partitionKey; + private final ErrorContextProvider contextProvider; + private final List events; + private final byte[] eventBytes; + private final String partitionId; + private int sizeInBytes; + private final TracerProvider tracerProvider; + private final String entityPath; + private final String hostname; + + EventDataBatchBase(int maxMessageSize, String partitionId, String partitionKey, + ErrorContextProvider contextProvider, TracerProvider tracerProvider, String entityPath, + String hostname) { + this.maxMessageSize = maxMessageSize; + this.partitionKey = partitionKey; + this.partitionId = partitionId; + this.contextProvider = contextProvider; + this.events = new LinkedList<>(); + this.sizeInBytes = (maxMessageSize / 65536) * 1024; // reserve 1KB for every 64KB + this.eventBytes = new byte[maxMessageSize]; + this.tracerProvider = tracerProvider; + this.entityPath = entityPath; + this.hostname = hostname; + } + + /** + * Gets the number of {@link EventData events} in the batch. + * + * @return The number of {@link EventData events} in the batch. + */ + public int getCount() { + return events.size(); + } + + /** + * Gets the maximum size, in bytes, of the {@link EventDataBatch}. + * + * @return The maximum size, in bytes, of the {@link EventDataBatch}. + */ + public int getMaxSizeInBytes() { + return maxMessageSize; + } + + /** + * Gets the size of the {@link EventDataBatch} in bytes. + * + * @return the size of the {@link EventDataBatch} in bytes. + */ + public int getSizeInBytes() { + return this.sizeInBytes; + } + + /** + * Tries to add an {@link EventData event} to the batch. + * + * @param eventData The {@link EventData} to add to the batch. + * @return {@code true} if the event could be added to the batch; {@code false} if the event was too large to fit in + * the batch. + * @throws IllegalArgumentException if {@code eventData} is {@code null}. + * @throws AmqpException if {@code eventData} is larger than the maximum size of the {@link EventDataBatch}. + */ + public boolean tryAdd(final EventData eventData) { + if (eventData == null) { + throw logger.logExceptionAsWarning(new IllegalArgumentException("eventData cannot be null")); + } + EventData event = tracerProvider.isEnabled() ? traceMessageSpan(eventData) : eventData; + + final int size; + try { + size = getSize(event, events.isEmpty()); + } catch (BufferOverflowException exception) { + throw logger.logExceptionAsWarning(new AmqpException(false, AmqpErrorCondition.LINK_PAYLOAD_SIZE_EXCEEDED, + String.format(Locale.US, "Size of the payload exceeded maximum message size: %s kb", + maxMessageSize / 1024), + contextProvider.getErrorContext())); + } + + synchronized (lock) { + if (this.sizeInBytes + size > this.maxMessageSize) { + return false; + } + + this.sizeInBytes += size; + } + + this.events.add(event); + return true; + } + + + /** + * Method to start and end a "Azure.EventHubs.message" span and add the "DiagnosticId" as a property of the message. + * + * @param eventData The Event to add tracing span for. + * @return the updated event data object. + */ + EventData traceMessageSpan(EventData eventData) { + Optional eventContextData = eventData.getContext().getData(SPAN_CONTEXT_KEY); + if (eventContextData.isPresent()) { + // if message has context (in case of retries), don't start a message span or add a new context + return eventData; + } else { + // Starting the span makes the sampling decision (nothing is logged at this time) + Context eventContext = eventData.getContext() + .addData(AZ_TRACING_NAMESPACE_KEY, AZ_NAMESPACE_VALUE) + .addData(ENTITY_PATH_KEY, this.entityPath) + .addData(HOST_NAME_KEY, this.hostname); + Context eventSpanContext = tracerProvider.startSpan(eventContext, ProcessKind.MESSAGE); + Optional eventDiagnosticIdOptional = eventSpanContext.getData(DIAGNOSTIC_ID_KEY); + if (eventDiagnosticIdOptional.isPresent()) { + eventData.getProperties().put(DIAGNOSTIC_ID_KEY, eventDiagnosticIdOptional.get().toString()); + tracerProvider.endSpan(eventSpanContext, Signal.complete()); + eventData.addContext(SPAN_CONTEXT_KEY, eventSpanContext); + } + } + + return eventData; + } + + List getEvents() { + return events; + } + + String getPartitionKey() { + return partitionKey; + } + + String getPartitionId() { + return partitionId; + } + + int getSize(final EventData eventData, final boolean isFirst) { + Objects.requireNonNull(eventData, "'eventData' cannot be null."); + + final Message amqpMessage = createAmqpMessage(eventData, partitionKey); + int eventSize = amqpMessage.encode(this.eventBytes, 0, maxMessageSize); // actual encoded bytes size + eventSize += 16; // data section overhead + + if (isFirst) { + amqpMessage.setBody(null); + amqpMessage.setApplicationProperties(null); + amqpMessage.setProperties(null); + amqpMessage.setDeliveryAnnotations(null); + + eventSize += amqpMessage.encode(this.eventBytes, 0, maxMessageSize); + } + + return eventSize; + } + + /* + * Creates the AMQP message represented by the event data + */ + private Message createAmqpMessage(EventData event, String partitionKey) { + final Message message = Proton.message(); + + if (event.getProperties() != null && !event.getProperties().isEmpty()) { + final ApplicationProperties applicationProperties = new ApplicationProperties(event.getProperties()); + message.setApplicationProperties(applicationProperties); + } + + if (event.getSystemProperties() != null) { + event.getSystemProperties().forEach((key, value) -> { + if (EventData.RESERVED_SYSTEM_PROPERTIES.contains(key)) { + return; + } + + final AmqpMessageConstant constant = AmqpMessageConstant.fromString(key); + + if (constant != null) { + switch (constant) { + case MESSAGE_ID: + message.setMessageId(value); + break; + case USER_ID: + message.setUserId((byte[]) value); + break; + case TO: + message.setAddress((String) value); + break; + case SUBJECT: + message.setSubject((String) value); + break; + case REPLY_TO: + message.setReplyTo((String) value); + break; + case CORRELATION_ID: + message.setCorrelationId(value); + break; + case CONTENT_TYPE: + message.setContentType((String) value); + break; + case CONTENT_ENCODING: + message.setContentEncoding((String) value); + break; + case ABSOLUTE_EXPIRY_TIME: + message.setExpiryTime((long) value); + break; + case CREATION_TIME: + message.setCreationTime((long) value); + break; + case GROUP_ID: + message.setGroupId((String) value); + break; + case GROUP_SEQUENCE: + message.setGroupSequence((long) value); + break; + case REPLY_TO_GROUP_ID: + message.setReplyToGroupId((String) value); + break; + default: + throw logger.logExceptionAsWarning(new IllegalArgumentException(String.format(Locale.US, + "Property is not a recognized reserved property name: %s", key))); + } + } else { + final MessageAnnotations messageAnnotations = (message.getMessageAnnotations() == null) + ? new MessageAnnotations(new HashMap<>()) + : message.getMessageAnnotations(); + messageAnnotations.getValue().put(Symbol.getSymbol(key), value); + message.setMessageAnnotations(messageAnnotations); + } + }); + } + + if (partitionKey != null) { + final MessageAnnotations messageAnnotations = (message.getMessageAnnotations() == null) + ? new MessageAnnotations(new HashMap<>()) + : message.getMessageAnnotations(); + messageAnnotations.getValue().put(AmqpConstants.PARTITION_KEY, partitionKey); + message.setMessageAnnotations(messageAnnotations); + } + + message.setBody(new Data(new Binary(event.getBody()))); + + return message; + } +} diff --git a/sdk/eventhubs/azure-messaging-eventhubs/src/main/java/com/azure/messaging/eventhubs/EventHubAsyncClient.java b/sdk/eventhubs/azure-messaging-eventhubs/src/main/java/com/azure/messaging/eventhubs/EventHubAsyncClient.java index 3a0598a08da51..27191d8d1f985 100644 --- a/sdk/eventhubs/azure-messaging-eventhubs/src/main/java/com/azure/messaging/eventhubs/EventHubAsyncClient.java +++ b/sdk/eventhubs/azure-messaging-eventhubs/src/main/java/com/azure/messaging/eventhubs/EventHubAsyncClient.java @@ -5,6 +5,7 @@ import com.azure.core.amqp.implementation.MessageSerializer; import com.azure.core.amqp.implementation.TracerProvider; +import com.azure.core.experimental.serializer.ObjectSerializer; import com.azure.core.util.logging.ClientLogger; import com.azure.messaging.eventhubs.implementation.EventHubConnectionProcessor; import com.azure.messaging.eventhubs.implementation.EventHubManagementNode; @@ -32,9 +33,11 @@ class EventHubAsyncClient implements Closeable { private final boolean isSharedConnection; private final Runnable onClientClose; private final TracerProvider tracerProvider; + private final ObjectSerializer serializer; EventHubAsyncClient(EventHubConnectionProcessor connectionProcessor, TracerProvider tracerProvider, - MessageSerializer messageSerializer, Scheduler scheduler, boolean isSharedConnection, Runnable onClientClose) { + MessageSerializer messageSerializer, ObjectSerializer serializer, Scheduler scheduler, + boolean isSharedConnection, Runnable onClientClose) { this.tracerProvider = Objects.requireNonNull(tracerProvider, "'tracerProvider' cannot be null."); this.messageSerializer = Objects.requireNonNull(messageSerializer, "'messageSerializer' cannot be null."); this.connectionProcessor = Objects.requireNonNull(connectionProcessor, @@ -43,6 +46,7 @@ class EventHubAsyncClient implements Closeable { this.onClientClose = Objects.requireNonNull(onClientClose, "'onClientClose' cannot be null."); this.isSharedConnection = isSharedConnection; + this.serializer = serializer; } /** @@ -104,8 +108,8 @@ Mono getPartitionProperties(String partitionId) { */ EventHubProducerAsyncClient createProducer() { return new EventHubProducerAsyncClient(connectionProcessor.getFullyQualifiedNamespace(), getEventHubName(), - connectionProcessor, connectionProcessor.getRetryOptions(), tracerProvider, messageSerializer, scheduler, - isSharedConnection, onClientClose); + connectionProcessor, connectionProcessor.getRetryOptions(), tracerProvider, messageSerializer, + serializer, scheduler, isSharedConnection, onClientClose); } /** @@ -129,8 +133,8 @@ EventHubConsumerAsyncClient createConsumer(String consumerGroup, int prefetchCou } return new EventHubConsumerAsyncClient(connectionProcessor.getFullyQualifiedNamespace(), getEventHubName(), - connectionProcessor, messageSerializer, consumerGroup, prefetchCount, scheduler, isSharedConnection, - onClientClose); + connectionProcessor, messageSerializer, serializer, consumerGroup, prefetchCount, scheduler, + isSharedConnection, onClientClose); } /** diff --git a/sdk/eventhubs/azure-messaging-eventhubs/src/main/java/com/azure/messaging/eventhubs/EventHubClientBuilder.java b/sdk/eventhubs/azure-messaging-eventhubs/src/main/java/com/azure/messaging/eventhubs/EventHubClientBuilder.java index 009168ce8e933..76b66e4b5f17e 100644 --- a/sdk/eventhubs/azure-messaging-eventhubs/src/main/java/com/azure/messaging/eventhubs/EventHubClientBuilder.java +++ b/sdk/eventhubs/azure-messaging-eventhubs/src/main/java/com/azure/messaging/eventhubs/EventHubClientBuilder.java @@ -20,6 +20,7 @@ import com.azure.core.annotation.ServiceClientBuilder; import com.azure.core.credential.TokenCredential; import com.azure.core.exception.AzureException; +import com.azure.core.experimental.serializer.ObjectSerializer; import com.azure.core.util.Configuration; import com.azure.core.util.CoreUtils; import com.azure.core.util.logging.ClientLogger; @@ -135,6 +136,7 @@ public class EventHubClientBuilder { private String consumerGroup; private EventHubConnectionProcessor eventHubConnectionProcessor; private int prefetchCount; + private ObjectSerializer serializer; /** * Keeps track of the open clients that were created from this builder when there is a shared connection. @@ -361,6 +363,18 @@ public EventHubClientBuilder prefetchCount(int prefetchCount) { return this; } + /** + * Set ObjectSerializer implementation to be used for creating ObjectBatch. + * + * @param serializer ObjectSerializer implementation + * + * @return updated builder instance + */ + public EventHubClientBuilder serializer(ObjectSerializer serializer) { + this.serializer = serializer; + return this; + } + /** * Package-private method that sets the scheduler for the created Event Hub client. * @@ -485,7 +499,7 @@ EventHubAsyncClient buildAsyncClient() { final TracerProvider tracerProvider = new TracerProvider(ServiceLoader.load(Tracer.class)); - return new EventHubAsyncClient(processor, tracerProvider, messageSerializer, scheduler, + return new EventHubAsyncClient(processor, tracerProvider, messageSerializer, serializer, scheduler, isSharedConnection.get(), this::onClientClose); } diff --git a/sdk/eventhubs/azure-messaging-eventhubs/src/main/java/com/azure/messaging/eventhubs/EventHubConsumerAsyncClient.java b/sdk/eventhubs/azure-messaging-eventhubs/src/main/java/com/azure/messaging/eventhubs/EventHubConsumerAsyncClient.java index 335fc7d3a9735..ae986f147a2c0 100644 --- a/sdk/eventhubs/azure-messaging-eventhubs/src/main/java/com/azure/messaging/eventhubs/EventHubConsumerAsyncClient.java +++ b/sdk/eventhubs/azure-messaging-eventhubs/src/main/java/com/azure/messaging/eventhubs/EventHubConsumerAsyncClient.java @@ -11,6 +11,7 @@ import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceClient; import com.azure.core.annotation.ServiceMethod; +import com.azure.core.experimental.serializer.ObjectSerializer; import com.azure.core.util.logging.ClientLogger; import com.azure.messaging.eventhubs.implementation.AmqpReceiveLinkProcessor; import com.azure.messaging.eventhubs.implementation.EventHubConnectionProcessor; @@ -70,6 +71,7 @@ public class EventHubConsumerAsyncClient implements Closeable { private final String eventHubName; private final EventHubConnectionProcessor connectionProcessor; private final MessageSerializer messageSerializer; + private final ObjectSerializer serializer; private final String consumerGroup; private final int prefetchCount; private final Scheduler scheduler; @@ -83,12 +85,15 @@ public class EventHubConsumerAsyncClient implements Closeable { new ConcurrentHashMap<>(); EventHubConsumerAsyncClient(String fullyQualifiedNamespace, String eventHubName, - EventHubConnectionProcessor connectionProcessor, MessageSerializer messageSerializer, String consumerGroup, - int prefetchCount, Scheduler scheduler, boolean isSharedConnection, Runnable onClientClosed) { + EventHubConnectionProcessor connectionProcessor, + MessageSerializer messageSerializer, ObjectSerializer serializer, + String consumerGroup, int prefetchCount, Scheduler scheduler, + boolean isSharedConnection, Runnable onClientClosed) { this.fullyQualifiedNamespace = fullyQualifiedNamespace; this.eventHubName = eventHubName; this.connectionProcessor = connectionProcessor; this.messageSerializer = messageSerializer; + this.serializer = serializer; this.consumerGroup = consumerGroup; this.prefetchCount = prefetchCount; this.scheduler = scheduler; @@ -364,7 +369,7 @@ private EventHubPartitionAsyncConsumer createPartitionConsumer(String linkName, new AmqpReceiveLinkProcessor(prefetchCount, retryPolicy, connectionProcessor)); return new EventHubPartitionAsyncConsumer(linkMessageProcessor, messageSerializer, getFullyQualifiedNamespace(), - getEventHubName(), consumerGroup, partitionId, initialPosition, - receiveOptions.getTrackLastEnqueuedEventProperties(), scheduler); + getEventHubName(), consumerGroup, partitionId, serializer, + initialPosition, receiveOptions.getTrackLastEnqueuedEventProperties(), scheduler); } } diff --git a/sdk/eventhubs/azure-messaging-eventhubs/src/main/java/com/azure/messaging/eventhubs/EventHubPartitionAsyncConsumer.java b/sdk/eventhubs/azure-messaging-eventhubs/src/main/java/com/azure/messaging/eventhubs/EventHubPartitionAsyncConsumer.java index d0b070343d4d6..950d4c532674c 100644 --- a/sdk/eventhubs/azure-messaging-eventhubs/src/main/java/com/azure/messaging/eventhubs/EventHubPartitionAsyncConsumer.java +++ b/sdk/eventhubs/azure-messaging-eventhubs/src/main/java/com/azure/messaging/eventhubs/EventHubPartitionAsyncConsumer.java @@ -4,6 +4,7 @@ package com.azure.messaging.eventhubs; import com.azure.core.amqp.implementation.MessageSerializer; +import com.azure.core.experimental.serializer.ObjectSerializer; import com.azure.core.util.logging.ClientLogger; import com.azure.messaging.eventhubs.implementation.AmqpReceiveLinkProcessor; import com.azure.messaging.eventhubs.models.EventPosition; @@ -39,13 +40,16 @@ class EventHubPartitionAsyncConsumer implements AutoCloseable { private final Scheduler scheduler; private final EmitterProcessor emitterProcessor; private final EventPosition initialPosition; + private final ObjectSerializer serializer; private volatile Long currentOffset; EventHubPartitionAsyncConsumer(AmqpReceiveLinkProcessor amqpReceiveLinkProcessor, - MessageSerializer messageSerializer, String fullyQualifiedNamespace, String eventHubName, String consumerGroup, - String partitionId, AtomicReference> currentEventPosition, - boolean trackLastEnqueuedEventProperties, Scheduler scheduler) { + MessageSerializer messageSerializer, String fullyQualifiedNamespace, + String eventHubName, String consumerGroup, String partitionId, + ObjectSerializer serializer, + AtomicReference> currentEventPosition, + boolean trackLastEnqueuedEventProperties, Scheduler scheduler) { this.initialPosition = Objects.requireNonNull(currentEventPosition.get().get(), "'currentEventPosition.get().get()' cannot be null."); this.amqpReceiveLinkProcessor = amqpReceiveLinkProcessor; @@ -54,6 +58,7 @@ class EventHubPartitionAsyncConsumer implements AutoCloseable { this.eventHubName = eventHubName; this.consumerGroup = consumerGroup; this.partitionId = partitionId; + this.serializer = serializer; this.trackLastEnqueuedEventProperties = trackLastEnqueuedEventProperties; this.scheduler = Objects.requireNonNull(scheduler, "'scheduler' cannot be null."); @@ -138,6 +143,6 @@ private PartitionEvent onMessageReceived(Message message) { final PartitionContext partitionContext = new PartitionContext(fullyQualifiedNamespace, eventHubName, consumerGroup, partitionId); - return new PartitionEvent(partitionContext, event, lastEnqueuedEventProperties.get()); + return new PartitionEvent(partitionContext, event, lastEnqueuedEventProperties.get(), this.serializer); } } diff --git a/sdk/eventhubs/azure-messaging-eventhubs/src/main/java/com/azure/messaging/eventhubs/EventHubProducerAsyncClient.java b/sdk/eventhubs/azure-messaging-eventhubs/src/main/java/com/azure/messaging/eventhubs/EventHubProducerAsyncClient.java index f2a81b0ba5bd5..f7906c6a573a5 100644 --- a/sdk/eventhubs/azure-messaging-eventhubs/src/main/java/com/azure/messaging/eventhubs/EventHubProducerAsyncClient.java +++ b/sdk/eventhubs/azure-messaging-eventhubs/src/main/java/com/azure/messaging/eventhubs/EventHubProducerAsyncClient.java @@ -15,6 +15,7 @@ import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceClient; import com.azure.core.annotation.ServiceMethod; +import com.azure.core.experimental.serializer.ObjectSerializer; import com.azure.core.util.Context; import com.azure.core.util.CoreUtils; import com.azure.core.util.logging.ClientLogger; @@ -110,6 +111,7 @@ public class EventHubProducerAsyncClient implements Closeable { private final Scheduler scheduler; private final boolean isSharedConnection; private final Runnable onClientClose; + private final ObjectSerializer serializer; /** * Creates a new instance of this {@link EventHubProducerAsyncClient} that can send messages to a single partition @@ -117,8 +119,10 @@ public class EventHubProducerAsyncClient implements Closeable { * load balance the messages amongst available partitions. */ EventHubProducerAsyncClient(String fullyQualifiedNamespace, String eventHubName, - EventHubConnectionProcessor connectionProcessor, AmqpRetryOptions retryOptions, TracerProvider tracerProvider, - MessageSerializer messageSerializer, Scheduler scheduler, boolean isSharedConnection, Runnable onClientClose) { + EventHubConnectionProcessor connectionProcessor, AmqpRetryOptions retryOptions, + TracerProvider tracerProvider, MessageSerializer messageSerializer, + ObjectSerializer serializer, Scheduler scheduler, boolean isSharedConnection, + Runnable onClientClose) { this.fullyQualifiedNamespace = Objects.requireNonNull(fullyQualifiedNamespace, "'fullyQualifiedNamespace' cannot be null."); this.eventHubName = Objects.requireNonNull(eventHubName, "'eventHubName' cannot be null."); @@ -132,6 +136,7 @@ public class EventHubProducerAsyncClient implements Closeable { this.retryPolicy = getRetryPolicy(retryOptions); this.scheduler = scheduler; this.isSharedConnection = isSharedConnection; + this.serializer = serializer; } /** @@ -208,6 +213,11 @@ public Mono createBatch(CreateBatchOptions options) { return monoError(logger, new NullPointerException("'options' cannot be null.")); } + Mono optionsError = validateBatchOptions(options); + if (optionsError != null) { + return optionsError; + } + final String partitionKey = options.getPartitionKey(); final String partitionId = options.getPartitionId(); final int batchMaxSize = options.getMaximumSizeInBytes(); @@ -248,6 +258,71 @@ public Mono createBatch(CreateBatchOptions options) { })); } + /** + * Creates an {@link ObjectBatch} that can fit as many serialized objects as events as the transport allows. + * @param objectType type of object in the batch + * @param object type + * + * @return A new {@link ObjectBatch} that can fit as many serialized objects as events as the transport allows. + */ + public Mono> createBatch(Class objectType) { + return createBatch(objectType, DEFAULT_BATCH_OPTIONS); + } + + /** + * Creates an {@link ObjectBatch} configured with the options specified. + * + * @param objectType type of object in the batch + * @param object type + * @param options A set of options used to configure the {@link ObjectBatch}. + * @return A new {@link ObjectBatch} that can fit as many events as the transport allows. + * @throws NullPointerException if {@code options} is null. + */ + public Mono> createBatch(Class objectType, CreateBatchOptions options) { + if (objectType == null) { + return monoError(logger, new IllegalArgumentException("'objectType' cannot be null.")); + } + if (serializer == null) { + return monoError(logger, + new NullPointerException("No serializer set for performing object serialization for ObjectBatch.")); + } + if (options == null) { + return monoError(logger, new NullPointerException("'options' cannot be null.")); + } + + Mono> optionsError = validateBatchOptions(options); + if (optionsError != null) { + return optionsError; + } + + final String partitionKey = options.getPartitionKey(); + final String partitionId = options.getPartitionId(); + final int batchMaxSize = options.getMaximumSizeInBytes(); + + return getSendLink(partitionId) + .flatMap(link -> link.getLinkSize() + .flatMap(size -> { + final int maximumLinkSize = size > 0 + ? size + : MAX_MESSAGE_LENGTH_BYTES; + + if (batchMaxSize > maximumLinkSize) { + return monoError(logger, + new IllegalArgumentException(String.format(Locale.US, + "BatchOptions.maximumSizeInBytes (%s bytes) is larger than the link size (%s bytes).", + batchMaxSize, maximumLinkSize))); + } + + final int batchSize = batchMaxSize > 0 + ? batchMaxSize + : maximumLinkSize; + + return Mono.just(new ObjectBatch<>(batchSize, partitionId, partitionKey, objectType, + link::getErrorContext, tracerProvider, serializer, + link.getEntityPath(), link.getHostname())); + })); + } + /** * Sends a single event to the associated Event Hub. If the size of the single event exceeds the maximum size * allowed, an exception will be triggered and the send will fail. @@ -510,6 +585,22 @@ private Mono getSendLink(String partitionId) { .flatMap(connection -> connection.createSendLink(linkName, entityPath, retryOptions)); } + private Mono validateBatchOptions(CreateBatchOptions options) { + if (!CoreUtils.isNullOrEmpty(options.getPartitionKey()) + && !CoreUtils.isNullOrEmpty(options.getPartitionId())) { + return monoError(logger, new IllegalArgumentException(String.format(Locale.US, + "CreateBatchOptions.getPartitionKey() and CreateBatchOptions.getPartitionId() are both set. " + + "Only one or the other can be used. partitionKey: '%s'. partitionId: '%s'", + options.getPartitionKey(), options.getPartitionId()))); + } else if (!CoreUtils.isNullOrEmpty(options.getPartitionKey()) + && options.getPartitionKey().length() > MAX_PARTITION_KEY_LENGTH) { + return monoError(logger, new IllegalArgumentException(String.format(Locale.US, + "Partition key '%s' exceeds the maximum allowed length: '%s'.", options.getPartitionKey(), + MAX_PARTITION_KEY_LENGTH))); + } + return null; + } + /** * Disposes of the {@link EventHubProducerAsyncClient}. If the client had a dedicated connection, the underlying * connection is also closed. diff --git a/sdk/eventhubs/azure-messaging-eventhubs/src/main/java/com/azure/messaging/eventhubs/ObjectBatch.java b/sdk/eventhubs/azure-messaging-eventhubs/src/main/java/com/azure/messaging/eventhubs/ObjectBatch.java new file mode 100644 index 0000000000000..587e98d31f68d --- /dev/null +++ b/sdk/eventhubs/azure-messaging-eventhubs/src/main/java/com/azure/messaging/eventhubs/ObjectBatch.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.messaging.eventhubs; + +import com.azure.core.amqp.exception.AmqpException; +import com.azure.core.amqp.implementation.ErrorContextProvider; +import com.azure.core.amqp.implementation.TracerProvider; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.experimental.serializer.ObjectSerializer; +import reactor.core.publisher.Mono; + +import java.io.ByteArrayOutputStream; +import java.util.Objects; + +import static com.azure.core.util.FluxUtil.monoError; + +/** + * A class for aggregating Java objects into a single, size-limited, batch. Objects are serialized into EventData + * objects and are added to the batch. It is treated as a single message when sent to the Azure Event Hubs service. + * + * @param type of objects in the batch. Multi-type batches are not permitted. + */ +public final class ObjectBatch extends EventDataBatchBase { + private final ClientLogger logger = new ClientLogger(ObjectBatch.class); + private final Class batchType; + private final ObjectSerializer serializer; + + ObjectBatch(int maxMessageSize, String partitionId, String partitionKey, Class batchType, + ErrorContextProvider contextProvider, TracerProvider tracerProvider, + ObjectSerializer serializer, String entityPath, String hostname) { + super(maxMessageSize, partitionId, partitionKey, contextProvider, tracerProvider, entityPath, hostname); + this.batchType = Objects.requireNonNull(batchType, "'batchType' cannot be null."); + this.serializer = Objects.requireNonNull(serializer, "'serializer' cannot be null."); + } + + /** + * Tries to asynchronously serialize an object into an EventData payload and add the EventData to the batch. + * + * @param object The object to add to the batch. + * @return {@code true} if the object could be added to the batch; {@code false} if the serialized + * object was too large to fit in the batch. + * @throws IllegalArgumentException if object is {@code null}. + * @throws AmqpException if serialized object as {@link EventData} is larger than the maximum size + * of the {@link EventDataBatch}. + */ + public Mono tryAdd(final T object) { + if (object == null) { + return monoError(logger, new IllegalArgumentException("object cannot be null")); + } + + ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); + return serializer.serialize(outputStream, object).map(s -> tryAdd(new EventData(s.toByteArray()))); + } +} diff --git a/sdk/eventhubs/azure-messaging-eventhubs/src/main/java/com/azure/messaging/eventhubs/models/PartitionEvent.java b/sdk/eventhubs/azure-messaging-eventhubs/src/main/java/com/azure/messaging/eventhubs/models/PartitionEvent.java index 838025b1eff4e..cc7f9b2dcf61c 100644 --- a/sdk/eventhubs/azure-messaging-eventhubs/src/main/java/com/azure/messaging/eventhubs/models/PartitionEvent.java +++ b/sdk/eventhubs/azure-messaging-eventhubs/src/main/java/com/azure/messaging/eventhubs/models/PartitionEvent.java @@ -4,10 +4,16 @@ package com.azure.messaging.eventhubs.models; import com.azure.core.annotation.Immutable; +import com.azure.core.experimental.serializer.ObjectSerializer; +import com.azure.core.util.logging.ClientLogger; import com.azure.messaging.eventhubs.EventData; +import reactor.core.publisher.Mono; +import java.io.ByteArrayInputStream; import java.util.Objects; +import static com.azure.core.util.FluxUtil.monoError; + /** * A container for {@link EventData} along with the partition information for this event data. */ @@ -17,6 +23,21 @@ public class PartitionEvent { private final PartitionContext partitionContext; private final EventData eventData; private final LastEnqueuedEventProperties lastEnqueuedEventProperties; + private final ObjectSerializer serializer; + private final ClientLogger logger = new ClientLogger(PartitionEvent.class); + + /** + * Creates an instance of PartitionEvent. + * + * @param partitionContext The partition information associated with the event data. + * @param eventData The event data received from the Event Hub. + * @param lastEnqueuedEventProperties The properties of the last enqueued event in the partition. + * @throws NullPointerException if {@code partitionContext} or {@code eventData} is {@code null}. + */ + public PartitionEvent(final PartitionContext partitionContext, final EventData eventData, + LastEnqueuedEventProperties lastEnqueuedEventProperties) { + this(partitionContext, eventData, lastEnqueuedEventProperties, null); + } /** * Creates an instance of PartitionEvent. @@ -24,13 +45,15 @@ public class PartitionEvent { * @param partitionContext The partition information associated with the event data. * @param eventData The event data received from the Event Hub. * @param lastEnqueuedEventProperties The properties of the last enqueued event in the partition. + * @param serializer ObjectSerializer implementation for deserializing event data payload. May be null. * @throws NullPointerException if {@code partitionContext} or {@code eventData} is {@code null}. */ public PartitionEvent(final PartitionContext partitionContext, final EventData eventData, - LastEnqueuedEventProperties lastEnqueuedEventProperties) { + LastEnqueuedEventProperties lastEnqueuedEventProperties, ObjectSerializer serializer) { this.partitionContext = Objects.requireNonNull(partitionContext, "'partitionContext' cannot be null"); this.eventData = Objects.requireNonNull(eventData, "'eventData' cannot be null"); this.lastEnqueuedEventProperties = lastEnqueuedEventProperties; + this.serializer = serializer; } /** @@ -59,4 +82,23 @@ public EventData getData() { public LastEnqueuedEventProperties getLastEnqueuedEventProperties() { return lastEnqueuedEventProperties; } + + /** + * Deserializes event payload into object. + * + * @param objectType Class object of type T + * @param object type for deserialization + * @return deserialized object as type T + */ + public Mono getDeserializedObject(Class objectType) { + if (this.serializer == null) { + return monoError(logger, + new NullPointerException("No serializer set for deserializing EventData payload.")); + } + if (objectType == null) { + return monoError(logger, new IllegalArgumentException("objectType cannot be null.")); + } + + return serializer.deserialize(new ByteArrayInputStream(eventData.getBody()), objectType); + } } diff --git a/sdk/eventhubs/azure-messaging-eventhubs/src/main/java/module-info.java b/sdk/eventhubs/azure-messaging-eventhubs/src/main/java/module-info.java index 0386dee075a72..e743ad96cb64a 100644 --- a/sdk/eventhubs/azure-messaging-eventhubs/src/main/java/module-info.java +++ b/sdk/eventhubs/azure-messaging-eventhubs/src/main/java/module-info.java @@ -3,6 +3,7 @@ module com.azure.messaging.eventhubs { requires transitive com.azure.core; + requires transitive com.azure.core.experimental; requires transitive com.azure.core.amqp; requires com.microsoft.azure.qpid.protonj.extensions; diff --git a/sdk/eventhubs/azure-messaging-eventhubs/src/test/java/com/azure/messaging/eventhubs/EventDataBatchTest.java b/sdk/eventhubs/azure-messaging-eventhubs/src/test/java/com/azure/messaging/eventhubs/EventDataBatchBaseTest.java similarity index 98% rename from sdk/eventhubs/azure-messaging-eventhubs/src/test/java/com/azure/messaging/eventhubs/EventDataBatchTest.java rename to sdk/eventhubs/azure-messaging-eventhubs/src/test/java/com/azure/messaging/eventhubs/EventDataBatchBaseTest.java index ea85afedd71f0..8a8a529ff7ab7 100644 --- a/sdk/eventhubs/azure-messaging-eventhubs/src/test/java/com/azure/messaging/eventhubs/EventDataBatchTest.java +++ b/sdk/eventhubs/azure-messaging-eventhubs/src/test/java/com/azure/messaging/eventhubs/EventDataBatchBaseTest.java @@ -20,7 +20,7 @@ import static org.junit.jupiter.api.Assertions.assertThrows; import static org.mockito.Mockito.when; -public class EventDataBatchTest { +public class EventDataBatchBaseTest { private static final String PARTITION_KEY = "PartitionIDCopyFromProducerOption"; @Mock diff --git a/sdk/eventhubs/azure-messaging-eventhubs/src/test/java/com/azure/messaging/eventhubs/EventHubConsumerAsyncClientTest.java b/sdk/eventhubs/azure-messaging-eventhubs/src/test/java/com/azure/messaging/eventhubs/EventHubConsumerAsyncClientTest.java index c37f1686c710d..ce9461c31e179 100644 --- a/sdk/eventhubs/azure-messaging-eventhubs/src/test/java/com/azure/messaging/eventhubs/EventHubConsumerAsyncClientTest.java +++ b/sdk/eventhubs/azure-messaging-eventhubs/src/test/java/com/azure/messaging/eventhubs/EventHubConsumerAsyncClientTest.java @@ -136,7 +136,7 @@ CbsAuthorizationType.SHARED_ACCESS_SIGNATURE, AmqpTransportType.AMQP_WEB_SOCKETS .subscribeWith(new EventHubConnectionProcessor(connectionOptions.getFullyQualifiedNamespace(), "event-hub-name", connectionOptions.getRetry())); - consumer = new EventHubConsumerAsyncClient(HOSTNAME, EVENT_HUB_NAME, connectionProcessor, messageSerializer, + consumer = new EventHubConsumerAsyncClient(HOSTNAME, EVENT_HUB_NAME, connectionProcessor, messageSerializer, null, CONSUMER_GROUP, PREFETCH, parallelScheduler, false, onClientClosed); } @@ -156,7 +156,7 @@ void teardown() { @Test void lastEnqueuedEventInformationIsNull() { final EventHubConsumerAsyncClient runtimeConsumer = new EventHubConsumerAsyncClient(HOSTNAME, EVENT_HUB_NAME, - connectionProcessor, messageSerializer, CONSUMER_GROUP, DEFAULT_PREFETCH_COUNT, parallelScheduler, false, onClientClosed); + connectionProcessor, messageSerializer, null, CONSUMER_GROUP, DEFAULT_PREFETCH_COUNT, parallelScheduler, false, onClientClosed); final int numberOfEvents = 10; when(amqpReceiveLink.getCredits()).thenReturn(numberOfEvents); final int numberToReceive = 3; @@ -179,7 +179,7 @@ void lastEnqueuedEventInformationIsNull() { void lastEnqueuedEventInformationCreated() { // Arrange final EventHubConsumerAsyncClient runtimeConsumer = new EventHubConsumerAsyncClient(HOSTNAME, EVENT_HUB_NAME, - connectionProcessor, messageSerializer, CONSUMER_GROUP, DEFAULT_PREFETCH_COUNT, Schedulers.parallel(), false, onClientClosed); + connectionProcessor, messageSerializer, null, CONSUMER_GROUP, DEFAULT_PREFETCH_COUNT, Schedulers.parallel(), false, onClientClosed); final int numberOfEvents = 10; final ReceiveOptions receiveOptions = new ReceiveOptions().setTrackLastEnqueuedEventProperties(true); when(amqpReceiveLink.getCredits()).thenReturn(numberOfEvents); @@ -232,7 +232,7 @@ void receivesNumberOfEventsAllowsBlock() throws InterruptedException { // Scheduling on elastic to simulate a user passed in scheduler (this is the default in EventHubClientBuilder). final EventHubConsumerAsyncClient myConsumer = new EventHubConsumerAsyncClient(HOSTNAME, EVENT_HUB_NAME, - connectionProcessor, messageSerializer, CONSUMER_GROUP, PREFETCH, Schedulers.elastic(), false, onClientClosed); + connectionProcessor, messageSerializer, null, CONSUMER_GROUP, PREFETCH, Schedulers.elastic(), false, onClientClosed); final Flux eventsFlux = myConsumer.receiveFromPartition(PARTITION_ID, EventPosition.earliest()) .take(numberOfEvents); @@ -294,7 +294,7 @@ void returnsNewListener() { any(ReceiveOptions.class))).thenReturn(Mono.just(link2), Mono.just(link3)); EventHubConsumerAsyncClient asyncClient = new EventHubConsumerAsyncClient(HOSTNAME, EVENT_HUB_NAME, - eventHubConnection, messageSerializer, CONSUMER_GROUP, PREFETCH, testScheduler, false, onClientClosed); + eventHubConnection, messageSerializer, null, CONSUMER_GROUP, PREFETCH, testScheduler, false, onClientClosed); // Act & Assert StepVerifier.create(asyncClient.receiveFromPartition(PARTITION_ID, EventPosition.earliest()).take(numberOfEvents)) @@ -517,7 +517,7 @@ void receivesMultiplePartitions() { .thenReturn(Mono.just(new EventHubProperties(EVENT_HUB_NAME, Instant.EPOCH, partitions))); EventHubConsumerAsyncClient asyncClient = new EventHubConsumerAsyncClient(HOSTNAME, EVENT_HUB_NAME, - eventHubConnection, messageSerializer, CONSUMER_GROUP, PREFETCH, parallelScheduler, false, onClientClosed); + eventHubConnection, messageSerializer, null, CONSUMER_GROUP, PREFETCH, parallelScheduler, false, onClientClosed); EmitterProcessor processor2 = EmitterProcessor.create(); FluxSink processor2sink = processor2.sink(); @@ -592,7 +592,7 @@ void receivesMultiplePartitionsWhenOneCloses() { .thenReturn(Mono.just(new EventHubProperties(EVENT_HUB_NAME, Instant.EPOCH, partitions))); EventHubConsumerAsyncClient asyncClient = new EventHubConsumerAsyncClient(HOSTNAME, EVENT_HUB_NAME, - eventHubConnection, messageSerializer, CONSUMER_GROUP, PREFETCH, Schedulers.parallel(), false, onClientClosed); + eventHubConnection, messageSerializer, null, CONSUMER_GROUP, PREFETCH, Schedulers.parallel(), false, onClientClosed); EmitterProcessor processor2 = EmitterProcessor.create(); FluxSink processor2sink = processor2.sink(); @@ -652,7 +652,7 @@ void doesNotCloseSharedConnection() { EventHubConnectionProcessor eventHubConnection = Flux.create(sink -> sink.next(connection1)) .subscribeWith(new EventHubConnectionProcessor(HOSTNAME, EVENT_HUB_NAME, retryOptions)); EventHubConsumerAsyncClient sharedConsumer = new EventHubConsumerAsyncClient(HOSTNAME, EVENT_HUB_NAME, - eventHubConnection, messageSerializer, CONSUMER_GROUP, PREFETCH, Schedulers.parallel(), true, onClientClosed); + eventHubConnection, messageSerializer, null, CONSUMER_GROUP, PREFETCH, Schedulers.parallel(), true, onClientClosed); // Act sharedConsumer.close(); @@ -672,7 +672,7 @@ void closesDedicatedConnection() { // Arrange EventHubConnectionProcessor hubConnection = mock(EventHubConnectionProcessor.class); EventHubConsumerAsyncClient dedicatedConsumer = new EventHubConsumerAsyncClient(HOSTNAME, EVENT_HUB_NAME, - hubConnection, messageSerializer, CONSUMER_GROUP, PREFETCH, Schedulers.parallel(), false, onClientClosed); + hubConnection, messageSerializer, null, CONSUMER_GROUP, PREFETCH, Schedulers.parallel(), false, onClientClosed); // Act dedicatedConsumer.close(); diff --git a/sdk/eventhubs/azure-messaging-eventhubs/src/test/java/com/azure/messaging/eventhubs/EventHubConsumerClientTest.java b/sdk/eventhubs/azure-messaging-eventhubs/src/test/java/com/azure/messaging/eventhubs/EventHubConsumerClientTest.java index b05a875f23617..6aa9c9cb85fdb 100644 --- a/sdk/eventhubs/azure-messaging-eventhubs/src/test/java/com/azure/messaging/eventhubs/EventHubConsumerClientTest.java +++ b/sdk/eventhubs/azure-messaging-eventhubs/src/test/java/com/azure/messaging/eventhubs/EventHubConsumerClientTest.java @@ -118,7 +118,7 @@ CbsAuthorizationType.SHARED_ACCESS_SIGNATURE, AmqpTransportType.AMQP_WEB_SOCKETS })); asyncConsumer = new EventHubConsumerAsyncClient(HOSTNAME, EVENT_HUB_NAME, - connectionProcessor, messageSerializer, CONSUMER_GROUP, PREFETCH, Schedulers.parallel(), false, onClientClosed); + connectionProcessor, messageSerializer, null, CONSUMER_GROUP, PREFETCH, Schedulers.parallel(), false, onClientClosed); consumer = new EventHubConsumerClient(asyncConsumer, Duration.ofSeconds(10)); } @@ -142,8 +142,8 @@ public static void dispose() { public void lastEnqueuedEventInformationIsNull() { // Arrange final EventHubConsumerAsyncClient runtimeConsumer = new EventHubConsumerAsyncClient( - HOSTNAME, EVENT_HUB_NAME, connectionProcessor, messageSerializer, CONSUMER_GROUP, - PREFETCH, Schedulers.parallel(), false, onClientClosed); + HOSTNAME, EVENT_HUB_NAME, connectionProcessor, messageSerializer, null, + CONSUMER_GROUP, PREFETCH, Schedulers.parallel(), false, onClientClosed); final EventHubConsumerClient consumer = new EventHubConsumerClient(runtimeConsumer, Duration.ofSeconds(5)); final int numberOfEvents = 10; sendMessages(sink, numberOfEvents, PARTITION_ID); @@ -172,8 +172,8 @@ public void lastEnqueuedEventInformationCreated() { // Arrange final ReceiveOptions options = new ReceiveOptions().setTrackLastEnqueuedEventProperties(true); final EventHubConsumerAsyncClient runtimeConsumer = new EventHubConsumerAsyncClient( - HOSTNAME, EVENT_HUB_NAME, connectionProcessor, messageSerializer, CONSUMER_GROUP, PREFETCH, - Schedulers.parallel(), false, onClientClosed); + HOSTNAME, EVENT_HUB_NAME, connectionProcessor, messageSerializer, null, CONSUMER_GROUP, + PREFETCH, Schedulers.parallel(), false, onClientClosed); final EventHubConsumerClient consumer = new EventHubConsumerClient(runtimeConsumer, Duration.ofSeconds(5)); final int numberOfEvents = 10; diff --git a/sdk/eventhubs/azure-messaging-eventhubs/src/test/java/com/azure/messaging/eventhubs/EventHubPartitionAsyncConsumerTest.java b/sdk/eventhubs/azure-messaging-eventhubs/src/test/java/com/azure/messaging/eventhubs/EventHubPartitionAsyncConsumerTest.java index 3510200950493..64cd339cbd64e 100644 --- a/sdk/eventhubs/azure-messaging-eventhubs/src/test/java/com/azure/messaging/eventhubs/EventHubPartitionAsyncConsumerTest.java +++ b/sdk/eventhubs/azure-messaging-eventhubs/src/test/java/com/azure/messaging/eventhubs/EventHubPartitionAsyncConsumerTest.java @@ -8,6 +8,7 @@ import com.azure.core.amqp.AmqpRetryPolicy; import com.azure.core.amqp.implementation.AmqpReceiveLink; import com.azure.core.amqp.implementation.MessageSerializer; +import com.azure.core.experimental.serializer.ObjectSerializer; import com.azure.core.util.Context; import com.azure.core.util.logging.ClientLogger; import com.azure.messaging.eventhubs.implementation.AmqpReceiveLinkProcessor; @@ -30,9 +31,12 @@ import reactor.core.publisher.DirectProcessor; import reactor.core.publisher.Flux; import reactor.core.publisher.FluxSink; +import reactor.core.publisher.Mono; import reactor.core.scheduler.Schedulers; import reactor.test.StepVerifier; +import java.io.InputStream; +import java.io.OutputStream; import java.time.Duration; import java.time.Instant; import java.util.Date; @@ -117,7 +121,7 @@ void receivesMessages(boolean trackLastEnqueuedProperties) { // Arrange linkProcessor = createSink(link1, link2).subscribeWith(new AmqpReceiveLinkProcessor(PREFETCH, retryPolicy, parentConnection)); consumer = new EventHubPartitionAsyncConsumer(linkProcessor, messageSerializer, HOSTNAME, EVENT_HUB_NAME, - CONSUMER_GROUP, PARTITION_ID, currentPosition, trackLastEnqueuedProperties, Schedulers.parallel()); + CONSUMER_GROUP, PARTITION_ID, null, currentPosition, trackLastEnqueuedProperties, Schedulers.parallel()); final EventData event1 = new EventData("Foo"); final EventData event2 = new EventData("Bar"); @@ -165,7 +169,7 @@ void receiveMultipleTimes() { // Arrange linkProcessor = createSink(link1, link2).subscribeWith(new AmqpReceiveLinkProcessor(PREFETCH, retryPolicy, parentConnection)); consumer = new EventHubPartitionAsyncConsumer(linkProcessor, messageSerializer, HOSTNAME, EVENT_HUB_NAME, - CONSUMER_GROUP, PARTITION_ID, currentPosition, false, Schedulers.parallel()); + CONSUMER_GROUP, PARTITION_ID, null, currentPosition, false, Schedulers.parallel()); final Message message3 = mock(Message.class); final String secondOffset = "54"; @@ -224,6 +228,57 @@ void receiveMultipleTimes() { Assertions.assertFalse(actual.isInclusive()); } + @Test + void receiveAndDeserialize() { + // just a test value + Object o = 0; + ObjectSerializer testSerializer = new ObjectSerializer() { + @Override + public Mono deserialize(InputStream stream, Class clazz) { + if (clazz.isInstance(o)) { + return Mono.just(clazz.cast(o)); + } + return null; + } + + @Override + public Mono serialize(S stream, Object value) { + return null; + } + }; + + // Arrange + linkProcessor = createSink(link1, link2).subscribeWith(new AmqpReceiveLinkProcessor(PREFETCH, retryPolicy, parentConnection)); + consumer = new EventHubPartitionAsyncConsumer(linkProcessor, messageSerializer, HOSTNAME, EVENT_HUB_NAME, + CONSUMER_GROUP, PARTITION_ID, testSerializer, currentPosition, false, Schedulers.parallel()); + + final EventData event = new EventData("Foo"); + final LastEnqueuedEventProperties last = new LastEnqueuedEventProperties(10L, 15L, + Instant.ofEpochMilli(1243454), Instant.ofEpochMilli(1240004)); + + when(messageSerializer.deserialize(same(message1), eq(EventData.class))).thenReturn(event); + when(messageSerializer.deserialize(same(message1), eq(LastEnqueuedEventProperties.class))).thenReturn(last); + + // Act & Assert + StepVerifier.create(consumer.receive()) + .then(() -> { + messageProcessorSink.next(message1); + }) + .assertNext(partitionEvent -> { + verifyPartitionContext(partitionEvent.getPartitionContext()); + verifyLastEnqueuedInformation(false, last, + partitionEvent.getLastEnqueuedEventProperties()); + Assertions.assertSame(event, partitionEvent.getData()); + Assertions.assertSame(Integer.class.cast(o), partitionEvent.getDeserializedObject(Integer.class).block()); + }) + .thenCancel() + .verify(); + + // The emitter processor is not closed until the partition consumer is. + Assertions.assertFalse(linkProcessor.isTerminated()); + Assertions.assertSame(originalPosition, currentPosition.get().get()); + } + /** * Verifies that the consumer closes and completes any listeners on a shutdown signal. @@ -233,7 +288,7 @@ void listensToShutdownSignals() throws InterruptedException { // Arrange linkProcessor = createSink(link1, link2).subscribeWith(new AmqpReceiveLinkProcessor(PREFETCH, retryPolicy, parentConnection)); consumer = new EventHubPartitionAsyncConsumer(linkProcessor, messageSerializer, HOSTNAME, EVENT_HUB_NAME, - CONSUMER_GROUP, PARTITION_ID, currentPosition, false, Schedulers.parallel()); + CONSUMER_GROUP, PARTITION_ID, null, currentPosition, false, Schedulers.parallel()); final Message message3 = mock(Message.class); final String secondOffset = "54"; diff --git a/sdk/eventhubs/azure-messaging-eventhubs/src/test/java/com/azure/messaging/eventhubs/EventHubProducerAsyncClientTest.java b/sdk/eventhubs/azure-messaging-eventhubs/src/test/java/com/azure/messaging/eventhubs/EventHubProducerAsyncClientTest.java index 85eaacce57ff4..6ab8b2d20f3a9 100644 --- a/sdk/eventhubs/azure-messaging-eventhubs/src/test/java/com/azure/messaging/eventhubs/EventHubProducerAsyncClientTest.java +++ b/sdk/eventhubs/azure-messaging-eventhubs/src/test/java/com/azure/messaging/eventhubs/EventHubProducerAsyncClientTest.java @@ -146,7 +146,7 @@ void setup(TestInfo testInfo) { new EventHubConnectionProcessor(connectionOptions.getFullyQualifiedNamespace(), "event-hub-path", connectionOptions.getRetry())); producer = new EventHubProducerAsyncClient(HOSTNAME, EVENT_HUB_NAME, connectionProcessor, retryOptions, - tracerProvider, messageSerializer, testScheduler, false, onClientClosed); + tracerProvider, messageSerializer, null, testScheduler, false, onClientClosed); when(sendLink.getLinkSize()).thenReturn(Mono.just(ClientConstants.MAX_MESSAGE_LENGTH_BYTES)); when(sendLink2.getLinkSize()).thenReturn(Mono.just(ClientConstants.MAX_MESSAGE_LENGTH_BYTES)); @@ -238,7 +238,7 @@ void sendSingleMessageWithBlock() throws InterruptedException { final Semaphore semaphore = new Semaphore(1); // In our actual client builder, we allow this. final EventHubProducerAsyncClient flexibleProducer = new EventHubProducerAsyncClient(HOSTNAME, EVENT_HUB_NAME, - connectionProcessor, retryOptions, tracerProvider, messageSerializer, testScheduler, + connectionProcessor, retryOptions, tracerProvider, messageSerializer, null, testScheduler, false, onClientClosed); // EC is the prefix they use when creating a link that sends to the service round-robin. @@ -319,7 +319,7 @@ void sendStartSpanSingleMessage() { final SendOptions sendOptions = new SendOptions() .setPartitionId(partitionId); final EventHubProducerAsyncClient asyncProducer = new EventHubProducerAsyncClient(HOSTNAME, EVENT_HUB_NAME, - connectionProcessor, retryOptions, tracerProvider, messageSerializer, Schedulers.parallel(), + connectionProcessor, retryOptions, tracerProvider, messageSerializer, null, Schedulers.parallel(), false, onClientClosed); when(connection.createSendLink( @@ -377,7 +377,7 @@ void sendMessageRetrySpanTest() { TracerProvider tracerProvider = new TracerProvider(tracers); producer = new EventHubProducerAsyncClient(HOSTNAME, EVENT_HUB_NAME, connectionProcessor, retryOptions, - tracerProvider, messageSerializer, Schedulers.parallel(), false, onClientClosed); + tracerProvider, messageSerializer, null, Schedulers.parallel(), false, onClientClosed); final String failureKey = "fail"; final EventData testData = new EventData("test"); @@ -516,7 +516,7 @@ void startMessageSpansOnCreateBatch() { final List tracers = Collections.singletonList(tracer1); TracerProvider tracerProvider = new TracerProvider(tracers); final EventHubProducerAsyncClient asyncProducer = new EventHubProducerAsyncClient(HOSTNAME, EVENT_HUB_NAME, - connectionProcessor, retryOptions, tracerProvider, messageSerializer, Schedulers.parallel(), + connectionProcessor, retryOptions, tracerProvider, messageSerializer, null, Schedulers.parallel(), false, onClientClosed); final AmqpSendLink link = mock(AmqpSendLink.class); @@ -822,7 +822,7 @@ void doesNotCloseSharedConnection() { // Arrange EventHubConnectionProcessor hubConnection = mock(EventHubConnectionProcessor.class); EventHubProducerAsyncClient sharedProducer = new EventHubProducerAsyncClient(HOSTNAME, EVENT_HUB_NAME, - hubConnection, retryOptions, tracerProvider, messageSerializer, Schedulers.parallel(), + hubConnection, retryOptions, tracerProvider, messageSerializer, null, Schedulers.parallel(), true, onClientClosed); // Act @@ -841,7 +841,7 @@ void closesDedicatedConnection() { // Arrange EventHubConnectionProcessor hubConnection = mock(EventHubConnectionProcessor.class); EventHubProducerAsyncClient dedicatedProducer = new EventHubProducerAsyncClient(HOSTNAME, EVENT_HUB_NAME, - hubConnection, retryOptions, tracerProvider, messageSerializer, Schedulers.parallel(), + hubConnection, retryOptions, tracerProvider, messageSerializer, null, Schedulers.parallel(), false, onClientClosed); // Act @@ -860,7 +860,7 @@ void closesDedicatedConnectionOnlyOnce() { // Arrange EventHubConnectionProcessor hubConnection = mock(EventHubConnectionProcessor.class); EventHubProducerAsyncClient dedicatedProducer = new EventHubProducerAsyncClient(HOSTNAME, EVENT_HUB_NAME, - hubConnection, retryOptions, tracerProvider, messageSerializer, Schedulers.parallel(), + hubConnection, retryOptions, tracerProvider, messageSerializer, null, Schedulers.parallel(), false, onClientClosed); // Act @@ -897,7 +897,7 @@ void reopensOnFailure() { new EventHubConnectionProcessor(EVENT_HUB_NAME, connectionOptions.getFullyQualifiedNamespace(), connectionOptions.getRetry())); producer = new EventHubProducerAsyncClient(HOSTNAME, EVENT_HUB_NAME, connectionProcessor, retryOptions, - tracerProvider, messageSerializer, Schedulers.parallel(), false, onClientClosed); + tracerProvider, messageSerializer, null, Schedulers.parallel(), false, onClientClosed); final int count = 4; final byte[] contents = TEST_CONTENTS.getBytes(UTF_8); @@ -972,7 +972,7 @@ void closesOnNonTransientFailure() { new EventHubConnectionProcessor(connectionOptions.getFullyQualifiedNamespace(), EVENT_HUB_NAME, connectionOptions.getRetry())); producer = new EventHubProducerAsyncClient(HOSTNAME, EVENT_HUB_NAME, connectionProcessor, retryOptions, - tracerProvider, messageSerializer, Schedulers.parallel(), false, onClientClosed); + tracerProvider, messageSerializer, null, Schedulers.parallel(), false, onClientClosed); final int count = 4; final byte[] contents = TEST_CONTENTS.getBytes(UTF_8); @@ -1048,7 +1048,7 @@ void resendMessageOnTransientLinkFailure() { new EventHubConnectionProcessor(connectionOptions.getFullyQualifiedNamespace(), EVENT_HUB_NAME, connectionOptions.getRetry())); producer = new EventHubProducerAsyncClient(HOSTNAME, EVENT_HUB_NAME, connectionProcessor, retryOptions, - tracerProvider, messageSerializer, Schedulers.parallel(), false, onClientClosed); + tracerProvider, messageSerializer, null, Schedulers.parallel(), false, onClientClosed); final int count = 4; final byte[] contents = TEST_CONTENTS.getBytes(UTF_8); diff --git a/sdk/eventhubs/azure-messaging-eventhubs/src/test/java/com/azure/messaging/eventhubs/EventHubProducerClientTest.java b/sdk/eventhubs/azure-messaging-eventhubs/src/test/java/com/azure/messaging/eventhubs/EventHubProducerClientTest.java index 9e0455d89957b..02ec09aaeb2c1 100644 --- a/sdk/eventhubs/azure-messaging-eventhubs/src/test/java/com/azure/messaging/eventhubs/EventHubProducerClientTest.java +++ b/sdk/eventhubs/azure-messaging-eventhubs/src/test/java/com/azure/messaging/eventhubs/EventHubProducerClientTest.java @@ -105,7 +105,7 @@ public void setup() { .subscribeWith(new EventHubConnectionProcessor(connectionOptions.getFullyQualifiedNamespace(), "event-hub-path", connectionOptions.getRetry())); asyncProducer = new EventHubProducerAsyncClient(HOSTNAME, EVENT_HUB_NAME, connectionProcessor, retryOptions, - tracerProvider, messageSerializer, Schedulers.parallel(), false, onClientClosed); + tracerProvider, messageSerializer, null, Schedulers.parallel(), false, onClientClosed); when(connection.getEndpointStates()).thenReturn(Flux.create(sink -> sink.next(AmqpEndpointState.ACTIVE))); } @@ -157,7 +157,7 @@ public void sendStartSpanSingleMessage() { final List tracers = Collections.singletonList(tracer1); final TracerProvider tracerProvider = new TracerProvider(tracers); final EventHubProducerAsyncClient asyncProducer = new EventHubProducerAsyncClient(HOSTNAME, EVENT_HUB_NAME, - connectionProcessor, retryOptions, tracerProvider, messageSerializer, Schedulers.parallel(), + connectionProcessor, retryOptions, tracerProvider, messageSerializer, null, Schedulers.parallel(), false, onClientClosed); final EventHubProducerClient producer = new EventHubProducerClient(asyncProducer, retryOptions.getTryTimeout()); final EventData eventData = new EventData("hello-world".getBytes(UTF_8)); @@ -219,7 +219,7 @@ public void sendMessageRetrySpanTest() { .thenReturn(Mono.just(sendLink)); final EventHubProducerAsyncClient asyncProducer = new EventHubProducerAsyncClient(HOSTNAME, EVENT_HUB_NAME, - connectionProcessor, retryOptions, tracerProvider, messageSerializer, Schedulers.parallel(), false, onClientClosed); + connectionProcessor, retryOptions, tracerProvider, messageSerializer, null, Schedulers.parallel(), false, onClientClosed); final EventHubProducerClient producer = new EventHubProducerClient(asyncProducer, retryOptions.getTryTimeout()); final EventData eventData = new EventData("hello-world".getBytes(UTF_8)) .addContext(SPAN_CONTEXT_KEY, Context.NONE); @@ -267,7 +267,7 @@ public void sendEventsExceedsBatchSize() { when(sendLink.getLinkSize()).thenReturn(Mono.just(1024)); TracerProvider tracerProvider = new TracerProvider(Collections.emptyList()); final EventHubProducerAsyncClient asyncProducer = new EventHubProducerAsyncClient(HOSTNAME, EVENT_HUB_NAME, - connectionProcessor, retryOptions, tracerProvider, messageSerializer, Schedulers.parallel(), false, onClientClosed); + connectionProcessor, retryOptions, tracerProvider, messageSerializer, null, Schedulers.parallel(), false, onClientClosed); final EventHubProducerClient producer = new EventHubProducerClient(asyncProducer, retryOptions.getTryTimeout()); //Act & Assert @@ -369,7 +369,7 @@ public void startsMessageSpanOnEventBatch() { final List tracers = Collections.singletonList(tracer1); final TracerProvider tracerProvider = new TracerProvider(tracers); final EventHubProducerAsyncClient asyncProducer = new EventHubProducerAsyncClient(HOSTNAME, EVENT_HUB_NAME, - connectionProcessor, retryOptions, tracerProvider, messageSerializer, Schedulers.parallel(), + connectionProcessor, retryOptions, tracerProvider, messageSerializer, null, Schedulers.parallel(), false, onClientClosed); final EventHubProducerClient producer = new EventHubProducerClient(asyncProducer, retryOptions.getTryTimeout()); diff --git a/sdk/eventhubs/azure-messaging-eventhubs/src/test/java/com/azure/messaging/eventhubs/EventProcessorClientErrorHandlingTest.java b/sdk/eventhubs/azure-messaging-eventhubs/src/test/java/com/azure/messaging/eventhubs/EventProcessorClientErrorHandlingTest.java index a79be245862d5..86941734582ba 100644 --- a/sdk/eventhubs/azure-messaging-eventhubs/src/test/java/com/azure/messaging/eventhubs/EventProcessorClientErrorHandlingTest.java +++ b/sdk/eventhubs/azure-messaging-eventhubs/src/test/java/com/azure/messaging/eventhubs/EventProcessorClientErrorHandlingTest.java @@ -139,7 +139,7 @@ private static Stream checkpointStoreSupplier() { private PartitionEvent getEvent(EventData event) { PartitionContext context = new PartitionContext("ns", "foo", "bar", "baz"); - return new PartitionEvent(context, event, null); + return new PartitionEvent(context, event, null, null); } diff --git a/sdk/eventhubs/azure-messaging-eventhubs/src/test/java/com/azure/messaging/eventhubs/EventProcessorClientTest.java b/sdk/eventhubs/azure-messaging-eventhubs/src/test/java/com/azure/messaging/eventhubs/EventProcessorClientTest.java index 05888a75f6cb4..ae309f330f9e2 100644 --- a/sdk/eventhubs/azure-messaging-eventhubs/src/test/java/com/azure/messaging/eventhubs/EventProcessorClientTest.java +++ b/sdk/eventhubs/azure-messaging-eventhubs/src/test/java/com/azure/messaging/eventhubs/EventProcessorClientTest.java @@ -474,7 +474,7 @@ public void testSingleEventReceiveHeartBeat() throws InterruptedException { private PartitionEvent getEvent(EventData event) { PartitionContext context = new PartitionContext("test-ns", "foo", "bar", "baz"); - return new PartitionEvent(context, event, null); + return new PartitionEvent(context, event, null, null); } private static final class TestPartitionProcessor extends PartitionProcessor { diff --git a/sdk/eventhubs/azure-messaging-eventhubs/src/test/java/com/azure/messaging/eventhubs/ObjectBatchTest.java b/sdk/eventhubs/azure-messaging-eventhubs/src/test/java/com/azure/messaging/eventhubs/ObjectBatchTest.java new file mode 100644 index 0000000000000..3cff1916bd214 --- /dev/null +++ b/sdk/eventhubs/azure-messaging-eventhubs/src/test/java/com/azure/messaging/eventhubs/ObjectBatchTest.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.messaging.eventhubs; + +import com.azure.core.amqp.implementation.ErrorContextProvider; +import com.azure.core.experimental.serializer.ObjectSerializer; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.mockito.Mock; +import org.mockito.MockitoAnnotations; +import reactor.core.publisher.Mono; + +import java.io.InputStream; +import java.io.OutputStream; + +import static org.junit.jupiter.api.Assertions.assertThrows; + +public class ObjectBatchTest { + @Mock + private ErrorContextProvider errorContextProvider; + + @BeforeEach + public void setup() { + MockitoAnnotations.initMocks(this); + } + + @Test + public void nullObject() { + assertThrows(IllegalArgumentException.class, () -> { + final ObjectBatch batch = new ObjectBatch<>( + 1024, + null, + null, + Object.class, + errorContextProvider, + null, + new ObjectSerializer() { + @Override + public Mono deserialize(InputStream stream, Class clazz) { + return null; + } + + @Override + public Mono serialize(S stream, Object value) { + return null; + } + }, + null, + null); + batch.tryAdd(null); + }); + } +} diff --git a/sdk/eventhubs/azure-messaging-eventhubs/src/test/java/com/azure/messaging/eventhubs/PartitionBasedLoadBalancerTest.java b/sdk/eventhubs/azure-messaging-eventhubs/src/test/java/com/azure/messaging/eventhubs/PartitionBasedLoadBalancerTest.java index 698aee42498ea..4e5c09b72b313 100644 --- a/sdk/eventhubs/azure-messaging-eventhubs/src/test/java/com/azure/messaging/eventhubs/PartitionBasedLoadBalancerTest.java +++ b/sdk/eventhubs/azure-messaging-eventhubs/src/test/java/com/azure/messaging/eventhubs/PartitionBasedLoadBalancerTest.java @@ -113,7 +113,7 @@ public void testSingleEventProcessor() { .thenReturn(Flux.interval(Duration.ofSeconds(1)).map(index -> { final PartitionContext partitionContext = new PartitionContext("ns", "foo", "bar", "bazz"); int i = index.intValue() % eventDataList.size(); - return new PartitionEvent(partitionContext, eventDataList.get(i), null); + return new PartitionEvent(partitionContext, eventDataList.get(i), null, null); })); PartitionBasedLoadBalancer partitionBasedLoadBalancer = createPartitionLoadBalancer("owner1"); @@ -149,7 +149,7 @@ public void testTwoEventProcessors() { .thenReturn(Flux.interval(Duration.ofSeconds(1)).map(index -> { final PartitionContext partitionContext = new PartitionContext("ns", "foo", "bar", "bazz"); int i = index.intValue() % eventDataList.size(); - return new PartitionEvent(partitionContext, eventDataList.get(i), null); + return new PartitionEvent(partitionContext, eventDataList.get(i), null, null); })); PartitionBasedLoadBalancer partitionBasedLoadBalancer1 = createPartitionLoadBalancer("owner1"); @@ -185,7 +185,7 @@ public void testPartitionStealing() { .thenReturn(Flux.interval(Duration.ofSeconds(1)).map(index -> { final PartitionContext partitionContext = new PartitionContext("ns", "foo", "bar", "bazz"); int i = index.intValue() % eventDataList.size(); - return new PartitionEvent(partitionContext, eventDataList.get(i), null); + return new PartitionEvent(partitionContext, eventDataList.get(i), null, null); })); PartitionBasedLoadBalancer partitionBasedLoadBalancer1 = createPartitionLoadBalancer("owner1"); @@ -225,7 +225,7 @@ public void testMoreEventProcessorsThanPartitions() { .thenReturn(Flux.interval(Duration.ofSeconds(1)).map(index -> { final PartitionContext partitionContext = new PartitionContext("ns", "foo", "bar", "bazz"); int i = index.intValue() % eventDataList.size(); - return new PartitionEvent(partitionContext, eventDataList.get(i), null); + return new PartitionEvent(partitionContext, eventDataList.get(i), null, null); })); List loadBalancers = new ArrayList<>(); @@ -263,7 +263,7 @@ public void testEventProcessorInactive() { .thenReturn(Flux.interval(Duration.ofSeconds(1)).map(index -> { final PartitionContext partitionContext = new PartitionContext("ns", "foo", "bar", "bazz"); final int i = index.intValue() % eventDataList.size(); - return new PartitionEvent(partitionContext, eventDataList.get(i), null); + return new PartitionEvent(partitionContext, eventDataList.get(i), null, null); })); List loadBalancers = new ArrayList<>(); @@ -422,7 +422,7 @@ public void testEmptyOwnerId() { .thenReturn(Flux.interval(Duration.ofSeconds(1)).map(index -> { final PartitionContext partitionContext = new PartitionContext("ns", "foo", "bar", "bazz"); final int i = index.intValue() % eventDataList.size(); - return new PartitionEvent(partitionContext, eventDataList.get(i), null); + return new PartitionEvent(partitionContext, eventDataList.get(i), null, null); })); String ownerName = "owner1"; diff --git a/sdk/schemaregistry/azure-data-schemaregistry-avro/src/main/java/com/azure/data/schemaregistry/avro/SchemaRegistryAvroAsyncSerializer.java b/sdk/schemaregistry/azure-data-schemaregistry-avro/src/main/java/com/azure/data/schemaregistry/avro/SchemaRegistryAvroAsyncSerializer.java index 7d8edfb020bac..9d11d6bd76317 100644 --- a/sdk/schemaregistry/azure-data-schemaregistry-avro/src/main/java/com/azure/data/schemaregistry/avro/SchemaRegistryAvroAsyncSerializer.java +++ b/sdk/schemaregistry/azure-data-schemaregistry-avro/src/main/java/com/azure/data/schemaregistry/avro/SchemaRegistryAvroAsyncSerializer.java @@ -3,7 +3,6 @@ package com.azure.data.schemaregistry.avro; -import com.azure.data.schemaregistry.AbstractDataSerializer; import com.azure.data.schemaregistry.SerializationException; import reactor.core.publisher.Mono; import reactor.core.scheduler.Scheduler; @@ -14,7 +13,7 @@ /** * Asynchronous registry-based serializer implementation. */ -public class SchemaRegistryAvroAsyncSerializer extends AbstractDataSerializer { +public class SchemaRegistryAvroAsyncSerializer { private static final int DEFAULT_THREAD_POOL_SIZE = 8; private final SchemaRegistryAvroSerializer serializer; From e7be51b20f8bdd77dedfc235285e921aa6f9733e Mon Sep 17 00:00:00 2001 From: Azure SDK Bot <53356347+azure-sdk@users.noreply.github.com> Date: Thu, 9 Jul 2020 11:11:47 -0700 Subject: [PATCH 070/129] Increment version for core releases (#12969) * disable flaky assert (#12793) * open to azure-core, for f.setAccessible(true); in FlatteningSerializer (#12863) * Prepare Azure Core Management for release 1.0.0-beta.2 * Prepare Azure Core Management 1.0.0-beta.2 Release (#12914) * disable flaky assert (#12793) * open to azure-core, for f.setAccessible(true); in FlatteningSerializer (#12863) * Prepare Azure Core Management for release 1.0.0-beta.2 Co-authored-by: Weidong Xu * Ignored flaky CF tests (#12915) * Update CHANGELOG version to unblock release * Increment package version after release of com.azure azure-core-management Co-authored-by: Weidong Xu Co-authored-by: alzimmermsft <48699787+alzimmermsft@users.noreply.github.com> Co-authored-by: Gauri Prasad <51212198+gapra-msft@users.noreply.github.com> --- eng/jacoco-test-coverage/pom.xml | 2 +- eng/versioning/version_client.txt | 2 +- sdk/core/azure-core-management/CHANGELOG.md | 8 +++++++- sdk/core/azure-core-management/README.md | 4 ++-- sdk/core/azure-core-management/pom.xml | 2 +- 5 files changed, 12 insertions(+), 6 deletions(-) diff --git a/eng/jacoco-test-coverage/pom.xml b/eng/jacoco-test-coverage/pom.xml index e1f940f5e687c..9da1771d9a7e0 100644 --- a/eng/jacoco-test-coverage/pom.xml +++ b/eng/jacoco-test-coverage/pom.xml @@ -79,7 +79,7 @@ com.azure azure-core-management - 1.0.0-beta.2 + 1.0.0-beta.3 com.azure diff --git a/eng/versioning/version_client.txt b/eng/versioning/version_client.txt index 748e073e4a9d3..035f75475be83 100644 --- a/eng/versioning/version_client.txt +++ b/eng/versioning/version_client.txt @@ -12,7 +12,7 @@ com.azure:azure-core-experimental;1.0.0-beta.1;1.0.0-beta.2 com.azure:azure-core-http-jdk-httpclient;1.0.0-beta.1;1.0.0-beta.1 com.azure:azure-core-http-netty;1.5.3;1.6.0-beta.1 com.azure:azure-core-http-okhttp;1.2.4;1.3.0-beta.1 -com.azure:azure-core-management;1.0.0-beta.1;1.0.0-beta.2 +com.azure:azure-core-management;1.0.0-beta.2;1.0.0-beta.3 com.azure:azure-core-serializer-avro-apache;1.0.0-beta.1;1.0.0-beta.1 com.azure:azure-core-serializer-avro-jackson;1.0.0-beta.1;1.0.0-beta.1 com.azure:azure-core-serializer-json-gson;1.0.0-beta.1;1.0.0-beta.2 diff --git a/sdk/core/azure-core-management/CHANGELOG.md b/sdk/core/azure-core-management/CHANGELOG.md index fd59fdd77eaaa..75f6d9d802400 100644 --- a/sdk/core/azure-core-management/CHANGELOG.md +++ b/sdk/core/azure-core-management/CHANGELOG.md @@ -1,8 +1,14 @@ # Release History -## 1.0.0-beta.2 (Unreleased) +## 1.0.0-beta.3 (Unreleased) +## 1.0.0-beta.2 (2020-07-09) + +- Added additional `ManagementError` constructors. +- Added additional `PollingState` checks. +- Fixed polling status HTTP status code check to include `204`. + ## 1.0.0-beta.1 (2020-06-17) - `PollerFactory` for polling of long-running operation. - `ManagementException` and `ManagementError` for exception and error handling. diff --git a/sdk/core/azure-core-management/README.md b/sdk/core/azure-core-management/README.md index 8e72f06096af4..5284eb7e4c36d 100644 --- a/sdk/core/azure-core-management/README.md +++ b/sdk/core/azure-core-management/README.md @@ -15,7 +15,7 @@ Azure Core Management library is a collection of classes common to the Azure ARM com.azure azure-core-management - 1.0.0-beta.1 + 1.0.0-beta.2 ``` [//]: # ({x-version-update-end}) @@ -37,4 +37,4 @@ Azure Projects Contribution Guidelines](http://azure.github.io/guidelines.html). 1. Create your feature branch (`git checkout -b my-new-feature`) 1. Commit your changes (`git commit -am 'Add some feature'`) 1. Push to the branch (`git push origin my-new-feature`) -1. Create new Pull Request \ No newline at end of file +1. Create new Pull Request diff --git a/sdk/core/azure-core-management/pom.xml b/sdk/core/azure-core-management/pom.xml index cc2f63d127911..6d80e9630b8da 100644 --- a/sdk/core/azure-core-management/pom.xml +++ b/sdk/core/azure-core-management/pom.xml @@ -13,7 +13,7 @@ com.azure azure-core-management - 1.0.0-beta.2 + 1.0.0-beta.3 jar Microsoft Azure Management Java Core Library From 037e12d4eb0c406b13b5c06a5b5fe1262d0557d8 Mon Sep 17 00:00:00 2001 From: Martijn Verburg Date: Thu, 9 Jul 2020 20:50:14 +0100 Subject: [PATCH 071/129] Add workaround for Checkstyle error, closes #6216 (#6593) * Add workaround for Checkstyle error, closes #6216 Signed-off-by: Martijn Verburg * Update CONTRIBUTING.md Updates to workaround section. * Update CONTRIBUTING.md Minor fix to use correct reference Co-authored-by: Alan Zimmer <48699787+alzimmermsft@users.noreply.github.com> --- CONTRIBUTING.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 43e86e06b2052..80be7a0bc41eb 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -87,6 +87,22 @@ Some live tests may have additional steps for setting up live testing resources. See the CONTRIBUTING.md file for the service you wish to test for additional information or instructions. +### Workaround for Checkstyle error + +When building locally you might run into a Checkstyle such as the following: + +``` +Execution default of goal org.apache.maven.plugins:maven-checkstyle-plugin:3.1.0:check failed: +Plugin org.apache.maven.plugins:maven-checkstyle-plugin:3.1.0 or one of its dependencies could not be resolved: +Could not find artifact com.azure:sdk-build-tools:jar:1.0.0 in ossrh (https://oss.sonatype.org/content/repositories/snapshots/) +``` + +This is because the `sdk-build-tools` project isn't released to Maven. To resolve this issue you'll need to copy the `eng` folder locally then install `sdk-build-tools`. + +`mvn clean install eng/code-quality-reports/pom.xml` + +All code in the Azure SDKs for Java repository must pass Checkstyle before being merged. The `sdk-build-tools` is updated periodically, so if a new branch fails Checkstyle you'll need to reinstall. + ## Versions and versioning Tooling has been introduced to centralize versioning and help ease the pain of updating artifact versions in POM and README files. Under the eng\versioning directory there exists version text files, one for client ([version_client.txt](./eng/versioning/version_client.txt)) and one for data ([version_data.txt](./eng/versioning/version_data.txt)). The format of the version files is as follows: From be3d197ae69d643323457772a3cc18d71aff834d Mon Sep 17 00:00:00 2001 From: Arthur Erlendsson <30675661+arerlend@users.noreply.github.com> Date: Thu, 9 Jul 2020 13:04:54 -0700 Subject: [PATCH 072/129] Revert "PR for EH + serializer integration (#12205)" (#12976) This reverts commit 7d211b4699e17156bca3ccb6a5e11b9b2644b75b. --- .../azure-messaging-eventhubs/pom.xml | 4 +- .../messaging/eventhubs/EventDataBatch.java | 255 +++++++++++++++- .../eventhubs/EventDataBatchBase.java | 284 ------------------ .../eventhubs/EventHubAsyncClient.java | 14 +- .../eventhubs/EventHubClientBuilder.java | 16 +- .../EventHubConsumerAsyncClient.java | 13 +- .../EventHubPartitionAsyncConsumer.java | 13 +- .../EventHubProducerAsyncClient.java | 95 +----- .../messaging/eventhubs/ObjectBatch.java | 55 ---- .../eventhubs/models/PartitionEvent.java | 44 +-- .../src/main/java/module-info.java | 1 - ...hBaseTest.java => EventDataBatchTest.java} | 2 +- .../EventHubConsumerAsyncClientTest.java | 18 +- .../eventhubs/EventHubConsumerClientTest.java | 10 +- .../EventHubPartitionAsyncConsumerTest.java | 61 +--- .../EventHubProducerAsyncClientTest.java | 22 +- .../eventhubs/EventHubProducerClientTest.java | 10 +- ...EventProcessorClientErrorHandlingTest.java | 2 +- .../eventhubs/EventProcessorClientTest.java | 2 +- .../messaging/eventhubs/ObjectBatchTest.java | 54 ---- .../PartitionBasedLoadBalancerTest.java | 12 +- .../SchemaRegistryAvroAsyncSerializer.java | 3 +- 22 files changed, 315 insertions(+), 675 deletions(-) delete mode 100644 sdk/eventhubs/azure-messaging-eventhubs/src/main/java/com/azure/messaging/eventhubs/EventDataBatchBase.java delete mode 100644 sdk/eventhubs/azure-messaging-eventhubs/src/main/java/com/azure/messaging/eventhubs/ObjectBatch.java rename sdk/eventhubs/azure-messaging-eventhubs/src/test/java/com/azure/messaging/eventhubs/{EventDataBatchBaseTest.java => EventDataBatchTest.java} (98%) delete mode 100644 sdk/eventhubs/azure-messaging-eventhubs/src/test/java/com/azure/messaging/eventhubs/ObjectBatchTest.java diff --git a/sdk/eventhubs/azure-messaging-eventhubs/pom.xml b/sdk/eventhubs/azure-messaging-eventhubs/pom.xml index dfb271b9f8aaa..7d0f5adbebb57 100644 --- a/sdk/eventhubs/azure-messaging-eventhubs/pom.xml +++ b/sdk/eventhubs/azure-messaging-eventhubs/pom.xml @@ -36,8 +36,8 @@ com.azure - azure-core-experimental - 1.0.0-beta.1 + azure-core + 1.6.0 com.azure diff --git a/sdk/eventhubs/azure-messaging-eventhubs/src/main/java/com/azure/messaging/eventhubs/EventDataBatch.java b/sdk/eventhubs/azure-messaging-eventhubs/src/main/java/com/azure/messaging/eventhubs/EventDataBatch.java index 0c00c696453e3..5656e9e588bc9 100644 --- a/sdk/eventhubs/azure-messaging-eventhubs/src/main/java/com/azure/messaging/eventhubs/EventDataBatch.java +++ b/sdk/eventhubs/azure-messaging-eventhubs/src/main/java/com/azure/messaging/eventhubs/EventDataBatch.java @@ -3,9 +3,38 @@ package com.azure.messaging.eventhubs; +import com.azure.core.amqp.AmqpMessageConstant; +import com.azure.core.amqp.exception.AmqpErrorCondition; import com.azure.core.amqp.exception.AmqpException; +import com.azure.core.amqp.implementation.AmqpConstants; import com.azure.core.amqp.implementation.ErrorContextProvider; import com.azure.core.amqp.implementation.TracerProvider; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.tracing.ProcessKind; +import org.apache.qpid.proton.Proton; +import org.apache.qpid.proton.amqp.Binary; +import org.apache.qpid.proton.amqp.Symbol; +import org.apache.qpid.proton.amqp.messaging.ApplicationProperties; +import org.apache.qpid.proton.amqp.messaging.Data; +import org.apache.qpid.proton.amqp.messaging.MessageAnnotations; +import org.apache.qpid.proton.message.Message; +import reactor.core.publisher.Signal; + +import java.nio.BufferOverflowException; +import java.util.HashMap; +import java.util.LinkedList; +import java.util.List; +import java.util.Locale; +import java.util.Objects; +import java.util.Optional; + +import static com.azure.core.util.tracing.Tracer.AZ_TRACING_NAMESPACE_KEY; +import static com.azure.core.util.tracing.Tracer.DIAGNOSTIC_ID_KEY; +import static com.azure.core.util.tracing.Tracer.ENTITY_PATH_KEY; +import static com.azure.core.util.tracing.Tracer.HOST_NAME_KEY; +import static com.azure.core.util.tracing.Tracer.SPAN_CONTEXT_KEY; +import static com.azure.messaging.eventhubs.implementation.ClientConstants.AZ_NAMESPACE_VALUE; /** * A class for aggregating {@link EventData} into a single, size-limited, batch. It is treated as a single message when @@ -16,10 +45,59 @@ * @see EventHubClientBuilder See EventHubClientBuilder for examples of building an asynchronous or synchronous * producer. */ -public final class EventDataBatch extends EventDataBatchBase { +public final class EventDataBatch { + private final ClientLogger logger = new ClientLogger(EventDataBatch.class); + private final Object lock = new Object(); + private final int maxMessageSize; + private final String partitionKey; + private final ErrorContextProvider contextProvider; + private final List events; + private final byte[] eventBytes; + private final String partitionId; + private int sizeInBytes; + private final TracerProvider tracerProvider; + private final String entityPath; + private final String hostname; + EventDataBatch(int maxMessageSize, String partitionId, String partitionKey, ErrorContextProvider contextProvider, TracerProvider tracerProvider, String entityPath, String hostname) { - super(maxMessageSize, partitionId, partitionKey, contextProvider, tracerProvider, entityPath, hostname); + this.maxMessageSize = maxMessageSize; + this.partitionKey = partitionKey; + this.partitionId = partitionId; + this.contextProvider = contextProvider; + this.events = new LinkedList<>(); + this.sizeInBytes = (maxMessageSize / 65536) * 1024; // reserve 1KB for every 64KB + this.eventBytes = new byte[maxMessageSize]; + this.tracerProvider = tracerProvider; + this.entityPath = entityPath; + this.hostname = hostname; + } + + /** + * Gets the number of {@link EventData events} in the batch. + * + * @return The number of {@link EventData events} in the batch. + */ + public int getCount() { + return events.size(); + } + + /** + * Gets the maximum size, in bytes, of the {@link EventDataBatch}. + * + * @return The maximum size, in bytes, of the {@link EventDataBatch}. + */ + public int getMaxSizeInBytes() { + return maxMessageSize; + } + + /** + * Gets the size of the {@link EventDataBatch} in bytes. + * + * @return the size of the {@link EventDataBatch} in bytes. + */ + public int getSizeInBytes() { + return this.sizeInBytes; } /** @@ -32,6 +110,177 @@ public final class EventDataBatch extends EventDataBatchBase { * @throws AmqpException if {@code eventData} is larger than the maximum size of the {@link EventDataBatch}. */ public boolean tryAdd(final EventData eventData) { - return super.tryAdd(eventData); + if (eventData == null) { + throw logger.logExceptionAsWarning(new IllegalArgumentException("eventData cannot be null")); + } + EventData event = tracerProvider.isEnabled() ? traceMessageSpan(eventData) : eventData; + + final int size; + try { + size = getSize(event, events.isEmpty()); + } catch (BufferOverflowException exception) { + throw logger.logExceptionAsWarning(new AmqpException(false, AmqpErrorCondition.LINK_PAYLOAD_SIZE_EXCEEDED, + String.format(Locale.US, "Size of the payload exceeded maximum message size: %s kb", + maxMessageSize / 1024), + contextProvider.getErrorContext())); + } + + synchronized (lock) { + if (this.sizeInBytes + size > this.maxMessageSize) { + return false; + } + + this.sizeInBytes += size; + } + + this.events.add(event); + return true; + } + + /** + * Method to start and end a "Azure.EventHubs.message" span and add the "DiagnosticId" as a property of the message. + * + * @param eventData The Event to add tracing span for. + * @return the updated event data object. + */ + private EventData traceMessageSpan(EventData eventData) { + Optional eventContextData = eventData.getContext().getData(SPAN_CONTEXT_KEY); + if (eventContextData.isPresent()) { + // if message has context (in case of retries), don't start a message span or add a new context + return eventData; + } else { + // Starting the span makes the sampling decision (nothing is logged at this time) + Context eventContext = eventData.getContext() + .addData(AZ_TRACING_NAMESPACE_KEY, AZ_NAMESPACE_VALUE) + .addData(ENTITY_PATH_KEY, this.entityPath) + .addData(HOST_NAME_KEY, this.hostname); + Context eventSpanContext = tracerProvider.startSpan(eventContext, ProcessKind.MESSAGE); + Optional eventDiagnosticIdOptional = eventSpanContext.getData(DIAGNOSTIC_ID_KEY); + if (eventDiagnosticIdOptional.isPresent()) { + eventData.getProperties().put(DIAGNOSTIC_ID_KEY, eventDiagnosticIdOptional.get().toString()); + tracerProvider.endSpan(eventSpanContext, Signal.complete()); + eventData.addContext(SPAN_CONTEXT_KEY, eventSpanContext); + } + } + + return eventData; + } + + List getEvents() { + return events; + } + + String getPartitionKey() { + return partitionKey; + } + + String getPartitionId() { + return partitionId; + } + + private int getSize(final EventData eventData, final boolean isFirst) { + Objects.requireNonNull(eventData, "'eventData' cannot be null."); + + final Message amqpMessage = createAmqpMessage(eventData, partitionKey); + int eventSize = amqpMessage.encode(this.eventBytes, 0, maxMessageSize); // actual encoded bytes size + eventSize += 16; // data section overhead + + if (isFirst) { + amqpMessage.setBody(null); + amqpMessage.setApplicationProperties(null); + amqpMessage.setProperties(null); + amqpMessage.setDeliveryAnnotations(null); + + eventSize += amqpMessage.encode(this.eventBytes, 0, maxMessageSize); + } + + return eventSize; + } + + /* + * Creates the AMQP message represented by the event data + */ + private Message createAmqpMessage(EventData event, String partitionKey) { + final Message message = Proton.message(); + + if (event.getProperties() != null && !event.getProperties().isEmpty()) { + final ApplicationProperties applicationProperties = new ApplicationProperties(event.getProperties()); + message.setApplicationProperties(applicationProperties); + } + + if (event.getSystemProperties() != null) { + event.getSystemProperties().forEach((key, value) -> { + if (EventData.RESERVED_SYSTEM_PROPERTIES.contains(key)) { + return; + } + + final AmqpMessageConstant constant = AmqpMessageConstant.fromString(key); + + if (constant != null) { + switch (constant) { + case MESSAGE_ID: + message.setMessageId(value); + break; + case USER_ID: + message.setUserId((byte[]) value); + break; + case TO: + message.setAddress((String) value); + break; + case SUBJECT: + message.setSubject((String) value); + break; + case REPLY_TO: + message.setReplyTo((String) value); + break; + case CORRELATION_ID: + message.setCorrelationId(value); + break; + case CONTENT_TYPE: + message.setContentType((String) value); + break; + case CONTENT_ENCODING: + message.setContentEncoding((String) value); + break; + case ABSOLUTE_EXPIRY_TIME: + message.setExpiryTime((long) value); + break; + case CREATION_TIME: + message.setCreationTime((long) value); + break; + case GROUP_ID: + message.setGroupId((String) value); + break; + case GROUP_SEQUENCE: + message.setGroupSequence((long) value); + break; + case REPLY_TO_GROUP_ID: + message.setReplyToGroupId((String) value); + break; + default: + throw logger.logExceptionAsWarning(new IllegalArgumentException(String.format(Locale.US, + "Property is not a recognized reserved property name: %s", key))); + } + } else { + final MessageAnnotations messageAnnotations = (message.getMessageAnnotations() == null) + ? new MessageAnnotations(new HashMap<>()) + : message.getMessageAnnotations(); + messageAnnotations.getValue().put(Symbol.getSymbol(key), value); + message.setMessageAnnotations(messageAnnotations); + } + }); + } + + if (partitionKey != null) { + final MessageAnnotations messageAnnotations = (message.getMessageAnnotations() == null) + ? new MessageAnnotations(new HashMap<>()) + : message.getMessageAnnotations(); + messageAnnotations.getValue().put(AmqpConstants.PARTITION_KEY, partitionKey); + message.setMessageAnnotations(messageAnnotations); + } + + message.setBody(new Data(new Binary(event.getBody()))); + + return message; } } diff --git a/sdk/eventhubs/azure-messaging-eventhubs/src/main/java/com/azure/messaging/eventhubs/EventDataBatchBase.java b/sdk/eventhubs/azure-messaging-eventhubs/src/main/java/com/azure/messaging/eventhubs/EventDataBatchBase.java deleted file mode 100644 index 6964ec79c1719..0000000000000 --- a/sdk/eventhubs/azure-messaging-eventhubs/src/main/java/com/azure/messaging/eventhubs/EventDataBatchBase.java +++ /dev/null @@ -1,284 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.messaging.eventhubs; - -import com.azure.core.amqp.AmqpMessageConstant; -import com.azure.core.amqp.exception.AmqpErrorCondition; -import com.azure.core.amqp.exception.AmqpException; -import com.azure.core.amqp.implementation.AmqpConstants; -import com.azure.core.amqp.implementation.ErrorContextProvider; -import com.azure.core.amqp.implementation.TracerProvider; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.core.util.tracing.ProcessKind; -import org.apache.qpid.proton.Proton; -import org.apache.qpid.proton.amqp.Binary; -import org.apache.qpid.proton.amqp.Symbol; -import org.apache.qpid.proton.amqp.messaging.ApplicationProperties; -import org.apache.qpid.proton.amqp.messaging.Data; -import org.apache.qpid.proton.amqp.messaging.MessageAnnotations; -import org.apache.qpid.proton.message.Message; -import reactor.core.publisher.Signal; - -import java.nio.BufferOverflowException; -import java.util.HashMap; -import java.util.LinkedList; -import java.util.List; -import java.util.Locale; -import java.util.Objects; -import java.util.Optional; - -import static com.azure.core.util.tracing.Tracer.AZ_TRACING_NAMESPACE_KEY; -import static com.azure.core.util.tracing.Tracer.DIAGNOSTIC_ID_KEY; -import static com.azure.core.util.tracing.Tracer.ENTITY_PATH_KEY; -import static com.azure.core.util.tracing.Tracer.HOST_NAME_KEY; -import static com.azure.core.util.tracing.Tracer.SPAN_CONTEXT_KEY; -import static com.azure.messaging.eventhubs.implementation.ClientConstants.AZ_NAMESPACE_VALUE; - -/** - * Base class containing common implementation for batch sending. - * - * Implemented by {@link ObjectBatch} and {@link EventDataBatch}. - */ -abstract class EventDataBatchBase { - private final ClientLogger logger = new ClientLogger(this.getClass()); - private final Object lock = new Object(); - private final int maxMessageSize; - private final String partitionKey; - private final ErrorContextProvider contextProvider; - private final List events; - private final byte[] eventBytes; - private final String partitionId; - private int sizeInBytes; - private final TracerProvider tracerProvider; - private final String entityPath; - private final String hostname; - - EventDataBatchBase(int maxMessageSize, String partitionId, String partitionKey, - ErrorContextProvider contextProvider, TracerProvider tracerProvider, String entityPath, - String hostname) { - this.maxMessageSize = maxMessageSize; - this.partitionKey = partitionKey; - this.partitionId = partitionId; - this.contextProvider = contextProvider; - this.events = new LinkedList<>(); - this.sizeInBytes = (maxMessageSize / 65536) * 1024; // reserve 1KB for every 64KB - this.eventBytes = new byte[maxMessageSize]; - this.tracerProvider = tracerProvider; - this.entityPath = entityPath; - this.hostname = hostname; - } - - /** - * Gets the number of {@link EventData events} in the batch. - * - * @return The number of {@link EventData events} in the batch. - */ - public int getCount() { - return events.size(); - } - - /** - * Gets the maximum size, in bytes, of the {@link EventDataBatch}. - * - * @return The maximum size, in bytes, of the {@link EventDataBatch}. - */ - public int getMaxSizeInBytes() { - return maxMessageSize; - } - - /** - * Gets the size of the {@link EventDataBatch} in bytes. - * - * @return the size of the {@link EventDataBatch} in bytes. - */ - public int getSizeInBytes() { - return this.sizeInBytes; - } - - /** - * Tries to add an {@link EventData event} to the batch. - * - * @param eventData The {@link EventData} to add to the batch. - * @return {@code true} if the event could be added to the batch; {@code false} if the event was too large to fit in - * the batch. - * @throws IllegalArgumentException if {@code eventData} is {@code null}. - * @throws AmqpException if {@code eventData} is larger than the maximum size of the {@link EventDataBatch}. - */ - public boolean tryAdd(final EventData eventData) { - if (eventData == null) { - throw logger.logExceptionAsWarning(new IllegalArgumentException("eventData cannot be null")); - } - EventData event = tracerProvider.isEnabled() ? traceMessageSpan(eventData) : eventData; - - final int size; - try { - size = getSize(event, events.isEmpty()); - } catch (BufferOverflowException exception) { - throw logger.logExceptionAsWarning(new AmqpException(false, AmqpErrorCondition.LINK_PAYLOAD_SIZE_EXCEEDED, - String.format(Locale.US, "Size of the payload exceeded maximum message size: %s kb", - maxMessageSize / 1024), - contextProvider.getErrorContext())); - } - - synchronized (lock) { - if (this.sizeInBytes + size > this.maxMessageSize) { - return false; - } - - this.sizeInBytes += size; - } - - this.events.add(event); - return true; - } - - - /** - * Method to start and end a "Azure.EventHubs.message" span and add the "DiagnosticId" as a property of the message. - * - * @param eventData The Event to add tracing span for. - * @return the updated event data object. - */ - EventData traceMessageSpan(EventData eventData) { - Optional eventContextData = eventData.getContext().getData(SPAN_CONTEXT_KEY); - if (eventContextData.isPresent()) { - // if message has context (in case of retries), don't start a message span or add a new context - return eventData; - } else { - // Starting the span makes the sampling decision (nothing is logged at this time) - Context eventContext = eventData.getContext() - .addData(AZ_TRACING_NAMESPACE_KEY, AZ_NAMESPACE_VALUE) - .addData(ENTITY_PATH_KEY, this.entityPath) - .addData(HOST_NAME_KEY, this.hostname); - Context eventSpanContext = tracerProvider.startSpan(eventContext, ProcessKind.MESSAGE); - Optional eventDiagnosticIdOptional = eventSpanContext.getData(DIAGNOSTIC_ID_KEY); - if (eventDiagnosticIdOptional.isPresent()) { - eventData.getProperties().put(DIAGNOSTIC_ID_KEY, eventDiagnosticIdOptional.get().toString()); - tracerProvider.endSpan(eventSpanContext, Signal.complete()); - eventData.addContext(SPAN_CONTEXT_KEY, eventSpanContext); - } - } - - return eventData; - } - - List getEvents() { - return events; - } - - String getPartitionKey() { - return partitionKey; - } - - String getPartitionId() { - return partitionId; - } - - int getSize(final EventData eventData, final boolean isFirst) { - Objects.requireNonNull(eventData, "'eventData' cannot be null."); - - final Message amqpMessage = createAmqpMessage(eventData, partitionKey); - int eventSize = amqpMessage.encode(this.eventBytes, 0, maxMessageSize); // actual encoded bytes size - eventSize += 16; // data section overhead - - if (isFirst) { - amqpMessage.setBody(null); - amqpMessage.setApplicationProperties(null); - amqpMessage.setProperties(null); - amqpMessage.setDeliveryAnnotations(null); - - eventSize += amqpMessage.encode(this.eventBytes, 0, maxMessageSize); - } - - return eventSize; - } - - /* - * Creates the AMQP message represented by the event data - */ - private Message createAmqpMessage(EventData event, String partitionKey) { - final Message message = Proton.message(); - - if (event.getProperties() != null && !event.getProperties().isEmpty()) { - final ApplicationProperties applicationProperties = new ApplicationProperties(event.getProperties()); - message.setApplicationProperties(applicationProperties); - } - - if (event.getSystemProperties() != null) { - event.getSystemProperties().forEach((key, value) -> { - if (EventData.RESERVED_SYSTEM_PROPERTIES.contains(key)) { - return; - } - - final AmqpMessageConstant constant = AmqpMessageConstant.fromString(key); - - if (constant != null) { - switch (constant) { - case MESSAGE_ID: - message.setMessageId(value); - break; - case USER_ID: - message.setUserId((byte[]) value); - break; - case TO: - message.setAddress((String) value); - break; - case SUBJECT: - message.setSubject((String) value); - break; - case REPLY_TO: - message.setReplyTo((String) value); - break; - case CORRELATION_ID: - message.setCorrelationId(value); - break; - case CONTENT_TYPE: - message.setContentType((String) value); - break; - case CONTENT_ENCODING: - message.setContentEncoding((String) value); - break; - case ABSOLUTE_EXPIRY_TIME: - message.setExpiryTime((long) value); - break; - case CREATION_TIME: - message.setCreationTime((long) value); - break; - case GROUP_ID: - message.setGroupId((String) value); - break; - case GROUP_SEQUENCE: - message.setGroupSequence((long) value); - break; - case REPLY_TO_GROUP_ID: - message.setReplyToGroupId((String) value); - break; - default: - throw logger.logExceptionAsWarning(new IllegalArgumentException(String.format(Locale.US, - "Property is not a recognized reserved property name: %s", key))); - } - } else { - final MessageAnnotations messageAnnotations = (message.getMessageAnnotations() == null) - ? new MessageAnnotations(new HashMap<>()) - : message.getMessageAnnotations(); - messageAnnotations.getValue().put(Symbol.getSymbol(key), value); - message.setMessageAnnotations(messageAnnotations); - } - }); - } - - if (partitionKey != null) { - final MessageAnnotations messageAnnotations = (message.getMessageAnnotations() == null) - ? new MessageAnnotations(new HashMap<>()) - : message.getMessageAnnotations(); - messageAnnotations.getValue().put(AmqpConstants.PARTITION_KEY, partitionKey); - message.setMessageAnnotations(messageAnnotations); - } - - message.setBody(new Data(new Binary(event.getBody()))); - - return message; - } -} diff --git a/sdk/eventhubs/azure-messaging-eventhubs/src/main/java/com/azure/messaging/eventhubs/EventHubAsyncClient.java b/sdk/eventhubs/azure-messaging-eventhubs/src/main/java/com/azure/messaging/eventhubs/EventHubAsyncClient.java index 27191d8d1f985..3a0598a08da51 100644 --- a/sdk/eventhubs/azure-messaging-eventhubs/src/main/java/com/azure/messaging/eventhubs/EventHubAsyncClient.java +++ b/sdk/eventhubs/azure-messaging-eventhubs/src/main/java/com/azure/messaging/eventhubs/EventHubAsyncClient.java @@ -5,7 +5,6 @@ import com.azure.core.amqp.implementation.MessageSerializer; import com.azure.core.amqp.implementation.TracerProvider; -import com.azure.core.experimental.serializer.ObjectSerializer; import com.azure.core.util.logging.ClientLogger; import com.azure.messaging.eventhubs.implementation.EventHubConnectionProcessor; import com.azure.messaging.eventhubs.implementation.EventHubManagementNode; @@ -33,11 +32,9 @@ class EventHubAsyncClient implements Closeable { private final boolean isSharedConnection; private final Runnable onClientClose; private final TracerProvider tracerProvider; - private final ObjectSerializer serializer; EventHubAsyncClient(EventHubConnectionProcessor connectionProcessor, TracerProvider tracerProvider, - MessageSerializer messageSerializer, ObjectSerializer serializer, Scheduler scheduler, - boolean isSharedConnection, Runnable onClientClose) { + MessageSerializer messageSerializer, Scheduler scheduler, boolean isSharedConnection, Runnable onClientClose) { this.tracerProvider = Objects.requireNonNull(tracerProvider, "'tracerProvider' cannot be null."); this.messageSerializer = Objects.requireNonNull(messageSerializer, "'messageSerializer' cannot be null."); this.connectionProcessor = Objects.requireNonNull(connectionProcessor, @@ -46,7 +43,6 @@ class EventHubAsyncClient implements Closeable { this.onClientClose = Objects.requireNonNull(onClientClose, "'onClientClose' cannot be null."); this.isSharedConnection = isSharedConnection; - this.serializer = serializer; } /** @@ -108,8 +104,8 @@ Mono getPartitionProperties(String partitionId) { */ EventHubProducerAsyncClient createProducer() { return new EventHubProducerAsyncClient(connectionProcessor.getFullyQualifiedNamespace(), getEventHubName(), - connectionProcessor, connectionProcessor.getRetryOptions(), tracerProvider, messageSerializer, - serializer, scheduler, isSharedConnection, onClientClose); + connectionProcessor, connectionProcessor.getRetryOptions(), tracerProvider, messageSerializer, scheduler, + isSharedConnection, onClientClose); } /** @@ -133,8 +129,8 @@ EventHubConsumerAsyncClient createConsumer(String consumerGroup, int prefetchCou } return new EventHubConsumerAsyncClient(connectionProcessor.getFullyQualifiedNamespace(), getEventHubName(), - connectionProcessor, messageSerializer, serializer, consumerGroup, prefetchCount, scheduler, - isSharedConnection, onClientClose); + connectionProcessor, messageSerializer, consumerGroup, prefetchCount, scheduler, isSharedConnection, + onClientClose); } /** diff --git a/sdk/eventhubs/azure-messaging-eventhubs/src/main/java/com/azure/messaging/eventhubs/EventHubClientBuilder.java b/sdk/eventhubs/azure-messaging-eventhubs/src/main/java/com/azure/messaging/eventhubs/EventHubClientBuilder.java index 76b66e4b5f17e..009168ce8e933 100644 --- a/sdk/eventhubs/azure-messaging-eventhubs/src/main/java/com/azure/messaging/eventhubs/EventHubClientBuilder.java +++ b/sdk/eventhubs/azure-messaging-eventhubs/src/main/java/com/azure/messaging/eventhubs/EventHubClientBuilder.java @@ -20,7 +20,6 @@ import com.azure.core.annotation.ServiceClientBuilder; import com.azure.core.credential.TokenCredential; import com.azure.core.exception.AzureException; -import com.azure.core.experimental.serializer.ObjectSerializer; import com.azure.core.util.Configuration; import com.azure.core.util.CoreUtils; import com.azure.core.util.logging.ClientLogger; @@ -136,7 +135,6 @@ public class EventHubClientBuilder { private String consumerGroup; private EventHubConnectionProcessor eventHubConnectionProcessor; private int prefetchCount; - private ObjectSerializer serializer; /** * Keeps track of the open clients that were created from this builder when there is a shared connection. @@ -363,18 +361,6 @@ public EventHubClientBuilder prefetchCount(int prefetchCount) { return this; } - /** - * Set ObjectSerializer implementation to be used for creating ObjectBatch. - * - * @param serializer ObjectSerializer implementation - * - * @return updated builder instance - */ - public EventHubClientBuilder serializer(ObjectSerializer serializer) { - this.serializer = serializer; - return this; - } - /** * Package-private method that sets the scheduler for the created Event Hub client. * @@ -499,7 +485,7 @@ EventHubAsyncClient buildAsyncClient() { final TracerProvider tracerProvider = new TracerProvider(ServiceLoader.load(Tracer.class)); - return new EventHubAsyncClient(processor, tracerProvider, messageSerializer, serializer, scheduler, + return new EventHubAsyncClient(processor, tracerProvider, messageSerializer, scheduler, isSharedConnection.get(), this::onClientClose); } diff --git a/sdk/eventhubs/azure-messaging-eventhubs/src/main/java/com/azure/messaging/eventhubs/EventHubConsumerAsyncClient.java b/sdk/eventhubs/azure-messaging-eventhubs/src/main/java/com/azure/messaging/eventhubs/EventHubConsumerAsyncClient.java index ae986f147a2c0..335fc7d3a9735 100644 --- a/sdk/eventhubs/azure-messaging-eventhubs/src/main/java/com/azure/messaging/eventhubs/EventHubConsumerAsyncClient.java +++ b/sdk/eventhubs/azure-messaging-eventhubs/src/main/java/com/azure/messaging/eventhubs/EventHubConsumerAsyncClient.java @@ -11,7 +11,6 @@ import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceClient; import com.azure.core.annotation.ServiceMethod; -import com.azure.core.experimental.serializer.ObjectSerializer; import com.azure.core.util.logging.ClientLogger; import com.azure.messaging.eventhubs.implementation.AmqpReceiveLinkProcessor; import com.azure.messaging.eventhubs.implementation.EventHubConnectionProcessor; @@ -71,7 +70,6 @@ public class EventHubConsumerAsyncClient implements Closeable { private final String eventHubName; private final EventHubConnectionProcessor connectionProcessor; private final MessageSerializer messageSerializer; - private final ObjectSerializer serializer; private final String consumerGroup; private final int prefetchCount; private final Scheduler scheduler; @@ -85,15 +83,12 @@ public class EventHubConsumerAsyncClient implements Closeable { new ConcurrentHashMap<>(); EventHubConsumerAsyncClient(String fullyQualifiedNamespace, String eventHubName, - EventHubConnectionProcessor connectionProcessor, - MessageSerializer messageSerializer, ObjectSerializer serializer, - String consumerGroup, int prefetchCount, Scheduler scheduler, - boolean isSharedConnection, Runnable onClientClosed) { + EventHubConnectionProcessor connectionProcessor, MessageSerializer messageSerializer, String consumerGroup, + int prefetchCount, Scheduler scheduler, boolean isSharedConnection, Runnable onClientClosed) { this.fullyQualifiedNamespace = fullyQualifiedNamespace; this.eventHubName = eventHubName; this.connectionProcessor = connectionProcessor; this.messageSerializer = messageSerializer; - this.serializer = serializer; this.consumerGroup = consumerGroup; this.prefetchCount = prefetchCount; this.scheduler = scheduler; @@ -369,7 +364,7 @@ private EventHubPartitionAsyncConsumer createPartitionConsumer(String linkName, new AmqpReceiveLinkProcessor(prefetchCount, retryPolicy, connectionProcessor)); return new EventHubPartitionAsyncConsumer(linkMessageProcessor, messageSerializer, getFullyQualifiedNamespace(), - getEventHubName(), consumerGroup, partitionId, serializer, - initialPosition, receiveOptions.getTrackLastEnqueuedEventProperties(), scheduler); + getEventHubName(), consumerGroup, partitionId, initialPosition, + receiveOptions.getTrackLastEnqueuedEventProperties(), scheduler); } } diff --git a/sdk/eventhubs/azure-messaging-eventhubs/src/main/java/com/azure/messaging/eventhubs/EventHubPartitionAsyncConsumer.java b/sdk/eventhubs/azure-messaging-eventhubs/src/main/java/com/azure/messaging/eventhubs/EventHubPartitionAsyncConsumer.java index 950d4c532674c..d0b070343d4d6 100644 --- a/sdk/eventhubs/azure-messaging-eventhubs/src/main/java/com/azure/messaging/eventhubs/EventHubPartitionAsyncConsumer.java +++ b/sdk/eventhubs/azure-messaging-eventhubs/src/main/java/com/azure/messaging/eventhubs/EventHubPartitionAsyncConsumer.java @@ -4,7 +4,6 @@ package com.azure.messaging.eventhubs; import com.azure.core.amqp.implementation.MessageSerializer; -import com.azure.core.experimental.serializer.ObjectSerializer; import com.azure.core.util.logging.ClientLogger; import com.azure.messaging.eventhubs.implementation.AmqpReceiveLinkProcessor; import com.azure.messaging.eventhubs.models.EventPosition; @@ -40,16 +39,13 @@ class EventHubPartitionAsyncConsumer implements AutoCloseable { private final Scheduler scheduler; private final EmitterProcessor emitterProcessor; private final EventPosition initialPosition; - private final ObjectSerializer serializer; private volatile Long currentOffset; EventHubPartitionAsyncConsumer(AmqpReceiveLinkProcessor amqpReceiveLinkProcessor, - MessageSerializer messageSerializer, String fullyQualifiedNamespace, - String eventHubName, String consumerGroup, String partitionId, - ObjectSerializer serializer, - AtomicReference> currentEventPosition, - boolean trackLastEnqueuedEventProperties, Scheduler scheduler) { + MessageSerializer messageSerializer, String fullyQualifiedNamespace, String eventHubName, String consumerGroup, + String partitionId, AtomicReference> currentEventPosition, + boolean trackLastEnqueuedEventProperties, Scheduler scheduler) { this.initialPosition = Objects.requireNonNull(currentEventPosition.get().get(), "'currentEventPosition.get().get()' cannot be null."); this.amqpReceiveLinkProcessor = amqpReceiveLinkProcessor; @@ -58,7 +54,6 @@ class EventHubPartitionAsyncConsumer implements AutoCloseable { this.eventHubName = eventHubName; this.consumerGroup = consumerGroup; this.partitionId = partitionId; - this.serializer = serializer; this.trackLastEnqueuedEventProperties = trackLastEnqueuedEventProperties; this.scheduler = Objects.requireNonNull(scheduler, "'scheduler' cannot be null."); @@ -143,6 +138,6 @@ private PartitionEvent onMessageReceived(Message message) { final PartitionContext partitionContext = new PartitionContext(fullyQualifiedNamespace, eventHubName, consumerGroup, partitionId); - return new PartitionEvent(partitionContext, event, lastEnqueuedEventProperties.get(), this.serializer); + return new PartitionEvent(partitionContext, event, lastEnqueuedEventProperties.get()); } } diff --git a/sdk/eventhubs/azure-messaging-eventhubs/src/main/java/com/azure/messaging/eventhubs/EventHubProducerAsyncClient.java b/sdk/eventhubs/azure-messaging-eventhubs/src/main/java/com/azure/messaging/eventhubs/EventHubProducerAsyncClient.java index f7906c6a573a5..f2a81b0ba5bd5 100644 --- a/sdk/eventhubs/azure-messaging-eventhubs/src/main/java/com/azure/messaging/eventhubs/EventHubProducerAsyncClient.java +++ b/sdk/eventhubs/azure-messaging-eventhubs/src/main/java/com/azure/messaging/eventhubs/EventHubProducerAsyncClient.java @@ -15,7 +15,6 @@ import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceClient; import com.azure.core.annotation.ServiceMethod; -import com.azure.core.experimental.serializer.ObjectSerializer; import com.azure.core.util.Context; import com.azure.core.util.CoreUtils; import com.azure.core.util.logging.ClientLogger; @@ -111,7 +110,6 @@ public class EventHubProducerAsyncClient implements Closeable { private final Scheduler scheduler; private final boolean isSharedConnection; private final Runnable onClientClose; - private final ObjectSerializer serializer; /** * Creates a new instance of this {@link EventHubProducerAsyncClient} that can send messages to a single partition @@ -119,10 +117,8 @@ public class EventHubProducerAsyncClient implements Closeable { * load balance the messages amongst available partitions. */ EventHubProducerAsyncClient(String fullyQualifiedNamespace, String eventHubName, - EventHubConnectionProcessor connectionProcessor, AmqpRetryOptions retryOptions, - TracerProvider tracerProvider, MessageSerializer messageSerializer, - ObjectSerializer serializer, Scheduler scheduler, boolean isSharedConnection, - Runnable onClientClose) { + EventHubConnectionProcessor connectionProcessor, AmqpRetryOptions retryOptions, TracerProvider tracerProvider, + MessageSerializer messageSerializer, Scheduler scheduler, boolean isSharedConnection, Runnable onClientClose) { this.fullyQualifiedNamespace = Objects.requireNonNull(fullyQualifiedNamespace, "'fullyQualifiedNamespace' cannot be null."); this.eventHubName = Objects.requireNonNull(eventHubName, "'eventHubName' cannot be null."); @@ -136,7 +132,6 @@ public class EventHubProducerAsyncClient implements Closeable { this.retryPolicy = getRetryPolicy(retryOptions); this.scheduler = scheduler; this.isSharedConnection = isSharedConnection; - this.serializer = serializer; } /** @@ -213,11 +208,6 @@ public Mono createBatch(CreateBatchOptions options) { return monoError(logger, new NullPointerException("'options' cannot be null.")); } - Mono optionsError = validateBatchOptions(options); - if (optionsError != null) { - return optionsError; - } - final String partitionKey = options.getPartitionKey(); final String partitionId = options.getPartitionId(); final int batchMaxSize = options.getMaximumSizeInBytes(); @@ -258,71 +248,6 @@ public Mono createBatch(CreateBatchOptions options) { })); } - /** - * Creates an {@link ObjectBatch} that can fit as many serialized objects as events as the transport allows. - * @param objectType type of object in the batch - * @param object type - * - * @return A new {@link ObjectBatch} that can fit as many serialized objects as events as the transport allows. - */ - public Mono> createBatch(Class objectType) { - return createBatch(objectType, DEFAULT_BATCH_OPTIONS); - } - - /** - * Creates an {@link ObjectBatch} configured with the options specified. - * - * @param objectType type of object in the batch - * @param object type - * @param options A set of options used to configure the {@link ObjectBatch}. - * @return A new {@link ObjectBatch} that can fit as many events as the transport allows. - * @throws NullPointerException if {@code options} is null. - */ - public Mono> createBatch(Class objectType, CreateBatchOptions options) { - if (objectType == null) { - return monoError(logger, new IllegalArgumentException("'objectType' cannot be null.")); - } - if (serializer == null) { - return monoError(logger, - new NullPointerException("No serializer set for performing object serialization for ObjectBatch.")); - } - if (options == null) { - return monoError(logger, new NullPointerException("'options' cannot be null.")); - } - - Mono> optionsError = validateBatchOptions(options); - if (optionsError != null) { - return optionsError; - } - - final String partitionKey = options.getPartitionKey(); - final String partitionId = options.getPartitionId(); - final int batchMaxSize = options.getMaximumSizeInBytes(); - - return getSendLink(partitionId) - .flatMap(link -> link.getLinkSize() - .flatMap(size -> { - final int maximumLinkSize = size > 0 - ? size - : MAX_MESSAGE_LENGTH_BYTES; - - if (batchMaxSize > maximumLinkSize) { - return monoError(logger, - new IllegalArgumentException(String.format(Locale.US, - "BatchOptions.maximumSizeInBytes (%s bytes) is larger than the link size (%s bytes).", - batchMaxSize, maximumLinkSize))); - } - - final int batchSize = batchMaxSize > 0 - ? batchMaxSize - : maximumLinkSize; - - return Mono.just(new ObjectBatch<>(batchSize, partitionId, partitionKey, objectType, - link::getErrorContext, tracerProvider, serializer, - link.getEntityPath(), link.getHostname())); - })); - } - /** * Sends a single event to the associated Event Hub. If the size of the single event exceeds the maximum size * allowed, an exception will be triggered and the send will fail. @@ -585,22 +510,6 @@ private Mono getSendLink(String partitionId) { .flatMap(connection -> connection.createSendLink(linkName, entityPath, retryOptions)); } - private Mono validateBatchOptions(CreateBatchOptions options) { - if (!CoreUtils.isNullOrEmpty(options.getPartitionKey()) - && !CoreUtils.isNullOrEmpty(options.getPartitionId())) { - return monoError(logger, new IllegalArgumentException(String.format(Locale.US, - "CreateBatchOptions.getPartitionKey() and CreateBatchOptions.getPartitionId() are both set. " - + "Only one or the other can be used. partitionKey: '%s'. partitionId: '%s'", - options.getPartitionKey(), options.getPartitionId()))); - } else if (!CoreUtils.isNullOrEmpty(options.getPartitionKey()) - && options.getPartitionKey().length() > MAX_PARTITION_KEY_LENGTH) { - return monoError(logger, new IllegalArgumentException(String.format(Locale.US, - "Partition key '%s' exceeds the maximum allowed length: '%s'.", options.getPartitionKey(), - MAX_PARTITION_KEY_LENGTH))); - } - return null; - } - /** * Disposes of the {@link EventHubProducerAsyncClient}. If the client had a dedicated connection, the underlying * connection is also closed. diff --git a/sdk/eventhubs/azure-messaging-eventhubs/src/main/java/com/azure/messaging/eventhubs/ObjectBatch.java b/sdk/eventhubs/azure-messaging-eventhubs/src/main/java/com/azure/messaging/eventhubs/ObjectBatch.java deleted file mode 100644 index 587e98d31f68d..0000000000000 --- a/sdk/eventhubs/azure-messaging-eventhubs/src/main/java/com/azure/messaging/eventhubs/ObjectBatch.java +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.messaging.eventhubs; - -import com.azure.core.amqp.exception.AmqpException; -import com.azure.core.amqp.implementation.ErrorContextProvider; -import com.azure.core.amqp.implementation.TracerProvider; -import com.azure.core.util.logging.ClientLogger; -import com.azure.core.experimental.serializer.ObjectSerializer; -import reactor.core.publisher.Mono; - -import java.io.ByteArrayOutputStream; -import java.util.Objects; - -import static com.azure.core.util.FluxUtil.monoError; - -/** - * A class for aggregating Java objects into a single, size-limited, batch. Objects are serialized into EventData - * objects and are added to the batch. It is treated as a single message when sent to the Azure Event Hubs service. - * - * @param type of objects in the batch. Multi-type batches are not permitted. - */ -public final class ObjectBatch extends EventDataBatchBase { - private final ClientLogger logger = new ClientLogger(ObjectBatch.class); - private final Class batchType; - private final ObjectSerializer serializer; - - ObjectBatch(int maxMessageSize, String partitionId, String partitionKey, Class batchType, - ErrorContextProvider contextProvider, TracerProvider tracerProvider, - ObjectSerializer serializer, String entityPath, String hostname) { - super(maxMessageSize, partitionId, partitionKey, contextProvider, tracerProvider, entityPath, hostname); - this.batchType = Objects.requireNonNull(batchType, "'batchType' cannot be null."); - this.serializer = Objects.requireNonNull(serializer, "'serializer' cannot be null."); - } - - /** - * Tries to asynchronously serialize an object into an EventData payload and add the EventData to the batch. - * - * @param object The object to add to the batch. - * @return {@code true} if the object could be added to the batch; {@code false} if the serialized - * object was too large to fit in the batch. - * @throws IllegalArgumentException if object is {@code null}. - * @throws AmqpException if serialized object as {@link EventData} is larger than the maximum size - * of the {@link EventDataBatch}. - */ - public Mono tryAdd(final T object) { - if (object == null) { - return monoError(logger, new IllegalArgumentException("object cannot be null")); - } - - ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); - return serializer.serialize(outputStream, object).map(s -> tryAdd(new EventData(s.toByteArray()))); - } -} diff --git a/sdk/eventhubs/azure-messaging-eventhubs/src/main/java/com/azure/messaging/eventhubs/models/PartitionEvent.java b/sdk/eventhubs/azure-messaging-eventhubs/src/main/java/com/azure/messaging/eventhubs/models/PartitionEvent.java index cc7f9b2dcf61c..838025b1eff4e 100644 --- a/sdk/eventhubs/azure-messaging-eventhubs/src/main/java/com/azure/messaging/eventhubs/models/PartitionEvent.java +++ b/sdk/eventhubs/azure-messaging-eventhubs/src/main/java/com/azure/messaging/eventhubs/models/PartitionEvent.java @@ -4,16 +4,10 @@ package com.azure.messaging.eventhubs.models; import com.azure.core.annotation.Immutable; -import com.azure.core.experimental.serializer.ObjectSerializer; -import com.azure.core.util.logging.ClientLogger; import com.azure.messaging.eventhubs.EventData; -import reactor.core.publisher.Mono; -import java.io.ByteArrayInputStream; import java.util.Objects; -import static com.azure.core.util.FluxUtil.monoError; - /** * A container for {@link EventData} along with the partition information for this event data. */ @@ -23,21 +17,6 @@ public class PartitionEvent { private final PartitionContext partitionContext; private final EventData eventData; private final LastEnqueuedEventProperties lastEnqueuedEventProperties; - private final ObjectSerializer serializer; - private final ClientLogger logger = new ClientLogger(PartitionEvent.class); - - /** - * Creates an instance of PartitionEvent. - * - * @param partitionContext The partition information associated with the event data. - * @param eventData The event data received from the Event Hub. - * @param lastEnqueuedEventProperties The properties of the last enqueued event in the partition. - * @throws NullPointerException if {@code partitionContext} or {@code eventData} is {@code null}. - */ - public PartitionEvent(final PartitionContext partitionContext, final EventData eventData, - LastEnqueuedEventProperties lastEnqueuedEventProperties) { - this(partitionContext, eventData, lastEnqueuedEventProperties, null); - } /** * Creates an instance of PartitionEvent. @@ -45,15 +24,13 @@ public PartitionEvent(final PartitionContext partitionContext, final EventData e * @param partitionContext The partition information associated with the event data. * @param eventData The event data received from the Event Hub. * @param lastEnqueuedEventProperties The properties of the last enqueued event in the partition. - * @param serializer ObjectSerializer implementation for deserializing event data payload. May be null. * @throws NullPointerException if {@code partitionContext} or {@code eventData} is {@code null}. */ public PartitionEvent(final PartitionContext partitionContext, final EventData eventData, - LastEnqueuedEventProperties lastEnqueuedEventProperties, ObjectSerializer serializer) { + LastEnqueuedEventProperties lastEnqueuedEventProperties) { this.partitionContext = Objects.requireNonNull(partitionContext, "'partitionContext' cannot be null"); this.eventData = Objects.requireNonNull(eventData, "'eventData' cannot be null"); this.lastEnqueuedEventProperties = lastEnqueuedEventProperties; - this.serializer = serializer; } /** @@ -82,23 +59,4 @@ public EventData getData() { public LastEnqueuedEventProperties getLastEnqueuedEventProperties() { return lastEnqueuedEventProperties; } - - /** - * Deserializes event payload into object. - * - * @param objectType Class object of type T - * @param object type for deserialization - * @return deserialized object as type T - */ - public Mono getDeserializedObject(Class objectType) { - if (this.serializer == null) { - return monoError(logger, - new NullPointerException("No serializer set for deserializing EventData payload.")); - } - if (objectType == null) { - return monoError(logger, new IllegalArgumentException("objectType cannot be null.")); - } - - return serializer.deserialize(new ByteArrayInputStream(eventData.getBody()), objectType); - } } diff --git a/sdk/eventhubs/azure-messaging-eventhubs/src/main/java/module-info.java b/sdk/eventhubs/azure-messaging-eventhubs/src/main/java/module-info.java index e743ad96cb64a..0386dee075a72 100644 --- a/sdk/eventhubs/azure-messaging-eventhubs/src/main/java/module-info.java +++ b/sdk/eventhubs/azure-messaging-eventhubs/src/main/java/module-info.java @@ -3,7 +3,6 @@ module com.azure.messaging.eventhubs { requires transitive com.azure.core; - requires transitive com.azure.core.experimental; requires transitive com.azure.core.amqp; requires com.microsoft.azure.qpid.protonj.extensions; diff --git a/sdk/eventhubs/azure-messaging-eventhubs/src/test/java/com/azure/messaging/eventhubs/EventDataBatchBaseTest.java b/sdk/eventhubs/azure-messaging-eventhubs/src/test/java/com/azure/messaging/eventhubs/EventDataBatchTest.java similarity index 98% rename from sdk/eventhubs/azure-messaging-eventhubs/src/test/java/com/azure/messaging/eventhubs/EventDataBatchBaseTest.java rename to sdk/eventhubs/azure-messaging-eventhubs/src/test/java/com/azure/messaging/eventhubs/EventDataBatchTest.java index 8a8a529ff7ab7..ea85afedd71f0 100644 --- a/sdk/eventhubs/azure-messaging-eventhubs/src/test/java/com/azure/messaging/eventhubs/EventDataBatchBaseTest.java +++ b/sdk/eventhubs/azure-messaging-eventhubs/src/test/java/com/azure/messaging/eventhubs/EventDataBatchTest.java @@ -20,7 +20,7 @@ import static org.junit.jupiter.api.Assertions.assertThrows; import static org.mockito.Mockito.when; -public class EventDataBatchBaseTest { +public class EventDataBatchTest { private static final String PARTITION_KEY = "PartitionIDCopyFromProducerOption"; @Mock diff --git a/sdk/eventhubs/azure-messaging-eventhubs/src/test/java/com/azure/messaging/eventhubs/EventHubConsumerAsyncClientTest.java b/sdk/eventhubs/azure-messaging-eventhubs/src/test/java/com/azure/messaging/eventhubs/EventHubConsumerAsyncClientTest.java index ce9461c31e179..c37f1686c710d 100644 --- a/sdk/eventhubs/azure-messaging-eventhubs/src/test/java/com/azure/messaging/eventhubs/EventHubConsumerAsyncClientTest.java +++ b/sdk/eventhubs/azure-messaging-eventhubs/src/test/java/com/azure/messaging/eventhubs/EventHubConsumerAsyncClientTest.java @@ -136,7 +136,7 @@ CbsAuthorizationType.SHARED_ACCESS_SIGNATURE, AmqpTransportType.AMQP_WEB_SOCKETS .subscribeWith(new EventHubConnectionProcessor(connectionOptions.getFullyQualifiedNamespace(), "event-hub-name", connectionOptions.getRetry())); - consumer = new EventHubConsumerAsyncClient(HOSTNAME, EVENT_HUB_NAME, connectionProcessor, messageSerializer, null, + consumer = new EventHubConsumerAsyncClient(HOSTNAME, EVENT_HUB_NAME, connectionProcessor, messageSerializer, CONSUMER_GROUP, PREFETCH, parallelScheduler, false, onClientClosed); } @@ -156,7 +156,7 @@ void teardown() { @Test void lastEnqueuedEventInformationIsNull() { final EventHubConsumerAsyncClient runtimeConsumer = new EventHubConsumerAsyncClient(HOSTNAME, EVENT_HUB_NAME, - connectionProcessor, messageSerializer, null, CONSUMER_GROUP, DEFAULT_PREFETCH_COUNT, parallelScheduler, false, onClientClosed); + connectionProcessor, messageSerializer, CONSUMER_GROUP, DEFAULT_PREFETCH_COUNT, parallelScheduler, false, onClientClosed); final int numberOfEvents = 10; when(amqpReceiveLink.getCredits()).thenReturn(numberOfEvents); final int numberToReceive = 3; @@ -179,7 +179,7 @@ void lastEnqueuedEventInformationIsNull() { void lastEnqueuedEventInformationCreated() { // Arrange final EventHubConsumerAsyncClient runtimeConsumer = new EventHubConsumerAsyncClient(HOSTNAME, EVENT_HUB_NAME, - connectionProcessor, messageSerializer, null, CONSUMER_GROUP, DEFAULT_PREFETCH_COUNT, Schedulers.parallel(), false, onClientClosed); + connectionProcessor, messageSerializer, CONSUMER_GROUP, DEFAULT_PREFETCH_COUNT, Schedulers.parallel(), false, onClientClosed); final int numberOfEvents = 10; final ReceiveOptions receiveOptions = new ReceiveOptions().setTrackLastEnqueuedEventProperties(true); when(amqpReceiveLink.getCredits()).thenReturn(numberOfEvents); @@ -232,7 +232,7 @@ void receivesNumberOfEventsAllowsBlock() throws InterruptedException { // Scheduling on elastic to simulate a user passed in scheduler (this is the default in EventHubClientBuilder). final EventHubConsumerAsyncClient myConsumer = new EventHubConsumerAsyncClient(HOSTNAME, EVENT_HUB_NAME, - connectionProcessor, messageSerializer, null, CONSUMER_GROUP, PREFETCH, Schedulers.elastic(), false, onClientClosed); + connectionProcessor, messageSerializer, CONSUMER_GROUP, PREFETCH, Schedulers.elastic(), false, onClientClosed); final Flux eventsFlux = myConsumer.receiveFromPartition(PARTITION_ID, EventPosition.earliest()) .take(numberOfEvents); @@ -294,7 +294,7 @@ void returnsNewListener() { any(ReceiveOptions.class))).thenReturn(Mono.just(link2), Mono.just(link3)); EventHubConsumerAsyncClient asyncClient = new EventHubConsumerAsyncClient(HOSTNAME, EVENT_HUB_NAME, - eventHubConnection, messageSerializer, null, CONSUMER_GROUP, PREFETCH, testScheduler, false, onClientClosed); + eventHubConnection, messageSerializer, CONSUMER_GROUP, PREFETCH, testScheduler, false, onClientClosed); // Act & Assert StepVerifier.create(asyncClient.receiveFromPartition(PARTITION_ID, EventPosition.earliest()).take(numberOfEvents)) @@ -517,7 +517,7 @@ void receivesMultiplePartitions() { .thenReturn(Mono.just(new EventHubProperties(EVENT_HUB_NAME, Instant.EPOCH, partitions))); EventHubConsumerAsyncClient asyncClient = new EventHubConsumerAsyncClient(HOSTNAME, EVENT_HUB_NAME, - eventHubConnection, messageSerializer, null, CONSUMER_GROUP, PREFETCH, parallelScheduler, false, onClientClosed); + eventHubConnection, messageSerializer, CONSUMER_GROUP, PREFETCH, parallelScheduler, false, onClientClosed); EmitterProcessor processor2 = EmitterProcessor.create(); FluxSink processor2sink = processor2.sink(); @@ -592,7 +592,7 @@ void receivesMultiplePartitionsWhenOneCloses() { .thenReturn(Mono.just(new EventHubProperties(EVENT_HUB_NAME, Instant.EPOCH, partitions))); EventHubConsumerAsyncClient asyncClient = new EventHubConsumerAsyncClient(HOSTNAME, EVENT_HUB_NAME, - eventHubConnection, messageSerializer, null, CONSUMER_GROUP, PREFETCH, Schedulers.parallel(), false, onClientClosed); + eventHubConnection, messageSerializer, CONSUMER_GROUP, PREFETCH, Schedulers.parallel(), false, onClientClosed); EmitterProcessor processor2 = EmitterProcessor.create(); FluxSink processor2sink = processor2.sink(); @@ -652,7 +652,7 @@ void doesNotCloseSharedConnection() { EventHubConnectionProcessor eventHubConnection = Flux.create(sink -> sink.next(connection1)) .subscribeWith(new EventHubConnectionProcessor(HOSTNAME, EVENT_HUB_NAME, retryOptions)); EventHubConsumerAsyncClient sharedConsumer = new EventHubConsumerAsyncClient(HOSTNAME, EVENT_HUB_NAME, - eventHubConnection, messageSerializer, null, CONSUMER_GROUP, PREFETCH, Schedulers.parallel(), true, onClientClosed); + eventHubConnection, messageSerializer, CONSUMER_GROUP, PREFETCH, Schedulers.parallel(), true, onClientClosed); // Act sharedConsumer.close(); @@ -672,7 +672,7 @@ void closesDedicatedConnection() { // Arrange EventHubConnectionProcessor hubConnection = mock(EventHubConnectionProcessor.class); EventHubConsumerAsyncClient dedicatedConsumer = new EventHubConsumerAsyncClient(HOSTNAME, EVENT_HUB_NAME, - hubConnection, messageSerializer, null, CONSUMER_GROUP, PREFETCH, Schedulers.parallel(), false, onClientClosed); + hubConnection, messageSerializer, CONSUMER_GROUP, PREFETCH, Schedulers.parallel(), false, onClientClosed); // Act dedicatedConsumer.close(); diff --git a/sdk/eventhubs/azure-messaging-eventhubs/src/test/java/com/azure/messaging/eventhubs/EventHubConsumerClientTest.java b/sdk/eventhubs/azure-messaging-eventhubs/src/test/java/com/azure/messaging/eventhubs/EventHubConsumerClientTest.java index 6aa9c9cb85fdb..b05a875f23617 100644 --- a/sdk/eventhubs/azure-messaging-eventhubs/src/test/java/com/azure/messaging/eventhubs/EventHubConsumerClientTest.java +++ b/sdk/eventhubs/azure-messaging-eventhubs/src/test/java/com/azure/messaging/eventhubs/EventHubConsumerClientTest.java @@ -118,7 +118,7 @@ CbsAuthorizationType.SHARED_ACCESS_SIGNATURE, AmqpTransportType.AMQP_WEB_SOCKETS })); asyncConsumer = new EventHubConsumerAsyncClient(HOSTNAME, EVENT_HUB_NAME, - connectionProcessor, messageSerializer, null, CONSUMER_GROUP, PREFETCH, Schedulers.parallel(), false, onClientClosed); + connectionProcessor, messageSerializer, CONSUMER_GROUP, PREFETCH, Schedulers.parallel(), false, onClientClosed); consumer = new EventHubConsumerClient(asyncConsumer, Duration.ofSeconds(10)); } @@ -142,8 +142,8 @@ public static void dispose() { public void lastEnqueuedEventInformationIsNull() { // Arrange final EventHubConsumerAsyncClient runtimeConsumer = new EventHubConsumerAsyncClient( - HOSTNAME, EVENT_HUB_NAME, connectionProcessor, messageSerializer, null, - CONSUMER_GROUP, PREFETCH, Schedulers.parallel(), false, onClientClosed); + HOSTNAME, EVENT_HUB_NAME, connectionProcessor, messageSerializer, CONSUMER_GROUP, + PREFETCH, Schedulers.parallel(), false, onClientClosed); final EventHubConsumerClient consumer = new EventHubConsumerClient(runtimeConsumer, Duration.ofSeconds(5)); final int numberOfEvents = 10; sendMessages(sink, numberOfEvents, PARTITION_ID); @@ -172,8 +172,8 @@ public void lastEnqueuedEventInformationCreated() { // Arrange final ReceiveOptions options = new ReceiveOptions().setTrackLastEnqueuedEventProperties(true); final EventHubConsumerAsyncClient runtimeConsumer = new EventHubConsumerAsyncClient( - HOSTNAME, EVENT_HUB_NAME, connectionProcessor, messageSerializer, null, CONSUMER_GROUP, - PREFETCH, Schedulers.parallel(), false, onClientClosed); + HOSTNAME, EVENT_HUB_NAME, connectionProcessor, messageSerializer, CONSUMER_GROUP, PREFETCH, + Schedulers.parallel(), false, onClientClosed); final EventHubConsumerClient consumer = new EventHubConsumerClient(runtimeConsumer, Duration.ofSeconds(5)); final int numberOfEvents = 10; diff --git a/sdk/eventhubs/azure-messaging-eventhubs/src/test/java/com/azure/messaging/eventhubs/EventHubPartitionAsyncConsumerTest.java b/sdk/eventhubs/azure-messaging-eventhubs/src/test/java/com/azure/messaging/eventhubs/EventHubPartitionAsyncConsumerTest.java index 64cd339cbd64e..3510200950493 100644 --- a/sdk/eventhubs/azure-messaging-eventhubs/src/test/java/com/azure/messaging/eventhubs/EventHubPartitionAsyncConsumerTest.java +++ b/sdk/eventhubs/azure-messaging-eventhubs/src/test/java/com/azure/messaging/eventhubs/EventHubPartitionAsyncConsumerTest.java @@ -8,7 +8,6 @@ import com.azure.core.amqp.AmqpRetryPolicy; import com.azure.core.amqp.implementation.AmqpReceiveLink; import com.azure.core.amqp.implementation.MessageSerializer; -import com.azure.core.experimental.serializer.ObjectSerializer; import com.azure.core.util.Context; import com.azure.core.util.logging.ClientLogger; import com.azure.messaging.eventhubs.implementation.AmqpReceiveLinkProcessor; @@ -31,12 +30,9 @@ import reactor.core.publisher.DirectProcessor; import reactor.core.publisher.Flux; import reactor.core.publisher.FluxSink; -import reactor.core.publisher.Mono; import reactor.core.scheduler.Schedulers; import reactor.test.StepVerifier; -import java.io.InputStream; -import java.io.OutputStream; import java.time.Duration; import java.time.Instant; import java.util.Date; @@ -121,7 +117,7 @@ void receivesMessages(boolean trackLastEnqueuedProperties) { // Arrange linkProcessor = createSink(link1, link2).subscribeWith(new AmqpReceiveLinkProcessor(PREFETCH, retryPolicy, parentConnection)); consumer = new EventHubPartitionAsyncConsumer(linkProcessor, messageSerializer, HOSTNAME, EVENT_HUB_NAME, - CONSUMER_GROUP, PARTITION_ID, null, currentPosition, trackLastEnqueuedProperties, Schedulers.parallel()); + CONSUMER_GROUP, PARTITION_ID, currentPosition, trackLastEnqueuedProperties, Schedulers.parallel()); final EventData event1 = new EventData("Foo"); final EventData event2 = new EventData("Bar"); @@ -169,7 +165,7 @@ void receiveMultipleTimes() { // Arrange linkProcessor = createSink(link1, link2).subscribeWith(new AmqpReceiveLinkProcessor(PREFETCH, retryPolicy, parentConnection)); consumer = new EventHubPartitionAsyncConsumer(linkProcessor, messageSerializer, HOSTNAME, EVENT_HUB_NAME, - CONSUMER_GROUP, PARTITION_ID, null, currentPosition, false, Schedulers.parallel()); + CONSUMER_GROUP, PARTITION_ID, currentPosition, false, Schedulers.parallel()); final Message message3 = mock(Message.class); final String secondOffset = "54"; @@ -228,57 +224,6 @@ void receiveMultipleTimes() { Assertions.assertFalse(actual.isInclusive()); } - @Test - void receiveAndDeserialize() { - // just a test value - Object o = 0; - ObjectSerializer testSerializer = new ObjectSerializer() { - @Override - public Mono deserialize(InputStream stream, Class clazz) { - if (clazz.isInstance(o)) { - return Mono.just(clazz.cast(o)); - } - return null; - } - - @Override - public Mono serialize(S stream, Object value) { - return null; - } - }; - - // Arrange - linkProcessor = createSink(link1, link2).subscribeWith(new AmqpReceiveLinkProcessor(PREFETCH, retryPolicy, parentConnection)); - consumer = new EventHubPartitionAsyncConsumer(linkProcessor, messageSerializer, HOSTNAME, EVENT_HUB_NAME, - CONSUMER_GROUP, PARTITION_ID, testSerializer, currentPosition, false, Schedulers.parallel()); - - final EventData event = new EventData("Foo"); - final LastEnqueuedEventProperties last = new LastEnqueuedEventProperties(10L, 15L, - Instant.ofEpochMilli(1243454), Instant.ofEpochMilli(1240004)); - - when(messageSerializer.deserialize(same(message1), eq(EventData.class))).thenReturn(event); - when(messageSerializer.deserialize(same(message1), eq(LastEnqueuedEventProperties.class))).thenReturn(last); - - // Act & Assert - StepVerifier.create(consumer.receive()) - .then(() -> { - messageProcessorSink.next(message1); - }) - .assertNext(partitionEvent -> { - verifyPartitionContext(partitionEvent.getPartitionContext()); - verifyLastEnqueuedInformation(false, last, - partitionEvent.getLastEnqueuedEventProperties()); - Assertions.assertSame(event, partitionEvent.getData()); - Assertions.assertSame(Integer.class.cast(o), partitionEvent.getDeserializedObject(Integer.class).block()); - }) - .thenCancel() - .verify(); - - // The emitter processor is not closed until the partition consumer is. - Assertions.assertFalse(linkProcessor.isTerminated()); - Assertions.assertSame(originalPosition, currentPosition.get().get()); - } - /** * Verifies that the consumer closes and completes any listeners on a shutdown signal. @@ -288,7 +233,7 @@ void listensToShutdownSignals() throws InterruptedException { // Arrange linkProcessor = createSink(link1, link2).subscribeWith(new AmqpReceiveLinkProcessor(PREFETCH, retryPolicy, parentConnection)); consumer = new EventHubPartitionAsyncConsumer(linkProcessor, messageSerializer, HOSTNAME, EVENT_HUB_NAME, - CONSUMER_GROUP, PARTITION_ID, null, currentPosition, false, Schedulers.parallel()); + CONSUMER_GROUP, PARTITION_ID, currentPosition, false, Schedulers.parallel()); final Message message3 = mock(Message.class); final String secondOffset = "54"; diff --git a/sdk/eventhubs/azure-messaging-eventhubs/src/test/java/com/azure/messaging/eventhubs/EventHubProducerAsyncClientTest.java b/sdk/eventhubs/azure-messaging-eventhubs/src/test/java/com/azure/messaging/eventhubs/EventHubProducerAsyncClientTest.java index 6ab8b2d20f3a9..85eaacce57ff4 100644 --- a/sdk/eventhubs/azure-messaging-eventhubs/src/test/java/com/azure/messaging/eventhubs/EventHubProducerAsyncClientTest.java +++ b/sdk/eventhubs/azure-messaging-eventhubs/src/test/java/com/azure/messaging/eventhubs/EventHubProducerAsyncClientTest.java @@ -146,7 +146,7 @@ void setup(TestInfo testInfo) { new EventHubConnectionProcessor(connectionOptions.getFullyQualifiedNamespace(), "event-hub-path", connectionOptions.getRetry())); producer = new EventHubProducerAsyncClient(HOSTNAME, EVENT_HUB_NAME, connectionProcessor, retryOptions, - tracerProvider, messageSerializer, null, testScheduler, false, onClientClosed); + tracerProvider, messageSerializer, testScheduler, false, onClientClosed); when(sendLink.getLinkSize()).thenReturn(Mono.just(ClientConstants.MAX_MESSAGE_LENGTH_BYTES)); when(sendLink2.getLinkSize()).thenReturn(Mono.just(ClientConstants.MAX_MESSAGE_LENGTH_BYTES)); @@ -238,7 +238,7 @@ void sendSingleMessageWithBlock() throws InterruptedException { final Semaphore semaphore = new Semaphore(1); // In our actual client builder, we allow this. final EventHubProducerAsyncClient flexibleProducer = new EventHubProducerAsyncClient(HOSTNAME, EVENT_HUB_NAME, - connectionProcessor, retryOptions, tracerProvider, messageSerializer, null, testScheduler, + connectionProcessor, retryOptions, tracerProvider, messageSerializer, testScheduler, false, onClientClosed); // EC is the prefix they use when creating a link that sends to the service round-robin. @@ -319,7 +319,7 @@ void sendStartSpanSingleMessage() { final SendOptions sendOptions = new SendOptions() .setPartitionId(partitionId); final EventHubProducerAsyncClient asyncProducer = new EventHubProducerAsyncClient(HOSTNAME, EVENT_HUB_NAME, - connectionProcessor, retryOptions, tracerProvider, messageSerializer, null, Schedulers.parallel(), + connectionProcessor, retryOptions, tracerProvider, messageSerializer, Schedulers.parallel(), false, onClientClosed); when(connection.createSendLink( @@ -377,7 +377,7 @@ void sendMessageRetrySpanTest() { TracerProvider tracerProvider = new TracerProvider(tracers); producer = new EventHubProducerAsyncClient(HOSTNAME, EVENT_HUB_NAME, connectionProcessor, retryOptions, - tracerProvider, messageSerializer, null, Schedulers.parallel(), false, onClientClosed); + tracerProvider, messageSerializer, Schedulers.parallel(), false, onClientClosed); final String failureKey = "fail"; final EventData testData = new EventData("test"); @@ -516,7 +516,7 @@ void startMessageSpansOnCreateBatch() { final List tracers = Collections.singletonList(tracer1); TracerProvider tracerProvider = new TracerProvider(tracers); final EventHubProducerAsyncClient asyncProducer = new EventHubProducerAsyncClient(HOSTNAME, EVENT_HUB_NAME, - connectionProcessor, retryOptions, tracerProvider, messageSerializer, null, Schedulers.parallel(), + connectionProcessor, retryOptions, tracerProvider, messageSerializer, Schedulers.parallel(), false, onClientClosed); final AmqpSendLink link = mock(AmqpSendLink.class); @@ -822,7 +822,7 @@ void doesNotCloseSharedConnection() { // Arrange EventHubConnectionProcessor hubConnection = mock(EventHubConnectionProcessor.class); EventHubProducerAsyncClient sharedProducer = new EventHubProducerAsyncClient(HOSTNAME, EVENT_HUB_NAME, - hubConnection, retryOptions, tracerProvider, messageSerializer, null, Schedulers.parallel(), + hubConnection, retryOptions, tracerProvider, messageSerializer, Schedulers.parallel(), true, onClientClosed); // Act @@ -841,7 +841,7 @@ void closesDedicatedConnection() { // Arrange EventHubConnectionProcessor hubConnection = mock(EventHubConnectionProcessor.class); EventHubProducerAsyncClient dedicatedProducer = new EventHubProducerAsyncClient(HOSTNAME, EVENT_HUB_NAME, - hubConnection, retryOptions, tracerProvider, messageSerializer, null, Schedulers.parallel(), + hubConnection, retryOptions, tracerProvider, messageSerializer, Schedulers.parallel(), false, onClientClosed); // Act @@ -860,7 +860,7 @@ void closesDedicatedConnectionOnlyOnce() { // Arrange EventHubConnectionProcessor hubConnection = mock(EventHubConnectionProcessor.class); EventHubProducerAsyncClient dedicatedProducer = new EventHubProducerAsyncClient(HOSTNAME, EVENT_HUB_NAME, - hubConnection, retryOptions, tracerProvider, messageSerializer, null, Schedulers.parallel(), + hubConnection, retryOptions, tracerProvider, messageSerializer, Schedulers.parallel(), false, onClientClosed); // Act @@ -897,7 +897,7 @@ void reopensOnFailure() { new EventHubConnectionProcessor(EVENT_HUB_NAME, connectionOptions.getFullyQualifiedNamespace(), connectionOptions.getRetry())); producer = new EventHubProducerAsyncClient(HOSTNAME, EVENT_HUB_NAME, connectionProcessor, retryOptions, - tracerProvider, messageSerializer, null, Schedulers.parallel(), false, onClientClosed); + tracerProvider, messageSerializer, Schedulers.parallel(), false, onClientClosed); final int count = 4; final byte[] contents = TEST_CONTENTS.getBytes(UTF_8); @@ -972,7 +972,7 @@ void closesOnNonTransientFailure() { new EventHubConnectionProcessor(connectionOptions.getFullyQualifiedNamespace(), EVENT_HUB_NAME, connectionOptions.getRetry())); producer = new EventHubProducerAsyncClient(HOSTNAME, EVENT_HUB_NAME, connectionProcessor, retryOptions, - tracerProvider, messageSerializer, null, Schedulers.parallel(), false, onClientClosed); + tracerProvider, messageSerializer, Schedulers.parallel(), false, onClientClosed); final int count = 4; final byte[] contents = TEST_CONTENTS.getBytes(UTF_8); @@ -1048,7 +1048,7 @@ void resendMessageOnTransientLinkFailure() { new EventHubConnectionProcessor(connectionOptions.getFullyQualifiedNamespace(), EVENT_HUB_NAME, connectionOptions.getRetry())); producer = new EventHubProducerAsyncClient(HOSTNAME, EVENT_HUB_NAME, connectionProcessor, retryOptions, - tracerProvider, messageSerializer, null, Schedulers.parallel(), false, onClientClosed); + tracerProvider, messageSerializer, Schedulers.parallel(), false, onClientClosed); final int count = 4; final byte[] contents = TEST_CONTENTS.getBytes(UTF_8); diff --git a/sdk/eventhubs/azure-messaging-eventhubs/src/test/java/com/azure/messaging/eventhubs/EventHubProducerClientTest.java b/sdk/eventhubs/azure-messaging-eventhubs/src/test/java/com/azure/messaging/eventhubs/EventHubProducerClientTest.java index 02ec09aaeb2c1..9e0455d89957b 100644 --- a/sdk/eventhubs/azure-messaging-eventhubs/src/test/java/com/azure/messaging/eventhubs/EventHubProducerClientTest.java +++ b/sdk/eventhubs/azure-messaging-eventhubs/src/test/java/com/azure/messaging/eventhubs/EventHubProducerClientTest.java @@ -105,7 +105,7 @@ public void setup() { .subscribeWith(new EventHubConnectionProcessor(connectionOptions.getFullyQualifiedNamespace(), "event-hub-path", connectionOptions.getRetry())); asyncProducer = new EventHubProducerAsyncClient(HOSTNAME, EVENT_HUB_NAME, connectionProcessor, retryOptions, - tracerProvider, messageSerializer, null, Schedulers.parallel(), false, onClientClosed); + tracerProvider, messageSerializer, Schedulers.parallel(), false, onClientClosed); when(connection.getEndpointStates()).thenReturn(Flux.create(sink -> sink.next(AmqpEndpointState.ACTIVE))); } @@ -157,7 +157,7 @@ public void sendStartSpanSingleMessage() { final List tracers = Collections.singletonList(tracer1); final TracerProvider tracerProvider = new TracerProvider(tracers); final EventHubProducerAsyncClient asyncProducer = new EventHubProducerAsyncClient(HOSTNAME, EVENT_HUB_NAME, - connectionProcessor, retryOptions, tracerProvider, messageSerializer, null, Schedulers.parallel(), + connectionProcessor, retryOptions, tracerProvider, messageSerializer, Schedulers.parallel(), false, onClientClosed); final EventHubProducerClient producer = new EventHubProducerClient(asyncProducer, retryOptions.getTryTimeout()); final EventData eventData = new EventData("hello-world".getBytes(UTF_8)); @@ -219,7 +219,7 @@ public void sendMessageRetrySpanTest() { .thenReturn(Mono.just(sendLink)); final EventHubProducerAsyncClient asyncProducer = new EventHubProducerAsyncClient(HOSTNAME, EVENT_HUB_NAME, - connectionProcessor, retryOptions, tracerProvider, messageSerializer, null, Schedulers.parallel(), false, onClientClosed); + connectionProcessor, retryOptions, tracerProvider, messageSerializer, Schedulers.parallel(), false, onClientClosed); final EventHubProducerClient producer = new EventHubProducerClient(asyncProducer, retryOptions.getTryTimeout()); final EventData eventData = new EventData("hello-world".getBytes(UTF_8)) .addContext(SPAN_CONTEXT_KEY, Context.NONE); @@ -267,7 +267,7 @@ public void sendEventsExceedsBatchSize() { when(sendLink.getLinkSize()).thenReturn(Mono.just(1024)); TracerProvider tracerProvider = new TracerProvider(Collections.emptyList()); final EventHubProducerAsyncClient asyncProducer = new EventHubProducerAsyncClient(HOSTNAME, EVENT_HUB_NAME, - connectionProcessor, retryOptions, tracerProvider, messageSerializer, null, Schedulers.parallel(), false, onClientClosed); + connectionProcessor, retryOptions, tracerProvider, messageSerializer, Schedulers.parallel(), false, onClientClosed); final EventHubProducerClient producer = new EventHubProducerClient(asyncProducer, retryOptions.getTryTimeout()); //Act & Assert @@ -369,7 +369,7 @@ public void startsMessageSpanOnEventBatch() { final List tracers = Collections.singletonList(tracer1); final TracerProvider tracerProvider = new TracerProvider(tracers); final EventHubProducerAsyncClient asyncProducer = new EventHubProducerAsyncClient(HOSTNAME, EVENT_HUB_NAME, - connectionProcessor, retryOptions, tracerProvider, messageSerializer, null, Schedulers.parallel(), + connectionProcessor, retryOptions, tracerProvider, messageSerializer, Schedulers.parallel(), false, onClientClosed); final EventHubProducerClient producer = new EventHubProducerClient(asyncProducer, retryOptions.getTryTimeout()); diff --git a/sdk/eventhubs/azure-messaging-eventhubs/src/test/java/com/azure/messaging/eventhubs/EventProcessorClientErrorHandlingTest.java b/sdk/eventhubs/azure-messaging-eventhubs/src/test/java/com/azure/messaging/eventhubs/EventProcessorClientErrorHandlingTest.java index 86941734582ba..a79be245862d5 100644 --- a/sdk/eventhubs/azure-messaging-eventhubs/src/test/java/com/azure/messaging/eventhubs/EventProcessorClientErrorHandlingTest.java +++ b/sdk/eventhubs/azure-messaging-eventhubs/src/test/java/com/azure/messaging/eventhubs/EventProcessorClientErrorHandlingTest.java @@ -139,7 +139,7 @@ private static Stream checkpointStoreSupplier() { private PartitionEvent getEvent(EventData event) { PartitionContext context = new PartitionContext("ns", "foo", "bar", "baz"); - return new PartitionEvent(context, event, null, null); + return new PartitionEvent(context, event, null); } diff --git a/sdk/eventhubs/azure-messaging-eventhubs/src/test/java/com/azure/messaging/eventhubs/EventProcessorClientTest.java b/sdk/eventhubs/azure-messaging-eventhubs/src/test/java/com/azure/messaging/eventhubs/EventProcessorClientTest.java index ae309f330f9e2..05888a75f6cb4 100644 --- a/sdk/eventhubs/azure-messaging-eventhubs/src/test/java/com/azure/messaging/eventhubs/EventProcessorClientTest.java +++ b/sdk/eventhubs/azure-messaging-eventhubs/src/test/java/com/azure/messaging/eventhubs/EventProcessorClientTest.java @@ -474,7 +474,7 @@ public void testSingleEventReceiveHeartBeat() throws InterruptedException { private PartitionEvent getEvent(EventData event) { PartitionContext context = new PartitionContext("test-ns", "foo", "bar", "baz"); - return new PartitionEvent(context, event, null, null); + return new PartitionEvent(context, event, null); } private static final class TestPartitionProcessor extends PartitionProcessor { diff --git a/sdk/eventhubs/azure-messaging-eventhubs/src/test/java/com/azure/messaging/eventhubs/ObjectBatchTest.java b/sdk/eventhubs/azure-messaging-eventhubs/src/test/java/com/azure/messaging/eventhubs/ObjectBatchTest.java deleted file mode 100644 index 3cff1916bd214..0000000000000 --- a/sdk/eventhubs/azure-messaging-eventhubs/src/test/java/com/azure/messaging/eventhubs/ObjectBatchTest.java +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.messaging.eventhubs; - -import com.azure.core.amqp.implementation.ErrorContextProvider; -import com.azure.core.experimental.serializer.ObjectSerializer; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; -import org.mockito.Mock; -import org.mockito.MockitoAnnotations; -import reactor.core.publisher.Mono; - -import java.io.InputStream; -import java.io.OutputStream; - -import static org.junit.jupiter.api.Assertions.assertThrows; - -public class ObjectBatchTest { - @Mock - private ErrorContextProvider errorContextProvider; - - @BeforeEach - public void setup() { - MockitoAnnotations.initMocks(this); - } - - @Test - public void nullObject() { - assertThrows(IllegalArgumentException.class, () -> { - final ObjectBatch batch = new ObjectBatch<>( - 1024, - null, - null, - Object.class, - errorContextProvider, - null, - new ObjectSerializer() { - @Override - public Mono deserialize(InputStream stream, Class clazz) { - return null; - } - - @Override - public Mono serialize(S stream, Object value) { - return null; - } - }, - null, - null); - batch.tryAdd(null); - }); - } -} diff --git a/sdk/eventhubs/azure-messaging-eventhubs/src/test/java/com/azure/messaging/eventhubs/PartitionBasedLoadBalancerTest.java b/sdk/eventhubs/azure-messaging-eventhubs/src/test/java/com/azure/messaging/eventhubs/PartitionBasedLoadBalancerTest.java index 4e5c09b72b313..698aee42498ea 100644 --- a/sdk/eventhubs/azure-messaging-eventhubs/src/test/java/com/azure/messaging/eventhubs/PartitionBasedLoadBalancerTest.java +++ b/sdk/eventhubs/azure-messaging-eventhubs/src/test/java/com/azure/messaging/eventhubs/PartitionBasedLoadBalancerTest.java @@ -113,7 +113,7 @@ public void testSingleEventProcessor() { .thenReturn(Flux.interval(Duration.ofSeconds(1)).map(index -> { final PartitionContext partitionContext = new PartitionContext("ns", "foo", "bar", "bazz"); int i = index.intValue() % eventDataList.size(); - return new PartitionEvent(partitionContext, eventDataList.get(i), null, null); + return new PartitionEvent(partitionContext, eventDataList.get(i), null); })); PartitionBasedLoadBalancer partitionBasedLoadBalancer = createPartitionLoadBalancer("owner1"); @@ -149,7 +149,7 @@ public void testTwoEventProcessors() { .thenReturn(Flux.interval(Duration.ofSeconds(1)).map(index -> { final PartitionContext partitionContext = new PartitionContext("ns", "foo", "bar", "bazz"); int i = index.intValue() % eventDataList.size(); - return new PartitionEvent(partitionContext, eventDataList.get(i), null, null); + return new PartitionEvent(partitionContext, eventDataList.get(i), null); })); PartitionBasedLoadBalancer partitionBasedLoadBalancer1 = createPartitionLoadBalancer("owner1"); @@ -185,7 +185,7 @@ public void testPartitionStealing() { .thenReturn(Flux.interval(Duration.ofSeconds(1)).map(index -> { final PartitionContext partitionContext = new PartitionContext("ns", "foo", "bar", "bazz"); int i = index.intValue() % eventDataList.size(); - return new PartitionEvent(partitionContext, eventDataList.get(i), null, null); + return new PartitionEvent(partitionContext, eventDataList.get(i), null); })); PartitionBasedLoadBalancer partitionBasedLoadBalancer1 = createPartitionLoadBalancer("owner1"); @@ -225,7 +225,7 @@ public void testMoreEventProcessorsThanPartitions() { .thenReturn(Flux.interval(Duration.ofSeconds(1)).map(index -> { final PartitionContext partitionContext = new PartitionContext("ns", "foo", "bar", "bazz"); int i = index.intValue() % eventDataList.size(); - return new PartitionEvent(partitionContext, eventDataList.get(i), null, null); + return new PartitionEvent(partitionContext, eventDataList.get(i), null); })); List loadBalancers = new ArrayList<>(); @@ -263,7 +263,7 @@ public void testEventProcessorInactive() { .thenReturn(Flux.interval(Duration.ofSeconds(1)).map(index -> { final PartitionContext partitionContext = new PartitionContext("ns", "foo", "bar", "bazz"); final int i = index.intValue() % eventDataList.size(); - return new PartitionEvent(partitionContext, eventDataList.get(i), null, null); + return new PartitionEvent(partitionContext, eventDataList.get(i), null); })); List loadBalancers = new ArrayList<>(); @@ -422,7 +422,7 @@ public void testEmptyOwnerId() { .thenReturn(Flux.interval(Duration.ofSeconds(1)).map(index -> { final PartitionContext partitionContext = new PartitionContext("ns", "foo", "bar", "bazz"); final int i = index.intValue() % eventDataList.size(); - return new PartitionEvent(partitionContext, eventDataList.get(i), null, null); + return new PartitionEvent(partitionContext, eventDataList.get(i), null); })); String ownerName = "owner1"; diff --git a/sdk/schemaregistry/azure-data-schemaregistry-avro/src/main/java/com/azure/data/schemaregistry/avro/SchemaRegistryAvroAsyncSerializer.java b/sdk/schemaregistry/azure-data-schemaregistry-avro/src/main/java/com/azure/data/schemaregistry/avro/SchemaRegistryAvroAsyncSerializer.java index 9d11d6bd76317..7d8edfb020bac 100644 --- a/sdk/schemaregistry/azure-data-schemaregistry-avro/src/main/java/com/azure/data/schemaregistry/avro/SchemaRegistryAvroAsyncSerializer.java +++ b/sdk/schemaregistry/azure-data-schemaregistry-avro/src/main/java/com/azure/data/schemaregistry/avro/SchemaRegistryAvroAsyncSerializer.java @@ -3,6 +3,7 @@ package com.azure.data.schemaregistry.avro; +import com.azure.data.schemaregistry.AbstractDataSerializer; import com.azure.data.schemaregistry.SerializationException; import reactor.core.publisher.Mono; import reactor.core.scheduler.Scheduler; @@ -13,7 +14,7 @@ /** * Asynchronous registry-based serializer implementation. */ -public class SchemaRegistryAvroAsyncSerializer { +public class SchemaRegistryAvroAsyncSerializer extends AbstractDataSerializer { private static final int DEFAULT_THREAD_POOL_SIZE = 8; private final SchemaRegistryAvroSerializer serializer; From 87055915afa1a519212022d529ecd37d76bc1863 Mon Sep 17 00:00:00 2001 From: "Melanie Ma (MSFT)" <64007802+Melanie-Ma@users.noreply.github.com> Date: Fri, 10 Jul 2020 04:07:16 +0800 Subject: [PATCH 073/129] Fix the issue of ChangeFeedProcessorCodeSnippet (#12894) --- .../cosmos/ChangeFeedProcessorCodeSnippet.java | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/sdk/cosmos/azure-cosmos/src/samples/java/com/azure/cosmos/ChangeFeedProcessorCodeSnippet.java b/sdk/cosmos/azure-cosmos/src/samples/java/com/azure/cosmos/ChangeFeedProcessorCodeSnippet.java index 1e1d7a9234673..24b3e2fec4608 100644 --- a/sdk/cosmos/azure-cosmos/src/samples/java/com/azure/cosmos/ChangeFeedProcessorCodeSnippet.java +++ b/sdk/cosmos/azure-cosmos/src/samples/java/com/azure/cosmos/ChangeFeedProcessorCodeSnippet.java @@ -2,6 +2,7 @@ // Licensed under the MIT License. package com.azure.cosmos; +import com.azure.cosmos.implementation.TestConfigurations; import com.fasterxml.jackson.databind.JsonNode; /** @@ -11,7 +12,12 @@ public class ChangeFeedProcessorCodeSnippet { public void changeFeedProcessorBuilderCodeSnippet() { String hostName = "test-host-name"; - CosmosAsyncClient cosmosAsyncClient = new CosmosClientBuilder().buildAsyncClient(); + CosmosAsyncClient cosmosAsyncClient = new CosmosClientBuilder() + .endpoint(TestConfigurations.HOST) + .key(TestConfigurations.MASTER_KEY) + .contentResponseOnWriteEnabled(true) + .consistencyLevel(ConsistencyLevel.SESSION) + .buildAsyncClient(); CosmosAsyncDatabase cosmosAsyncDatabase = cosmosAsyncClient.getDatabase("testDb"); CosmosAsyncContainer feedContainer = cosmosAsyncDatabase.getContainer("feedContainer"); CosmosAsyncContainer leaseContainer = cosmosAsyncDatabase.getContainer("leaseContainer"); @@ -31,7 +37,12 @@ public void changeFeedProcessorBuilderCodeSnippet() { public void handleChangesCodeSnippet() { String hostName = "test-host-name"; - CosmosAsyncClient cosmosAsyncClient = new CosmosClientBuilder().buildAsyncClient(); + CosmosAsyncClient cosmosAsyncClient = new CosmosClientBuilder() + .endpoint(TestConfigurations.HOST) + .key(TestConfigurations.MASTER_KEY) + .contentResponseOnWriteEnabled(true) + .consistencyLevel(ConsistencyLevel.SESSION) + .buildAsyncClient(); CosmosAsyncDatabase cosmosAsyncDatabase = cosmosAsyncClient.getDatabase("testDb"); CosmosAsyncContainer feedContainer = cosmosAsyncDatabase.getContainer("feedContainer"); CosmosAsyncContainer leaseContainer = cosmosAsyncDatabase.getContainer("leaseContainer"); From feaf5d480c914e3bea71bc1324c8c5d85c6d7e45 Mon Sep 17 00:00:00 2001 From: Kushagra Thapar Date: Thu, 9 Jul 2020 13:32:39 -0700 Subject: [PATCH 074/129] Updated azure spring data cosmos group id and artifact id (#12925) * Updated azure spring data cosmos group id and artifact id * Sorted version client to alphabetical list * Fixed tests.yml with new safename for azure spring data cosmos * Increasing timeout for cosmos emulator builds since download step takes most of the time * Added comments for increasing the timeout value --- eng/jacoco-test-coverage/pom.xml | 6 +++--- eng/pipelines/templates/stages/cosmos-sdk-client.yml | 3 +++ eng/versioning/version_client.txt | 2 +- sdk/cosmos/azure-spring-data-cosmos/pom.xml | 6 +++--- sdk/cosmos/ci.yml | 4 ++-- sdk/cosmos/tests.yml | 6 +++--- 6 files changed, 15 insertions(+), 12 deletions(-) diff --git a/eng/jacoco-test-coverage/pom.xml b/eng/jacoco-test-coverage/pom.xml index 9da1771d9a7e0..7de09b3ef7639 100644 --- a/eng/jacoco-test-coverage/pom.xml +++ b/eng/jacoco-test-coverage/pom.xml @@ -274,9 +274,9 @@ 2.3.3-beta.1 - com.microsoft.azure - spring-data-cosmosdb - 3.0.0-beta.1 + com.azure + azure-spring-data-cosmos + 3.0.0-beta.1 diff --git a/eng/pipelines/templates/stages/cosmos-sdk-client.yml b/eng/pipelines/templates/stages/cosmos-sdk-client.yml index d135774c22dce..d31b37c199e85 100644 --- a/eng/pipelines/templates/stages/cosmos-sdk-client.yml +++ b/eng/pipelines/templates/stages/cosmos-sdk-client.yml @@ -81,6 +81,9 @@ stages: ServiceDirectory: cosmos Artifacts: ${{ parameters.Artifacts }} AdditionalModules: ${{ parameters.AdditionalModules }} + # Increased timeout to 90 because of cosmos emulator taking 25-30 mins to download emulator + # Issue filed to improve download speed: https://github.com/Azure/azure-sdk-for-java/issues/12970 + TimeoutInMinutes: 90 Matrix: Tcp_Integration_Tests_Java8: OSVmImage: 'windows-2019' diff --git a/eng/versioning/version_client.txt b/eng/versioning/version_client.txt index 035f75475be83..c90f1bbdc4425 100644 --- a/eng/versioning/version_client.txt +++ b/eng/versioning/version_client.txt @@ -36,6 +36,7 @@ com.azure:azure-security-keyvault-certificates;4.0.4;4.1.0-beta.4 com.azure:azure-security-keyvault-keys;4.1.4;4.2.0-beta.5 com.azure:azure-security-keyvault-secrets;4.1.4;4.2.0-beta.4 com.azure:azure-sdk-template;1.0.4-beta.19;1.0.4-beta.20 +com.azure:azure-spring-data-cosmos;3.0.0-beta.1;3.0.0-beta.1 com.azure:azure-storage-blob;12.8.0-beta.1;12.8.0-beta.2 com.azure:azure-storage-blob-batch;12.6.0-beta.1;12.6.0-beta.2 com.azure:azure-storage-blob-changefeed;12.0.0-beta.1;12.0.0-beta.2 @@ -60,7 +61,6 @@ com.microsoft.azure:azure-servicebus-jms-spring-boot-starter;2.3.2;2.3.3-beta.1 com.microsoft.azure:azure-spring-boot-metrics-starter;2.3.2;2.3.3-beta.1 com.microsoft.azure:azure-spring-boot-tests;2.3.2;2.3.3-beta.1 com.microsoft.azure:azure-spring-boot-test-core;2.3.2;2.3.3-beta.1 -com.microsoft.azure:spring-data-cosmosdb;3.0.0-beta.1;3.0.0-beta.1 # Unreleased dependencies: Copy the entry from above, prepend "unreleased_" and remove the current # version. Unreleased dependencies are only valid for dependency versions. diff --git a/sdk/cosmos/azure-spring-data-cosmos/pom.xml b/sdk/cosmos/azure-spring-data-cosmos/pom.xml index b0798a2bfbd3b..c08922070a6e3 100644 --- a/sdk/cosmos/azure-spring-data-cosmos/pom.xml +++ b/sdk/cosmos/azure-spring-data-cosmos/pom.xml @@ -10,9 +10,9 @@ ../../parents/azure-client-sdk-parent - com.microsoft.azure - spring-data-cosmosdb - 3.0.0-beta.1 + com.azure + azure-spring-data-cosmos + 3.0.0-beta.1 jar Spring Data for Azure Cosmos DB SQL API Spring Data for Azure Cosmos DB SQL API diff --git a/sdk/cosmos/ci.yml b/sdk/cosmos/ci.yml index 6791e182ef0e3..4b65101fddcd0 100644 --- a/sdk/cosmos/ci.yml +++ b/sdk/cosmos/ci.yml @@ -43,8 +43,8 @@ extends: - name: azure-cosmos groupId: com.azure safeName: azurecosmos - - name: spring-data-cosmosdb - groupId: com.microsoft.azure + - name: azure-spring-data-cosmos + groupId: com.azure safeName: azurespringdatacosmos AdditionalModules: - name: azure-cosmos-benchmark diff --git a/sdk/cosmos/tests.yml b/sdk/cosmos/tests.yml index 41881477a7f93..ceb95d3e8df6d 100644 --- a/sdk/cosmos/tests.yml +++ b/sdk/cosmos/tests.yml @@ -251,9 +251,9 @@ jobs: TestName: Integration_Test_Spring_Data_Cosmosdb ServiceDirectory: cosmos Artifacts: - - name: spring-data-cosmosdb - groupId: com.microsoft.azure - safeName: springdatacosmosdb + - name: azure-spring-data-cosmos + groupId: com.azure + safeName: azurespringdatacosmos TimeoutInMinutes: 90 Matrix: Session_Integration: From 98615296641c1cabc245d270fb852e1ab8c55da8 Mon Sep 17 00:00:00 2001 From: Rick Ley Date: Thu, 9 Jul 2020 14:10:50 -0700 Subject: [PATCH 075/129] Added an exception to unsupported provider methods instead of no-op'ing or returning null (#12977) --- .../storage/blob/nio/AzureFileSystemProvider.java | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/sdk/storage/azure-storage-blob-nio/src/main/java/com/azure/storage/blob/nio/AzureFileSystemProvider.java b/sdk/storage/azure-storage-blob-nio/src/main/java/com/azure/storage/blob/nio/AzureFileSystemProvider.java index 4be316c90c830..c212b1b35c352 100644 --- a/sdk/storage/azure-storage-blob-nio/src/main/java/com/azure/storage/blob/nio/AzureFileSystemProvider.java +++ b/sdk/storage/azure-storage-blob-nio/src/main/java/com/azure/storage/blob/nio/AzureFileSystemProvider.java @@ -199,12 +199,13 @@ public Path getPath(URI uri) { } /** + * @throws UnsupportedOperationException Operation is not supported. * {@inheritDoc} */ @Override public SeekableByteChannel newByteChannel(Path path, Set set, FileAttribute... fileAttributes) throws IOException { - return null; + throw new UnsupportedOperationException(); } /** @@ -611,19 +612,21 @@ public void copy(Path source, Path destination, CopyOption... copyOptions) throw }*/ /** + * @throws UnsupportedOperationException Operation is not supported. * {@inheritDoc} */ @Override public void move(Path path, Path path1, CopyOption... copyOptions) throws IOException { - + throw new UnsupportedOperationException(); } /** + * @throws UnsupportedOperationException Operation is not supported. * {@inheritDoc} */ @Override public boolean isSameFile(Path path, Path path1) throws IOException { - return false; + throw new UnsupportedOperationException(); } /** @@ -635,19 +638,21 @@ public boolean isHidden(Path path) throws IOException { } /** + * @throws UnsupportedOperationException Operation is not supported. * {@inheritDoc} */ @Override public FileStore getFileStore(Path path) throws IOException { - return null; + throw new UnsupportedOperationException(); } /** + * @throws UnsupportedOperationException Operation is not supported. * {@inheritDoc} */ @Override public void checkAccess(Path path, AccessMode... accessModes) throws IOException { - + throw new UnsupportedOperationException(); } /** From 4bb00efe11d6883c95001c4ea1e970f8e36931cb Mon Sep 17 00:00:00 2001 From: Naveen Singh Date: Thu, 9 Jul 2020 19:34:36 -0400 Subject: [PATCH 076/129] Update ctl-image-build.yml (#12973) * Update ctl-image-build.yml Adding write-host to the powershell script, this will help in debugging if image doesn't uploaded to registry successfully. * Update ctl-image-build.yml Adding Executing keyword in the starting of write host --- sdk/cosmos/azure-cosmos-benchmark/ctl-image-build.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sdk/cosmos/azure-cosmos-benchmark/ctl-image-build.yml b/sdk/cosmos/azure-cosmos-benchmark/ctl-image-build.yml index 1927756e5432e..1b0740ea20d75 100644 --- a/sdk/cosmos/azure-cosmos-benchmark/ctl-image-build.yml +++ b/sdk/cosmos/azure-cosmos-benchmark/ctl-image-build.yml @@ -42,8 +42,12 @@ jobs: # Below will build the image and push it to azure container registry - pwsh: | cd $(Agent.TempDirectory)/ctl + Write-Host "Executing docker build . -t java-ctl" docker build . -t java-ctl + Write-Host "Executing az acr login --name $(ContainerRegistryName) -u $(ContainerRegistryUserName) -p $(java-cosmos-container-registry-pwd)" az acr login --name $(ContainerRegistryName) -u $(ContainerRegistryUserName) -p $(java-cosmos-container-registry-pwd) + Write-Host "Executing docker tag java-ctl $(ContainerRegistryUrl)/javactl/benchmark" docker tag java-ctl $(ContainerRegistryUrl)/javactl/benchmark + Write-Host "Executing docker push $(ContainerRegistryUrl)/javactl/benchmark" docker push $(ContainerRegistryUrl)/javactl/benchmark displayName: 'Build and push docker image to registry' From 32f2037e4c4012f19b326eeeaa3926645b25d675 Mon Sep 17 00:00:00 2001 From: Srikanta <51379715+srnagar@users.noreply.github.com> Date: Thu, 9 Jul 2020 19:06:25 -0700 Subject: [PATCH 077/129] Remove search model builder classes (#12796) * Remove search model builder classes * Update codesnippets and readme samples * Remove SearchFieldBase --- sdk/search/azure-search-documents/README.md | 132 +++++++-------- .../indexes/models/ComplexFieldBuilder.java | 55 ------- .../indexes/models/SearchFieldBase.java | 49 ------ .../models/SearchableFieldBuilder.java | 144 ---------------- .../indexes/models/SimpleFieldBuilder.java | 154 ------------------ .../azure/search/documents/ReadmeSamples.java | 58 +++---- .../documents/SearchJavaDocCodeSnippets.java | 18 +- .../documents/indexes/FieldBuilderTests.java | 69 +++++--- 8 files changed, 144 insertions(+), 535 deletions(-) delete mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/ComplexFieldBuilder.java delete mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/SearchFieldBase.java delete mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/SearchableFieldBuilder.java delete mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/SimpleFieldBuilder.java diff --git a/sdk/search/azure-search-documents/README.md b/sdk/search/azure-search-documents/README.md index 947c0b0df4655..3c03e0a53da1c 100644 --- a/sdk/search/azure-search-documents/README.md +++ b/sdk/search/azure-search-documents/README.md @@ -102,7 +102,7 @@ The SDK provides three clients. To create a `SearchIndexClient/SearchIndexAsyncClient`, you will need the values of the Azure Cognitive Search service URL endpoint and admin key. - + ```Java SearchIndexClient searchIndexClient = new SearchIndexClientBuilder() .endpoint(endpoint) @@ -112,7 +112,7 @@ SearchIndexClient searchIndexClient = new SearchIndexClientBuilder() or - + ```Java SearchIndexAsyncClient searchIndexAsyncClient = new SearchIndexClientBuilder() .endpoint(endpoint) @@ -125,7 +125,7 @@ SearchIndexAsyncClient searchIndexAsyncClient = new SearchIndexClientBuilder() To create a `SearchIndexerClient/SearchIndexerAsyncClient`, you will need the values of the Azure Cognitive Search service URL endpoint and admin key. - + ```Java SearchIndexerClient searchIndexerClient = new SearchIndexerClientBuilder() .endpoint(endpoint) @@ -135,7 +135,7 @@ SearchIndexerClient searchIndexerClient = new SearchIndexerClientBuilder() or - + ```Java SearchIndexerAsyncClient searchIndexerAsyncClient = new SearchIndexerClientBuilder() .endpoint(endpoint) @@ -148,7 +148,7 @@ SearchIndexerAsyncClient searchIndexerAsyncClient = new SearchIndexerClientBuild Once you have the values of the Azure Cognitive Search service URL endpoint and admin key, you can create the `SearchClient/SearchAsyncClient` with an existing index name: - + ```Java SearchClient searchClient = new SearchClientBuilder() .endpoint(endpoint) @@ -159,7 +159,7 @@ SearchClient searchClient = new SearchClientBuilder() or - + ```Java SearchAsyncClient searchAsyncClient = new SearchClientBuilder() .endpoint(endpoint) @@ -174,7 +174,7 @@ To get running immediately, we're going to connect to a well-known sandbox Search service provided by Microsoft. This means you do not need an Azure subscription or Azure Cognitive Search service to try out this query. - + ```Java // We'll connect to the Azure Cognitive Search public sandbox and send a // query to its "nycjobs" index built from a public dataset of available jobs @@ -258,7 +258,7 @@ Let's explore them with a search for a "luxury" hotel. provide your own. Here we perform the search, enumerate over the results, and extract data using `SearchDocument`'s dictionary indexer. - + ```Java SearchPagedIterable searchResultsIterable = searchClient.search("luxury"); for (SearchResult searchResult: searchResultsIterable) { @@ -271,7 +271,7 @@ for (SearchResult searchResult: searchResultsIterable) { #### Use Java model class for search results Define a `Hotel` class. - + ```Java public class Hotel { private String id; @@ -298,7 +298,7 @@ public class Hotel { ``` And use them in place of `SearchDocument` when querying. - + ```Java SearchPagedIterable searchResultsIterable = searchClient.search("luxury"); for (SearchResult searchResult: searchResultsIterable) { @@ -317,7 +317,7 @@ is recommended. The `SearchOptions` provide powerful control over the behavior of our queries. Let's search for the top 5 luxury hotels with a good rating. - + ```Java int stars = 4; SearchOptions options = new SearchOptions() @@ -334,58 +334,58 @@ You can use the [`SearchIndexClient`](#Create-a-SearchIndexClient) to create a s defined using convenient `SimpleField`, `SearchableField`, or `ComplexField` classes. Indexes can also define suggesters, lexical analyzers, and more. - + ```Java - searchFieldList.add(new SimpleFieldBuilder("hotelId", SearchFieldDataType.STRING, false) - .setKey(true) - .setFilterable(true) - .setSortable(true) - .build()); - searchFieldList.add(new SearchableFieldBuilder("hotelName", false) - .setFilterable(true) - .setSortable(true) - .build()); - searchFieldList.add(new SearchableFieldBuilder("description", false) - .setAnalyzerName(LexicalAnalyzerName.EU_LUCENE) - .build()); - searchFieldList.add(new SearchableFieldBuilder("tags", true) - .setKey(true) - .setFilterable(true) - .setFacetable(true) - .build()); - searchFieldList.add(new ComplexFieldBuilder("address", false) - .setFields(Arrays.asList( - new SearchableFieldBuilder("streetAddress", false).build(), - new SearchableFieldBuilder("city", false) - .setFilterable(true) - .setFacetable(true) - .setSortable(true) - .build(), - new SearchableFieldBuilder("stateProvince", false) - .setFilterable(true) - .setFacetable(true) - .setSortable(true) - .build(), - new SearchableFieldBuilder("country", false) - .setFilterable(true) - .setFacetable(true) - .setSortable(true) - .build(), - new SearchableFieldBuilder("postalCode", false) - .setFilterable(true) - .setFacetable(true) - .setSortable(true) - .build() - )) - .build()); - // Prepare suggester. - SearchSuggester suggester = new SearchSuggester("sg", Collections.singletonList("hotelName")); - // Prepare SearchIndex with index name and search fields. - SearchIndex index = new SearchIndex("hotels").setFields(searchFieldList).setSuggesters( - Collections.singletonList(suggester)); - // Create an index - searchIndexClient.createIndex(index); - } + List searchFieldList = new ArrayList<>(); + searchFieldList.add(new SearchField("hotelId", SearchFieldDataType.STRING) + .setKey(true) + .setFilterable(true) + .setSortable(true)); + + searchFieldList.add(new SearchField("hotelName", SearchFieldDataType.STRING) + .setSearchable(true) + .setFilterable(true) + .setSortable(true)); + searchFieldList.add(new SearchField("description", SearchFieldDataType.STRING) + .setSearchable(true) + .setAnalyzerName(LexicalAnalyzerName.EU_LUCENE)); + searchFieldList.add(new SearchField("tags", SearchFieldDataType.collection(SearchFieldDataType.STRING)) + .setSearchable(true) + .setKey(true) + .setFilterable(true) + .setFacetable(true)); + searchFieldList.add(new SearchField("address", SearchFieldDataType.COMPLEX) + .setFields(Arrays.asList( + new SearchField("streetAddress", SearchFieldDataType.STRING).setSearchable(true), + new SearchField("city", SearchFieldDataType.STRING) + .setSearchable(true) + .setFilterable(true) + .setFacetable(true) + .setSortable(true), + new SearchField("stateProvince", SearchFieldDataType.STRING) + .setSearchable(true) + .setFilterable(true) + .setFacetable(true) + .setSortable(true), + new SearchField("country", SearchFieldDataType.STRING) + .setSearchable(true) + .setFilterable(true) + .setFacetable(true) + .setSortable(true), + new SearchField("postalCode", SearchFieldDataType.STRING) + .setSearchable(true) + .setFilterable(true) + .setFacetable(true) + .setSortable(true) + ))); + + // Prepare suggester. + SearchSuggester suggester = new SearchSuggester("sg", Collections.singletonList("hotelName")); + // Prepare SearchIndex with index name and search fields. + SearchIndex index = new SearchIndex("hotels").setFields(searchFieldList).setSuggesters( + Collections.singletonList(suggester)); + // Create an index + searchIndexClient.createIndex(index); } ``` @@ -396,7 +396,7 @@ you can retrieve a specific document from your index if you already know the key. You could get the key from a query, for example, and want to show more information about it or navigate your customer to that document. - + ```Java Hotel hotel = searchClient.getDocument("1", Hotel.class); System.out.printf("This is hotelId %s, and this is hotel name %s.%n", hotel.getId(), hotel.getName()); @@ -409,7 +409,7 @@ an index in a single batched request. There are [a few special rules for merging](https://docs.microsoft.com/rest/api/searchservice/addupdate-or-delete-documents#document-actions) to be aware of. - + ```Java IndexDocumentsBatch batch = new IndexDocumentsBatch(); batch.addUploadActions(Collections.singletonList(new Hotel().setId("783").setName("Upload Inn"))); @@ -428,7 +428,7 @@ with an `IndexDocumentsResult` for inspection. All of the examples so far have been using synchronous APIs, but we provide full support for async APIs as well. You'll need to use [SearchAsyncClient](#Create-a-SearchClient) - + ```Java searchAsyncClient.search("luxury") .subscribe(result -> { @@ -452,7 +452,7 @@ Any Search API operation that fails will throw a [`HttpResponseException`][HttpResponseException] with helpful [`Status codes`][status_codes]. Many of these errors are recoverable. - + ```Java try { Iterable results = searchClient.search("hotel"); diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/ComplexFieldBuilder.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/ComplexFieldBuilder.java deleted file mode 100644 index b558ba5ae42ac..0000000000000 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/ComplexFieldBuilder.java +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.search.documents.indexes.models; - -import java.util.List; - -/** - * A helper Field model to build a complex field which uses {@code SearchFieldDataType.EDM_COMPLEX_TYPE} or - * collection of {@code SearchFieldDataType.EDM_COMPLEX_TYPE}. - */ -public class ComplexFieldBuilder extends SearchFieldBase { - private List fields; - - /** - * Initializes a new instance of the {@link ComplexFieldBuilder} class. - * - * @param name The name of the field, which must be unique within the index or parent field. - * @param collection Whether the field is a collection of strings. - */ - public ComplexFieldBuilder(String name, boolean collection) { - super(name, collection ? SearchFieldDataType.collection(SearchFieldDataType.COMPLEX) - : SearchFieldDataType.COMPLEX); - } - - /** - * Gets a collection of {@link SimpleFieldBuilder} or {@link ComplexFieldBuilder} child fields. - * - * @return The list of sub-fields. - */ - public List getFields() { - return fields; - } - - /** - * Sets a collection of {@link SimpleFieldBuilder} or {@link ComplexFieldBuilder} child fields. - * - * @param fields The list of sub-fields. - * @return The {@link ComplexFieldBuilder} object itself. - */ - public ComplexFieldBuilder setFields(List fields) { - this.fields = fields; - return this; - } - - /** - * Convert ComplexField to {@link SearchField}. - * - * @return The {@link SearchField} object. - */ - public SearchField build() { - return new SearchField(super.getName(), super.getDataType()) - .setFields(fields); - } -} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/SearchFieldBase.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/SearchFieldBase.java deleted file mode 100644 index 9c86b3c628e32..0000000000000 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/SearchFieldBase.java +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.search.documents.indexes.models; - -import com.azure.core.util.CoreUtils; -import com.azure.core.util.logging.ClientLogger; - -import java.util.Objects; - -/** - * Base field type for helper classes to more easily create a {@link SearchIndex}. - */ -public abstract class SearchFieldBase { - private final ClientLogger logger = new ClientLogger(SearchFieldBase.class); - private final String name; - private final SearchFieldDataType dataType; - - /** - * Initializes a new instance of the {@link SearchFieldBase} class. - * @param name The name of the field, which must be unique within the index or parent field. - * @param dataType The data type of the field. - */ - protected SearchFieldBase(String name, SearchFieldDataType dataType) { - if (CoreUtils.isNullOrEmpty(name)) { - throw logger.logExceptionAsError(new IllegalArgumentException("The name of the field cannot be null")); - } - this.dataType = Objects.requireNonNull(dataType, "'dataType' cannot be null."); - this.name = name; - } - - /** - * Get the name of the field. - * - * @return The name of the field. - */ - public String getName() { - return name; - } - - /** - * Get the {@link SearchFieldDataType} of the field. - * - * @return The data type of the field. - */ - public SearchFieldDataType getDataType() { - return dataType; - } -} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/SearchableFieldBuilder.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/SearchableFieldBuilder.java deleted file mode 100644 index 06426b7997491..0000000000000 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/SearchableFieldBuilder.java +++ /dev/null @@ -1,144 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.search.documents.indexes.models; - -import java.util.List; - -/** - * A helper Field model to build a searchable {@link SearchField}. - */ -public class SearchableFieldBuilder extends SimpleFieldBuilder { - private LexicalAnalyzerName analyzerName; - private LexicalAnalyzerName searchAnalyzerName; - private LexicalAnalyzerName indexAnalyzerName; - private List synonymMapNames; - - /** - * Initializes a new instance of the {@link SearchableFieldBuilder} class. - * - * @param name The name of the field, which must be unique within the index or parent field. - * @param collection Whether the field is a collection of strings. - * @throws NullPointerException when {@code name} is null. - */ - public SearchableFieldBuilder(String name, boolean collection) { - super(name, SearchFieldDataType.STRING, collection); - } - - /** - * Gets the name of the language analyzer. This property cannot be set when either {@code searchAnalyzer} or - * {@code indexAnalyzer} are set. Once the analyzer is chosen, it cannot be changed for the field in the index. - * - * @return The {@link LexicalAnalyzerName} used for analyzer. - */ - public LexicalAnalyzerName getAnalyzerName() { - return analyzerName; - } - - /** - * Sets the name of the language analyzer. This property cannot be set when either {@code searchAnalyzer} or - * {@code indexAnalyzer} are set. Once the analyzer is chosen, it cannot be changed for the field in the index. - * - * @param analyzerName The {@link LexicalAnalyzerName} used for analyzer. - * @return The SearchableFieldBuilder object itself. - */ - public SearchableFieldBuilder setAnalyzerName(LexicalAnalyzerName analyzerName) { - this.analyzerName = analyzerName; - return this; - } - - /** - * Gets the name of the language analyzer for searching. This property must be set together with - * {@code indexAnalyzer}, and cannot be set when {@code analyzer} is set. Once the analyzer is chosen, it cannot be - * changed for the field in the index. - * - * @return The {@link LexicalAnalyzerName} used for search analyzer. - */ - public LexicalAnalyzerName getSearchAnalyzerName() { - return searchAnalyzerName; - } - - /** - * Sets the name of the language analyzer for searching. This property must be set together with - * {@code indexAnalyzer}, and cannot be set when {@code analyzer} is set. Once the analyzer is chosen, it cannot be - * changed for the field in the index. - * - * @param searchAnalyzerName The {@link LexicalAnalyzerName} used for search analyzer. - * @return The SearchableField object itself. - */ - public SearchableFieldBuilder setSearchAnalyzerName(LexicalAnalyzerName searchAnalyzerName) { - this.searchAnalyzerName = searchAnalyzerName; - return this; - } - - /** - * Gets the name of the language analyzer for indexing. This property must be set together with - * {@code searchAnalyzer}, and cannot be set when {@code analyzer} is set. Once the analyzer is chosen, it cannot be - * changed for the field in the index. - * - * @return The {@link LexicalAnalyzerName} used for index analyzer. - */ - public LexicalAnalyzerName getIndexAnalyzerName() { - return indexAnalyzerName; - } - - /** - * Gets the name of the language analyzer for indexing. This property must be set together with - * {@code searchAnalyzer}, and cannot be set when {@code analyzer} is set. Once the analyzer is chosen, it cannot be - * changed for the field in the index. - * - * @param indexAnalyzerName The {@link LexicalAnalyzerName} used for index analyzer. - * @return The SearchableField object itself. - */ - public SearchableFieldBuilder setIndexAnalyzerName(LexicalAnalyzerName indexAnalyzerName) { - this.indexAnalyzerName = indexAnalyzerName; - return this; - } - - /** - * Gets a list of names of synonym maps to associate with this field. - * Currently, only one synonym map per field is supported. - * - * Assigning a synonym map to a field ensures that query terms targeting that field are expanded at query-time using - * the rules in the synonym map. This attribute can be changed on existing fields. - * - * @return List of names of synonym maps to associate with this field. - */ - public List getSynonymMapNames() { - return synonymMapNames; - } - - /** - * Sets a list of names of synonym maps to associate with this field. - * Currently, only one synonym map per field is supported. - * - * Assigning a synonym map to a field ensures that query terms targeting that field are expanded at query-time using - * the rules in the synonym map. This attribute can be changed on existing fields. - * - * @param synonymMapNames list of names of synonym maps to associate with this field. - * @return The SearchableField object itself. - */ - public SearchableFieldBuilder setSynonymMapNames(List synonymMapNames) { - this.synonymMapNames = synonymMapNames; - return this; - } - - /** - * Convert SearchableField to {@link SearchField}. - * - * @return The {@link SearchField} object. - */ - public SearchField build() { - return new SearchField(super.getName(), super.getDataType()) - .setSearchable(true) - .setKey(super.isKey()) - .setSortable(super.isSortable()) - .setFilterable(super.isFilterable()) - .setHidden(super.isHidden()) - .setFacetable(super.isFacetable()) - .setAnalyzerName(this.analyzerName) - .setSearchAnalyzerName(this.searchAnalyzerName) - .setIndexAnalyzerName(this.indexAnalyzerName) - .setSynonymMapNames(this.synonymMapNames); - } -} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/SimpleFieldBuilder.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/SimpleFieldBuilder.java deleted file mode 100644 index 905335b57b7c1..0000000000000 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/SimpleFieldBuilder.java +++ /dev/null @@ -1,154 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.search.documents.indexes.models; - -/** - * A helper Field model to build a simple {@link SearchField}. - */ -public class SimpleFieldBuilder extends SearchFieldBase { - private boolean key; - private boolean facetable; - private boolean sortable; - private boolean filterable; - private boolean hidden; - - /** - * Initializes a new instance of the {@link SimpleFieldBuilder} class. - * - * @param name The name of the field, which must be unique within the index or parent field. - * @param dataType The {@link SearchFieldDataType} of the {@link SearchField}. - * @param collection boolean field to indicate whether the dataType is collection. - * @throws NullPointerException when {@code name} is null. - */ - public SimpleFieldBuilder(String name, SearchFieldDataType dataType, boolean collection) { - super(name, collection ? SearchFieldDataType.collection(dataType) : dataType); - } - - /** - * Gets whether the field is the key field. - * - * @return An {@link SearchIndex} must have exactly one key field of type {@code DataType.EDM_STRING}. - */ - public boolean isKey() { - return key; - } - - /** - * Sets whether the field is the key field. The default is false. - * - * @param key boolean to indicate whether the field is key field or not. - * @return The SimpleField object itself. - */ - public SimpleFieldBuilder setKey(boolean key) { - this.key = key; - return this; - } - - /** - * Gets a value indicating whether to enable the field can be referenced in {@code $orderby} expressions. - * By default Azure Cognitive Search sorts results by score, but in many experiences users may want to sort by - * fields in the documents. - * - * @return The boolean to indicate whether the field is sortable or not. - */ - public boolean isSortable() { - return sortable; - } - - /** - * Sets a value indicating whether to enable the field can be referenced in {@code $orderby} expressions. - * The default is false. - * By default Azure Cognitive Search sorts results by score, but in many experiences users may want to sort by - * fields in the documents. - * - * @param sortable The boolean to indicate whether the field is sortable or not. - * @return The SimpleField object itself. - */ - public SimpleFieldBuilder setSortable(boolean sortable) { - this.sortable = sortable; - return this; - } - - /** - * Gets or sets a value indicating whether the field can be referenced in {@code $filter} queries. - * - * @return The boolean to indicate whether the field is filterable or not. - */ - public boolean isFilterable() { - return filterable; - } - - /** - * Gets or sets a value indicating whether the field can be referenced in {@code $filter} queries. - * The default is false. - * - * @param filterable The boolean to indicate whether the field is filterable or not. - * @return The SimpleField object itself. - */ - public SimpleFieldBuilder setFilterable(boolean filterable) { - this.filterable = filterable; - return this; - } - - /** - * Gets whether the field is returned in search results. - * - * @return The boolean to indicate whether the field is hidden or not. - */ - public boolean isHidden() { - return hidden; - } - - /** - * Sets whether the field is returned in search results. The default is false. - * A key field where {@code key} is true must have this property set to false. - * - * @param hidden The boolean to indicate whether the field is hidden or not. - * @return The SimpleField object itself. - */ - public SimpleFieldBuilder setHidden(boolean hidden) { - this.hidden = hidden; - return this; - } - - /** - * Gets a value indicating whether the field can be retrieved in facet queries. - * Facets are used in presentation of search results that include hit counts by categories. - * For example, in a search for digital cameras, facets might include branch, megapixels, price, etc. - * - * @return The boolean to indicate whether the field is facetable or not. - */ - public boolean isFacetable() { - return facetable; - } - - /** - * Sets a value indicating whether the field can be retrieved in facet queries. The default is false. - * Facets are used in presentation of search results that include hit counts by categories. - * For example, in a search for digital cameras, facets might include branch, megapixels, price, etc. - * - * @param facetable The boolean to indicate whether the field is facetable or not. - * @return The SimpleField object itself. - */ - public SimpleFieldBuilder setFacetable(boolean facetable) { - this.facetable = facetable; - return this; - } - - /** - * Convert SimpleField to {@link SearchField}. - * - * @return The {@link SearchField} object. - */ - public SearchField build() { - return new SearchField(super.getName(), super.getDataType()) - .setKey(key) - .setSearchable(false) - .setSortable(sortable) - .setFilterable(filterable) - .setHidden(hidden) - .setFacetable(facetable) - .setHidden(hidden); - } -} diff --git a/sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/ReadmeSamples.java b/sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/ReadmeSamples.java index 7559c905983b5..a817585285d50 100644 --- a/sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/ReadmeSamples.java +++ b/sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/ReadmeSamples.java @@ -14,15 +14,12 @@ import com.azure.search.documents.indexes.SearchIndexerAsyncClient; import com.azure.search.documents.indexes.SearchIndexerClient; import com.azure.search.documents.indexes.SearchIndexerClientBuilder; -import com.azure.search.documents.indexes.models.ComplexFieldBuilder; import com.azure.search.documents.indexes.models.IndexDocumentsBatch; import com.azure.search.documents.indexes.models.LexicalAnalyzerName; import com.azure.search.documents.indexes.models.SearchField; import com.azure.search.documents.indexes.models.SearchFieldDataType; import com.azure.search.documents.indexes.models.SearchIndex; import com.azure.search.documents.indexes.models.SearchSuggester; -import com.azure.search.documents.indexes.models.SearchableFieldBuilder; -import com.azure.search.documents.indexes.models.SimpleFieldBuilder; import com.azure.search.documents.models.SearchOptions; import com.azure.search.documents.models.SearchResult; import com.azure.search.documents.util.SearchPagedIterable; @@ -221,50 +218,49 @@ public void batchDocumentsOperations() { } public void createIndex() { - // Prepare SearchFields with SimpleFieldBuilder, SearchableFieldBuilder and ComplexFieldBuilder. List searchFieldList = new ArrayList<>(); - searchFieldList.add(new SimpleFieldBuilder("hotelId", SearchFieldDataType.STRING, false) + searchFieldList.add(new SearchField("hotelId", SearchFieldDataType.STRING) .setKey(true) .setFilterable(true) - .setSortable(true) - .build()); - searchFieldList.add(new SearchableFieldBuilder("hotelName", false) + .setSortable(true)); + + searchFieldList.add(new SearchField("hotelName", SearchFieldDataType.STRING) + .setSearchable(true) .setFilterable(true) - .setSortable(true) - .build()); - searchFieldList.add(new SearchableFieldBuilder("description", false) - .setAnalyzerName(LexicalAnalyzerName.EU_LUCENE) - .build()); - searchFieldList.add(new SearchableFieldBuilder("tags", true) + .setSortable(true)); + searchFieldList.add(new SearchField("description", SearchFieldDataType.STRING) + .setSearchable(true) + .setAnalyzerName(LexicalAnalyzerName.EU_LUCENE)); + searchFieldList.add(new SearchField("tags", SearchFieldDataType.collection(SearchFieldDataType.STRING)) + .setSearchable(true) .setKey(true) .setFilterable(true) - .setFacetable(true) - .build()); - searchFieldList.add(new ComplexFieldBuilder("address", false) + .setFacetable(true)); + searchFieldList.add(new SearchField("address", SearchFieldDataType.COMPLEX) .setFields(Arrays.asList( - new SearchableFieldBuilder("streetAddress", false).build(), - new SearchableFieldBuilder("city", false) + new SearchField("streetAddress", SearchFieldDataType.STRING).setSearchable(true), + new SearchField("city", SearchFieldDataType.STRING) + .setSearchable(true) .setFilterable(true) .setFacetable(true) - .setSortable(true) - .build(), - new SearchableFieldBuilder("stateProvince", false) + .setSortable(true), + new SearchField("stateProvince", SearchFieldDataType.STRING) + .setSearchable(true) .setFilterable(true) .setFacetable(true) - .setSortable(true) - .build(), - new SearchableFieldBuilder("country", false) + .setSortable(true), + new SearchField("country", SearchFieldDataType.STRING) + .setSearchable(true) .setFilterable(true) .setFacetable(true) - .setSortable(true) - .build(), - new SearchableFieldBuilder("postalCode", false) + .setSortable(true), + new SearchField("postalCode", SearchFieldDataType.STRING) + .setSearchable(true) .setFilterable(true) .setFacetable(true) .setSortable(true) - .build() - )) - .build()); + ))); + // Prepare suggester. SearchSuggester suggester = new SearchSuggester("sg", Collections.singletonList("hotelName")); // Prepare SearchIndex with index name and search fields. diff --git a/sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/SearchJavaDocCodeSnippets.java b/sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/SearchJavaDocCodeSnippets.java index 39702f0996813..a99366c3e06ff 100644 --- a/sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/SearchJavaDocCodeSnippets.java +++ b/sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/SearchJavaDocCodeSnippets.java @@ -33,8 +33,6 @@ import com.azure.search.documents.indexes.models.SearchIndexerStatus; import com.azure.search.documents.indexes.models.SearchServiceStatistics; import com.azure.search.documents.indexes.models.SearchSuggester; -import com.azure.search.documents.indexes.models.SearchableFieldBuilder; -import com.azure.search.documents.indexes.models.SimpleFieldBuilder; import com.azure.search.documents.indexes.models.SynonymMap; import com.azure.search.documents.models.AutocompleteItem; import com.azure.search.documents.models.AutocompleteMode; @@ -789,8 +787,8 @@ public void createSearchIndexClientFromBuilder() { public void createSearchIndex() { // BEGIN: com.azure.search.documents.indexes.SearchIndexClient.createIndex#SearchIndex List searchFields = Arrays.asList( - new SimpleFieldBuilder("hotelId", SearchFieldDataType.STRING, false).setKey(true).build(), - new SearchableFieldBuilder("hotelName", false).build() + new SearchField("hotelId", SearchFieldDataType.STRING).setKey(true), + new SearchField("hotelName", SearchFieldDataType.STRING).setSearchable(true) ); SearchIndex searchIndex = new SearchIndex("searchIndex", searchFields); SearchIndex indexFromService = searchIndexClient.createIndex(searchIndex); @@ -805,8 +803,8 @@ public void createSearchIndex() { public void createSearchIndexWithResponse() { // BEGIN: com.azure.search.documents.indexes.SearchIndexClient.createIndexWithResponse#SearchIndex-Context List searchFields = Arrays.asList( - new SimpleFieldBuilder("hotelId", SearchFieldDataType.STRING, false).setKey(true).build(), - new SearchableFieldBuilder("hotelName", false).build() + new SearchField("hotelId", SearchFieldDataType.STRING).setKey(true), + new SearchField("hotelName", SearchFieldDataType.STRING).setSearchable(true) ); SearchIndex searchIndex = new SearchIndex("searchIndex", searchFields); @@ -1199,8 +1197,8 @@ public void createSearchIndexAsyncClientFromBuilder() { public void createSearchIndexAsync() { // BEGIN: com.azure.search.documents.indexes.SearchIndexAsyncClient.createIndex#SearchIndex List searchFields = Arrays.asList( - new SimpleFieldBuilder("hotelId", SearchFieldDataType.STRING, false).setKey(true).build(), - new SearchableFieldBuilder("hotelName", false).build() + new SearchField("hotelId", SearchFieldDataType.STRING).setKey(true), + new SearchField("hotelName", SearchFieldDataType.STRING).setSearchable(true) ); SearchIndex searchIndex = new SearchIndex("searchIndex", searchFields); searchIndexAsyncClient.createIndex(searchIndex) @@ -1216,8 +1214,8 @@ public void createSearchIndexAsync() { public void createSearchIndexWithResponseAsync() { // BEGIN: com.azure.search.documents.indexes.SearchIndexAsyncClient.createIndexWithResponse#SearchIndex List searchFields = Arrays.asList( - new SimpleFieldBuilder("hotelId", SearchFieldDataType.STRING, false).setKey(true).build(), - new SearchableFieldBuilder("hotelName", false).build() + new SearchField("hotelId", SearchFieldDataType.STRING).setKey(true), + new SearchField("hotelName", SearchFieldDataType.STRING).setSearchable(true) ); SearchIndex searchIndex = new SearchIndex("searchIndex", searchFields); diff --git a/sdk/search/azure-search-documents/src/test/java/com/azure/search/documents/indexes/FieldBuilderTests.java b/sdk/search/azure-search-documents/src/test/java/com/azure/search/documents/indexes/FieldBuilderTests.java index 11377b669a94f..a0b60ca93ac7f 100644 --- a/sdk/search/azure-search-documents/src/test/java/com/azure/search/documents/indexes/FieldBuilderTests.java +++ b/sdk/search/azure-search-documents/src/test/java/com/azure/search/documents/indexes/FieldBuilderTests.java @@ -4,11 +4,8 @@ package com.azure.search.documents.indexes; import com.azure.search.documents.TestHelpers; -import com.azure.search.documents.indexes.models.ComplexFieldBuilder; import com.azure.search.documents.indexes.models.SearchField; import com.azure.search.documents.indexes.models.SearchFieldDataType; -import com.azure.search.documents.indexes.models.SearchableFieldBuilder; -import com.azure.search.documents.indexes.models.SimpleFieldBuilder; import com.azure.search.documents.test.environment.models.HotelAnalyzerException; import com.azure.search.documents.test.environment.models.HotelCircularDependencies; import com.azure.search.documents.test.environment.models.HotelSearchException; @@ -54,8 +51,16 @@ public void hotelCircularDependencies() { public void hotelWithEmptySynonymMaps() { // We cannot put null in the annotation. So no need to test null case. List actualFields = FieldBuilder.build(HotelWithEmptyInSynonymMaps.class); - List expectedFields = Collections.singletonList(new SearchableFieldBuilder("tags", true) - .setSynonymMapNames(Arrays.asList("asynonymMaps", "maps")).build()); + + List expectedFields = Collections.singletonList(new SearchField("tags", + SearchFieldDataType.collection(SearchFieldDataType.STRING)) + .setSearchable(true) + .setKey(false) + .setFilterable(false) + .setSortable(false) + .setFacetable(false) + .setSynonymMapNames(Arrays.asList("asynonymMaps", "maps"))); + assertListFieldEquals(expectedFields, actualFields); } @@ -95,43 +100,55 @@ private void assertExceptionMassageAndDataType(Exception exception, SearchFieldD } private List buildHotelCircularDependenciesModel() { - SearchField homeAddress = new ComplexFieldBuilder("homeAddress", false).setFields(buildHotelInAddress()).build(); - SearchField billingAddress = new ComplexFieldBuilder("billingAddress", false).setFields(buildHotelInAddress()).build(); + SearchField homeAddress = new SearchField("homeAddress", SearchFieldDataType.COMPLEX) + .setFields(buildHotelInAddress()); + SearchField billingAddress = new SearchField("billingAddress", SearchFieldDataType.COMPLEX) + .setFields(buildHotelInAddress()); return Arrays.asList(homeAddress, billingAddress); } private List buildHotelInAddress() { - SearchField hotel = new ComplexFieldBuilder("hotel", false).build(); + SearchField hotel = new SearchField("hotel", SearchFieldDataType.COMPLEX); return Collections.singletonList(hotel); } private List buildHotelWithArrayModel() { - SearchField hotelId = new SimpleFieldBuilder("hotelId", SearchFieldDataType.STRING, false).setKey(true) - .setSortable(true).build(); - SearchField tags = new SearchableFieldBuilder("tags", true).build(); + SearchField hotelId = new SearchField("hotelId", SearchFieldDataType.STRING) + .setKey(true) + .setSortable(true) + .setSearchable(false) + .setFacetable(false) + .setFilterable(false); + SearchField tags = new SearchField("tags", SearchFieldDataType.collection(SearchFieldDataType.STRING)) + .setKey(false) + .setSearchable(true) + .setSortable(false) + .setFilterable(false) + .setFacetable(false); return Arrays.asList(hotelId, tags); } private List buildHotelAddressField() { - SearchField streetAddress = new SimpleFieldBuilder("streetAddress", SearchFieldDataType.STRING, false).setFacetable(true) - .setKey(true).build(); - SearchField city = new SearchableFieldBuilder("city", false).setFilterable(true).build(); - SearchField stateProvince = new SearchableFieldBuilder("stateProvince", false).build(); - SearchField country = new SearchableFieldBuilder("country", false) - .setSynonymMapNames(Arrays.asList("America -> USA", "USA -> US")).build(); - SearchField postalCode = new SimpleFieldBuilder("postalCode", SearchFieldDataType.STRING, false).build(); + SearchField streetAddress = new SearchField("streetAddress", SearchFieldDataType.STRING).setFacetable(true) + .setKey(true); + SearchField city = new SearchField("city", SearchFieldDataType.STRING).setFilterable(true); + SearchField stateProvince = new SearchField("stateProvince", SearchFieldDataType.STRING); + SearchField country = + new SearchField("country", SearchFieldDataType.STRING).setSynonymMapNames(Arrays.asList("America -> USA", + "USA -> US")); + SearchField postalCode = new SearchField("postalCode", SearchFieldDataType.STRING); return Arrays.asList(streetAddress, city, stateProvince, country, postalCode); } private List buildHotelRoomField() { - SearchField description = new SimpleFieldBuilder("description", SearchFieldDataType.STRING, false).build(); - SearchField descriptionFr = new SimpleFieldBuilder("descriptionFr", SearchFieldDataType.STRING, false).build(); - SearchField type = new SimpleFieldBuilder("type", SearchFieldDataType.STRING, false).build(); - SearchField baseRate = new SimpleFieldBuilder("baseRate", SearchFieldDataType.DOUBLE, false).build(); - SearchField bedOptions = new SimpleFieldBuilder("bedOptions", SearchFieldDataType.STRING, false).build(); - SearchField sleepsCount = new SimpleFieldBuilder("sleepsCount", SearchFieldDataType.INT32, false).build(); - SearchField smokingAllowed = new SimpleFieldBuilder("smokingAllowed", SearchFieldDataType.BOOLEAN, false).build(); - SearchField tags = new SimpleFieldBuilder("tags", SearchFieldDataType.STRING, true).build(); + SearchField description = new SearchField("description", SearchFieldDataType.STRING); + SearchField descriptionFr = new SearchField("descriptionFr", SearchFieldDataType.STRING); + SearchField type = new SearchField("type", SearchFieldDataType.STRING); + SearchField baseRate = new SearchField("baseRate", SearchFieldDataType.DOUBLE); + SearchField bedOptions = new SearchField("bedOptions", SearchFieldDataType.STRING); + SearchField sleepsCount = new SearchField("sleepsCount", SearchFieldDataType.INT32); + SearchField smokingAllowed = new SearchField("smokingAllowed", SearchFieldDataType.BOOLEAN); + SearchField tags = new SearchField("tags", SearchFieldDataType.collection(SearchFieldDataType.STRING)); return Arrays.asList(description, descriptionFr, type, baseRate, bedOptions, sleepsCount, smokingAllowed, tags); } From a08a57b060a025a8f455c5cfb5171fc52a3aeba4 Mon Sep 17 00:00:00 2001 From: Mitch Denny Date: Fri, 10 Jul 2020 13:45:30 +1000 Subject: [PATCH 078/129] Add some wagon options. (#12991) --- eng/pipelines/templates/variables/globals.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/eng/pipelines/templates/variables/globals.yml b/eng/pipelines/templates/variables/globals.yml index b2bb2acb9f96a..611421186b18a 100644 --- a/eng/pipelines/templates/variables/globals.yml +++ b/eng/pipelines/templates/variables/globals.yml @@ -1,6 +1,7 @@ variables: DocWardenVersion: '0.5.0' - DefaultOptions: '--batch-mode --fail-at-end --settings eng/settings.xml' + WagonOptions: '-Dmaven.wagon.rto=300000 -Dmaven.wagon.http.retryHandler.count=3' + DefaultOptions: '--batch-mode --fail-at-end --settings eng/settings.xml $(WagonOptions)' LoggingOptions: '-Dorg.slf4j.simpleLogger.defaultLogLevel=error -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn' MemoryOptions: '-Xmx3072m' #Agent.Source.Git.ShallowFetchDepth: 1 From e0772d428921d48bbaace64a6955316637bc520d Mon Sep 17 00:00:00 2001 From: Kushagra Thapar Date: Thu, 9 Jul 2020 22:18:55 -0700 Subject: [PATCH 079/129] Added idle tcp connection timeout bug where gateway connection overrides direct connection config (#12974) --- .../com/azure/cosmos/CosmosClientBuilder.java | 4 +- .../implementation/ConnectionPolicy.java | 54 +++++++++++++++---- .../implementation/RxDocumentClientImpl.java | 2 +- .../RntbdTransportClient.java | 4 +- .../azure/cosmos/ConnectionConfigTest.java | 49 +++++++++-------- .../models/CosmosPartitionKeyTests.java | 2 +- 6 files changed, 74 insertions(+), 41 deletions(-) diff --git a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/CosmosClientBuilder.java b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/CosmosClientBuilder.java index ed30bac228434..13892748126c6 100644 --- a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/CosmosClientBuilder.java +++ b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/CosmosClientBuilder.java @@ -668,8 +668,10 @@ private void buildConnectionPolicy() { // Check if the user passed additional gateway connection configuration if (this.gatewayConnectionConfig != null) { this.connectionPolicy.setMaxConnectionPoolSize(this.gatewayConnectionConfig.getMaxConnectionPoolSize()); + // TODO(kuthapar): potential bug - when we expose requestTimeout from direct and gateway connection config, + // as gateway connection config will overwrite direct connection config settings this.connectionPolicy.setRequestTimeout(this.gatewayConnectionConfig.getRequestTimeout()); - this.connectionPolicy.setIdleConnectionTimeout(this.gatewayConnectionConfig.getIdleConnectionTimeout()); + this.connectionPolicy.setIdleHttpConnectionTimeout(this.gatewayConnectionConfig.getIdleConnectionTimeout()); } } else if (gatewayConnectionConfig != null) { this.connectionPolicy = new ConnectionPolicy(gatewayConnectionConfig); diff --git a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/ConnectionPolicy.java b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/ConnectionPolicy.java index 9362d784712e0..a9433289dcc9c 100644 --- a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/ConnectionPolicy.java +++ b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/ConnectionPolicy.java @@ -27,7 +27,6 @@ public final class ConnectionPolicy { private ConnectionMode connectionMode; private boolean endpointDiscoveryEnabled; - private Duration idleConnectionTimeout; private boolean multipleWriteRegionsEnabled; private List preferredRegions; private boolean readRequestsFallbackEnabled; @@ -38,19 +37,21 @@ public final class ConnectionPolicy { private int maxConnectionPoolSize; private Duration requestTimeout; private ProxyOptions proxy; + private Duration idleHttpConnectionTimeout; // Direct connection config properties private Duration connectTimeout; private Duration idleEndpointTimeout; private int maxConnectionsPerEndpoint; private int maxRequestsPerConnection; + private Duration idleTcpConnectionTimeout; /** * Constructor. */ public ConnectionPolicy(GatewayConnectionConfig gatewayConnectionConfig) { this(ConnectionMode.GATEWAY); - this.idleConnectionTimeout = gatewayConnectionConfig.getIdleConnectionTimeout(); + this.idleHttpConnectionTimeout = gatewayConnectionConfig.getIdleConnectionTimeout(); this.maxConnectionPoolSize = gatewayConnectionConfig.getMaxConnectionPoolSize(); this.requestTimeout = BridgeInternal.getRequestTimeoutFromGatewayConnectionConfig(gatewayConnectionConfig); this.proxy = gatewayConnectionConfig.getProxy(); @@ -59,7 +60,7 @@ public ConnectionPolicy(GatewayConnectionConfig gatewayConnectionConfig) { public ConnectionPolicy(DirectConnectionConfig directConnectionConfig) { this(ConnectionMode.DIRECT); this.connectTimeout = directConnectionConfig.getConnectTimeout(); - this.idleConnectionTimeout = directConnectionConfig.getIdleConnectionTimeout(); + this.idleTcpConnectionTimeout = directConnectionConfig.getIdleConnectionTimeout(); this.idleEndpointTimeout = directConnectionConfig.getIdleEndpointTimeout(); this.maxConnectionsPerEndpoint = directConnectionConfig.getMaxConnectionsPerEndpoint(); this.maxRequestsPerConnection = directConnectionConfig.getMaxRequestsPerConnection(); @@ -149,24 +150,54 @@ public ConnectionPolicy setMaxConnectionPoolSize(int maxConnectionPoolSize) { } /** - * Gets the value of the timeout for an idle connection, the default is 60 + * Gets the value of the timeout for an idle http connection, the default is 60 * seconds. * * @return Idle connection timeout duration. */ - public Duration getIdleConnectionTimeout() { - return this.idleConnectionTimeout; + public Duration getIdleHttpConnectionTimeout() { + return this.idleHttpConnectionTimeout; } /** - * sets the value of the timeout for an idle connection. After that time, + * sets the value of the timeout for an idle http connection. After that time, * the connection will be automatically closed. * - * @param idleConnectionTimeout the duration for an idle connection. + * @param idleHttpConnectionTimeout the duration for an idle connection. * @return the ConnectionPolicy. */ - public ConnectionPolicy setIdleConnectionTimeout(Duration idleConnectionTimeout) { - this.idleConnectionTimeout = idleConnectionTimeout; + public ConnectionPolicy setIdleHttpConnectionTimeout(Duration idleHttpConnectionTimeout) { + this.idleHttpConnectionTimeout = idleHttpConnectionTimeout; + return this; + } + + /** + * Gets the idle tcp connection timeout for direct client + * + * Default value is {@link Duration#ZERO} + * + * Direct client doesn't close a single connection to an endpoint + * by default unless specified. + * + * @return idle tcp connection timeout + */ + public Duration getIdleTcpConnectionTimeout() { + return idleTcpConnectionTimeout; + } + + /** + * Sets the idle tcp connection timeout + * + * Default value is {@link Duration#ZERO} + * + * Direct client doesn't close a single connection to an endpoint + * by default unless specified. + * + * @param idleTcpConnectionTimeout idle connection timeout + * @return the {@link ConnectionPolicy} + */ + public ConnectionPolicy setIdleTcpConnectionTimeout(Duration idleTcpConnectionTimeout) { + this.idleTcpConnectionTimeout = idleTcpConnectionTimeout; return this; } @@ -451,7 +482,8 @@ public String toString() { "requestTimeout=" + requestTimeout + ", connectionMode=" + connectionMode + ", maxConnectionPoolSize=" + maxConnectionPoolSize + - ", idleConnectionTimeout=" + idleConnectionTimeout + + ", idleHttpConnectionTimeout=" + idleHttpConnectionTimeout + + ", idleTcpConnectionTimeout=" + idleTcpConnectionTimeout + ", userAgentSuffix='" + userAgentSuffix + '\'' + ", throttlingRetryOptions=" + throttlingRetryOptions + ", endpointDiscoveryEnabled=" + endpointDiscoveryEnabled + diff --git a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/RxDocumentClientImpl.java b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/RxDocumentClientImpl.java index a004f7ab68bc5..120f0efd21bc6 100644 --- a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/RxDocumentClientImpl.java +++ b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/RxDocumentClientImpl.java @@ -357,7 +357,7 @@ RxGatewayStoreModel createRxGatewayProxy(ISessionContainer sessionContainer, private HttpClient httpClient() { HttpClientConfig httpClientConfig = new HttpClientConfig(this.configs) - .withMaxIdleConnectionTimeout(this.connectionPolicy.getIdleConnectionTimeout()) + .withMaxIdleConnectionTimeout(this.connectionPolicy.getIdleHttpConnectionTimeout()) .withPoolSize(this.connectionPolicy.getMaxConnectionPoolSize()) .withProxy(this.connectionPolicy.getProxy()) .withRequestTimeout(this.connectionPolicy.getRequestTimeout()); diff --git a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/directconnectivity/RntbdTransportClient.java b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/directconnectivity/RntbdTransportClient.java index 71682cdbd2846..837163ab5725e 100644 --- a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/directconnectivity/RntbdTransportClient.java +++ b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/directconnectivity/RntbdTransportClient.java @@ -254,7 +254,7 @@ private Options(final ConnectionPolicy connectionPolicy) { this.bufferPageSize = 8192; this.connectionAcquisitionTimeout = Duration.ZERO; this.connectTimeout = connectionPolicy.getConnectTimeout(); - this.idleChannelTimeout = connectionPolicy.getIdleConnectionTimeout(); + this.idleChannelTimeout = connectionPolicy.getIdleTcpConnectionTimeout(); this.idleEndpointTimeout = Duration.ofSeconds(70L); this.maxBufferCapacity = 8192 << 10; this.maxChannelsPerEndpoint = connectionPolicy.getMaxConnectionsPerEndpoint(); @@ -484,7 +484,7 @@ public Builder(ConnectionPolicy connectionPolicy) { this.bufferPageSize = DEFAULT_OPTIONS.bufferPageSize; this.connectionAcquisitionTimeout = DEFAULT_OPTIONS.connectionAcquisitionTimeout; this.connectTimeout = connectionPolicy.getConnectTimeout(); - this.idleChannelTimeout = connectionPolicy.getIdleConnectionTimeout(); + this.idleChannelTimeout = connectionPolicy.getIdleTcpConnectionTimeout(); this.idleEndpointTimeout = DEFAULT_OPTIONS.idleEndpointTimeout; this.maxBufferCapacity = DEFAULT_OPTIONS.maxBufferCapacity; this.maxChannelsPerEndpoint = connectionPolicy.getMaxConnectionsPerEndpoint(); diff --git a/sdk/cosmos/azure-cosmos/src/test/java/com/azure/cosmos/ConnectionConfigTest.java b/sdk/cosmos/azure-cosmos/src/test/java/com/azure/cosmos/ConnectionConfigTest.java index cf0dc55b925a0..a7a01d1f68eea 100644 --- a/sdk/cosmos/azure-cosmos/src/test/java/com/azure/cosmos/ConnectionConfigTest.java +++ b/sdk/cosmos/azure-cosmos/src/test/java/com/azure/cosmos/ConnectionConfigTest.java @@ -12,7 +12,6 @@ import java.time.Duration; import java.util.ArrayList; import java.util.List; -import java.util.Objects; import static org.assertj.core.api.Assertions.assertThat; @@ -37,7 +36,7 @@ public void buildClient_withDefaultGatewayConnectionConfig() { AsyncDocumentClient asyncDocumentClient = CosmosBridgeInternal.getAsyncDocumentClient(cosmosClient); ConnectionPolicy connectionPolicy = asyncDocumentClient.getConnectionPolicy(); - assertThat(connectionPolicy.getConnectionMode().equals(ConnectionMode.GATEWAY)); + assertThat(connectionPolicy.getConnectionMode()).isEqualTo(ConnectionMode.GATEWAY); validateGatewayConnectionConfig(connectionPolicy, cosmosClientBuilder, gatewayConnectionConfig); safeCloseSyncClient(cosmosClient); } @@ -66,7 +65,7 @@ public void buildClient_withCustomGatewayConnectionConfig() { AsyncDocumentClient asyncDocumentClient = CosmosBridgeInternal.getAsyncDocumentClient(cosmosClient); ConnectionPolicy connectionPolicy = asyncDocumentClient.getConnectionPolicy(); - assertThat(connectionPolicy.getConnectionMode().equals(ConnectionMode.GATEWAY)); + assertThat(connectionPolicy.getConnectionMode()).isEqualTo(ConnectionMode.GATEWAY); validateGatewayConnectionConfig(connectionPolicy, cosmosClientBuilder, gatewayConnectionConfig); safeCloseSyncClient(cosmosClient); } @@ -84,7 +83,7 @@ public void buildClient_withDefaultDirectConnectionConfig() { AsyncDocumentClient asyncDocumentClient = CosmosBridgeInternal.getAsyncDocumentClient(cosmosClient); ConnectionPolicy connectionPolicy = asyncDocumentClient.getConnectionPolicy(); - assertThat(connectionPolicy.getConnectionMode().equals(ConnectionMode.DIRECT)); + assertThat(connectionPolicy.getConnectionMode()).isEqualTo(ConnectionMode.DIRECT); validateDirectConnectionConfig(connectionPolicy, cosmosClientBuilder, directConnectionConfig); safeCloseSyncClient(cosmosClient); } @@ -113,7 +112,7 @@ public void buildClient_withCustomDirectConnectionConfig() { AsyncDocumentClient asyncDocumentClient = CosmosBridgeInternal.getAsyncDocumentClient(cosmosClient); ConnectionPolicy connectionPolicy = asyncDocumentClient.getConnectionPolicy(); - assertThat(connectionPolicy.getConnectionMode().equals(ConnectionMode.DIRECT)); + assertThat(connectionPolicy.getConnectionMode()).isEqualTo(ConnectionMode.DIRECT); validateDirectConnectionConfig(connectionPolicy, cosmosClientBuilder, directConnectionConfig); safeCloseSyncClient(cosmosClient); } @@ -133,7 +132,7 @@ public void buildClient_withDirectAndGatewayConnectionConfig() { AsyncDocumentClient asyncDocumentClient = CosmosBridgeInternal.getAsyncDocumentClient(cosmosClient); ConnectionPolicy connectionPolicy = asyncDocumentClient.getConnectionPolicy(); - assertThat(connectionPolicy.getConnectionMode().equals(ConnectionMode.DIRECT)); + assertThat(connectionPolicy.getConnectionMode()).isEqualTo(ConnectionMode.DIRECT); validateDirectAndGatewayConnectionConfig(connectionPolicy, cosmosClientBuilder, directConnectionConfig, gatewayConnectionConfig); safeCloseSyncClient(cosmosClient); } @@ -149,7 +148,7 @@ public void buildClient_withNoConnectionConfig() { AsyncDocumentClient asyncDocumentClient = CosmosBridgeInternal.getAsyncDocumentClient(cosmosClient); ConnectionPolicy connectionPolicy = asyncDocumentClient.getConnectionPolicy(); - assertThat(connectionPolicy.getConnectionMode().equals(ConnectionMode.DIRECT)); + assertThat(connectionPolicy.getConnectionMode()).isEqualTo(ConnectionMode.DIRECT); validateDirectConnectionConfig(connectionPolicy, cosmosClientBuilder, DirectConnectionConfig.getDefaultConfig()); safeCloseSyncClient(cosmosClient); } @@ -157,44 +156,44 @@ public void buildClient_withNoConnectionConfig() { private void validateDirectAndGatewayConnectionConfig(ConnectionPolicy connectionPolicy, CosmosClientBuilder cosmosClientBuilder, DirectConnectionConfig directConnectionConfig, GatewayConnectionConfig gatewayConnectionConfig) { validateCommonConnectionConfig(connectionPolicy, cosmosClientBuilder); - assertThat(Objects.equals(connectionPolicy.getConnectionMode(), ConnectionMode.DIRECT)); + assertThat(connectionPolicy.getConnectionMode()).isEqualTo(ConnectionMode.DIRECT); validateDirectConfig(connectionPolicy, directConnectionConfig); validateGatewayConfig(connectionPolicy, gatewayConnectionConfig); } private void validateGatewayConnectionConfig(ConnectionPolicy connectionPolicy, CosmosClientBuilder cosmosClientBuilder, GatewayConnectionConfig gatewayConnectionConfig) { validateCommonConnectionConfig(connectionPolicy, cosmosClientBuilder); - assertThat(Objects.equals(connectionPolicy.getConnectionMode(), ConnectionMode.GATEWAY)); + assertThat(connectionPolicy.getConnectionMode()).isEqualTo(ConnectionMode.GATEWAY); validateGatewayConfig(connectionPolicy, gatewayConnectionConfig); } private void validateDirectConnectionConfig(ConnectionPolicy connectionPolicy, CosmosClientBuilder cosmosClientBuilder, DirectConnectionConfig directConnectionConfig) { validateCommonConnectionConfig(connectionPolicy, cosmosClientBuilder); - assertThat(Objects.equals(connectionPolicy.getConnectionMode(), ConnectionMode.DIRECT)); + assertThat(connectionPolicy.getConnectionMode()).isEqualTo(ConnectionMode.DIRECT); validateDirectConfig(connectionPolicy, directConnectionConfig); } private void validateCommonConnectionConfig(ConnectionPolicy connectionPolicy, CosmosClientBuilder cosmosClientBuilder) { - assertThat(Objects.equals(connectionPolicy.isMultipleWriteRegionsEnabled(), cosmosClientBuilder.isMultipleWriteRegionsEnabled())); - assertThat(Objects.equals(connectionPolicy.isEndpointDiscoveryEnabled(), cosmosClientBuilder.isEndpointDiscoveryEnabled())); - assertThat(Objects.equals(connectionPolicy.isReadRequestsFallbackEnabled(), cosmosClientBuilder.isReadRequestsFallbackEnabled())); - assertThat(Objects.equals(connectionPolicy.getPreferredRegions(), cosmosClientBuilder.getPreferredRegions())); - assertThat(Objects.equals(connectionPolicy.getThrottlingRetryOptions(), cosmosClientBuilder.getThrottlingRetryOptions())); - assertThat(Objects.equals(connectionPolicy.getUserAgentSuffix(), cosmosClientBuilder.getUserAgentSuffix())); + assertThat(connectionPolicy.isMultipleWriteRegionsEnabled()).isEqualTo(cosmosClientBuilder.isMultipleWriteRegionsEnabled()); + assertThat(connectionPolicy.isEndpointDiscoveryEnabled()).isEqualTo(cosmosClientBuilder.isEndpointDiscoveryEnabled()); + assertThat(connectionPolicy.isReadRequestsFallbackEnabled()).isEqualTo(cosmosClientBuilder.isReadRequestsFallbackEnabled()); + assertThat(connectionPolicy.getPreferredRegions()).isEqualTo(cosmosClientBuilder.getPreferredRegions()); + assertThat(connectionPolicy.getThrottlingRetryOptions()).isEqualTo(cosmosClientBuilder.getThrottlingRetryOptions()); + assertThat(connectionPolicy.getUserAgentSuffix()).isEqualTo(cosmosClientBuilder.getUserAgentSuffix()); } private void validateGatewayConfig(ConnectionPolicy connectionPolicy, GatewayConnectionConfig gatewayConnectionConfig) { - assertThat(Objects.equals(connectionPolicy.getIdleConnectionTimeout(), gatewayConnectionConfig.getIdleConnectionTimeout())); - assertThat(Objects.equals(connectionPolicy.getMaxConnectionPoolSize(), gatewayConnectionConfig.getMaxConnectionPoolSize())); - assertThat(Objects.equals(connectionPolicy.getRequestTimeout(), gatewayConnectionConfig.getRequestTimeout())); - assertThat(Objects.equals(connectionPolicy.getProxy(), gatewayConnectionConfig.getProxy())); + assertThat(connectionPolicy.getIdleHttpConnectionTimeout()).isEqualTo(gatewayConnectionConfig.getIdleConnectionTimeout()); + assertThat(connectionPolicy.getMaxConnectionPoolSize()).isEqualTo(gatewayConnectionConfig.getMaxConnectionPoolSize()); + assertThat(connectionPolicy.getRequestTimeout()).isEqualTo(gatewayConnectionConfig.getRequestTimeout()); + assertThat(connectionPolicy.getProxy()).isEqualTo(gatewayConnectionConfig.getProxy()); } private void validateDirectConfig(ConnectionPolicy connectionPolicy, DirectConnectionConfig directConnectionConfig) { - assertThat(Objects.equals(connectionPolicy.getConnectTimeout(), directConnectionConfig.getConnectTimeout())); - assertThat(Objects.equals(connectionPolicy.getIdleConnectionTimeout(), directConnectionConfig.getIdleConnectionTimeout())); - assertThat(Objects.equals(connectionPolicy.getIdleEndpointTimeout(), directConnectionConfig.getIdleEndpointTimeout())); - assertThat(Objects.equals(connectionPolicy.getMaxConnectionsPerEndpoint(), directConnectionConfig.getMaxConnectionsPerEndpoint())); - assertThat(Objects.equals(connectionPolicy.getMaxRequestsPerConnection(), directConnectionConfig.getMaxRequestsPerConnection())); + assertThat(connectionPolicy.getConnectTimeout()).isEqualTo(directConnectionConfig.getConnectTimeout()); + assertThat(connectionPolicy.getIdleTcpConnectionTimeout()).isEqualTo(directConnectionConfig.getIdleConnectionTimeout()); + assertThat(connectionPolicy.getIdleEndpointTimeout()).isEqualTo(directConnectionConfig.getIdleEndpointTimeout()); + assertThat(connectionPolicy.getMaxConnectionsPerEndpoint()).isEqualTo(directConnectionConfig.getMaxConnectionsPerEndpoint()); + assertThat(connectionPolicy.getMaxRequestsPerConnection()).isEqualTo(directConnectionConfig.getMaxRequestsPerConnection()); } } diff --git a/sdk/cosmos/azure-cosmos/src/test/java/com/azure/cosmos/models/CosmosPartitionKeyTests.java b/sdk/cosmos/azure-cosmos/src/test/java/com/azure/cosmos/models/CosmosPartitionKeyTests.java index 58f2ea67d7fe8..87c6c943a1fec 100644 --- a/sdk/cosmos/azure-cosmos/src/test/java/com/azure/cosmos/models/CosmosPartitionKeyTests.java +++ b/sdk/cosmos/azure-cosmos/src/test/java/com/azure/cosmos/models/CosmosPartitionKeyTests.java @@ -78,7 +78,7 @@ public void afterClass() { private void createContainerWithoutPk() throws URISyntaxException, IOException { ConnectionPolicy connectionPolicy = new ConnectionPolicy(DirectConnectionConfig.getDefaultConfig()); HttpClientConfig httpClientConfig = new HttpClientConfig(new Configs()) - .withMaxIdleConnectionTimeout(connectionPolicy.getIdleConnectionTimeout()) + .withMaxIdleConnectionTimeout(connectionPolicy.getIdleHttpConnectionTimeout()) .withPoolSize(connectionPolicy.getMaxConnectionPoolSize()) .withProxy(connectionPolicy.getProxy()) .withRequestTimeout(connectionPolicy.getRequestTimeout()); From f627f826e65ed3802c63ec2a2044c3535325c943 Mon Sep 17 00:00:00 2001 From: Alan Zimmer <48699787+alzimmermsft@users.noreply.github.com> Date: Thu, 9 Jul 2020 22:38:19 -0700 Subject: [PATCH 080/129] Use Varargs in Model APIs (#12878) * Move model list APIs to use varargs * Add missing vararg and List overloads * Added more vararg and List overloads, add JsonGetters to List overloads * Fix failing test * Remove list overload from input only model * Fix Java 8 toArray call * Add null checking validation for vararg overloads --- .../converters/AnalyzeRequestConverter.java | 12 +- .../CjkBigramTokenFilterConverter.java | 7 +- .../EdgeNGramTokenizerConverter.java | 7 +- .../ElisionTokenFilterConverter.java | 3 +- .../EntityRecognitionSkillConverter.java | 7 +- .../ImageAnalysisSkillConverter.java | 14 +- .../LuceneStandardAnalyzerConverter.java | 3 +- .../converters/NGramTokenizerConverter.java | 7 +- .../converters/PatternAnalyzerConverter.java | 9 +- .../converters/PatternTokenizerConverter.java | 7 +- .../converters/ScoringProfileConverter.java | 7 +- .../converters/StopAnalyzerConverter.java | 3 +- .../WordDelimiterTokenFilterConverter.java | 3 +- .../indexes/models/AnalyzeTextOptions.java | 10 +- .../indexes/models/CjkBigramTokenFilter.java | 15 + .../indexes/models/CustomAnalyzer.java | 33 ++ .../indexes/models/EdgeNGramTokenizer.java | 15 + .../indexes/models/ElisionTokenFilter.java | 15 + .../models/EntityRecognitionSkill.java | 16 + .../indexes/models/ImageAnalysisSkill.java | 28 ++ .../models/InputFieldMappingEntry.java | 16 + .../models/LuceneStandardAnalyzer.java | 15 + .../indexes/models/NGramTokenizer.java | 15 + .../indexes/models/PatternAnalyzer.java | 26 ++ .../indexes/models/PatternTokenizer.java | 14 + .../indexes/models/ScoringProfile.java | 16 + .../documents/indexes/models/SearchField.java | 35 ++ .../documents/indexes/models/SearchIndex.java | 87 +++++ .../indexes/models/SearchIndexer.java | 29 ++ .../indexes/models/SearchIndexerSkillset.java | 15 + .../indexes/models/StopAnalyzer.java | 15 + .../indexes/models/StopwordsTokenFilter.java | 16 + .../models/WordDelimiterTokenFilter.java | 16 + .../documents/models/AutocompleteOptions.java | 2 +- .../documents/models/SearchOptions.java | 12 +- .../documents/models/SuggestOptions.java | 6 +- .../IndexAndServiceStatisticsExample.java | 37 +- .../RefineSearchCapabilitiesExample.java | 2 +- .../documents/SynonymMapsCreateExample.java | 3 +- .../indexes/LifecycleSetupExample.java | 3 +- .../search/documents/IndexingSyncTests.java | 4 +- .../search/documents/SearchSyncTests.java | 2 +- .../search/documents/SearchTestBase.java | 339 +++++++++--------- .../indexes/CustomAnalyzerSyncTests.java | 186 +++------- .../indexes/IndexManagementSyncTests.java | 34 +- .../indexes/SkillsetManagementSyncTests.java | 26 +- sdk/search/tests.yml | 4 +- 47 files changed, 750 insertions(+), 446 deletions(-) diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/AnalyzeRequestConverter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/AnalyzeRequestConverter.java index 8827b92075411..5dcc1e5e3e1ee 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/AnalyzeRequestConverter.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/AnalyzeRequestConverter.java @@ -35,16 +35,16 @@ public static AnalyzeTextOptions map(com.azure.search.documents.indexes.implemen } if (obj.getCharFilters() != null) { - List charFilters = - obj.getCharFilters().stream().map(CharFilterNameConverter::map).collect(Collectors.toList()); - analyzeTextOptions.setCharFilters(charFilters); + analyzeTextOptions.setCharFilters(obj.getCharFilters().stream() + .map(CharFilterNameConverter::map) + .toArray(CharFilterName[]::new)); } if (obj.getTokenFilters() != null) { - List tokenFilters = - obj.getTokenFilters().stream().map(TokenFilterNameConverter::map).collect(Collectors.toList()); - analyzeTextOptions.setTokenFilters(tokenFilters); + analyzeTextOptions.setTokenFilters(obj.getTokenFilters().stream() + .map(TokenFilterNameConverter::map) + .toArray(TokenFilterName[]::new)); } diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/CjkBigramTokenFilterConverter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/CjkBigramTokenFilterConverter.java index 3f36516036f63..ca45d321dc27b 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/CjkBigramTokenFilterConverter.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/CjkBigramTokenFilterConverter.java @@ -4,7 +4,6 @@ package com.azure.search.documents.implementation.converters; import com.azure.search.documents.indexes.models.CjkBigramTokenFilter; -import com.azure.search.documents.indexes.models.CjkBigramTokenFilterScripts; import java.util.List; import java.util.stream.Collectors; @@ -28,9 +27,9 @@ public static CjkBigramTokenFilter map(com.azure.search.documents.indexes.implem cjkBigramTokenFilter.setOutputUnigrams(outputUnigrams); if (obj.getIgnoreScripts() != null) { - List ignoreScripts = - obj.getIgnoreScripts().stream().map(CjkBigramTokenFilterScriptsConverter::map).collect(Collectors.toList()); - cjkBigramTokenFilter.setIgnoreScripts(ignoreScripts); + cjkBigramTokenFilter.setIgnoreScripts(obj.getIgnoreScripts().stream() + .map(CjkBigramTokenFilterScriptsConverter::map) + .collect(Collectors.toList())); } return cjkBigramTokenFilter; } diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/EdgeNGramTokenizerConverter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/EdgeNGramTokenizerConverter.java index 9237bb4bff098..2629716afe667 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/EdgeNGramTokenizerConverter.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/EdgeNGramTokenizerConverter.java @@ -4,7 +4,6 @@ package com.azure.search.documents.implementation.converters; import com.azure.search.documents.indexes.models.EdgeNGramTokenizer; -import com.azure.search.documents.indexes.models.TokenCharacterKind; import java.util.List; import java.util.stream.Collectors; @@ -28,9 +27,9 @@ public static EdgeNGramTokenizer map(com.azure.search.documents.indexes.implemen edgeNGramTokenizer.setMaxGram(maxGram); if (obj.getTokenChars() != null) { - List tokenChars = - obj.getTokenChars().stream().map(TokenCharacterKindConverter::map).collect(Collectors.toList()); - edgeNGramTokenizer.setTokenChars(tokenChars); + edgeNGramTokenizer.setTokenChars(obj.getTokenChars().stream() + .map(TokenCharacterKindConverter::map) + .collect(Collectors.toList())); } Integer minGram = obj.getMinGram(); diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/ElisionTokenFilterConverter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/ElisionTokenFilterConverter.java index fd274a727534d..5b04318783c5d 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/ElisionTokenFilterConverter.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/ElisionTokenFilterConverter.java @@ -24,8 +24,7 @@ public static ElisionTokenFilter map(com.azure.search.documents.indexes.implemen ElisionTokenFilter elisionTokenFilter = new ElisionTokenFilter(obj.getName()); if (obj.getArticles() != null) { - List articles = new ArrayList<>(obj.getArticles()); - elisionTokenFilter.setArticles(articles); + elisionTokenFilter.setArticles(obj.getArticles()); } return elisionTokenFilter; } diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/EntityRecognitionSkillConverter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/EntityRecognitionSkillConverter.java index 17c91d75a62de..42e15524b92d8 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/EntityRecognitionSkillConverter.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/EntityRecognitionSkillConverter.java @@ -3,7 +3,6 @@ package com.azure.search.documents.implementation.converters; -import com.azure.search.documents.indexes.models.EntityCategory; import com.azure.search.documents.indexes.models.EntityRecognitionSkill; import com.azure.search.documents.indexes.models.EntityRecognitionSkillLanguage; import com.azure.search.documents.indexes.models.InputFieldMappingEntry; @@ -52,9 +51,9 @@ public static EntityRecognitionSkill map(com.azure.search.documents.indexes.impl } if (obj.getCategories() != null) { - List categories = - obj.getCategories().stream().map(EntityCategoryConverter::map).collect(Collectors.toList()); - entityRecognitionSkill.setCategories(categories); + entityRecognitionSkill.setCategories(obj.getCategories().stream() + .map(EntityCategoryConverter::map) + .collect(Collectors.toList())); } Double minimumPrecision = obj.getMinimumPrecision(); diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/ImageAnalysisSkillConverter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/ImageAnalysisSkillConverter.java index ddb96e58578d4..76eabdc29d134 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/ImageAnalysisSkillConverter.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/ImageAnalysisSkillConverter.java @@ -5,10 +5,8 @@ import com.azure.search.documents.indexes.models.ImageAnalysisSkill; import com.azure.search.documents.indexes.models.ImageAnalysisSkillLanguage; -import com.azure.search.documents.indexes.models.ImageDetail; import com.azure.search.documents.indexes.models.InputFieldMappingEntry; import com.azure.search.documents.indexes.models.OutputFieldMappingEntry; -import com.azure.search.documents.indexes.models.VisualFeature; import java.util.List; import java.util.stream.Collectors; @@ -44,9 +42,9 @@ public static ImageAnalysisSkill map(com.azure.search.documents.indexes.implemen imageAnalysisSkill.setDescription(description); if (obj.getVisualFeatures() != null) { - List visualFeatures = - obj.getVisualFeatures().stream().map(VisualFeatureConverter::map).collect(Collectors.toList()); - imageAnalysisSkill.setVisualFeatures(visualFeatures); + imageAnalysisSkill.setVisualFeatures(obj.getVisualFeatures().stream() + .map(VisualFeatureConverter::map) + .collect(Collectors.toList())); } if (obj.getDefaultLanguageCode() != null) { @@ -56,9 +54,9 @@ public static ImageAnalysisSkill map(com.azure.search.documents.indexes.implemen } if (obj.getDetails() != null) { - List details = - obj.getDetails().stream().map(ImageDetailConverter::map).collect(Collectors.toList()); - imageAnalysisSkill.setDetails(details); + imageAnalysisSkill.setDetails(obj.getDetails().stream() + .map(ImageDetailConverter::map) + .collect(Collectors.toList())); } return imageAnalysisSkill; } diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/LuceneStandardAnalyzerConverter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/LuceneStandardAnalyzerConverter.java index 3a3eb17a747d2..3e092e9c830da 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/LuceneStandardAnalyzerConverter.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/LuceneStandardAnalyzerConverter.java @@ -27,8 +27,7 @@ public static LuceneStandardAnalyzer map(com.azure.search.documents.indexes.impl luceneStandardAnalyzer.setMaxTokenLength(maxTokenLength); if (obj.getStopwords() != null) { - List stopwords = new ArrayList<>(obj.getStopwords()); - luceneStandardAnalyzer.setStopwords(stopwords); + luceneStandardAnalyzer.setStopwords(obj.getStopwords()); } return luceneStandardAnalyzer; } diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/NGramTokenizerConverter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/NGramTokenizerConverter.java index 11d9135727dd1..7c551de884b65 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/NGramTokenizerConverter.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/NGramTokenizerConverter.java @@ -4,7 +4,6 @@ package com.azure.search.documents.implementation.converters; import com.azure.search.documents.indexes.models.NGramTokenizer; -import com.azure.search.documents.indexes.models.TokenCharacterKind; import java.util.List; import java.util.stream.Collectors; @@ -27,9 +26,9 @@ public static NGramTokenizer map(com.azure.search.documents.indexes.implementati nGramTokenizer.setMaxGram(maxGram); if (obj.getTokenChars() != null) { - List tokenChars = - obj.getTokenChars().stream().map(TokenCharacterKindConverter::map).collect(Collectors.toList()); - nGramTokenizer.setTokenChars(tokenChars); + nGramTokenizer.setTokenChars(obj.getTokenChars().stream() + .map(TokenCharacterKindConverter::map) + .collect(Collectors.toList())); } Integer minGram = obj.getMinGram(); diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/PatternAnalyzerConverter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/PatternAnalyzerConverter.java index 3c629c15b7b5a..5918253435148 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/PatternAnalyzerConverter.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/PatternAnalyzerConverter.java @@ -32,14 +32,13 @@ public static PatternAnalyzer map(com.azure.search.documents.indexes.implementat patternAnalyzer.setPattern(pattern); if (obj.getFlags() != null) { - List regexFlags = - Arrays.stream(obj.getFlags().toString().split("\\|")).map(RegexFlags::fromString).collect(Collectors.toList()); - patternAnalyzer.setFlags(regexFlags); + patternAnalyzer.setFlags(Arrays.stream(obj.getFlags().toString().split("\\|")) + .map(RegexFlags::fromString) + .collect(Collectors.toList())); } if (obj.getStopwords() != null) { - List stopwords = new ArrayList<>(obj.getStopwords()); - patternAnalyzer.setStopwords(stopwords); + patternAnalyzer.setStopwords(obj.getStopwords()); } return patternAnalyzer; } diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/PatternTokenizerConverter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/PatternTokenizerConverter.java index 89cf03629166e..5f0aeb5a91047 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/PatternTokenizerConverter.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/PatternTokenizerConverter.java @@ -7,7 +7,6 @@ import com.azure.search.documents.indexes.models.RegexFlags; import java.util.Arrays; -import java.util.List; import java.util.stream.Collectors; /** @@ -28,9 +27,9 @@ public static PatternTokenizer map(com.azure.search.documents.indexes.implementa patternTokenizer.setPattern(pattern); if (obj.getFlags() != null) { - List regexFlags = - Arrays.stream(obj.getFlags().toString().split("\\|")).map(RegexFlags::fromString).collect(Collectors.toList()); - patternTokenizer.setFlags(regexFlags); + patternTokenizer.setFlags(Arrays.stream(obj.getFlags().toString().split("\\|")) + .map(RegexFlags::fromString) + .collect(Collectors.toList())); } Integer group = obj.getGroup(); diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/ScoringProfileConverter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/ScoringProfileConverter.java index 78fc6dd367ac8..610eb69f6b8c3 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/ScoringProfileConverter.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/ScoringProfileConverter.java @@ -3,7 +3,6 @@ package com.azure.search.documents.implementation.converters; -import com.azure.search.documents.indexes.models.ScoringFunction; import com.azure.search.documents.indexes.models.ScoringFunctionAggregation; import com.azure.search.documents.indexes.models.ScoringProfile; import com.azure.search.documents.indexes.models.TextWeights; @@ -26,9 +25,9 @@ public static ScoringProfile map(com.azure.search.documents.indexes.implementati ScoringProfile scoringProfile = new ScoringProfile(obj.getName()); if (obj.getFunctions() != null) { - List functions = - obj.getFunctions().stream().map(ScoringFunctionConverter::map).collect(Collectors.toList()); - scoringProfile.setFunctions(functions); + scoringProfile.setFunctions(obj.getFunctions().stream() + .map(ScoringFunctionConverter::map) + .collect(Collectors.toList())); } if (obj.getTextWeights() != null) { diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/StopAnalyzerConverter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/StopAnalyzerConverter.java index 2b8f8495b1d53..e59cab202029f 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/StopAnalyzerConverter.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/StopAnalyzerConverter.java @@ -22,8 +22,7 @@ public static StopAnalyzer map(com.azure.search.documents.indexes.implementation StopAnalyzer stopAnalyzer = new StopAnalyzer(obj.getName()); if (obj.getStopwords() != null) { - List stopwords = new ArrayList<>(obj.getStopwords()); - stopAnalyzer.setStopwords(stopwords); + stopAnalyzer.setStopwords(obj.getStopwords()); } return stopAnalyzer; } diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/WordDelimiterTokenFilterConverter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/WordDelimiterTokenFilterConverter.java index 988967cd2d35a..a8f0aff32e22f 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/WordDelimiterTokenFilterConverter.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/converters/WordDelimiterTokenFilterConverter.java @@ -27,8 +27,7 @@ public static WordDelimiterTokenFilter map(com.azure.search.documents.indexes.im wordDelimiterTokenFilter.setNumbersCatenated(catenateNumbers); if (obj.getProtectedWords() != null) { - List protectedWords = new ArrayList<>(obj.getProtectedWords()); - wordDelimiterTokenFilter.setProtectedWords(protectedWords); + wordDelimiterTokenFilter.setProtectedWords(obj.getProtectedWords()); } Boolean generateNumberParts = obj.isGenerateNumberParts(); diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/AnalyzeTextOptions.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/AnalyzeTextOptions.java index 4039507f14291..a7255502772bf 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/AnalyzeTextOptions.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/AnalyzeTextOptions.java @@ -5,6 +5,8 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; + +import java.util.Arrays; import java.util.List; /** @@ -201,8 +203,8 @@ public List getTokenFilters() { * @param tokenFilters the tokenFilters value to set. * @return the AnalyzeRequest object itself. */ - public AnalyzeTextOptions setTokenFilters(List tokenFilters) { - this.tokenFilters = tokenFilters; + public AnalyzeTextOptions setTokenFilters(TokenFilterName... tokenFilters) { + this.tokenFilters = (tokenFilters == null) ? null : Arrays.asList(tokenFilters); return this; } @@ -225,8 +227,8 @@ public List getCharFilters() { * @param charFilters the charFilters value to set. * @return the AnalyzeRequest object itself. */ - public AnalyzeTextOptions setCharFilters(List charFilters) { - this.charFilters = charFilters; + public AnalyzeTextOptions setCharFilters(CharFilterName... charFilters) { + this.charFilters = (charFilters == null) ? null : Arrays.asList(charFilters); return this; } } diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/CjkBigramTokenFilter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/CjkBigramTokenFilter.java index 65d3b31763e9c..9df7360dac2fd 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/CjkBigramTokenFilter.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/CjkBigramTokenFilter.java @@ -6,8 +6,11 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; + +import java.util.Arrays; import java.util.List; /** @@ -58,6 +61,18 @@ public List getIgnoreScripts() { * @param ignoreScripts the ignoreScripts value to set. * @return the CjkBigramTokenFilter object itself. */ + public CjkBigramTokenFilter setIgnoreScripts(CjkBigramTokenFilterScripts... ignoreScripts) { + this.ignoreScripts = (ignoreScripts == null) ? null : Arrays.asList(ignoreScripts); + return this; + } + + /** + * Set the ignoreScripts property: The scripts to ignore. + * + * @param ignoreScripts the ignoreScripts value to set. + * @return the CjkBigramTokenFilter object itself. + */ + @JsonSetter public CjkBigramTokenFilter setIgnoreScripts(List ignoreScripts) { this.ignoreScripts = ignoreScripts; return this; diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/CustomAnalyzer.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/CustomAnalyzer.java index e6bab959e9fd3..a5295162b8512 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/CustomAnalyzer.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/CustomAnalyzer.java @@ -5,8 +5,11 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; + +import java.util.Arrays; import java.util.List; /** @@ -102,6 +105,21 @@ public List getTokenFilters() { * @param tokenFilters the tokenFilters value to set. * @return the CustomAnalyzer object itself. */ + public CustomAnalyzer setTokenFilters(TokenFilterName... tokenFilters) { + this.tokenFilters = (tokenFilters == null) ? null : Arrays.asList(tokenFilters); + return this; + } + + /** + * Set the tokenFilters property: A list of token filters used to filter + * out or modify the tokens generated by a tokenizer. For example, you can + * specify a lowercase filter that converts all characters to lowercase. + * The filters are run in the order in which they are listed. + * + * @param tokenFilters the tokenFilters value to set. + * @return the CustomAnalyzer object itself. + */ + @JsonSetter public CustomAnalyzer setTokenFilters(List tokenFilters) { this.tokenFilters = tokenFilters; return this; @@ -128,6 +146,21 @@ public List getCharFilters() { * @param charFilters the charFilters value to set. * @return the CustomAnalyzer object itself. */ + public CustomAnalyzer setCharFilters(CharFilterName... charFilters) { + this.charFilters = (charFilters == null) ? null : Arrays.asList(charFilters); + return this; + } + + /** + * Set the charFilters property: A list of character filters used to + * prepare input text before it is processed by the tokenizer. For + * instance, they can replace certain characters or symbols. The filters + * are run in the order in which they are listed. + * + * @param charFilters the charFilters value to set. + * @return the CustomAnalyzer object itself. + */ + @JsonSetter public CustomAnalyzer setCharFilters(List charFilters) { this.charFilters = charFilters; return this; diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/EdgeNGramTokenizer.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/EdgeNGramTokenizer.java index 67fed3cf4f004..25ff7da874210 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/EdgeNGramTokenizer.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/EdgeNGramTokenizer.java @@ -5,8 +5,11 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; + +import java.util.Arrays; import java.util.List; /** @@ -106,6 +109,18 @@ public List getTokenChars() { * @param tokenChars the tokenChars value to set. * @return the EdgeNGramTokenizer object itself. */ + public EdgeNGramTokenizer setTokenChars(TokenCharacterKind... tokenChars) { + this.tokenChars = (tokenChars == null) ? null : Arrays.asList(tokenChars); + return this; + } + + /** + * Set the tokenChars property: Character classes to keep in the tokens. + * + * @param tokenChars the tokenChars value to set. + * @return the EdgeNGramTokenizer object itself. + */ + @JsonSetter public EdgeNGramTokenizer setTokenChars(List tokenChars) { this.tokenChars = tokenChars; return this; diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/ElisionTokenFilter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/ElisionTokenFilter.java index 98dcbaa63db15..7384709790663 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/ElisionTokenFilter.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/ElisionTokenFilter.java @@ -5,8 +5,11 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; + +import java.util.Arrays; import java.util.List; /** @@ -49,6 +52,18 @@ public List getArticles() { * @param articles the articles value to set. * @return the ElisionTokenFilter object itself. */ + public ElisionTokenFilter setArticles(String... articles) { + this.articles = (articles == null) ? null : Arrays.asList(articles); + return this; + } + + /** + * Set the articles property: The set of articles to remove. + * + * @param articles the articles value to set. + * @return the ElisionTokenFilter object itself. + */ + @JsonSetter public ElisionTokenFilter setArticles(List articles) { this.articles = articles; return this; diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/EntityRecognitionSkill.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/EntityRecognitionSkill.java index d7cc6773e8641..5e572dad917e9 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/EntityRecognitionSkill.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/EntityRecognitionSkill.java @@ -5,8 +5,11 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; + +import java.util.Arrays; import java.util.List; /** @@ -76,6 +79,19 @@ public List getCategories() { * @param categories the categories value to set. * @return the EntityRecognitionSkill object itself. */ + public EntityRecognitionSkill setCategories(EntityCategory... categories) { + this.categories = (categories == null) ? null : Arrays.asList(categories); + return this; + } + + /** + * Set the categories property: A list of entity categories that should be + * extracted. + * + * @param categories the categories value to set. + * @return the EntityRecognitionSkill object itself. + */ + @JsonSetter public EntityRecognitionSkill setCategories(List categories) { this.categories = categories; return this; diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/ImageAnalysisSkill.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/ImageAnalysisSkill.java index 45eea7cd1fe2c..e86bd6c40f5a8 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/ImageAnalysisSkill.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/ImageAnalysisSkill.java @@ -5,8 +5,11 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; + +import java.util.Arrays; import java.util.List; /** @@ -87,6 +90,18 @@ public List getVisualFeatures() { * @param visualFeatures the visualFeatures value to set. * @return the ImageAnalysisSkill object itself. */ + public ImageAnalysisSkill setVisualFeatures(VisualFeature... visualFeatures) { + this.visualFeatures = (visualFeatures == null) ? null : Arrays.asList(visualFeatures); + return this; + } + + /** + * Set the visualFeatures property: A list of visual features. + * + * @param visualFeatures the visualFeatures value to set. + * @return the ImageAnalysisSkill object itself. + */ + @JsonSetter public ImageAnalysisSkill setVisualFeatures(List visualFeatures) { this.visualFeatures = visualFeatures; return this; @@ -109,6 +124,19 @@ public List getDetails() { * @param details the details value to set. * @return the ImageAnalysisSkill object itself. */ + public ImageAnalysisSkill setDetails(ImageDetail... details) { + this.details = (details == null) ? null : Arrays.asList(details); + return this; + } + + /** + * Set the details property: A string indicating which domain-specific + * details to return. + * + * @param details the details value to set. + * @return the ImageAnalysisSkill object itself. + */ + @JsonSetter public ImageAnalysisSkill setDetails(List details) { this.details = details; return this; diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/InputFieldMappingEntry.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/InputFieldMappingEntry.java index 27cf9378ef8c8..6d3b3d1786dbb 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/InputFieldMappingEntry.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/InputFieldMappingEntry.java @@ -6,6 +6,9 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; + +import java.util.Arrays; import java.util.List; /** @@ -115,6 +118,19 @@ public List getInputs() { * @param inputs the inputs value to set. * @return the InputFieldMappingEntry object itself. */ + public InputFieldMappingEntry setInputs(InputFieldMappingEntry... inputs) { + this.inputs = (inputs == null) ? null : Arrays.asList(inputs); + return this; + } + + /** + * Set the inputs property: The recursive inputs used when creating a + * complex type. + * + * @param inputs the inputs value to set. + * @return the InputFieldMappingEntry object itself. + */ + @JsonSetter public InputFieldMappingEntry setInputs(List inputs) { this.inputs = inputs; return this; diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/LuceneStandardAnalyzer.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/LuceneStandardAnalyzer.java index da9e445230dcd..e1bc743ff11d6 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/LuceneStandardAnalyzer.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/LuceneStandardAnalyzer.java @@ -6,8 +6,11 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; + +import java.util.Arrays; import java.util.List; /** @@ -83,6 +86,18 @@ public List getStopwords() { * @param stopwords the stopwords value to set. * @return the LuceneStandardAnalyzer object itself. */ + public LuceneStandardAnalyzer setStopwords(String... stopwords) { + this.stopwords = (stopwords == null) ? null : Arrays.asList(stopwords); + return this; + } + + /** + * Set the stopwords property: A list of stopwords. + * + * @param stopwords the stopwords value to set. + * @return the LuceneStandardAnalyzer object itself. + */ + @JsonSetter public LuceneStandardAnalyzer setStopwords(List stopwords) { this.stopwords = stopwords; return this; diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/NGramTokenizer.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/NGramTokenizer.java index fb2bcf1519f6c..218e63130f086 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/NGramTokenizer.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/NGramTokenizer.java @@ -5,8 +5,11 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; + +import java.util.Arrays; import java.util.List; /** @@ -106,6 +109,18 @@ public List getTokenChars() { * @param tokenChars the tokenChars value to set. * @return the NGramTokenizer object itself. */ + public NGramTokenizer setTokenChars(TokenCharacterKind... tokenChars) { + this.tokenChars = (tokenChars == null) ? null : Arrays.asList(tokenChars); + return this; + } + + /** + * Set the tokenChars property: Character classes to keep in the tokens. + * + * @param tokenChars the tokenChars value to set. + * @return the NGramTokenizer object itself. + */ + @JsonSetter public NGramTokenizer setTokenChars(List tokenChars) { this.tokenChars = tokenChars; return this; diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/PatternAnalyzer.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/PatternAnalyzer.java index 7e76909eb019f..be1ac6348ec31 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/PatternAnalyzer.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/PatternAnalyzer.java @@ -5,9 +5,11 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.Arrays; import java.util.List; /** @@ -115,6 +117,18 @@ public List getFlags() { * @param flags the flags value to set. * @return the PatternAnalyzer object itself. */ + public PatternAnalyzer setFlags(RegexFlags... flags) { + this.flags = (flags == null) ? null : Arrays.asList(flags); + return this; + } + + /** + * Set the flags property: Regular expression flags. + * + * @param flags the flags value to set. + * @return the PatternAnalyzer object itself. + */ + @JsonSetter public PatternAnalyzer setFlags(List flags) { this.flags = flags; return this; @@ -135,6 +149,18 @@ public List getStopwords() { * @param stopwords the stopwords value to set. * @return the PatternAnalyzer object itself. */ + public PatternAnalyzer setStopwords(String... stopwords) { + this.stopwords = (stopwords == null) ? null : Arrays.asList(stopwords); + return this; + } + + /** + * Set the stopwords property: A list of stopwords. + * + * @param stopwords the stopwords value to set. + * @return the PatternAnalyzer object itself. + */ + @JsonSetter public PatternAnalyzer setStopwords(List stopwords) { this.stopwords = stopwords; return this; diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/PatternTokenizer.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/PatternTokenizer.java index 3b685f78a23f4..03f3842f9a37c 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/PatternTokenizer.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/PatternTokenizer.java @@ -5,9 +5,11 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.Arrays; import java.util.List; /** @@ -90,6 +92,18 @@ public List getFlags() { * @param flags the flags value to set. * @return the PatternTokenizer object itself. */ + public PatternTokenizer setFlags(RegexFlags... flags) { + this.flags = (flags == null) ? null : Arrays.asList(flags); + return this; + } + + /** + * Set the flags property: Regular expression flags. + * + * @param flags the flags value to set. + * @return the PatternTokenizer object itself. + */ + @JsonSetter public PatternTokenizer setFlags(List flags) { this.flags = flags; return this; diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/ScoringProfile.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/ScoringProfile.java index 750a97cfcb901..c07e1aee07180 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/ScoringProfile.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/ScoringProfile.java @@ -6,6 +6,9 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; + +import java.util.Arrays; import java.util.List; /** @@ -100,6 +103,19 @@ public List getFunctions() { * @param functions the functions value to set. * @return the ScoringProfile object itself. */ + public ScoringProfile setFunctions(ScoringFunction... functions) { + this.functions = (functions == null) ? null : Arrays.asList(functions); + return this; + } + + /** + * Set the functions property: The collection of functions that influence + * the scoring of documents. + * + * @param functions the functions value to set. + * @return the ScoringProfile object itself. + */ + @JsonSetter public ScoringProfile setFunctions(List functions) { this.functions = functions; return this; diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/SearchField.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/SearchField.java index 130aaef4938be..64b5d61ce0e0a 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/SearchField.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/SearchField.java @@ -7,6 +7,9 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; + +import java.util.Arrays; import java.util.List; /** @@ -683,6 +686,24 @@ public List getSynonymMapNames() { * @param synonymMapNames the synonymMap names to set. * @return the SearchField object itself. */ + public SearchField setSynonymMapNames(String... synonymMapNames) { + this.synonymMapNames = (synonymMapNames == null) ? null : Arrays.asList(synonymMapNames); + return this; + } + + /** + * Set the synonymMaps property: A list of the names of synonym maps to + * associate with this field. This option can be used only with searchable + * fields. Currently only one synonym map per field is supported. Assigning + * a synonym map to a field ensures that query terms targeting that field + * are expanded at query-time using the rules in the synonym map. This + * attribute can be changed on existing fields. Must be null or an empty + * collection for complex fields. + * + * @param synonymMapNames the synonymMap names to set. + * @return the SearchField object itself. + */ + @JsonSetter public SearchField setSynonymMapNames(List synonymMapNames) { this.synonymMapNames = synonymMapNames; return this; @@ -707,6 +728,20 @@ public List getFields() { * @param fields the fields value to set. * @return the SearchField object itself. */ + public SearchField setFields(SearchField... fields) { + this.fields = (fields == null) ? null : Arrays.asList(fields); + return this; + } + + /** + * Set the fields property: A list of sub-fields if this is a field of type + * Edm.ComplexType or Collection(Edm.ComplexType). Must be null or empty + * for simple fields. + * + * @param fields the fields value to set. + * @return the SearchField object itself. + */ + @JsonSetter public SearchField setFields(List fields) { this.fields = fields; return this; diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/SearchIndex.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/SearchIndex.java index 769a2d6774120..6d20056eb0430 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/SearchIndex.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/SearchIndex.java @@ -6,6 +6,9 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; + +import java.util.Arrays; import java.util.List; /** @@ -152,6 +155,18 @@ public List getFields() { * @param fields the fields value to set. * @return the SearchIndex object itself. */ + public SearchIndex setFields(SearchField... fields) { + this.fields = (fields == null) ? null : Arrays.asList(fields); + return this; + } + + /** + * Set the fields property: The fields of the index. + * + * @param fields the fields value to set. + * @return the SearchIndex object itself. + */ + @JsonSetter public SearchIndex setFields(List fields) { this.fields = fields; return this; @@ -172,6 +187,18 @@ public List getScoringProfiles() { * @param scoringProfiles the scoringProfiles value to set. * @return the SearchIndex object itself. */ + public SearchIndex setScoringProfiles(ScoringProfile... scoringProfiles) { + this.scoringProfiles = (scoringProfiles == null) ? null : Arrays.asList(scoringProfiles); + return this; + } + + /** + * Set the scoringProfiles property: The scoring profiles for the index. + * + * @param scoringProfiles the scoringProfiles value to set. + * @return the SearchIndex object itself. + */ + @JsonSetter public SearchIndex setScoringProfiles(List scoringProfiles) { this.scoringProfiles = scoringProfiles; return this; @@ -240,6 +267,18 @@ public List getSuggesters() { * @param suggesters the suggesters value to set. * @return the SearchIndex object itself. */ + public SearchIndex setSuggesters(SearchSuggester... suggesters) { + this.suggesters = (suggesters == null) ? null : Arrays.asList(suggesters); + return this; + } + + /** + * Set the suggesters property: The suggesters for the index. + * + * @param suggesters the suggesters value to set. + * @return the SearchIndex object itself. + */ + @JsonSetter public SearchIndex setSuggesters(List suggesters) { this.suggesters = suggesters; return this; @@ -260,6 +299,18 @@ public List getAnalyzers() { * @param analyzers the analyzers value to set. * @return the SearchIndex object itself. */ + public SearchIndex setAnalyzers(LexicalAnalyzer... analyzers) { + this.analyzers = (analyzers == null) ? null : Arrays.asList(analyzers); + return this; + } + + /** + * Set the analyzers property: The analyzers for the index. + * + * @param analyzers the analyzers value to set. + * @return the SearchIndex object itself. + */ + @JsonSetter public SearchIndex setAnalyzers(List analyzers) { this.analyzers = analyzers; return this; @@ -280,6 +331,18 @@ public List getTokenizers() { * @param tokenizers the tokenizers value to set. * @return the SearchIndex object itself. */ + public SearchIndex setTokenizers(LexicalTokenizer... tokenizers) { + this.tokenizers = (tokenizers == null) ? null : Arrays.asList(tokenizers); + return this; + } + + /** + * Set the tokenizers property: The tokenizers for the index. + * + * @param tokenizers the tokenizers value to set. + * @return the SearchIndex object itself. + */ + @JsonSetter public SearchIndex setTokenizers(List tokenizers) { this.tokenizers = tokenizers; return this; @@ -300,6 +363,18 @@ public List getTokenFilters() { * @param tokenFilters the tokenFilters value to set. * @return the SearchIndex object itself. */ + public SearchIndex setTokenFilters(TokenFilter... tokenFilters) { + this.tokenFilters = (tokenFilters == null) ? null : Arrays.asList(tokenFilters); + return this; + } + + /** + * Set the tokenFilters property: The token filters for the index. + * + * @param tokenFilters the tokenFilters value to set. + * @return the SearchIndex object itself. + */ + @JsonSetter public SearchIndex setTokenFilters(List tokenFilters) { this.tokenFilters = tokenFilters; return this; @@ -320,6 +395,18 @@ public List getCharFilters() { * @param charFilters the charFilters value to set. * @return the SearchIndex object itself. */ + public SearchIndex setCharFilters(CharFilter... charFilters) { + this.charFilters = (charFilters == null) ? null : Arrays.asList(charFilters); + return this; + } + + /** + * Set the charFilters property: The character filters for the index. + * + * @param charFilters the charFilters value to set. + * @return the SearchIndex object itself. + */ + @JsonSetter public SearchIndex setCharFilters(List charFilters) { this.charFilters = charFilters; return this; diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/SearchIndexer.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/SearchIndexer.java index 58d0fc9e5fc92..9a46b807fb4e5 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/SearchIndexer.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/SearchIndexer.java @@ -6,6 +6,9 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; + +import java.util.Arrays; import java.util.List; /** @@ -259,6 +262,19 @@ public List getFieldMappings() { * @param fieldMappings the fieldMappings value to set. * @return the SearchIndexer object itself. */ + public SearchIndexer setFieldMappings(FieldMapping... fieldMappings) { + this.fieldMappings = (fieldMappings == null) ? null : Arrays.asList(fieldMappings); + return this; + } + + /** + * Set the fieldMappings property: Defines mappings between fields in the + * data source and corresponding target fields in the index. + * + * @param fieldMappings the fieldMappings value to set. + * @return the SearchIndexer object itself. + */ + @JsonSetter public SearchIndexer setFieldMappings(List fieldMappings) { this.fieldMappings = fieldMappings; return this; @@ -281,6 +297,19 @@ public List getOutputFieldMappings() { * @param outputFieldMappings the outputFieldMappings value to set. * @return the SearchIndexer object itself. */ + public SearchIndexer setOutputFieldMappings(FieldMapping... outputFieldMappings) { + this.outputFieldMappings = (outputFieldMappings == null) ? null : Arrays.asList(outputFieldMappings); + return this; + } + + /** + * Set the outputFieldMappings property: Output field mappings are applied + * after enrichment and immediately before indexing. + * + * @param outputFieldMappings the outputFieldMappings value to set. + * @return the SearchIndexer object itself. + */ + @JsonSetter public SearchIndexer setOutputFieldMappings(List outputFieldMappings) { this.outputFieldMappings = outputFieldMappings; return this; diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/SearchIndexerSkillset.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/SearchIndexerSkillset.java index 6283f51f19439..ed51441127363 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/SearchIndexerSkillset.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/SearchIndexerSkillset.java @@ -6,6 +6,9 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; + +import java.util.Arrays; import java.util.List; /** @@ -110,6 +113,18 @@ public List getSkills() { * @param skills the skills value to set. * @return the SearchIndexerSkillset object itself. */ + public SearchIndexerSkillset setSkills(SearchIndexerSkill... skills) { + this.skills = (skills == null) ? null : Arrays.asList(skills); + return this; + } + + /** + * Set the skills property: A list of skills in the skillset. + * + * @param skills the skills value to set. + * @return the SearchIndexerSkillset object itself. + */ + @JsonSetter public SearchIndexerSkillset setSkills(List skills) { this.skills = skills; return this; diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/StopAnalyzer.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/StopAnalyzer.java index 98d10d80a5ed4..34cd38efd1237 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/StopAnalyzer.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/StopAnalyzer.java @@ -5,8 +5,11 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; + +import java.util.Arrays; import java.util.List; /** @@ -49,6 +52,18 @@ public List getStopwords() { * @param stopwords the stopwords value to set. * @return the StopAnalyzer object itself. */ + public StopAnalyzer setStopwords(String... stopwords) { + this.stopwords = (stopwords == null) ? null : Arrays.asList(stopwords); + return this; + } + + /** + * Set the stopwords property: A list of stopwords. + * + * @param stopwords the stopwords value to set. + * @return the StopAnalyzer object itself. + */ + @JsonSetter public StopAnalyzer setStopwords(List stopwords) { this.stopwords = stopwords; return this; diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/StopwordsTokenFilter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/StopwordsTokenFilter.java index 4cddb34d8d5e7..d7179cd3706ac 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/StopwordsTokenFilter.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/StopwordsTokenFilter.java @@ -5,8 +5,11 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; + +import java.util.Arrays; import java.util.List; /** @@ -78,6 +81,19 @@ public List getStopwords() { * @param stopwords the stopwords value to set. * @return the StopwordsTokenFilter object itself. */ + public StopwordsTokenFilter setStopwords(String... stopwords) { + this.stopwords = (stopwords == null) ? null : Arrays.asList(stopwords); + return this; + } + + /** + * Set the stopwords property: The list of stopwords. This property and the + * stopwords list property cannot both be set. + * + * @param stopwords the stopwords value to set. + * @return the StopwordsTokenFilter object itself. + */ + @JsonSetter public StopwordsTokenFilter setStopwords(List stopwords) { this.stopwords = stopwords; return this; diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/WordDelimiterTokenFilter.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/WordDelimiterTokenFilter.java index 99a66624dd1f0..aed639ef9c559 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/WordDelimiterTokenFilter.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/WordDelimiterTokenFilter.java @@ -5,8 +5,11 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; + +import java.util.Arrays; import java.util.List; /** @@ -329,6 +332,19 @@ public List getProtectedWords() { * @param protectedWords the protectedWords value to set. * @return the WordDelimiterTokenFilter object itself. */ + public WordDelimiterTokenFilter setProtectedWords(String... protectedWords) { + this.protectedWords = (protectedWords == null) ? null : Arrays.asList(protectedWords); + return this; + } + + /** + * Set the protectedWords property: A list of tokens to protect from being + * delimited. + * + * @param protectedWords the protectedWords value to set. + * @return the WordDelimiterTokenFilter object itself. + */ + @JsonSetter public WordDelimiterTokenFilter setProtectedWords(List protectedWords) { this.protectedWords = protectedWords; return this; diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/AutocompleteOptions.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/AutocompleteOptions.java index 37bf316d380b1..482d69a7c1d04 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/AutocompleteOptions.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/AutocompleteOptions.java @@ -254,7 +254,7 @@ public List getSearchFields() { * @return the AutocompleteOptions object itself. */ public AutocompleteOptions setSearchFields(String... searchFields) { - this.searchFields = Arrays.asList(searchFields); + this.searchFields = (searchFields == null) ? null : Arrays.asList(searchFields); return this; } diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/SearchOptions.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/SearchOptions.java index 8066adabd8291..196505ee8d10f 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/SearchOptions.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/SearchOptions.java @@ -193,7 +193,7 @@ public List getFacets() { * @return the SearchOptions object itself. */ public SearchOptions setFacets(String... facets) { - this.facets = Arrays.asList(facets); + this.facets = (facets == null) ? null : Arrays.asList(facets); return this; } @@ -237,7 +237,7 @@ public List getHighlightFields() { * @return the SearchOptions object itself. */ public SearchOptions setHighlightFields(String... highlightFields) { - this.highlightFields = Arrays.asList(highlightFields); + this.highlightFields = (highlightFields == null) ? null : Arrays.asList(highlightFields); return this; } @@ -347,7 +347,7 @@ public List getOrderBy() { * @return the SearchOptions object itself. */ public SearchOptions setOrderBy(String... orderBy) { - this.orderBy = Arrays.asList(orderBy); + this.orderBy = (orderBy == null) ? null : Arrays.asList(orderBy); return this; } @@ -399,7 +399,7 @@ public List getScoringParameters() { * @return the SearchOptions object itself. */ public SearchOptions setScoringParameters(ScoringParameter... scoringParameters) { - this.scoringParameters = Arrays.asList(scoringParameters); + this.scoringParameters = (scoringParameters == null) ? null : Arrays.asList(scoringParameters); return this; } @@ -451,7 +451,7 @@ public List getSearchFields() { * @return the SearchOptions object itself. */ public SearchOptions setSearchFields(String... searchFields) { - this.searchFields = Arrays.asList(searchFields); + this.searchFields = (searchFields == null) ? null : Arrays.asList(searchFields); return this; } @@ -497,7 +497,7 @@ public List getSelect() { * @return the SearchOptions object itself. */ public SearchOptions setSelect(String... select) { - this.select = Arrays.asList(select); + this.select = (select == null) ? null : Arrays.asList(select); return this; } diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/SuggestOptions.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/SuggestOptions.java index 4707580e2eb79..7268718ed8860 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/SuggestOptions.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/SuggestOptions.java @@ -248,7 +248,7 @@ public List getOrderBy() { * @return the SuggestOptions object itself. */ public SuggestOptions setOrderBy(String... orderBy) { - this.orderBy = Arrays.asList(orderBy); + this.orderBy = (orderBy == null) ? null : Arrays.asList(orderBy); return this; } @@ -272,7 +272,7 @@ public List getSearchFields() { * @return the SuggestOptions object itself. */ public SuggestOptions setSearchFields(String... searchFields) { - this.searchFields = Arrays.asList(searchFields); + this.searchFields = (searchFields == null) ? null : Arrays.asList(searchFields); return this; } @@ -294,7 +294,7 @@ public List getSelect() { * @return the SuggestOptions object itself. */ public SuggestOptions setSelect(String... select) { - this.select = Arrays.asList(select); + this.select = (select == null) ? null : Arrays.asList(select); return this; } diff --git a/sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/IndexAndServiceStatisticsExample.java b/sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/IndexAndServiceStatisticsExample.java index 3decd86005dff..186cd82606344 100644 --- a/sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/IndexAndServiceStatisticsExample.java +++ b/sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/IndexAndServiceStatisticsExample.java @@ -42,8 +42,8 @@ public class IndexAndServiceStatisticsExample { /** - * From the Azure portal, get your Azure Cognitive Search service name and API key and - * populate ADMIN_KEY and SEARCH_SERVICE_NAME. + * From the Azure portal, get your Azure Cognitive Search service name and API key and populate ADMIN_KEY and + * SEARCH_SERVICE_NAME. */ private static final String ENDPOINT = Configuration.getGlobalConfiguration().get("AZURE_COGNITIVE_SEARCH_ENDPOINT"); private static final String ADMIN_KEY = Configuration.getGlobalConfiguration().get("AZURE_COGNITIVE_SEARCH_ADMIN_KEY"); @@ -286,8 +286,7 @@ private static SearchIndex createTestIndex() { .setScoringProfiles(Arrays.asList( new ScoringProfile("MyProfile") .setFunctionAggregation(ScoringFunctionAggregation.AVERAGE) - .setFunctions(Arrays.asList( - new MagnitudeScoringFunction("Rating", 2.0, + .setFunctions(new MagnitudeScoringFunction("Rating", 2.0, new MagnitudeScoringParameters(1, 4) .setShouldBoostBeyondRangeByConstant(true)) .setInterpolation(ScoringFunctionInterpolation.CONSTANT), @@ -297,36 +296,30 @@ private static SearchIndex createTestIndex() { new FreshnessScoringFunction("LastRenovationDate", 1.1, new FreshnessScoringParameters(Duration.ofDays(365))) .setInterpolation(ScoringFunctionInterpolation.LOGARITHMIC) - )) + ) .setTextWeights(new TextWeights(weights)), new ScoringProfile("ProfileTwo") .setFunctionAggregation(ScoringFunctionAggregation.MAXIMUM) - .setFunctions(Collections.singletonList( - new TagScoringFunction("Tags", 1.5, new TagScoringParameters("MyTags")) - .setInterpolation(ScoringFunctionInterpolation.LINEAR) - )), + .setFunctions(new TagScoringFunction("Tags", 1.5, new TagScoringParameters("MyTags")) + .setInterpolation(ScoringFunctionInterpolation.LINEAR) + ), new ScoringProfile("ProfileThree") .setFunctionAggregation(ScoringFunctionAggregation.MINIMUM) - .setFunctions(Collections.singletonList( - new MagnitudeScoringFunction("Rating", 3.0, - new MagnitudeScoringParameters(0, 10) + .setFunctions(new MagnitudeScoringFunction("Rating", 3.0, + new MagnitudeScoringParameters(0, 10) .setShouldBoostBeyondRangeByConstant(false)) - .setInterpolation(ScoringFunctionInterpolation.QUADRATIC) - )), + .setInterpolation(ScoringFunctionInterpolation.QUADRATIC) + ), new ScoringProfile("ProfileFour") .setFunctionAggregation(ScoringFunctionAggregation.FIRST_MATCHING) - .setFunctions(Collections.singletonList( - new MagnitudeScoringFunction("Rating", 3.14, - new MagnitudeScoringParameters(1, 5) + .setFunctions(new MagnitudeScoringFunction("Rating", 3.14, + new MagnitudeScoringParameters(1, 5) .setShouldBoostBeyondRangeByConstant(false)) - .setInterpolation(ScoringFunctionInterpolation.CONSTANT) - )) - )) + .setInterpolation(ScoringFunctionInterpolation.CONSTANT)))) .setDefaultScoringProfile("MyProfile") .setCorsOptions(new CorsOptions(Arrays.asList("http://tempuri.org", "http://localhost:80")) .setMaxAgeInSeconds(60L)) - .setSuggesters(Collections.singletonList(new SearchSuggester("FancySuggester", - Collections.singletonList("HotelName")))); + .setSuggesters(new SearchSuggester("FancySuggester", Collections.singletonList("HotelName"))); } /** diff --git a/sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/RefineSearchCapabilitiesExample.java b/sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/RefineSearchCapabilitiesExample.java index 2c1ccc0ab7be6..88ce4b28826b5 100644 --- a/sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/RefineSearchCapabilitiesExample.java +++ b/sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/RefineSearchCapabilitiesExample.java @@ -129,7 +129,7 @@ private static void addSynonymMapToIndex(SearchIndexClient client) { SearchIndex index = client.getIndex(INDEX_NAME); List fields = index.getFields(); - fields.get(1).setSynonymMapNames(Collections.singletonList(synonymMapName)); + fields.get(1).setSynonymMapNames(synonymMapName); index.setFields(fields); client.createOrUpdateIndex(index); diff --git a/sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/SynonymMapsCreateExample.java b/sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/SynonymMapsCreateExample.java index 09dd900c513db..a18cb4d807cff 100644 --- a/sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/SynonymMapsCreateExample.java +++ b/sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/SynonymMapsCreateExample.java @@ -13,7 +13,6 @@ import com.azure.search.documents.indexes.models.SynonymMap; import java.util.Arrays; -import java.util.Collections; /** * This example shows how to create an index with a synonym map @@ -59,7 +58,7 @@ private static void assignSynonymMapToIndex(String synonymMapName) { new SearchField("HotelId", SearchFieldDataType.STRING) .setKey(true), new SearchField("HotelName", SearchFieldDataType.STRING) - .setSynonymMapNames(Collections.singletonList(synonymMapName)) + .setSynonymMapNames(synonymMapName) )); } } diff --git a/sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/indexes/LifecycleSetupExample.java b/sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/indexes/LifecycleSetupExample.java index e5b6d8c8a8b87..c6acd454d1b88 100644 --- a/sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/indexes/LifecycleSetupExample.java +++ b/sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/indexes/LifecycleSetupExample.java @@ -167,8 +167,7 @@ private static SearchIndex createIndex(SearchIndexClient client) { SearchIndex index = new SearchIndex(INDEX_NAME, fields); // Set Suggester - index.setSuggesters(Collections.singletonList(new SearchSuggester(SUGGESTER_NAME, - Collections.singletonList("Tags")))); + index.setSuggesters(new SearchSuggester(SUGGESTER_NAME, Collections.singletonList("Tags"))); return client.createOrUpdateIndex(index); } diff --git a/sdk/search/azure-search-documents/src/test/java/com/azure/search/documents/IndexingSyncTests.java b/sdk/search/azure-search-documents/src/test/java/com/azure/search/documents/IndexingSyncTests.java index e4e1a084bb13d..0659cf655c693 100644 --- a/sdk/search/azure-search-documents/src/test/java/com/azure/search/documents/IndexingSyncTests.java +++ b/sdk/search/azure-search-documents/src/test/java/com/azure/search/documents/IndexingSyncTests.java @@ -333,9 +333,7 @@ public void indexWithInvalidDocumentThrowsException() { public void canUseIndexWithReservedName() { String indexName = "prototype"; SearchIndex indexWithReservedName = new SearchIndex(indexName) - .setFields(Collections.singletonList(new SearchField("ID", SearchFieldDataType.STRING) - .setKey(Boolean.TRUE) - )); + .setFields(new SearchField("ID", SearchFieldDataType.STRING).setKey(Boolean.TRUE)); SearchIndexClient searchIndexClient = getSearchIndexClientBuilder().buildClient(); searchIndexClient.createOrUpdateIndex(indexWithReservedName); diff --git a/sdk/search/azure-search-documents/src/test/java/com/azure/search/documents/SearchSyncTests.java b/sdk/search/azure-search-documents/src/test/java/com/azure/search/documents/SearchSyncTests.java index 3498f1e130122..189640b882789 100644 --- a/sdk/search/azure-search-documents/src/test/java/com/azure/search/documents/SearchSyncTests.java +++ b/sdk/search/azure-search-documents/src/test/java/com/azure/search/documents/SearchSyncTests.java @@ -753,7 +753,7 @@ public void canSearchWithSynonyms() { SearchIndex hotelsIndex = searchIndexClient.getIndex(client.getIndexName()); hotelsIndex.getFields().stream() .filter(f -> fieldName.equals(f.getName())) - .findFirst().get().setSynonymMapNames(Collections.singletonList(synonymMapToDelete)); + .findFirst().get().setSynonymMapNames(synonymMapToDelete); // Update the index with the SynonymMap searchIndexClient.createOrUpdateIndex(hotelsIndex); diff --git a/sdk/search/azure-search-documents/src/test/java/com/azure/search/documents/SearchTestBase.java b/sdk/search/azure-search-documents/src/test/java/com/azure/search/documents/SearchTestBase.java index a4b3d6fc0703d..883877dcba9d9 100644 --- a/sdk/search/azure-search-documents/src/test/java/com/azure/search/documents/SearchTestBase.java +++ b/sdk/search/azure-search-documents/src/test/java/com/azure/search/documents/SearchTestBase.java @@ -197,187 +197,168 @@ protected SearchIndex createTestIndex(String indexName) { weights.put("Category", 2.0); String searchIndexName = indexName == null ? randomIndexName(HOTEL_INDEX_NAME) : indexName; return new SearchIndex(searchIndexName, Arrays.asList( - new SearchField("HotelId", SearchFieldDataType.STRING) - .setKey(Boolean.TRUE) - .setFilterable(Boolean.TRUE) - .setSortable(Boolean.TRUE) - .setFacetable(Boolean.TRUE) - .setHidden(Boolean.FALSE), - new SearchField("HotelName", SearchFieldDataType.STRING) - .setSearchable(Boolean.TRUE) - .setFilterable(Boolean.TRUE) - .setSortable(Boolean.TRUE) - .setHidden(Boolean.FALSE), - new SearchField("Description", SearchFieldDataType.STRING) - .setSearchable(Boolean.TRUE) - .setAnalyzerName(LexicalAnalyzerName.EN_LUCENE) - .setHidden(Boolean.FALSE), - new SearchField("DescriptionFr", SearchFieldDataType.STRING) - .setSearchable(Boolean.TRUE) - .setAnalyzerName(LexicalAnalyzerName.FR_LUCENE) - .setHidden(Boolean.FALSE), - new SearchField("Description_Custom", SearchFieldDataType.STRING) - .setSearchable(Boolean.TRUE) - .setSearchAnalyzerName(LexicalAnalyzerName.STOP) - .setIndexAnalyzerName(LexicalAnalyzerName.STOP) - .setHidden(Boolean.FALSE), - new SearchField("Category", SearchFieldDataType.STRING) - .setSearchable(Boolean.TRUE) - .setFilterable(Boolean.TRUE) - .setSortable(Boolean.TRUE) - .setFacetable(Boolean.TRUE) - .setHidden(Boolean.FALSE), - new SearchField("Tags", SearchFieldDataType.collection(SearchFieldDataType.STRING)) - .setSearchable(Boolean.TRUE) - .setFilterable(Boolean.TRUE) - .setFacetable(Boolean.TRUE) - .setHidden(Boolean.FALSE), - new SearchField("ParkingIncluded", SearchFieldDataType.BOOLEAN) - .setFilterable(Boolean.TRUE) - .setSortable(Boolean.TRUE) - .setFacetable(Boolean.TRUE) - .setHidden(Boolean.FALSE), - new SearchField("SmokingAllowed", SearchFieldDataType.BOOLEAN) - .setFilterable(Boolean.TRUE) - .setSortable(Boolean.TRUE) - .setFacetable(Boolean.TRUE) - .setHidden(Boolean.FALSE), - new SearchField("LastRenovationDate", SearchFieldDataType.DATE_TIME_OFFSET) - .setFilterable(Boolean.TRUE) - .setSortable(Boolean.TRUE) - .setFacetable(Boolean.TRUE) - .setHidden(Boolean.FALSE), - new SearchField("Rating", SearchFieldDataType.INT32) - .setFilterable(Boolean.TRUE) - .setSortable(Boolean.TRUE) - .setFacetable(Boolean.TRUE) - .setHidden(Boolean.FALSE), - new SearchField("Address", SearchFieldDataType.COMPLEX) - .setFields(Arrays.asList( - new SearchField("StreetAddress", SearchFieldDataType.STRING) - .setSearchable(Boolean.TRUE) - .setHidden(Boolean.FALSE), - new SearchField("City", SearchFieldDataType.STRING) - .setSearchable(Boolean.TRUE) - .setFilterable(Boolean.TRUE) - .setSortable(Boolean.TRUE) - .setFacetable(Boolean.TRUE) - .setHidden(Boolean.FALSE), - new SearchField("StateProvince", SearchFieldDataType.STRING) - .setSearchable(Boolean.TRUE) - .setFilterable(Boolean.TRUE) - .setSortable(Boolean.TRUE) - .setFacetable(Boolean.TRUE) - .setHidden(Boolean.FALSE), - new SearchField("Country", SearchFieldDataType.STRING) - .setSearchable(Boolean.TRUE) - .setFilterable(Boolean.TRUE) - .setSortable(Boolean.TRUE) - .setFacetable(Boolean.TRUE) - .setHidden(Boolean.FALSE), - new SearchField("PostalCode", SearchFieldDataType.STRING) - .setSearchable(Boolean.TRUE) - .setFilterable(Boolean.TRUE) - .setSortable(Boolean.TRUE) - .setFacetable(Boolean.TRUE) - .setHidden(Boolean.FALSE) - ) - ), - new SearchField("Location", SearchFieldDataType.GEOGRAPHY_POINT) - .setFilterable(Boolean.TRUE) - .setSortable(Boolean.TRUE) - .setHidden(Boolean.FALSE), - new SearchField("Rooms", SearchFieldDataType.collection(SearchFieldDataType.COMPLEX)) - .setFields(Arrays.asList( - new SearchField("Description", SearchFieldDataType.STRING) - .setSearchable(Boolean.TRUE) - .setAnalyzerName(LexicalAnalyzerName.EN_LUCENE), - new SearchField("DescriptionFr", SearchFieldDataType.STRING) - .setSearchable(Boolean.TRUE) - .setAnalyzerName(LexicalAnalyzerName.FR_LUCENE) - .setHidden(Boolean.FALSE), - new SearchField("Type", SearchFieldDataType.STRING) - .setSearchable(Boolean.TRUE) - .setFilterable(Boolean.TRUE) - .setFacetable(Boolean.TRUE) - .setHidden(Boolean.FALSE), - new SearchField("BaseRate", SearchFieldDataType.DOUBLE) - .setKey(Boolean.FALSE) - .setFilterable(Boolean.TRUE) - .setFacetable(Boolean.TRUE) - .setHidden(Boolean.FALSE), - new SearchField("BedOptions", SearchFieldDataType.STRING) - .setSearchable(Boolean.TRUE) - .setFilterable(Boolean.TRUE) - .setFacetable(Boolean.TRUE) - .setHidden(Boolean.FALSE), - new SearchField("SleepsCount", SearchFieldDataType.INT32) - .setFilterable(Boolean.TRUE) - .setFacetable(Boolean.TRUE) - .setHidden(Boolean.FALSE), - new SearchField("SmokingAllowed", SearchFieldDataType.BOOLEAN) - .setFilterable(Boolean.TRUE) - .setFacetable(Boolean.TRUE) - .setHidden(Boolean.FALSE), - new SearchField("Tags", SearchFieldDataType.collection(SearchFieldDataType.STRING)) - .setSearchable(Boolean.TRUE) - .setFilterable(Boolean.TRUE) - .setFacetable(Boolean.TRUE) - .setHidden(Boolean.FALSE) - ) - ), - new SearchField("TotalGuests", SearchFieldDataType.INT64) - .setFilterable(Boolean.TRUE) - .setSortable(Boolean.TRUE) - .setFacetable(Boolean.TRUE), - new SearchField("ProfitMargin", SearchFieldDataType.DOUBLE) - ) - ) - .setScoringProfiles(Arrays.asList( - new ScoringProfile("MyProfile") - .setFunctionAggregation(ScoringFunctionAggregation.AVERAGE) - .setFunctions(Arrays.asList( - new MagnitudeScoringFunction("Rating", 2.0, - new MagnitudeScoringParameters(1, 4) - .setShouldBoostBeyondRangeByConstant(true)) - .setInterpolation(ScoringFunctionInterpolation.CONSTANT), - new DistanceScoringFunction("Location", 1.5, - new DistanceScoringParameters("Loc", 5)) - .setInterpolation(ScoringFunctionInterpolation.LINEAR), - new FreshnessScoringFunction("LastRenovationDate", 1.1, - new FreshnessScoringParameters(Duration.ofDays(365))) - .setInterpolation(ScoringFunctionInterpolation.LOGARITHMIC) - )) - .setTextWeights(new TextWeights(weights)), - new ScoringProfile("ProfileTwo") - .setFunctionAggregation(ScoringFunctionAggregation.MAXIMUM) - .setFunctions(Collections.singletonList( - new TagScoringFunction("Tags", 1.5, - new TagScoringParameters("MyTags")) - .setInterpolation(ScoringFunctionInterpolation.LINEAR) - )), - new ScoringProfile("ProfileThree") - .setFunctionAggregation(ScoringFunctionAggregation.MINIMUM) - .setFunctions(Collections.singletonList( - new MagnitudeScoringFunction("Rating", 3.0, - new MagnitudeScoringParameters(0, 10) - .setShouldBoostBeyondRangeByConstant(false)) - .setInterpolation(ScoringFunctionInterpolation.QUADRATIC) - )), - new ScoringProfile("ProfileFour") - .setFunctionAggregation(ScoringFunctionAggregation.FIRST_MATCHING) - .setFunctions(Collections.singletonList( - new MagnitudeScoringFunction("Rating", 3.14, - new MagnitudeScoringParameters(1, 5) - .setShouldBoostBeyondRangeByConstant(false)) - .setInterpolation(ScoringFunctionInterpolation.CONSTANT) - )) - )) - .setDefaultScoringProfile("MyProfile") + new SearchField("HotelId", SearchFieldDataType.STRING) + .setKey(Boolean.TRUE) + .setFilterable(Boolean.TRUE) + .setSortable(Boolean.TRUE) + .setFacetable(Boolean.TRUE) + .setHidden(Boolean.FALSE), + new SearchField("HotelName", SearchFieldDataType.STRING) + .setSearchable(Boolean.TRUE) + .setFilterable(Boolean.TRUE) + .setSortable(Boolean.TRUE) + .setHidden(Boolean.FALSE), + new SearchField("Description", SearchFieldDataType.STRING) + .setSearchable(Boolean.TRUE) + .setAnalyzerName(LexicalAnalyzerName.EN_LUCENE) + .setHidden(Boolean.FALSE), + new SearchField("DescriptionFr", SearchFieldDataType.STRING) + .setSearchable(Boolean.TRUE) + .setAnalyzerName(LexicalAnalyzerName.FR_LUCENE) + .setHidden(Boolean.FALSE), + new SearchField("Description_Custom", SearchFieldDataType.STRING) + .setSearchable(Boolean.TRUE) + .setSearchAnalyzerName(LexicalAnalyzerName.STOP) + .setIndexAnalyzerName(LexicalAnalyzerName.STOP) + .setHidden(Boolean.FALSE), + new SearchField("Category", SearchFieldDataType.STRING) + .setSearchable(Boolean.TRUE) + .setFilterable(Boolean.TRUE) + .setSortable(Boolean.TRUE) + .setFacetable(Boolean.TRUE) + .setHidden(Boolean.FALSE), + new SearchField("Tags", SearchFieldDataType.collection(SearchFieldDataType.STRING)) + .setSearchable(Boolean.TRUE) + .setFilterable(Boolean.TRUE) + .setFacetable(Boolean.TRUE) + .setHidden(Boolean.FALSE), + new SearchField("ParkingIncluded", SearchFieldDataType.BOOLEAN) + .setFilterable(Boolean.TRUE) + .setSortable(Boolean.TRUE) + .setFacetable(Boolean.TRUE) + .setHidden(Boolean.FALSE), + new SearchField("SmokingAllowed", SearchFieldDataType.BOOLEAN) + .setFilterable(Boolean.TRUE) + .setSortable(Boolean.TRUE) + .setFacetable(Boolean.TRUE) + .setHidden(Boolean.FALSE), + new SearchField("LastRenovationDate", SearchFieldDataType.DATE_TIME_OFFSET) + .setFilterable(Boolean.TRUE) + .setSortable(Boolean.TRUE) + .setFacetable(Boolean.TRUE) + .setHidden(Boolean.FALSE), + new SearchField("Rating", SearchFieldDataType.INT32) + .setFilterable(Boolean.TRUE) + .setSortable(Boolean.TRUE) + .setFacetable(Boolean.TRUE) + .setHidden(Boolean.FALSE), + new SearchField("Address", SearchFieldDataType.COMPLEX) + .setFields(new SearchField("StreetAddress", SearchFieldDataType.STRING) + .setSearchable(Boolean.TRUE) + .setHidden(Boolean.FALSE), + new SearchField("City", SearchFieldDataType.STRING) + .setSearchable(Boolean.TRUE) + .setFilterable(Boolean.TRUE) + .setSortable(Boolean.TRUE) + .setFacetable(Boolean.TRUE) + .setHidden(Boolean.FALSE), + new SearchField("StateProvince", SearchFieldDataType.STRING) + .setSearchable(Boolean.TRUE) + .setFilterable(Boolean.TRUE) + .setSortable(Boolean.TRUE) + .setFacetable(Boolean.TRUE) + .setHidden(Boolean.FALSE), + new SearchField("Country", SearchFieldDataType.STRING) + .setSearchable(Boolean.TRUE) + .setFilterable(Boolean.TRUE) + .setSortable(Boolean.TRUE) + .setFacetable(Boolean.TRUE) + .setHidden(Boolean.FALSE), + new SearchField("PostalCode", SearchFieldDataType.STRING) + .setSearchable(Boolean.TRUE) + .setFilterable(Boolean.TRUE) + .setSortable(Boolean.TRUE) + .setFacetable(Boolean.TRUE) + .setHidden(Boolean.FALSE)), + new SearchField("Location", SearchFieldDataType.GEOGRAPHY_POINT) + .setFilterable(Boolean.TRUE) + .setSortable(Boolean.TRUE) + .setHidden(Boolean.FALSE), + new SearchField("Rooms", SearchFieldDataType.collection(SearchFieldDataType.COMPLEX)) + .setFields(new SearchField("Description", SearchFieldDataType.STRING) + .setSearchable(Boolean.TRUE) + .setAnalyzerName(LexicalAnalyzerName.EN_LUCENE), + new SearchField("DescriptionFr", SearchFieldDataType.STRING) + .setSearchable(Boolean.TRUE) + .setAnalyzerName(LexicalAnalyzerName.FR_LUCENE) + .setHidden(Boolean.FALSE), + new SearchField("Type", SearchFieldDataType.STRING) + .setSearchable(Boolean.TRUE) + .setFilterable(Boolean.TRUE) + .setFacetable(Boolean.TRUE) + .setHidden(Boolean.FALSE), + new SearchField("BaseRate", SearchFieldDataType.DOUBLE) + .setKey(Boolean.FALSE) + .setFilterable(Boolean.TRUE) + .setFacetable(Boolean.TRUE) + .setHidden(Boolean.FALSE), + new SearchField("BedOptions", SearchFieldDataType.STRING) + .setSearchable(Boolean.TRUE) + .setFilterable(Boolean.TRUE) + .setFacetable(Boolean.TRUE) + .setHidden(Boolean.FALSE), + new SearchField("SleepsCount", SearchFieldDataType.INT32) + .setFilterable(Boolean.TRUE) + .setFacetable(Boolean.TRUE) + .setHidden(Boolean.FALSE), + new SearchField("SmokingAllowed", SearchFieldDataType.BOOLEAN) + .setFilterable(Boolean.TRUE) + .setFacetable(Boolean.TRUE) + .setHidden(Boolean.FALSE), + new SearchField("Tags", SearchFieldDataType.collection(SearchFieldDataType.STRING)) + .setSearchable(Boolean.TRUE) + .setFilterable(Boolean.TRUE) + .setFacetable(Boolean.TRUE) + .setHidden(Boolean.FALSE)), + new SearchField("TotalGuests", SearchFieldDataType.INT64) + .setFilterable(Boolean.TRUE) + .setSortable(Boolean.TRUE) + .setFacetable(Boolean.TRUE), + new SearchField("ProfitMargin", SearchFieldDataType.DOUBLE) + )).setScoringProfiles(new ScoringProfile("MyProfile") + .setFunctionAggregation(ScoringFunctionAggregation.AVERAGE) + .setFunctions(new MagnitudeScoringFunction("Rating", 2.0, + new MagnitudeScoringParameters(1, 4) + .setShouldBoostBeyondRangeByConstant(true)) + .setInterpolation(ScoringFunctionInterpolation.CONSTANT), + new DistanceScoringFunction("Location", 1.5, + new DistanceScoringParameters("Loc", 5)) + .setInterpolation(ScoringFunctionInterpolation.LINEAR), + new FreshnessScoringFunction("LastRenovationDate", 1.1, + new FreshnessScoringParameters(Duration.ofDays(365))) + .setInterpolation(ScoringFunctionInterpolation.LOGARITHMIC)) + .setTextWeights(new TextWeights(weights)), + new ScoringProfile("ProfileTwo") + .setFunctionAggregation(ScoringFunctionAggregation.MAXIMUM) + .setFunctions(new TagScoringFunction("Tags", 1.5, + new TagScoringParameters("MyTags")) + .setInterpolation(ScoringFunctionInterpolation.LINEAR)), + new ScoringProfile("ProfileThree") + .setFunctionAggregation(ScoringFunctionAggregation.MINIMUM) + .setFunctions(new MagnitudeScoringFunction("Rating", 3.0, + new MagnitudeScoringParameters(0, 10) + .setShouldBoostBeyondRangeByConstant(false)) + .setInterpolation(ScoringFunctionInterpolation.QUADRATIC)), + new ScoringProfile("ProfileFour") + .setFunctionAggregation(ScoringFunctionAggregation.FIRST_MATCHING) + .setFunctions(new MagnitudeScoringFunction("Rating", 3.14, + new MagnitudeScoringParameters(1, 5) + .setShouldBoostBeyondRangeByConstant(false)) + .setInterpolation(ScoringFunctionInterpolation.CONSTANT)) + ).setDefaultScoringProfile("MyProfile") .setCorsOptions(new CorsOptions(Arrays.asList("http://tempuri.org", "http://localhost:80")) .setMaxAgeInSeconds(60L)) - .setSuggesters(Collections.singletonList(new SearchSuggester("FancySuggester", - Collections.singletonList("HotelName")))); + .setSuggesters(new SearchSuggester("FancySuggester", Collections.singletonList("HotelName"))); } protected SearchIndexerDataSourceConnection createTestSqlDataSourceObject() { diff --git a/sdk/search/azure-search-documents/src/test/java/com/azure/search/documents/indexes/CustomAnalyzerSyncTests.java b/sdk/search/azure-search-documents/src/test/java/com/azure/search/documents/indexes/CustomAnalyzerSyncTests.java index 0c08d69fb38ce..e8580d40f85dc 100644 --- a/sdk/search/azure-search-documents/src/test/java/com/azure/search/documents/indexes/CustomAnalyzerSyncTests.java +++ b/sdk/search/azure-search-documents/src/test/java/com/azure/search/documents/indexes/CustomAnalyzerSyncTests.java @@ -127,13 +127,9 @@ public void canSearchWithCustomAnalyzer() { .setAnalyzerName(customLexicalAnalyzerName) .setSearchable(true) )) - .setAnalyzers(Collections.singletonList( - new CustomAnalyzer(customLexicalAnalyzerName.toString(), LexicalTokenizerName.STANDARD) - .setCharFilters(Collections.singletonList(customCharFilterName)) - )) - .setCharFilters(Collections.singletonList( - new PatternReplaceCharFilter(customCharFilterName.toString(), "@", "_") - )); + .setAnalyzers(new CustomAnalyzer(customLexicalAnalyzerName.toString(), LexicalTokenizerName.STANDARD) + .setCharFilters(customCharFilterName)) + .setCharFilters(new PatternReplaceCharFilter(customCharFilterName.toString(), "@", "_")); searchIndexClient.createIndex(index); indexesToCleanup.add(index.getName()); @@ -198,8 +194,8 @@ public void canAnalyze() { assertFalse(iterator.hasNext()); request = new AnalyzeTextOptions("One's ", LexicalTokenizerName.WHITESPACE) - .setTokenFilters(Collections.singletonList(TokenFilterName.APOSTROPHE)) - .setCharFilters(Collections.singletonList(CharFilterName.HTML_STRIP)); + .setTokenFilters(TokenFilterName.APOSTROPHE) + .setCharFilters(CharFilterName.HTML_STRIP); results = searchIndexClient.analyzeText(index.getName(), request); // End offset is based on the original token, not the one emitted by the filters. iterator = results.iterator(); @@ -230,15 +226,14 @@ public void canAnalyzeWithAllPossibleNames() { .forEach(r -> searchIndexClient.analyzeText(index.getName(), r)); AnalyzeTextOptions request = new AnalyzeTextOptions("One two", LexicalTokenizerName.WHITESPACE) - .setTokenFilters(new ArrayList<>(TokenFilterName.values())) - .setCharFilters(new ArrayList<>(CharFilterName.values())); + .setTokenFilters(TokenFilterName.values().toArray(new TokenFilterName[0])) + .setCharFilters(CharFilterName.values().toArray(new CharFilterName[0])); searchIndexClient.analyzeText(index.getName(), request); } @Test public void addingCustomAnalyzerThrowsHttpExceptionByDefault() { - SearchIndex index = createTestIndex(null) - .setAnalyzers(Collections.singletonList(new StopAnalyzer("a1"))); + SearchIndex index = createTestIndex(null).setAnalyzers(new StopAnalyzer("a1")); searchIndexClient.createIndex(index); indexesToCleanup.add(index.getName()); @@ -253,8 +248,7 @@ public void addingCustomAnalyzerThrowsHttpExceptionByDefault() { @Test public void canAddCustomAnalyzerWithIndexDowntime() { - SearchIndex index = createTestIndex(null) - .setAnalyzers(Collections.singletonList(new StopAnalyzer("a1"))); + SearchIndex index = createTestIndex(null).setAnalyzers(new StopAnalyzer("a1")); searchIndexClient.createIndex(index); indexesToCleanup.add(index.getName()); @@ -302,12 +296,11 @@ public void canUseAllAnalysisComponentNames() { @Test public void canUseAllRegexFlagsAnalyzer() { - SearchIndex index = createTestIndex(null) - .setAnalyzers(Collections.singletonList(new PatternAnalyzer(generateName()) - .setStopwords(Arrays.asList("stop1", "stop2")) - .setLowerCaseTerms(true) - .setPattern(".*") - .setFlags(new ArrayList<>(RegexFlags.values())))); + SearchIndex index = createTestIndex(null).setAnalyzers(new PatternAnalyzer(generateName()) + .setStopwords("stop1", "stop2") + .setLowerCaseTerms(true) + .setPattern(".*") + .setFlags(new ArrayList<>(RegexFlags.values()))); SearchIndex createdIndex = searchIndexClient.createIndex(index); indexesToCleanup.add(index.getName()); @@ -318,7 +311,7 @@ public void canUseAllRegexFlagsAnalyzer() { @Test public void canUseAllRegexFlagsNullAnalyzer() { SearchIndex index = createTestIndex(null) - .setAnalyzers(null); + .setAnalyzers((List) null); SearchIndex createdIndex = searchIndexClient.createIndex(index); indexesToCleanup.add(index.getName()); @@ -339,23 +332,16 @@ public void canUseAllRegexFlagsEmptyAnalyzer() { @Test public void canUseAllRegexFlagsNullNameAnalyzer() { - SearchIndex index = createTestIndex(null) - .setAnalyzers(Collections.singletonList( - new PatternAnalyzer(null) - )); + SearchIndex index = createTestIndex(null).setAnalyzers(new PatternAnalyzer(null)); - assertThrows(IllegalArgumentException.class, () -> { - searchIndexClient.createIndex(index); - }, "Missing required property name in model LexicalAnalyzer"); + assertThrows(IllegalArgumentException.class, () -> + searchIndexClient.createIndex(index), "Missing required property name in model LexicalAnalyzer"); } @Test public void canUseAllRegexFlagsEmptyNameAnalyzer() { - SearchIndex index = createTestIndex(null) - .setAnalyzers(Collections.singletonList( - new PatternAnalyzer("") - )); + SearchIndex index = createTestIndex(null).setAnalyzers(new PatternAnalyzer("")); assertHttpResponseException( () -> searchIndexClient.createIndex(index), @@ -367,9 +353,7 @@ public void canUseAllRegexFlagsEmptyNameAnalyzer() { @Test public void canUseAllRegexFlagsNullLowerCaseAnalyzer() { SearchIndex index = createTestIndex(null) - .setAnalyzers(Collections.singletonList( - new PatternAnalyzer(generateName()).setLowerCaseTerms(null) - )); + .setAnalyzers(new PatternAnalyzer(generateName()).setLowerCaseTerms(null)); SearchIndex createdIndex = searchIndexClient.createIndex(index); indexesToCleanup.add(index.getName()); @@ -380,9 +364,7 @@ public void canUseAllRegexFlagsNullLowerCaseAnalyzer() { @Test public void canUseAllRegexFlagsNullPatternAnalyzer() { SearchIndex index = createTestIndex(null) - .setAnalyzers(Collections.singletonList( - new PatternAnalyzer(generateName()).setPattern(null) - )); + .setAnalyzers(new PatternAnalyzer(generateName()).setPattern(null)); SearchIndex createdIndex = searchIndexClient.createIndex(index); indexesToCleanup.add(index.getName()); @@ -393,22 +375,7 @@ public void canUseAllRegexFlagsNullPatternAnalyzer() { @Test public void canUseAllRegexFlagsEmptyPatternAnalyzer() { SearchIndex index = createTestIndex(null) - .setAnalyzers(Collections.singletonList( - new PatternAnalyzer(generateName()).setPattern("")) - ); - - SearchIndex createdIndex = searchIndexClient.createIndex(index); - indexesToCleanup.add(index.getName()); - - assertAnalysisComponentsEqual(index, createdIndex); - } - - @Test - public void canUseAllRegexFlagsNullFlagsAnalyzer() { - SearchIndex index = createTestIndex(null) - .setAnalyzers(Collections.singletonList( - new PatternAnalyzer(generateName()).setFlags(null)) - ); + .setAnalyzers(new PatternAnalyzer(generateName()).setPattern("")); SearchIndex createdIndex = searchIndexClient.createIndex(index); indexesToCleanup.add(index.getName()); @@ -419,9 +386,7 @@ public void canUseAllRegexFlagsNullFlagsAnalyzer() { @Test public void canUseAllRegexFlagsEmptyFlagsAnalyzer() { SearchIndex index = createTestIndex(null) - .setAnalyzers(Collections.singletonList( - new PatternAnalyzer(generateName()).setFlags(new ArrayList<>())) - ); + .setAnalyzers(new PatternAnalyzer(generateName()).setFlags()); assertHttpResponseException( () -> searchIndexClient.createIndex(index), @@ -430,23 +395,10 @@ public void canUseAllRegexFlagsEmptyFlagsAnalyzer() { ); } - @Test - public void canUseAllRegexFlagsNullStopwordsAnalyzer() { - SearchIndex index = createTestIndex(null) - .setAnalyzers(Collections.singletonList(new PatternAnalyzer(generateName()) - .setStopwords(null))); - - SearchIndex createdIndex = searchIndexClient.createIndex(index); - indexesToCleanup.add(index.getName()); - - assertAnalysisComponentsEqual(index, createdIndex); - } - @Test public void canUseAllRegexFlagsEmptyStopwordsAnalyzer() { SearchIndex index = createTestIndex(null) - .setAnalyzers(Collections.singletonList(new PatternAnalyzer(generateName()) - .setStopwords(new ArrayList<>()))); + .setAnalyzers(new PatternAnalyzer(generateName()).setStopwords()); SearchIndex createdIndex = searchIndexClient.createIndex(index); indexesToCleanup.add(index.getName()); @@ -457,10 +409,10 @@ public void canUseAllRegexFlagsEmptyStopwordsAnalyzer() { @Test public void canUseAllRegexFlagsTokenizer() { SearchIndex index = createTestIndex(null) - .setTokenizers(Collections.singletonList(new PatternTokenizer(generateName()) + .setTokenizers(new PatternTokenizer(generateName()) .setPattern(".*") .setFlags(new ArrayList<>(RegexFlags.values())) - .setGroup(0))); + .setGroup(0)); SearchIndex createdIndex = searchIndexClient.createIndex(index); indexesToCleanup.add(index.getName()); @@ -471,7 +423,7 @@ public void canUseAllRegexFlagsTokenizer() { @Test public void canUseAllRegexFlagsNullTokenizer() { SearchIndex index = createTestIndex(null) - .setTokenizers(null); + .setTokenizers((List) null); SearchIndex createdIndex = searchIndexClient.createIndex(index); indexesToCleanup.add(index.getName()); @@ -493,19 +445,17 @@ public void canUseAllRegexFlagsEmptyTokenizer() { @Test public void canUseAllRegexFlagsNullNameTokenizer() { SearchIndex index = createTestIndex(null) - .setTokenizers(Collections.singletonList(new PatternTokenizer(null))); + .setTokenizers(new PatternTokenizer(null)); - assertThrows(IllegalArgumentException.class, () -> { - searchIndexClient.createIndex(index); - }, "Missing required property name in model SearchIndexer"); + assertThrows(IllegalArgumentException.class, () -> + searchIndexClient.createIndex(index), "Missing required property name in model SearchIndexer"); } @Test public void canUseAllRegexFlagsEmptyNameTokenizer() { SearchIndex index = createTestIndex(null) - .setTokenizers(Collections.singletonList(new PatternTokenizer("") - )); + .setTokenizers(new PatternTokenizer("")); assertHttpResponseException( () -> searchIndexClient.createIndex(index), @@ -517,8 +467,7 @@ public void canUseAllRegexFlagsEmptyNameTokenizer() { @Test public void canUseAllRegexFlagsNullPatternTokenizer() { SearchIndex index = createTestIndex(null) - .setTokenizers(Collections.singletonList(new PatternTokenizer(generateName()) - .setPattern(null))); + .setTokenizers(new PatternTokenizer(generateName()).setPattern(null)); SearchIndex createdIndex = searchIndexClient.createIndex(index); indexesToCleanup.add(index.getName()); @@ -529,35 +478,18 @@ public void canUseAllRegexFlagsNullPatternTokenizer() { @Test public void canUseAllRegexFlagsEmptyPatternTokenizer() { SearchIndex index = createTestIndex(null) - .setTokenizers(Collections.singletonList(new PatternTokenizer(generateName()) - .setPattern("")) - ); - - SearchIndex createdIndex = searchIndexClient.createIndex(index); - indexesToCleanup.add(index.getName()); - - assertAnalysisComponentsEqual(index, createdIndex); - } - - @Test - public void canUseAllRegexFlagsNullFlagsTokenizer() { - SearchIndex index = createTestIndex(null) - .setTokenizers(Collections.singletonList(new PatternTokenizer(generateName()) - .setFlags(null))); + .setTokenizers(new PatternTokenizer(generateName()).setPattern("")); SearchIndex createdIndex = searchIndexClient.createIndex(index); indexesToCleanup.add(index.getName()); assertAnalysisComponentsEqual(index, createdIndex); - System.out.println(RegexFlags.values()); } @Test public void canUseAllRegexFlagsEmptyFlagsTokenizer() { SearchIndex index = createTestIndex(null) - .setTokenizers(Collections.singletonList(new PatternTokenizer(generateName()) - .setFlags(new ArrayList<>())) - ); + .setTokenizers(new PatternTokenizer(generateName()).setFlags()); assertHttpResponseException( () -> searchIndexClient.createIndex(index), @@ -569,8 +501,7 @@ public void canUseAllRegexFlagsEmptyFlagsTokenizer() { @Test public void canUseAllRegexFlagsNullGroupTokenizer() { SearchIndex index = createTestIndex(null) - .setTokenizers(Collections.singletonList(new PatternTokenizer(generateName()) - .setGroup(null))); + .setTokenizers(new PatternTokenizer(generateName()).setGroup(null)); SearchIndex createdIndex = searchIndexClient.createIndex(index); indexesToCleanup.add(index.getName()); @@ -672,8 +603,7 @@ List prepareIndexesWithAllAnalysisComponentOptions() { new EdgeNGramTokenizer(generateName()) .setMinGram(1) .setMaxGram(2) - .setTokenChars(Arrays.asList(TokenCharacterKind.values())) - ); + .setTokenChars(TokenCharacterKind.values())); tokenizers.addAll( Arrays.stream(MicrosoftStemmingTokenizerLanguage.values()) .map(mtl -> new MicrosoftLanguageStemmingTokenizer(generateName()) @@ -688,7 +618,7 @@ List prepareIndexesWithAllAnalysisComponentOptions() { // Set token filters List tokenFilters = new ArrayList<>(); tokenFilters.add(new CjkBigramTokenFilter(generateName()) - .setIgnoreScripts(Arrays.asList(CjkBigramTokenFilterScripts.values())) + .setIgnoreScripts(CjkBigramTokenFilterScripts.values()) .setOutputUnigrams(true)); tokenFilters.addAll( Arrays.stream(EdgeNGramTokenFilterSide.values()) @@ -850,35 +780,34 @@ SearchIndex prepareIndexWithAllAnalysisComponentTypes() { final CharFilterName customCharFilterName = CharFilterName.fromString("my_charfilter"); return createTestIndex(null) - .setAnalyzers(Arrays.asList( + .setAnalyzers( new CustomAnalyzer(generateName(), customTokenizerName) - .setTokenFilters(Collections.singletonList(customTokenFilterName)) - .setCharFilters(Collections.singletonList(customCharFilterName)), + .setTokenFilters(customTokenFilterName) + .setCharFilters(customCharFilterName), new CustomAnalyzer(generateName(), LexicalTokenizerName.EDGE_NGRAM), new PatternAnalyzer(generateName()) .setLowerCaseTerms(false) .setPattern("abc") - .setFlags(Collections.singletonList(RegexFlags.DOT_ALL)) - .setStopwords(Collections.singletonList("the")), + .setFlags(RegexFlags.DOT_ALL) + .setStopwords("the"), new LuceneStandardAnalyzer(generateName()) .setMaxTokenLength(100) - .setStopwords(Collections.singletonList("the")), - new StopAnalyzer(generateName()) - .setStopwords(Collections.singletonList("the")), + .setStopwords("the"), new StopAnalyzer(generateName()) - )) - .setTokenizers(Arrays.asList( + .setStopwords("the"), + new StopAnalyzer(generateName())) + .setTokenizers( new EdgeNGramTokenizer(customTokenizerName.toString()) .setMinGram(1) .setMaxGram(2), new EdgeNGramTokenizer(generateName()) .setMinGram(2) .setMaxGram(4) - .setTokenChars(Collections.singletonList(TokenCharacterKind.LETTER)), + .setTokenChars(TokenCharacterKind.LETTER), new NGramTokenizer(generateName()) .setMinGram(2) .setMaxGram(4) - .setTokenChars(Collections.singletonList(TokenCharacterKind.LETTER)), + .setTokenChars(TokenCharacterKind.LETTER), new ClassicTokenizer(generateName()) .setMaxTokenLength(100), new KeywordTokenizer(generateName()) @@ -899,17 +828,16 @@ SearchIndex prepareIndexWithAllAnalysisComponentTypes() { .setNumberOfTokensToSkip(2), new PatternTokenizer(generateName()) .setPattern(".*") - .setFlags(Collections.singletonList(RegexFlags.MULTILINE)) + .setFlags(RegexFlags.MULTILINE) .setGroup(0), new LuceneStandardTokenizer(generateName()) .setMaxTokenLength(100), new UaxUrlEmailTokenizer(generateName()) - .setMaxTokenLength(100) - )) - .setTokenFilters(Arrays.asList( + .setMaxTokenLength(100)) + .setTokenFilters( new CjkBigramTokenFilter(customTokenFilterName.toString()), // One custom token filter for CustomAnalyzer above. new CjkBigramTokenFilter(generateName()) - .setIgnoreScripts(Collections.singletonList(CjkBigramTokenFilterScripts.HAN)) + .setIgnoreScripts(CjkBigramTokenFilterScripts.HAN) .setOutputUnigrams(true), new CjkBigramTokenFilter(generateName()), new AsciiFoldingTokenFilter(generateName()) @@ -929,7 +857,7 @@ SearchIndex prepareIndexWithAllAnalysisComponentTypes() { .setMaxGram(10) .setSide(EdgeNGramTokenFilterSide.BACK), new ElisionTokenFilter(generateName()) - .setArticles(Collections.singletonList("a")), + .setArticles("a"), new ElisionTokenFilter(generateName()), new KeepTokenFilter(generateName(), Collections.singletonList("aloha")), new KeepTokenFilter(generateName(), Arrays.asList("e", "komo", "mai")), @@ -986,13 +914,11 @@ SearchIndex prepareIndexWithAllAnalysisComponentTypes() { .setPreserveOriginal(true) .setSplitOnNumerics(false) .setStemEnglishPossessive(false) - .setProtectedWords(Collections.singletonList("protected")))) - .setCharFilters(Arrays.asList( - new MappingCharFilter(customCharFilterName.toString(), + .setProtectedWords("protected")) + .setCharFilters(new MappingCharFilter(customCharFilterName.toString(), Collections.singletonList("a => b")), // One custom char filter for CustomeAnalyer above. new MappingCharFilter(generateName(), Arrays.asList("s => $", "S => $")), - new PatternReplaceCharFilter(generateName(), "abc", "123") - )); + new PatternReplaceCharFilter(generateName(), "abc", "123")); } SearchIndex createIndexWithSpecialDefaults() { diff --git a/sdk/search/azure-search-documents/src/test/java/com/azure/search/documents/indexes/IndexManagementSyncTests.java b/sdk/search/azure-search-documents/src/test/java/com/azure/search/documents/indexes/IndexManagementSyncTests.java index 9f4363ffa40ee..8506e195951ab 100644 --- a/sdk/search/azure-search-documents/src/test/java/com/azure/search/documents/indexes/IndexManagementSyncTests.java +++ b/sdk/search/azure-search-documents/src/test/java/com/azure/search/documents/indexes/IndexManagementSyncTests.java @@ -99,11 +99,8 @@ public void createIndexReturnsCorrectDefinitionWithResponse() { public void createIndexReturnsCorrectDefaultValues() { SearchIndex index = createTestIndex(null) .setCorsOptions(new CorsOptions(Collections.singletonList("*"))) - .setScoringProfiles(Collections.singletonList(new ScoringProfile("MyProfile") - .setFunctions(Collections.singletonList(new MagnitudeScoringFunction("Rating", 2.0, - new MagnitudeScoringParameters(1, 4))) - ) - )); + .setScoringProfiles(new ScoringProfile("MyProfile") + .setFunctions(new MagnitudeScoringFunction("Rating", 2.0, new MagnitudeScoringParameters(1, 4)))); SearchIndex indexResponse = client.createIndex(index); indexesToDelete.add(indexResponse.getName()); @@ -118,10 +115,7 @@ public void createIndexReturnsCorrectDefaultValues() { public void createIndexFailsWithUsefulMessageOnUserError() { String indexName = HOTEL_INDEX_NAME; SearchIndex index = new SearchIndex(indexName) - .setFields(Collections.singletonList( - new SearchField("HotelId", SearchFieldDataType.STRING) - .setKey(false) - )); + .setFields(new SearchField("HotelId", SearchFieldDataType.STRING).setKey(false)); String expectedMessage = String.format("The request is invalid. Details: index : Found 0 key fields in index '%s'. " + "Each index must have exactly one key field.", indexName); @@ -174,7 +168,7 @@ public void deleteIndexIfNotChangedWorksOnlyOnCurrentResource() { // Update the resource, the eTag will be changed SearchIndex updatedIndex = client.createOrUpdateIndexWithResponse(originalIndex - .setCorsOptions(new CorsOptions(Collections.singletonList("https://test.com/"))), false, false, + .setCorsOptions(new CorsOptions(Collections.singletonList("https://test.com/"))), false, false, Context.NONE) .getValue(); @@ -207,10 +201,7 @@ public void deleteIndexIfExistsWorksOnlyWhenResourceExists() { @Test public void deleteIndexIsIdempotent() { SearchIndex index = new SearchIndex(HOTEL_INDEX_NAME) - .setFields(Collections.singletonList( - new SearchField("HotelId", SearchFieldDataType.STRING) - .setKey(true) - )); + .setFields(new SearchField("HotelId", SearchFieldDataType.STRING).setKey(true)); Response deleteResponse = client.deleteIndexWithResponse(index, false, Context.NONE); assertEquals(HttpURLConnection.HTTP_NOT_FOUND, deleteResponse.getStatusCode()); @@ -288,8 +279,7 @@ public void canAddSynonymFieldProperty() { new SearchField("HotelId", SearchFieldDataType.STRING) .setKey(true), new SearchField("HotelName", SearchFieldDataType.STRING) - .setSynonymMapNames(Collections.singletonList(synonymMapName)) - )); + .setSynonymMapNames(synonymMapName))); SearchIndex createdIndex = client.createIndex(index); indexesToDelete.add(createdIndex.getName()); @@ -311,7 +301,7 @@ public void canUpdateSynonymFieldProperty() { // Create an index SearchIndex index = createTestIndex(null); SearchField hotelNameField = getFieldByName(index, "HotelName"); - hotelNameField.setSynonymMapNames(Collections.singletonList(synonymMapName)); + hotelNameField.setSynonymMapNames(synonymMapName); client.createIndex(index); indexesToDelete.add(index.getName()); @@ -361,7 +351,7 @@ public void canUpdateIndexDefinition() { SearchField tagsField = getFieldByName(existingIndex, "Description_Custom"); tagsField.setHidden(true) .setSearchAnalyzerName(LexicalAnalyzerName.WHITESPACE) - .setSynonymMapNames(Collections.singletonList(synonymMap.getName())); + .setSynonymMapNames(synonymMap.getName()); SearchField hotelWebSiteField = new SearchField("HotelWebsite", SearchFieldDataType.STRING) .setSearchable(Boolean.TRUE) @@ -388,9 +378,7 @@ public void canUpdateSuggesterWithNewIndexFields() { existingIndex.getFields().addAll(Arrays.asList( new SearchField("HotelAmenities", SearchFieldDataType.STRING), new SearchField("HotelRewards", SearchFieldDataType.STRING))); - existingIndex.setSuggesters(Collections.singletonList(new SearchSuggester("Suggestion", - Arrays.asList("HotelAmenities", "HotelRewards")) - )); + existingIndex.setSuggesters(new SearchSuggester("Suggestion", Arrays.asList("HotelAmenities", "HotelRewards"))); SearchIndex updatedIndex = client.createOrUpdateIndexWithResponse(existingIndex, true, false, Context.NONE).getValue(); @@ -405,9 +393,7 @@ public void createOrUpdateIndexThrowsWhenUpdatingSuggesterWithExistingIndexField SearchIndex existingIndex = client.getIndex(index.getName()); String existingFieldName = "Category"; - existingIndex.setSuggesters(Collections.singletonList(new SearchSuggester("Suggestion", - Collections.singletonList(existingFieldName)) - )); + existingIndex.setSuggesters(new SearchSuggester("Suggestion", Collections.singletonList(existingFieldName))); assertHttpResponseException( () -> client.createOrUpdateIndex(existingIndex), diff --git a/sdk/search/azure-search-documents/src/test/java/com/azure/search/documents/indexes/SkillsetManagementSyncTests.java b/sdk/search/azure-search-documents/src/test/java/com/azure/search/documents/indexes/SkillsetManagementSyncTests.java index 7f33727e09618..1f88f93b504b7 100644 --- a/sdk/search/azure-search-documents/src/test/java/com/azure/search/documents/indexes/SkillsetManagementSyncTests.java +++ b/sdk/search/azure-search-documents/src/test/java/com/azure/search/documents/indexes/SkillsetManagementSyncTests.java @@ -122,10 +122,8 @@ public void createSkillsetReturnsCorrectDefinitionOcrEntity() { skillsetsToDelete.add(actualSkillset.getName()); assertObjectEquals(expectedSkillset, actualSkillset, true, "etag"); - List entityCategories = Arrays.asList( - EntityCategory.LOCATION, EntityCategory.ORGANIZATION, EntityCategory.PERSON); - - expectedSkillset = createTestSkillsetOcrEntity(entityCategories); + expectedSkillset = createTestSkillsetOcrEntity(Arrays.asList(EntityCategory.LOCATION, + EntityCategory.ORGANIZATION, EntityCategory.PERSON)); actualSkillset = client.createSkillset(expectedSkillset); skillsetsToDelete.add(actualSkillset.getName()); assertObjectEquals(expectedSkillset, actualSkillset, true, "etag"); @@ -612,7 +610,7 @@ SearchIndexerSkillset createTestSkillsetImageAnalysisKeyPhrase() { skills.add(new ImageAnalysisSkill(inputs, outputs) .setVisualFeatures(new ArrayList<>(VisualFeature.values())) - .setDetails(new ArrayList<>((ImageDetail.values()))) + .setDetails(new ArrayList<>(ImageDetail.values())) .setDefaultLanguageCode(ImageAnalysisSkillLanguage.EN) .setName("myimage") .setDescription("Tested image analysis skill") @@ -743,15 +741,13 @@ SearchIndexerSkillset createTestSkillsetConditional() { } SearchIndexerSkillset mutateSkillsInSkillset(SearchIndexerSkillset skillset) { - return skillset.setSkills(Collections.singletonList( - new KeyPhraseExtractionSkill(Collections - .singletonList(simpleInputFieldMappingEntry("text", "/document/mydescription/*/Tags/*")), - Collections.singletonList(createOutputFieldMappingEntry("keyPhrases", "myKeyPhrases"))) - .setDefaultLanguageCode(KeyPhraseExtractionSkillLanguage.EN) - .setName("mykeyphrases") - .setDescription("Tested Key Phrase skill") - .setContext(CONTEXT_VALUE) - )); + return skillset.setSkills(new KeyPhraseExtractionSkill(Collections + .singletonList(simpleInputFieldMappingEntry("text", "/document/mydescription/*/Tags/*")), + Collections.singletonList(createOutputFieldMappingEntry("keyPhrases", "myKeyPhrases"))) + .setDefaultLanguageCode(KeyPhraseExtractionSkillLanguage.EN) + .setName("mykeyphrases") + .setDescription("Tested Key Phrase skill") + .setContext(CONTEXT_VALUE)); } SearchIndexerSkillset createTestSkillsetOcrEntity(List categories) { @@ -945,7 +941,7 @@ SearchIndexerSkillset createSkillsetWithKeyPhraseExtractionDefaultSettings() { ); return new SearchIndexerSkillset(testResourceNamer.randomName("key-phrase-extraction-skillset", 48), - skills).setDescription("Skillset for testing default configuration"); + skills).setDescription("Skillset for testing default configuration"); } SearchIndexerSkillset createSkillsetWithMergeDefaultSettings() { diff --git a/sdk/search/tests.yml b/sdk/search/tests.yml index 4b3c335e3e503..f205c27212845 100644 --- a/sdk/search/tests.yml +++ b/sdk/search/tests.yml @@ -4,8 +4,8 @@ jobs: - template: ../../eng/pipelines/templates/jobs/archetype-sdk-tests.yml parameters: ServiceDirectory: search - Timeout: 120 - MaxParallel: 2 + Timeout: 60 + MaxParallel: 3 EnvVars: AZURE_TEST_MODE: LIVE Artifacts: From 734b8cdb33253d25614f36ca372f7c4270df5aa0 Mon Sep 17 00:00:00 2001 From: Xiaolu Dai <31124698+saragluna@users.noreply.github.com> Date: Fri, 10 Jul 2020 13:54:42 +0800 Subject: [PATCH 081/129] Spring - Remove Intermediate Poms (#12966) * remove intermediate poms * remove deleted module * add readme files * remove useless Co-authored-by: Xiaolu Dai --- eng/versioning/version_client.txt | 7 +- .../pom.xml | 9 +- .../pom.xml | 11 +-- .../pom.xml | 87 +++++++++--------- .../pom.xml | 87 +++++++++--------- .../pom.xml | 90 +++++++++---------- .../pom.xml | 11 +-- .../azure-spring-boot-sample-cosmosdb/pom.xml | 11 +-- .../pom.xml | 11 +-- .../pom.xml | 11 +-- .../pom.xml | 11 +-- .../pom.xml | 11 +-- .../pom.xml | 11 +-- .../pom.xml | 11 +-- .../pom.xml | 11 +-- sdk/spring/azure-spring-boot-samples/pom.xml | 81 ----------------- .../azure-spring-boot-test-aad/README.md | 9 ++ .../azure-spring-boot-test-aad/pom.xml | 19 ++-- ...ppRoleStatelessAuthenticationFilterIT.java | 0 .../aad/group/AADAuthenticationFilterIT.java | 0 .../azure/test/oauth/OAuthResponse.java | 0 .../azure/test/oauth/OAuthUtils.java | 0 .../pom.xml | 6 +- .../config/IncreaseStartupTimeHelper.java | 0 .../com/microsoft/azure/test/Application.java | 0 .../src/main/resources/application.properties | 0 .../src/main/resources/assembly/zip.xml | 0 .../azure-spring-boot-test-core/README.md | 9 ++ .../azure-spring-boot-test-core/pom.xml | 34 +++---- .../azure/test/management/Access.java | 0 .../test/management/ClientSecretAccess.java | 0 .../microsoft/azure/test/utils/AppRunner.java | 0 .../azure/test/utils/MavenBasedProject.java | 0 .../microsoft/azure/test/utils/SSHShell.java | 0 .../azure-spring-boot-test-cosmosdb/README.md | 9 ++ .../azure-spring-boot-test-cosmosdb/pom.xml | 18 ++-- .../azure/test/cosmosdb/CosmosDBIT.java | 0 .../azure/test/cosmosdb/DummyApp.java | 0 .../microsoft/azure/test/cosmosdb/User.java | 0 .../azure/test/cosmosdb/UserRepository.java | 0 .../test-resources.json | 0 .../azure-spring-boot-test-keyvault/README.md | 9 ++ .../azure-spring-boot-test-keyvault/pom.xml | 24 +++-- .../azure/test/keyvault/ActuatorIT.java | 0 .../azure/test/keyvault/KeyVaultIT.java | 0 .../test/keyvault/MultipleKeyVaultsIT.java | 0 .../test-resources.json | 0 sdk/spring/azure-spring-boot-tests/README.md | 18 ---- sdk/spring/azure-spring-boot-tests/pom.xml | 35 -------- sdk/spring/ci.yml | 28 +++--- sdk/spring/pom.xml | 21 ++++- sdk/spring/tests.yml | 18 ++-- 52 files changed, 335 insertions(+), 393 deletions(-) delete mode 100644 sdk/spring/azure-spring-boot-samples/pom.xml create mode 100644 sdk/spring/azure-spring-boot-test-aad/README.md rename sdk/spring/{azure-spring-boot-tests => }/azure-spring-boot-test-aad/pom.xml (77%) rename sdk/spring/{azure-spring-boot-tests => }/azure-spring-boot-test-aad/src/test/java/com/microsoft/azure/test/aad/approle/AADAppRoleStatelessAuthenticationFilterIT.java (100%) rename sdk/spring/{azure-spring-boot-tests => }/azure-spring-boot-test-aad/src/test/java/com/microsoft/azure/test/aad/group/AADAuthenticationFilterIT.java (100%) rename sdk/spring/{azure-spring-boot-tests => }/azure-spring-boot-test-aad/src/test/java/com/microsoft/azure/test/oauth/OAuthResponse.java (100%) rename sdk/spring/{azure-spring-boot-tests => }/azure-spring-boot-test-aad/src/test/java/com/microsoft/azure/test/oauth/OAuthUtils.java (100%) rename sdk/spring/{azure-spring-boot-tests => }/azure-spring-boot-test-application/pom.xml (86%) rename sdk/spring/{azure-spring-boot-tests => }/azure-spring-boot-test-application/src/main/java/com/microsoft/azure/config/IncreaseStartupTimeHelper.java (100%) rename sdk/spring/{azure-spring-boot-tests => }/azure-spring-boot-test-application/src/main/java/com/microsoft/azure/test/Application.java (100%) rename sdk/spring/{azure-spring-boot-tests => }/azure-spring-boot-test-application/src/main/resources/application.properties (100%) rename sdk/spring/{azure-spring-boot-tests => }/azure-spring-boot-test-application/src/main/resources/assembly/zip.xml (100%) create mode 100644 sdk/spring/azure-spring-boot-test-core/README.md rename sdk/spring/{azure-spring-boot-tests => }/azure-spring-boot-test-core/pom.xml (81%) rename sdk/spring/{azure-spring-boot-tests => }/azure-spring-boot-test-core/src/main/java/com/microsoft/azure/test/management/Access.java (100%) rename sdk/spring/{azure-spring-boot-tests => }/azure-spring-boot-test-core/src/main/java/com/microsoft/azure/test/management/ClientSecretAccess.java (100%) rename sdk/spring/{azure-spring-boot-tests => }/azure-spring-boot-test-core/src/main/java/com/microsoft/azure/test/utils/AppRunner.java (100%) rename sdk/spring/{azure-spring-boot-tests => }/azure-spring-boot-test-core/src/main/java/com/microsoft/azure/test/utils/MavenBasedProject.java (100%) rename sdk/spring/{azure-spring-boot-tests => }/azure-spring-boot-test-core/src/main/java/com/microsoft/azure/test/utils/SSHShell.java (100%) create mode 100644 sdk/spring/azure-spring-boot-test-cosmosdb/README.md rename sdk/spring/{azure-spring-boot-tests => }/azure-spring-boot-test-cosmosdb/pom.xml (79%) rename sdk/spring/{azure-spring-boot-tests => }/azure-spring-boot-test-cosmosdb/src/test/java/com/microsoft/azure/test/cosmosdb/CosmosDBIT.java (100%) rename sdk/spring/{azure-spring-boot-tests => }/azure-spring-boot-test-cosmosdb/src/test/java/com/microsoft/azure/test/cosmosdb/DummyApp.java (100%) rename sdk/spring/{azure-spring-boot-tests => }/azure-spring-boot-test-cosmosdb/src/test/java/com/microsoft/azure/test/cosmosdb/User.java (100%) rename sdk/spring/{azure-spring-boot-tests => }/azure-spring-boot-test-cosmosdb/src/test/java/com/microsoft/azure/test/cosmosdb/UserRepository.java (100%) rename sdk/spring/{azure-spring-boot-tests => }/azure-spring-boot-test-cosmosdb/test-resources.json (100%) create mode 100644 sdk/spring/azure-spring-boot-test-keyvault/README.md rename sdk/spring/{azure-spring-boot-tests => }/azure-spring-boot-test-keyvault/pom.xml (81%) rename sdk/spring/{azure-spring-boot-tests => }/azure-spring-boot-test-keyvault/src/test/java/com/microsoft/azure/test/keyvault/ActuatorIT.java (100%) rename sdk/spring/{azure-spring-boot-tests => }/azure-spring-boot-test-keyvault/src/test/java/com/microsoft/azure/test/keyvault/KeyVaultIT.java (100%) rename sdk/spring/{azure-spring-boot-tests => }/azure-spring-boot-test-keyvault/src/test/java/com/microsoft/azure/test/keyvault/MultipleKeyVaultsIT.java (100%) rename sdk/spring/{azure-spring-boot-tests => }/azure-spring-boot-test-keyvault/test-resources.json (100%) delete mode 100644 sdk/spring/azure-spring-boot-tests/README.md delete mode 100644 sdk/spring/azure-spring-boot-tests/pom.xml diff --git a/eng/versioning/version_client.txt b/eng/versioning/version_client.txt index c90f1bbdc4425..277a78335fb18 100644 --- a/eng/versioning/version_client.txt +++ b/eng/versioning/version_client.txt @@ -50,6 +50,10 @@ com.azure:azure-storage-perf;1.0.0-beta.1;1.0.0-beta.1 com.azure:azure-storage-queue;12.6.0-beta.1;12.6.0-beta.2 com.azure:perf-test-core;1.0.0-beta.1;1.0.0-beta.1 com.azure:azure-test-watcher;1.0.0-beta.1;1.0.0-beta.1 +com.azure:azure-spring-boot-test-aad;1.0.0;1.0.0 +com.azure:azure-spring-boot-test-core;1.0.0;1.0.0 +com.azure:azure-spring-boot-test-cosmosdb;1.0.0;1.0.0 +com.azure:azure-spring-boot-test-keyvault;1.0.0;1.0.0 com.microsoft.azure:azure-spring-boot;2.3.2;2.3.3-beta.1 com.microsoft.azure:azure-spring-boot-starter;2.3.2;2.3.3-beta.1 com.microsoft.azure:azure-active-directory-spring-boot-starter;2.3.2;2.3.3-beta.1 @@ -59,8 +63,7 @@ com.microsoft.azure:azure-data-gremlin-spring-boot-starter;2.3.2;2.3.3-beta.1 com.microsoft.azure:azure-keyvault-secrets-spring-boot-starter;2.3.2;2.3.3-beta.1 com.microsoft.azure:azure-servicebus-jms-spring-boot-starter;2.3.2;2.3.3-beta.1 com.microsoft.azure:azure-spring-boot-metrics-starter;2.3.2;2.3.3-beta.1 -com.microsoft.azure:azure-spring-boot-tests;2.3.2;2.3.3-beta.1 -com.microsoft.azure:azure-spring-boot-test-core;2.3.2;2.3.3-beta.1 +com.microsoft.azure:spring-data-cosmosdb;3.0.0-beta.1;3.0.0-beta.1 # Unreleased dependencies: Copy the entry from above, prepend "unreleased_" and remove the current # version. Unreleased dependencies are only valid for dependency versions. diff --git a/sdk/spring/azure-spring-boot-samples/azure-cloud-foundry-service-sample/pom.xml b/sdk/spring/azure-spring-boot-samples/azure-cloud-foundry-service-sample/pom.xml index 6e2c7a1dae7ef..6bf68ed712aaf 100644 --- a/sdk/spring/azure-spring-boot-samples/azure-cloud-foundry-service-sample/pom.xml +++ b/sdk/spring/azure-spring-boot-samples/azure-cloud-foundry-service-sample/pom.xml @@ -4,13 +4,14 @@ 4.0.0 - com.microsoft.azure - azure-spring-boot-samples - 1.0.0 - ../pom.xml + org.springframework.boot + spring-boot-starter-parent + 2.3.0.RELEASE + com.azure azure-cloud-foundry-service-sample + 1.0.0 jar Azure Cloud Foundry Service Sample diff --git a/sdk/spring/azure-spring-boot-samples/azure-spring-boot-sample-active-directory-b2c-oidc/pom.xml b/sdk/spring/azure-spring-boot-samples/azure-spring-boot-sample-active-directory-b2c-oidc/pom.xml index ec15c4c34ddc8..b3773beca50aa 100644 --- a/sdk/spring/azure-spring-boot-samples/azure-spring-boot-sample-active-directory-b2c-oidc/pom.xml +++ b/sdk/spring/azure-spring-boot-samples/azure-spring-boot-sample-active-directory-b2c-oidc/pom.xml @@ -4,16 +4,17 @@ 4.0.0 - com.microsoft.azure - azure-spring-boot-samples - 1.0.0 - ../pom.xml + org.springframework.boot + spring-boot-starter-parent + 2.3.0.RELEASE + com.azure azure-spring-boot-sample-active-directory-b2c-oidc + 1.0.0 jar - Azure AD B2C Spring Security 5 OAuth2 Integration Spring Boot Sample + Azure Spring Boot Starter Sample - Azure AD B2C Spring Security 5 OAuth Integration Azure AD B2C Spring Security 5 OAuth2 Integration Spring Boot Sample https://github.com/Azure/azure-sdk-for-java diff --git a/sdk/spring/azure-spring-boot-samples/azure-spring-boot-sample-active-directory-backend-v2/pom.xml b/sdk/spring/azure-spring-boot-samples/azure-spring-boot-sample-active-directory-backend-v2/pom.xml index cbd0d92c837d5..ebb1c722b5682 100644 --- a/sdk/spring/azure-spring-boot-samples/azure-spring-boot-sample-active-directory-backend-v2/pom.xml +++ b/sdk/spring/azure-spring-boot-samples/azure-spring-boot-sample-active-directory-backend-v2/pom.xml @@ -1,54 +1,55 @@ - 4.0.0 + 4.0.0 - - com.microsoft.azure - azure-spring-boot-samples - 1.0.0 - ../pom.xml - + + org.springframework.boot + spring-boot-starter-parent + 2.3.0.RELEASE + - azure-spring-boot-sample-active-directory-backend-v2 - jar + com.azure + azure-spring-boot-sample-active-directory-backend-v2 + 1.0.0 + jar - Azure AD Spring Security 5 OAuth2 V2 Integration Spring Boot Sample - Azure AD Spring Security 5 OAuth2 V2 Integration Spring Boot Sample - https://github.com/Azure/azure-sdk-for-java + Azure Spring Boot Starter Sample - Azure AD Spring Security Integration v2 + Azure AD Spring Security 5 OAuth2 V2 Integration Spring Boot Sample + https://github.com/Azure/azure-sdk-for-java - - - com.microsoft.azure - azure-active-directory-spring-boot-starter - 2.3.3-beta.1 - + + + com.microsoft.azure + azure-active-directory-spring-boot-starter + 2.3.3-beta.1 + - - org.springframework.boot - spring-boot-starter-web - - - org.springframework.boot - spring-boot-starter-thymeleaf - + + org.springframework.boot + spring-boot-starter-web + + + org.springframework.boot + spring-boot-starter-thymeleaf + - - org.springframework.boot - spring-boot-starter-security - - - org.springframework.security - spring-security-oauth2-client - - - org.springframework.security - spring-security-oauth2-jose - - - org.thymeleaf.extras - thymeleaf-extras-springsecurity5 - - + + org.springframework.boot + spring-boot-starter-security + + + org.springframework.security + spring-security-oauth2-client + + + org.springframework.security + spring-security-oauth2-jose + + + org.thymeleaf.extras + thymeleaf-extras-springsecurity5 + + diff --git a/sdk/spring/azure-spring-boot-samples/azure-spring-boot-sample-active-directory-backend/pom.xml b/sdk/spring/azure-spring-boot-samples/azure-spring-boot-sample-active-directory-backend/pom.xml index 292780bbe3559..408b7867beb2f 100644 --- a/sdk/spring/azure-spring-boot-samples/azure-spring-boot-sample-active-directory-backend/pom.xml +++ b/sdk/spring/azure-spring-boot-samples/azure-spring-boot-sample-active-directory-backend/pom.xml @@ -1,54 +1,55 @@ - 4.0.0 + 4.0.0 - - com.microsoft.azure - azure-spring-boot-samples - 1.0.0 - ../pom.xml - + + org.springframework.boot + spring-boot-starter-parent + 2.3.0.RELEASE + - azure-spring-boot-sample-active-directory-backend - jar + com.azure + azure-spring-boot-sample-active-directory-backend + 1.0.0 + jar - Azure AD Spring Security 5 OAuth2 Integration Spring Boot Sample - Azure AD Spring Security 5 OAuth2 Integration Spring Boot Sample - https://github.com/Azure/azure-sdk-for-java + Azure Spring Boot Starter Sample - Azure AD Spring Security Integration + Azure AD Spring Security 5 OAuth2 Integration Spring Boot Sample + https://github.com/Azure/azure-sdk-for-java - - - com.microsoft.azure - azure-active-directory-spring-boot-starter - 2.3.3-beta.1 - + + + com.microsoft.azure + azure-active-directory-spring-boot-starter + 2.3.3-beta.1 + - - org.springframework.boot - spring-boot-starter-web - - - org.springframework.boot - spring-boot-starter-thymeleaf - + + org.springframework.boot + spring-boot-starter-web + + + org.springframework.boot + spring-boot-starter-thymeleaf + - - org.springframework.boot - spring-boot-starter-security - - - org.springframework.security - spring-security-oauth2-client - - - org.springframework.security - spring-security-oauth2-jose - - - org.thymeleaf.extras - thymeleaf-extras-springsecurity5 - - + + org.springframework.boot + spring-boot-starter-security + + + org.springframework.security + spring-security-oauth2-client + + + org.springframework.security + spring-security-oauth2-jose + + + org.thymeleaf.extras + thymeleaf-extras-springsecurity5 + + diff --git a/sdk/spring/azure-spring-boot-samples/azure-spring-boot-sample-active-directory-stateless/pom.xml b/sdk/spring/azure-spring-boot-samples/azure-spring-boot-sample-active-directory-stateless/pom.xml index 1a82a9d4b10dd..22a4296737c90 100644 --- a/sdk/spring/azure-spring-boot-samples/azure-spring-boot-sample-active-directory-stateless/pom.xml +++ b/sdk/spring/azure-spring-boot-samples/azure-spring-boot-sample-active-directory-stateless/pom.xml @@ -1,49 +1,49 @@ - 4.0.0 - - - com.microsoft.azure - azure-spring-boot-samples - 1.0.0 - ../pom.xml - - - - azure-spring-boot-sample-active-directory-stateless - - Azure AD Stateless Spring Security Integration Spring Boot Sample - Sample project using the AAD stateless app-role filter for AAD integration in Spring Security - https://github.com/Azure/azure-sdk-for-java - - - - com.microsoft.azure - azure-active-directory-spring-boot-starter - 2.3.3-beta.1 - - - - org.springframework.boot - spring-boot-starter-web - - - - org.springframework.boot - spring-boot-starter-security - - - - org.springframework.security - spring-security-oauth2-client - - - - org.springframework.security - spring-security-oauth2-jose - - + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + 4.0.0 + + + org.springframework.boot + spring-boot-starter-parent + 2.3.0.RELEASE + + + com.azure + azure-spring-boot-sample-active-directory-stateless + 1.0.0 + + Azure Spring Boot Starter Sample - Azure AD Stateless Spring Security Integration + Sample project using the AAD stateless app-role filter for AAD integration in Spring Security + https://github.com/Azure/azure-sdk-for-java + + + + com.microsoft.azure + azure-active-directory-spring-boot-starter + 2.3.3-beta.1 + + + + org.springframework.boot + spring-boot-starter-web + + + + org.springframework.boot + spring-boot-starter-security + + + + org.springframework.security + spring-security-oauth2-client + + + + org.springframework.security + spring-security-oauth2-jose + + diff --git a/sdk/spring/azure-spring-boot-samples/azure-spring-boot-sample-active-directory/pom.xml b/sdk/spring/azure-spring-boot-samples/azure-spring-boot-sample-active-directory/pom.xml index 042fec4e4c151..4e49e9dfcd79c 100644 --- a/sdk/spring/azure-spring-boot-samples/azure-spring-boot-sample-active-directory/pom.xml +++ b/sdk/spring/azure-spring-boot-samples/azure-spring-boot-sample-active-directory/pom.xml @@ -4,16 +4,17 @@ 4.0.0 - com.microsoft.azure - azure-spring-boot-samples - 1.0.0 - ../pom.xml + org.springframework.boot + spring-boot-starter-parent + 2.3.0.RELEASE + com.azure azure-spring-boot-sample-active-directory + 1.0.0 jar - Azure AD Spring Security Integration Spring Boot Sample + Azure Spring Boot Starter Sample - Azure AD Spring Security Integration Azure AD Spring Security Integration Spring Boot Sample https://github.com/Azure/azure-sdk-for-java diff --git a/sdk/spring/azure-spring-boot-samples/azure-spring-boot-sample-cosmosdb/pom.xml b/sdk/spring/azure-spring-boot-samples/azure-spring-boot-sample-cosmosdb/pom.xml index e9b6195ab0ae5..fe8405d77d901 100644 --- a/sdk/spring/azure-spring-boot-samples/azure-spring-boot-sample-cosmosdb/pom.xml +++ b/sdk/spring/azure-spring-boot-samples/azure-spring-boot-sample-cosmosdb/pom.xml @@ -4,16 +4,17 @@ 4.0.0 - com.microsoft.azure - azure-spring-boot-samples - 1.0.0 - ../pom.xml + org.springframework.boot + spring-boot-starter-parent + 2.3.0.RELEASE + com.azure azure-spring-boot-sample-cosmosdb + 1.0.0 jar - Azure Cosmos DB Spring Boot Starter Sample + Azure Spring Boot Starter Sample - Cosmos DB Sample project for Azure Document DB Starter https://github.com/Azure/azure-sdk-for-java diff --git a/sdk/spring/azure-spring-boot-samples/azure-spring-boot-sample-data-gremlin/pom.xml b/sdk/spring/azure-spring-boot-samples/azure-spring-boot-sample-data-gremlin/pom.xml index fdf7507fa6e98..82ab68f45fd5d 100644 --- a/sdk/spring/azure-spring-boot-samples/azure-spring-boot-sample-data-gremlin/pom.xml +++ b/sdk/spring/azure-spring-boot-samples/azure-spring-boot-sample-data-gremlin/pom.xml @@ -5,16 +5,17 @@ 4.0.0 - com.microsoft.azure - azure-spring-boot-samples - 1.0.0 - ../pom.xml + org.springframework.boot + spring-boot-starter-parent + 2.3.0.RELEASE + com.azure azure-spring-boot-sample-data-gremlin + 1.0.0 jar - Spring Data Gremlin Boot Starter Sample + Azure Spring Boot Starter Sample - Spring Data Gremlin Sample project for Spring Data Gremlin https://github.com/Azure/azure-sdk-for-java diff --git a/sdk/spring/azure-spring-boot-samples/azure-spring-boot-sample-keyvault-secrets/pom.xml b/sdk/spring/azure-spring-boot-samples/azure-spring-boot-sample-keyvault-secrets/pom.xml index a07a108249039..3123c4636f232 100644 --- a/sdk/spring/azure-spring-boot-samples/azure-spring-boot-sample-keyvault-secrets/pom.xml +++ b/sdk/spring/azure-spring-boot-samples/azure-spring-boot-sample-keyvault-secrets/pom.xml @@ -5,16 +5,17 @@ 4.0.0 - com.microsoft.azure - azure-spring-boot-samples - 1.0.0 - ../pom.xml + org.springframework.boot + spring-boot-starter-parent + 2.3.0.RELEASE + com.azure azure-spring-boot-sample-keyvault-secrets + 1.0.0 jar - Azure Key Vault Secrets Spring Boot Starter Sample + Azure Spring Boot Starter Sample - Key Vault Secrets Sample project for Azure Key Vault Secrets Starter https://github.com/Azure/azure-sdk-for-java diff --git a/sdk/spring/azure-spring-boot-samples/azure-spring-boot-sample-mediaservices/pom.xml b/sdk/spring/azure-spring-boot-samples/azure-spring-boot-sample-mediaservices/pom.xml index 42635de23369d..48c552e78504d 100644 --- a/sdk/spring/azure-spring-boot-samples/azure-spring-boot-sample-mediaservices/pom.xml +++ b/sdk/spring/azure-spring-boot-samples/azure-spring-boot-sample-mediaservices/pom.xml @@ -5,16 +5,17 @@ 4.0.0 - com.microsoft.azure - azure-spring-boot-samples - 1.0.0 - ../pom.xml + org.springframework.boot + spring-boot-starter-parent + 2.3.0.RELEASE + com.azure azure-spring-boot-sample-mediaservices + 1.0.0 jar - Azure Media Services Spring Boot Sample + Azure Spring Boot Starter Sample - Media Services Sample project for Azure Media Services https://github.com/Azure/azure-sdk-for-java diff --git a/sdk/spring/azure-spring-boot-samples/azure-spring-boot-sample-servicebus-jms-queue/pom.xml b/sdk/spring/azure-spring-boot-samples/azure-spring-boot-sample-servicebus-jms-queue/pom.xml index b6854172191e5..82d3a20f50531 100644 --- a/sdk/spring/azure-spring-boot-samples/azure-spring-boot-sample-servicebus-jms-queue/pom.xml +++ b/sdk/spring/azure-spring-boot-samples/azure-spring-boot-sample-servicebus-jms-queue/pom.xml @@ -5,16 +5,17 @@ 4.0.0 - com.microsoft.azure - azure-spring-boot-samples - 1.0.0 - ../pom.xml + org.springframework.boot + spring-boot-starter-parent + 2.3.0.RELEASE + com.azure azure-spring-boot-sample-servicebus-jms-queue + 1.0.0 jar - Azure Service Bus JMS Queue Spring Boot Starter Sample + Azure Spring Boot Starter Sample - Service Bus JMS Queue Sample project for Spring Boot Service Bus JMS Starter https://github.com/Azure/azure-sdk-for-java diff --git a/sdk/spring/azure-spring-boot-samples/azure-spring-boot-sample-servicebus-jms-topic/pom.xml b/sdk/spring/azure-spring-boot-samples/azure-spring-boot-sample-servicebus-jms-topic/pom.xml index ea0698400c45f..ee5c4289fe4ad 100644 --- a/sdk/spring/azure-spring-boot-samples/azure-spring-boot-sample-servicebus-jms-topic/pom.xml +++ b/sdk/spring/azure-spring-boot-samples/azure-spring-boot-sample-servicebus-jms-topic/pom.xml @@ -5,16 +5,17 @@ 4.0.0 - com.microsoft.azure - azure-spring-boot-samples - 1.0.0 - ../pom.xml + org.springframework.boot + spring-boot-starter-parent + 2.3.0.RELEASE + com.azure azure-spring-boot-sample-servicebus-jms-topic + 1.0.0 jar - Azure Service Bus JMS Topic Spring Boot Starter Sample + Azure Spring Boot Starter Sample - Service Bus JMS Topic Sample project for Spring Boot Service Bus JMS Starter https://github.com/Azure/azure-sdk-for-java diff --git a/sdk/spring/azure-spring-boot-samples/azure-spring-boot-sample-servicebus/pom.xml b/sdk/spring/azure-spring-boot-samples/azure-spring-boot-sample-servicebus/pom.xml index 09d6653d555ee..76529026d8818 100644 --- a/sdk/spring/azure-spring-boot-samples/azure-spring-boot-sample-servicebus/pom.xml +++ b/sdk/spring/azure-spring-boot-samples/azure-spring-boot-sample-servicebus/pom.xml @@ -5,16 +5,17 @@ 4.0.0 - com.microsoft.azure - azure-spring-boot-samples - 1.0.0 - ../pom.xml + org.springframework.boot + spring-boot-starter-parent + 2.3.0.RELEASE + com.azure azure-spring-boot-sample-servicebus + 1.0.0 jar - Azure Service Bus Spring Boot Starter Sample + Azure Spring Boot Starter Sample - Service Bus Sample project for Spring Boot Service Bus Starter https://github.com/Azure/azure-sdk-for-java diff --git a/sdk/spring/azure-spring-boot-samples/azure-spring-boot-sample-storage-blob/pom.xml b/sdk/spring/azure-spring-boot-samples/azure-spring-boot-sample-storage-blob/pom.xml index edc525785e1b7..da8a272d062df 100644 --- a/sdk/spring/azure-spring-boot-samples/azure-spring-boot-sample-storage-blob/pom.xml +++ b/sdk/spring/azure-spring-boot-samples/azure-spring-boot-sample-storage-blob/pom.xml @@ -5,16 +5,17 @@ 4.0.0 - com.microsoft.azure - azure-spring-boot-samples - 1.0.0 - ../pom.xml + org.springframework.boot + spring-boot-starter-parent + 2.3.0.RELEASE + com.azure azure-spring-boot-sample-storage-blob + 1.0.0 jar - Azure Storage Spring Boot Starter Sample + Azure Spring Boot Starter Sample - Storage Blob Sample project for Azure Storage Starter https://github.com/Azure/azure-sdk-for-java diff --git a/sdk/spring/azure-spring-boot-samples/pom.xml b/sdk/spring/azure-spring-boot-samples/pom.xml deleted file mode 100644 index 5f201b3fa860a..0000000000000 --- a/sdk/spring/azure-spring-boot-samples/pom.xml +++ /dev/null @@ -1,81 +0,0 @@ - - - 4.0.0 - - - org.springframework.boot - spring-boot-starter-parent - 2.3.0.RELEASE - - - - com.microsoft.azure - azure-spring-boot-samples - pom - 1.0.0 - - Azure Spring Boot Samples - Samples for Azure Spring Boot - https://github.com/Azure/azure-sdk-for-java - - - - The MIT License (MIT) - http://opensource.org/licenses/MIT - repo - - - - - - microsoft - Microsoft Corporation - - - - - scm:git:git://github.com/azure/azure-sdk-for-java - scm:git:git://github.com/azure/azure-sdk-for-java - https://github.com/azure/azure-sdk-for-java - - - - GitHub - https://github.com/azure/azure-sdk-for-java/issues - - - - 1.8 - UTF-8 - UTF-8 - - - - - - org.springframework.boot - spring-boot-maven-plugin - - - - - - azure-spring-boot-sample-active-directory - azure-spring-boot-sample-active-directory-b2c-oidc - azure-spring-boot-sample-active-directory-backend - azure-spring-boot-sample-active-directory-backend-v2 - azure-spring-boot-sample-active-directory-stateless - azure-spring-boot-sample-cosmosdb - azure-spring-boot-sample-data-gremlin - azure-spring-boot-sample-keyvault-secrets - azure-spring-boot-sample-mediaservices - azure-spring-boot-sample-servicebus - azure-spring-boot-sample-servicebus-jms-queue - azure-spring-boot-sample-servicebus-jms-topic - azure-spring-boot-sample-storage-blob - azure-cloud-foundry-service-sample - - - diff --git a/sdk/spring/azure-spring-boot-test-aad/README.md b/sdk/spring/azure-spring-boot-test-aad/README.md new file mode 100644 index 0000000000000..a20e9ce11abec --- /dev/null +++ b/sdk/spring/azure-spring-boot-test-aad/README.md @@ -0,0 +1,9 @@ +# Azure Spring Boot Integration tests client library for Java + +## Key concepts +## Getting started +## Key concepts +## Examples +## Troubleshooting +## Next steps +## Contributing diff --git a/sdk/spring/azure-spring-boot-tests/azure-spring-boot-test-aad/pom.xml b/sdk/spring/azure-spring-boot-test-aad/pom.xml similarity index 77% rename from sdk/spring/azure-spring-boot-tests/azure-spring-boot-test-aad/pom.xml rename to sdk/spring/azure-spring-boot-test-aad/pom.xml index 4685339f2b049..f263520b730b3 100644 --- a/sdk/spring/azure-spring-boot-tests/azure-spring-boot-test-aad/pom.xml +++ b/sdk/spring/azure-spring-boot-test-aad/pom.xml @@ -3,20 +3,22 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> - azure-spring-boot-tests - com.microsoft.azure - 2.3.3-beta.1 - ../pom.xml + com.azure + azure-client-sdk-parent + 1.7.0 + ../../parents/azure-client-sdk-parent 4.0.0 + com.azure azure-spring-boot-test-aad + 1.0.0 - com.microsoft.azure + com.azure azure-spring-boot-test-core - 2.3.3-beta.1 + 1.0.0 com.microsoft.azure @@ -31,6 +33,10 @@ + + true + + @@ -41,6 +47,7 @@ + com.azure:* com.microsoft.azure:* org.springframework.boot:spring-boot-starter-web:[2.3.0.RELEASE] diff --git a/sdk/spring/azure-spring-boot-tests/azure-spring-boot-test-aad/src/test/java/com/microsoft/azure/test/aad/approle/AADAppRoleStatelessAuthenticationFilterIT.java b/sdk/spring/azure-spring-boot-test-aad/src/test/java/com/microsoft/azure/test/aad/approle/AADAppRoleStatelessAuthenticationFilterIT.java similarity index 100% rename from sdk/spring/azure-spring-boot-tests/azure-spring-boot-test-aad/src/test/java/com/microsoft/azure/test/aad/approle/AADAppRoleStatelessAuthenticationFilterIT.java rename to sdk/spring/azure-spring-boot-test-aad/src/test/java/com/microsoft/azure/test/aad/approle/AADAppRoleStatelessAuthenticationFilterIT.java diff --git a/sdk/spring/azure-spring-boot-tests/azure-spring-boot-test-aad/src/test/java/com/microsoft/azure/test/aad/group/AADAuthenticationFilterIT.java b/sdk/spring/azure-spring-boot-test-aad/src/test/java/com/microsoft/azure/test/aad/group/AADAuthenticationFilterIT.java similarity index 100% rename from sdk/spring/azure-spring-boot-tests/azure-spring-boot-test-aad/src/test/java/com/microsoft/azure/test/aad/group/AADAuthenticationFilterIT.java rename to sdk/spring/azure-spring-boot-test-aad/src/test/java/com/microsoft/azure/test/aad/group/AADAuthenticationFilterIT.java diff --git a/sdk/spring/azure-spring-boot-tests/azure-spring-boot-test-aad/src/test/java/com/microsoft/azure/test/oauth/OAuthResponse.java b/sdk/spring/azure-spring-boot-test-aad/src/test/java/com/microsoft/azure/test/oauth/OAuthResponse.java similarity index 100% rename from sdk/spring/azure-spring-boot-tests/azure-spring-boot-test-aad/src/test/java/com/microsoft/azure/test/oauth/OAuthResponse.java rename to sdk/spring/azure-spring-boot-test-aad/src/test/java/com/microsoft/azure/test/oauth/OAuthResponse.java diff --git a/sdk/spring/azure-spring-boot-tests/azure-spring-boot-test-aad/src/test/java/com/microsoft/azure/test/oauth/OAuthUtils.java b/sdk/spring/azure-spring-boot-test-aad/src/test/java/com/microsoft/azure/test/oauth/OAuthUtils.java similarity index 100% rename from sdk/spring/azure-spring-boot-tests/azure-spring-boot-test-aad/src/test/java/com/microsoft/azure/test/oauth/OAuthUtils.java rename to sdk/spring/azure-spring-boot-test-aad/src/test/java/com/microsoft/azure/test/oauth/OAuthUtils.java diff --git a/sdk/spring/azure-spring-boot-tests/azure-spring-boot-test-application/pom.xml b/sdk/spring/azure-spring-boot-test-application/pom.xml similarity index 86% rename from sdk/spring/azure-spring-boot-tests/azure-spring-boot-test-application/pom.xml rename to sdk/spring/azure-spring-boot-test-application/pom.xml index 0027764d24c23..3eea8727fc7d4 100644 --- a/sdk/spring/azure-spring-boot-tests/azure-spring-boot-test-application/pom.xml +++ b/sdk/spring/azure-spring-boot-test-application/pom.xml @@ -10,9 +10,9 @@ 4.0.0 - com.microsoft.azure + com.azure azure-spring-boot-test-application - 1.0.0 + 1.0.0 jar @@ -25,13 +25,11 @@ org.springframework.boot spring-boot-starter-web - 2.3.0.RELEASE org.springframework.boot spring-boot-starter-test - 2.3.0.RELEASE test diff --git a/sdk/spring/azure-spring-boot-tests/azure-spring-boot-test-application/src/main/java/com/microsoft/azure/config/IncreaseStartupTimeHelper.java b/sdk/spring/azure-spring-boot-test-application/src/main/java/com/microsoft/azure/config/IncreaseStartupTimeHelper.java similarity index 100% rename from sdk/spring/azure-spring-boot-tests/azure-spring-boot-test-application/src/main/java/com/microsoft/azure/config/IncreaseStartupTimeHelper.java rename to sdk/spring/azure-spring-boot-test-application/src/main/java/com/microsoft/azure/config/IncreaseStartupTimeHelper.java diff --git a/sdk/spring/azure-spring-boot-tests/azure-spring-boot-test-application/src/main/java/com/microsoft/azure/test/Application.java b/sdk/spring/azure-spring-boot-test-application/src/main/java/com/microsoft/azure/test/Application.java similarity index 100% rename from sdk/spring/azure-spring-boot-tests/azure-spring-boot-test-application/src/main/java/com/microsoft/azure/test/Application.java rename to sdk/spring/azure-spring-boot-test-application/src/main/java/com/microsoft/azure/test/Application.java diff --git a/sdk/spring/azure-spring-boot-tests/azure-spring-boot-test-application/src/main/resources/application.properties b/sdk/spring/azure-spring-boot-test-application/src/main/resources/application.properties similarity index 100% rename from sdk/spring/azure-spring-boot-tests/azure-spring-boot-test-application/src/main/resources/application.properties rename to sdk/spring/azure-spring-boot-test-application/src/main/resources/application.properties diff --git a/sdk/spring/azure-spring-boot-tests/azure-spring-boot-test-application/src/main/resources/assembly/zip.xml b/sdk/spring/azure-spring-boot-test-application/src/main/resources/assembly/zip.xml similarity index 100% rename from sdk/spring/azure-spring-boot-tests/azure-spring-boot-test-application/src/main/resources/assembly/zip.xml rename to sdk/spring/azure-spring-boot-test-application/src/main/resources/assembly/zip.xml diff --git a/sdk/spring/azure-spring-boot-test-core/README.md b/sdk/spring/azure-spring-boot-test-core/README.md new file mode 100644 index 0000000000000..a20e9ce11abec --- /dev/null +++ b/sdk/spring/azure-spring-boot-test-core/README.md @@ -0,0 +1,9 @@ +# Azure Spring Boot Integration tests client library for Java + +## Key concepts +## Getting started +## Key concepts +## Examples +## Troubleshooting +## Next steps +## Contributing diff --git a/sdk/spring/azure-spring-boot-tests/azure-spring-boot-test-core/pom.xml b/sdk/spring/azure-spring-boot-test-core/pom.xml similarity index 81% rename from sdk/spring/azure-spring-boot-tests/azure-spring-boot-test-core/pom.xml rename to sdk/spring/azure-spring-boot-test-core/pom.xml index 5acfaf3cb63b4..1752fd094fcd1 100644 --- a/sdk/spring/azure-spring-boot-tests/azure-spring-boot-test-core/pom.xml +++ b/sdk/spring/azure-spring-boot-test-core/pom.xml @@ -3,14 +3,16 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> - azure-spring-boot-tests - com.microsoft.azure - 2.3.3-beta.1 - ../pom.xml + com.azure + azure-client-sdk-parent + 1.7.0 + ../../parents/azure-client-sdk-parent 4.0.0 + com.azure azure-spring-boot-test-core + 1.0.0 jar @@ -95,14 +97,14 @@ com.azure:* com.microsoft.azure:* - com.jcraft:jsch:[0.1.53] - com.github.cverges.expect4j:expect4j:[1.6] - org.apache.maven:maven-embedder:[3.6.2] - org.apache.maven:maven-compat:[3.6.2] - org.apache.maven.wagon:wagon-http:[3.3.4] - org.apache.maven.wagon:wagon-provider-api:[3.3.4] - org.eclipse.aether:aether-connector-basic:[1.1.0] - org.eclipse.aether:aether-transport-wagon:[1.1.0] + com.jcraft:jsch:[0.1.53] + com.github.cverges.expect4j:expect4j:[1.6] + org.apache.maven:maven-embedder:[3.6.2] + org.apache.maven:maven-compat:[3.6.2] + org.apache.maven.wagon:wagon-http:[3.3.4] + org.apache.maven.wagon:wagon-provider-api:[3.3.4] + org.eclipse.aether:aether-connector-basic:[1.1.0] + org.eclipse.aether:aether-transport-wagon:[1.1.0] org.springframework.boot:spring-boot:[2.3.0.RELEASE] org.springframework.boot:spring-boot-starter-web:[2.3.0.RELEASE] org.springframework:spring-context:[5.2.6.RELEASE] @@ -111,14 +113,6 @@ - - org.apache.maven.plugins - maven-failsafe-plugin - 2.22.0 - - ${skipSpringITs} - - diff --git a/sdk/spring/azure-spring-boot-tests/azure-spring-boot-test-core/src/main/java/com/microsoft/azure/test/management/Access.java b/sdk/spring/azure-spring-boot-test-core/src/main/java/com/microsoft/azure/test/management/Access.java similarity index 100% rename from sdk/spring/azure-spring-boot-tests/azure-spring-boot-test-core/src/main/java/com/microsoft/azure/test/management/Access.java rename to sdk/spring/azure-spring-boot-test-core/src/main/java/com/microsoft/azure/test/management/Access.java diff --git a/sdk/spring/azure-spring-boot-tests/azure-spring-boot-test-core/src/main/java/com/microsoft/azure/test/management/ClientSecretAccess.java b/sdk/spring/azure-spring-boot-test-core/src/main/java/com/microsoft/azure/test/management/ClientSecretAccess.java similarity index 100% rename from sdk/spring/azure-spring-boot-tests/azure-spring-boot-test-core/src/main/java/com/microsoft/azure/test/management/ClientSecretAccess.java rename to sdk/spring/azure-spring-boot-test-core/src/main/java/com/microsoft/azure/test/management/ClientSecretAccess.java diff --git a/sdk/spring/azure-spring-boot-tests/azure-spring-boot-test-core/src/main/java/com/microsoft/azure/test/utils/AppRunner.java b/sdk/spring/azure-spring-boot-test-core/src/main/java/com/microsoft/azure/test/utils/AppRunner.java similarity index 100% rename from sdk/spring/azure-spring-boot-tests/azure-spring-boot-test-core/src/main/java/com/microsoft/azure/test/utils/AppRunner.java rename to sdk/spring/azure-spring-boot-test-core/src/main/java/com/microsoft/azure/test/utils/AppRunner.java diff --git a/sdk/spring/azure-spring-boot-tests/azure-spring-boot-test-core/src/main/java/com/microsoft/azure/test/utils/MavenBasedProject.java b/sdk/spring/azure-spring-boot-test-core/src/main/java/com/microsoft/azure/test/utils/MavenBasedProject.java similarity index 100% rename from sdk/spring/azure-spring-boot-tests/azure-spring-boot-test-core/src/main/java/com/microsoft/azure/test/utils/MavenBasedProject.java rename to sdk/spring/azure-spring-boot-test-core/src/main/java/com/microsoft/azure/test/utils/MavenBasedProject.java diff --git a/sdk/spring/azure-spring-boot-tests/azure-spring-boot-test-core/src/main/java/com/microsoft/azure/test/utils/SSHShell.java b/sdk/spring/azure-spring-boot-test-core/src/main/java/com/microsoft/azure/test/utils/SSHShell.java similarity index 100% rename from sdk/spring/azure-spring-boot-tests/azure-spring-boot-test-core/src/main/java/com/microsoft/azure/test/utils/SSHShell.java rename to sdk/spring/azure-spring-boot-test-core/src/main/java/com/microsoft/azure/test/utils/SSHShell.java diff --git a/sdk/spring/azure-spring-boot-test-cosmosdb/README.md b/sdk/spring/azure-spring-boot-test-cosmosdb/README.md new file mode 100644 index 0000000000000..a20e9ce11abec --- /dev/null +++ b/sdk/spring/azure-spring-boot-test-cosmosdb/README.md @@ -0,0 +1,9 @@ +# Azure Spring Boot Integration tests client library for Java + +## Key concepts +## Getting started +## Key concepts +## Examples +## Troubleshooting +## Next steps +## Contributing diff --git a/sdk/spring/azure-spring-boot-tests/azure-spring-boot-test-cosmosdb/pom.xml b/sdk/spring/azure-spring-boot-test-cosmosdb/pom.xml similarity index 79% rename from sdk/spring/azure-spring-boot-tests/azure-spring-boot-test-cosmosdb/pom.xml rename to sdk/spring/azure-spring-boot-test-cosmosdb/pom.xml index ca98c2dde5d3d..37f3956c8e7a0 100644 --- a/sdk/spring/azure-spring-boot-tests/azure-spring-boot-test-cosmosdb/pom.xml +++ b/sdk/spring/azure-spring-boot-test-cosmosdb/pom.xml @@ -3,14 +3,16 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> - azure-spring-boot-tests - com.microsoft.azure - 2.3.3-beta.1 - ../pom.xml + com.azure + azure-client-sdk-parent + 1.7.0 + ../../parents/azure-client-sdk-parent 4.0.0 + com.azure azure-spring-boot-test-cosmosdb + 1.0.0 @@ -19,9 +21,9 @@ 2.3.3-beta.1 - com.microsoft.azure + com.azure azure-spring-boot-test-core - 2.3.3-beta.1 + 1.0.0 org.springframework.boot @@ -31,6 +33,10 @@ + + true + + diff --git a/sdk/spring/azure-spring-boot-tests/azure-spring-boot-test-cosmosdb/src/test/java/com/microsoft/azure/test/cosmosdb/CosmosDBIT.java b/sdk/spring/azure-spring-boot-test-cosmosdb/src/test/java/com/microsoft/azure/test/cosmosdb/CosmosDBIT.java similarity index 100% rename from sdk/spring/azure-spring-boot-tests/azure-spring-boot-test-cosmosdb/src/test/java/com/microsoft/azure/test/cosmosdb/CosmosDBIT.java rename to sdk/spring/azure-spring-boot-test-cosmosdb/src/test/java/com/microsoft/azure/test/cosmosdb/CosmosDBIT.java diff --git a/sdk/spring/azure-spring-boot-tests/azure-spring-boot-test-cosmosdb/src/test/java/com/microsoft/azure/test/cosmosdb/DummyApp.java b/sdk/spring/azure-spring-boot-test-cosmosdb/src/test/java/com/microsoft/azure/test/cosmosdb/DummyApp.java similarity index 100% rename from sdk/spring/azure-spring-boot-tests/azure-spring-boot-test-cosmosdb/src/test/java/com/microsoft/azure/test/cosmosdb/DummyApp.java rename to sdk/spring/azure-spring-boot-test-cosmosdb/src/test/java/com/microsoft/azure/test/cosmosdb/DummyApp.java diff --git a/sdk/spring/azure-spring-boot-tests/azure-spring-boot-test-cosmosdb/src/test/java/com/microsoft/azure/test/cosmosdb/User.java b/sdk/spring/azure-spring-boot-test-cosmosdb/src/test/java/com/microsoft/azure/test/cosmosdb/User.java similarity index 100% rename from sdk/spring/azure-spring-boot-tests/azure-spring-boot-test-cosmosdb/src/test/java/com/microsoft/azure/test/cosmosdb/User.java rename to sdk/spring/azure-spring-boot-test-cosmosdb/src/test/java/com/microsoft/azure/test/cosmosdb/User.java diff --git a/sdk/spring/azure-spring-boot-tests/azure-spring-boot-test-cosmosdb/src/test/java/com/microsoft/azure/test/cosmosdb/UserRepository.java b/sdk/spring/azure-spring-boot-test-cosmosdb/src/test/java/com/microsoft/azure/test/cosmosdb/UserRepository.java similarity index 100% rename from sdk/spring/azure-spring-boot-tests/azure-spring-boot-test-cosmosdb/src/test/java/com/microsoft/azure/test/cosmosdb/UserRepository.java rename to sdk/spring/azure-spring-boot-test-cosmosdb/src/test/java/com/microsoft/azure/test/cosmosdb/UserRepository.java diff --git a/sdk/spring/azure-spring-boot-tests/azure-spring-boot-test-cosmosdb/test-resources.json b/sdk/spring/azure-spring-boot-test-cosmosdb/test-resources.json similarity index 100% rename from sdk/spring/azure-spring-boot-tests/azure-spring-boot-test-cosmosdb/test-resources.json rename to sdk/spring/azure-spring-boot-test-cosmosdb/test-resources.json diff --git a/sdk/spring/azure-spring-boot-test-keyvault/README.md b/sdk/spring/azure-spring-boot-test-keyvault/README.md new file mode 100644 index 0000000000000..a20e9ce11abec --- /dev/null +++ b/sdk/spring/azure-spring-boot-test-keyvault/README.md @@ -0,0 +1,9 @@ +# Azure Spring Boot Integration tests client library for Java + +## Key concepts +## Getting started +## Key concepts +## Examples +## Troubleshooting +## Next steps +## Contributing diff --git a/sdk/spring/azure-spring-boot-tests/azure-spring-boot-test-keyvault/pom.xml b/sdk/spring/azure-spring-boot-test-keyvault/pom.xml similarity index 81% rename from sdk/spring/azure-spring-boot-tests/azure-spring-boot-test-keyvault/pom.xml rename to sdk/spring/azure-spring-boot-test-keyvault/pom.xml index 8f413b404d1cd..d206c8c9c94b2 100644 --- a/sdk/spring/azure-spring-boot-tests/azure-spring-boot-test-keyvault/pom.xml +++ b/sdk/spring/azure-spring-boot-test-keyvault/pom.xml @@ -3,14 +3,16 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> - azure-spring-boot-tests - com.microsoft.azure - 2.3.3-beta.1 - ../pom.xml + com.azure + azure-client-sdk-parent + 1.7.0 + ../../parents/azure-client-sdk-parent 4.0.0 + com.azure azure-spring-boot-test-keyvault + 1.0.0 @@ -35,9 +37,9 @@ 2.3.3-beta.1 - com.microsoft.azure + com.azure azure-spring-boot-test-core - 2.3.3-beta.1 + 1.0.0 com.microsoft.azure @@ -54,9 +56,12 @@ - + + true + + @@ -67,9 +72,10 @@ + com.azure:* com.microsoft.azure:* - org.springframework.boot:spring-boot-starter-actuator:[2.3.0.RELEASE] - org.springframework.boot:spring-boot-starter-web:[2.3.0.RELEASE] + org.springframework.boot:spring-boot-starter-actuator:[2.3.0.RELEASE] + org.springframework.boot:spring-boot-starter-web:[2.3.0.RELEASE] diff --git a/sdk/spring/azure-spring-boot-tests/azure-spring-boot-test-keyvault/src/test/java/com/microsoft/azure/test/keyvault/ActuatorIT.java b/sdk/spring/azure-spring-boot-test-keyvault/src/test/java/com/microsoft/azure/test/keyvault/ActuatorIT.java similarity index 100% rename from sdk/spring/azure-spring-boot-tests/azure-spring-boot-test-keyvault/src/test/java/com/microsoft/azure/test/keyvault/ActuatorIT.java rename to sdk/spring/azure-spring-boot-test-keyvault/src/test/java/com/microsoft/azure/test/keyvault/ActuatorIT.java diff --git a/sdk/spring/azure-spring-boot-tests/azure-spring-boot-test-keyvault/src/test/java/com/microsoft/azure/test/keyvault/KeyVaultIT.java b/sdk/spring/azure-spring-boot-test-keyvault/src/test/java/com/microsoft/azure/test/keyvault/KeyVaultIT.java similarity index 100% rename from sdk/spring/azure-spring-boot-tests/azure-spring-boot-test-keyvault/src/test/java/com/microsoft/azure/test/keyvault/KeyVaultIT.java rename to sdk/spring/azure-spring-boot-test-keyvault/src/test/java/com/microsoft/azure/test/keyvault/KeyVaultIT.java diff --git a/sdk/spring/azure-spring-boot-tests/azure-spring-boot-test-keyvault/src/test/java/com/microsoft/azure/test/keyvault/MultipleKeyVaultsIT.java b/sdk/spring/azure-spring-boot-test-keyvault/src/test/java/com/microsoft/azure/test/keyvault/MultipleKeyVaultsIT.java similarity index 100% rename from sdk/spring/azure-spring-boot-tests/azure-spring-boot-test-keyvault/src/test/java/com/microsoft/azure/test/keyvault/MultipleKeyVaultsIT.java rename to sdk/spring/azure-spring-boot-test-keyvault/src/test/java/com/microsoft/azure/test/keyvault/MultipleKeyVaultsIT.java diff --git a/sdk/spring/azure-spring-boot-tests/azure-spring-boot-test-keyvault/test-resources.json b/sdk/spring/azure-spring-boot-test-keyvault/test-resources.json similarity index 100% rename from sdk/spring/azure-spring-boot-tests/azure-spring-boot-test-keyvault/test-resources.json rename to sdk/spring/azure-spring-boot-test-keyvault/test-resources.json diff --git a/sdk/spring/azure-spring-boot-tests/README.md b/sdk/spring/azure-spring-boot-tests/README.md deleted file mode 100644 index 928b7a2efe585..0000000000000 --- a/sdk/spring/azure-spring-boot-tests/README.md +++ /dev/null @@ -1,18 +0,0 @@ -#Azure Spring Boot Integration tests client library for Java - -## Key concepts -The structure of integration tests are organized as: - -- azure-spring-boot-tests (top folder for integration tests) - - azure-spring-boot-test-core (common code shared by integration tests) - - azure-spring-boot-test-keyvault (integration tests for key vault starter) - - azure-spring-boot-test-aad (integration tests for aad starter) - - azure-spring-boot-test-cosmosdb (integration tests for cosmos starter) - - azure-spring-boot-test-application (an application used by other integration tests) - -## Getting started -## Key concepts -## Examples -## Troubleshooting -## Next steps -## Contributing diff --git a/sdk/spring/azure-spring-boot-tests/pom.xml b/sdk/spring/azure-spring-boot-tests/pom.xml deleted file mode 100644 index 2647b21503a58..0000000000000 --- a/sdk/spring/azure-spring-boot-tests/pom.xml +++ /dev/null @@ -1,35 +0,0 @@ - - - - 4.0.0 - - - com.azure - azure-client-sdk-parent - 1.7.0 - ../../parents/azure-client-sdk-parent - - - com.microsoft.azure - azure-spring-boot-tests - 2.3.3-beta.1 - pom - - Azure Spring Boot Tests - Tests for Azure Spring Boot - - - azure-spring-boot-test-core - azure-spring-boot-test-application - azure-spring-boot-test-aad - azure-spring-boot-test-cosmosdb - azure-spring-boot-test-keyvault - - - - true - - - diff --git a/sdk/spring/ci.yml b/sdk/spring/ci.yml index 7ccde32252d21..a2cfbd7ba4e17 100644 --- a/sdk/spring/ci.yml +++ b/sdk/spring/ci.yml @@ -56,31 +56,29 @@ extends: groupId: com.microsoft.azure safeName: azurespringbootstarterservicebusjms AdditionalModules: - - name: azure-spring-boot-samples - groupId: com.microsoft.azure - name: azure-spring-boot-sample-active-directory - groupId: com.microsoft.azure + groupId: com.azure - name: azure-spring-boot-sample-active-directory-b2c-oidc - groupId: com.microsoft.azure + groupId: com.azure - name: azure-spring-boot-sample-active-directory-backend - groupId: com.microsoft.azure + groupId: com.azure - name: azure-spring-boot-sample-active-directory-backend-v2 - groupId: com.microsoft.azure + groupId: com.azure - name: azure-spring-boot-sample-active-directory-stateless - groupId: com.microsoft.azure + groupId: com.azure - name: azure-spring-boot-sample-cosmosdb - groupId: com.microsoft.azure + groupId: com.azure - name: azure-spring-boot-sample-data-gremlin - groupId: com.microsoft.azure + groupId: com.azure - name: azure-spring-boot-sample-keyvault-secrets - groupId: com.microsoft.azure + groupId: com.azure - name: azure-spring-boot-sample-mediaservices - groupId: com.microsoft.azure + groupId: com.azure - name: azure-spring-boot-sample-servicebus - groupId: com.microsoft.azure + groupId: com.azure - name: azure-spring-boot-sample-servicebus-jms-queue - groupId: com.microsoft.azure + groupId: com.azure - name: azure-spring-boot-sample-servicebus-jms-topic - groupId: com.microsoft.azure + groupId: com.azure - name: azure-spring-boot-sample-storage-blob - groupId: com.microsoft.azure + groupId: com.azure diff --git a/sdk/spring/pom.xml b/sdk/spring/pom.xml index b9e7c1e1216c7..3ff7a064ef50a 100644 --- a/sdk/spring/pom.xml +++ b/sdk/spring/pom.xml @@ -18,8 +18,25 @@ azure-spring-boot-starter-keyvault-secrets azure-spring-boot-starter-metrics azure-spring-boot-starter-servicebus-jms - azure-spring-boot-samples - azure-spring-boot-tests + azure-spring-boot-test-application + azure-spring-boot-test-core + azure-spring-boot-test-aad + azure-spring-boot-test-cosmosdb + azure-spring-boot-test-keyvault + azure-spring-boot-samples/azure-spring-boot-sample-active-directory + azure-spring-boot-samples/azure-spring-boot-sample-active-directory-b2c-oidc + azure-spring-boot-samples/azure-spring-boot-sample-active-directory-backend + azure-spring-boot-samples/azure-spring-boot-sample-active-directory-backend-v2 + azure-spring-boot-samples/azure-spring-boot-sample-active-directory-stateless + azure-spring-boot-samples/azure-spring-boot-sample-cosmosdb + azure-spring-boot-samples/azure-spring-boot-sample-data-gremlin + azure-spring-boot-samples/azure-spring-boot-sample-keyvault-secrets + azure-spring-boot-samples/azure-spring-boot-sample-mediaservices + azure-spring-boot-samples/azure-spring-boot-sample-servicebus + azure-spring-boot-samples/azure-spring-boot-sample-servicebus-jms-queue + azure-spring-boot-samples/azure-spring-boot-sample-servicebus-jms-topic + azure-spring-boot-samples/azure-spring-boot-sample-storage-blob + azure-spring-boot-samples/azure-cloud-foundry-service-sample diff --git a/sdk/spring/tests.yml b/sdk/spring/tests.yml index 0a51f922ad7be..df60d67043f00 100644 --- a/sdk/spring/tests.yml +++ b/sdk/spring/tests.yml @@ -10,23 +10,21 @@ jobs: goals: "verify" Artifacts: - - name: azure-spring-boot-tests - groupId: com.microsoft.azure - safeName: azurespringboot-tests + - name: azure-spring-boot-test-application + groupId: com.azure + safeName: azurespringboottestapplication - name: azure-spring-boot-test-core - groupId: com.microsoft.azure + groupId: com.azure safeName: azurespringboottestcore - name: azure-spring-boot-test-cosmosdb - groupId: com.microsoft.azure + groupId: com.azure safeName: azurespringboottestcosmosdb - name: azure-spring-boot-test-aad - groupId: com.microsoft.azure + groupId: com.azure safeName: azurespringboottestaad - name: azure-spring-boot-test-keyvault - groupId: com.microsoft.azure + groupId: com.azure safeName: azurespringboottestkeyvault - - name: azure-spring-boot-test-application - groupId: com.microsoft.azure - safeName: azurespringboottestapplication + EnvVars: AZURE_TEST_MODE: LIVE From eadf80dbd89dd17a95e749e3b7622b0091da739c Mon Sep 17 00:00:00 2001 From: Connie Yau Date: Fri, 10 Jul 2020 00:56:22 -0700 Subject: [PATCH 082/129] Updates prefetch algorithm and test updates. (#12975) * Remove parentConnection from link processor. * Add comment for lock tokens on received messages. * Using prefetch buffer. * Add logic for emptyCreditListener when empty. * Pass prefetch into parameter when publishing. * Consider ReceiveMode when using prefetch so we continue to fetch. --- .../servicebus/ServiceBusAsyncConsumer.java | 4 +- .../ServiceBusReceiverAsyncClient.java | 9 +- .../servicebus/UnnamedSessionReceiver.java | 11 +- .../ServiceBusReceiveLinkProcessor.java | 159 +++++++++++------ .../ServiceBusAsyncConsumerTest.java | 15 +- ...ceBusSenderAsyncClientIntegrationTest.java | 8 +- .../servicebus/UnnamedSessionManagerTest.java | 133 +++++++++++--- .../ServiceBusReceiveLinkProcessorTest.java | 163 ++++++++++-------- 8 files changed, 334 insertions(+), 168 deletions(-) diff --git a/sdk/servicebus/azure-messaging-servicebus/src/main/java/com/azure/messaging/servicebus/ServiceBusAsyncConsumer.java b/sdk/servicebus/azure-messaging-servicebus/src/main/java/com/azure/messaging/servicebus/ServiceBusAsyncConsumer.java index 590fb39637fab..d0bd513da33b0 100644 --- a/sdk/servicebus/azure-messaging-servicebus/src/main/java/com/azure/messaging/servicebus/ServiceBusAsyncConsumer.java +++ b/sdk/servicebus/azure-messaging-servicebus/src/main/java/com/azure/messaging/servicebus/ServiceBusAsyncConsumer.java @@ -29,13 +29,13 @@ class ServiceBusAsyncConsumer implements AutoCloseable { private final Flux processor; ServiceBusAsyncConsumer(String linkName, ServiceBusReceiveLinkProcessor linkProcessor, - MessageSerializer messageSerializer) { + MessageSerializer messageSerializer, int prefetch) { this.linkName = linkName; this.linkProcessor = linkProcessor; this.messageSerializer = messageSerializer; this.processor = linkProcessor .map(message -> this.messageSerializer.deserialize(message, ServiceBusReceivedMessage.class)) - .publish() + .publish(prefetch) .autoConnect(1); } diff --git a/sdk/servicebus/azure-messaging-servicebus/src/main/java/com/azure/messaging/servicebus/ServiceBusReceiverAsyncClient.java b/sdk/servicebus/azure-messaging-servicebus/src/main/java/com/azure/messaging/servicebus/ServiceBusReceiverAsyncClient.java index 9a4c29faade1d..164f8fcae3f4a 100644 --- a/sdk/servicebus/azure-messaging-servicebus/src/main/java/com/azure/messaging/servicebus/ServiceBusReceiverAsyncClient.java +++ b/sdk/servicebus/azure-messaging-servicebus/src/main/java/com/azure/messaging/servicebus/ServiceBusReceiverAsyncClient.java @@ -6,7 +6,6 @@ import com.azure.core.amqp.AmqpRetryPolicy; import com.azure.core.amqp.AmqpTransaction; import com.azure.core.amqp.exception.AmqpException; -import com.azure.core.amqp.exception.LinkErrorContext; import com.azure.core.amqp.implementation.MessageSerializer; import com.azure.core.amqp.implementation.RetryUtil; import com.azure.core.amqp.implementation.StringUtil; @@ -1255,14 +1254,12 @@ private ServiceBusAsyncConsumer getOrCreateConsumer() { }) .repeat(); - final LinkErrorContext context = new LinkErrorContext(fullyQualifiedNamespace, entityPath, linkName, - null); final AmqpRetryPolicy retryPolicy = RetryUtil.getRetryPolicy(connectionProcessor.getRetryOptions()); final ServiceBusReceiveLinkProcessor linkMessageProcessor = receiveLink.subscribeWith( - new ServiceBusReceiveLinkProcessor(receiverOptions.getPrefetchCount(), retryPolicy, connectionProcessor, - context)); + new ServiceBusReceiveLinkProcessor(receiverOptions.getPrefetchCount(), retryPolicy, + receiverOptions.getReceiveMode())); final ServiceBusAsyncConsumer newConsumer = new ServiceBusAsyncConsumer(linkName, linkMessageProcessor, - messageSerializer); + messageSerializer, receiverOptions.getPrefetchCount()); // There could have been multiple threads trying to create this async consumer when the result was null. // If another one had set the value while we were creating this resource, dispose of newConsumer. diff --git a/sdk/servicebus/azure-messaging-servicebus/src/main/java/com/azure/messaging/servicebus/UnnamedSessionReceiver.java b/sdk/servicebus/azure-messaging-servicebus/src/main/java/com/azure/messaging/servicebus/UnnamedSessionReceiver.java index 079ae05b268d8..a141e9621a081 100644 --- a/sdk/servicebus/azure-messaging-servicebus/src/main/java/com/azure/messaging/servicebus/UnnamedSessionReceiver.java +++ b/sdk/servicebus/azure-messaging-servicebus/src/main/java/com/azure/messaging/servicebus/UnnamedSessionReceiver.java @@ -86,8 +86,12 @@ class UnnamedSessionReceiver implements AutoCloseable { final ServiceBusReceivedMessage deserialized = messageSerializer.deserialize(message, ServiceBusReceivedMessage.class); + //TODO (conniey): For session receivers, do they have a message lock token? if (!CoreUtils.isNullOrEmpty(deserialized.getLockToken())) { lockContainer.addOrUpdate(deserialized.getLockToken(), deserialized.getLockedUntil()); + } else { + logger.info("sessionId[{}] message[{}]. There is no lock token.", + deserialized.getSessionId(), deserialized.getMessageId()); } return new ServiceBusReceivedMessageContext(deserialized); @@ -101,9 +105,12 @@ class UnnamedSessionReceiver implements AutoCloseable { return; } - final String token = CoreUtils.isNullOrEmpty(context.getMessage().getLockToken()) - ? context.getMessage().getLockToken() + final ServiceBusReceivedMessage message = context.getMessage(); + final String token = !CoreUtils.isNullOrEmpty(message.getLockToken()) + ? message.getLockToken() : ""; + + logger.verbose("Received sessionId[{}] messageId[{}]", context.getSessionId(), message.getMessageId()); messageReceivedSink.next(token); }); diff --git a/sdk/servicebus/azure-messaging-servicebus/src/main/java/com/azure/messaging/servicebus/implementation/ServiceBusReceiveLinkProcessor.java b/sdk/servicebus/azure-messaging-servicebus/src/main/java/com/azure/messaging/servicebus/implementation/ServiceBusReceiveLinkProcessor.java index 5fecd4d570d7c..98d2eddd32e95 100644 --- a/sdk/servicebus/azure-messaging-servicebus/src/main/java/com/azure/messaging/servicebus/implementation/ServiceBusReceiveLinkProcessor.java +++ b/sdk/servicebus/azure-messaging-servicebus/src/main/java/com/azure/messaging/servicebus/implementation/ServiceBusReceiveLinkProcessor.java @@ -5,9 +5,9 @@ import com.azure.core.amqp.AmqpEndpointState; import com.azure.core.amqp.AmqpRetryPolicy; -import com.azure.core.amqp.exception.AmqpErrorContext; import com.azure.core.amqp.implementation.AmqpReceiveLink; import com.azure.core.util.logging.ClientLogger; +import com.azure.messaging.servicebus.models.ReceiveMode; import org.apache.qpid.proton.amqp.transport.DeliveryState; import org.apache.qpid.proton.message.Message; import org.reactivestreams.Subscription; @@ -42,20 +42,25 @@ public class ServiceBusReceiveLinkProcessor extends FluxProcessor messageQueue = new ConcurrentLinkedDeque<>(); - private final AtomicBoolean hasFirstLink = new AtomicBoolean(); private final AtomicBoolean linkCreditsAdded = new AtomicBoolean(); private final AtomicReference linkName = new AtomicReference<>(); + // Queue containing all the prefetched messages. + private final Deque messageQueue = new ConcurrentLinkedDeque<>(); + // size() on Deque is O(n) operation, so we use an integer to keep track. All reads and writes to this are gated by + // the `queueLock`. + private final AtomicInteger pendingMessages = new AtomicInteger(); + private final int minimumNumberOfMessages; + private final int prefetch; + private final AtomicReference> downstream = new AtomicReference<>(); private final AtomicInteger wip = new AtomicInteger(); - private final int prefetch; private final AmqpRetryPolicy retryPolicy; - private final Disposable parentConnection; - private final AmqpErrorContext errorContext; + private final ReceiveMode receiveMode; private volatile Throwable lastError; private volatile boolean isCancelled; @@ -78,39 +83,29 @@ public class ServiceBusReceiveLinkProcessor extends FluxProcessor updateDisposition(String lockToken, DeliveryState deliveryState) { if (isDisposed()) { return monoError(logger, new IllegalStateException(String.format( @@ -123,7 +118,15 @@ public Mono updateDisposition(String lockToken, DeliveryState deliveryStat "lockToken[%s]. state[%s]. Cannot update disposition with no link.", lockToken, deliveryState))); } - return link.updateDisposition(lockToken, deliveryState); + return link.updateDisposition(lockToken, deliveryState) + .then(Mono.fromRunnable(() -> { + // Check if we should add more credits. + synchronized (queueLock) { + pendingMessages.decrementAndGet(); + } + + checkAndAddCredits(link); + })); } /** @@ -196,17 +199,20 @@ public void onNext(ServiceBusReceiveLink next) { oldSubscription = currentLinkSubscriptions; currentLink = next; + next.setEmptyCreditListener(() -> { + final int creditsToAdd = getCreditsToAdd(0); + linkCreditsAdded.set(creditsToAdd > 0); - if (!hasFirstLink.getAndSet(true)) { - linkCreditsAdded.set(true); - next.addCredits(prefetch); - } - - next.setEmptyCreditListener(() -> getCreditsToAdd()); + return creditsToAdd; + }); currentLinkSubscriptions = Disposables.composite( next.receive().publishOn(Schedulers.boundedElastic()).subscribe(message -> { - messageQueue.add(message); + synchronized (queueLock) { + messageQueue.add(message); + pendingMessages.incrementAndGet(); + } + drain(); }), next.getEndpointStates().subscribe( @@ -221,9 +227,11 @@ public void onNext(ServiceBusReceiveLink next) { onError(error); }, () -> { - if (parentConnection.isDisposed() || isTerminated() - || upstream == Operators.cancelledSubscription()) { - logger.info("Terminal state reached. Disposing of link processor."); + if (isTerminated()) { + logger.info("Processor is terminated. Disposing of link processor."); + dispose(); + } else if (upstream == Operators.cancelledSubscription()) { + logger.info("Upstream has completed. Disposing of link processor."); dispose(); } else { logger.info("Receive link endpoint states are closed. Requesting another."); @@ -239,6 +247,8 @@ public void onNext(ServiceBusReceiveLink next) { })); } + checkAndAddCredits(next); + if (oldChannel != null) { oldChannel.dispose(); } @@ -313,7 +323,7 @@ public void onError(Throwable throwable) { final String linkName = link != null ? link.getLinkName() : "n/a"; final String entityPath = link != null ? link.getEntityPath() : "n/a"; - if (retryInterval != null && !parentConnection.isDisposed() && upstream != Operators.cancelledSubscription()) { + if (retryInterval != null && upstream != Operators.cancelledSubscription()) { logger.warning("linkName[{}] entityPath[{}]. Transient error occurred. Attempt: {}. Retrying after {} ms.", linkName, entityPath, attempt, retryInterval.toMillis(), throwable); @@ -322,10 +332,6 @@ public void onError(Throwable throwable) { return; } - if (parentConnection.isDisposed()) { - logger.info("Parent connection is disposed. Not reopening on error."); - } - logger.warning("linkName[{}] entityPath[{}]. Non-retryable error occurred in AMQP receive link.", linkName, entityPath, throwable); lastError = throwable; @@ -371,12 +377,11 @@ public void request(long request) { Operators.addCap(REQUESTED, this, request); final AmqpReceiveLink link = currentLink; - if (link != null && !linkCreditsAdded.getAndSet(true)) { - int credits = getCreditsToAdd(); - logger.info("Link credits not yet added. Adding: {}", credits); - link.addCredits(credits); + if (link == null) { + return; } + checkAndAddCredits(link); drain(); } @@ -469,19 +474,30 @@ private void drainQueue() { break; } - Message message = messageQueue.poll(); + final Message message = messageQueue.poll(); if (message == null) { break; } if (isCancelled) { Operators.onDiscard(message, subscriber.currentContext()); - Operators.onDiscardQueueWithClear(messageQueue, subscriber.currentContext(), null); + + synchronized (queueLock) { + Operators.onDiscardQueueWithClear(messageQueue, subscriber.currentContext(), null); + pendingMessages.set(0); + } + return; } try { subscriber.onNext(message); + + // These don't have to be settled because they're automatically settled by the link, so we + // decrement the count. + if (receiveMode != ReceiveMode.PEEK_LOCK) { + pendingMessages.decrementAndGet(); + } } catch (Exception e) { logger.error("Exception occurred while handling downstream onNext operation.", e); throw logger.logExceptionAsError(Exceptions.propagate( @@ -515,22 +531,63 @@ private boolean checkAndSetTerminated() { currentLink.dispose(); } - messageQueue.clear(); + synchronized (queueLock) { + messageQueue.clear(); + pendingMessages.set(0); + } + return true; } - private int getCreditsToAdd() { + private void checkAndAddCredits(AmqpReceiveLink link) { + if (link == null) { + return; + } + + // Credits have already been added to the link. We won't try again. + if (linkCreditsAdded.getAndSet(true)) { + return; + } + + final int credits = getCreditsToAdd(link.getCredits()); + linkCreditsAdded.set(credits > 0); + + logger.info("Link credits to add. Credits: '{}'", credits); + + if (credits > 0) { + link.addCredits(credits); + } + } + + private int getCreditsToAdd(int linkCredits) { final CoreSubscriber subscriber = downstream.get(); final long r = requested; + final boolean hasBackpressure = r != Long.MAX_VALUE; + if (subscriber == null || r == 0) { logger.info("Not adding credits. No downstream subscribers or items requested."); - linkCreditsAdded.set(false); return 0; } - linkCreditsAdded.set(true); + final int creditsToAdd; + if (messageQueue.isEmpty() && !hasBackpressure) { + creditsToAdd = prefetch; + } else { + synchronized (queueLock) { + final int queuedMessages = pendingMessages.get(); + final int pending = queuedMessages + linkCredits; + + if (hasBackpressure) { + creditsToAdd = Math.max(Long.valueOf(r).intValue() - pending, 0); + } else { + // If the queue has less than 1/3 of the prefetch, then add the difference to keep the queue full. + creditsToAdd = minimumNumberOfMessages >= queuedMessages + ? Math.max(prefetch - pending, 1) + : 0; + } + } + } - // If there is no back pressure, always add 1. Otherwise, add whatever is requested. - return r == Long.MAX_VALUE ? 1 : Long.valueOf(r).intValue(); + return creditsToAdd; } } diff --git a/sdk/servicebus/azure-messaging-servicebus/src/test/java/com/azure/messaging/servicebus/ServiceBusAsyncConsumerTest.java b/sdk/servicebus/azure-messaging-servicebus/src/test/java/com/azure/messaging/servicebus/ServiceBusAsyncConsumerTest.java index e0925bdb2d30b..aa1ae3a2c413d 100644 --- a/sdk/servicebus/azure-messaging-servicebus/src/test/java/com/azure/messaging/servicebus/ServiceBusAsyncConsumerTest.java +++ b/sdk/servicebus/azure-messaging-servicebus/src/test/java/com/azure/messaging/servicebus/ServiceBusAsyncConsumerTest.java @@ -5,12 +5,12 @@ import com.azure.core.amqp.AmqpEndpointState; import com.azure.core.amqp.AmqpRetryPolicy; -import com.azure.core.amqp.exception.AmqpErrorContext; import com.azure.core.amqp.implementation.MessageSerializer; import com.azure.core.util.logging.ClientLogger; import com.azure.messaging.servicebus.implementation.ServiceBusAmqpConnection; import com.azure.messaging.servicebus.implementation.ServiceBusReceiveLink; import com.azure.messaging.servicebus.implementation.ServiceBusReceiveLinkProcessor; +import com.azure.messaging.servicebus.models.ReceiveMode; import org.apache.qpid.proton.amqp.transport.DeliveryState; import org.apache.qpid.proton.message.Message; import org.junit.jupiter.api.AfterAll; @@ -22,7 +22,6 @@ import org.mockito.Mock; import org.mockito.Mockito; import org.mockito.MockitoAnnotations; -import reactor.core.Disposable; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; import reactor.test.StepVerifier; @@ -61,8 +60,6 @@ class ServiceBusAsyncConsumerTest { @Mock private AmqpRetryPolicy retryPolicy; @Mock - private Disposable parentConnection; - @Mock private MessageSerializer serializer; @BeforeAll @@ -84,7 +81,7 @@ void setup(TestInfo testInfo) { when(link.getEndpointStates()).thenReturn(endpointStateFlux); when(link.receive()).thenReturn(messageFlux); linkProcessor = linkFlux.subscribeWith(new ServiceBusReceiveLinkProcessor(10, retryPolicy, - parentConnection, new AmqpErrorContext("a-namespace"))); + ReceiveMode.RECEIVE_AND_DELETE)); when(connection.getEndpointStates()).thenReturn(Flux.create(sink -> sink.next(AmqpEndpointState.ACTIVE))); when(link.updateDisposition(anyString(), any(DeliveryState.class))).thenReturn(Mono.empty()); @@ -108,7 +105,9 @@ void teardown(TestInfo testInfo) { @Test void receiveNoAutoComplete() { // Arrange - final ServiceBusAsyncConsumer consumer = new ServiceBusAsyncConsumer(LINK_NAME, linkProcessor, serializer); + final int prefetch = 10; + final ServiceBusAsyncConsumer consumer = new ServiceBusAsyncConsumer(LINK_NAME, linkProcessor, serializer, + prefetch); final Message message1 = mock(Message.class); final Message message2 = mock(Message.class); @@ -145,8 +144,10 @@ void receiveNoAutoComplete() { @Test void canDispose() { // Arrange + final int prefetch = 10; final String lockToken = UUID.randomUUID().toString(); - final ServiceBusAsyncConsumer consumer = new ServiceBusAsyncConsumer(LINK_NAME, linkProcessor, serializer); + final ServiceBusAsyncConsumer consumer = new ServiceBusAsyncConsumer(LINK_NAME, linkProcessor, serializer, + prefetch); final Message message1 = mock(Message.class); final ServiceBusReceivedMessage receivedMessage1 = mock(ServiceBusReceivedMessage.class); diff --git a/sdk/servicebus/azure-messaging-servicebus/src/test/java/com/azure/messaging/servicebus/ServiceBusSenderAsyncClientIntegrationTest.java b/sdk/servicebus/azure-messaging-servicebus/src/test/java/com/azure/messaging/servicebus/ServiceBusSenderAsyncClientIntegrationTest.java index a602c75f8582d..34d81c258099f 100644 --- a/sdk/servicebus/azure-messaging-servicebus/src/test/java/com/azure/messaging/servicebus/ServiceBusSenderAsyncClientIntegrationTest.java +++ b/sdk/servicebus/azure-messaging-servicebus/src/test/java/com/azure/messaging/servicebus/ServiceBusSenderAsyncClientIntegrationTest.java @@ -247,20 +247,24 @@ void transactionMessageSendAndCompleteTransaction(MessagingEntityType entityType if (isCommit) { StepVerifier.create(sender.commitTransaction(transaction.get()).delaySubscription(Duration.ofSeconds(1))) .verifyComplete(); - StepVerifier.create(receiver.receiveMessages().take(total).timeout(shortTimeout)) + StepVerifier.create(receiver.receiveMessages().take(total)) .assertNext(receivedMessage -> { + System.out.println("1"); assertMessageEquals(receivedMessage, messageId, isSessionEnabled); messagesPending.decrementAndGet(); }) .assertNext(receivedMessage -> { + System.out.println("2"); assertMessageEquals(receivedMessage, messageId, isSessionEnabled); messagesPending.decrementAndGet(); }) .assertNext(receivedMessage -> { + System.out.println("3"); assertMessageEquals(receivedMessage, messageId, isSessionEnabled); messagesPending.decrementAndGet(); }) - .verifyComplete(); + .expectComplete() + .verify(shortTimeout); } else { StepVerifier.create(sender.rollbackTransaction(transaction.get()).delaySubscription(Duration.ofSeconds(1))) .verifyComplete(); diff --git a/sdk/servicebus/azure-messaging-servicebus/src/test/java/com/azure/messaging/servicebus/UnnamedSessionManagerTest.java b/sdk/servicebus/azure-messaging-servicebus/src/test/java/com/azure/messaging/servicebus/UnnamedSessionManagerTest.java index fd206b4444017..9dacc8031c5f2 100644 --- a/sdk/servicebus/azure-messaging-servicebus/src/test/java/com/azure/messaging/servicebus/UnnamedSessionManagerTest.java +++ b/sdk/servicebus/azure-messaging-servicebus/src/test/java/com/azure/messaging/servicebus/UnnamedSessionManagerTest.java @@ -37,10 +37,13 @@ import reactor.core.publisher.ReplayProcessor; import reactor.core.scheduler.Schedulers; import reactor.test.StepVerifier; +import reactor.test.publisher.TestPublisher; import java.time.Duration; import java.time.Instant; import java.util.Collections; +import java.util.concurrent.Callable; +import java.util.concurrent.atomic.AtomicInteger; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNull; @@ -122,11 +125,16 @@ void beforeEach(TestInfo testInfo) { @AfterEach void afterEach(TestInfo testInfo) { logger.info("===== [{}] Tearing down. =====", testInfo.getDisplayName()); - Mockito.framework().clearInlineMocks(); if (sessionManager != null) { sessionManager.close(); } + + if (connectionProcessor != null) { + connectionProcessor.dispose(); + } + + Mockito.framework().clearInlineMocks(); } @Test @@ -148,8 +156,8 @@ void receiveNull() { @Test void singleUnnamedSession() { // Arrange - ReceiverOptions receiverOptions = new ReceiverOptions(ReceiveMode.PEEK_LOCK, 1, Duration.ofSeconds(20), - null, false, null); + ReceiverOptions receiverOptions = new ReceiverOptions(ReceiveMode.PEEK_LOCK, 1, + Duration.ofSeconds(20), null, false, null); sessionManager = new UnnamedSessionManager(ENTITY_PATH, ENTITY_TYPE, connectionProcessor, TIMEOUT, tracerProvider, messageSerializer, receiverOptions); @@ -176,7 +184,8 @@ void singleUnnamedSession() { when(connection.createReceiveLink(anyString(), eq(ENTITY_PATH), any(ReceiveMode.class), isNull(), any(MessagingEntityType.class), isNull())).thenReturn(Mono.just(amqpReceiveLink)); - when(managementNode.renewSessionLock(sessionId, linkName)).thenReturn(Mono.empty()); + when(managementNode.renewSessionLock(sessionId, linkName)).thenReturn( + Mono.fromCallable(() -> Instant.now().plus(Duration.ofSeconds(5)))); // Act & Assert StepVerifier.create(sessionManager.receive()) @@ -185,11 +194,11 @@ void singleUnnamedSession() { messageSink.next(message); } }) - .assertNext(context -> assertMessageEquals(receivedMessage, context)) - .assertNext(context -> assertMessageEquals(receivedMessage, context)) - .assertNext(context -> assertMessageEquals(receivedMessage, context)) - .assertNext(context -> assertMessageEquals(receivedMessage, context)) - .assertNext(context -> assertMessageEquals(receivedMessage, context)) + .assertNext(context -> assertMessageEquals(sessionId, receivedMessage, context)) + .assertNext(context -> assertMessageEquals(sessionId, receivedMessage, context)) + .assertNext(context -> assertMessageEquals(sessionId, receivedMessage, context)) + .assertNext(context -> assertMessageEquals(sessionId, receivedMessage, context)) + .assertNext(context -> assertMessageEquals(sessionId, receivedMessage, context)) .expectComplete() .verify(); } @@ -200,35 +209,70 @@ void singleUnnamedSession() { @Test void multipleSessions() { // Arrange - ReceiverOptions receiverOptions = new ReceiverOptions(ReceiveMode.PEEK_LOCK, 1, Duration.ofSeconds(20), - null, false, null); + final ReceiverOptions receiverOptions = new ReceiverOptions(ReceiveMode.PEEK_LOCK, 1, + Duration.ofSeconds(8), null, true, 1); sessionManager = new UnnamedSessionManager(ENTITY_PATH, ENTITY_TYPE, connectionProcessor, TIMEOUT, tracerProvider, messageSerializer, receiverOptions); final int numberOfMessages = 5; + final Callable onRenewal = () -> Instant.now().plus(Duration.ofSeconds(5)); + final String sessionId = "session-1"; final String lockToken = "a-lock-token"; final String linkName = "my-link-name"; - final Instant sessionLockedUntil = Instant.now().plus(Duration.ofSeconds(5)); final Message message = mock(Message.class); final ServiceBusReceivedMessage receivedMessage = mock(ServiceBusReceivedMessage.class); - when(messageSerializer.deserialize(message, ServiceBusReceivedMessage.class)).thenReturn(receivedMessage); when(receivedMessage.getSessionId()).thenReturn(sessionId); when(receivedMessage.getLockToken()).thenReturn(lockToken); - when(amqpReceiveLink.getLinkName()).thenReturn(linkName); when(amqpReceiveLink.getSessionId()).thenReturn(Mono.just(sessionId)); - when(amqpReceiveLink.getSessionLockedUntil()) - .thenAnswer(invocation -> Mono.just(sessionLockedUntil)); + when(amqpReceiveLink.getSessionLockedUntil()).thenReturn(Mono.fromCallable(onRenewal)); when(amqpReceiveLink.updateDisposition(lockToken, Accepted.getInstance())).thenReturn(Mono.empty()); + // Session 2's messages + final ServiceBusReceiveLink amqpReceiveLink2 = mock(ServiceBusReceiveLink.class); + final Message message2 = mock(Message.class); + final ServiceBusReceivedMessage receivedMessage2 = mock(ServiceBusReceivedMessage.class); + final String sessionId2 = "session-2"; + final String lockToken2 = "a-lock-token-2"; + final String linkName2 = "my-link-name-2"; + final TestPublisher messagePublisher2 = TestPublisher.create(); + final Flux messageFlux2 = messagePublisher2.flux(); + + when(receivedMessage2.getSessionId()).thenReturn(sessionId2); + when(receivedMessage2.getLockToken()).thenReturn(lockToken2); + + when(amqpReceiveLink2.receive()).thenReturn(messageFlux2); + when(amqpReceiveLink2.getHostname()).thenReturn(NAMESPACE); + when(amqpReceiveLink2.getEntityPath()).thenReturn(ENTITY_PATH); + when(amqpReceiveLink2.getEndpointStates()).thenReturn(endpointProcessor); + when(amqpReceiveLink2.getLinkName()).thenReturn(linkName2); + when(amqpReceiveLink2.getSessionId()).thenReturn(Mono.just(sessionId2)); + when(amqpReceiveLink2.getSessionLockedUntil()).thenReturn(Mono.fromCallable(onRenewal)); + when(amqpReceiveLink2.updateDisposition(lockToken2, Accepted.getInstance())).thenReturn(Mono.empty()); + + final AtomicInteger count = new AtomicInteger(); when(connection.createReceiveLink(anyString(), eq(ENTITY_PATH), any(ReceiveMode.class), isNull(), - any(MessagingEntityType.class), isNull())).thenReturn(Mono.just(amqpReceiveLink)); + any(MessagingEntityType.class), isNull())).thenAnswer(invocation -> { + final int number = count.getAndIncrement(); + switch (number) { + case 0: + return Mono.just(amqpReceiveLink); + case 1: + return Mono.just(amqpReceiveLink2); + default: + return Mono.empty(); + } + }); - when(managementNode.renewSessionLock(sessionId, linkName)).thenReturn(Mono.empty()); + when(messageSerializer.deserialize(message, ServiceBusReceivedMessage.class)).thenReturn(receivedMessage); + when(messageSerializer.deserialize(message2, ServiceBusReceivedMessage.class)).thenReturn(receivedMessage2); + + when(managementNode.renewSessionLock(sessionId, linkName)).thenReturn(Mono.fromCallable(onRenewal)); + when(managementNode.renewSessionLock(sessionId2, linkName2)).thenReturn(Mono.fromCallable(onRenewal)); // Act & Assert StepVerifier.create(sessionManager.receive()) @@ -237,19 +281,54 @@ void multipleSessions() { messageSink.next(message); } }) - .assertNext(context -> assertMessageEquals(receivedMessage, context)) - .assertNext(context -> assertMessageEquals(receivedMessage, context)) - .assertNext(context -> assertMessageEquals(receivedMessage, context)) - .assertNext(context -> assertMessageEquals(receivedMessage, context)) - .assertNext(context -> assertMessageEquals(receivedMessage, context)) - .expectComplete() + .assertNext(context -> { + System.out.println("1"); + assertMessageEquals(sessionId, receivedMessage, context); + }) + .assertNext(context -> { + System.out.println("2"); + assertMessageEquals(sessionId, receivedMessage, context); + }) + .assertNext(context -> { + System.out.println("3"); + assertMessageEquals(sessionId, receivedMessage, context); + }) + .assertNext(context -> { + System.out.println("4"); + assertMessageEquals(sessionId, receivedMessage, context); + }) + .assertNext(context -> { + System.out.println("5"); + assertMessageEquals(sessionId, receivedMessage, context); + }) + .thenAwait(Duration.ofSeconds(13)) + .then(() -> { + for (int i = 0; i < 3; i++) { + messagePublisher2.next(message2); + } + }) + .assertNext(context -> { + System.out.println("6"); + assertMessageEquals(sessionId2, receivedMessage2, context); + }) + .assertNext(context -> { + System.out.println("7"); + assertMessageEquals(sessionId2, receivedMessage2, context); + }) + .assertNext(context -> { + System.out.println("8"); + assertMessageEquals(sessionId2, receivedMessage2, context); + }) + .thenAwait(Duration.ofSeconds(15)) + .thenCancel() .verify(); } - private static void assertMessageEquals(ServiceBusReceivedMessage expected, + private static void assertMessageEquals(String sessionId, ServiceBusReceivedMessage expected, ServiceBusReceivedMessageContext actual) { - assertEquals(expected, actual.getMessage()); + assertEquals(sessionId, actual.getSessionId()); assertNull(actual.getThrowable()); - assertEquals(expected.getSessionId(), actual.getSessionId()); + + assertEquals(expected, actual.getMessage()); } } diff --git a/sdk/servicebus/azure-messaging-servicebus/src/test/java/com/azure/messaging/servicebus/implementation/ServiceBusReceiveLinkProcessorTest.java b/sdk/servicebus/azure-messaging-servicebus/src/test/java/com/azure/messaging/servicebus/implementation/ServiceBusReceiveLinkProcessorTest.java index 52aa09adf4a8a..24164c379cd78 100644 --- a/sdk/servicebus/azure-messaging-servicebus/src/test/java/com/azure/messaging/servicebus/implementation/ServiceBusReceiveLinkProcessorTest.java +++ b/sdk/servicebus/azure-messaging-servicebus/src/test/java/com/azure/messaging/servicebus/implementation/ServiceBusReceiveLinkProcessorTest.java @@ -7,6 +7,7 @@ import com.azure.core.amqp.exception.AmqpErrorCondition; import com.azure.core.amqp.exception.AmqpErrorContext; import com.azure.core.amqp.exception.AmqpException; +import com.azure.messaging.servicebus.models.ReceiveMode; import org.apache.qpid.proton.message.Message; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.AfterEach; @@ -21,22 +22,31 @@ import org.mockito.Mockito; import org.mockito.MockitoAnnotations; import org.reactivestreams.Subscription; -import reactor.core.Disposable; import reactor.core.publisher.DirectProcessor; import reactor.core.publisher.EmitterProcessor; import reactor.core.publisher.Flux; import reactor.core.publisher.FluxSink; import reactor.test.StepVerifier; +import reactor.test.publisher.TestPublisher; import java.time.Duration; +import java.util.concurrent.Semaphore; +import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicInteger; import java.util.function.Supplier; import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertSame; +import static org.junit.jupiter.api.Assertions.assertThrows; import static org.junit.jupiter.api.Assertions.assertTrue; import static org.mockito.ArgumentMatchers.any; +import static org.mockito.ArgumentMatchers.anyInt; import static org.mockito.ArgumentMatchers.eq; import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.never; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.verifyZeroInteractions; import static org.mockito.Mockito.when; @@ -59,13 +69,10 @@ class ServiceBusReceiveLinkProcessorTest { private Message message1; @Mock private Message message2; - @Mock - private Disposable parentConnection; @Captor private ArgumentCaptor> creditSupplierCaptor; - private final AmqpErrorContext amqpErrorContext = new AmqpErrorContext("test-context"); private final EmitterProcessor endpointProcessor = EmitterProcessor.create(); private final EmitterProcessor messageProcessor = EmitterProcessor.create(); private final FluxSink messageProcessorSink = messageProcessor.sink(FluxSink.OverflowStrategy.BUFFER); @@ -85,7 +92,7 @@ static void afterAll() { void setup() { MockitoAnnotations.initMocks(this); - linkProcessor = new ServiceBusReceiveLinkProcessor(PREFETCH, retryPolicy, parentConnection, amqpErrorContext); + linkProcessor = new ServiceBusReceiveLinkProcessor(PREFETCH, retryPolicy, ReceiveMode.PEEK_LOCK); when(link1.getEndpointStates()).thenReturn(endpointProcessor); when(link1.receive()).thenReturn(messageProcessor); @@ -98,12 +105,12 @@ void teardown() { @Test void constructor() { - Assertions.assertThrows(NullPointerException.class, () -> new ServiceBusReceiveLinkProcessor(PREFETCH, null, - parentConnection, amqpErrorContext)); - Assertions.assertThrows(NullPointerException.class, () -> new ServiceBusReceiveLinkProcessor(PREFETCH, retryPolicy, - null, amqpErrorContext)); - Assertions.assertThrows(IllegalArgumentException.class, () -> new ServiceBusReceiveLinkProcessor(-1, retryPolicy, - parentConnection, amqpErrorContext)); + assertThrows(NullPointerException.class, () -> new ServiceBusReceiveLinkProcessor(PREFETCH, null, + ReceiveMode.PEEK_LOCK)); + assertThrows(IllegalArgumentException.class, () -> new ServiceBusReceiveLinkProcessor(-1, retryPolicy, + ReceiveMode.PEEK_LOCK)); + assertThrows(NullPointerException.class, () -> new ServiceBusReceiveLinkProcessor(PREFETCH, retryPolicy, + null)); } /** @@ -128,19 +135,20 @@ void createNewLink() { .thenCancel() .verify(); - Assertions.assertTrue(processor.isTerminated()); - Assertions.assertFalse(processor.hasError()); - Assertions.assertNull(processor.getError()); + assertTrue(processor.isTerminated()); + assertFalse(processor.hasError()); + assertNull(processor.getError()); verify(link1).addCredits(eq(PREFETCH)); verify(link1).setEmptyCreditListener(creditSupplierCaptor.capture()); Supplier value = creditSupplierCaptor.getValue(); - Assertions.assertNotNull(value); + assertNotNull(value); final Integer creditValue = value.get(); - // Expecting 1 because it is Long.MAX_VALUE. - assertEquals(1, creditValue); + // Expecting 5 because it is Long.MAX_VALUE and there are no credits (since we invoked the empty credit + // listener). + assertEquals(PREFETCH, creditValue); } /** @@ -161,11 +169,11 @@ void respectsBackpressureInRange() { .thenCancel() .verify(); - verify(link1).addCredits(eq(PREFETCH)); + verify(link1).addCredits(eq(backpressure)); verify(link1).setEmptyCreditListener(creditSupplierCaptor.capture()); Supplier value = creditSupplierCaptor.getValue(); - Assertions.assertNotNull(value); + assertNotNull(value); final Integer creditValue = value.get(); final int emittedOne = backpressure - 1; @@ -176,26 +184,33 @@ void respectsBackpressureInRange() { * Verifies we don't set the back pressure when it is too low. */ @Test - void respectsBackpressureLessThanMinimum() { + void respectsBackpressureLessThanMinimum() throws InterruptedException { // Arrange + final Semaphore semaphore = new Semaphore(1); final int backpressure = -1; ServiceBusReceiveLinkProcessor processor = Flux.create(sink -> sink.next(link1)) .subscribeWith(linkProcessor); when(link1.getCredits()).thenReturn(1); // Act + semaphore.acquire(); processor.subscribe( e -> System.out.println("message: " + e), Assertions::fail, () -> System.out.println("Complete."), - s -> s.request(backpressure)); + s -> { + s.request(backpressure); + semaphore.release(); + }); // Assert - verify(link1).addCredits(eq(PREFETCH)); + assertTrue(semaphore.tryAcquire(10, TimeUnit.SECONDS)); + + verify(link1, never()).addCredits(anyInt()); verify(link1).setEmptyCreditListener(creditSupplierCaptor.capture()); Supplier value = creditSupplierCaptor.getValue(); - Assertions.assertNotNull(value); + assertNotNull(value); final Integer creditValue = value.get(); // Expecting 0 because we wouldn't have any requested set. @@ -272,9 +287,9 @@ void newLinkOnClose() { }) .verifyComplete(); - Assertions.assertTrue(processor.isTerminated()); - Assertions.assertFalse(processor.hasError()); - Assertions.assertNull(processor.getError()); + assertTrue(processor.isTerminated()); + assertFalse(processor.hasError()); + assertNull(processor.getError()); } /** @@ -313,9 +328,9 @@ void newLinkOnRetryableError() { .thenCancel() .verify(); - Assertions.assertTrue(processor.isTerminated()); - Assertions.assertFalse(processor.hasError()); - Assertions.assertNull(processor.getError()); + assertTrue(processor.isTerminated()); + assertFalse(processor.hasError()); + assertNull(processor.getError()); } /** @@ -350,18 +365,18 @@ void nonRetryableError() { endpointSink.error(amqpException); }) .expectErrorSatisfies(error -> { - Assertions.assertTrue(error instanceof AmqpException); + assertTrue(error instanceof AmqpException); AmqpException exception = (AmqpException) error; - Assertions.assertFalse(exception.isTransient()); + assertFalse(exception.isTransient()); assertEquals(amqpException.getErrorCondition(), exception.getErrorCondition()); assertEquals(amqpException.getMessage(), exception.getMessage()); }) .verify(); - Assertions.assertTrue(processor.isTerminated()); - Assertions.assertTrue(processor.hasError()); - Assertions.assertSame(amqpException, processor.getError()); + assertTrue(processor.isTerminated()); + assertTrue(processor.hasError()); + assertSame(amqpException, processor.getError()); } /** @@ -438,52 +453,54 @@ void retriesUntilExhausted() { .then(() -> endpointSink.error(amqpException)) .thenAwait(delay) .then(() -> link2StateSink.error(amqpException2)) - .expectErrorSatisfies(error -> Assertions.assertSame(amqpException2, error)) + .expectErrorSatisfies(error -> assertSame(amqpException2, error)) .verify(); - Assertions.assertTrue(processor.isTerminated()); - Assertions.assertTrue(processor.hasError()); - Assertions.assertSame(amqpException2, processor.getError()); + assertTrue(processor.isTerminated()); + assertTrue(processor.hasError()); + assertSame(amqpException2, processor.getError()); } /** - * Does not request another link when parent connection is closed. + * Does not request another link when upstream is closed. */ @Test void doNotRetryWhenParentConnectionIsClosed() { // Arrange - final ServiceBusReceiveLink[] connections = new ServiceBusReceiveLink[]{link1, link2}; - - final ServiceBusReceiveLinkProcessor processor = createSink(connections).subscribeWith(linkProcessor); - final FluxSink endpointSink = endpointProcessor.sink(); + final TestPublisher linkGenerator = TestPublisher.create(); + final ServiceBusReceiveLinkProcessor processor = linkGenerator.flux().subscribeWith(linkProcessor); + final TestPublisher endpointStates = TestPublisher.create(); + final TestPublisher messages = TestPublisher.create(); - final DirectProcessor link2StateProcessor = DirectProcessor.create(); - - when(parentConnection.isDisposed()).thenReturn(true); + when(link1.getEndpointStates()).thenReturn(endpointStates.flux()); + when(link1.receive()).thenReturn(messages.flux()); - when(link2.getEndpointStates()).thenReturn(link2StateProcessor); + final TestPublisher endpointStates2 = TestPublisher.create(); + when(link2.getEndpointStates()).thenReturn(endpointStates2.flux()); when(link2.receive()).thenReturn(Flux.never()); // Act & Assert StepVerifier.create(processor) .then(() -> { - endpointSink.next(AmqpEndpointState.ACTIVE); - messageProcessorSink.next(message1); + linkGenerator.next(link1); + endpointStates.next(AmqpEndpointState.ACTIVE); + messages.next(message1); }) .expectNext(message1) - .then(() -> endpointSink.complete()) - .thenCancel() + .then(linkGenerator::complete) + .then(endpointStates::complete) + .expectComplete() .verify(); - Assertions.assertTrue(processor.isTerminated()); + assertTrue(processor.isTerminated()); } @Test void requiresNonNull() { - Assertions.assertThrows(NullPointerException.class, + assertThrows(NullPointerException.class, () -> linkProcessor.onNext(null)); - Assertions.assertThrows(NullPointerException.class, + assertThrows(NullPointerException.class, () -> linkProcessor.onError(null)); } @@ -533,19 +550,20 @@ void receivesUntilFirstLinkClosed() { .expectComplete() .verify(); - Assertions.assertTrue(processor.isTerminated()); - Assertions.assertFalse(processor.hasError()); - Assertions.assertNull(processor.getError()); + assertTrue(processor.isTerminated()); + assertFalse(processor.hasError()); + assertNull(processor.getError()); verify(link1).addCredits(eq(PREFETCH)); verify(link1).setEmptyCreditListener(creditSupplierCaptor.capture()); Supplier value = creditSupplierCaptor.getValue(); - Assertions.assertNotNull(value); + assertNotNull(value); final Integer creditValue = value.get(); - // Expecting 1 because it is Long.MAX_VALUE. - assertEquals(1, creditValue); + // Expecting 5 because it is Long.MAX_VALUE and there are no credits (since we invoked the empty credit + // listener). + assertEquals(PREFETCH, creditValue); } @Test @@ -568,19 +586,20 @@ void receivesFromFirstLink() { .thenCancel() .verify(); - Assertions.assertTrue(processor.isTerminated()); - Assertions.assertFalse(processor.hasError()); - Assertions.assertNull(processor.getError()); + assertTrue(processor.isTerminated()); + assertFalse(processor.hasError()); + assertNull(processor.getError()); verify(link1).addCredits(eq(PREFETCH)); verify(link1).setEmptyCreditListener(creditSupplierCaptor.capture()); Supplier value = creditSupplierCaptor.getValue(); - Assertions.assertNotNull(value); + assertNotNull(value); final Integer creditValue = value.get(); - // Expecting 1 because it is Long.MAX_VALUE. - assertEquals(1, creditValue); + // Expecting 5 because it is Long.MAX_VALUE and there are no credits (since we invoked the empty credit + // listener). + assertEquals(PREFETCH, creditValue); } /** @@ -591,10 +610,12 @@ void receivesFromFirstLink() { void backpressureRequestOnlyEmitsThatAmount() { // Arrange final int backpressure = 10; + final int existingCredits = 1; + final int expectedCredits = backpressure - existingCredits; ServiceBusReceiveLinkProcessor processor = Flux.just(link1).subscribeWith(linkProcessor); FluxSink sink = endpointProcessor.sink(); - when(link1.getCredits()).thenReturn(1); + when(link1.getCredits()).thenReturn(existingCredits); // Act & Assert StepVerifier.create(processor, backpressure) @@ -610,11 +631,11 @@ void backpressureRequestOnlyEmitsThatAmount() { .thenCancel() .verify(); - Assertions.assertTrue(processor.isTerminated()); - Assertions.assertFalse(processor.hasError()); - Assertions.assertNull(processor.getError()); + assertTrue(processor.isTerminated()); + assertFalse(processor.hasError()); + assertNull(processor.getError()); - verify(link1).addCredits(eq(PREFETCH)); + verify(link1).addCredits(expectedCredits); verify(link1).setEmptyCreditListener(any()); } From 9bc23c330bab952a0b439e10421f3dc57a25b71a Mon Sep 17 00:00:00 2001 From: James Suplizio Date: Fri, 10 Jul 2020 09:08:33 -0700 Subject: [PATCH 083/129] Update to deal with use of Spring BOM in samples (#12784) * Update to deal with use of Spring BOM in samples * Remove defunct superfluous parent entry * Update for missing tag on non-sdk dependencies --- eng/versioning/pom_file_version_scanner.ps1 | 113 +++++++++++++++++++- 1 file changed, 112 insertions(+), 1 deletion(-) diff --git a/eng/versioning/pom_file_version_scanner.ps1 b/eng/versioning/pom_file_version_scanner.ps1 index abd51df745410..5586664d8d582 100644 --- a/eng/versioning/pom_file_version_scanner.ps1 +++ b/eng/versioning/pom_file_version_scanner.ps1 @@ -32,6 +32,13 @@ # Since we're skipping Management for the moment, only look for files with certain parents. These # limitations will vanish once Management track is updated. $ValidParents = ("azure-sdk-parent", "azure-client-sdk-parent", "azure-data-sdk-parent", "azure-cosmos-parent") + +# SpringSampleParents is necessary for the spring samples which have to build using the spring-boot-starter-parent BOM. +# The problem with this is, it's a BOM file and the spring dependencies are pulled in through that which means any +# dependencies may or may not have versions. Unfortunately, there are still version tags azure sdk client libraries +# which means these files have to be "sort of" scanned. +$SpringSampleParents = ("spring-boot-starter-parent") + $Path = Resolve-Path ($PSScriptRoot + "/../../") # Not all POM files have a parent entry @@ -248,6 +255,107 @@ function Confirm-Node-Is-Part-Of-Configuration { return $false } +# Spring samples will pull in most dependencies through use of the spring bom. Any dependency that is an +# an azure sdk client dependency needs to be verified and must have a groupId, artifactId, version and version tag. +# Similarly, any dependency with a version needs to have a version tag. Dependencies without a version tag are +# ignored as those are assumed to be coming from the BOM. +function Assert-Spring-Sample-Version-Tags { + param( + [hashtable]$libHash, + [hashtable]$extDepHash, + [xml]$xmlPomFile + ) + Write-Host "processing Spring Sample pomFile=$($pomFile)" + $xmlNsManagerSpring = New-Object -TypeName "Xml.XmlNamespaceManager" -ArgumentList $xmlPomFile.NameTable + $xmlNsManagerSpring.AddNamespace("ns", $xmlPomFile.DocumentElement.NamespaceURI) + + if (-not $xmlPomFile.project.parent.groupId) + { + $script:FoundError = $true + Write-Error-With-Color "Error: parent/groupId is missing." + } + + $versionNode = $xmlPomFile.SelectSingleNode("/ns:project/ns:parent/ns:version", $xmlNsManagerSpring) + if (-not $versionNode) + { + $script:FoundError = $true + Write-Error-With-Color "Error: parent/version is missing." + Write-Error-With-ColorWrite-Error-With-Color "Error: Missing project/version update tag. The tag should be " + } else { + $retVal = Test-Dependency-Tag-And-Version $libHash $extDepHash $versionNode.InnerText.Trim() $versionNode.NextSibling.Value + if ($retVal) + { + $script:FoundError = $true + Write-Error-With-Color "$($retVal)" + } + } + + # Loop through the dependencies. If any dependency is in the libHash (aka, the libraries we build) + # then it needs to have a version element and update tag. + foreach($dependencyNode in $xmlPomFile.GetElementsByTagName("dependency")) + { + $artifactId = $dependencyNode.artifactId + $groupId = $dependencyNode.groupId + # If the artifactId and groupId are both empty then check to see if this + # is part of a configuration entry. If so then just continue. + if (!$artifactId -and !$groupId) + { + $isPartOfConfig = Confirm-Node-Is-Part-Of-Configuration $dependencyNode + if (!$isPartOfConfig) + { + $script:FoundError = $true + # Because this particular case is harder to track down, print the OuterXML which is effectively the entire tag + Write-Error-With-Color "Error: dependency is missing version element and/or artifactId and groupId elements dependencyNode=$($dependencyNode.OuterXml)" + } + continue + } + $hashKey = "$($groupId):$($artifactId)" + $versionNode = $dependencyNode.GetElementsByTagName("version")[0] + # If this is something we build and release, it better have a version and a version tag + if ($libHash.ContainsKey($hashKey)) + { + if (-not $versionNode) + { + $script:FoundError = $true + Write-Error-With-Color "Error: dependency is missing version element and tag groupId=$($groupId), artifactId=$($artifactId) should be " + } else { + # verify the version tag and version are correct + if ($versionNode.NextSibling -and $versionNode.NextSibling.NodeType -eq "Comment") + { + $retVal = Test-Dependency-Tag-And-Version $libHash $extDepHash $versionNode.InnerText.Trim() $versionNode.NextSibling.Value + if ($retVal) + { + $script:FoundError = $true + Write-Error-With-Color "$($retVal)" + } + } else { + $script:FoundError = $true + Write-Error-With-Color "Error: dependency is missing version tag groupId=$($groupId), artifactId=$($artifactId) tag should be " + } + } + } else { + # else, if there's a version tag verify it, otherwise just skip it since the version should be coming + # from the bom + if ($versionNode) + { + if ($versionNode.NextSibling -and $versionNode.NextSibling.NodeType -eq "Comment") + { + $retVal = Test-Dependency-Tag-And-Version $libHash $extDepHash $versionNode.InnerText.Trim() $versionNode.NextSibling.Value + if ($retVal) + { + $script:FoundError = $true + Write-Error-With-Color "$($retVal)" + } + # If there's no version tag then error, if there's a version then it must be tagged + } else { + $script:FoundError = $true + Write-Error-With-Color "Error: dependency is missing version tag groupId=$($groupId), artifactId=$($artifactId) tag should be " + } + } + } + } +} + # Create one dependency hashtable for libraries we build (the groupIds will make the entries unique) and # one hash for external dependencies $libHash = @{} @@ -279,6 +387,10 @@ Get-ChildItem -Path $Path -Filter pom*.xml -Recurse -File | ForEach-Object { $xmlPomFile.Load($pomFile) if ($ValidParents -notcontains $xmlPomFile.project.parent.artifactId) { + if ($SpringSampleParents -contains $xmlPomFile.project.parent.artifactId) + { + Assert-Spring-Sample-Version-Tags $libHash $extDepHash $xmlPomFile + } # This may look odd but ForEach-Object is a cmdlet which means that "continue" # exits the loop altogether and "return" behaves like continue for a particular # loop @@ -613,4 +725,3 @@ if ($script:FoundError) Write-Error-With-Color "This script can be run locally from the root of the repo. .\eng\versioning\pom_file_version_scanner.ps1" exit(1) } - From 7612f32612813e83ac83b8a22ff35be198e6f07d Mon Sep 17 00:00:00 2001 From: Rick Ley Date: Fri, 10 Jul 2020 09:48:11 -0700 Subject: [PATCH 084/129] Readme (#12972) * Readme * PR feedback * updates --- .../checkstyle/checkstyle-suppressions.xml | 2 +- sdk/storage/azure-storage-blob-nio/README.md | 225 +++++++++++++++--- .../blob/nio/AzureBasicFileAttributeView.java | 4 +- .../blob/nio/AzureBlobFileAttributeView.java | 3 +- .../blob/nio/AzureFileSystemProvider.java | 12 +- .../azure/storage/blob/nio/ReadmeSamples.java | 95 ++++++++ 6 files changed, 295 insertions(+), 46 deletions(-) create mode 100644 sdk/storage/azure-storage-blob-nio/src/samples/java/com/azure/storage/blob/nio/ReadmeSamples.java diff --git a/eng/code-quality-reports/src/main/resources/checkstyle/checkstyle-suppressions.xml b/eng/code-quality-reports/src/main/resources/checkstyle/checkstyle-suppressions.xml index ae6c3fffe457a..42bb4fb08c1d5 100755 --- a/eng/code-quality-reports/src/main/resources/checkstyle/checkstyle-suppressions.xml +++ b/eng/code-quality-reports/src/main/resources/checkstyle/checkstyle-suppressions.xml @@ -126,7 +126,7 @@ diff --git a/sdk/storage/azure-storage-blob-nio/README.md b/sdk/storage/azure-storage-blob-nio/README.md index 2396ef3a19f5e..bf9c0f7fb96ee 100644 --- a/sdk/storage/azure-storage-blob-nio/README.md +++ b/sdk/storage/azure-storage-blob-nio/README.md @@ -1,5 +1,6 @@ -# Azure Storage Java NIO Blob plugin library for Java -## This README is not yet updated for this project and is a skeleton copied from blobs +# Azure Storage Blob NIO FileSystemProvider + +This package allows you to interact with Azure Blob Storage through the standard Java NIO Filesystem APIs. [Source code][source] | [API reference documentation][docs] | [REST API documentation][rest_docs] | [Product documentation][product_docs] | [Samples][samples] @@ -35,8 +36,8 @@ az storage account create \ ### Authenticate the client -In order to interact with the Storage Service (Blob, Queue, Message, MessageId, File) you'll need to create an instance of the Service Client class. -To make this possible you'll need the Account SAS (shared access signature) string of the Storage Account. Learn more at [SAS Token][sas_token] +The simplest way to interact with the Storage Service is to create an instance of the [FileSystem][file_system] class using the [FileSystems][file_systems] API. +To make this possible you'll need the Account SAS (shared access signature) string of the Storage Account or a Shared Key. Learn more at [SAS Token][sas_token] and [Shared Key][shared_key] #### Get credentials @@ -76,55 +77,185 @@ b. Alternatively, get the Account SAS Token from the Azure Portal. ##### **Shared Key Credential** -a. Use Account name and Account key. Account name is your Storage Account name. +Use Account name and Account key. Account name is your Storage Account name. 1. Go to your Storage Account 2. Select `Access keys` from the menu on the left 3. Under `key1`/`key2` copy the contents of the `Key` field -or +## Key concepts -b. Use the connection string. +NIO on top of Blob Storage is designed for: + +- Working with Blob Storage as though it were a local file system +- Random access reads on large blobs without downloading the entire blob +- Uploading full files as blobs +- Creating and navigating a directory structure within an account +- Reading and setting attributes on blobs + +## Design Notes +It is important to recognize that Azure Blob Storage is not a true FileSystem, nor is it the goal of this project to +force Azure Blob Storage to act like a full-fledged FileSystem. While providing FileSystem APIs on top of Azure Blob +Storage can offer convenience and ease of access in certain cases, trying to force the Storage service to work in +scenarios it is not designed for is bound to introduce performance and stability problems. + +To that end, this project will only offer APIs that can be sensibly and cleanly built on top of Azure Blob Storage APIs. +We recognize that this will leave some scenarios unsupported indefinitely, but we would rather offer a product that +works predictably and reliably in its well defined scenarios than eagerly support all possible scenarios at the expense +of quality. Even still, supporting some fundamentally required use cases, such as directories, can result in unexpected +behavior due to the difference between blob storage and a file system. The javadocs on each type and method should +therefore be read and understood for ways in which they may diverge from the standard specified by the JDK. + +Moreover, even from within a given application, it should be remembered that using a remote FileSystem introduces higher +latency. Because of this, particular care must be taken when managing concurrency. Race conditions are more likely to +manifest, network failures occur more frequently than disk failures, and other such distributed application scenarios +must be considered when working with this FileSystem. While the AzureFileSystem will ensure it takes appropriate steps +towards robustness and reliability, the application developer must also design around these failure scenarios and have +fallback and retry options available. + +The view of the FileSystem from within an instance of the JVM will be consistent, but the AzureFileSystem makes no +guarantees on behavior or state should other processes operate on the same data. The AzureFileSystem will assume that it +has exclusive access to the resources stored in Azure Blob Storage and will behave without regard for potential +interfering applications + +Finally, this implementation has currently chosen to always read/write directly to/from Azure Storage without a local +cache. Our team has determined that with the tradeoffs of complexity, correctness, safety, performance, debuggability, +etc. one option is not inherently better than the other and that this choice most directly addresses the current known +use cases for this project. While this has consequences for every API, of particular note is the limitations on writing +data. Data may only be written as an entire file (i.e. random IO or appends are not supported), and data is not +committed or available to be read until the write stream is closed. -1. Go to your Storage Account -2. Select `Access keys` from the menu on the left -3. Under `key1`/`key2` copy the contents of the `Connection string` field +## Examples -## Key concepts +The following sections provide several code snippets covering some of the most common Azure Storage Blob NIO tasks, including: -Blob Storage is designed for: +- [Create a `FileSystem`](#create-a-filesystem) +- [Create a directory](#create-a-directory) +- [Iterate over directory contents](#iterate-over-directory-contents) +- [Read a file](#read-a-file) +- [Write to a file](#write-to-a-file) +- [Copy a file](#copy-a-file) +- [Delete a file](#delete-a-file) +- [Read attributes on a file](#read-attributes-on-a-file) +- [Write attributes to a file](#write-attributes-to-a-file) -- Serving images or documents directly to a browser -- Storing files for distributed access -- Streaming video and audio -- Writing to log files -- Storing data for backup and restore, disaster recovery, and archiving -- Storing data for analysis by an on-premises or Azure-hosted service +### Create a `FileSystem` -## Examples +Create a `FileSystem` using the [`shared key`](#get-credentials) retrieved above. -The following sections provide several code snippets covering some of the most common Azure Storage Blob tasks, including: +Note that you can further configure the file system using constants available in `AzureFileSystem`. +Please see the docs for `AzureFileSystemProvider` for a full explanation of initializing and configuring a filesystem -- [Create a `BlobServiceClient`](#create-a-blobserviceclient) + +```java +Map config = new HashMap<>(); +config.put(AzureFileSystem.AZURE_STORAGE_ACCOUNT_KEY, ""); +config.put(AzureFileSystem.AZURE_STORAGE_FILE_STORES, ""); +FileSystem myFs = FileSystems.newFileSystem(new URI("azb://?account= +```java +Path dirPath = myFs.getPath("dir"); +Files.createDirectory(dirPath); +``` -### Create a `BlobServiceClient` +### Iterate over directory contents -Create a `BlobServiceClient` using the [`sasToken`](#get-credentials) generated above. +Iterate over a directory using a `DirectoryStream` + ```java -BlobServiceClient blobServiceClient = new BlobServiceClientBuilder() - .endpoint("") - .sasToken("") - .buildClient(); +for (Path p : Files.newDirectoryStream(dirPath)) { + System.out.println(p.toString()); +} ``` +### Read a file + +Read the contents of a file using an `InputStream`. Skipping, marking, and resetting are all supported. + + +```java +Path filePath = myFs.getPath("file"); +InputStream is = Files.newInputStream(filePath); +is.read(); +is.close(); +``` + +### Write to a file + +Write to a file. Only writing whole files is supported. Random IO is not supported. The stream must be closed in order +to guarantee that the data is available to be read. + + +```java +OutputStream os = Files.newOutputStream(filePath); +os.write(0); +os.close(); +``` + +### Copy a file + + +```java +Path destinationPath = myFs.getPath("destinationFile"); +Files.copy(filePath, destinationPath, StandardCopyOption.COPY_ATTRIBUTES); +``` + +### Delete a file + + +```java +Files.delete(filePath); +``` + +### Read attributes on a file + +Read attributes of a file through the `AzureBlobFileAttributes`. + + +```java +AzureBlobFileAttributes attr = Files.readAttributes(filePath, AzureBlobFileAttributes.class); +BlobHttpHeaders headers = attr.blobHttpHeaders(); +``` + +Or read attributes dynamically by specifying a string of desired attributes. This will not improve performance as a call +to retrieve any attribute will always retrieve all of them as an atomic bulk operation. You may specify "*" instead of a +list of specific attributes to have all attributes returned in the map. + + +```java +Map attributes = Files.readAttributes(filePath, "azureBlob:metadata,headers"); +``` + +### Write attributes to a file + +Set attributes of a file through the `AzureBlobFileAttributeView`. + + +```java +AzureBlobFileAttributeView view = Files.getFileAttributeView(filePath, AzureBlobFileAttributeView.class); +view.setMetadata(Collections.EMPTY_MAP); +``` + +Or set an attribute dynamically by specifying the attribute as a string. + + +```java +Files.setAttribute(filePath, "azureBlob:blobHttpHeaders", new BlobHttpHeaders()); +``` ## Troubleshooting -When interacting with blobs using this Java client library, errors returned by the service correspond to the same HTTP -status codes returned for [REST API][error_codes] requests. For example, if you try to retrieve a container or blob that -doesn't exist in your Storage Account, a `404` error is returned, indicating `Not Found`. +When using the NIO implementation for Azure Blob Storage, errors returned by the service are manifested as an +`IOException` which wraps a `BlobStorageException` having the same HTTP status codes returned for +[REST API][error_codes] requests. For example, if you try to read a file that doesn't exist in your Storage Account, a +`404` error is returned, indicating `Not Found`. ### Default HTTP Client All client libraries by default use the Netty HTTP client. Adding the above dependency will automatically configure @@ -137,12 +268,29 @@ operations. The Boring SSL library is an uber jar containing native libraries fo better performance compared to the default SSL implementation within the JDK. For more information, including how to reduce the dependency size, refer to the [performance tuning][performance_tuning] section of the wiki. -## Next steps - -Several Storage blob Java SDK samples are available to you in the SDK's GitHub repository. These samples provide example code for additional scenarios commonly encountered while working with Key Vault: - -## Next steps Samples -Samples are explained in detail [here][samples_readme]. +## Continued development + +This project is still actively being developed in an effort to move from preview to GA. Below is a list of features that +are not currently supported but are under consideration and may be added before GA. We welcome feedback and input on +which of these may be most useful and are open to suggestions for items not included in this list. While all of these +items are being considered, they have not been investigated and designed and therefore we cannot confirm their +feasibility within Azure Blob Storage. Therefore, it may be the case that further investigation reveals a feature may +not be possible or otherwise may conflict with established design goals and therefor will not ultimately be supported. + +- Symbolic links +- Hard links +- Hidden files +- Random writes +- File locks +- Watches on directory events +- Support for other Azure Storage services such as ADLS Gen 2 (Datalake) and Azure Files (shares) +- Token authentication +- Multi-account filesystems +- Delegating access to single files +- Normalizing directory structure of data upon loading a FileSystem +- Local caching +- Other `OpenOptions` such as append or dsync +- Flags to toggle certain behaviors such as FileStore (container) creation, etc. ## Contributing @@ -159,6 +307,7 @@ This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For m [rest_docs]: https://docs.microsoft.com/rest/api/storageservices/blob-service-rest-api [product_docs]: https://docs.microsoft.com/azure/storage/blobs/storage-blobs-overview [sas_token]: https://docs.microsoft.com/azure/storage/common/storage-dotnet-shared-access-signature-part-1 +[shared_key]: https://docs.microsoft.com/en-us/rest/api/storageservices/authorize-with-shared-key [jdk]: https://docs.microsoft.com/java/azure/jdk/ [azure_subscription]: https://azure.microsoft.com/free/ [storage_account]: https://docs.microsoft.com/azure/storage/common/storage-quickstart-create-account?tabs=azure-portal @@ -166,11 +315,13 @@ This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For m [storage_account_create_portal]: https://docs.microsoft.com/azure/storage/common/storage-quickstart-create-account?tabs=azure-portal [identity]: https://github.com/Azure/azure-sdk-for-java/blob/master/sdk/identity/azure-identity/README.md [error_codes]: https://docs.microsoft.com/rest/api/storageservices/blob-service-error-codes -[samples]: src/samples +[samples]: https://docs.oracle.com/javase/tutorial/essential/io/fileio.html [cla]: https://cla.microsoft.com [coc]: https://opensource.microsoft.com/codeofconduct/ [coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/ [coc_contact]: mailto:opencode@microsoft.com [performance_tuning]: https://github.com/Azure/azure-sdk-for-java/wiki/Performance-Tuning +[file_system]: https://docs.oracle.com/javase/7/docs/api/java/nio/file/FileSystem.html +[file_systems]: https://docs.oracle.com/javase/7/docs/api/java/nio/file/FileSystems.html ![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-java%2Fsdk%2Fstorage%2Fazure-storage-blob%2FREADME.png) diff --git a/sdk/storage/azure-storage-blob-nio/src/main/java/com/azure/storage/blob/nio/AzureBasicFileAttributeView.java b/sdk/storage/azure-storage-blob-nio/src/main/java/com/azure/storage/blob/nio/AzureBasicFileAttributeView.java index 4a0766ac42849..01ae0bd2e7a2c 100644 --- a/sdk/storage/azure-storage-blob-nio/src/main/java/com/azure/storage/blob/nio/AzureBasicFileAttributeView.java +++ b/sdk/storage/azure-storage-blob-nio/src/main/java/com/azure/storage/blob/nio/AzureBasicFileAttributeView.java @@ -21,6 +21,8 @@ */ public final class AzureBasicFileAttributeView implements BasicFileAttributeView { + static final String NAME = "azureBasic"; + private final Path path; AzureBasicFileAttributeView(Path path) { @@ -33,7 +35,7 @@ public final class AzureBasicFileAttributeView implements BasicFileAttributeView */ @Override public String name() { - return "azureBasic"; + return NAME; } /** diff --git a/sdk/storage/azure-storage-blob-nio/src/main/java/com/azure/storage/blob/nio/AzureBlobFileAttributeView.java b/sdk/storage/azure-storage-blob-nio/src/main/java/com/azure/storage/blob/nio/AzureBlobFileAttributeView.java index 2761c54830b6e..241d72e474aef 100644 --- a/sdk/storage/azure-storage-blob-nio/src/main/java/com/azure/storage/blob/nio/AzureBlobFileAttributeView.java +++ b/sdk/storage/azure-storage-blob-nio/src/main/java/com/azure/storage/blob/nio/AzureBlobFileAttributeView.java @@ -29,6 +29,7 @@ public final class AzureBlobFileAttributeView implements BasicFileAttributeView private final ClientLogger logger = new ClientLogger(AzureBlobFileAttributeView.class); static final String ATTR_CONSUMER_ERROR = "Exception thrown by attribute consumer"; + static final String NAME = "azureBlob"; private final Path path; @@ -74,7 +75,7 @@ static Map> setAttributeConsumers(AzureBlobFileAttribut */ @Override public String name() { - return "azureBlob"; + return NAME; } /** diff --git a/sdk/storage/azure-storage-blob-nio/src/main/java/com/azure/storage/blob/nio/AzureFileSystemProvider.java b/sdk/storage/azure-storage-blob-nio/src/main/java/com/azure/storage/blob/nio/AzureFileSystemProvider.java index c212b1b35c352..1a63f257dd364 100644 --- a/sdk/storage/azure-storage-blob-nio/src/main/java/com/azure/storage/blob/nio/AzureFileSystemProvider.java +++ b/sdk/storage/azure-storage-blob-nio/src/main/java/com/azure/storage/blob/nio/AzureFileSystemProvider.java @@ -755,9 +755,9 @@ public Map readAttributes(Path path, String s, LinkOption... lin state that "basic" must be supported, so we funnel to azureBasic. */ if (viewType.equals("basic")) { - viewType = "azureBasic"; + viewType = AzureBasicFileAttributeView.NAME; } - if (!viewType.equals("azureBasic") && !viewType.equals("azureBlob")) { + if (!viewType.equals(AzureBasicFileAttributeView.NAME) && !viewType.equals(AzureBlobFileAttributeView.NAME)) { throw LoggingUtility.logError(logger, new UnsupportedOperationException("Invalid attribute view: " + viewType)); } @@ -768,7 +768,7 @@ public Map readAttributes(Path path, String s, LinkOption... lin should at least validate that the attribute is available on a basic view. */ // TODO: Put these strings in constants - if (viewType.equals("azureBasic")) { + if (viewType.equals(AzureBasicFileAttributeView.NAME)) { if (!AzureBasicFileAttributes.ATTRIBUTE_STRINGS.contains(attributeName) && !attributeName.equals("*")) { throw LoggingUtility.logError(logger, new IllegalArgumentException("Invalid attribute. View: " + viewType @@ -786,7 +786,7 @@ public Map readAttributes(Path path, String s, LinkOption... lin // If "*" is specified, add all of the attributes from the specified set. if (attributeName.equals("*")) { Set attributesToAdd; - if (viewType.equals("azureBasic")) { + if (viewType.equals(AzureBasicFileAttributeView.NAME)) { for (String attr : AzureBasicFileAttributes.ATTRIBUTE_STRINGS) { results.put(attr, attributeSuppliers.get(attr).get()); } @@ -848,7 +848,7 @@ public void setAttribute(Path path, String s, Object o, LinkOption... linkOption state that "basic" must be supported, so we funnel to azureBasic. */ if (viewType.equals("basic")) { - viewType = "azureBasic"; + viewType = AzureBasicFileAttributeView.NAME; } // We don't actually support any setters on the basic view. @@ -856,7 +856,7 @@ public void setAttribute(Path path, String s, Object o, LinkOption... linkOption throw LoggingUtility.logError(logger, new IllegalArgumentException("Invalid attribute. View: " + viewType + ". Attribute: " + attributeName)); - } else if (viewType.equals("azureBlob")) { + } else if (viewType.equals(AzureBlobFileAttributeView.NAME)) { Map> attributeConsumers = AzureBlobFileAttributeView.setAttributeConsumers( this.getFileAttributeView(path, AzureBlobFileAttributeView.class, linkOptions)); if (!attributeConsumers.containsKey(attributeName)) { diff --git a/sdk/storage/azure-storage-blob-nio/src/samples/java/com/azure/storage/blob/nio/ReadmeSamples.java b/sdk/storage/azure-storage-blob-nio/src/samples/java/com/azure/storage/blob/nio/ReadmeSamples.java new file mode 100644 index 0000000000000..004d5cfd1e1e9 --- /dev/null +++ b/sdk/storage/azure-storage-blob-nio/src/samples/java/com/azure/storage/blob/nio/ReadmeSamples.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +package com.azure.storage.blob.nio; + +import com.azure.storage.blob.models.BlobHttpHeaders; + +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.net.URI; +import java.net.URISyntaxException; +import java.nio.file.FileSystem; +import java.nio.file.FileSystems; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.StandardCopyOption; +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; + +/** + * WARNING: MODIFYING THIS FILE WILL REQUIRE CORRESPONDING UPDATES TO README.md FILE. LINE NUMBERS + * ARE USED TO EXTRACT APPROPRIATE CODE SEGMENTS FROM THIS FILE. ADD NEW CODE AT THE BOTTOM TO AVOID CHANGING + * LINE NUMBERS OF EXISTING CODE SAMPLES. + * + * Code samples for the README.md + */ +public class ReadmeSamples { + + private FileSystem myFs = FileSystems.newFileSystem(new URI("azb://?account= config = new HashMap<>(); + config.put(AzureFileSystem.AZURE_STORAGE_ACCOUNT_KEY, ""); + config.put(AzureFileSystem.AZURE_STORAGE_FILE_STORES, ""); + FileSystem myFs = FileSystems.newFileSystem(new URI("azb://?account= attributes = Files.readAttributes(filePath, "azureBlob:metadata,headers"); + } + + public void writeAttributesToAFile() throws IOException { + AzureBlobFileAttributeView view = Files.getFileAttributeView(filePath, AzureBlobFileAttributeView.class); + view.setMetadata(Collections.EMPTY_MAP); + } + + public void writeAttributesToAFileString() throws IOException { + Files.setAttribute(filePath, "azureBlob:blobHttpHeaders", new BlobHttpHeaders()); + } +} From 46e99501a11f7f27cc22557da20744da84fa3cbe Mon Sep 17 00:00:00 2001 From: Connie Yau Date: Fri, 10 Jul 2020 09:58:19 -0700 Subject: [PATCH 085/129] Update CHANGELOG and README for preview 4. (#13026) * Changelog updates. * Update README with current version. * Update identity version. --- sdk/servicebus/azure-messaging-servicebus/CHANGELOG.md | 9 +++++++-- sdk/servicebus/azure-messaging-servicebus/README.md | 4 ++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/sdk/servicebus/azure-messaging-servicebus/CHANGELOG.md b/sdk/servicebus/azure-messaging-servicebus/CHANGELOG.md index b59c2cf0196db..68344bf8adb48 100644 --- a/sdk/servicebus/azure-messaging-servicebus/CHANGELOG.md +++ b/sdk/servicebus/azure-messaging-servicebus/CHANGELOG.md @@ -1,10 +1,15 @@ # Release History -## 7.0.0-beta.4 (Unreleased) - +## 7.0.0-beta.4 (2020-07-10) +- Add support for send messages via another entity. +- Add support for management operations on a topic, subscription, or namespace. +- Add support for receiving messages from the dead letter queue. +- Change suffixes for receive methods by adding `Message` or `Messages`. +- Remove `MessageLockToken` interface in favour of passing a lock token string. ## 7.0.0-beta.3 (2020-06-08) - Add support for transaction feature in all the clients. +- Add support for management operations on a Queue. ## 7.0.0-beta.2 (2020-05-07) diff --git a/sdk/servicebus/azure-messaging-servicebus/README.md b/sdk/servicebus/azure-messaging-servicebus/README.md index e061bfd600c45..4da74784fff9a 100644 --- a/sdk/servicebus/azure-messaging-servicebus/README.md +++ b/sdk/servicebus/azure-messaging-servicebus/README.md @@ -37,7 +37,7 @@ To quickly create the needed Service Bus resources in Azure and to receive a con com.azure azure-messaging-servicebus - 7.0.0-beta.3 + 7.0.0-beta.4 ``` [//]: # ({x-version-update-end}) @@ -86,7 +86,7 @@ platform. First, add the package: com.azure azure-identity - 1.0.6 + 1.0.8 ``` [//]: # ({x-version-update-end}) From 593440d1f6423bf6eb71294a81ebec835b6c1c1c Mon Sep 17 00:00:00 2001 From: Alan Zimmer <48699787+alzimmermsft@users.noreply.github.com> Date: Fri, 10 Jul 2020 10:49:54 -0700 Subject: [PATCH 086/129] Move AzureTestWatcher into azure-core-test (#12989) * Move azure-test-watcher into azure-core-test * Remove references to azure-test-watcher --- common/azure-test-watcher/README.md | 43 ---------- common/azure-test-watcher/pom.xml | 81 ------------------- .../java/com/azure/testing/package-info.java | 7 -- .../org.junit.jupiter.api.extension.Extension | 1 - eng/versioning/version_client.txt | 1 - pom.xml | 1 - .../azure/core/test}/AzureTestWatcher.java | 2 +- .../org.junit.jupiter.api.extension.Extension | 1 + sdk/parents/azure-client-sdk-parent/pom.xml | 10 --- 9 files changed, 2 insertions(+), 145 deletions(-) delete mode 100644 common/azure-test-watcher/README.md delete mode 100644 common/azure-test-watcher/pom.xml delete mode 100644 common/azure-test-watcher/src/main/java/com/azure/testing/package-info.java delete mode 100644 common/azure-test-watcher/src/main/resources/META-INF/services/org.junit.jupiter.api.extension.Extension rename {common/azure-test-watcher/src/main/java/com/azure/testing => sdk/core/azure-core-test/src/main/java/com/azure/core/test}/AzureTestWatcher.java (98%) create mode 100644 sdk/core/azure-core-test/src/main/resources/META-INF/services/org.junit.jupiter.api.extension.Extension diff --git a/common/azure-test-watcher/README.md b/common/azure-test-watcher/README.md deleted file mode 100644 index 9c783341d4afc..0000000000000 --- a/common/azure-test-watcher/README.md +++ /dev/null @@ -1,43 +0,0 @@ -# Azure Test Watcher client library for Java - -Azure Test Watcher client library adds an implementations of JUnit 5's before and after test extensions and creates an SPI that will be loaded during the test run - -## Getting started - -### Prerequisites - -- Java Development Kit (JDK) with version 8 or above - -### Adding the package to your product - -[//]: # ({x-version-update-start;com.azure:azure-test-watcher;current}) -```xml - - com.azure - azure-test-watcher - 1.0.0-beta.1 - -``` -[//]: # ({x-version-update-end}) - -## Key concepts - - -## Examples - -## Troubleshooting - -## Next steps - -## 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 -1. Create your feature branch (`git checkout -b my-new-feature`) -1. Commit your changes (`git commit -am 'Add some feature'`) -1. Push to the branch (`git push origin my-new-feature`) -1. Create new Pull Request - -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-java%2Fcommon%2Fazure-test-watcher%2FREADME.png) diff --git a/common/azure-test-watcher/pom.xml b/common/azure-test-watcher/pom.xml deleted file mode 100644 index 3210abbfa5a4d..0000000000000 --- a/common/azure-test-watcher/pom.xml +++ /dev/null @@ -1,81 +0,0 @@ - - - 4.0.0 - - com.azure - azure-test-watcher - 1.0.0-beta.1 - - - com.azure - azure-client-sdk-parent - 1.7.0 - ../../sdk/parents/azure-client-sdk-parent - - - - UTF-8 - - https://azuresdkartifacts.blob.core.windows.net/azure-sdk-for-java - - 1.8 - 1.8 - - - - - - org.apache.maven.plugins - maven-enforcer-plugin - 3.0.0-M3 - - - - - com.azure:* - - - org.junit.jupiter:junit-jupiter:[5.6.2] - org.junit.jupiter:junit-jupiter-api:[5.6.2] - - - - - - - - - org.apache.maven.plugins - maven-jar-plugin - 3.1.2 - - ${packageOutputDirectory} - - - - default-jar - test - - jar - - - - - - - - - - org.junit.jupiter - junit-jupiter - 5.6.2 - - - org.junit.jupiter - junit-jupiter-api - 5.6.2 - - - diff --git a/common/azure-test-watcher/src/main/java/com/azure/testing/package-info.java b/common/azure-test-watcher/src/main/java/com/azure/testing/package-info.java deleted file mode 100644 index 295ed604e6709..0000000000000 --- a/common/azure-test-watcher/src/main/java/com/azure/testing/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -/** - * Package containing JUnit 5 testing extensions. - */ -package com.azure.testing; diff --git a/common/azure-test-watcher/src/main/resources/META-INF/services/org.junit.jupiter.api.extension.Extension b/common/azure-test-watcher/src/main/resources/META-INF/services/org.junit.jupiter.api.extension.Extension deleted file mode 100644 index 3fa30aa817c75..0000000000000 --- a/common/azure-test-watcher/src/main/resources/META-INF/services/org.junit.jupiter.api.extension.Extension +++ /dev/null @@ -1 +0,0 @@ -com.azure.testing.AzureTestWatcher diff --git a/eng/versioning/version_client.txt b/eng/versioning/version_client.txt index 277a78335fb18..ca739e6b6f004 100644 --- a/eng/versioning/version_client.txt +++ b/eng/versioning/version_client.txt @@ -49,7 +49,6 @@ com.azure:azure-storage-internal-avro;12.0.0-beta.1;12.0.0-beta.2 com.azure:azure-storage-perf;1.0.0-beta.1;1.0.0-beta.1 com.azure:azure-storage-queue;12.6.0-beta.1;12.6.0-beta.2 com.azure:perf-test-core;1.0.0-beta.1;1.0.0-beta.1 -com.azure:azure-test-watcher;1.0.0-beta.1;1.0.0-beta.1 com.azure:azure-spring-boot-test-aad;1.0.0;1.0.0 com.azure:azure-spring-boot-test-core;1.0.0;1.0.0 com.azure:azure-spring-boot-test-cosmosdb;1.0.0;1.0.0 diff --git a/pom.xml b/pom.xml index 807e0f82055ce..677664e21ce65 100644 --- a/pom.xml +++ b/pom.xml @@ -8,7 +8,6 @@ pom 1.0.0 - common/azure-test-watcher common/perf-test-core eng/jacoco-test-coverage eng/code-quality-reports diff --git a/common/azure-test-watcher/src/main/java/com/azure/testing/AzureTestWatcher.java b/sdk/core/azure-core-test/src/main/java/com/azure/core/test/AzureTestWatcher.java similarity index 98% rename from common/azure-test-watcher/src/main/java/com/azure/testing/AzureTestWatcher.java rename to sdk/core/azure-core-test/src/main/java/com/azure/core/test/AzureTestWatcher.java index ee79b70406651..551c6abc5b436 100644 --- a/common/azure-test-watcher/src/main/java/com/azure/testing/AzureTestWatcher.java +++ b/sdk/core/azure-core-test/src/main/java/com/azure/core/test/AzureTestWatcher.java @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.azure.testing; +package com.azure.core.test; import org.junit.jupiter.api.extension.AfterTestExecutionCallback; import org.junit.jupiter.api.extension.BeforeTestExecutionCallback; diff --git a/sdk/core/azure-core-test/src/main/resources/META-INF/services/org.junit.jupiter.api.extension.Extension b/sdk/core/azure-core-test/src/main/resources/META-INF/services/org.junit.jupiter.api.extension.Extension new file mode 100644 index 0000000000000..19d1b79f06c19 --- /dev/null +++ b/sdk/core/azure-core-test/src/main/resources/META-INF/services/org.junit.jupiter.api.extension.Extension @@ -0,0 +1 @@ +com.azure.core.test.AzureTestWatcher diff --git a/sdk/parents/azure-client-sdk-parent/pom.xml b/sdk/parents/azure-client-sdk-parent/pom.xml index 8276bdfb8eb76..ad31d3479c60d 100644 --- a/sdk/parents/azure-client-sdk-parent/pom.xml +++ b/sdk/parents/azure-client-sdk-parent/pom.xml @@ -731,17 +731,7 @@ org.apache.maven.plugins maven-surefire-plugin 3.0.0-M3 - - - com.azure - azure-test-watcher - 1.0.0-beta.1 - - - - ../../../common/azure-test-watcher/target/azure-test-watcher-1.0.0-beta.1.jar - alphabetical false From 7d690ca6481239c9efea8955c3263393c045db2d Mon Sep 17 00:00:00 2001 From: Yi Liu Date: Sat, 11 Jul 2020 02:20:25 +0800 Subject: [PATCH 087/129] Modify javadoc check on spring annotation in README.md (#13012) * Modify javadoc check on spring annotation in README.md * Update generate_overview_from_readme.py Relax regex pattern to match all `@` symbols and replacing them with `{@literal @}`. This is safe as Javadoc generation will display all `{@literal @}` as `@`, retaining current display behavior while fixing all erroneous attempts of Javadoc using `@` as a tag reference. Co-authored-by: Alan Zimmer <48699787+alzimmermsft@users.noreply.github.com> --- eng/pipelines/scripts/generate_overview_from_readme.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eng/pipelines/scripts/generate_overview_from_readme.py b/eng/pipelines/scripts/generate_overview_from_readme.py index 6b606a98777ca..7fcbe35a7fbfb 100644 --- a/eng/pipelines/scripts/generate_overview_from_readme.py +++ b/eng/pipelines/scripts/generate_overview_from_readme.py @@ -41,7 +41,7 @@ def generate_overview(readme_file, version): # markdown2.markdown will create html from the readme.md file. The fenced-code-blocks # extras being passed into the markdown call is necessary to deal with the embedded # code blocks within the readme so they'll displaye correctly in the html - html_readme_content = markdown2.markdown(re.sub(pattern='^(\s*)@', repl='\g<1>{@literal @}', string=readme_content, flags=re.MULTILINE), extras=["fenced-code-blocks"]) + html_readme_content = markdown2.markdown(re.sub(pattern='@', repl='{@literal @}', string=readme_content, flags=re.MULTILINE), extras=["fenced-code-blocks"]) # Due to javadoc's iFrames the links need to target new tabs otherwise hilarity ensues soup = BeautifulSoup(html_readme_content, "html.parser") From e5194356021564ce2b04732b78a7cdab60b49e1f Mon Sep 17 00:00:00 2001 From: Yi Liu Date: Sat, 11 Jul 2020 03:45:51 +0800 Subject: [PATCH 088/129] add readme of spring data cosmos (#12964) * add README.md for spring-data-cosmos project * add embedme tag for README * modify checkstyle errors * modify README to fit SDK repo Co-authored-by: Kushagra Thapar --- .../checkstyle/checkstyle-suppressions.xml | 1 + .../{Contributing.md => CONTRIBUTING.md} | 0 sdk/cosmos/azure-spring-data-cosmos/README.md | 327 +++++++++++++++++- .../com/azure/cosmos/AppConfiguration.java | 65 ++++ .../cosmos/AppConfigurationCodeSnippet.java | 47 +++ .../com/azure/cosmos/CosmosDbProperties.java | 64 ++++ .../DocumentIndexingPolicyCodeSnippet.java | 27 ++ .../java/com/azure/cosmos/MyDocument.java | 20 ++ .../ObjectMapperConfigurationCodeSnippet.java | 22 ++ .../cosmos/PageableRepositoryCodeSnippet.java | 39 +++ .../com/azure/cosmos/SampleApplication.java | 51 +++ .../samples/java/com/azure/cosmos/User.java | 62 ++++ .../java/com/azure/cosmos/UserRepository.java | 21 ++ .../cosmos/UserRepositoryConfiguration.java | 67 ++++ .../java/com/azure/cosmos/UserSample.java | 19 + 15 files changed, 829 insertions(+), 3 deletions(-) rename sdk/cosmos/azure-spring-data-cosmos/{Contributing.md => CONTRIBUTING.md} (100%) create mode 100644 sdk/cosmos/azure-spring-data-cosmos/src/samples/java/com/azure/cosmos/AppConfiguration.java create mode 100644 sdk/cosmos/azure-spring-data-cosmos/src/samples/java/com/azure/cosmos/AppConfigurationCodeSnippet.java create mode 100644 sdk/cosmos/azure-spring-data-cosmos/src/samples/java/com/azure/cosmos/CosmosDbProperties.java create mode 100644 sdk/cosmos/azure-spring-data-cosmos/src/samples/java/com/azure/cosmos/DocumentIndexingPolicyCodeSnippet.java create mode 100644 sdk/cosmos/azure-spring-data-cosmos/src/samples/java/com/azure/cosmos/MyDocument.java create mode 100644 sdk/cosmos/azure-spring-data-cosmos/src/samples/java/com/azure/cosmos/ObjectMapperConfigurationCodeSnippet.java create mode 100644 sdk/cosmos/azure-spring-data-cosmos/src/samples/java/com/azure/cosmos/PageableRepositoryCodeSnippet.java create mode 100644 sdk/cosmos/azure-spring-data-cosmos/src/samples/java/com/azure/cosmos/SampleApplication.java create mode 100644 sdk/cosmos/azure-spring-data-cosmos/src/samples/java/com/azure/cosmos/User.java create mode 100644 sdk/cosmos/azure-spring-data-cosmos/src/samples/java/com/azure/cosmos/UserRepository.java create mode 100644 sdk/cosmos/azure-spring-data-cosmos/src/samples/java/com/azure/cosmos/UserRepositoryConfiguration.java create mode 100644 sdk/cosmos/azure-spring-data-cosmos/src/samples/java/com/azure/cosmos/UserSample.java diff --git a/eng/code-quality-reports/src/main/resources/checkstyle/checkstyle-suppressions.xml b/eng/code-quality-reports/src/main/resources/checkstyle/checkstyle-suppressions.xml index 42bb4fb08c1d5..891d637a644d2 100755 --- a/eng/code-quality-reports/src/main/resources/checkstyle/checkstyle-suppressions.xml +++ b/eng/code-quality-reports/src/main/resources/checkstyle/checkstyle-suppressions.xml @@ -489,5 +489,6 @@ + diff --git a/sdk/cosmos/azure-spring-data-cosmos/Contributing.md b/sdk/cosmos/azure-spring-data-cosmos/CONTRIBUTING.md similarity index 100% rename from sdk/cosmos/azure-spring-data-cosmos/Contributing.md rename to sdk/cosmos/azure-spring-data-cosmos/CONTRIBUTING.md diff --git a/sdk/cosmos/azure-spring-data-cosmos/README.md b/sdk/cosmos/azure-spring-data-cosmos/README.md index c6e8f26a27727..16f9b4d26b1be 100644 --- a/sdk/cosmos/azure-spring-data-cosmos/README.md +++ b/sdk/cosmos/azure-spring-data-cosmos/README.md @@ -1,25 +1,346 @@ #Azure Cosmos DB client library for Java ## Getting started +[Azure Cosmos DB](https://docs.microsoft.com/azure/cosmos-db/introduction) is a globally-distributed database service that allows developers to work with data using a variety of standard APIs, such as SQL, MongoDB, Cassandra, Graph, and Table. + +**Spring Data Azure Cosmos DB** provides initial Spring Data support for Azure Cosmos DB using the [SQL API](https://docs.microsoft.com/azure/cosmos-db/sql-api-introduction), based on Spring Data framework. Currently it only supports SQL API, the other APIs are in the plan. ## TOC -## Examples +* [Examples](#Examples) +* [Spring data version support](#spring-data-version-support) +* [Feature List](#feature-list) +* [Quick Start](#quick-start) +* [Query Partitioned Collection](QueryPartitionedCollection.md) +* [Beta version package](#Beta version package) +* [Troubleshooting](#Troubleshooting) +* [Contributing](#Contributing) +* [Code of Conduct](#code-of-conduct) +* [Key concepts](#Key concepts) +* [Next steps](#Next steps) -## Spring Data Version Support +## Examples +Please refer to [sample project here](./samplecode). ## Feature List +- Spring Data ReactiveCrudRepository CrudRepository basic CRUD functionality + - save + - findAll + - findOne by Id + - deleteAll + - delete by Id + - delete entity +- Spring Data [@Id](https://github.com/spring-projects/spring-data-commons/blob/db62390de90c93a78743c97cc2cc9ccd964994a5/src/main/java/org/springframework/data/annotation/Id.java) annotation. + There're 2 ways to map a field in domain class to `id` field of Azure Cosmos DB document. + - annotate a field in domain class with `@Id`, this field will be mapped to document `id` in Cosmos DB. + - set name of this field to `id`, this field will be mapped to document `id` in Azure Cosmos DB. +- Custom collection Name. + By default, collection name will be class name of user domain class. To customize it, add the `@Document(collection="myCustomCollectionName")` annotation to the domain class. The collection field also supports SpEL expressions (eg. `collection = "${dynamic.collection.name}"` or `collection = "#{@someBean.getContainerName()}"`) in order to provide collection names programmatically/via configuration properties. +- Custom IndexingPolicy + By default, IndexingPolicy will be set by azure service. To customize it add annotation `@DocumentIndexingPolicy` to domain class. This annotation has 4 attributes to customize, see following: + +```java +// Indicate if indexing policy use automatic or not +boolean automatic() default Constants.DEFAULT_INDEXINGPOLICY_AUTOMATIC; + +// Indexing policy mode, option Consistent|Lazy|None. +IndexingMode mode() default IndexingMode.CONSISTENT; + +// Included paths for indexing +String[] includePaths() default {}; + +// Excluded paths for indexing +String[] excludePaths() default {}; +``` + +- Supports Optimistic Locking for specific collections, which means upserts/deletes by document will fail with an exception in case the document was modified by another process in the meanwhile. To enable Optimistic Locking for a collection, just create a string `_etag` field and mark it with the `@Version` annotation. See the following: + + +```java +@Document(collection = "myCollection") +public class MyDocument { + String id; + String data; + @Version + String _etag; +} +``` +- Supports [Azure Cosmos DB partition](https://docs.microsoft.com/azure/cosmos-db/partition-data). To specify a field of domain class to be partition key field, just annotate it with `@PartitionKey`. When you do CRUD operation, pls specify your partition value. For more sample on partition CRUD, pls refer to [test here](./src/test/java/com/azure/spring/data/cosmos/repository/integration/AddressRepositoryIT.java) +- Supports [Spring Data custom query](https://docs.spring.io/spring-data/commons/docs/current/reference/html/#repositories.query-methods.details) find operation, e.g., `findByAFieldAndBField` +- Supports [Spring Data pagable and sort](https://docs.spring.io/spring-data/commons/docs/current/reference/html/#repositories.special-parameters). + - Based on available RUs on the database account, cosmosDB can return documents less than or equal to the requested size. + - Due to this variable number of returned documents in every iteration, user should not rely on the totalPageSize, and instead iterating over pageable should be done in this way. + +```java +final CosmosPageRequest pageRequest = new CosmosPageRequest(0, pageSize, null); +Page page = repository.findAll(pageRequest); +List pageContent = page.getContent(); +while (page.hasNext()) { + Pageable nextPageable = page.nextPageable(); + page = repository.findAll(nextPageable); + pageContent = page.getContent(); +} +``` +- Supports [spring-boot-starter-data-rest](https://projects.spring.io/spring-data-rest/). +- Supports List and nested type in domain class. +- Configurable ObjectMapper bean with unique name `cosmosdbObjectMapper`, only configure customized ObjectMapper if you really need to. e.g., + +```java +@Bean(name = "cosmosdbObjectMapper") +public ObjectMapper objectMapper() { + return new ObjectMapper(); // Do configuration to the ObjectMapper if required +} +``` ## Quick Start -## Snapshots +### Add the dependency +`azure-spring-data-cosmos` is published on Maven Central Repository. +If you are using Maven, add the following dependency. + +[//]: # "{x-version-update-start;com.azure:azure-spring-data-cosmos;current}" +```xml + + com.azure + azure-spring-data-cosmos + 3.0.0-beta.1 + +``` + +### Setup Configuration +Setup configuration class. + +CosmosKeyCredential feature provides capability to rotate keys on the fly. You can switch keys using switchToSecondaryKey(). +For more information on this, see the Sample Application code. + +### Sync and Reactive Repository support +2.2.x supports both sync and reactive repository support. + +Use `@EnableCosmosRepositories` to enable sync repository support. + +For reactive repository support, use `@EnableReactiveCosmosRepositories` + +### Response Diagnostics String and Query Metrics +2.2.x supports Response Diagnostics String and Query Metrics. +Set `populateQueryMetrics` flag to true in application.properties to enable query metrics. +In addition to setting the flag, implement `ResponseDiagnosticsProcessor` to log diagnostics information. + + +```java +@Configuration +@EnableCosmosRepositories +public class AppConfiguration extends AbstractCosmosConfiguration { + + private static final Logger logger = LoggerFactory.getLogger(AppConfiguration.class); + + @Value("${azure.cosmosdb.uri}") + private String uri; + + @Value("${azure.cosmosdb.key}") + private String key; + + @Value("${azure.cosmosdb.secondaryKey}") + private String secondaryKey; + + @Value("${azure.cosmosdb.database}") + private String dbName; + + @Value("${azure.cosmosdb.populateQueryMetrics}") + private boolean populateQueryMetrics; + + private CosmosKeyCredential cosmosKeyCredential; + + public CosmosDBConfig getConfig() { + this.cosmosKeyCredential = new CosmosKeyCredential(key); + CosmosDBConfig cosmosdbConfig = CosmosDBConfig.builder(uri, + this.cosmosKeyCredential, dbName).build(); + cosmosdbConfig.setPopulateQueryMetrics(populateQueryMetrics); + cosmosdbConfig.setResponseDiagnosticsProcessor(new ResponseDiagnosticsProcessorImplementation()); + return cosmosdbConfig; + } + + public void switchToSecondaryKey() { + this.cosmosKeyCredential.key(secondaryKey); + } + + private static class ResponseDiagnosticsProcessorImplementation implements ResponseDiagnosticsProcessor { + + @Override + public void processResponseDiagnostics(@Nullable ResponseDiagnostics responseDiagnostics) { + logger.info("Response Diagnostics {}", responseDiagnostics); + } + } + +} +``` +Or if you want to customize your config: + +```java +public CosmosDBConfig getConfig() { + this.cosmosKeyCredential = new CosmosKeyCredential(key); + CosmosDBConfig cosmosDbConfig = CosmosDBConfig.builder(uri, this.cosmosKeyCredential, dbName).build(); + cosmosDbConfig.getConnectionPolicy().connectionMode(ConnectionMode.DIRECT); + cosmosDbConfig.getConnectionPolicy().maxPoolSize(1000); + return cosmosDbConfig; +} +``` +By default, `@EnableCosmosRepositories` will scan the current package for any interfaces that extend one of Spring Data's repository interfaces. Using it to annotate your Configuration class to scan a different root package by `@EnableCosmosRepositories(basePackageClass=UserRepository.class)` if your project layout has multiple projects and it's not finding your repositories. + + +### Define an entity +Define a simple entity as Document in Azure Cosmos DB. + +You can define entities by adding the `@Document` annotation and specifying properties related to the container, such as the container name, request units (RUs), time to live, and auto-create container. + +Containers are created automatically unless you don't want them to: Set `autoCreateCollection` to false in `@Document` annotation to disable auto creation of containers. + +Note: By default request units assigned to newly created containers is 4000. Specify different ru value to customize request units for container created by the SDK (minimum RU value is 400). + +```java +@Document(collection = "myCollection", ru = "400") +public class User { + private String id; + private String firstName; + + + @PartitionKey + private String lastName; + + public User() { + // If you do not want to create a default constructor, + // use annotation @JsonCreator and @JsonProperty in the full args constructor + } + + public User(String id, String firstName, String lastName) { + this.id = id; + this.firstName = firstName; + this.lastName = lastName; + } + + @Override + public String toString() { + return String.format("User: %s %s, %s", firstName, lastName, id); + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getFirstName() { + return firstName; + } + + public void setFirstName(String firstName) { + this.firstName = firstName; + } + + public String getLastName() { + return lastName; + } + + public void setLastName(String lastName) { + this.lastName = lastName; + } +} +``` +`id` field will be used as document id in Azure Cosmos DB. If you want use another field like `emailAddress` as document `id`, just annotate that field with `@Id` annotation. + +Annotation `@Document(collection="mycollection")` is used to specify collection name in Azure Cosmos DB. +Annotation `@PartitionKey` on `lastName` field is used to specify this field be partition key in Azure Cosmos DB. + +```java +@Document(collection = "mycollection") +public class UserSample { + @Id + private String emailAddress; + +} +``` + +### Create repositories +Extends CosmosRepository interface, which provides Spring Data repository support. + + +```java +@Repository +public interface UserRepository extends CosmosRepository { + List findByFirstName(String firstName); + User findOne(String id, String lastName); +} +``` + +`findByFirstName` method is custom query method, it will find documents per FirstName. + +### Create an Application class +Here create an application class with all the components + + +```java +@SpringBootApplication +public class SampleApplication implements CommandLineRunner { + + @Autowired + private UserRepository repository; + + @Autowired + private ApplicationContext applicationContext; + + public static void main(String[] args) { + SpringApplication.run(SampleApplication.class, args); + } + + public void run(String... var1) { + + final User testUser = new User("testId", "testFirstName", "testLastName"); + + repository.deleteAll(); + repository.save(testUser); + + // to find by Id, please specify partition key value if collection is partitioned + final User result = repository.findOne(testUser.getId(), testUser.getLastName()); + // if emailAddress is mapped to id, then + // final User result = respository.findOne(testUser.getEmailAddress(), testUser.getLastName()); + + // Switch to secondary key + UserRepositoryConfiguration bean = + applicationContext.getBean(UserRepositoryConfiguration.class); + bean.switchToSecondaryKey(); + + // Now repository will use secondary key + repository.save(testUser); + + } +} +``` +Autowired UserRepository interface, then can do save, delete and find operations. Spring Data Azure Cosmos DB uses the CosmosTemplate to execute the queries behind *find*, *save* methods. You can use the template yourself for more complex queries. + +## Beta version package + +Beta version built from `master` branch are available, you can refer to the [instruction](https://github.com/Azure/azure-sdk-for-java/blob/master/CONTRIBUTING.md#nightly-package-builds) to use beta version packages. + ## Troubleshooting +If you encounter any bug, please file an issue [here](https://github.com/Azure/azure-sdk-for-java/issues/new). + +To suggest a new feature or changes that could be made, file an issue the same way you would for a bug. + ## Contributing +Contribution is welcome. Please follow [this instruction](./CONTRIBUTING.md) to contribute code. + ## Code of Conduct +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. + +### Data/Telemetry + + This project collects usage data and sends it to Microsoft to help improve our products and services. Read our [privacy](https://privacy.microsoft.com/privacystatement) statement to learn more. + ## Key concepts ## Next steps diff --git a/sdk/cosmos/azure-spring-data-cosmos/src/samples/java/com/azure/cosmos/AppConfiguration.java b/sdk/cosmos/azure-spring-data-cosmos/src/samples/java/com/azure/cosmos/AppConfiguration.java new file mode 100644 index 0000000000000..9fbdeefe25645 --- /dev/null +++ b/sdk/cosmos/azure-spring-data-cosmos/src/samples/java/com/azure/cosmos/AppConfiguration.java @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +package com.azure.cosmos; +/** + * WARNING: MODIFYING THIS FILE WILL REQUIRE CORRESPONDING UPDATES TO README.md FILE. LINE NUMBERS + * ARE USED TO EXTRACT APPROPRIATE CODE SEGMENTS FROM THIS FILE. ADD NEW CODE AT THE BOTTOM TO AVOID CHANGING + * LINE NUMBERS OF EXISTING CODE SAMPLES. + */ +import com.azure.data.cosmos.CosmosKeyCredential; +import com.azure.spring.data.cosmos.config.AbstractCosmosConfiguration; +import com.azure.spring.data.cosmos.config.CosmosDBConfig; +import com.azure.spring.data.cosmos.core.ResponseDiagnostics; +import com.azure.spring.data.cosmos.core.ResponseDiagnosticsProcessor; +import com.azure.spring.data.cosmos.repository.config.EnableCosmosRepositories; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.context.annotation.Configuration; +import io.micrometer.core.lang.Nullable; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +@Configuration +@EnableCosmosRepositories +public class AppConfiguration extends AbstractCosmosConfiguration { + + private static final Logger logger = LoggerFactory.getLogger(AppConfiguration.class); + + @Value("${azure.cosmosdb.uri}") + private String uri; + + @Value("${azure.cosmosdb.key}") + private String key; + + @Value("${azure.cosmosdb.secondaryKey}") + private String secondaryKey; + + @Value("${azure.cosmosdb.database}") + private String dbName; + + @Value("${azure.cosmosdb.populateQueryMetrics}") + private boolean populateQueryMetrics; + + private CosmosKeyCredential cosmosKeyCredential; + + public CosmosDBConfig getConfig() { + this.cosmosKeyCredential = new CosmosKeyCredential(key); + CosmosDBConfig cosmosdbConfig = CosmosDBConfig.builder(uri, + this.cosmosKeyCredential, dbName).build(); + cosmosdbConfig.setPopulateQueryMetrics(populateQueryMetrics); + cosmosdbConfig.setResponseDiagnosticsProcessor(new ResponseDiagnosticsProcessorImplementation()); + return cosmosdbConfig; + } + + public void switchToSecondaryKey() { + this.cosmosKeyCredential.key(secondaryKey); + } + + private static class ResponseDiagnosticsProcessorImplementation implements ResponseDiagnosticsProcessor { + + @Override + public void processResponseDiagnostics(@Nullable ResponseDiagnostics responseDiagnostics) { + logger.info("Response Diagnostics {}", responseDiagnostics); + } + } + +} diff --git a/sdk/cosmos/azure-spring-data-cosmos/src/samples/java/com/azure/cosmos/AppConfigurationCodeSnippet.java b/sdk/cosmos/azure-spring-data-cosmos/src/samples/java/com/azure/cosmos/AppConfigurationCodeSnippet.java new file mode 100644 index 0000000000000..d44af1707fad7 --- /dev/null +++ b/sdk/cosmos/azure-spring-data-cosmos/src/samples/java/com/azure/cosmos/AppConfigurationCodeSnippet.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +package com.azure.cosmos; + +/** + * WARNING: MODIFYING THIS FILE WILL REQUIRE CORRESPONDING UPDATES TO README.md FILE. LINE NUMBERS + * ARE USED TO EXTRACT APPROPRIATE CODE SEGMENTS FROM THIS FILE. ADD NEW CODE AT THE BOTTOM TO AVOID CHANGING + * LINE NUMBERS OF EXISTING CODE SAMPLES. + */ + +import com.azure.data.cosmos.ConnectionMode; +import com.azure.data.cosmos.CosmosKeyCredential; +import com.azure.spring.data.cosmos.config.AbstractCosmosConfiguration; +import com.azure.spring.data.cosmos.config.CosmosDBConfig; +import com.azure.spring.data.cosmos.repository.config.EnableCosmosRepositories; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.context.annotation.Configuration; + +@Configuration +@EnableCosmosRepositories +public class AppConfigurationCodeSnippet extends AbstractCosmosConfiguration { + // configuration code + @Value("${azure.cosmosdb.uri}") + private String uri; + + @Value("${azure.cosmosdb.key}") + private String key; + + @Value("${azure.cosmosdb.secondaryKey}") + private String secondaryKey; + + @Value("${azure.cosmosdb.database}") + private String dbName; + + @Value("${azure.cosmosdb.populateQueryMetrics}") + private boolean populateQueryMetrics; + + private CosmosKeyCredential cosmosKeyCredential; + + public CosmosDBConfig getConfig() { + this.cosmosKeyCredential = new CosmosKeyCredential(key); + CosmosDBConfig cosmosDbConfig = CosmosDBConfig.builder(uri, this.cosmosKeyCredential, dbName).build(); + cosmosDbConfig.getConnectionPolicy().connectionMode(ConnectionMode.DIRECT); + cosmosDbConfig.getConnectionPolicy().maxPoolSize(1000); + return cosmosDbConfig; + } +} diff --git a/sdk/cosmos/azure-spring-data-cosmos/src/samples/java/com/azure/cosmos/CosmosDbProperties.java b/sdk/cosmos/azure-spring-data-cosmos/src/samples/java/com/azure/cosmos/CosmosDbProperties.java new file mode 100644 index 0000000000000..345d13361811d --- /dev/null +++ b/sdk/cosmos/azure-spring-data-cosmos/src/samples/java/com/azure/cosmos/CosmosDbProperties.java @@ -0,0 +1,64 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +package com.azure.cosmos; +/** + * WARNING: MODIFYING THIS FILE WILL REQUIRE CORRESPONDING UPDATES TO README.md FILE. LINE NUMBERS + * ARE USED TO EXTRACT APPROPRIATE CODE SEGMENTS FROM THIS FILE. ADD NEW CODE AT THE BOTTOM TO AVOID CHANGING + * LINE NUMBERS OF EXISTING CODE SAMPLES. + */ + +import org.springframework.boot.context.properties.ConfigurationProperties; + +@ConfigurationProperties(prefix = "azure.cosmosdb") +public class CosmosDbProperties { + + private String uri; + + private String key; + + private String secondaryKey; + + private String database; + + private boolean populateQueryMetrics; + + public String getUri() { + return uri; + } + + public void setUri(String uri) { + this.uri = uri; + } + + public String getKey() { + return key; + } + + public void setKey(String key) { + this.key = key; + } + + public String getSecondaryKey() { + return secondaryKey; + } + + public void setSecondaryKey(String secondaryKey) { + this.secondaryKey = secondaryKey; + } + + public String getDatabase() { + return database; + } + + public void setDatabase(String database) { + this.database = database; + } + + public boolean isPopulateQueryMetrics() { + return populateQueryMetrics; + } + + public void setPopulateQueryMetrics(boolean populateQueryMetrics) { + this.populateQueryMetrics = populateQueryMetrics; + } +} diff --git a/sdk/cosmos/azure-spring-data-cosmos/src/samples/java/com/azure/cosmos/DocumentIndexingPolicyCodeSnippet.java b/sdk/cosmos/azure-spring-data-cosmos/src/samples/java/com/azure/cosmos/DocumentIndexingPolicyCodeSnippet.java new file mode 100644 index 0000000000000..b68bf0f2b366e --- /dev/null +++ b/sdk/cosmos/azure-spring-data-cosmos/src/samples/java/com/azure/cosmos/DocumentIndexingPolicyCodeSnippet.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +package com.azure.cosmos; + +/** + * WARNING: MODIFYING THIS FILE WILL REQUIRE CORRESPONDING UPDATES TO README.md FILE. LINE NUMBERS + * ARE USED TO EXTRACT APPROPRIATE CODE SEGMENTS FROM THIS FILE. ADD NEW CODE AT THE BOTTOM TO AVOID CHANGING + * LINE NUMBERS OF EXISTING CODE SAMPLES. + */ + +import com.azure.data.cosmos.IndexingMode; +import com.azure.spring.data.cosmos.Constants; + +public @interface DocumentIndexingPolicyCodeSnippet { + + // Indicate if indexing policy use automatic or not + boolean automatic() default Constants.DEFAULT_INDEXINGPOLICY_AUTOMATIC; + + // Indexing policy mode, option Consistent|Lazy|None. + IndexingMode mode() default IndexingMode.CONSISTENT; + + // Included paths for indexing + String[] includePaths() default {}; + + // Excluded paths for indexing + String[] excludePaths() default {}; +} diff --git a/sdk/cosmos/azure-spring-data-cosmos/src/samples/java/com/azure/cosmos/MyDocument.java b/sdk/cosmos/azure-spring-data-cosmos/src/samples/java/com/azure/cosmos/MyDocument.java new file mode 100644 index 0000000000000..368b4f850b117 --- /dev/null +++ b/sdk/cosmos/azure-spring-data-cosmos/src/samples/java/com/azure/cosmos/MyDocument.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +package com.azure.cosmos; + +/** + * WARNING: MODIFYING THIS FILE WILL REQUIRE CORRESPONDING UPDATES TO README.md FILE. LINE NUMBERS + * ARE USED TO EXTRACT APPROPRIATE CODE SEGMENTS FROM THIS FILE. ADD NEW CODE AT THE BOTTOM TO AVOID CHANGING + * LINE NUMBERS OF EXISTING CODE SAMPLES. + */ + +import com.azure.spring.data.cosmos.core.mapping.Document; +import org.springframework.data.annotation.Version; + +@Document(collection = "myCollection") +public class MyDocument { + String id; + String data; + @Version + String _etag; +} diff --git a/sdk/cosmos/azure-spring-data-cosmos/src/samples/java/com/azure/cosmos/ObjectMapperConfigurationCodeSnippet.java b/sdk/cosmos/azure-spring-data-cosmos/src/samples/java/com/azure/cosmos/ObjectMapperConfigurationCodeSnippet.java new file mode 100644 index 0000000000000..87c9d23a4650e --- /dev/null +++ b/sdk/cosmos/azure-spring-data-cosmos/src/samples/java/com/azure/cosmos/ObjectMapperConfigurationCodeSnippet.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +package com.azure.cosmos; + +import com.fasterxml.jackson.databind.ObjectMapper; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +/** + * WARNING: MODIFYING THIS FILE WILL REQUIRE CORRESPONDING UPDATES TO README.md FILE. LINE NUMBERS + * ARE USED TO EXTRACT APPROPRIATE CODE SEGMENTS FROM THIS FILE. ADD NEW CODE AT THE BOTTOM TO AVOID CHANGING + * LINE NUMBERS OF EXISTING CODE SAMPLES. + */ +@Configuration +public class ObjectMapperConfigurationCodeSnippet { + + @Bean(name = "cosmosdbObjectMapper") + public ObjectMapper objectMapper() { + return new ObjectMapper(); // Do configuration to the ObjectMapper if required + } + +} diff --git a/sdk/cosmos/azure-spring-data-cosmos/src/samples/java/com/azure/cosmos/PageableRepositoryCodeSnippet.java b/sdk/cosmos/azure-spring-data-cosmos/src/samples/java/com/azure/cosmos/PageableRepositoryCodeSnippet.java new file mode 100644 index 0000000000000..457d3bea66b9b --- /dev/null +++ b/sdk/cosmos/azure-spring-data-cosmos/src/samples/java/com/azure/cosmos/PageableRepositoryCodeSnippet.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +package com.azure.cosmos; + +/** + * WARNING: MODIFYING THIS FILE WILL REQUIRE CORRESPONDING UPDATES TO README.md FILE. LINE NUMBERS + * ARE USED TO EXTRACT APPROPRIATE CODE SEGMENTS FROM THIS FILE. ADD NEW CODE AT THE BOTTOM TO AVOID CHANGING + * LINE NUMBERS OF EXISTING CODE SAMPLES. + */ + +import com.azure.spring.data.cosmos.core.query.CosmosPageRequest; +import com.azure.spring.data.cosmos.repository.TestRepositoryConfig; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.data.domain.Page; +import org.springframework.data.domain.Pageable; +import org.springframework.data.repository.PagingAndSortingRepository; +import org.springframework.test.context.ContextConfiguration; + +import java.util.List; + +@ContextConfiguration(classes = TestRepositoryConfig.class) +public class PageableRepositoryCodeSnippet { + + @Autowired + private PagingAndSortingRepository repository; + + private List findAllWithPageSize(int pageSize) { + + final CosmosPageRequest pageRequest = new CosmosPageRequest(0, pageSize, null); + Page page = repository.findAll(pageRequest); + List pageContent = page.getContent(); + while (page.hasNext()) { + Pageable nextPageable = page.nextPageable(); + page = repository.findAll(nextPageable); + pageContent = page.getContent(); + } + return pageContent; + } +} diff --git a/sdk/cosmos/azure-spring-data-cosmos/src/samples/java/com/azure/cosmos/SampleApplication.java b/sdk/cosmos/azure-spring-data-cosmos/src/samples/java/com/azure/cosmos/SampleApplication.java new file mode 100644 index 0000000000000..34f408063d3af --- /dev/null +++ b/sdk/cosmos/azure-spring-data-cosmos/src/samples/java/com/azure/cosmos/SampleApplication.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +package com.azure.cosmos; + +/** + * WARNING: MODIFYING THIS FILE WILL REQUIRE CORRESPONDING UPDATES TO README.md FILE. LINE NUMBERS + * ARE USED TO EXTRACT APPROPRIATE CODE SEGMENTS FROM THIS FILE. ADD NEW CODE AT THE BOTTOM TO AVOID CHANGING + * LINE NUMBERS OF EXISTING CODE SAMPLES. + */ + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.CommandLineRunner; +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.ApplicationContext; + +@SpringBootApplication +public class SampleApplication implements CommandLineRunner { + + @Autowired + private UserRepository repository; + + @Autowired + private ApplicationContext applicationContext; + + public static void main(String[] args) { + SpringApplication.run(SampleApplication.class, args); + } + + public void run(String... var1) { + + final User testUser = new User("testId", "testFirstName", "testLastName"); + + repository.deleteAll(); + repository.save(testUser); + + // to find by Id, please specify partition key value if collection is partitioned + final User result = repository.findOne(testUser.getId(), testUser.getLastName()); + // if emailAddress is mapped to id, then + // final User result = respository.findOne(testUser.getEmailAddress(), testUser.getLastName()); + + // Switch to secondary key + UserRepositoryConfiguration bean = + applicationContext.getBean(UserRepositoryConfiguration.class); + bean.switchToSecondaryKey(); + + // Now repository will use secondary key + repository.save(testUser); + + } +} diff --git a/sdk/cosmos/azure-spring-data-cosmos/src/samples/java/com/azure/cosmos/User.java b/sdk/cosmos/azure-spring-data-cosmos/src/samples/java/com/azure/cosmos/User.java new file mode 100644 index 0000000000000..90a02d32c807f --- /dev/null +++ b/sdk/cosmos/azure-spring-data-cosmos/src/samples/java/com/azure/cosmos/User.java @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +package com.azure.cosmos; + +/** + * WARNING: MODIFYING THIS FILE WILL REQUIRE CORRESPONDING UPDATES TO README.md FILE. LINE NUMBERS + * ARE USED TO EXTRACT APPROPRIATE CODE SEGMENTS FROM THIS FILE. ADD NEW CODE AT THE BOTTOM TO AVOID CHANGING + * LINE NUMBERS OF EXISTING CODE SAMPLES. + */ + +import com.azure.spring.data.cosmos.core.mapping.Document; +import com.azure.spring.data.cosmos.core.mapping.PartitionKey; + +@Document(collection = "myCollection", ru = "400") +public class User { + private String id; + private String firstName; + + + @PartitionKey + private String lastName; + + public User() { + // If you do not want to create a default constructor, + // use annotation @JsonCreator and @JsonProperty in the full args constructor + } + + public User(String id, String firstName, String lastName) { + this.id = id; + this.firstName = firstName; + this.lastName = lastName; + } + + @Override + public String toString() { + return String.format("User: %s %s, %s", firstName, lastName, id); + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getFirstName() { + return firstName; + } + + public void setFirstName(String firstName) { + this.firstName = firstName; + } + + public String getLastName() { + return lastName; + } + + public void setLastName(String lastName) { + this.lastName = lastName; + } +} diff --git a/sdk/cosmos/azure-spring-data-cosmos/src/samples/java/com/azure/cosmos/UserRepository.java b/sdk/cosmos/azure-spring-data-cosmos/src/samples/java/com/azure/cosmos/UserRepository.java new file mode 100644 index 0000000000000..e89d1e2dac876 --- /dev/null +++ b/sdk/cosmos/azure-spring-data-cosmos/src/samples/java/com/azure/cosmos/UserRepository.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +package com.azure.cosmos; + +import com.azure.spring.data.cosmos.repository.CosmosRepository; +import org.springframework.stereotype.Repository; + +import java.util.List; + +/** + * WARNING: MODIFYING THIS FILE WILL REQUIRE CORRESPONDING UPDATES TO README.md FILE. LINE NUMBERS + * ARE USED TO EXTRACT APPROPRIATE CODE SEGMENTS FROM THIS FILE. ADD NEW CODE AT THE BOTTOM TO AVOID CHANGING + * LINE NUMBERS OF EXISTING CODE SAMPLES. + */ + + +@Repository +public interface UserRepository extends CosmosRepository { + List findByFirstName(String firstName); + User findOne(String id, String lastName); +} diff --git a/sdk/cosmos/azure-spring-data-cosmos/src/samples/java/com/azure/cosmos/UserRepositoryConfiguration.java b/sdk/cosmos/azure-spring-data-cosmos/src/samples/java/com/azure/cosmos/UserRepositoryConfiguration.java new file mode 100644 index 0000000000000..f9d5c2a0baff6 --- /dev/null +++ b/sdk/cosmos/azure-spring-data-cosmos/src/samples/java/com/azure/cosmos/UserRepositoryConfiguration.java @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +package com.azure.cosmos; +/** + * WARNING: MODIFYING THIS FILE WILL REQUIRE CORRESPONDING UPDATES TO README.md FILE. LINE NUMBERS + * ARE USED TO EXTRACT APPROPRIATE CODE SEGMENTS FROM THIS FILE. ADD NEW CODE AT THE BOTTOM TO AVOID CHANGING + * LINE NUMBERS OF EXISTING CODE SAMPLES. + */ +import com.azure.data.cosmos.CosmosKeyCredential; +import com.azure.spring.data.cosmos.config.AbstractCosmosConfiguration; +import com.azure.spring.data.cosmos.config.CosmosDBConfig; +import com.azure.spring.data.cosmos.core.ResponseDiagnostics; +import com.azure.spring.data.cosmos.core.ResponseDiagnosticsProcessor; +import com.azure.spring.data.cosmos.repository.config.EnableReactiveCosmosRepositories; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.context.properties.EnableConfigurationProperties; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.PropertySource; + +import javax.annotation.Nullable; + + +@Configuration +@EnableConfigurationProperties(CosmosDbProperties.class) +@EnableReactiveCosmosRepositories +@PropertySource("classpath:application.properties") +public class UserRepositoryConfiguration extends AbstractCosmosConfiguration { + private static final Logger logger = LoggerFactory.getLogger(AppConfiguration.class); + + @Autowired + private CosmosDbProperties properties; + + private CosmosKeyCredential cosmosKeyCredential; + + @Bean + public CosmosDBConfig cosmosDbConfig() { + this.cosmosKeyCredential = new CosmosKeyCredential(properties.getKey()); + CosmosDBConfig cosmosDBConfig = CosmosDBConfig.builder(properties.getUri(), cosmosKeyCredential, + properties.getDatabase()).build(); + cosmosDBConfig.setPopulateQueryMetrics(properties.isPopulateQueryMetrics()); + cosmosDBConfig.setResponseDiagnosticsProcessor(new ResponseDiagnosticsProcessorImplementation()); + return cosmosDBConfig; + } + + public void switchToSecondaryKey() { + this.cosmosKeyCredential.key(properties.getSecondaryKey()); + } + + public void switchToPrimaryKey() { + this.cosmosKeyCredential.key(properties.getKey()); + } + + public void switchKey(String key) { + this.cosmosKeyCredential.key(key); + } + + private static class ResponseDiagnosticsProcessorImplementation implements ResponseDiagnosticsProcessor { + + @Override + public void processResponseDiagnostics(@Nullable ResponseDiagnostics responseDiagnostics) { + logger.info("Response Diagnostics {}", responseDiagnostics); + } + } +} diff --git a/sdk/cosmos/azure-spring-data-cosmos/src/samples/java/com/azure/cosmos/UserSample.java b/sdk/cosmos/azure-spring-data-cosmos/src/samples/java/com/azure/cosmos/UserSample.java new file mode 100644 index 0000000000000..cdf690cd992ea --- /dev/null +++ b/sdk/cosmos/azure-spring-data-cosmos/src/samples/java/com/azure/cosmos/UserSample.java @@ -0,0 +1,19 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +package com.azure.cosmos; + +/** + * WARNING: MODIFYING THIS FILE WILL REQUIRE CORRESPONDING UPDATES TO README.md FILE. LINE NUMBERS + * ARE USED TO EXTRACT APPROPRIATE CODE SEGMENTS FROM THIS FILE. ADD NEW CODE AT THE BOTTOM TO AVOID CHANGING + * LINE NUMBERS OF EXISTING CODE SAMPLES. + */ + +import com.azure.spring.data.cosmos.core.mapping.Document; +import org.springframework.data.annotation.Id; + +@Document(collection = "mycollection") +public class UserSample { + @Id + private String emailAddress; + +} From 24e7fb56a6cd1897dfb45cf0240405e057013188 Mon Sep 17 00:00:00 2001 From: Azure SDK Bot <53356347+azure-sdk@users.noreply.github.com> Date: Fri, 10 Jul 2020 13:05:54 -0700 Subject: [PATCH 089/129] Sync eng/common directory with azure-sdk-tools repository (#13027) --- eng/common/scripts/Verify-ChangeLog.ps1 | 35 ++++++++++++------- .../scripts/modules/Package-Properties.psm1 | 3 ++ 2 files changed, 25 insertions(+), 13 deletions(-) diff --git a/eng/common/scripts/Verify-ChangeLog.ps1 b/eng/common/scripts/Verify-ChangeLog.ps1 index c9ad4d2956441..26218d988df28 100644 --- a/eng/common/scripts/Verify-ChangeLog.ps1 +++ b/eng/common/scripts/Verify-ChangeLog.ps1 @@ -1,14 +1,14 @@ # Wrapper Script for ChangeLog Verification param ( - [String]$ChangeLogLocation, - [String]$VersionString, - [string]$PackageName, - [string]$ServiceName, - [string]$RepoRoot, - [ValidateSet("net","java","js","python")] - [string]$Language, - [string]$RepoName, - [boolean]$ForRelease=$False + [String]$ChangeLogLocation, + [String]$VersionString, + [string]$PackageName, + [string]$ServiceName, + [string]$RepoRoot, + [ValidateSet("net", "java", "js", "python")] + [string]$Language, + [string]$RepoName, + [boolean]$ForRelease = $False ) $ProgressPreference = "SilentlyContinue" @@ -16,23 +16,32 @@ $ProgressPreference = "SilentlyContinue" Import-Module (Join-Path $PSScriptRoot modules ChangeLog-Operations.psm1) $validChangeLog = $false -if ($ChangeLogLocation -and $VersionString) +if ($ChangeLogLocation -and $VersionString) { $validChangeLog = Confirm-ChangeLogEntry -ChangeLogLocation $ChangeLogLocation -VersionString $VersionString -ForRelease $ForRelease } -else +else { Import-Module (Join-Path $PSScriptRoot modules Package-Properties.psm1) if ([System.String]::IsNullOrEmpty($Language)) { - $Language = $RepoName.Substring($RepoName.LastIndexOf('-') + 1) + if ($RepoName -match "azure-sdk-for-(?[^-]+)") + { + $Language = $matches["lang"] + } + else + { + Write-Error "Failed to set Language automatically. Please pass the appropriate Language as a parameter." + exit 1 + } } $PackageProp = Get-PkgProperties -PackageName $PackageName -ServiceName $ServiceName -Language $Language -RepoRoot $RepoRoot $validChangeLog = Confirm-ChangeLogEntry -ChangeLogLocation $PackageProp.pkgChangeLogPath -VersionString $PackageProp.pkgVersion -ForRelease $ForRelease } -if (!$validChangeLog) { +if (!$validChangeLog) +{ exit 1 } diff --git a/eng/common/scripts/modules/Package-Properties.psm1 b/eng/common/scripts/modules/Package-Properties.psm1 index fa6920bec3492..b9a8eb11780de 100644 --- a/eng/common/scripts/modules/Package-Properties.psm1 +++ b/eng/common/scripts/modules/Package-Properties.psm1 @@ -65,6 +65,9 @@ class PackageProps } $ProgressPreference = "SilentlyContinue" + + +Register-PSRepository -Default -ErrorAction:SilentlyContinue Install-Module -Name powershell-yaml -RequiredVersion 0.4.1 -Force -Scope CurrentUser function Extract-PkgProps ($pkgPath, $serviceName, $pkgName, $lang) From 4ffbde366229724d0c3a751e10c9dfbe777dbcbe Mon Sep 17 00:00:00 2001 From: vcolin7 Date: Fri, 10 Jul 2020 15:06:57 -0700 Subject: [PATCH 090/129] Renamed getSyncSecretClientCodeSnippets() to getSecretClient() to be consistent with the samples for SecretAsyncClient. (#12837) --- .../SecretClientJavaDocCodeSnippets.java | 39 +++++++------------ 1 file changed, 15 insertions(+), 24 deletions(-) diff --git a/sdk/keyvault/azure-security-keyvault-secrets/src/samples/java/com/azure/security/keyvault/secrets/SecretClientJavaDocCodeSnippets.java b/sdk/keyvault/azure-security-keyvault-secrets/src/samples/java/com/azure/security/keyvault/secrets/SecretClientJavaDocCodeSnippets.java index b8b35ddbe7008..fbbb24f59092d 100644 --- a/sdk/keyvault/azure-security-keyvault-secrets/src/samples/java/com/azure/security/keyvault/secrets/SecretClientJavaDocCodeSnippets.java +++ b/sdk/keyvault/azure-security-keyvault-secrets/src/samples/java/com/azure/security/keyvault/secrets/SecretClientJavaDocCodeSnippets.java @@ -26,6 +26,21 @@ public final class SecretClientJavaDocCodeSnippets { private String value1 = "val1"; private String value2 = "val2"; + /** + * Implementation for sync SecretClient + * @return sync SecretClient + */ + private SecretClient getSecretClient() { + // BEGIN: com.azure.security.keyvault.secretclient.sync.construct + SecretClient secretClient = new SecretClientBuilder() + .credential(new DefaultAzureCredentialBuilder().build()) + .vaultUrl("https://myvault.vault.azure.net/") + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BODY_AND_HEADERS)) + .buildClient(); + // END: com.azure.security.keyvault.secretclient.sync.construct + return secretClient; + } + /** * Method to insert code snippets for {@link SecretClient#getSecret(String, String)} */ @@ -369,28 +384,4 @@ public void listSecretVersionsCodeSnippets() { }); // END: com.azure.security.keyvault.secretclient.listSecretVersions#string-Context-iterableByPage } - - /** - * Implementation for sync SecretClient - * - * @return sync SecretClient - */ - private SecretClient getSyncSecretClientCodeSnippets() { - - // BEGIN: com.azure.security.keyvault.secretclient.sync.construct - SecretClient secretClient = new SecretClientBuilder() - .credential(new DefaultAzureCredentialBuilder().build()) - .vaultUrl("https://myvault.vault.azure.net/") - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BODY_AND_HEADERS)) - .buildClient(); - // END: com.azure.security.keyvault.secretclient.sync.construct - return secretClient; - } - - /** - * Implementation not provided for this method - */ - private SecretClient getSecretClient() { - return new SecretClient(null); - } } From 2892a1ebe656b6db07c086941034472d85ea3922 Mon Sep 17 00:00:00 2001 From: vcolin7 Date: Fri, 10 Jul 2020 15:07:40 -0700 Subject: [PATCH 091/129] Corrected broken link in README and sample with error. (#12464) --- sdk/keyvault/azure-security-keyvault-keys/README.md | 2 +- .../keyvault/keys/KeyAsyncClientJavaDocCodeSnippets.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sdk/keyvault/azure-security-keyvault-keys/README.md b/sdk/keyvault/azure-security-keyvault-keys/README.md index d49459cf014f7..e8f8db367e75c 100644 --- a/sdk/keyvault/azure-security-keyvault-keys/README.md +++ b/sdk/keyvault/azure-security-keyvault-keys/README.md @@ -255,7 +255,7 @@ The following sections provide several code snippets covering some of the most c - [Update an existing key asynchronously](#update-an-existing-key-asynchronously) - [Delete a key asynchronously](#delete-a-key-asynchronously) - [List keys asynchronously](#list-keys-asynchronously) -- [Encrypt asynchronously](#encryp-asynchronously) +- [Encrypt asynchronously](#encrypt-asynchronously) - [Decrypt asynchronously](#decrypt-asynchronously) > Note : You should add `System.in.read()` or `Thread.sleep()` after the function calls in the main class/thread to allow async functions/operations to execute and finish before the main application/thread exits. diff --git a/sdk/keyvault/azure-security-keyvault-keys/src/samples/java/com/azure/security/keyvault/keys/KeyAsyncClientJavaDocCodeSnippets.java b/sdk/keyvault/azure-security-keyvault-keys/src/samples/java/com/azure/security/keyvault/keys/KeyAsyncClientJavaDocCodeSnippets.java index b056f7e714080..e01a950bd6064 100644 --- a/sdk/keyvault/azure-security-keyvault-keys/src/samples/java/com/azure/security/keyvault/keys/KeyAsyncClientJavaDocCodeSnippets.java +++ b/sdk/keyvault/azure-security-keyvault-keys/src/samples/java/com/azure/security/keyvault/keys/KeyAsyncClientJavaDocCodeSnippets.java @@ -43,8 +43,8 @@ public KeyAsyncClient createAsyncClientWithHttpClient() { // BEGIN: com.azure.security.keyvault.keys.async.keyclient.withhttpclient.instantiation KeyAsyncClient keyAsyncClient = new KeyClientBuilder() .vaultUrl("https://myvault.azure.net/") + .credential(new DefaultAzureCredentialBuilder().build()) .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BODY_AND_HEADERS)) - .addPolicy(new KeyVaultCredentialPolicy(new DefaultAzureCredentialBuilder().build())) .httpClient(HttpClient.createDefault()) .buildAsyncClient(); // END: com.azure.security.keyvault.keys.async.keyclient.withhttpclient.instantiation From 989bb8a0941d4b7b3f19eb99ec786df82d751e63 Mon Sep 17 00:00:00 2001 From: Saurabh Singh Date: Fri, 10 Jul 2020 15:09:59 -0700 Subject: [PATCH 092/129] Fix incorrect comments. (#12754) * Fix incorrect comments. Looks like the comments were copied over from KeyOperation and the type name was fixed but the values weren't * Fix more comments * Address feedback --- .../cryptography/models/KeyWrapAlgorithm.java | 10 +++++----- .../models/SignatureAlgorithm.java | 20 +++++++++---------- .../keyvault/keys/models/KeyType.java | 10 +++++----- 3 files changed, 20 insertions(+), 20 deletions(-) diff --git a/sdk/keyvault/azure-security-keyvault-keys/src/main/java/com/azure/security/keyvault/keys/cryptography/models/KeyWrapAlgorithm.java b/sdk/keyvault/azure-security-keyvault-keys/src/main/java/com/azure/security/keyvault/keys/cryptography/models/KeyWrapAlgorithm.java index 940b04bd95931..5c387443778ad 100644 --- a/sdk/keyvault/azure-security-keyvault-keys/src/main/java/com/azure/security/keyvault/keys/cryptography/models/KeyWrapAlgorithm.java +++ b/sdk/keyvault/azure-security-keyvault-keys/src/main/java/com/azure/security/keyvault/keys/cryptography/models/KeyWrapAlgorithm.java @@ -15,27 +15,27 @@ public final class KeyWrapAlgorithm extends ExpandableStringEnum { /** - * Static value Encrypt for KeyWrapAlgorithm. + * Static value RSA-OAEP for KeyWrapAlgorithm. */ public static final KeyWrapAlgorithm RSA_OAEP = fromString("RSA-OAEP"); /** - * Static value Decrypt for KeyWrapAlgorithm. + * Static value RSA-OAEP-256 for KeyWrapAlgorithm. */ public static final KeyWrapAlgorithm RSA_OAEP_256 = fromString("RSA-OAEP-256"); /** - * Static value Sign for KeyWrapAlgorithm. + * Static value RSA1_5 for KeyWrapAlgorithm. */ public static final KeyWrapAlgorithm RSA1_5 = fromString("RSA1_5"); /** - * Static value Verify for KeyWrapAlgorithm. + * Static value A192KW for KeyWrapAlgorithm. */ public static final KeyWrapAlgorithm A192KW = fromString("A192KW"); /** - * Static value Wrap Key for KeyWrapAlgorithm. + * Static value A128KW for KeyWrapAlgorithm. */ public static final KeyWrapAlgorithm A128KW = fromString("A128KW"); diff --git a/sdk/keyvault/azure-security-keyvault-keys/src/main/java/com/azure/security/keyvault/keys/cryptography/models/SignatureAlgorithm.java b/sdk/keyvault/azure-security-keyvault-keys/src/main/java/com/azure/security/keyvault/keys/cryptography/models/SignatureAlgorithm.java index 07801352dcb09..1994403a287e3 100644 --- a/sdk/keyvault/azure-security-keyvault-keys/src/main/java/com/azure/security/keyvault/keys/cryptography/models/SignatureAlgorithm.java +++ b/sdk/keyvault/azure-security-keyvault-keys/src/main/java/com/azure/security/keyvault/keys/cryptography/models/SignatureAlgorithm.java @@ -15,52 +15,52 @@ public final class SignatureAlgorithm extends ExpandableStringEnum { /** - * Static value RSA_OAEP for SignatureAlgorithm. + * Static value PS256 for SignatureAlgorithm. */ public static final SignatureAlgorithm PS256 = fromString("PS256"); /** - * Static value RSA_OAEP_256 for SignatureAlgorithm. + * Static value PS384 for SignatureAlgorithm. */ public static final SignatureAlgorithm PS384 = fromString("PS384"); /** - * Static value RSA1_5 for SignatureAlgorithm. + * Static value PS512 for SignatureAlgorithm. */ public static final SignatureAlgorithm PS512 = fromString("PS512"); /** - * Static value A256CBC_HS512 for SignatureAlgorithm. + * Static value RS256 for SignatureAlgorithm. */ public static final SignatureAlgorithm RS256 = fromString("RS256"); /** - * Static value A128CBC_HS256 for SignatureAlgorithm. + * Static value RS384 for SignatureAlgorithm. */ public static final SignatureAlgorithm RS384 = fromString("RS384"); /** - * Static value A192CBC_HS384 for SignatureAlgorithm. + * Static value RS512 for SignatureAlgorithm. */ public static final SignatureAlgorithm RS512 = fromString("RS512"); /** - * Static value A256CBC for SignatureAlgorithm. + * Static value ES256 for SignatureAlgorithm. */ public static final SignatureAlgorithm ES256 = fromString("ES256"); /** - * Static value A192CBC for SignatureAlgorithm. + * Static value ES384 for SignatureAlgorithm. */ public static final SignatureAlgorithm ES384 = fromString("ES384"); /** - * Static value A128CBC for SignatureAlgorithm. + * Static value ES512 for SignatureAlgorithm. */ public static final SignatureAlgorithm ES512 = fromString("ES512"); /** - * Static value A128CBC for SignatureAlgorithm. + * Static value ES256K for SignatureAlgorithm. */ public static final SignatureAlgorithm ES256K = fromString("ES256K"); diff --git a/sdk/keyvault/azure-security-keyvault-keys/src/main/java/com/azure/security/keyvault/keys/models/KeyType.java b/sdk/keyvault/azure-security-keyvault-keys/src/main/java/com/azure/security/keyvault/keys/models/KeyType.java index 98b8c78644224..5f8ee90add439 100644 --- a/sdk/keyvault/azure-security-keyvault-keys/src/main/java/com/azure/security/keyvault/keys/models/KeyType.java +++ b/sdk/keyvault/azure-security-keyvault-keys/src/main/java/com/azure/security/keyvault/keys/models/KeyType.java @@ -15,27 +15,27 @@ public final class KeyType extends ExpandableStringEnum { /** - * Static value Encrypt for KeyType. + * Static value EC for KeyType. */ public static final KeyType EC = fromString("EC"); /** - * Static value Decrypt for KeyType. + * Static value EC-HSM for KeyType. */ public static final KeyType EC_HSM = fromString("EC-HSM"); /** - * Static value Sign for KeyType. + * Static value RSA for KeyType. */ public static final KeyType RSA = fromString("RSA"); /** - * Static value Verify for KeyType. + * Static value RSA-HSM for KeyType. */ public static final KeyType RSA_HSM = fromString("RSA-HSM"); /** - * Static value Wrap Key for KeyType. + * Static value oct for KeyType. */ public static final KeyType OCT = fromString("oct"); From 661682eb58f2816d0c2e3c68d996bd1bdbac7a3b Mon Sep 17 00:00:00 2001 From: Azure SDK Bot <53356347+azure-sdk@users.noreply.github.com> Date: Fri, 10 Jul 2020 17:05:53 -0700 Subject: [PATCH 093/129] Sync eng/common directory with azure-sdk-tools repository (#13034) --- eng/common/pipelines/templates/steps/verify-links.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/eng/common/pipelines/templates/steps/verify-links.yml b/eng/common/pipelines/templates/steps/verify-links.yml index 1a99350f0161f..a3d385becefc5 100644 --- a/eng/common/pipelines/templates/steps/verify-links.yml +++ b/eng/common/pipelines/templates/steps/verify-links.yml @@ -1,5 +1,7 @@ parameters: Directory: 'not-specified' + IgnoreLinksFile: "$(Build.SourcesDirectory)/eng/ignore-links.txt" + steps: - task: PowerShell@2 @@ -9,4 +11,4 @@ steps: workingDirectory: $(Build.SourcesDirectory)/${{ parameters.Directory }} filePath: eng/common/scripts/Verify-Links.ps1 arguments: > - -urls $(dir -r -i *.md) -rootUrl "file://$(Build.SourcesDirectory)/${{ parameters.Directory }}" + -urls $(dir -r -i *.md) -rootUrl "file://$(Build.SourcesDirectory)/${{ parameters.Directory }}" -recursive:$false -ignoreLinksFile ${{ parameters.IgnoreLinksFile }} From da37c2d5e514f75cac48943eede18c897068b3e0 Mon Sep 17 00:00:00 2001 From: Alan Zimmer <48699787+alzimmermsft@users.noreply.github.com> Date: Fri, 10 Jul 2020 17:19:06 -0700 Subject: [PATCH 094/129] Review Before Releasing Azure Cognitive Search (#13033) * Added missing module-info export, added missing package-info, added missing linting annotations, and updated package-info Javadocs * Clean up Javadocs * Updates from comments, added to CHANGELOG --- .../checkstyle/checkstyle-suppressions.xml | 8 ++ .../azure-search-documents/CHANGELOG.md | 22 ++++- sdk/search/azure-search-documents/README.md | 2 +- sdk/search/azure-search-documents/pom.xml | 4 +- .../search/documents/SearchAsyncClient.java | 62 ++++++------ .../azure/search/documents/SearchClient.java | 22 +++-- .../search/documents/SearchClientBuilder.java | 38 ++++--- .../search/documents/SearchDocument.java | 12 +-- .../documents/SearchServiceVersion.java | 6 +- .../indexes/SearchIndexAsyncClient.java | 38 +++---- .../documents/indexes/SearchIndexClient.java | 5 +- .../indexes/SearchIndexClientBuilder.java | 26 +++-- .../indexes/SearchIndexerAsyncClient.java | 99 +++++++------------ .../indexes/SearchIndexerClient.java | 34 +++---- .../indexes/SearchIndexerClientBuilder.java | 11 +-- .../indexes/SearchIndexerDataSources.java | 3 +- .../indexes/models/package-info.java | 5 +- .../documents/indexes/package-info.java | 7 +- .../search/documents/models/package-info.java | 8 ++ .../azure/search/documents/package-info.java | 5 +- .../search/documents/util/package-info.java | 2 +- .../src/main/java/module-info.java | 1 + .../RefineSearchCapabilitiesExample.java | 2 +- .../RunningSearchSolutionExample.java | 2 +- .../indexes/LifecycleSetupExample.java | 2 +- .../azure/search/documents/TestHelpers.java | 2 +- 26 files changed, 215 insertions(+), 213 deletions(-) create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/package-info.java diff --git a/eng/code-quality-reports/src/main/resources/checkstyle/checkstyle-suppressions.xml b/eng/code-quality-reports/src/main/resources/checkstyle/checkstyle-suppressions.xml index 891d637a644d2..1a88861759f3f 100755 --- a/eng/code-quality-reports/src/main/resources/checkstyle/checkstyle-suppressions.xml +++ b/eng/code-quality-reports/src/main/resources/checkstyle/checkstyle-suppressions.xml @@ -491,4 +491,12 @@ + + + + + + diff --git a/sdk/search/azure-search-documents/CHANGELOG.md b/sdk/search/azure-search-documents/CHANGELOG.md index 21c771d16e249..70b572b66079f 100644 --- a/sdk/search/azure-search-documents/CHANGELOG.md +++ b/sdk/search/azure-search-documents/CHANGELOG.md @@ -1,10 +1,24 @@ # Release History -## 11.0.0 (Unreleased) +## 11.0.0 (2020-07-10) + - Changed version to 11.0.0. -- Removed preview version `SearchClientOptions.ServiceVersion.V2019_05_06_Preview` - and added version `SearchClientOptions.ServiceVersion.V2020_06_30`. -- Added value constructors for required parameters. +- Removed preview version `SearchClientOptions.ServiceVersion.V2019_05_06_Preview` and added version `SearchClientOptions.ServiceVersion.V2020_06_30`. + +### New Features + +- Added `IndexDocumentsOptions` used to configure document operations. + +### Breaking Changes + +- Moved search result metadata to `SearchPagedFlux` and `SearchPagedIterable` from `SearchPagedResponse`. +- Changed many model classes from fluent setter pattern to immutable constructor pattern. +- Removed `RequestOptions` from APIs, instead use pipeline context to pass per method contextual information. +- Removed strongly type GeoJSON classes. + +### Bug Fixes + +- Removed `implementation` classes from APIs. ## 1.0.0-beta.4 (2020-06-09) - Split `SearchServiceClient` into two clients `SearchIndexClient`, `SearchIndexerClient`. diff --git a/sdk/search/azure-search-documents/README.md b/sdk/search/azure-search-documents/README.md index 3c03e0a53da1c..9f1a519d14485 100644 --- a/sdk/search/azure-search-documents/README.md +++ b/sdk/search/azure-search-documents/README.md @@ -21,7 +21,7 @@ The Azure Cognitive Search service is well suited for the following * In a search client application, implement query logic and user experiences similar to commercial web search engines. -Use the Azure Search client library to: +Use the Azure Cognitive Search client library to: * Submit queries for simple and advanced query forms that include fuzzy search, wildcard search, regular expressions. diff --git a/sdk/search/azure-search-documents/pom.xml b/sdk/search/azure-search-documents/pom.xml index 41d86df154d40..b82c30ad3bd65 100644 --- a/sdk/search/azure-search-documents/pom.xml +++ b/sdk/search/azure-search-documents/pom.xml @@ -11,8 +11,8 @@ ../../parents/azure-client-sdk-parent - Microsoft Azure Search client for Java - This package contains client functionality for Microsoft Azure Search + Microsoft Azure Cognitive Search client for Java + This package contains client functionality for Microsoft Azure Cognitive Search com.azure azure-search-documents diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/SearchAsyncClient.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/SearchAsyncClient.java index 66950b98e0b95..4320fc63a3507 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/SearchAsyncClient.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/SearchAsyncClient.java @@ -69,7 +69,10 @@ import static com.azure.core.util.FluxUtil.withContext; /** - * Cognitive Search Asynchronous Client to query an index and upload, merge, or delete documents + * This class provides a client that contains the operations for querying an index and uploading, merging, or deleting + * documents in an Azure Cognitive Search service. + * + * @see SearchClientBuilder */ @ServiceClient(builder = SearchClientBuilder.class, isAsync = true) public final class SearchAsyncClient { @@ -213,8 +216,7 @@ public Mono> uploadDocumentsWithResponse(Iterable Mono> uploadDocumentsWithResponse(Iterable documents, IndexDocumentsOptions options, Context context) { - return indexDocumentsWithResponse(buildIndexBatch(documents, IndexActionType.UPLOAD), options, - context); + return indexDocumentsWithResponse(buildIndexBatch(documents, IndexActionType.UPLOAD), options, context); } /** @@ -283,8 +285,7 @@ public Mono> mergeDocumentsWithResponse(Iterable< Mono> mergeDocumentsWithResponse(Iterable documents, IndexDocumentsOptions options, Context context) { - return indexDocumentsWithResponse(buildIndexBatch(documents, IndexActionType.MERGE), options, - context); + return indexDocumentsWithResponse(buildIndexBatch(documents, IndexActionType.MERGE), options, context); } /** @@ -411,8 +412,7 @@ public Mono> deleteDocumentsWithResponse(Iterable Mono> deleteDocumentsWithResponse(Iterable documents, IndexDocumentsOptions options, Context context) { - return indexDocumentsWithResponse(buildIndexBatch(documents, IndexActionType.DELETE), options, - context); + return indexDocumentsWithResponse(buildIndexBatch(documents, IndexActionType.DELETE), options, context); } /** @@ -468,11 +468,9 @@ public Mono> indexDocumentsWithResponse(IndexDocu Mono> indexDocumentsWithResponse(IndexDocumentsBatch batch, IndexDocumentsOptions options, Context context) { try { - IndexDocumentsOptions documentsOptions = (options == null) - ? new IndexDocumentsOptions() : options; + IndexDocumentsOptions documentsOptions = (options == null) ? new IndexDocumentsOptions() : options; return restClient.getDocuments() - .indexWithResponseAsync(IndexBatchBaseConverter.map(batch), null, - context) + .indexWithResponseAsync(IndexBatchBaseConverter.map(batch), null, context) .onErrorMap(MappingUtils::exceptionMapper) .flatMap(response -> (response.getStatusCode() == MULTI_STATUS_CODE && documentsOptions.throwOnAnyError()) @@ -527,22 +525,21 @@ public Mono getDocument(String key, Class modelClass) { * @see Lookup document */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getDocumentWithResponse(String key, Class modelClass, - List selectedFields) { - return withContext(context -> getDocumentWithResponse(key, modelClass, - selectedFields, context)); + public Mono> getDocumentWithResponse(String key, Class modelClass, List selectedFields) { + return withContext(context -> getDocumentWithResponse(key, modelClass, selectedFields, context)); } @SuppressWarnings("unchecked") - Mono> getDocumentWithResponse(String key, Class modelClass, - List selectedFields, Context context) { + Mono> getDocumentWithResponse(String key, Class modelClass, List selectedFields, + Context context) { try { return restClient.getDocuments() .getWithResponseAsync(key, selectedFields, null, context) .onErrorMap(DocumentResponseConversions::exceptionMapper) .map(res -> { if (SearchDocument.class == modelClass) { - TypeReference> typeReference = new TypeReference>() { }; + TypeReference> typeReference = new TypeReference>() { + }; SearchDocument doc = new SearchDocument(MAPPER.convertValue(res.getValue(), typeReference)); return new SimpleResponse(res, (T) doc); } @@ -603,7 +600,7 @@ Mono> getDocumentCountWithResponse(Context context) { *

* If {@code searchText} is set to {@code null} or {@code "*"} all documents will be matched, see * simple query - * syntax in Azure Search for more information about search query syntax. + * syntax in Azure Cognitive Search for more information about search query syntax. * *

Code Sample

* @@ -617,8 +614,9 @@ Mono> getDocumentCountWithResponse(Context context) { * information. * @see Search documents */ + @ServiceMethod(returns = ReturnType.COLLECTION) public SearchPagedFlux search(String searchText) { - return this.search(searchText, null, null); + return this.search(searchText, null); } /** @@ -626,7 +624,7 @@ public SearchPagedFlux search(String searchText) { *

* If {@code searchText} is set to {@code null} or {@code "*"} all documents will be matched, see * simple query - * syntax in Azure Search for more information about search query syntax. + * syntax in Azure Cognitive Search for more information about search query syntax. * *

Code Sample

* @@ -641,6 +639,7 @@ public SearchPagedFlux search(String searchText) { * information. * @see Search documents */ + @ServiceMethod(returns = ReturnType.COLLECTION) public SearchPagedFlux search(String searchText, SearchOptions searchOptions) { SearchRequest request = createSearchRequest(searchText, searchOptions); // The firstPageResponse shared among all fucntional calls below. @@ -661,16 +660,16 @@ SearchPagedFlux search(String searchText, SearchOptions searchOptions, Context c return new SearchPagedFlux(() -> func.apply(null), func); } - private Mono search(SearchRequest request, - String continuationToken, SearchFirstPageResponseWrapper firstPageResponseWrapper, Context context) { + private Mono search(SearchRequest request, String continuationToken, + SearchFirstPageResponseWrapper firstPageResponseWrapper, Context context) { if (continuationToken == null && firstPageResponseWrapper.getFirstPageResponse() != null) { return Mono.just(firstPageResponseWrapper.getFirstPageResponse()); } - SearchRequest requestToUse = (continuationToken == null) ? request + SearchRequest requestToUse = (continuationToken == null) + ? request : SearchContinuationToken.deserializeToken(serviceVersion.getVersion(), continuationToken); - return restClient.getDocuments().searchPostWithResponseAsync(requestToUse, - null, context) + return restClient.getDocuments().searchPostWithResponseAsync(requestToUse, null, context) .onErrorMap(MappingUtils::exceptionMapper) .map(response -> { SearchDocumentsResult result = response.getValue(); @@ -726,6 +725,7 @@ private static Map> getFacets(SearchDocumentsResult re * {@link SuggestPagedResponse} object for each page containing HTTP response and coverage information. * @see Suggestions */ + @ServiceMethod(returns = ReturnType.COLLECTION) public SuggestPagedFlux suggest(String searchText, String suggesterName) { return suggest(searchText, suggesterName, null); } @@ -747,6 +747,7 @@ public SuggestPagedFlux suggest(String searchText, String suggesterName) { * {@link SuggestPagedResponse} object for each page containing HTTP response and coverage information. * @see Suggestions */ + @ServiceMethod(returns = ReturnType.COLLECTION) public SuggestPagedFlux suggest(String searchText, String suggesterName, SuggestOptions suggestOptions) { SuggestRequest suggestRequest = createSuggestRequest(searchText, suggesterName, SuggestOptionsHandler.ensureSuggestOptions(suggestOptions)); @@ -762,8 +763,7 @@ SuggestPagedFlux suggest(String searchText, String suggesterName, SuggestOptions } private Mono suggest(SuggestRequest suggestRequest, Context context) { - return restClient.getDocuments().suggestPostWithResponseAsync(suggestRequest, - null, context) + return restClient.getDocuments().suggestPostWithResponseAsync(suggestRequest, null, context) .onErrorMap(MappingUtils::exceptionMapper) .map(response -> { SuggestDocumentsResult result = response.getValue(); @@ -792,8 +792,9 @@ private static List getSuggestResults(SuggestDocumentsResult resu * @param suggesterName suggester name * @return auto complete result. */ + @ServiceMethod(returns = ReturnType.COLLECTION) public AutocompletePagedFlux autocomplete(String searchText, String suggesterName) { - return autocomplete(searchText, suggesterName, null, null); + return autocomplete(searchText, suggesterName, null); } /** @@ -825,8 +826,7 @@ AutocompletePagedFlux autocomplete(String searchText, String suggesterName, Auto } private Mono autocomplete(AutocompleteRequest request, Context context) { - return restClient.getDocuments().autocompletePostWithResponseAsync(request, - null, context) + return restClient.getDocuments().autocompletePostWithResponseAsync(request, null, context) .onErrorMap(MappingUtils::exceptionMapper) .map(MappingUtils::mappingAutocompleteResponse); } diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/SearchClient.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/SearchClient.java index 52964b5a4aba4..7e776fa2993e5 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/SearchClient.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/SearchClient.java @@ -27,7 +27,10 @@ import java.util.List; /** - * Cognitive Search Synchronous Client to query an index and upload, merge, or delete documents + * This class provides a client that contains the operations for querying an index and uploading, merging, or deleting + * documents in an Azure Cognitive Search service. + * + * @see SearchClientBuilder */ @ServiceClient(builder = SearchClientBuilder.class) public final class SearchClient { @@ -182,7 +185,7 @@ public IndexDocumentsResult mergeDocuments(Iterable documents) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Response mergeDocumentsWithResponse(Iterable documents, - IndexDocumentsOptions options, Context context) { + IndexDocumentsOptions options, Context context) { return asyncClient.mergeDocumentsWithResponse(documents, options, context).block(); } @@ -249,7 +252,7 @@ public IndexDocumentsResult mergeOrUploadDocuments(Iterable documents) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Response mergeOrUploadDocumentsWithResponse(Iterable documents, - IndexDocumentsOptions options, Context context) { + IndexDocumentsOptions options, Context context) { return asyncClient.mergeOrUploadDocumentsWithResponse(documents, options, context).block(); } @@ -443,7 +446,7 @@ public Response getDocumentCountWithResponse(Context context) { *

* If {@code searchText} is set to {@code null} or {@code "*"} all documents will be matched, see * simple query - * syntax in Azure Search for more information about search query syntax. + * syntax in Azure Cognitive Search for more information about search query syntax. * *

Code Sample

* @@ -457,6 +460,7 @@ public Response getDocumentCountWithResponse(Context context) { * information. * @see Search documents */ + @ServiceMethod(returns = ReturnType.COLLECTION) public SearchPagedIterable search(String searchText) { return search(searchText, null, Context.NONE); } @@ -466,7 +470,7 @@ public SearchPagedIterable search(String searchText) { *

* If {@code searchText} is set to {@code null} or {@code "*"} all documents will be matched, see * simple query - * syntax in Azure Search for more information about search query syntax. + * syntax in Azure Cognitive Search for more information about search query syntax. * *

Code Sample

* @@ -482,6 +486,7 @@ public SearchPagedIterable search(String searchText) { * information. * @see Search documents */ + @ServiceMethod(returns = ReturnType.COLLECTION) public SearchPagedIterable search(String searchText, SearchOptions searchOptions, Context context) { return new SearchPagedIterable(asyncClient.search(searchText, searchOptions, context)); } @@ -502,6 +507,7 @@ public SearchPagedIterable search(String searchText, SearchOptions searchOptions * the {@link SuggestPagedResponse} object for each page containing HTTP response and coverage information. * @see Suggestions */ + @ServiceMethod(returns = ReturnType.COLLECTION) public SuggestPagedIterable suggest(String searchText, String suggesterName) { return suggest(searchText, suggesterName, null, Context.NONE); } @@ -524,10 +530,10 @@ public SuggestPagedIterable suggest(String searchText, String suggesterName) { * the {@link SuggestPagedResponse} object for each page containing HTTP response and coverage information. * @see Suggestions */ + @ServiceMethod(returns = ReturnType.COLLECTION) public SuggestPagedIterable suggest(String searchText, String suggesterName, SuggestOptions suggestOptions, Context context) { - return new SuggestPagedIterable(asyncClient.suggest(searchText, suggesterName, suggestOptions, - context)); + return new SuggestPagedIterable(asyncClient.suggest(searchText, suggesterName, suggestOptions, context)); } /** @@ -543,6 +549,7 @@ public SuggestPagedIterable suggest(String searchText, String suggesterName, Sug * @param suggesterName suggester name * @return auto complete result. */ + @ServiceMethod(returns = ReturnType.COLLECTION) public AutocompletePagedIterable autocomplete(String searchText, String suggesterName) { return autocomplete(searchText, suggesterName, null, Context.NONE); } @@ -562,6 +569,7 @@ public AutocompletePagedIterable autocomplete(String searchText, String suggeste * @param context additional context that is passed through the HTTP pipeline during the service call * @return auto complete result. */ + @ServiceMethod(returns = ReturnType.COLLECTION) public AutocompletePagedIterable autocomplete(String searchText, String suggesterName, AutocompleteOptions autocompleteOptions, Context context) { return new AutocompletePagedIterable(asyncClient.autocomplete(searchText, suggesterName, autocompleteOptions, diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/SearchClientBuilder.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/SearchClientBuilder.java index 17056e6cd6f6d..50421a2b514ab 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/SearchClientBuilder.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/SearchClientBuilder.java @@ -33,15 +33,13 @@ /** * This class provides a fluent builder API to help aid the configuration and instantiation of {@link SearchClient - * SearchClients} and {@link SearchAsyncClient SearchAsyncClients}. Call {@link #buildClient() - * buildClient} and {@link #buildAsyncClient() buildAsyncClient} respectively to construct an instance of the desired - * client. + * SearchClients} and {@link SearchAsyncClient SearchAsyncClients}. Call {@link #buildClient() buildClient} and {@link + * #buildAsyncClient() buildAsyncClient} respectively to construct an instance of the desired client. *

- * The client needs to at least provide the following required fields - *

+ * The following must be provided to construct a client instance. *
    - *
  • the service endpoint of the Azure Cognitive Search to access the resource service.
  • - *
  • {@link #credential(AzureKeyCredential)} gives the builder access credential.
  • + *
  • The Azure Cognitive Search service URL.
  • + *
  • An {@link AzureKeyCredential} that grants access to the Azure Cognitive Search service.
  • *
  • The search index name.
  • *
* @@ -89,8 +87,8 @@ public final class SearchClientBuilder { /** - * Creates a builder instance that is able to configure and construct {@link SearchClient SearchClients} - * and {@link SearchAsyncClient SearchAsyncClients}. + * Creates a builder instance that is able to configure and construct {@link SearchClient SearchClients} and {@link + * SearchAsyncClient SearchAsyncClients}. */ public SearchClientBuilder() { Map properties = CoreUtils.getProperties(SEARCH_PROPERTIES); @@ -99,12 +97,12 @@ public SearchClientBuilder() { } /** - * Creates a {@link SearchClient} based on options set in the Builder. Every time {@code buildClient()} is - * called a new instance of {@link SearchClient} is created. + * Creates a {@link SearchClient} based on options set in the builder. Every time {@code buildClient()} is called a + * new instance of {@link SearchClient} is created. *

* If {@link #pipeline(HttpPipeline) pipeline} is set, then only the {@code pipeline}, {@link #endpoint(String) - * endpoint}, and {@link #indexName(String) indexName} are used to create the {@link SearchClient client}. - * All other builder settings are ignored. + * endpoint}, and {@link #indexName(String) indexName} are used to create the {@link SearchClient client}. All other + * builder settings are ignored. * * @return A SearchClient with the options set from the builder. * @throws NullPointerException If {@code indexName} or {@code endpoint} are {@code null}. @@ -114,12 +112,12 @@ public SearchClient buildClient() { } /** - * Creates a {@link SearchAsyncClient} based on options set in the Builder. Every time - * {@code buildAsyncClient()} is called a new instance of {@link SearchAsyncClient} is created. + * Creates a {@link SearchAsyncClient} based on options set in the builder. Every time {@code buildAsyncClient()} is + * called a new instance of {@link SearchAsyncClient} is created. *

* If {@link #pipeline(HttpPipeline) pipeline} is set, then only the {@code pipeline}, {@link #endpoint(String) - * endpoint}, and {@link #indexName(String) indexName} are used to create the {@link SearchAsyncClient client}. - * All other builder settings are ignored. + * endpoint}, and {@link #indexName(String) indexName} are used to create the {@link SearchAsyncClient client}. All + * other builder settings are ignored. * * @return A SearchClient with the options set from the builder. * @throws NullPointerException If {@code indexName} or {@code endpoint} are {@code null}. @@ -170,9 +168,9 @@ public SearchAsyncClient buildAsyncClient() { } /** - * Sets the service endpoint for the Azure Search instance. + * Sets the service endpoint for the Azure Cognitive Search instance. * - * @param endpoint The URL of the Azure Search instance. + * @param endpoint The URL of the Azure Cognitive Search instance. * @return The updated SearchClientBuilder object. * @throws IllegalArgumentException If {@code endpoint} is null or it cannot be parsed into a valid URL. */ @@ -307,7 +305,7 @@ public SearchClientBuilder retryPolicy(RetryPolicy retryPolicy) { * Sets the {@link SearchServiceVersion} that is used when making API requests. *

* If a service version is not provided, {@link SearchServiceVersion#getLatest()} will be used as a default. When - * this default is used updating to a newer client library may result in a newer version of the service being used. + * the default is used, updating to a newer client library may implicitly use a newer version of the service. * * @param serviceVersion The version of the service to be used when making requests. * @return The updated SearchClientBuilder object. diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/SearchDocument.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/SearchDocument.java index c15e2b4b3b182..39a92ae538ab3 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/SearchDocument.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/SearchDocument.java @@ -7,26 +7,22 @@ import java.util.Map; /** - * Represents a document - *

- * A property bag is used for scenarios where the index schema is only known at run-time - *

- * If the schema is known, user can convert the properties to a specific object type + * Represents an untyped document returned from a search or document lookup. */ public final class SearchDocument extends HashMap { private static final long serialVersionUID = 1L; /** - * Default empty constructor + * Initializes a new instance of the SearchDocument class. */ public SearchDocument() { super(); } /** - * Constructs a new {@code Document} with the same mappings as the specified {@code Map}. + * Initializes a new instance of the SearchDocument class with initial values. * - * @param propertyMap the map whose mappings are to be placed in this map + * @param propertyMap Initial values of the document. */ public SearchDocument(Map propertyMap) { super(propertyMap); diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/SearchServiceVersion.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/SearchServiceVersion.java index 0751e21c93a6d..bc33b3df930d4 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/SearchServiceVersion.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/SearchServiceVersion.java @@ -6,7 +6,7 @@ import com.azure.core.util.ServiceVersion; /** - * The versions of Azure Search supported by this client library. + * The versions of Azure Cognitive Search supported by this client library. */ public enum SearchServiceVersion implements ServiceVersion { V2020_06_30("2020-06-30"); @@ -26,9 +26,9 @@ public String getVersion() { } /** - * Gets the latest service version supported by this client library + * Gets the latest service version supported by this client library. * - * @return the latest {@link SearchServiceVersion} + * @return The latest version supported by this client library. */ public static SearchServiceVersion getLatest() { return V2020_06_30; diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/SearchIndexAsyncClient.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/SearchIndexAsyncClient.java index c35dd69c612da..a2e67069e3bf8 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/SearchIndexAsyncClient.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/SearchIndexAsyncClient.java @@ -38,7 +38,10 @@ import static com.azure.core.util.FluxUtil.withContext; /** - * Asynchronous Client to manage and query indexes, as well as Synonym Map, on a Cognitive Search service + * This class provides a client that contains the operations for creating, getting, listing, updating, or deleting + * indexes or synonym map and analyzing text in an Azure Cognitive Search service. + * + * @see SearchIndexClientBuilder */ @ServiceClient(builder = SearchIndexClientBuilder.class, isAsync = true) public final class SearchIndexAsyncClient { @@ -75,7 +78,7 @@ public final class SearchIndexAsyncClient { this.restClient = new SearchServiceClientImplBuilder() .endpoint(endpoint) - // .apiVersion(serviceVersion.getVersion()) + // .apiVersion(serviceVersion.getVersion()) .pipeline(httpPipeline) .buildClient(); } @@ -308,8 +311,7 @@ public PagedFlux listIndexNames() { PagedFlux listIndexNames(Context context) { try { return new PagedFlux<>(() -> this.listIndexesWithResponse("name", context) - .map(MappingUtils::mappingPagingSearchIndexNames) - ); + .map(MappingUtils::mappingPagingSearchIndexNames)); } catch (RuntimeException ex) { return pagedFluxError(logger, ex); } @@ -371,8 +373,7 @@ Mono> createOrUpdateIndexWithResponse(SearchIndex index, b String ifMatch = onlyIfUnchanged ? index.getETag() : null; return restClient.getIndexes() .createOrUpdateWithResponseAsync(index.getName(), SearchIndexConverter.map(index), - allowIndexDowntime, ifMatch, null, - null, context) + allowIndexDowntime, ifMatch, null, null, context) .onErrorMap(MappingUtils::exceptionMapper) .map(MappingUtils::mappingExternalSearchIndex); } catch (RuntimeException ex) { @@ -421,8 +422,7 @@ public Mono> deleteIndexWithResponse(SearchIndex index, boolean o Mono> deleteIndexWithResponse(String indexName, String etag, Context context) { try { return restClient.getIndexes() - .deleteWithResponseAsync(indexName, etag, null, - null, context) + .deleteWithResponseAsync(indexName, etag, null, null, context) .onErrorMap(MappingUtils::exceptionMapper) .map(Function.identity()); } catch (RuntimeException ex) { @@ -465,8 +465,7 @@ PagedFlux analyzeText(String indexName, AnalyzeTextOptions an private Mono> analyzeTextWithResponse(String indexName, AnalyzeTextOptions analyzeTextOptions, Context context) { return restClient.getIndexes() - .analyzeWithResponseAsync(indexName, AnalyzeRequestConverter.map(analyzeTextOptions), - null, context) + .analyzeWithResponseAsync(indexName, AnalyzeRequestConverter.map(analyzeTextOptions), null, context) .onErrorMap(MappingUtils::exceptionMapper) .map(MappingUtils::mappingTokenInfo); } @@ -510,8 +509,7 @@ Mono> createSynonymMapWithResponse(SynonymMap synonymMap, Objects.requireNonNull(synonymMap, "'SynonymMap' cannot be null."); try { return restClient.getSynonymMaps() - .createWithResponseAsync(SynonymMapConverter.map(synonymMap), - null, context) + .createWithResponseAsync(SynonymMapConverter.map(synonymMap), null, context) .onErrorMap(MappingUtils::exceptionMapper) .map(MappingUtils::mappingExternalSynonymMap); } catch (RuntimeException ex) { @@ -553,8 +551,7 @@ public Mono> getSynonymMapWithResponse(String synonymMapNam return withContext(context -> getSynonymMapWithResponse(synonymMapName, context)); } - Mono> getSynonymMapWithResponse(String synonymMapName, - Context context) { + Mono> getSynonymMapWithResponse(String synonymMapName, Context context) { try { return restClient.getSynonymMaps() .getWithResponseAsync(synonymMapName, null, context) @@ -627,8 +624,7 @@ PagedFlux listSynonymMapNames(Context context) { } } - private Mono> listSynonymMapsWithResponse(String select, - Context context) { + private Mono> listSynonymMapsWithResponse(String select, Context context) { return restClient.getSynonymMaps() .listWithResponseAsync(select, null, context) .onErrorMap(MappingUtils::exceptionMapper); @@ -679,9 +675,7 @@ Mono> createOrUpdateSynonymMapWithResponse(SynonymMap synon try { return restClient.getSynonymMaps() .createOrUpdateWithResponseAsync(synonymMap.getName(), SynonymMapConverter.map(synonymMap), - ifMatch, null, - null, - context) + ifMatch, null, null, context) .onErrorMap(MappingUtils::exceptionMapper) .map(MappingUtils::mappingExternalSynonymMap); } catch (RuntimeException ex) { @@ -725,16 +719,14 @@ public Mono deleteSynonymMap(String synonymMapName) { public Mono> deleteSynonymMapWithResponse(SynonymMap synonymMap, boolean onlyIfUnchanged) { Objects.requireNonNull(synonymMap, "'SynonymMap' cannot be null"); String etag = onlyIfUnchanged ? synonymMap.getETag() : null; - return withContext(context -> - deleteSynonymMapWithResponse(synonymMap.getName(), etag, context)); + return withContext(context -> deleteSynonymMapWithResponse(synonymMap.getName(), etag, context)); } Mono> deleteSynonymMapWithResponse(String synonymMapName, String etag, Context context) { try { return restClient.getSynonymMaps() - .deleteWithResponseAsync(synonymMapName, etag, null, - null, context) + .deleteWithResponseAsync(synonymMapName, etag, null, null, context) .onErrorMap(MappingUtils::exceptionMapper) .map(Function.identity()); } catch (RuntimeException ex) { diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/SearchIndexClient.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/SearchIndexClient.java index 7988efe024730..e5fde4706f603 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/SearchIndexClient.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/SearchIndexClient.java @@ -20,7 +20,10 @@ import com.azure.search.documents.indexes.models.SynonymMap; /** - * Synchronous Client to manage and query indexes, as well as manage Synonym Map, on a Cognitive Search service + * This class provides a client that contains the operations for creating, getting, listing, updating, or deleting + * indexes or synonym map and analyzing text in an Azure Cognitive Search service. + * + * @see SearchIndexClientBuilder */ @ServiceClient(builder = SearchIndexClientBuilder.class) public final class SearchIndexClient { diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/SearchIndexClientBuilder.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/SearchIndexClientBuilder.java index c7bcd43d5b1e4..a5b20e7ee701e 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/SearchIndexClientBuilder.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/SearchIndexClientBuilder.java @@ -32,16 +32,15 @@ import java.util.Objects; /** - * This class provides a fluent builder API to help aid the configuration and instantiation of {@link - * SearchIndexClient SearchIndexClients} and {@link SearchIndexAsyncClient SearchIndexAsyncClients}. Call {@link - * #buildClient() buildClient} and {@link #buildAsyncClient() buildAsyncClient} respectively to construct an instance of - * the desired client. + * This class provides a fluent builder API to help aid the configuration and instantiation of {@link SearchIndexClient + * SearchIndexClients} and {@link SearchIndexAsyncClient SearchIndexAsyncClients}. Call {@link #buildClient() + * buildClient} and {@link #buildAsyncClient() buildAsyncClient} respectively to construct an instance of the desired + * client. *

- * The client needs to at least provide the following required fields - *

+ * The following must be provided to construct a client instance. *
    - *
  • the service endpoint of the Azure Cognitive Search to access the resource service.
  • - *
  • {@link #credential(AzureKeyCredential)} gives the builder access credential.
  • + *
  • The Azure Cognitive Search service URL.
  • + *
  • An {@link AzureKeyCredential} that grants access to the Azure Cognitive Search service.
  • *
* *

Instantiating an asynchronous Search Index Client

@@ -86,8 +85,8 @@ public final class SearchIndexClientBuilder { private RetryPolicy retryPolicy; /** - * Creates a builder instance that is able to configure and construct {@link SearchIndexClient - * SearchIndexClients} and {@link SearchIndexAsyncClient SearchIndexAsyncClients}. + * Creates a builder instance that is able to configure and construct {@link SearchIndexClient SearchIndexClients} + * and {@link SearchIndexAsyncClient SearchIndexAsyncClients}. */ public SearchIndexClientBuilder() { Map properties = CoreUtils.getProperties(SEARCH_PROPERTIES); @@ -114,8 +113,7 @@ public SearchIndexClient buildClient() { * buildAsyncClient()} is called a new instance of {@link SearchIndexAsyncClient} is created. *

* If {@link #pipeline(HttpPipeline) pipeline} is set, then only the {@code pipeline} and {@link #endpoint(String) - * endpoint} are used to create the {@link SearchIndexAsyncClient client}. All other builder settings are - * ignored. + * endpoint} are used to create the {@link SearchIndexAsyncClient client}. All other builder settings are ignored. * * @return A SearchIndexAsyncClient with the options set from the builder. * @throws NullPointerException If {@code endpoint} are {@code null}. @@ -165,9 +163,9 @@ public SearchIndexAsyncClient buildAsyncClient() { } /** - * Sets the service endpoint for the Azure Search instance. + * Sets the service endpoint for the Azure Cognitive Search instance. * - * @param endpoint The URL of the Azure Search instance. + * @param endpoint The URL of the Azure Cognitive Search instance. * @return The updated SearchIndexClientBuilder object. * @throws IllegalArgumentException If {@code endpoint} is null or it cannot be parsed into a valid URL. */ diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/SearchIndexerAsyncClient.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/SearchIndexerAsyncClient.java index 141f6096f4f66..ad4d89e99dc8d 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/SearchIndexerAsyncClient.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/SearchIndexerAsyncClient.java @@ -4,6 +4,7 @@ package com.azure.search.documents.indexes; import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceClient; import com.azure.core.annotation.ServiceMethod; import com.azure.core.http.HttpPipeline; import com.azure.core.http.rest.PagedFlux; @@ -35,8 +36,12 @@ import static com.azure.core.util.FluxUtil.withContext; /** - * Asynchronous Client to manage and query indexers, as well as manage other resources, on a Cognitive Search service + * This class provides a client that contains the operations for creating, getting, listing, updating, or deleting data + * source connections, indexers, or skillsets and running or resetting indexers in an Azure Cognitive Search service. + * + * @see SearchIndexerClientBuilder */ +@ServiceClient(builder = SearchIndexerClientBuilder.class, isAsync = true) public class SearchIndexerAsyncClient { /** * Search REST API Version @@ -70,7 +75,7 @@ public class SearchIndexerAsyncClient { this.restClient = new SearchServiceClientImplBuilder() .endpoint(endpoint) - // .apiVersion(serviceVersion.getVersion()) + // .apiVersion(serviceVersion.getVersion()) .pipeline(httpPipeline) .buildClient(); } @@ -133,8 +138,7 @@ public Mono> createOrUpdateDataSourc } Mono> createOrUpdateDataSourceConnectionWithResponse( - SearchIndexerDataSourceConnection dataSource, - boolean onlyIfUnchanged, Context context) { + SearchIndexerDataSourceConnection dataSource, boolean onlyIfUnchanged, Context context) { Objects.requireNonNull(dataSource, "'DataSource' cannot be null."); String ifMatch = onlyIfUnchanged ? dataSource.getETag() : null; if (dataSource.getConnectionString() == null) { @@ -143,9 +147,8 @@ Mono> createOrUpdateDataSourceConnec try { return restClient .getDataSources() - .createOrUpdateWithResponseAsync(dataSource.getName(), - SearchIndexerDataSourceConverter.map(dataSource), ifMatch, null, - null, context) + .createOrUpdateWithResponseAsync(dataSource.getName(), SearchIndexerDataSourceConverter.map(dataSource), + ifMatch, null, null, context) .onErrorMap(MappingUtils::exceptionMapper) .map(MappingUtils::mappingExternalDataSource); } catch (RuntimeException ex) { @@ -193,8 +196,7 @@ Mono> createDataSourceConnectionWith SearchIndexerDataSourceConnection dataSource, Context context) { try { return restClient.getDataSources() - .createWithResponseAsync(SearchIndexerDataSourceConverter.map(dataSource), - null, context) + .createWithResponseAsync(SearchIndexerDataSourceConverter.map(dataSource), null, context) .onErrorMap(MappingUtils::exceptionMapper) .map(MappingUtils::mappingExternalDataSource); } catch (RuntimeException ex) { @@ -237,7 +239,6 @@ public Mono> getDataSourceConnection return withContext(context -> getDataSourceConnectionWithResponse(dataSourceName, context)); } - @ServiceMethod(returns = ReturnType.SINGLE) Mono> getDataSourceConnectionWithResponse(String dataSourceName, Context context) { try { @@ -292,6 +293,7 @@ PagedFlux listDataSourceConnections(Context c * * @return a list of DataSource names */ + @ServiceMethod(returns = ReturnType.COLLECTION) public PagedFlux listDataSourceConnectionNames() { try { return new PagedFlux<>(() -> @@ -332,8 +334,8 @@ private Mono> listDataSourceConnectionsWithRespo */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono deleteDataSourceConnection(String dataSourceName) { - return withContext(context -> - deleteDataSourceConnectionWithResponse(dataSourceName, null, context).flatMap(FluxUtil::toMono)); + return withContext(context -> deleteDataSourceConnectionWithResponse(dataSourceName, null, context) + .flatMap(FluxUtil::toMono)); } /** @@ -355,19 +357,13 @@ public Mono> deleteDataSourceConnectionWithResponse(SearchIndexer boolean onlyIfUnchanged) { Objects.requireNonNull(dataSource, "'DataSource' cannot be null"); String etag = onlyIfUnchanged ? dataSource.getETag() : null; - return withContext(context -> - deleteDataSourceConnectionWithResponse(dataSource.getName(), etag, context)); + return withContext(context -> deleteDataSourceConnectionWithResponse(dataSource.getName(), etag, context)); } - Mono> deleteDataSourceConnectionWithResponse(String dataSourceName, String etag, - Context context) { + Mono> deleteDataSourceConnectionWithResponse(String dataSourceName, String etag, Context context) { try { return restClient.getDataSources() - .deleteWithResponseAsync( - dataSourceName, - etag, null, - null, - context) + .deleteWithResponseAsync(dataSourceName, etag, null, null, context) .onErrorMap(MappingUtils::exceptionMapper) .map(Function.identity()); } catch (RuntimeException ex) { @@ -409,12 +405,10 @@ public Mono> createIndexerWithResponse(SearchIndexer ind return withContext(context -> createIndexerWithResponse(indexer, context)); } - Mono> createIndexerWithResponse(SearchIndexer indexer, - Context context) { + Mono> createIndexerWithResponse(SearchIndexer indexer, Context context) { try { return restClient.getIndexers() - .createWithResponseAsync(SearchIndexerConverter.map(indexer), - null, context) + .createWithResponseAsync(SearchIndexerConverter.map(indexer), null, context) .onErrorMap(MappingUtils::exceptionMapper) .map(MappingUtils::mappingExternalSearchIndexer); } catch (RuntimeException ex) { @@ -456,8 +450,7 @@ public Mono createOrUpdateIndexer(SearchIndexer indexer) { @ServiceMethod(returns = ReturnType.SINGLE) public Mono> createOrUpdateIndexerWithResponse(SearchIndexer indexer, boolean onlyIfUnchanged) { - return withContext(context -> - createOrUpdateIndexerWithResponse(indexer, onlyIfUnchanged, context)); + return withContext(context -> createOrUpdateIndexerWithResponse(indexer, onlyIfUnchanged, context)); } Mono> createOrUpdateIndexerWithResponse(SearchIndexer indexer, boolean onlyIfUnchanged, @@ -466,10 +459,8 @@ Mono> createOrUpdateIndexerWithResponse(SearchIndexer in String ifMatch = onlyIfUnchanged ? indexer.getETag() : null; try { return restClient.getIndexers() - .createOrUpdateWithResponseAsync(indexer.getName(), SearchIndexerConverter.map(indexer), ifMatch, - null, - null, - context) + .createOrUpdateWithResponseAsync(indexer.getName(), SearchIndexerConverter.map(indexer), ifMatch, null, + null, context) .onErrorMap(MappingUtils::exceptionMapper) .map(MappingUtils::mappingExternalSearchIndexer); } catch (RuntimeException ex) { @@ -511,8 +502,7 @@ public Mono> getIndexerWithResponse(String indexerName) return withContext(context -> getIndexerWithResponse(indexerName, context)); } - Mono> getIndexerWithResponse(String indexerName, - Context context) { + Mono> getIndexerWithResponse(String indexerName, Context context) { try { return restClient.getIndexers() .getWithResponseAsync(indexerName, null, context) @@ -585,8 +575,7 @@ PagedFlux listIndexerNames(Context context) { } } - private Mono> listIndexersWithResponse(String select, - Context context) { + private Mono> listIndexersWithResponse(String select, Context context) { return restClient.getIndexers() .listWithResponseAsync(select, null, context) .onErrorMap(MappingUtils::exceptionMapper); @@ -639,12 +628,10 @@ public Mono> deleteIndexerWithResponse(SearchIndexer indexer, boo * @param context the context * @return a response signalling completion. */ - Mono> deleteIndexerWithResponse(String indexerName, String etag, - Context context) { + Mono> deleteIndexerWithResponse(String indexerName, String etag, Context context) { try { return restClient.getIndexers() - .deleteWithResponseAsync(indexerName, etag, null, - null, context) + .deleteWithResponseAsync(indexerName, etag, null, null, context) .onErrorMap(MappingUtils::exceptionMapper) .map(Function.identity()); } catch (RuntimeException ex) { @@ -733,8 +720,7 @@ public Mono> runIndexerWithResponse(String indexerName) { Mono> runIndexerWithResponse(String indexerName, Context context) { try { - return restClient.getIndexers().runWithResponseAsync(indexerName, - null, context) + return restClient.getIndexers().runWithResponseAsync(indexerName, null, context) .onErrorMap(MappingUtils::exceptionMapper) .map(Function.identity()); } catch (RuntimeException ex) { @@ -776,12 +762,10 @@ public Mono> getIndexerStatusWithResponse(String i return withContext(context -> getIndexerStatusWithResponse(indexerName, context)); } - Mono> getIndexerStatusWithResponse(String indexerName, - Context context) { + Mono> getIndexerStatusWithResponse(String indexerName, Context context) { try { return restClient.getIndexers() - .getStatusWithResponseAsync(indexerName, null, - context) + .getStatusWithResponseAsync(indexerName, null, context) .onErrorMap(MappingUtils::exceptionMapper) .map(MappingUtils::mappingIndexerStatus); } catch (RuntimeException ex) { @@ -823,13 +807,11 @@ public Mono> createSkillsetWithResponse(SearchIn return withContext(context -> createSkillsetWithResponse(skillset, context)); } - Mono> createSkillsetWithResponse(SearchIndexerSkillset skillset, - Context context) { + Mono> createSkillsetWithResponse(SearchIndexerSkillset skillset, Context context) { Objects.requireNonNull(skillset, "'Skillset' cannot be null."); try { return restClient.getSkillsets() - .createWithResponseAsync(SearchIndexerSkillsetConverter.map(skillset), - null, context) + .createWithResponseAsync(SearchIndexerSkillsetConverter.map(skillset), null, context) .onErrorMap(MappingUtils::exceptionMapper) .map(MappingUtils::mappingExternalSkillset); } catch (RuntimeException ex) { @@ -871,8 +853,7 @@ public Mono> getSkillsetWithResponse(String skil return withContext(context -> getSkillsetWithResponse(skillsetName, context)); } - Mono> getSkillsetWithResponse(String skillsetName, - Context context) { + Mono> getSkillsetWithResponse(String skillsetName, Context context) { try { return this.restClient.getSkillsets() .getWithResponseAsync(skillsetName, null, context) @@ -985,8 +966,7 @@ public Mono createOrUpdateSkillset(SearchIndexerSkillset @ServiceMethod(returns = ReturnType.SINGLE) public Mono> createOrUpdateSkillsetWithResponse(SearchIndexerSkillset skillset, boolean onlyIfUnchanged) { - return withContext(context -> - createOrUpdateSkillsetWithResponse(skillset, onlyIfUnchanged, context)); + return withContext(context -> createOrUpdateSkillsetWithResponse(skillset, onlyIfUnchanged, context)); } Mono> createOrUpdateSkillsetWithResponse(SearchIndexerSkillset skillset, @@ -996,9 +976,7 @@ Mono> createOrUpdateSkillsetWithResponse(SearchI try { return restClient.getSkillsets() .createOrUpdateWithResponseAsync(skillset.getName(), SearchIndexerSkillsetConverter.map(skillset), - ifMatch, null, - null, - context) + ifMatch, null, null, context) .onErrorMap(MappingUtils::exceptionMapper) .map(MappingUtils::mappingExternalSkillset); } catch (RuntimeException ex) { @@ -1042,16 +1020,13 @@ public Mono deleteSkillset(String skillsetName) { public Mono> deleteSkillsetWithResponse(SearchIndexerSkillset skillset, boolean onlyIfUnchanged) { Objects.requireNonNull(skillset, "'Skillset' cannot be null."); String etag = onlyIfUnchanged ? skillset.getETag() : null; - return withContext(context -> - deleteSkillsetWithResponse(skillset.getName(), etag, context)); + return withContext(context -> deleteSkillsetWithResponse(skillset.getName(), etag, context)); } - Mono> deleteSkillsetWithResponse(String skillsetName, String etag, - Context context) { + Mono> deleteSkillsetWithResponse(String skillsetName, String etag, Context context) { try { return restClient.getSkillsets() - .deleteWithResponseAsync(skillsetName, etag, null, - null, context) + .deleteWithResponseAsync(skillsetName, etag, null, null, context) .onErrorMap(MappingUtils::exceptionMapper) .map(Function.identity()); } catch (RuntimeException ex) { diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/SearchIndexerClient.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/SearchIndexerClient.java index 819cdf381f3ce..c04749b1389ac 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/SearchIndexerClient.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/SearchIndexerClient.java @@ -4,6 +4,7 @@ package com.azure.search.documents.indexes; import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceClient; import com.azure.core.annotation.ServiceMethod; import com.azure.core.http.HttpPipeline; import com.azure.core.http.rest.PagedIterable; @@ -15,8 +16,12 @@ import com.azure.search.documents.indexes.models.SearchIndexerStatus; /** - * Synchronous Client to manage and query indexers, as well as manage other resources, on a Cognitive Search service + * This class provides a client that contains the operations for creating, getting, listing, updating, or deleting data + * source connections, indexers, or skillsets and running or resetting indexers in an Azure Cognitive Search service. + * + * @see SearchIndexerClientBuilder */ +@ServiceClient(builder = SearchIndexerClientBuilder.class) public class SearchIndexerClient { private final SearchIndexerAsyncClient asyncClient; @@ -57,8 +62,7 @@ public String getEndpoint() { @ServiceMethod(returns = ReturnType.SINGLE) public SearchIndexerDataSourceConnection createOrUpdateDataSourceConnection( SearchIndexerDataSourceConnection dataSourceConnection) { - return createOrUpdateDataSourceConnectionWithResponse(dataSourceConnection, false, - Context.NONE).getValue(); + return createOrUpdateDataSourceConnectionWithResponse(dataSourceConnection, false, Context.NONE).getValue(); } /** @@ -236,7 +240,7 @@ public PagedIterable listDataSourceConnectionNames(Context context) { * * @param dataSourceConnectionName the name of the data source to be deleted */ - @ServiceMethod(returns = ReturnType.COLLECTION) + @ServiceMethod(returns = ReturnType.SINGLE) public void deleteDataSourceConnection(String dataSourceConnectionName) { deleteDataSourceConnectionWithResponse(new SearchIndexerDataSourceConnection(dataSourceConnectionName), false, Context.NONE); @@ -262,8 +266,8 @@ public void deleteDataSourceConnection(String dataSourceConnectionName) { public Response deleteDataSourceConnectionWithResponse(SearchIndexerDataSourceConnection dataSourceConnection, boolean onlyIfUnchanged, Context context) { String etag = onlyIfUnchanged ? dataSourceConnection.getETag() : null; - return asyncClient.deleteDataSourceConnectionWithResponse(dataSourceConnection.getName(), etag, - context).block(); + return asyncClient.deleteDataSourceConnectionWithResponse(dataSourceConnection.getName(), etag, context) + .block(); } /** @@ -297,8 +301,7 @@ public SearchIndexer createIndexer(SearchIndexer indexer) { * @return a response containing the created Indexer. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response createIndexerWithResponse(SearchIndexer indexer, - Context context) { + public Response createIndexerWithResponse(SearchIndexer indexer, Context context) { return asyncClient.createIndexerWithResponse(indexer, context).block(); } @@ -437,8 +440,7 @@ public SearchIndexer getIndexer(String indexerName) { * @return a response containing the indexer. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getIndexerWithResponse(String indexerName, - Context context) { + public Response getIndexerWithResponse(String indexerName, Context context) { return asyncClient.getIndexerWithResponse(indexerName, context).block(); } @@ -474,8 +476,7 @@ public void deleteIndexer(String indexerName) { * @return a response signalling completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteIndexerWithResponse(SearchIndexer indexer, boolean onlyIfUnchanged, - Context context) { + public Response deleteIndexerWithResponse(SearchIndexer indexer, boolean onlyIfUnchanged, Context context) { String etag = onlyIfUnchanged ? indexer.getETag() : null; return asyncClient.deleteIndexerWithResponse(indexer.getName(), etag, context).block(); } @@ -579,8 +580,7 @@ public SearchIndexerStatus getIndexerStatus(String indexerName) { * @return a response with the indexer execution info. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getIndexerStatusWithResponse(String indexerName, - Context context) { + public Response getIndexerStatusWithResponse(String indexerName, Context context) { return asyncClient.getIndexerStatusWithResponse(indexerName, context).block(); } @@ -616,8 +616,7 @@ public SearchIndexerSkillset createSkillset(SearchIndexerSkillset skillset) { * @return a response containing the created SearchIndexerSkillset. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response createSkillsetWithResponse(SearchIndexerSkillset skillset, - Context context) { + public Response createSkillsetWithResponse(SearchIndexerSkillset skillset, Context context) { return asyncClient.createSkillsetWithResponse(skillset, context).block(); } @@ -652,8 +651,7 @@ public SearchIndexerSkillset getSkillset(String skillsetName) { * @return a response containing the SearchIndexerSkillset. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getSkillsetWithResponse(String skillsetName, - Context context) { + public Response getSkillsetWithResponse(String skillsetName, Context context) { return asyncClient.getSkillsetWithResponse(skillsetName, context).block(); } diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/SearchIndexerClientBuilder.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/SearchIndexerClientBuilder.java index 7874238e497f5..f83a3f743d97c 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/SearchIndexerClientBuilder.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/SearchIndexerClientBuilder.java @@ -38,11 +38,10 @@ * #buildClient() buildClient} and {@link #buildAsyncClient() buildAsyncClient} respectively to construct an instance of * the desired client. *

- * The client needs to at least provide the following required fields - *

+ * The following must be provided to construct a client instance. *
    - *
  • the service endpoint of the Azure Cognitive Search to access the resource service.
  • - *
  • {@link #credential(AzureKeyCredential)} gives the builder access credential.
  • + *
  • The Azure Cognitive Search service URL.
  • + *
  • An {@link AzureKeyCredential} that grants access to the Azure Cognitive Search service.
  • *
* *

Instantiating an asynchronous Search Indexer Client

@@ -166,9 +165,9 @@ public SearchIndexerAsyncClient buildAsyncClient() { } /** - * Sets the service endpoint for the Azure Search instance. + * Sets the service endpoint for the Azure Cognitive Search instance. * - * @param endpoint The URL of the Azure Search instance. + * @param endpoint The URL of the Azure Cognitive Search instance. * @return The updated SearchIndexerClientBuilder object. * @throws IllegalArgumentException If {@code endpoint} is null or it cannot be parsed into a valid URL. */ diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/SearchIndexerDataSources.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/SearchIndexerDataSources.java index 82b6746da476f..92a35395bdf13 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/SearchIndexerDataSources.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/SearchIndexerDataSources.java @@ -12,7 +12,8 @@ import com.azure.search.documents.indexes.models.SearchIndexerDataSourceType; /** - * Utility class that aids in the creation of {@link SearchIndexerDataSourceConnection SearchIndexerDataSources}. + * Utility class that aids in the creation of {@link SearchIndexerDataSourceConnection + * SearchIndexerDataSourceConnections}. */ public final class SearchIndexerDataSources { diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/package-info.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/package-info.java index a95b4570dd2cd..cf1d4ff54de32 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/package-info.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/package-info.java @@ -2,8 +2,7 @@ // Licensed under the MIT License. /** - * Package containing the data models for SearchServiceRestClient. - * Client that can be used to manage and query indexes and documents, as well - * as manage other resources, on a search service. + * Package containing classes used for resource management operations that are being sent-to and received-from an + * Azure Cognitive Search service. */ package com.azure.search.documents.indexes.models; diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/package-info.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/package-info.java index f3976eff94c23..d970f63ef906c 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/package-info.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/package-info.java @@ -2,7 +2,10 @@ // Licensed under the MIT License. /** - * Package containing the annotations used by FieldBuilder which help convert - * model class to a list of Field classes for building Index. + * Package containing classes for creating {@link com.azure.search.documents.indexes.SearchIndexClient}, + * {@link com.azure.search.documents.indexes.SearchIndexAsyncClient}, + * {@link com.azure.search.documents.indexes.SearchIndexerClient}, or + * {@link com.azure.search.documents.indexes.SearchIndexerAsyncClient} used to perform resource management operations + * on an Azure Cognitive Search service. */ package com.azure.search.documents.indexes; diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/package-info.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/package-info.java new file mode 100644 index 0000000000000..a052f26e2a178 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/package-info.java @@ -0,0 +1,8 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +/** + * Package containing classes used for document management, autocomplete, search, or suggestion operations that are + * being sent-to and received-from an Azure Cognitive Search service index. + */ +package com.azure.search.documents.models; diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/package-info.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/package-info.java index 11f33ee1ee8c3..38b8b14ef0e89 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/package-info.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/package-info.java @@ -5,7 +5,8 @@ // regenerated. /** - * Package containing the classes for SearchIndexRestClient. Client that can be used to query an index and upload, - * merge, or delete documents. + * Package containing classes for creating {@link com.azure.search.documents.SearchClient} or + * {@link com.azure.search.documents.SearchAsyncClient} used to perform document management, autocomplete, search, or + * suggestion operations using an Azure Cognitive Search service index. */ package com.azure.search.documents; diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/util/package-info.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/util/package-info.java index a60d24405cd5c..800c51a81b69c 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/util/package-info.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/util/package-info.java @@ -2,6 +2,6 @@ // Licensed under the MIT License. /** - * Package containing Search utility classes. + * Package containing Azure Cognitive Search paged response classes. */ package com.azure.search.documents.util; diff --git a/sdk/search/azure-search-documents/src/main/java/module-info.java b/sdk/search/azure-search-documents/src/main/java/module-info.java index a25a9e84ecf52..44e0917971daf 100644 --- a/sdk/search/azure-search-documents/src/main/java/module-info.java +++ b/sdk/search/azure-search-documents/src/main/java/module-info.java @@ -17,6 +17,7 @@ opens com.azure.search.documents.implementation.util to com.fasterxml.jackson.databind; exports com.azure.search.documents; + exports com.azure.search.documents.indexes; exports com.azure.search.documents.indexes.models; exports com.azure.search.documents.models; exports com.azure.search.documents.util; diff --git a/sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/RefineSearchCapabilitiesExample.java b/sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/RefineSearchCapabilitiesExample.java index 88ce4b28826b5..b830c0748fa30 100644 --- a/sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/RefineSearchCapabilitiesExample.java +++ b/sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/RefineSearchCapabilitiesExample.java @@ -31,7 +31,7 @@ /** * This scenario assumes an existing search solution, with index and an indexer setup (see LifecycleSetupExample) - * For more information visit Azure Search Sample Data + * For more information visit Azure Cognitive Search Sample Data * https://docs.microsoft.com/en-us/samples/azure-samples/azure-search-sample-data/azure-search-sample-data/ */ public class RefineSearchCapabilitiesExample { diff --git a/sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/RunningSearchSolutionExample.java b/sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/RunningSearchSolutionExample.java index 259ba3ab0fd27..9e5fe4c57710a 100644 --- a/sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/RunningSearchSolutionExample.java +++ b/sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/RunningSearchSolutionExample.java @@ -27,7 +27,7 @@ /** * This scenario assumes an existing search solution, with index and an indexer setup (see LifecycleSetupExample) - * Azure Search Sample Data + * Azure Cognitive Search Sample Data * https://docs.microsoft.com/en-us/samples/azure-samples/azure-search-sample-data/azure-search-sample-data/ */ public class RunningSearchSolutionExample { diff --git a/sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/indexes/LifecycleSetupExample.java b/sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/indexes/LifecycleSetupExample.java index c6acd454d1b88..eff3c0a9775d6 100644 --- a/sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/indexes/LifecycleSetupExample.java +++ b/sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/indexes/LifecycleSetupExample.java @@ -29,7 +29,7 @@ /** * This scenario assumes an existing search solution and uses a pre-population data source with sample data set - * For more information visit Azure Search Sample Data: + * For more information visit Azure Cognitive Search Sample Data: * https://docs.microsoft.com/en-us/samples/azure-samples/azure-search-sample-data/azure-search-sample-data/ */ public class LifecycleSetupExample { diff --git a/sdk/search/azure-search-documents/src/test/java/com/azure/search/documents/TestHelpers.java b/sdk/search/azure-search-documents/src/test/java/com/azure/search/documents/TestHelpers.java index da20ef304172a..d31986de974c8 100644 --- a/sdk/search/azure-search-documents/src/test/java/com/azure/search/documents/TestHelpers.java +++ b/sdk/search/azure-search-documents/src/test/java/com/azure/search/documents/TestHelpers.java @@ -39,7 +39,7 @@ import static org.junit.jupiter.api.Assertions.fail; /** - * This class contains helper methods for running Azure Search tests. + * This class contains helper methods for running Azure Cognitive Search tests. */ public final class TestHelpers { private static final TestMode TEST_MODE = setupTestMode(); From 467e370934054b0ed748367a6a6f088481d2f3de Mon Sep 17 00:00:00 2001 From: Jianghao Lu Date: Fri, 10 Jul 2020 19:13:22 -0700 Subject: [PATCH 095/129] increment version after azure-identity 1.1.0-beta.6 release (#13037) * increment version after azure-identity 1.1.0-beta.6 release * Update readme to 1.0.8 --- eng/jacoco-test-coverage/pom.xml | 2 +- eng/versioning/version_client.txt | 2 +- sdk/e2e/pom.xml | 2 +- sdk/identity/azure-identity-perf/pom.xml | 2 +- sdk/identity/azure-identity/CHANGELOG.md | 6 +++++- sdk/identity/azure-identity/README.md | 2 +- sdk/identity/azure-identity/pom.xml | 2 +- 7 files changed, 11 insertions(+), 7 deletions(-) diff --git a/eng/jacoco-test-coverage/pom.xml b/eng/jacoco-test-coverage/pom.xml index 7de09b3ef7639..63e664f3d819c 100644 --- a/eng/jacoco-test-coverage/pom.xml +++ b/eng/jacoco-test-coverage/pom.xml @@ -134,7 +134,7 @@ com.azure azure-identity - 1.1.0-beta.6 + 1.1.0-beta.7 com.azure diff --git a/eng/versioning/version_client.txt b/eng/versioning/version_client.txt index ca739e6b6f004..d9332004bbf1b 100644 --- a/eng/versioning/version_client.txt +++ b/eng/versioning/version_client.txt @@ -26,7 +26,7 @@ com.azure:azure-data-schemaregistry;1.0.0-beta.2;1.0.0-beta.3 com.azure:azure-data-schemaregistry-avro;1.0.0-beta.2;1.0.0-beta.3 com.azure:azure-data-tables;1.0.0-beta.1;1.0.0-beta.1 com.azure:azure-e2e;1.0.0-beta.1;1.0.0-beta.1 -com.azure:azure-identity;1.0.8;1.1.0-beta.6 +com.azure:azure-identity;1.0.8;1.1.0-beta.7 com.azure:azure-identity-perf;1.0.0-beta.1;1.0.0-beta.1 com.azure:azure-messaging-eventhubs;5.1.2;5.2.0-beta.1 com.azure:azure-messaging-eventhubs-checkpointstore-blob;1.1.2;1.2.0-beta.1 diff --git a/sdk/e2e/pom.xml b/sdk/e2e/pom.xml index c6508af00fd60..648a174f431bd 100644 --- a/sdk/e2e/pom.xml +++ b/sdk/e2e/pom.xml @@ -33,7 +33,7 @@ com.azure azure-identity - 1.1.0-beta.6 + 1.1.0-beta.7 com.azure diff --git a/sdk/identity/azure-identity-perf/pom.xml b/sdk/identity/azure-identity-perf/pom.xml index a2850b08bd6f9..56d2e7379410a 100644 --- a/sdk/identity/azure-identity-perf/pom.xml +++ b/sdk/identity/azure-identity-perf/pom.xml @@ -27,7 +27,7 @@ com.azure azure-identity - 1.1.0-beta.6 + 1.1.0-beta.7 com.azure diff --git a/sdk/identity/azure-identity/CHANGELOG.md b/sdk/identity/azure-identity/CHANGELOG.md index 8122e713e48b0..21bd86b155665 100644 --- a/sdk/identity/azure-identity/CHANGELOG.md +++ b/sdk/identity/azure-identity/CHANGELOG.md @@ -1,8 +1,12 @@ # Release History -## 1.1.0-beta.6 (Unreleased) +## 1.1.0-beta.7 (Unreleased) +## 1.1.0-beta.6 (2020-07-10) +- Added `.getCredentials()` method to `DefaultAzureCredential` and `ChainedTokenCredential` and added option `.addAll(Collection)` on `ChainedtokenCredentialBuilder`. +- Added logging information in credentials and improved error messages in `DefaultAzureCredential`. + ## 1.1.0-beta.5 (2020-06-09) ### New Features diff --git a/sdk/identity/azure-identity/README.md b/sdk/identity/azure-identity/README.md index 2c4a37dad0f1f..609301e3ba489 100644 --- a/sdk/identity/azure-identity/README.md +++ b/sdk/identity/azure-identity/README.md @@ -45,7 +45,7 @@ Maven dependency for Azure Secret Client library. Add it to your project's pom f com.azure azure-identity - 1.0.7 + 1.0.8 ``` [//]: # ({x-version-update-end}) diff --git a/sdk/identity/azure-identity/pom.xml b/sdk/identity/azure-identity/pom.xml index 1ffe0f026ec9c..24ffceb057e06 100644 --- a/sdk/identity/azure-identity/pom.xml +++ b/sdk/identity/azure-identity/pom.xml @@ -6,7 +6,7 @@ com.azure azure-identity - 1.1.0-beta.6 + 1.1.0-beta.7 Microsoft Azure client library for Identity This module contains client library for Microsoft Azure Identity. From 2248f96601316d9cd0af1bf4144d3995a776afcb Mon Sep 17 00:00:00 2001 From: David Noble Date: Sat, 11 Jul 2020 16:19:04 -0700 Subject: [PATCH 096/129] [BUG] Cosmos | Addresses GitHub issue #10401 : Operator called default onErrorDropped (#12836) * Port from v4 * Corrected package misspelling in log4j.properties and removed System.exit from Main.java * Responded to code review comments * Updated sdk/cosmos/README.md with info on using system properties to modify default Direct TCP options * Removed file that's been deleted on origin/master: sdk/cosmos/README.md * Resolved issue (see changes to RntbdTransportClient), disambiguated two messages (see changes to RntbdClientChannelPool), and optimized imports. * Refinements to exception handling designed to eliminate onErrorDropped errors. * RntbdTransportClient.Options constructor now respects the value of DirectConnectionConfig.idleEndpointTimeout. * Testing a new possible fix * Another fix attempt * Updated code comment * Updated code comment * Testing a revised 'fix' * Updated thread name prefix string. * Tweakead the implementation before creating a PR. * Fix compilation error on conflict resolution * Fixed merge issue Co-authored-by: Kushagra Thapar --- .../RntbdTransportClient.java | 102 ++++++++++++++++-- .../TransportException.java | 3 + .../rntbd/RntbdClientChannelPool.java | 4 +- .../rntbd/RntbdMetrics.java | 2 +- .../rntbd/RntbdRequest.java | 2 +- .../rntbd/RntbdRequestArgs.java | 4 +- .../rntbd/RntbdRequestHeaders.java | 2 +- .../rntbd/RntbdResponse.java | 1 - .../rntbd/RntbdResponseHeaders.java | 4 +- .../rntbd/RntbdServiceEndpoint.java | 5 +- .../rntbd/RntbdThreadFactory.java | 2 +- 11 files changed, 110 insertions(+), 21 deletions(-) diff --git a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/directconnectivity/RntbdTransportClient.java b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/directconnectivity/RntbdTransportClient.java index 837163ab5725e..4a16686aa317d 100644 --- a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/directconnectivity/RntbdTransportClient.java +++ b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/directconnectivity/RntbdTransportClient.java @@ -4,8 +4,10 @@ package com.azure.cosmos.implementation.directconnectivity; import com.azure.cosmos.BridgeInternal; +import com.azure.cosmos.CosmosException; import com.azure.cosmos.implementation.Configs; import com.azure.cosmos.implementation.ConnectionPolicy; +import com.azure.cosmos.implementation.GoneException; import com.azure.cosmos.implementation.RequestTimeline; import com.azure.cosmos.implementation.RxDocumentServiceRequest; import com.azure.cosmos.implementation.UserAgentContainer; @@ -27,6 +29,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import reactor.core.publisher.Mono; +import reactor.core.publisher.SignalType; import java.io.File; import java.io.IOException; @@ -35,12 +38,15 @@ import java.time.Duration; import java.util.Iterator; import java.util.Locale; +import java.util.concurrent.CompletionException; import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicLong; +import static com.azure.cosmos.implementation.directconnectivity.rntbd.RntbdReporter.reportIssue; import static com.azure.cosmos.implementation.guava25.base.Preconditions.checkArgument; import static com.azure.cosmos.implementation.guava25.base.Preconditions.checkNotNull; import static com.azure.cosmos.implementation.guava25.base.Preconditions.checkState; +import static com.azure.cosmos.implementation.guava27.Strings.lenientFormat; @JsonSerialize(using = RntbdTransportClient.JsonSerializer.class) public final class RntbdTransportClient extends TransportClient { @@ -116,15 +122,13 @@ public Mono invokeStoreAsync(final Uri addressUri, final RxDocume checkNotNull(request, "expected non-null request"); this.throwIfClosed(); - URI address = addressUri.getURI(); + final URI address = addressUri.getURI(); final RntbdRequestArgs requestArgs = new RntbdRequestArgs(request, address); final RntbdEndpoint endpoint = this.endpointProvider.get(address); final RntbdRequestRecord record = endpoint.request(requestArgs); - logger.debug("RntbdTransportClient.invokeStoreAsync({}, {}): {}", address, request, record); - - return Mono.fromFuture(record.whenComplete((response, throwable) -> { + final Mono result = Mono.fromFuture(record.whenComplete((response, throwable) -> { record.stage(RntbdRequestRecord.Stage.COMPLETED); @@ -136,8 +140,86 @@ public Mono invokeStoreAsync(final Uri addressUri, final RxDocume RequestTimeline timeline = record.takeTimelineSnapshot(); response.setRequestTimeline(timeline); } - })).doOnCancel(() -> { - logger.debug("REQUEST CANCELLED: {}", record); + + })).onErrorMap(throwable -> { + + Throwable error = throwable instanceof CompletionException ? throwable.getCause() : throwable; + + if (!(error instanceof CosmosException)) { + + String unexpectedError = RntbdObjectMapper.toJson(error); + + reportIssue(logger, endpoint, + "request completed with an unexpected {}: \\{\"record\":{},\"error\":{}}", + error.getClass(), + record, + unexpectedError); + + error = new GoneException( + lenientFormat("an unexpected %s occurred: %s", unexpectedError), + address.toString()); + } + + return error; + + }); + + return result.doFinally(signalType -> { + + // This lambda ensures that a pending Direct TCP request in a reactive stream dropped by an end user or the + // HA layer completes without bubbling up to reactor.core.publisher.Hooks#onErrorDropped as a + // CompletionException error. Pending requests may be left outstanding when, for example, an end user calls + // CosmosAsyncClient#close or the HA layer detects that a partition split has occurred. This code guarantees + // that each pending Mono in the stream will run to completion with a new subscriber. + // Consequently the default Hooks#onErrorDropped method will not be called thus preventing distracting error + // messages. + // + // This lambda does not prevent requests that complete exceptionally before the call to this lambda from + // bubbling up to Hooks#onErrorDropped as CompletionException errors. We will still see some onErrorDropped + // messages due to CompletionException errors. Anecdotal evidence shows that this is more likely to be seen + // in low latency environments on Azure cloud. + // + // One might be tempted to complete a pending request here, but that is ill advised. Testing and + // inspection of the reactor code shows that this does not prevent errors from bubbling up to + // reactor.core.publisher.Hooks#onErrorDropped. Worse than this it has been seen to cause failures in + // the HA layer: + // + // * Calling record.cancel or record.completeExceptionally causes failures in (low-latency) cloud + // environments and all errors bubble up Hooks#onErrorDropped. + // + // * Calling record.complete with a null value causes failures in all environments, depending on the + // operation being performed. In short: many of our tests fail. + // + // TODO (DANOBLE) verify the correctness of this statement: Fact: We still see some of these errors. Does + // reactor provide a mechanism other than Hooks#onErrorDropped(Consumer consumer) for + // doing this per Mono or must we, for example, rely on something like this in the consistency layer: + // https://www.codota.com/code/java/classes/reactor.core.publisher.Hooks + + if (signalType != SignalType.CANCEL) { + return; + } + + result.subscribe( + response -> { + if (logger.isDebugEnabled()) { + logger.debug( + "received response to cancelled request: {\"request\":{},\"response\":{\"type\":{}," + + "\"value\":{}}}}", + RntbdObjectMapper.toJson(record), + response.getClass().getSimpleName(), + RntbdObjectMapper.toJson(response)); + } + }, + throwable -> { + if (logger.isDebugEnabled()) { + logger.debug( + "received response to cancelled request: {\"request\":{},\"response\":{\"type\":{}," + + "\"value\":{}}}", + RntbdObjectMapper.toJson(record), + throwable.getClass().getSimpleName(), + RntbdObjectMapper.toJson(throwable)); + } + }); }); } @@ -159,7 +241,9 @@ private static Tag tag(long id) { // region Privates private void throwIfClosed() { - checkState(!this.closed.get(), "%s is closed", this); + if (this.closed.get()) { + throw new TransportException(lenientFormat("%s is closed", this), null); + } } // endregion @@ -255,7 +339,7 @@ private Options(final ConnectionPolicy connectionPolicy) { this.connectionAcquisitionTimeout = Duration.ZERO; this.connectTimeout = connectionPolicy.getConnectTimeout(); this.idleChannelTimeout = connectionPolicy.getIdleTcpConnectionTimeout(); - this.idleEndpointTimeout = Duration.ofSeconds(70L); + this.idleEndpointTimeout = connectionPolicy.getIdleEndpointTimeout(); this.maxBufferCapacity = 8192 << 10; this.maxChannelsPerEndpoint = connectionPolicy.getMaxConnectionsPerEndpoint(); this.maxRequestsPerChannel = connectionPolicy.getMaxRequestsPerConnection(); @@ -381,7 +465,7 @@ public String toString() { * "maxRequestsPerChannel": 30, * "receiveHangDetectionTime": "PT1M5S", * "requestExpiryInterval": "PT5S", - * "requestTimeout": "PT1M", + * "requestTimeout": "PT5S", * "requestTimerResolution": "PT0.5S", * "sendHangDetectionTime": "PT10S", * "shutdownTimeout": "PT15S", diff --git a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/directconnectivity/TransportException.java b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/directconnectivity/TransportException.java index ce39b5f5363e6..7cb9bbd53eec9 100644 --- a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/directconnectivity/TransportException.java +++ b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/directconnectivity/TransportException.java @@ -20,6 +20,9 @@ // NOTES: // We throw a derivative in one place: RntbdContextException in RntbdContext.decode. This is a special case // that is handled by RntbdRequestManager.userEventTriggered. +// REFERENCES: +// * The Exceptional Performance of Lil' Exception +// https://shipilev.net/blog/2014/exceptional-performance/ public class TransportException extends RuntimeException { public TransportException(String message, Throwable cause) { diff --git a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/directconnectivity/rntbd/RntbdClientChannelPool.java b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/directconnectivity/rntbd/RntbdClientChannelPool.java index d53f5f290e78d..4f493706de407 100644 --- a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/directconnectivity/rntbd/RntbdClientChannelPool.java +++ b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/directconnectivity/rntbd/RntbdClientChannelPool.java @@ -65,11 +65,11 @@ public final class RntbdClientChannelPool implements ChannelPool { new ClosedChannelException(), RntbdClientChannelPool.class, "acquire"); private static final IllegalStateException POOL_CLOSED_ON_ACQUIRE = ThrowableUtil.unknownStackTrace( - new StacklessIllegalStateException("service endpoint was closed"), + new StacklessIllegalStateException("service endpoint was closed while acquiring a channel"), RntbdClientChannelPool.class, "acquire"); private static final IllegalStateException POOL_CLOSED_ON_RELEASE = ThrowableUtil.unknownStackTrace( - new StacklessIllegalStateException("service endpoint was closed"), + new StacklessIllegalStateException("service endpoint was closed while releasing a channel"), RntbdClientChannelPool.class, "release"); private static final AttributeKey POOL_KEY = AttributeKey.newInstance( diff --git a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/directconnectivity/rntbd/RntbdMetrics.java b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/directconnectivity/rntbd/RntbdMetrics.java index 3e7aaa18b8eed..2231e5a16a670 100644 --- a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/directconnectivity/rntbd/RntbdMetrics.java +++ b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/directconnectivity/rntbd/RntbdMetrics.java @@ -4,11 +4,11 @@ package com.azure.cosmos.implementation.directconnectivity.rntbd; import com.azure.cosmos.implementation.directconnectivity.RntbdTransportClient; +import com.azure.cosmos.implementation.guava25.net.PercentEscaper; import com.codahale.metrics.ConsoleReporter; import com.codahale.metrics.MetricRegistry; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.azure.cosmos.implementation.guava25.net.PercentEscaper; import io.micrometer.core.instrument.Clock; import io.micrometer.core.instrument.DistributionSummary; import io.micrometer.core.instrument.Gauge; diff --git a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/directconnectivity/rntbd/RntbdRequest.java b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/directconnectivity/rntbd/RntbdRequest.java index 9d562a0a4cbc2..727cccb2bc519 100644 --- a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/directconnectivity/rntbd/RntbdRequest.java +++ b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/directconnectivity/rntbd/RntbdRequest.java @@ -4,8 +4,8 @@ package com.azure.cosmos.implementation.directconnectivity.rntbd; import com.azure.cosmos.implementation.RxDocumentServiceRequest; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.azure.cosmos.implementation.guava27.Strings; +import com.fasterxml.jackson.annotation.JsonIgnore; import io.netty.buffer.ByteBuf; import java.util.UUID; diff --git a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/directconnectivity/rntbd/RntbdRequestArgs.java b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/directconnectivity/rntbd/RntbdRequestArgs.java index b56c905de9eab..c15593898b699 100644 --- a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/directconnectivity/rntbd/RntbdRequestArgs.java +++ b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/directconnectivity/rntbd/RntbdRequestArgs.java @@ -4,15 +4,15 @@ package com.azure.cosmos.implementation.directconnectivity.rntbd; import com.azure.cosmos.implementation.RxDocumentServiceRequest; +import com.azure.cosmos.implementation.apachecommons.lang.StringUtils; +import com.azure.cosmos.implementation.guava25.base.Stopwatch; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; -import com.azure.cosmos.implementation.guava25.base.Stopwatch; import io.micrometer.core.instrument.Timer; import io.netty.channel.ChannelHandlerContext; -import com.azure.cosmos.implementation.apachecommons.lang.StringUtils; import org.slf4j.Logger; import java.net.URI; diff --git a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/directconnectivity/rntbd/RntbdRequestHeaders.java b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/directconnectivity/rntbd/RntbdRequestHeaders.java index 2738fc44ab8e2..fc7e7f0c69067 100644 --- a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/directconnectivity/rntbd/RntbdRequestHeaders.java +++ b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/directconnectivity/rntbd/RntbdRequestHeaders.java @@ -27,8 +27,8 @@ import java.util.Map; import java.util.function.Supplier; -import static com.azure.cosmos.implementation.HttpConstants.HttpHeaders; import static com.azure.cosmos.implementation.HttpConstants.HeaderValues; +import static com.azure.cosmos.implementation.HttpConstants.HttpHeaders; import static com.azure.cosmos.implementation.directconnectivity.WFConstants.BackendHeaders; import static com.azure.cosmos.implementation.directconnectivity.rntbd.RntbdConstants.RntbdConsistencyLevel; import static com.azure.cosmos.implementation.directconnectivity.rntbd.RntbdConstants.RntbdContentSerializationFormat; diff --git a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/directconnectivity/rntbd/RntbdResponse.java b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/directconnectivity/rntbd/RntbdResponse.java index 410d5f6c7a3e7..b743b01b1f15f 100644 --- a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/directconnectivity/rntbd/RntbdResponse.java +++ b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/directconnectivity/rntbd/RntbdResponse.java @@ -29,7 +29,6 @@ import static com.azure.cosmos.implementation.guava25.base.Preconditions.checkArgument; import static com.azure.cosmos.implementation.guava25.base.Preconditions.checkNotNull; import static com.azure.cosmos.implementation.guava25.base.Preconditions.checkState; -import static java.lang.Integer.min; @JsonPropertyOrder({ "messageLength", "referenceCount", "frame", "headers", "content" }) public final class RntbdResponse implements ReferenceCounted { diff --git a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/directconnectivity/rntbd/RntbdResponseHeaders.java b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/directconnectivity/rntbd/RntbdResponseHeaders.java index acd1df01552d0..920173ed0e465 100644 --- a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/directconnectivity/rntbd/RntbdResponseHeaders.java +++ b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/directconnectivity/rntbd/RntbdResponseHeaders.java @@ -3,12 +3,12 @@ package com.azure.cosmos.implementation.directconnectivity.rntbd; +import com.azure.cosmos.implementation.guava25.collect.ImmutableList; +import com.azure.cosmos.implementation.guava25.collect.ImmutableMap; import com.fasterxml.jackson.annotation.JsonFilter; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectWriter; -import com.azure.cosmos.implementation.guava25.collect.ImmutableList; -import com.azure.cosmos.implementation.guava25.collect.ImmutableMap; import io.netty.buffer.ByteBuf; import io.netty.buffer.Unpooled; import io.netty.handler.codec.CorruptedFrameException; diff --git a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/directconnectivity/rntbd/RntbdServiceEndpoint.java b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/directconnectivity/rntbd/RntbdServiceEndpoint.java index 0bf5122d67c07..a0288d75f1b8b 100644 --- a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/directconnectivity/rntbd/RntbdServiceEndpoint.java +++ b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/directconnectivity/rntbd/RntbdServiceEndpoint.java @@ -314,7 +314,10 @@ public static final class Provider implements RntbdEndpoint.Provider { private final RntbdRequestTimer requestTimer; private final RntbdTransportClient transportClient; - public Provider(final RntbdTransportClient transportClient, final Options options, final SslContext sslContext) { + public Provider( + final RntbdTransportClient transportClient, + final Options options, + final SslContext sslContext) { checkNotNull(transportClient, "expected non-null provider"); checkNotNull(options, "expected non-null options"); diff --git a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/directconnectivity/rntbd/RntbdThreadFactory.java b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/directconnectivity/rntbd/RntbdThreadFactory.java index 1b58f32650a7d..ee2e9a10b9c72 100644 --- a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/directconnectivity/rntbd/RntbdThreadFactory.java +++ b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/directconnectivity/rntbd/RntbdThreadFactory.java @@ -14,7 +14,7 @@ */ class RntbdThreadFactory implements ThreadFactory { - private static final String NAME_TEMPLATE = "rntbd-%s[%s]"; + private static final String NAME_TEMPLATE = "cosmos-rntbd-%s[%s]"; private final boolean daemon; private final String name; private final int priority; From 978c5e27a18a05ca012fc33c8cbbd4cee478756e Mon Sep 17 00:00:00 2001 From: Yi Liu Date: Mon, 13 Jul 2020 10:10:48 +0800 Subject: [PATCH 097/129] modify build command to build the whole project (#12992) --- sdk/spring/CONTRIBUTING.md | 27 +++++++++++---------------- 1 file changed, 11 insertions(+), 16 deletions(-) diff --git a/sdk/spring/CONTRIBUTING.md b/sdk/spring/CONTRIBUTING.md index 87b09e0025e9f..e7b9b7abf19fe 100644 --- a/sdk/spring/CONTRIBUTING.md +++ b/sdk/spring/CONTRIBUTING.md @@ -33,36 +33,31 @@ submission is consistent with the project standards and is ready to be accepted ## Building from source -To build the project, open a command prompt/terminal: +If it's the first time you try to build the project or you pull new commits from github, then you need to build the whole SDK project with the below command: 1. Execute `git clone https://github.com/Azure/azure-sdk-for-java.git` -1. Traverse to the spring directory: +1. Traverse to the root directory: +1. Build the whole product by executing the following command which may take several minutes: + * `mvn clean install -Dmaven.javadoc.skip=true -Dcheckstyle.skip=true -Dspotbugs.skip=true -Drevapi.skip=true -Djacoco.skip=true​ -DskipTests -Dparallel-test-playback` + +After executing the above steps, you can build the spring project only for the developing purpose: +1. Traverse to spring directory: * `cd sdk\spring` -1. Build the product by executing: - * `mvn clean package -DskipTests` +1. Build the spring project: + * `mvn clean install -DskipTests` + ## Running tests After following instructions above, you can run the unit tests by executing: ```shell -mvn clean test +mvn test ``` For unit tests, there are no special considerations; these are self-contained and execute locally without any reliance on external resources. These tests are run for all PR validations. -## FAQ - -When building Spring Boot project, if it fails on the sample `azure-spring-boot-sample-servicebus`, please deploy the -`com.azure:azure-messaging-servicebus` to your local repository manually by: -```shell -cd sdk\servicebus\azure-messaging-service -mvn clean install -DskipTests -``` -This is because the version of `com.azure:azure-messaging-servicebus` library the sample depends on is from this SDK -repository instead of Maven. - ## Version management Developing version naming convention is like `0.1.2-beta.1`. Release version naming convention is like `0.1.2`. From 6f85cf8333c46fc7071c7063312f6043a55c0326 Mon Sep 17 00:00:00 2001 From: Weidong Xu Date: Mon, 13 Jul 2020 10:41:04 +0800 Subject: [PATCH 098/129] mgmt regen appservice and compute (#13022) * add mergeContext to merge user provided context and default context * regen appservice * regen compute * manual fix * fix checkstyle --- .../resources/spotbugs/spotbugs-exclude.xml | 2 +- .../appservice/WebSiteManagementClient.java | 2 +- .../AppServiceCertificateOrdersClient.java | 676 +- .../fluent/AppServiceEnvironmentsClient.java | 2553 +--- .../fluent/AppServicePlansClient.java | 295 +- ...ertificateRegistrationProvidersClient.java | 2 + .../appservice/fluent/CertificatesClient.java | 8 + .../fluent/DeletedWebAppsClient.java | 5 + .../appservice/fluent/DiagnosticsClient.java | 31 + .../DomainRegistrationProvidersClient.java | 2 + .../appservice/fluent/DomainsClient.java | 280 +- .../appservice/fluent/ProvidersClient.java | 6 + .../fluent/RecommendationsClient.java | 20 + .../fluent/ResourceHealthMetadatasClient.java | 10 + .../fluent/ResourceProvidersClient.java | 21 + .../appservice/fluent/StaticSitesClient.java | 33 + .../fluent/TopLevelDomainsClient.java | 5 + .../appservice/fluent/WebAppsClient.java | 11539 ++++------------ .../compute/ComputeManagementClient.java | 2 +- .../fluent/AvailabilitySetsClient.java | 9 + .../fluent/ContainerServicesClient.java | 413 +- .../fluent/DedicatedHostGroupsClient.java | 8 + .../compute/fluent/DedicatedHostsClient.java | 678 +- .../fluent/DiskEncryptionSetsClient.java | 671 +- .../compute/fluent/DisksClient.java | 1016 +- .../compute/fluent/GalleriesClient.java | 610 +- .../GalleryApplicationVersionsClient.java | 916 +- .../fluent/GalleryApplicationsClient.java | 764 +- .../fluent/GalleryImageVersionsClient.java | 826 +- .../compute/fluent/GalleryImagesClient.java | 707 +- .../compute/fluent/ImagesClient.java | 609 +- .../compute/fluent/LogAnalyticsClient.java | 386 +- .../compute/fluent/OperationsClient.java | 1 + .../ProximityPlacementGroupsClient.java | 8 + .../compute/fluent/ResourceSkusClient.java | 2 + .../compute/fluent/SnapshotsClient.java | 1016 +- .../compute/fluent/SshPublicKeysClient.java | 9 + .../compute/fluent/UsagesClient.java | 2 + .../VirtualMachineExtensionImagesClient.java | 3 + .../VirtualMachineExtensionsClient.java | 703 +- .../fluent/VirtualMachineImagesClient.java | 5 + .../VirtualMachineRunCommandsClient.java | 3 + ...irtualMachineScaleSetExtensionsClient.java | 708 +- ...lMachineScaleSetRollingUpgradesClient.java | 534 +- ...tualMachineScaleSetVMExtensionsClient.java | 768 +- .../VirtualMachineScaleSetVMsClient.java | 2308 +--- .../fluent/VirtualMachineScaleSetsClient.java | 3021 +--- .../fluent/VirtualMachineSizesClient.java | 1 + .../compute/fluent/VirtualMachinesClient.java | 2703 +--- .../inner/VirtualMachineExtensionInner.java | 8 +- .../VirtualMachineScaleSetExtensionInner.java | 15 + .../compute/models/ApiError.java | 3 - .../compute/models/DiffDiskOptions.java | 39 +- .../models/DiskEncryptionSetIdentityType.java | 39 +- .../models/OrchestrationServiceNames.java | 39 +- .../OrchestrationServiceStateInput.java | 17 +- .../models/ReplicationStatusTypes.java | 39 +- .../fluentcore/AzureServiceClient.java | 14 + 58 files changed, 4513 insertions(+), 30600 deletions(-) diff --git a/eng/code-quality-reports/src/main/resources/spotbugs/spotbugs-exclude.xml b/eng/code-quality-reports/src/main/resources/spotbugs/spotbugs-exclude.xml index f536c098907ff..ffa56e0ca5e0f 100755 --- a/eng/code-quality-reports/src/main/resources/spotbugs/spotbugs-exclude.xml +++ b/eng/code-quality-reports/src/main/resources/spotbugs/spotbugs-exclude.xml @@ -1982,7 +1982,7 @@ - + diff --git a/sdk/appservice/mgmt/src/main/java/com/azure/resourcemanager/appservice/WebSiteManagementClient.java b/sdk/appservice/mgmt/src/main/java/com/azure/resourcemanager/appservice/WebSiteManagementClient.java index 0381c1d7c68c3..acd20cfc1cb4b 100644 --- a/sdk/appservice/mgmt/src/main/java/com/azure/resourcemanager/appservice/WebSiteManagementClient.java +++ b/sdk/appservice/mgmt/src/main/java/com/azure/resourcemanager/appservice/WebSiteManagementClient.java @@ -8,7 +8,6 @@ import com.azure.core.http.HttpPipeline; import com.azure.core.management.AzureEnvironment; import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.resources.fluentcore.AzureServiceClient; import com.azure.resourcemanager.appservice.fluent.AppServiceCertificateOrdersClient; import com.azure.resourcemanager.appservice.fluent.AppServiceEnvironmentsClient; import com.azure.resourcemanager.appservice.fluent.AppServicePlansClient; @@ -25,6 +24,7 @@ import com.azure.resourcemanager.appservice.fluent.StaticSitesClient; import com.azure.resourcemanager.appservice.fluent.TopLevelDomainsClient; import com.azure.resourcemanager.appservice.fluent.WebAppsClient; +import com.azure.resourcemanager.resources.fluentcore.AzureServiceClient; /** Initializes a new instance of the WebSiteManagementClient type. */ @ServiceClient(builder = WebSiteManagementClientBuilder.class) diff --git a/sdk/appservice/mgmt/src/main/java/com/azure/resourcemanager/appservice/fluent/AppServiceCertificateOrdersClient.java b/sdk/appservice/mgmt/src/main/java/com/azure/resourcemanager/appservice/fluent/AppServiceCertificateOrdersClient.java index 04a53826f5ce1..dc4b30792bf1d 100644 --- a/sdk/appservice/mgmt/src/main/java/com/azure/resourcemanager/appservice/fluent/AppServiceCertificateOrdersClient.java +++ b/sdk/appservice/mgmt/src/main/java/com/azure/resourcemanager/appservice/fluent/AppServiceCertificateOrdersClient.java @@ -31,6 +31,7 @@ import com.azure.core.util.FluxUtil; import com.azure.core.util.logging.ClientLogger; import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.appservice.WebSiteManagementClient; import com.azure.resourcemanager.appservice.fluent.inner.AppServiceCertificateCollectionInner; import com.azure.resourcemanager.appservice.fluent.inner.AppServiceCertificateOrderCollectionInner; @@ -373,37 +374,6 @@ Mono>> retrieveCertificateEmailHistory( @QueryParam("api-version") String apiVersion, Context context); - @Headers({"Accept: application/json", "Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.CertificateRegistration/certificateOrders/{certificateOrderName}") - @ExpectedResponses({200, 201}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> beginCreateOrUpdateWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("certificateOrderName") String certificateOrderName, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") AppServiceCertificateOrderInner certificateDistinguishedName, - Context context); - - @Headers({"Accept: application/json", "Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.CertificateRegistration/certificateOrders/{certificateOrderName}/certificates/{name}") - @ExpectedResponses({200, 201}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> beginCreateOrUpdateCertificateWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("certificateOrderName") String certificateOrderName, - @PathParam("name") String name, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") AppServiceCertificateResourceInner keyVaultCertificate, - Context context); - @Headers({"Accept: application/json", "Content-Type: application/json"}) @Get("{nextLink}") @ExpectedResponses({200}) @@ -491,6 +461,7 @@ public Mono> listSinglePageAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .list(this.client.getEndpoint(), this.client.getSubscriptionId(), this.client.getApiVersion(), context) .map( @@ -634,6 +605,7 @@ public Mono> validatePurchaseInformationWithResponseAsync( } else { appServiceCertificateOrder.validate(); } + context = this.client.mergeContext(context); return service .validatePurchaseInformation( this.client.getEndpoint(), @@ -782,6 +754,7 @@ public Mono> listByResourceGroupS new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listByResourceGroup( this.client.getEndpoint(), @@ -945,6 +918,7 @@ public Mono> getByResourceGroupWithRes new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getByResourceGroup( this.client.getEndpoint(), @@ -1141,6 +1115,7 @@ public Mono>> createOrUpdateWithResponseAsync( } else { certificateDistinguishedName.validate(); } + context = this.client.mergeContext(context); return service .createOrUpdate( this.client.getEndpoint(), @@ -1164,10 +1139,11 @@ public Mono>> createOrUpdateWithResponseAsync( * @return sSL certificate purchase order. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, AppServiceCertificateOrderInner> beginCreateOrUpdate( - String resourceGroupName, - String certificateOrderName, - AppServiceCertificateOrderInner certificateDistinguishedName) { + public PollerFlux, AppServiceCertificateOrderInner> + beginCreateOrUpdateAsync( + String resourceGroupName, + String certificateOrderName, + AppServiceCertificateOrderInner certificateDistinguishedName) { Mono>> mono = createOrUpdateWithResponseAsync(resourceGroupName, certificateOrderName, certificateDistinguishedName); return this @@ -1192,11 +1168,12 @@ public PollerFlux, AppServiceCertifi * @return sSL certificate purchase order. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, AppServiceCertificateOrderInner> beginCreateOrUpdate( - String resourceGroupName, - String certificateOrderName, - AppServiceCertificateOrderInner certificateDistinguishedName, - Context context) { + public PollerFlux, AppServiceCertificateOrderInner> + beginCreateOrUpdateAsync( + String resourceGroupName, + String certificateOrderName, + AppServiceCertificateOrderInner certificateDistinguishedName, + Context context) { Mono>> mono = createOrUpdateWithResponseAsync( resourceGroupName, certificateOrderName, certificateDistinguishedName, context); @@ -1209,6 +1186,48 @@ public PollerFlux, AppServiceCertifi AppServiceCertificateOrderInner.class); } + /** + * Description for Create or update a certificate purchase order. + * + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param certificateOrderName Name of the certificate order. + * @param certificateDistinguishedName SSL certificate purchase order. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sSL certificate purchase order. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, AppServiceCertificateOrderInner> beginCreateOrUpdate( + String resourceGroupName, + String certificateOrderName, + AppServiceCertificateOrderInner certificateDistinguishedName) { + return beginCreateOrUpdateAsync(resourceGroupName, certificateOrderName, certificateDistinguishedName) + .getSyncPoller(); + } + + /** + * Description for Create or update a certificate purchase order. + * + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param certificateOrderName Name of the certificate order. + * @param certificateDistinguishedName SSL certificate purchase order. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sSL certificate purchase order. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, AppServiceCertificateOrderInner> beginCreateOrUpdate( + String resourceGroupName, + String certificateOrderName, + AppServiceCertificateOrderInner certificateDistinguishedName, + Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, certificateOrderName, certificateDistinguishedName, context) + .getSyncPoller(); + } + /** * Description for Create or update a certificate purchase order. * @@ -1225,17 +1244,9 @@ public Mono createOrUpdateAsync( String resourceGroupName, String certificateOrderName, AppServiceCertificateOrderInner certificateDistinguishedName) { - Mono>> mono = - createOrUpdateWithResponseAsync(resourceGroupName, certificateOrderName, certificateDistinguishedName); - return this - .client - .getLroResultAsync( - mono, - this.client.getHttpPipeline(), - AppServiceCertificateOrderInner.class, - AppServiceCertificateOrderInner.class) + return beginCreateOrUpdateAsync(resourceGroupName, certificateOrderName, certificateDistinguishedName) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -1256,18 +1267,9 @@ public Mono createOrUpdateAsync( String certificateOrderName, AppServiceCertificateOrderInner certificateDistinguishedName, Context context) { - Mono>> mono = - createOrUpdateWithResponseAsync( - resourceGroupName, certificateOrderName, certificateDistinguishedName, context); - return this - .client - .getLroResultAsync( - mono, - this.client.getHttpPipeline(), - AppServiceCertificateOrderInner.class, - AppServiceCertificateOrderInner.class) + return beginCreateOrUpdateAsync(resourceGroupName, certificateOrderName, certificateDistinguishedName, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -1391,6 +1393,7 @@ public Mono> deleteWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .delete( this.client.getEndpoint(), @@ -1568,6 +1571,7 @@ public Mono> updateWithResponseAsync( } else { certificateDistinguishedName.validate(); } + context = this.client.mergeContext(context); return service .update( this.client.getEndpoint(), @@ -1765,6 +1769,7 @@ public Mono> listCertificatesS new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listCertificates( this.client.getEndpoint(), @@ -1944,6 +1949,7 @@ public Mono> getCertificateWithResp new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getCertificate( this.client.getEndpoint(), @@ -2153,6 +2159,7 @@ public Mono>> createOrUpdateCertificateWithResponseAsy } else { keyVaultCertificate.validate(); } + context = this.client.mergeContext(context); return service .createOrUpdateCertificate( this.client.getEndpoint(), @@ -2179,7 +2186,7 @@ public Mono>> createOrUpdateCertificateWithResponseAsy */ @ServiceMethod(returns = ReturnType.SINGLE) public PollerFlux, AppServiceCertificateResourceInner> - beginCreateOrUpdateCertificate( + beginCreateOrUpdateCertificateAsync( String resourceGroupName, String certificateOrderName, String name, @@ -2211,7 +2218,7 @@ public Mono>> createOrUpdateCertificateWithResponseAsy */ @ServiceMethod(returns = ReturnType.SINGLE) public PollerFlux, AppServiceCertificateResourceInner> - beginCreateOrUpdateCertificate( + beginCreateOrUpdateCertificateAsync( String resourceGroupName, String certificateOrderName, String name, @@ -2229,6 +2236,55 @@ public Mono>> createOrUpdateCertificateWithResponseAsy AppServiceCertificateResourceInner.class); } + /** + * Description for Creates or updates a certificate and associates with key vault secret. + * + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param certificateOrderName Name of the certificate order. + * @param name Name of the certificate. + * @param keyVaultCertificate Key Vault container ARM resource for a certificate that is purchased through Azure. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return key Vault container ARM resource for a certificate that is purchased through Azure. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, AppServiceCertificateResourceInner> + beginCreateOrUpdateCertificate( + String resourceGroupName, + String certificateOrderName, + String name, + AppServiceCertificateResourceInner keyVaultCertificate) { + return beginCreateOrUpdateCertificateAsync(resourceGroupName, certificateOrderName, name, keyVaultCertificate) + .getSyncPoller(); + } + + /** + * Description for Creates or updates a certificate and associates with key vault secret. + * + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param certificateOrderName Name of the certificate order. + * @param name Name of the certificate. + * @param keyVaultCertificate Key Vault container ARM resource for a certificate that is purchased through Azure. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return key Vault container ARM resource for a certificate that is purchased through Azure. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, AppServiceCertificateResourceInner> + beginCreateOrUpdateCertificate( + String resourceGroupName, + String certificateOrderName, + String name, + AppServiceCertificateResourceInner keyVaultCertificate, + Context context) { + return beginCreateOrUpdateCertificateAsync( + resourceGroupName, certificateOrderName, name, keyVaultCertificate, context) + .getSyncPoller(); + } + /** * Description for Creates or updates a certificate and associates with key vault secret. * @@ -2247,18 +2303,9 @@ public Mono createOrUpdateCertificateAsync( String certificateOrderName, String name, AppServiceCertificateResourceInner keyVaultCertificate) { - Mono>> mono = - createOrUpdateCertificateWithResponseAsync( - resourceGroupName, certificateOrderName, name, keyVaultCertificate); - return this - .client - .getLroResultAsync( - mono, - this.client.getHttpPipeline(), - AppServiceCertificateResourceInner.class, - AppServiceCertificateResourceInner.class) + return beginCreateOrUpdateCertificateAsync(resourceGroupName, certificateOrderName, name, keyVaultCertificate) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -2281,18 +2328,10 @@ public Mono createOrUpdateCertificateAsync( String name, AppServiceCertificateResourceInner keyVaultCertificate, Context context) { - Mono>> mono = - createOrUpdateCertificateWithResponseAsync( - resourceGroupName, certificateOrderName, name, keyVaultCertificate, context); - return this - .client - .getLroResultAsync( - mono, - this.client.getHttpPipeline(), - AppServiceCertificateResourceInner.class, - AppServiceCertificateResourceInner.class) + return beginCreateOrUpdateCertificateAsync( + resourceGroupName, certificateOrderName, name, keyVaultCertificate, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -2432,6 +2471,7 @@ public Mono> deleteCertificateWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .deleteCertificate( this.client.getEndpoint(), @@ -2622,6 +2662,7 @@ public Mono> updateCertificateWithR } else { keyVaultCertificate.validate(); } + context = this.client.mergeContext(context); return service .updateCertificate( this.client.getEndpoint(), @@ -2845,6 +2886,7 @@ public Mono> reissueWithResponseAsync( } else { reissueCertificateOrderRequest.validate(); } + context = this.client.mergeContext(context); return service .reissue( this.client.getEndpoint(), @@ -3042,6 +3084,7 @@ public Mono> renewWithResponseAsync( } else { renewCertificateOrderRequest.validate(); } + context = this.client.mergeContext(context); return service .renew( this.client.getEndpoint(), @@ -3213,6 +3256,7 @@ public Mono> resendEmailWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .resendEmail( this.client.getEndpoint(), @@ -3373,6 +3417,7 @@ public Mono> resendRequestEmailsWithResponseAsync( } NameIdentifierInner nameIdentifier = new NameIdentifierInner(); nameIdentifier.withName(name); + context = this.client.mergeContext(context); return service .resendRequestEmails( this.client.getEndpoint(), @@ -3548,6 +3593,7 @@ public Mono> retrieveSiteSealWithResponseAsync( } else { siteSealRequest.validate(); } + context = this.client.mergeContext(context); return service .retrieveSiteSeal( this.client.getEndpoint(), @@ -3726,6 +3772,7 @@ public Mono> verifyDomainOwnershipWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .verifyDomainOwnership( this.client.getEndpoint(), @@ -3878,6 +3925,7 @@ public Mono>> retrieveCertificateActi new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .retrieveCertificateActions( this.client.getEndpoint(), @@ -4048,6 +4096,7 @@ public Mono>> retrieveCertificateEmailHisto new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .retrieveCertificateEmailHistory( this.client.getEndpoint(), @@ -4139,460 +4188,6 @@ public List retrieveCertificateEmailHistory( return retrieveCertificateEmailHistoryAsync(resourceGroupName, name, context).block(); } - /** - * Description for Create or update a certificate purchase order. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param certificateOrderName Name of the certificate order. - * @param certificateDistinguishedName SSL certificate purchase order. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return sSL certificate purchase order. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginCreateOrUpdateWithoutPollingWithResponseAsync( - String resourceGroupName, - String certificateOrderName, - AppServiceCertificateOrderInner certificateDistinguishedName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (certificateOrderName == null) { - return Mono - .error(new IllegalArgumentException("Parameter certificateOrderName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (certificateDistinguishedName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter certificateDistinguishedName is required and cannot be null.")); - } else { - certificateDistinguishedName.validate(); - } - return FluxUtil - .withContext( - context -> - service - .beginCreateOrUpdateWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - certificateOrderName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - certificateDistinguishedName, - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Description for Create or update a certificate purchase order. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param certificateOrderName Name of the certificate order. - * @param certificateDistinguishedName SSL certificate purchase order. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return sSL certificate purchase order. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginCreateOrUpdateWithoutPollingWithResponseAsync( - String resourceGroupName, - String certificateOrderName, - AppServiceCertificateOrderInner certificateDistinguishedName, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (certificateOrderName == null) { - return Mono - .error(new IllegalArgumentException("Parameter certificateOrderName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (certificateDistinguishedName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter certificateDistinguishedName is required and cannot be null.")); - } else { - certificateDistinguishedName.validate(); - } - return service - .beginCreateOrUpdateWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - certificateOrderName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - certificateDistinguishedName, - context); - } - - /** - * Description for Create or update a certificate purchase order. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param certificateOrderName Name of the certificate order. - * @param certificateDistinguishedName SSL certificate purchase order. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return sSL certificate purchase order. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginCreateOrUpdateWithoutPollingAsync( - String resourceGroupName, - String certificateOrderName, - AppServiceCertificateOrderInner certificateDistinguishedName) { - return beginCreateOrUpdateWithoutPollingWithResponseAsync( - resourceGroupName, certificateOrderName, certificateDistinguishedName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Description for Create or update a certificate purchase order. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param certificateOrderName Name of the certificate order. - * @param certificateDistinguishedName SSL certificate purchase order. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return sSL certificate purchase order. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginCreateOrUpdateWithoutPollingAsync( - String resourceGroupName, - String certificateOrderName, - AppServiceCertificateOrderInner certificateDistinguishedName, - Context context) { - return beginCreateOrUpdateWithoutPollingWithResponseAsync( - resourceGroupName, certificateOrderName, certificateDistinguishedName, context) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Description for Create or update a certificate purchase order. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param certificateOrderName Name of the certificate order. - * @param certificateDistinguishedName SSL certificate purchase order. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return sSL certificate purchase order. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public AppServiceCertificateOrderInner beginCreateOrUpdateWithoutPolling( - String resourceGroupName, - String certificateOrderName, - AppServiceCertificateOrderInner certificateDistinguishedName) { - return beginCreateOrUpdateWithoutPollingAsync( - resourceGroupName, certificateOrderName, certificateDistinguishedName) - .block(); - } - - /** - * Description for Create or update a certificate purchase order. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param certificateOrderName Name of the certificate order. - * @param certificateDistinguishedName SSL certificate purchase order. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return sSL certificate purchase order. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public AppServiceCertificateOrderInner beginCreateOrUpdateWithoutPolling( - String resourceGroupName, - String certificateOrderName, - AppServiceCertificateOrderInner certificateDistinguishedName, - Context context) { - return beginCreateOrUpdateWithoutPollingAsync( - resourceGroupName, certificateOrderName, certificateDistinguishedName, context) - .block(); - } - - /** - * Description for Creates or updates a certificate and associates with key vault secret. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param certificateOrderName Name of the certificate order. - * @param name Name of the certificate. - * @param keyVaultCertificate Key Vault container ARM resource for a certificate that is purchased through Azure. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return key Vault container ARM resource for a certificate that is purchased through Azure. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> - beginCreateOrUpdateCertificateWithoutPollingWithResponseAsync( - String resourceGroupName, - String certificateOrderName, - String name, - AppServiceCertificateResourceInner keyVaultCertificate) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (certificateOrderName == null) { - return Mono - .error(new IllegalArgumentException("Parameter certificateOrderName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (keyVaultCertificate == null) { - return Mono - .error(new IllegalArgumentException("Parameter keyVaultCertificate is required and cannot be null.")); - } else { - keyVaultCertificate.validate(); - } - return FluxUtil - .withContext( - context -> - service - .beginCreateOrUpdateCertificateWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - certificateOrderName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - keyVaultCertificate, - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Description for Creates or updates a certificate and associates with key vault secret. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param certificateOrderName Name of the certificate order. - * @param name Name of the certificate. - * @param keyVaultCertificate Key Vault container ARM resource for a certificate that is purchased through Azure. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return key Vault container ARM resource for a certificate that is purchased through Azure. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> - beginCreateOrUpdateCertificateWithoutPollingWithResponseAsync( - String resourceGroupName, - String certificateOrderName, - String name, - AppServiceCertificateResourceInner keyVaultCertificate, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (certificateOrderName == null) { - return Mono - .error(new IllegalArgumentException("Parameter certificateOrderName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (keyVaultCertificate == null) { - return Mono - .error(new IllegalArgumentException("Parameter keyVaultCertificate is required and cannot be null.")); - } else { - keyVaultCertificate.validate(); - } - return service - .beginCreateOrUpdateCertificateWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - certificateOrderName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - keyVaultCertificate, - context); - } - - /** - * Description for Creates or updates a certificate and associates with key vault secret. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param certificateOrderName Name of the certificate order. - * @param name Name of the certificate. - * @param keyVaultCertificate Key Vault container ARM resource for a certificate that is purchased through Azure. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return key Vault container ARM resource for a certificate that is purchased through Azure. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginCreateOrUpdateCertificateWithoutPollingAsync( - String resourceGroupName, - String certificateOrderName, - String name, - AppServiceCertificateResourceInner keyVaultCertificate) { - return beginCreateOrUpdateCertificateWithoutPollingWithResponseAsync( - resourceGroupName, certificateOrderName, name, keyVaultCertificate) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Description for Creates or updates a certificate and associates with key vault secret. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param certificateOrderName Name of the certificate order. - * @param name Name of the certificate. - * @param keyVaultCertificate Key Vault container ARM resource for a certificate that is purchased through Azure. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return key Vault container ARM resource for a certificate that is purchased through Azure. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginCreateOrUpdateCertificateWithoutPollingAsync( - String resourceGroupName, - String certificateOrderName, - String name, - AppServiceCertificateResourceInner keyVaultCertificate, - Context context) { - return beginCreateOrUpdateCertificateWithoutPollingWithResponseAsync( - resourceGroupName, certificateOrderName, name, keyVaultCertificate, context) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Description for Creates or updates a certificate and associates with key vault secret. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param certificateOrderName Name of the certificate order. - * @param name Name of the certificate. - * @param keyVaultCertificate Key Vault container ARM resource for a certificate that is purchased through Azure. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return key Vault container ARM resource for a certificate that is purchased through Azure. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public AppServiceCertificateResourceInner beginCreateOrUpdateCertificateWithoutPolling( - String resourceGroupName, - String certificateOrderName, - String name, - AppServiceCertificateResourceInner keyVaultCertificate) { - return beginCreateOrUpdateCertificateWithoutPollingAsync( - resourceGroupName, certificateOrderName, name, keyVaultCertificate) - .block(); - } - - /** - * Description for Creates or updates a certificate and associates with key vault secret. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param certificateOrderName Name of the certificate order. - * @param name Name of the certificate. - * @param keyVaultCertificate Key Vault container ARM resource for a certificate that is purchased through Azure. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return key Vault container ARM resource for a certificate that is purchased through Azure. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public AppServiceCertificateResourceInner beginCreateOrUpdateCertificateWithoutPolling( - String resourceGroupName, - String certificateOrderName, - String name, - AppServiceCertificateResourceInner keyVaultCertificate, - Context context) { - return beginCreateOrUpdateCertificateWithoutPollingAsync( - resourceGroupName, certificateOrderName, name, keyVaultCertificate, context) - .block(); - } - /** * Get the next page of items. * @@ -4637,6 +4232,7 @@ public Mono> listNextSinglePageAs if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listNext(nextLink, context) .map( @@ -4695,6 +4291,7 @@ public Mono> listByResourceGroupN if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listByResourceGroupNext(nextLink, context) .map( @@ -4753,6 +4350,7 @@ public Mono> listCertificatesN if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listCertificatesNext(nextLink, context) .map( diff --git a/sdk/appservice/mgmt/src/main/java/com/azure/resourcemanager/appservice/fluent/AppServiceEnvironmentsClient.java b/sdk/appservice/mgmt/src/main/java/com/azure/resourcemanager/appservice/fluent/AppServiceEnvironmentsClient.java index 7550af44f5784..0d53862c1ab51 100644 --- a/sdk/appservice/mgmt/src/main/java/com/azure/resourcemanager/appservice/fluent/AppServiceEnvironmentsClient.java +++ b/sdk/appservice/mgmt/src/main/java/com/azure/resourcemanager/appservice/fluent/AppServiceEnvironmentsClient.java @@ -31,6 +31,7 @@ import com.azure.core.util.FluxUtil; import com.azure.core.util.logging.ClientLogger; import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.appservice.WebSiteManagementClient; import com.azure.resourcemanager.appservice.fluent.inner.AddressResponseInner; import com.azure.resourcemanager.appservice.fluent.inner.AppServiceEnvironmentCollectionInner; @@ -619,110 +620,6 @@ Mono> listWebWorkerUsages( @QueryParam("api-version") String apiVersion, Context context); - @Headers({"Accept: application/json", "Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web" - + "/hostingEnvironments/{name}") - @ExpectedResponses({200, 201, 202}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> beginCreateOrUpdateWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") AppServiceEnvironmentResourceInner hostingEnvironmentEnvelope, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web" - + "/hostingEnvironments/{name}") - @ExpectedResponses({202, 204}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> beginDeleteWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @QueryParam("forceDelete") Boolean forceDelete, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - Context context); - - @Headers({"Accept: application/json", "Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web" - + "/hostingEnvironments/{name}/changeVirtualNetwork") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> beginChangeVnetWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") VirtualNetworkProfile vnetInfo, - Context context); - - @Headers({"Accept: application/json", "Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web" - + "/hostingEnvironments/{name}/multiRolePools/default") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> beginCreateOrUpdateMultiRolePoolWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") WorkerPoolResourceInner multiRolePoolEnvelope, - Context context); - - @Headers({"Accept: application/json", "Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web" - + "/hostingEnvironments/{name}/resume") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> beginResumeWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - Context context); - - @Headers({"Accept: application/json", "Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web" - + "/hostingEnvironments/{name}/suspend") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> beginSuspendWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - Context context); - - @Headers({"Accept: application/json", "Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web" - + "/hostingEnvironments/{name}/workerPools/{workerPoolName}") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> beginCreateOrUpdateWorkerPoolWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("workerPoolName") String workerPoolName, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") WorkerPoolResourceInner workerPoolEnvelope, - Context context); - @Headers({"Accept: application/json", "Content-Type: application/json"}) @Get("{nextLink}") @ExpectedResponses({200}) @@ -744,6 +641,13 @@ Mono> listByResourceGroupNext( Mono> listCapacitiesNext( @PathParam(value = "nextLink", encoded = true) String nextLink, Context context); + @Headers({"Accept: application/json", "Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) + Mono> changeVnetNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, Context context); + @Headers({"Accept: application/json", "Content-Type: application/json"}) @Get("{nextLink}") @ExpectedResponses({200}) @@ -793,6 +697,13 @@ Mono> listMultiRoleUsagesNext( Mono> getOutboundNetworkDependenciesEndpointsNext( @PathParam(value = "nextLink", encoded = true) String nextLink, Context context); + @Headers({"Accept: application/json", "Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) + Mono> resumeNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, Context context); + @Headers({"Accept: application/json", "Content-Type: application/json"}) @Get("{nextLink}") @ExpectedResponses({200}) @@ -807,6 +718,13 @@ Mono> listAppServicePlansNext( Mono> listWebAppsNext( @PathParam(value = "nextLink", encoded = true) String nextLink, Context context); + @Headers({"Accept: application/json", "Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) + Mono> suspendNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, Context context); + @Headers({"Accept: application/json", "Content-Type: application/json"}) @Get("{nextLink}") @ExpectedResponses({200}) @@ -915,6 +833,7 @@ public Mono> listSinglePageAsy new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .list(this.client.getEndpoint(), this.client.getSubscriptionId(), this.client.getApiVersion(), context) .map( @@ -1059,6 +978,7 @@ public Mono> listByResourceGro new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listByResourceGroup( this.client.getEndpoint(), @@ -1220,6 +1140,7 @@ public Mono> getByResourceGroupWith new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getByResourceGroup( this.client.getEndpoint(), @@ -1411,6 +1332,7 @@ public Mono>> createOrUpdateWithResponseAsync( } else { hostingEnvironmentEnvelope.validate(); } + context = this.client.mergeContext(context); return service .createOrUpdate( this.client.getEndpoint(), @@ -1435,7 +1357,7 @@ public Mono>> createOrUpdateWithResponseAsync( */ @ServiceMethod(returns = ReturnType.SINGLE) public PollerFlux, AppServiceEnvironmentResourceInner> - beginCreateOrUpdate( + beginCreateOrUpdateAsync( String resourceGroupName, String name, AppServiceEnvironmentResourceInner hostingEnvironmentEnvelope) { Mono>> mono = createOrUpdateWithResponseAsync(resourceGroupName, name, hostingEnvironmentEnvelope); @@ -1462,7 +1384,7 @@ public Mono>> createOrUpdateWithResponseAsync( */ @ServiceMethod(returns = ReturnType.SINGLE) public PollerFlux, AppServiceEnvironmentResourceInner> - beginCreateOrUpdate( + beginCreateOrUpdateAsync( String resourceGroupName, String name, AppServiceEnvironmentResourceInner hostingEnvironmentEnvelope, @@ -1478,6 +1400,46 @@ public Mono>> createOrUpdateWithResponseAsync( AppServiceEnvironmentResourceInner.class); } + /** + * Description for Create or update an App Service Environment. + * + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the App Service Environment. + * @param hostingEnvironmentEnvelope App Service Environment ARM resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return app Service Environment ARM resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, AppServiceEnvironmentResourceInner> + beginCreateOrUpdate( + String resourceGroupName, String name, AppServiceEnvironmentResourceInner hostingEnvironmentEnvelope) { + return beginCreateOrUpdateAsync(resourceGroupName, name, hostingEnvironmentEnvelope).getSyncPoller(); + } + + /** + * Description for Create or update an App Service Environment. + * + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the App Service Environment. + * @param hostingEnvironmentEnvelope App Service Environment ARM resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return app Service Environment ARM resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, AppServiceEnvironmentResourceInner> + beginCreateOrUpdate( + String resourceGroupName, + String name, + AppServiceEnvironmentResourceInner hostingEnvironmentEnvelope, + Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, name, hostingEnvironmentEnvelope, context).getSyncPoller(); + } + /** * Description for Create or update an App Service Environment. * @@ -1492,17 +1454,9 @@ public Mono>> createOrUpdateWithResponseAsync( @ServiceMethod(returns = ReturnType.SINGLE) public Mono createOrUpdateAsync( String resourceGroupName, String name, AppServiceEnvironmentResourceInner hostingEnvironmentEnvelope) { - Mono>> mono = - createOrUpdateWithResponseAsync(resourceGroupName, name, hostingEnvironmentEnvelope); - return this - .client - .getLroResultAsync( - mono, - this.client.getHttpPipeline(), - AppServiceEnvironmentResourceInner.class, - AppServiceEnvironmentResourceInner.class) + return beginCreateOrUpdateAsync(resourceGroupName, name, hostingEnvironmentEnvelope) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -1523,17 +1477,9 @@ public Mono createOrUpdateAsync( String name, AppServiceEnvironmentResourceInner hostingEnvironmentEnvelope, Context context) { - Mono>> mono = - createOrUpdateWithResponseAsync(resourceGroupName, name, hostingEnvironmentEnvelope, context); - return this - .client - .getLroResultAsync( - mono, - this.client.getHttpPipeline(), - AppServiceEnvironmentResourceInner.class, - AppServiceEnvironmentResourceInner.class) + return beginCreateOrUpdateAsync(resourceGroupName, name, hostingEnvironmentEnvelope, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -1658,6 +1604,7 @@ public Mono>> deleteWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .delete( this.client.getEndpoint(), @@ -1682,7 +1629,8 @@ public Mono>> deleteWithResponseAsync( * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, Void> beginDelete(String resourceGroupName, String name, Boolean forceDelete) { + public PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String name, Boolean forceDelete) { Mono>> mono = deleteWithResponseAsync(resourceGroupName, name, forceDelete); return this.client.getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class); } @@ -1701,12 +1649,48 @@ public PollerFlux, Void> beginDelete(String resourceGroupName, * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, Void> beginDelete( + public PollerFlux, Void> beginDeleteAsync( String resourceGroupName, String name, Boolean forceDelete, Context context) { Mono>> mono = deleteWithResponseAsync(resourceGroupName, name, forceDelete, context); return this.client.getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class); } + /** + * Description for Delete an App Service Environment. + * + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the App Service Environment. + * @param forceDelete Specify <code>true</code> to force the deletion even if the App Service + * Environment contains resources. The default is <code>false</code>. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name, Boolean forceDelete) { + return beginDeleteAsync(resourceGroupName, name, forceDelete).getSyncPoller(); + } + + /** + * Description for Delete an App Service Environment. + * + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the App Service Environment. + * @param forceDelete Specify <code>true</code> to force the deletion even if the App Service + * Environment contains resources. The default is <code>false</code>. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String name, Boolean forceDelete, Context context) { + return beginDeleteAsync(resourceGroupName, name, forceDelete, context).getSyncPoller(); + } + /** * Description for Delete an App Service Environment. * @@ -1721,12 +1705,9 @@ public PollerFlux, Void> beginDelete( */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono deleteAsync(String resourceGroupName, String name, Boolean forceDelete) { - Mono>> mono = deleteWithResponseAsync(resourceGroupName, name, forceDelete); - return this - .client - .getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class) + return beginDeleteAsync(resourceGroupName, name, forceDelete) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -1744,12 +1725,9 @@ public Mono deleteAsync(String resourceGroupName, String name, Boolean for */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono deleteAsync(String resourceGroupName, String name, Boolean forceDelete, Context context) { - Mono>> mono = deleteWithResponseAsync(resourceGroupName, name, forceDelete, context); - return this - .client - .getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class) + return beginDeleteAsync(resourceGroupName, name, forceDelete, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -1766,12 +1744,9 @@ public Mono deleteAsync(String resourceGroupName, String name, Boolean for public Mono deleteAsync(String resourceGroupName, String name) { final Boolean forceDelete = null; final Context context = null; - Mono>> mono = deleteWithResponseAsync(resourceGroupName, name, forceDelete); - return this - .client - .getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class) + return beginDeleteAsync(resourceGroupName, name, forceDelete) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -1924,6 +1899,7 @@ public Mono> updateWithResponseAsyn } else { hostingEnvironmentEnvelope.validate(); } + context = this.client.mergeContext(context); return service .update( this.client.getEndpoint(), @@ -2115,6 +2091,7 @@ public Mono> listCapacitiesSinglePageAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listCapacities( this.client.getEndpoint(), @@ -2278,6 +2255,7 @@ public Mono> getVipInfoWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getVipInfo( this.client.getEndpoint(), @@ -2378,7 +2356,7 @@ public AddressResponseInner getVipInfo(String resourceGroupName, String name, Co * @return collection of App Service apps. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> changeVnetWithResponseAsync( + public Mono> changeVnetSinglePageAsync( String resourceGroupName, String name, VirtualNetworkProfile vnetInfo) { if (this.client.getEndpoint() == null) { return Mono @@ -2406,16 +2384,40 @@ public Mono>> changeVnetWithResponseAsync( } return FluxUtil .withContext( - context -> - service - .changeVnet( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - vnetInfo, - context)) + context -> { + Mono>> mono = + service + .changeVnet( + this.client.getEndpoint(), + resourceGroupName, + name, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + vnetInfo, + context) + .cache(); + return Mono + .zip( + mono, + this + .client + .getLroResultAsync( + mono, + this.client.getHttpPipeline(), + WebAppCollectionInner.class, + WebAppCollectionInner.class) + .last() + .flatMap(this.client::getLroFinalResultOrError)); + }) + .>map( + res -> + new PagedResponseBase<>( + res.getT1().getRequest(), + res.getT1().getStatusCode(), + res.getT1().getHeaders(), + res.getT2().value(), + res.getT2().nextLink(), + null)) .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); } @@ -2432,7 +2434,7 @@ public Mono>> changeVnetWithResponseAsync( * @return collection of App Service apps. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> changeVnetWithResponseAsync( + public Mono> changeVnetSinglePageAsync( String resourceGroupName, String name, VirtualNetworkProfile vnetInfo, Context context) { if (this.client.getEndpoint() == null) { return Mono @@ -2458,15 +2460,36 @@ public Mono>> changeVnetWithResponseAsync( } else { vnetInfo.validate(); } - return service - .changeVnet( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - vnetInfo, - context); + context = this.client.mergeContext(context); + Mono>> mono = + service + .changeVnet( + this.client.getEndpoint(), + resourceGroupName, + name, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + vnetInfo, + context) + .cache(); + return Mono + .zip( + mono, + this + .client + .getLroResultAsync( + mono, this.client.getHttpPipeline(), WebAppCollectionInner.class, WebAppCollectionInner.class) + .last() + .flatMap(this.client::getLroFinalResultOrError)) + .map( + res -> + new PagedResponseBase<>( + res.getT1().getRequest(), + res.getT1().getStatusCode(), + res.getT1().getHeaders(), + res.getT2().value(), + res.getT2().nextLink(), + null)); } /** @@ -2480,14 +2503,11 @@ public Mono>> changeVnetWithResponseAsync( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return collection of App Service apps. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, WebAppCollectionInner> beginChangeVnet( - String resourceGroupName, String name, VirtualNetworkProfile vnetInfo) { - Mono>> mono = changeVnetWithResponseAsync(resourceGroupName, name, vnetInfo); - return this - .client - .getLroResultAsync( - mono, this.client.getHttpPipeline(), WebAppCollectionInner.class, WebAppCollectionInner.class); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux changeVnetAsync(String resourceGroupName, String name, VirtualNetworkProfile vnetInfo) { + return new PagedFlux<>( + () -> changeVnetSinglePageAsync(resourceGroupName, name, vnetInfo), + nextLink -> changeVnetNextSinglePageAsync(nextLink)); } /** @@ -2502,14 +2522,12 @@ public PollerFlux, WebAppCollectionInner> begi * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return collection of App Service apps. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, WebAppCollectionInner> beginChangeVnet( + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux changeVnetAsync( String resourceGroupName, String name, VirtualNetworkProfile vnetInfo, Context context) { - Mono>> mono = changeVnetWithResponseAsync(resourceGroupName, name, vnetInfo, context); - return this - .client - .getLroResultAsync( - mono, this.client.getHttpPipeline(), WebAppCollectionInner.class, WebAppCollectionInner.class); + return new PagedFlux<>( + () -> changeVnetSinglePageAsync(resourceGroupName, name, vnetInfo, context), + nextLink -> changeVnetNextSinglePageAsync(nextLink)); } /** @@ -2523,16 +2541,9 @@ public PollerFlux, WebAppCollectionInner> begi * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return collection of App Service apps. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono changeVnetAsync( - String resourceGroupName, String name, VirtualNetworkProfile vnetInfo) { - Mono>> mono = changeVnetWithResponseAsync(resourceGroupName, name, vnetInfo); - return this - .client - .getLroResultAsync( - mono, this.client.getHttpPipeline(), WebAppCollectionInner.class, WebAppCollectionInner.class) - .last() - .flatMap(client::getLroFinalResultOrError); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable changeVnet(String resourceGroupName, String name, VirtualNetworkProfile vnetInfo) { + return new PagedIterable<>(changeVnetAsync(resourceGroupName, name, vnetInfo)); } /** @@ -2547,50 +2558,10 @@ public Mono changeVnetAsync( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return collection of App Service apps. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono changeVnetAsync( + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable changeVnet( String resourceGroupName, String name, VirtualNetworkProfile vnetInfo, Context context) { - Mono>> mono = changeVnetWithResponseAsync(resourceGroupName, name, vnetInfo, context); - return this - .client - .getLroResultAsync( - mono, this.client.getHttpPipeline(), WebAppCollectionInner.class, WebAppCollectionInner.class) - .last() - .flatMap(client::getLroFinalResultOrError); - } - - /** - * Description for Move an App Service Environment to a different VNET. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param vnetInfo Specification for using a Virtual Network. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of App Service apps. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public WebAppCollectionInner changeVnet(String resourceGroupName, String name, VirtualNetworkProfile vnetInfo) { - return changeVnetAsync(resourceGroupName, name, vnetInfo).block(); - } - - /** - * Description for Move an App Service Environment to a different VNET. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param vnetInfo Specification for using a Virtual Network. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of App Service apps. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public WebAppCollectionInner changeVnet( - String resourceGroupName, String name, VirtualNetworkProfile vnetInfo, Context context) { - return changeVnetAsync(resourceGroupName, name, vnetInfo, context).block(); + return new PagedIterable<>(changeVnetAsync(resourceGroupName, name, vnetInfo, context)); } /** @@ -2672,6 +2643,7 @@ public Mono>> listDiagnosticsW new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listDiagnostics( this.client.getEndpoint(), @@ -2852,6 +2824,7 @@ public Mono> getDiagnosticsItemWith new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getDiagnosticsItem( this.client.getEndpoint(), @@ -3037,6 +3010,7 @@ public Mono> getInboundNetworkDep new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getInboundNetworkDependenciesEndpoints( this.client.getEndpoint(), @@ -3214,6 +3188,7 @@ public Mono> listMultiRolePoolsSinglePage new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listMultiRolePools( this.client.getEndpoint(), @@ -3380,6 +3355,7 @@ public Mono> getMultiRolePoolWithResponseAsync new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getMultiRolePool( this.client.getEndpoint(), @@ -3562,6 +3538,7 @@ public Mono>> createOrUpdateMultiRolePoolWithResponseA } else { multiRolePoolEnvelope.validate(); } + context = this.client.mergeContext(context); return service .createOrUpdateMultiRolePool( this.client.getEndpoint(), @@ -3585,8 +3562,9 @@ public Mono>> createOrUpdateMultiRolePoolWithResponseA * @return worker pool of an App Service Environment ARM resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, WorkerPoolResourceInner> beginCreateOrUpdateMultiRolePool( - String resourceGroupName, String name, WorkerPoolResourceInner multiRolePoolEnvelope) { + public PollerFlux, WorkerPoolResourceInner> + beginCreateOrUpdateMultiRolePoolAsync( + String resourceGroupName, String name, WorkerPoolResourceInner multiRolePoolEnvelope) { Mono>> mono = createOrUpdateMultiRolePoolWithResponseAsync(resourceGroupName, name, multiRolePoolEnvelope); return this @@ -3608,8 +3586,9 @@ public PollerFlux, WorkerPoolResourceInner> * @return worker pool of an App Service Environment ARM resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, WorkerPoolResourceInner> beginCreateOrUpdateMultiRolePool( - String resourceGroupName, String name, WorkerPoolResourceInner multiRolePoolEnvelope, Context context) { + public PollerFlux, WorkerPoolResourceInner> + beginCreateOrUpdateMultiRolePoolAsync( + String resourceGroupName, String name, WorkerPoolResourceInner multiRolePoolEnvelope, Context context) { Mono>> mono = createOrUpdateMultiRolePoolWithResponseAsync(resourceGroupName, name, multiRolePoolEnvelope, context); return this @@ -3618,6 +3597,42 @@ public PollerFlux, WorkerPoolResourceInner> mono, this.client.getHttpPipeline(), WorkerPoolResourceInner.class, WorkerPoolResourceInner.class); } + /** + * Description for Create or update a multi-role pool. + * + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the App Service Environment. + * @param multiRolePoolEnvelope Worker pool of an App Service Environment ARM resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return worker pool of an App Service Environment ARM resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, WorkerPoolResourceInner> beginCreateOrUpdateMultiRolePool( + String resourceGroupName, String name, WorkerPoolResourceInner multiRolePoolEnvelope) { + return beginCreateOrUpdateMultiRolePoolAsync(resourceGroupName, name, multiRolePoolEnvelope).getSyncPoller(); + } + + /** + * Description for Create or update a multi-role pool. + * + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the App Service Environment. + * @param multiRolePoolEnvelope Worker pool of an App Service Environment ARM resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return worker pool of an App Service Environment ARM resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, WorkerPoolResourceInner> beginCreateOrUpdateMultiRolePool( + String resourceGroupName, String name, WorkerPoolResourceInner multiRolePoolEnvelope, Context context) { + return beginCreateOrUpdateMultiRolePoolAsync(resourceGroupName, name, multiRolePoolEnvelope, context) + .getSyncPoller(); + } + /** * Description for Create or update a multi-role pool. * @@ -3632,14 +3647,9 @@ public PollerFlux, WorkerPoolResourceInner> @ServiceMethod(returns = ReturnType.SINGLE) public Mono createOrUpdateMultiRolePoolAsync( String resourceGroupName, String name, WorkerPoolResourceInner multiRolePoolEnvelope) { - Mono>> mono = - createOrUpdateMultiRolePoolWithResponseAsync(resourceGroupName, name, multiRolePoolEnvelope); - return this - .client - .getLroResultAsync( - mono, this.client.getHttpPipeline(), WorkerPoolResourceInner.class, WorkerPoolResourceInner.class) + return beginCreateOrUpdateMultiRolePoolAsync(resourceGroupName, name, multiRolePoolEnvelope) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -3657,14 +3667,9 @@ public Mono createOrUpdateMultiRolePoolAsync( @ServiceMethod(returns = ReturnType.SINGLE) public Mono createOrUpdateMultiRolePoolAsync( String resourceGroupName, String name, WorkerPoolResourceInner multiRolePoolEnvelope, Context context) { - Mono>> mono = - createOrUpdateMultiRolePoolWithResponseAsync(resourceGroupName, name, multiRolePoolEnvelope, context); - return this - .client - .getLroResultAsync( - mono, this.client.getHttpPipeline(), WorkerPoolResourceInner.class, WorkerPoolResourceInner.class) + return beginCreateOrUpdateMultiRolePoolAsync(resourceGroupName, name, multiRolePoolEnvelope, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -3796,6 +3801,7 @@ public Mono> updateMultiRolePoolWithResponseAs } else { multiRolePoolEnvelope.validate(); } + context = this.client.mergeContext(context); return service .updateMultiRolePool( this.client.getEndpoint(), @@ -3992,6 +3998,7 @@ public Mono> listMultiRolePoolInsta new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listMultiRolePoolInstanceMetricDefinitions( this.client.getEndpoint(), @@ -4179,6 +4186,7 @@ public Mono> listMultiRoleMetricDef new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listMultiRoleMetricDefinitions( this.client.getEndpoint(), @@ -4356,6 +4364,7 @@ public Mono> listMultiRolePoolSkusSinglePageAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listMultiRolePoolSkus( this.client.getEndpoint(), @@ -4528,6 +4537,7 @@ public Mono> listMultiRoleUsagesSinglePageAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listMultiRoleUsages( this.client.getEndpoint(), @@ -4691,6 +4701,7 @@ public Mono>> listOperationsWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listOperations( this.client.getEndpoint(), @@ -4867,6 +4878,7 @@ public Mono> getOutboundNetworkD new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getOutboundNetworkDependenciesEndpoints( this.client.getEndpoint(), @@ -5033,6 +5045,7 @@ public Mono> rebootWithResponseAsync(String resourceGroupName, St new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .reboot( this.client.getEndpoint(), @@ -5114,7 +5127,7 @@ public void reboot(String resourceGroupName, String name, Context context) { * @return collection of App Service apps. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> resumeWithResponseAsync(String resourceGroupName, String name) { + public Mono> resumeSinglePageAsync(String resourceGroupName, String name) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -5136,15 +5149,39 @@ public Mono>> resumeWithResponseAsync(String resourceG } return FluxUtil .withContext( - context -> - service - .resume( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context)) + context -> { + Mono>> mono = + service + .resume( + this.client.getEndpoint(), + resourceGroupName, + name, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + context) + .cache(); + return Mono + .zip( + mono, + this + .client + .getLroResultAsync( + mono, + this.client.getHttpPipeline(), + WebAppCollectionInner.class, + WebAppCollectionInner.class) + .last() + .flatMap(this.client::getLroFinalResultOrError)); + }) + .>map( + res -> + new PagedResponseBase<>( + res.getT1().getRequest(), + res.getT1().getStatusCode(), + res.getT1().getHeaders(), + res.getT2().value(), + res.getT2().nextLink(), + null)) .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); } @@ -5160,7 +5197,7 @@ public Mono>> resumeWithResponseAsync(String resourceG * @return collection of App Service apps. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> resumeWithResponseAsync( + public Mono> resumeSinglePageAsync( String resourceGroupName, String name, Context context) { if (this.client.getEndpoint() == null) { return Mono @@ -5181,55 +5218,35 @@ public Mono>> resumeWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - return service - .resume( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context); - } - - /** - * Description for Resume an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of App Service apps. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, WebAppCollectionInner> beginResume( - String resourceGroupName, String name) { - Mono>> mono = resumeWithResponseAsync(resourceGroupName, name); - return this - .client - .getLroResultAsync( - mono, this.client.getHttpPipeline(), WebAppCollectionInner.class, WebAppCollectionInner.class); - } - - /** - * Description for Resume an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of App Service apps. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, WebAppCollectionInner> beginResume( - String resourceGroupName, String name, Context context) { - Mono>> mono = resumeWithResponseAsync(resourceGroupName, name, context); - return this - .client - .getLroResultAsync( - mono, this.client.getHttpPipeline(), WebAppCollectionInner.class, WebAppCollectionInner.class); + context = this.client.mergeContext(context); + Mono>> mono = + service + .resume( + this.client.getEndpoint(), + resourceGroupName, + name, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + context) + .cache(); + return Mono + .zip( + mono, + this + .client + .getLroResultAsync( + mono, this.client.getHttpPipeline(), WebAppCollectionInner.class, WebAppCollectionInner.class) + .last() + .flatMap(this.client::getLroFinalResultOrError)) + .map( + res -> + new PagedResponseBase<>( + res.getT1().getRequest(), + res.getT1().getStatusCode(), + res.getT1().getHeaders(), + res.getT2().value(), + res.getT2().nextLink(), + null)); } /** @@ -5242,15 +5259,10 @@ public PollerFlux, WebAppCollectionInner> begi * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return collection of App Service apps. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono resumeAsync(String resourceGroupName, String name) { - Mono>> mono = resumeWithResponseAsync(resourceGroupName, name); - return this - .client - .getLroResultAsync( - mono, this.client.getHttpPipeline(), WebAppCollectionInner.class, WebAppCollectionInner.class) - .last() - .flatMap(client::getLroFinalResultOrError); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux resumeAsync(String resourceGroupName, String name) { + return new PagedFlux<>( + () -> resumeSinglePageAsync(resourceGroupName, name), nextLink -> resumeNextSinglePageAsync(nextLink)); } /** @@ -5264,15 +5276,11 @@ public Mono resumeAsync(String resourceGroupName, String * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return collection of App Service apps. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono resumeAsync(String resourceGroupName, String name, Context context) { - Mono>> mono = resumeWithResponseAsync(resourceGroupName, name, context); - return this - .client - .getLroResultAsync( - mono, this.client.getHttpPipeline(), WebAppCollectionInner.class, WebAppCollectionInner.class) - .last() - .flatMap(client::getLroFinalResultOrError); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux resumeAsync(String resourceGroupName, String name, Context context) { + return new PagedFlux<>( + () -> resumeSinglePageAsync(resourceGroupName, name, context), + nextLink -> resumeNextSinglePageAsync(nextLink)); } /** @@ -5285,9 +5293,9 @@ public Mono resumeAsync(String resourceGroupName, String * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return collection of App Service apps. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public WebAppCollectionInner resume(String resourceGroupName, String name) { - return resumeAsync(resourceGroupName, name).block(); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable resume(String resourceGroupName, String name) { + return new PagedIterable<>(resumeAsync(resourceGroupName, name)); } /** @@ -5301,9 +5309,9 @@ public WebAppCollectionInner resume(String resourceGroupName, String name) { * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return collection of App Service apps. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public WebAppCollectionInner resume(String resourceGroupName, String name, Context context) { - return resumeAsync(resourceGroupName, name, context).block(); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable resume(String resourceGroupName, String name, Context context) { + return new PagedIterable<>(resumeAsync(resourceGroupName, name, context)); } /** @@ -5394,6 +5402,7 @@ public Mono> listAppServicePlansSinglePageAsy new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listAppServicePlans( this.client.getEndpoint(), @@ -5572,6 +5581,7 @@ public Mono> listWebAppsSinglePageAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listWebApps( this.client.getEndpoint(), @@ -5711,7 +5721,7 @@ public PagedIterable listWebApps(String resourceGroupName, String nam * @return collection of App Service apps. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> suspendWithResponseAsync(String resourceGroupName, String name) { + public Mono> suspendSinglePageAsync(String resourceGroupName, String name) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -5733,15 +5743,39 @@ public Mono>> suspendWithResponseAsync(String resource } return FluxUtil .withContext( - context -> - service - .suspend( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context)) + context -> { + Mono>> mono = + service + .suspend( + this.client.getEndpoint(), + resourceGroupName, + name, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + context) + .cache(); + return Mono + .zip( + mono, + this + .client + .getLroResultAsync( + mono, + this.client.getHttpPipeline(), + WebAppCollectionInner.class, + WebAppCollectionInner.class) + .last() + .flatMap(this.client::getLroFinalResultOrError)); + }) + .>map( + res -> + new PagedResponseBase<>( + res.getT1().getRequest(), + res.getT1().getStatusCode(), + res.getT1().getHeaders(), + res.getT2().value(), + res.getT2().nextLink(), + null)) .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); } @@ -5757,7 +5791,7 @@ public Mono>> suspendWithResponseAsync(String resource * @return collection of App Service apps. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> suspendWithResponseAsync( + public Mono> suspendSinglePageAsync( String resourceGroupName, String name, Context context) { if (this.client.getEndpoint() == null) { return Mono @@ -5778,55 +5812,35 @@ public Mono>> suspendWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - return service - .suspend( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context); - } - - /** - * Description for Suspend an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of App Service apps. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, WebAppCollectionInner> beginSuspend( - String resourceGroupName, String name) { - Mono>> mono = suspendWithResponseAsync(resourceGroupName, name); - return this - .client - .getLroResultAsync( - mono, this.client.getHttpPipeline(), WebAppCollectionInner.class, WebAppCollectionInner.class); - } - - /** - * Description for Suspend an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of App Service apps. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, WebAppCollectionInner> beginSuspend( - String resourceGroupName, String name, Context context) { - Mono>> mono = suspendWithResponseAsync(resourceGroupName, name, context); - return this - .client - .getLroResultAsync( - mono, this.client.getHttpPipeline(), WebAppCollectionInner.class, WebAppCollectionInner.class); + context = this.client.mergeContext(context); + Mono>> mono = + service + .suspend( + this.client.getEndpoint(), + resourceGroupName, + name, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + context) + .cache(); + return Mono + .zip( + mono, + this + .client + .getLroResultAsync( + mono, this.client.getHttpPipeline(), WebAppCollectionInner.class, WebAppCollectionInner.class) + .last() + .flatMap(this.client::getLroFinalResultOrError)) + .map( + res -> + new PagedResponseBase<>( + res.getT1().getRequest(), + res.getT1().getStatusCode(), + res.getT1().getHeaders(), + res.getT2().value(), + res.getT2().nextLink(), + null)); } /** @@ -5839,15 +5853,10 @@ public PollerFlux, WebAppCollectionInner> begi * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return collection of App Service apps. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono suspendAsync(String resourceGroupName, String name) { - Mono>> mono = suspendWithResponseAsync(resourceGroupName, name); - return this - .client - .getLroResultAsync( - mono, this.client.getHttpPipeline(), WebAppCollectionInner.class, WebAppCollectionInner.class) - .last() - .flatMap(client::getLroFinalResultOrError); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux suspendAsync(String resourceGroupName, String name) { + return new PagedFlux<>( + () -> suspendSinglePageAsync(resourceGroupName, name), nextLink -> suspendNextSinglePageAsync(nextLink)); } /** @@ -5861,15 +5870,11 @@ public Mono suspendAsync(String resourceGroupName, String * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return collection of App Service apps. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono suspendAsync(String resourceGroupName, String name, Context context) { - Mono>> mono = suspendWithResponseAsync(resourceGroupName, name, context); - return this - .client - .getLroResultAsync( - mono, this.client.getHttpPipeline(), WebAppCollectionInner.class, WebAppCollectionInner.class) - .last() - .flatMap(client::getLroFinalResultOrError); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux suspendAsync(String resourceGroupName, String name, Context context) { + return new PagedFlux<>( + () -> suspendSinglePageAsync(resourceGroupName, name, context), + nextLink -> suspendNextSinglePageAsync(nextLink)); } /** @@ -5882,9 +5887,9 @@ public Mono suspendAsync(String resourceGroupName, String * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return collection of App Service apps. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public WebAppCollectionInner suspend(String resourceGroupName, String name) { - return suspendAsync(resourceGroupName, name).block(); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable suspend(String resourceGroupName, String name) { + return new PagedIterable<>(suspendAsync(resourceGroupName, name)); } /** @@ -5898,9 +5903,9 @@ public WebAppCollectionInner suspend(String resourceGroupName, String name) { * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return collection of App Service apps. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public WebAppCollectionInner suspend(String resourceGroupName, String name, Context context) { - return suspendAsync(resourceGroupName, name, context).block(); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable suspend(String resourceGroupName, String name, Context context) { + return new PagedIterable<>(suspendAsync(resourceGroupName, name, context)); } /** @@ -5998,6 +6003,7 @@ public Mono> listUsagesSinglePageAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listUsages( this.client.getEndpoint(), @@ -6222,6 +6228,7 @@ public Mono> listWorkerPoolsSinglePageAsy new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listWorkerPools( this.client.getEndpoint(), @@ -6397,6 +6404,7 @@ public Mono> getWorkerPoolWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getWorkerPool( this.client.getEndpoint(), @@ -6600,6 +6608,7 @@ public Mono>> createOrUpdateWorkerPoolWithResponseAsyn } else { workerPoolEnvelope.validate(); } + context = this.client.mergeContext(context); return service .createOrUpdateWorkerPool( this.client.getEndpoint(), @@ -6625,7 +6634,7 @@ public Mono>> createOrUpdateWorkerPoolWithResponseAsyn * @return worker pool of an App Service Environment ARM resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, WorkerPoolResourceInner> beginCreateOrUpdateWorkerPool( + public PollerFlux, WorkerPoolResourceInner> beginCreateOrUpdateWorkerPoolAsync( String resourceGroupName, String name, String workerPoolName, WorkerPoolResourceInner workerPoolEnvelope) { Mono>> mono = createOrUpdateWorkerPoolWithResponseAsync(resourceGroupName, name, workerPoolName, workerPoolEnvelope); @@ -6649,7 +6658,7 @@ public PollerFlux, WorkerPoolResourceInner> * @return worker pool of an App Service Environment ARM resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, WorkerPoolResourceInner> beginCreateOrUpdateWorkerPool( + public PollerFlux, WorkerPoolResourceInner> beginCreateOrUpdateWorkerPoolAsync( String resourceGroupName, String name, String workerPoolName, @@ -6677,16 +6686,10 @@ public PollerFlux, WorkerPoolResourceInner> * @return worker pool of an App Service Environment ARM resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createOrUpdateWorkerPoolAsync( + public SyncPoller, WorkerPoolResourceInner> beginCreateOrUpdateWorkerPool( String resourceGroupName, String name, String workerPoolName, WorkerPoolResourceInner workerPoolEnvelope) { - Mono>> mono = - createOrUpdateWorkerPoolWithResponseAsync(resourceGroupName, name, workerPoolName, workerPoolEnvelope); - return this - .client - .getLroResultAsync( - mono, this.client.getHttpPipeline(), WorkerPoolResourceInner.class, WorkerPoolResourceInner.class) - .last() - .flatMap(client::getLroFinalResultOrError); + return beginCreateOrUpdateWorkerPoolAsync(resourceGroupName, name, workerPoolName, workerPoolEnvelope) + .getSyncPoller(); } /** @@ -6703,21 +6706,14 @@ public Mono createOrUpdateWorkerPoolAsync( * @return worker pool of an App Service Environment ARM resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createOrUpdateWorkerPoolAsync( + public SyncPoller, WorkerPoolResourceInner> beginCreateOrUpdateWorkerPool( String resourceGroupName, String name, String workerPoolName, WorkerPoolResourceInner workerPoolEnvelope, Context context) { - Mono>> mono = - createOrUpdateWorkerPoolWithResponseAsync( - resourceGroupName, name, workerPoolName, workerPoolEnvelope, context); - return this - .client - .getLroResultAsync( - mono, this.client.getHttpPipeline(), WorkerPoolResourceInner.class, WorkerPoolResourceInner.class) - .last() - .flatMap(client::getLroFinalResultOrError); + return beginCreateOrUpdateWorkerPoolAsync(resourceGroupName, name, workerPoolName, workerPoolEnvelope, context) + .getSyncPoller(); } /** @@ -6733,9 +6729,11 @@ public Mono createOrUpdateWorkerPoolAsync( * @return worker pool of an App Service Environment ARM resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public WorkerPoolResourceInner createOrUpdateWorkerPool( + public Mono createOrUpdateWorkerPoolAsync( String resourceGroupName, String name, String workerPoolName, WorkerPoolResourceInner workerPoolEnvelope) { - return createOrUpdateWorkerPoolAsync(resourceGroupName, name, workerPoolName, workerPoolEnvelope).block(); + return beginCreateOrUpdateWorkerPoolAsync(resourceGroupName, name, workerPoolName, workerPoolEnvelope) + .last() + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -6752,14 +6750,15 @@ public WorkerPoolResourceInner createOrUpdateWorkerPool( * @return worker pool of an App Service Environment ARM resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public WorkerPoolResourceInner createOrUpdateWorkerPool( + public Mono createOrUpdateWorkerPoolAsync( String resourceGroupName, String name, String workerPoolName, WorkerPoolResourceInner workerPoolEnvelope, Context context) { - return createOrUpdateWorkerPoolAsync(resourceGroupName, name, workerPoolName, workerPoolEnvelope, context) - .block(); + return beginCreateOrUpdateWorkerPoolAsync(resourceGroupName, name, workerPoolName, workerPoolEnvelope, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -6775,15 +6774,57 @@ public WorkerPoolResourceInner createOrUpdateWorkerPool( * @return worker pool of an App Service Environment ARM resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> updateWorkerPoolWithResponseAsync( + public WorkerPoolResourceInner createOrUpdateWorkerPool( String resourceGroupName, String name, String workerPoolName, WorkerPoolResourceInner workerPoolEnvelope) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { + return createOrUpdateWorkerPoolAsync(resourceGroupName, name, workerPoolName, workerPoolEnvelope).block(); + } + + /** + * Description for Create or update a worker pool. + * + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the App Service Environment. + * @param workerPoolName Name of the worker pool. + * @param workerPoolEnvelope Worker pool of an App Service Environment ARM resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return worker pool of an App Service Environment ARM resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public WorkerPoolResourceInner createOrUpdateWorkerPool( + String resourceGroupName, + String name, + String workerPoolName, + WorkerPoolResourceInner workerPoolEnvelope, + Context context) { + return createOrUpdateWorkerPoolAsync(resourceGroupName, name, workerPoolName, workerPoolEnvelope, context) + .block(); + } + + /** + * Description for Create or update a worker pool. + * + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the App Service Environment. + * @param workerPoolName Name of the worker pool. + * @param workerPoolEnvelope Worker pool of an App Service Environment ARM resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return worker pool of an App Service Environment ARM resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> updateWorkerPoolWithResponseAsync( + String resourceGroupName, String name, String workerPoolName, WorkerPoolResourceInner workerPoolEnvelope) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } @@ -6869,6 +6910,7 @@ public Mono> updateWorkerPoolWithResponseAsync } else { workerPoolEnvelope.validate(); } + context = this.client.mergeContext(context); return service .updateWorkerPool( this.client.getEndpoint(), @@ -7085,6 +7127,7 @@ public Mono> listWorkerPoolInstance new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listWorkerPoolInstanceMetricDefinitions( this.client.getEndpoint(), @@ -7287,6 +7330,7 @@ public Mono> listWebWorkerMetricDef new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listWebWorkerMetricDefinitions( this.client.getEndpoint(), @@ -7479,6 +7523,7 @@ public Mono> listWorkerPoolSkusSinglePageAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listWorkerPoolSkus( this.client.getEndpoint(), @@ -7670,6 +7715,7 @@ public Mono> listWebWorkerUsagesSinglePageAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listWebWorkerUsages( this.client.getEndpoint(), @@ -7764,1430 +7810,139 @@ public PagedIterable listWebWorkerUsages( } /** - * Description for Create or update an App Service Environment. + * Get the next page of items. * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param hostingEnvironmentEnvelope App Service Environment ARM resource. + * @param nextLink The nextLink parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return app Service Environment ARM resource. + * @return collection of App Service Environments. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginCreateOrUpdateWithoutPollingWithResponseAsync( - String resourceGroupName, String name, AppServiceEnvironmentResourceInner hostingEnvironmentEnvelope) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (hostingEnvironmentEnvelope == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter hostingEnvironmentEnvelope is required and cannot be null.")); - } else { - hostingEnvironmentEnvelope.validate(); + public Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } return FluxUtil - .withContext( - context -> - service - .beginCreateOrUpdateWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - hostingEnvironmentEnvelope, - context)) + .withContext(context -> service.listNext(nextLink, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); } /** - * Description for Create or update an App Service Environment. + * Get the next page of items. * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param hostingEnvironmentEnvelope App Service Environment ARM resource. + * @param nextLink The nextLink parameter. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return app Service Environment ARM resource. + * @return collection of App Service Environments. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginCreateOrUpdateWithoutPollingWithResponseAsync( - String resourceGroupName, - String name, - AppServiceEnvironmentResourceInner hostingEnvironmentEnvelope, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (hostingEnvironmentEnvelope == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter hostingEnvironmentEnvelope is required and cannot be null.")); - } else { - hostingEnvironmentEnvelope.validate(); + public Mono> listNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service - .beginCreateOrUpdateWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - hostingEnvironmentEnvelope, - context); + .listNext(nextLink, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); } /** - * Description for Create or update an App Service Environment. + * Get the next page of items. * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param hostingEnvironmentEnvelope App Service Environment ARM resource. + * @param nextLink The nextLink parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return app Service Environment ARM resource. + * @return collection of App Service Environments. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginCreateOrUpdateWithoutPollingAsync( - String resourceGroupName, String name, AppServiceEnvironmentResourceInner hostingEnvironmentEnvelope) { - return beginCreateOrUpdateWithoutPollingWithResponseAsync(resourceGroupName, name, hostingEnvironmentEnvelope) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + public Mono> listByResourceGroupNextSinglePageAsync( + String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + return FluxUtil + .withContext(context -> service.listByResourceGroupNext(nextLink, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); } /** - * Description for Create or update an App Service Environment. + * Get the next page of items. * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param hostingEnvironmentEnvelope App Service Environment ARM resource. + * @param nextLink The nextLink parameter. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return app Service Environment ARM resource. + * @return collection of App Service Environments. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginCreateOrUpdateWithoutPollingAsync( - String resourceGroupName, - String name, - AppServiceEnvironmentResourceInner hostingEnvironmentEnvelope, - Context context) { - return beginCreateOrUpdateWithoutPollingWithResponseAsync( - resourceGroupName, name, hostingEnvironmentEnvelope, context) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + public Mono> listByResourceGroupNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + context = this.client.mergeContext(context); + return service + .listByResourceGroupNext(nextLink, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); } /** - * Description for Create or update an App Service Environment. + * Get the next page of items. * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param hostingEnvironmentEnvelope App Service Environment ARM resource. + * @param nextLink The nextLink parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return app Service Environment ARM resource. + * @return collection of stamp capacities. */ @ServiceMethod(returns = ReturnType.SINGLE) - public AppServiceEnvironmentResourceInner beginCreateOrUpdateWithoutPolling( - String resourceGroupName, String name, AppServiceEnvironmentResourceInner hostingEnvironmentEnvelope) { - return beginCreateOrUpdateWithoutPollingAsync(resourceGroupName, name, hostingEnvironmentEnvelope).block(); - } - - /** - * Description for Create or update an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param hostingEnvironmentEnvelope App Service Environment ARM resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return app Service Environment ARM resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public AppServiceEnvironmentResourceInner beginCreateOrUpdateWithoutPolling( - String resourceGroupName, - String name, - AppServiceEnvironmentResourceInner hostingEnvironmentEnvelope, - Context context) { - return beginCreateOrUpdateWithoutPollingAsync(resourceGroupName, name, hostingEnvironmentEnvelope, context) - .block(); - } - - /** - * Description for Delete an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param forceDelete Specify <code>true</code> to force the deletion even if the App Service - * Environment contains resources. The default is <code>false</code>. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginDeleteWithoutPollingWithResponseAsync( - String resourceGroupName, String name, Boolean forceDelete) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - return FluxUtil - .withContext( - context -> - service - .beginDeleteWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - name, - forceDelete, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Description for Delete an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param forceDelete Specify <code>true</code> to force the deletion even if the App Service - * Environment contains resources. The default is <code>false</code>. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginDeleteWithoutPollingWithResponseAsync( - String resourceGroupName, String name, Boolean forceDelete, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - return service - .beginDeleteWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - name, - forceDelete, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context); - } - - /** - * Description for Delete an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param forceDelete Specify <code>true</code> to force the deletion even if the App Service - * Environment contains resources. The default is <code>false</code>. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginDeleteWithoutPollingAsync(String resourceGroupName, String name, Boolean forceDelete) { - return beginDeleteWithoutPollingWithResponseAsync(resourceGroupName, name, forceDelete) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Description for Delete an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param forceDelete Specify <code>true</code> to force the deletion even if the App Service - * Environment contains resources. The default is <code>false</code>. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginDeleteWithoutPollingAsync( - String resourceGroupName, String name, Boolean forceDelete, Context context) { - return beginDeleteWithoutPollingWithResponseAsync(resourceGroupName, name, forceDelete, context) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Description for Delete an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginDeleteWithoutPollingAsync(String resourceGroupName, String name) { - final Boolean forceDelete = null; - final Context context = null; - return beginDeleteWithoutPollingWithResponseAsync(resourceGroupName, name, forceDelete) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Description for Delete an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param forceDelete Specify <code>true</code> to force the deletion even if the App Service - * Environment contains resources. The default is <code>false</code>. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void beginDeleteWithoutPolling(String resourceGroupName, String name, Boolean forceDelete) { - beginDeleteWithoutPollingAsync(resourceGroupName, name, forceDelete).block(); - } - - /** - * Description for Delete an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param forceDelete Specify <code>true</code> to force the deletion even if the App Service - * Environment contains resources. The default is <code>false</code>. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void beginDeleteWithoutPolling(String resourceGroupName, String name, Boolean forceDelete, Context context) { - beginDeleteWithoutPollingAsync(resourceGroupName, name, forceDelete, context).block(); - } - - /** - * Description for Delete an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void beginDeleteWithoutPolling(String resourceGroupName, String name) { - final Boolean forceDelete = null; - final Context context = null; - beginDeleteWithoutPollingAsync(resourceGroupName, name, forceDelete).block(); - } - - /** - * Description for Move an App Service Environment to a different VNET. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param vnetInfo Specification for using a Virtual Network. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of App Service apps. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginChangeVnetWithoutPollingWithResponseAsync( - String resourceGroupName, String name, VirtualNetworkProfile vnetInfo) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (vnetInfo == null) { - return Mono.error(new IllegalArgumentException("Parameter vnetInfo is required and cannot be null.")); - } else { - vnetInfo.validate(); - } - return FluxUtil - .withContext( - context -> - service - .beginChangeVnetWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - vnetInfo, - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Description for Move an App Service Environment to a different VNET. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param vnetInfo Specification for using a Virtual Network. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of App Service apps. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginChangeVnetWithoutPollingWithResponseAsync( - String resourceGroupName, String name, VirtualNetworkProfile vnetInfo, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (vnetInfo == null) { - return Mono.error(new IllegalArgumentException("Parameter vnetInfo is required and cannot be null.")); - } else { - vnetInfo.validate(); - } - return service - .beginChangeVnetWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - vnetInfo, - context); - } - - /** - * Description for Move an App Service Environment to a different VNET. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param vnetInfo Specification for using a Virtual Network. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of App Service apps. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginChangeVnetWithoutPollingAsync( - String resourceGroupName, String name, VirtualNetworkProfile vnetInfo) { - return beginChangeVnetWithoutPollingWithResponseAsync(resourceGroupName, name, vnetInfo) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Description for Move an App Service Environment to a different VNET. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param vnetInfo Specification for using a Virtual Network. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of App Service apps. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginChangeVnetWithoutPollingAsync( - String resourceGroupName, String name, VirtualNetworkProfile vnetInfo, Context context) { - return beginChangeVnetWithoutPollingWithResponseAsync(resourceGroupName, name, vnetInfo, context) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Description for Move an App Service Environment to a different VNET. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param vnetInfo Specification for using a Virtual Network. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of App Service apps. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public WebAppCollectionInner beginChangeVnetWithoutPolling( - String resourceGroupName, String name, VirtualNetworkProfile vnetInfo) { - return beginChangeVnetWithoutPollingAsync(resourceGroupName, name, vnetInfo).block(); - } - - /** - * Description for Move an App Service Environment to a different VNET. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param vnetInfo Specification for using a Virtual Network. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of App Service apps. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public WebAppCollectionInner beginChangeVnetWithoutPolling( - String resourceGroupName, String name, VirtualNetworkProfile vnetInfo, Context context) { - return beginChangeVnetWithoutPollingAsync(resourceGroupName, name, vnetInfo, context).block(); - } - - /** - * Description for Create or update a multi-role pool. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param multiRolePoolEnvelope Worker pool of an App Service Environment ARM resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return worker pool of an App Service Environment ARM resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginCreateOrUpdateMultiRolePoolWithoutPollingWithResponseAsync( - String resourceGroupName, String name, WorkerPoolResourceInner multiRolePoolEnvelope) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (multiRolePoolEnvelope == null) { - return Mono - .error(new IllegalArgumentException("Parameter multiRolePoolEnvelope is required and cannot be null.")); - } else { - multiRolePoolEnvelope.validate(); - } - return FluxUtil - .withContext( - context -> - service - .beginCreateOrUpdateMultiRolePoolWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - multiRolePoolEnvelope, - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Description for Create or update a multi-role pool. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param multiRolePoolEnvelope Worker pool of an App Service Environment ARM resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return worker pool of an App Service Environment ARM resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginCreateOrUpdateMultiRolePoolWithoutPollingWithResponseAsync( - String resourceGroupName, String name, WorkerPoolResourceInner multiRolePoolEnvelope, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (multiRolePoolEnvelope == null) { - return Mono - .error(new IllegalArgumentException("Parameter multiRolePoolEnvelope is required and cannot be null.")); - } else { - multiRolePoolEnvelope.validate(); - } - return service - .beginCreateOrUpdateMultiRolePoolWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - multiRolePoolEnvelope, - context); - } - - /** - * Description for Create or update a multi-role pool. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param multiRolePoolEnvelope Worker pool of an App Service Environment ARM resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return worker pool of an App Service Environment ARM resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginCreateOrUpdateMultiRolePoolWithoutPollingAsync( - String resourceGroupName, String name, WorkerPoolResourceInner multiRolePoolEnvelope) { - return beginCreateOrUpdateMultiRolePoolWithoutPollingWithResponseAsync( - resourceGroupName, name, multiRolePoolEnvelope) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Description for Create or update a multi-role pool. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param multiRolePoolEnvelope Worker pool of an App Service Environment ARM resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return worker pool of an App Service Environment ARM resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginCreateOrUpdateMultiRolePoolWithoutPollingAsync( - String resourceGroupName, String name, WorkerPoolResourceInner multiRolePoolEnvelope, Context context) { - return beginCreateOrUpdateMultiRolePoolWithoutPollingWithResponseAsync( - resourceGroupName, name, multiRolePoolEnvelope, context) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Description for Create or update a multi-role pool. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param multiRolePoolEnvelope Worker pool of an App Service Environment ARM resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return worker pool of an App Service Environment ARM resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public WorkerPoolResourceInner beginCreateOrUpdateMultiRolePoolWithoutPolling( - String resourceGroupName, String name, WorkerPoolResourceInner multiRolePoolEnvelope) { - return beginCreateOrUpdateMultiRolePoolWithoutPollingAsync(resourceGroupName, name, multiRolePoolEnvelope) - .block(); - } - - /** - * Description for Create or update a multi-role pool. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param multiRolePoolEnvelope Worker pool of an App Service Environment ARM resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return worker pool of an App Service Environment ARM resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public WorkerPoolResourceInner beginCreateOrUpdateMultiRolePoolWithoutPolling( - String resourceGroupName, String name, WorkerPoolResourceInner multiRolePoolEnvelope, Context context) { - return beginCreateOrUpdateMultiRolePoolWithoutPollingAsync( - resourceGroupName, name, multiRolePoolEnvelope, context) - .block(); - } - - /** - * Description for Resume an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of App Service apps. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginResumeWithoutPollingWithResponseAsync( - String resourceGroupName, String name) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - return FluxUtil - .withContext( - context -> - service - .beginResumeWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Description for Resume an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of App Service apps. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginResumeWithoutPollingWithResponseAsync( - String resourceGroupName, String name, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - return service - .beginResumeWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context); - } - - /** - * Description for Resume an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of App Service apps. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginResumeWithoutPollingAsync(String resourceGroupName, String name) { - return beginResumeWithoutPollingWithResponseAsync(resourceGroupName, name) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Description for Resume an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of App Service apps. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginResumeWithoutPollingAsync( - String resourceGroupName, String name, Context context) { - return beginResumeWithoutPollingWithResponseAsync(resourceGroupName, name, context) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Description for Resume an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of App Service apps. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public WebAppCollectionInner beginResumeWithoutPolling(String resourceGroupName, String name) { - return beginResumeWithoutPollingAsync(resourceGroupName, name).block(); - } - - /** - * Description for Resume an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of App Service apps. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public WebAppCollectionInner beginResumeWithoutPolling(String resourceGroupName, String name, Context context) { - return beginResumeWithoutPollingAsync(resourceGroupName, name, context).block(); - } - - /** - * Description for Suspend an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of App Service apps. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginSuspendWithoutPollingWithResponseAsync( - String resourceGroupName, String name) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - return FluxUtil - .withContext( - context -> - service - .beginSuspendWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Description for Suspend an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of App Service apps. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginSuspendWithoutPollingWithResponseAsync( - String resourceGroupName, String name, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - return service - .beginSuspendWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context); - } - - /** - * Description for Suspend an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of App Service apps. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginSuspendWithoutPollingAsync(String resourceGroupName, String name) { - return beginSuspendWithoutPollingWithResponseAsync(resourceGroupName, name) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Description for Suspend an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of App Service apps. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginSuspendWithoutPollingAsync( - String resourceGroupName, String name, Context context) { - return beginSuspendWithoutPollingWithResponseAsync(resourceGroupName, name, context) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Description for Suspend an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of App Service apps. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public WebAppCollectionInner beginSuspendWithoutPolling(String resourceGroupName, String name) { - return beginSuspendWithoutPollingAsync(resourceGroupName, name).block(); - } - - /** - * Description for Suspend an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of App Service apps. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public WebAppCollectionInner beginSuspendWithoutPolling(String resourceGroupName, String name, Context context) { - return beginSuspendWithoutPollingAsync(resourceGroupName, name, context).block(); - } - - /** - * Description for Create or update a worker pool. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param workerPoolName Name of the worker pool. - * @param workerPoolEnvelope Worker pool of an App Service Environment ARM resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return worker pool of an App Service Environment ARM resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginCreateOrUpdateWorkerPoolWithoutPollingWithResponseAsync( - String resourceGroupName, String name, String workerPoolName, WorkerPoolResourceInner workerPoolEnvelope) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (workerPoolName == null) { - return Mono.error(new IllegalArgumentException("Parameter workerPoolName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (workerPoolEnvelope == null) { - return Mono - .error(new IllegalArgumentException("Parameter workerPoolEnvelope is required and cannot be null.")); - } else { - workerPoolEnvelope.validate(); - } - return FluxUtil - .withContext( - context -> - service - .beginCreateOrUpdateWorkerPoolWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - name, - workerPoolName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - workerPoolEnvelope, - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Description for Create or update a worker pool. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param workerPoolName Name of the worker pool. - * @param workerPoolEnvelope Worker pool of an App Service Environment ARM resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return worker pool of an App Service Environment ARM resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginCreateOrUpdateWorkerPoolWithoutPollingWithResponseAsync( - String resourceGroupName, - String name, - String workerPoolName, - WorkerPoolResourceInner workerPoolEnvelope, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (workerPoolName == null) { - return Mono.error(new IllegalArgumentException("Parameter workerPoolName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (workerPoolEnvelope == null) { - return Mono - .error(new IllegalArgumentException("Parameter workerPoolEnvelope is required and cannot be null.")); - } else { - workerPoolEnvelope.validate(); - } - return service - .beginCreateOrUpdateWorkerPoolWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - name, - workerPoolName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - workerPoolEnvelope, - context); - } - - /** - * Description for Create or update a worker pool. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param workerPoolName Name of the worker pool. - * @param workerPoolEnvelope Worker pool of an App Service Environment ARM resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return worker pool of an App Service Environment ARM resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginCreateOrUpdateWorkerPoolWithoutPollingAsync( - String resourceGroupName, String name, String workerPoolName, WorkerPoolResourceInner workerPoolEnvelope) { - return beginCreateOrUpdateWorkerPoolWithoutPollingWithResponseAsync( - resourceGroupName, name, workerPoolName, workerPoolEnvelope) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Description for Create or update a worker pool. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param workerPoolName Name of the worker pool. - * @param workerPoolEnvelope Worker pool of an App Service Environment ARM resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return worker pool of an App Service Environment ARM resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginCreateOrUpdateWorkerPoolWithoutPollingAsync( - String resourceGroupName, - String name, - String workerPoolName, - WorkerPoolResourceInner workerPoolEnvelope, - Context context) { - return beginCreateOrUpdateWorkerPoolWithoutPollingWithResponseAsync( - resourceGroupName, name, workerPoolName, workerPoolEnvelope, context) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Description for Create or update a worker pool. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param workerPoolName Name of the worker pool. - * @param workerPoolEnvelope Worker pool of an App Service Environment ARM resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return worker pool of an App Service Environment ARM resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public WorkerPoolResourceInner beginCreateOrUpdateWorkerPoolWithoutPolling( - String resourceGroupName, String name, String workerPoolName, WorkerPoolResourceInner workerPoolEnvelope) { - return beginCreateOrUpdateWorkerPoolWithoutPollingAsync( - resourceGroupName, name, workerPoolName, workerPoolEnvelope) - .block(); - } - - /** - * Description for Create or update a worker pool. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param workerPoolName Name of the worker pool. - * @param workerPoolEnvelope Worker pool of an App Service Environment ARM resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return worker pool of an App Service Environment ARM resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public WorkerPoolResourceInner beginCreateOrUpdateWorkerPoolWithoutPolling( - String resourceGroupName, - String name, - String workerPoolName, - WorkerPoolResourceInner workerPoolEnvelope, - Context context) { - return beginCreateOrUpdateWorkerPoolWithoutPollingAsync( - resourceGroupName, name, workerPoolName, workerPoolEnvelope, context) - .block(); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of App Service Environments. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - return FluxUtil - .withContext(context -> service.listNext(nextLink, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of App Service Environments. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> listNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - return service - .listNext(nextLink, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of App Service Environments. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> listByResourceGroupNextSinglePageAsync( - String nextLink) { + public Mono> listCapacitiesNextSinglePageAsync(String nextLink) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } return FluxUtil - .withContext(context -> service.listByResourceGroupNext(nextLink, context)) - .>map( + .withContext(context -> service.listCapacitiesNext(nextLink, context)) + .>map( res -> new PagedResponseBase<>( res.getRequest(), @@ -9207,16 +7962,16 @@ public Mono> listByResourceGro * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of App Service Environments. + * @return collection of stamp capacities. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> listByResourceGroupNextSinglePageAsync( - String nextLink, Context context) { + public Mono> listCapacitiesNextSinglePageAsync(String nextLink, Context context) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service - .listByResourceGroupNext(nextLink, context) + .listCapacitiesNext(nextLink, context) .map( res -> new PagedResponseBase<>( @@ -9235,16 +7990,16 @@ public Mono> listByResourceGro * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of stamp capacities. + * @return collection of App Service apps. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> listCapacitiesNextSinglePageAsync(String nextLink) { + public Mono> changeVnetNextSinglePageAsync(String nextLink) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } return FluxUtil - .withContext(context -> service.listCapacitiesNext(nextLink, context)) - .>map( + .withContext(context -> service.changeVnetNext(nextLink, context)) + .>map( res -> new PagedResponseBase<>( res.getRequest(), @@ -9264,15 +8019,16 @@ public Mono> listCapacitiesNextSinglePageAsync * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of stamp capacities. + * @return collection of App Service apps. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> listCapacitiesNextSinglePageAsync(String nextLink, Context context) { + public Mono> changeVnetNextSinglePageAsync(String nextLink, Context context) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service - .listCapacitiesNext(nextLink, context) + .changeVnetNext(nextLink, context) .map( res -> new PagedResponseBase<>( @@ -9329,6 +8085,7 @@ public Mono> listCapacitiesNextSinglePageAsync if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getInboundNetworkDependenciesEndpointsNext(nextLink, context) .map( @@ -9386,6 +8143,7 @@ public Mono> listMultiRolePoolsNextSingle if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listMultiRolePoolsNext(nextLink, context) .map( @@ -9444,6 +8202,7 @@ public Mono> listMultiRolePoolsNextSingle if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listMultiRolePoolInstanceMetricDefinitionsNext(nextLink, context) .map( @@ -9502,6 +8261,7 @@ public Mono> listMultiRoleMetricDef if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listMultiRoleMetricDefinitionsNext(nextLink, context) .map( @@ -9559,6 +8319,7 @@ public Mono> listMultiRolePoolSkusNextSinglePageAsyn if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listMultiRolePoolSkusNext(nextLink, context) .map( @@ -9615,6 +8376,7 @@ public Mono> listMultiRoleUsagesNextSinglePageAsync(St if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listMultiRoleUsagesNext(nextLink, context) .map( @@ -9673,6 +8435,7 @@ public Mono> listMultiRoleUsagesNextSinglePageAsync(St if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getOutboundNetworkDependenciesEndpointsNext(nextLink, context) .map( @@ -9686,6 +8449,63 @@ public Mono> listMultiRoleUsagesNextSinglePageAsync(St null)); } + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of App Service apps. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> resumeNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + return FluxUtil + .withContext(context -> service.resumeNext(nextLink, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of App Service apps. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> resumeNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + context = this.client.mergeContext(context); + return service + .resumeNext(nextLink, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + /** * Get the next page of items. * @@ -9730,6 +8550,7 @@ public Mono> listAppServicePlansNextSinglePag if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listAppServicePlansNext(nextLink, context) .map( @@ -9786,6 +8607,7 @@ public Mono> listWebAppsNextSinglePageAsync(String next if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listWebAppsNext(nextLink, context) .map( @@ -9799,6 +8621,63 @@ public Mono> listWebAppsNextSinglePageAsync(String next null)); } + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of App Service apps. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> suspendNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + return FluxUtil + .withContext(context -> service.suspendNext(nextLink, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of App Service apps. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> suspendNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + context = this.client.mergeContext(context); + return service + .suspendNext(nextLink, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + /** * Get the next page of items. * @@ -9842,6 +8721,7 @@ public Mono> listUsagesNextSinglePageAsync(Str if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listUsagesNext(nextLink, context) .map( @@ -9899,6 +8779,7 @@ public Mono> listWorkerPoolsNextSinglePag if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listWorkerPoolsNext(nextLink, context) .map( @@ -9957,6 +8838,7 @@ public Mono> listWorkerPoolsNextSinglePag if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listWorkerPoolInstanceMetricDefinitionsNext(nextLink, context) .map( @@ -10015,6 +8897,7 @@ public Mono> listWebWorkerMetricDef if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listWebWorkerMetricDefinitionsNext(nextLink, context) .map( @@ -10071,6 +8954,7 @@ public Mono> listWorkerPoolSkusNextSinglePageAsync(S if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listWorkerPoolSkusNext(nextLink, context) .map( @@ -10127,6 +9011,7 @@ public Mono> listWebWorkerUsagesNextSinglePageAsync(St if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listWebWorkerUsagesNext(nextLink, context) .map( diff --git a/sdk/appservice/mgmt/src/main/java/com/azure/resourcemanager/appservice/fluent/AppServicePlansClient.java b/sdk/appservice/mgmt/src/main/java/com/azure/resourcemanager/appservice/fluent/AppServicePlansClient.java index 0b8a3421c0741..87b88c80140a4 100644 --- a/sdk/appservice/mgmt/src/main/java/com/azure/resourcemanager/appservice/fluent/AppServicePlansClient.java +++ b/sdk/appservice/mgmt/src/main/java/com/azure/resourcemanager/appservice/fluent/AppServicePlansClient.java @@ -31,6 +31,7 @@ import com.azure.core.util.FluxUtil; import com.azure.core.util.logging.ClientLogger; import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.appservice.WebSiteManagementClient; import com.azure.resourcemanager.appservice.fluent.inner.AppServicePlanCollectionInner; import com.azure.resourcemanager.appservice.fluent.inner.AppServicePlanInner; @@ -493,21 +494,6 @@ Mono> rebootWorker( @QueryParam("api-version") String apiVersion, Context context); - @Headers({"Accept: application/json", "Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms" - + "/{name}") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> beginCreateOrUpdateWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") AppServicePlanInner appServicePlan, - Context context); - @Headers({"Accept: application/json", "Content-Type: application/json"}) @Get("{nextLink}") @ExpectedResponses({200}) @@ -624,6 +610,7 @@ public Mono> listSinglePageAsync(Boolean deta new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .list( this.client.getEndpoint(), @@ -815,6 +802,7 @@ public Mono> listByResourceGroupSinglePageAsy new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listByResourceGroup( this.client.getEndpoint(), @@ -974,6 +962,7 @@ public Mono> getByResourceGroupWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getByResourceGroup( this.client.getEndpoint(), @@ -1154,6 +1143,7 @@ public Mono>> createOrUpdateWithResponseAsync( } else { appServicePlan.validate(); } + context = this.client.mergeContext(context); return service .createOrUpdate( this.client.getEndpoint(), @@ -1177,7 +1167,7 @@ public Mono>> createOrUpdateWithResponseAsync( * @return app Service plan. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, AppServicePlanInner> beginCreateOrUpdate( + public PollerFlux, AppServicePlanInner> beginCreateOrUpdateAsync( String resourceGroupName, String name, AppServicePlanInner appServicePlan) { Mono>> mono = createOrUpdateWithResponseAsync(resourceGroupName, name, appServicePlan); @@ -1200,7 +1190,7 @@ public PollerFlux, AppServicePlanInner> beginCre * @return app Service plan. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, AppServicePlanInner> beginCreateOrUpdate( + public PollerFlux, AppServicePlanInner> beginCreateOrUpdateAsync( String resourceGroupName, String name, AppServicePlanInner appServicePlan, Context context) { Mono>> mono = createOrUpdateWithResponseAsync(resourceGroupName, name, appServicePlan, context); @@ -1210,6 +1200,41 @@ public PollerFlux, AppServicePlanInner> beginCre mono, this.client.getHttpPipeline(), AppServicePlanInner.class, AppServicePlanInner.class); } + /** + * Description for Creates or updates an App Service Plan. + * + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the App Service plan. + * @param appServicePlan App Service plan. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return app Service plan. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, AppServicePlanInner> beginCreateOrUpdate( + String resourceGroupName, String name, AppServicePlanInner appServicePlan) { + return beginCreateOrUpdateAsync(resourceGroupName, name, appServicePlan).getSyncPoller(); + } + + /** + * Description for Creates or updates an App Service Plan. + * + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the App Service plan. + * @param appServicePlan App Service plan. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return app Service plan. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, AppServicePlanInner> beginCreateOrUpdate( + String resourceGroupName, String name, AppServicePlanInner appServicePlan, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, name, appServicePlan, context).getSyncPoller(); + } + /** * Description for Creates or updates an App Service Plan. * @@ -1224,14 +1249,9 @@ public PollerFlux, AppServicePlanInner> beginCre @ServiceMethod(returns = ReturnType.SINGLE) public Mono createOrUpdateAsync( String resourceGroupName, String name, AppServicePlanInner appServicePlan) { - Mono>> mono = - createOrUpdateWithResponseAsync(resourceGroupName, name, appServicePlan); - return this - .client - .getLroResultAsync( - mono, this.client.getHttpPipeline(), AppServicePlanInner.class, AppServicePlanInner.class) + return beginCreateOrUpdateAsync(resourceGroupName, name, appServicePlan) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -1249,14 +1269,9 @@ public Mono createOrUpdateAsync( @ServiceMethod(returns = ReturnType.SINGLE) public Mono createOrUpdateAsync( String resourceGroupName, String name, AppServicePlanInner appServicePlan, Context context) { - Mono>> mono = - createOrUpdateWithResponseAsync(resourceGroupName, name, appServicePlan, context); - return this - .client - .getLroResultAsync( - mono, this.client.getHttpPipeline(), AppServicePlanInner.class, AppServicePlanInner.class) + return beginCreateOrUpdateAsync(resourceGroupName, name, appServicePlan, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -1371,6 +1386,7 @@ public Mono> deleteWithResponseAsync(String resourceGroupName, St new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .delete( this.client.getEndpoint(), @@ -1533,6 +1549,7 @@ public Mono> updateWithResponseAsync( } else { appServicePlan.validate(); } + context = this.client.mergeContext(context); return service .update( this.client.getEndpoint(), @@ -1709,6 +1726,7 @@ public Mono>> listCapabilitiesWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listCapabilities( this.client.getEndpoint(), @@ -1894,6 +1912,7 @@ public Mono> getHybridConnectionWithResponseAsyn new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getHybridConnection( this.client.getEndpoint(), @@ -2093,6 +2112,7 @@ public Mono> deleteHybridConnectionWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .deleteHybridConnection( this.client.getEndpoint(), @@ -2275,6 +2295,7 @@ public Mono> listHybridConnectionKeysWithResp new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listHybridConnectionKeys( this.client.getEndpoint(), @@ -2483,6 +2504,7 @@ public Mono> listWebAppsByHybridConnectionSinglePageAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listWebAppsByHybridConnection( this.client.getEndpoint(), @@ -2665,6 +2687,7 @@ public Mono> getHybridConnectionPlanLimitW new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getHybridConnectionPlanLimit( this.client.getEndpoint(), @@ -2843,6 +2866,7 @@ public Mono> listHybridConnectionsSinglePag new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listHybridConnections( this.client.getEndpoint(), @@ -3016,6 +3040,7 @@ public Mono> restartWebAppsWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .restartWebApps( this.client.getEndpoint(), @@ -3236,6 +3261,7 @@ public Mono> listWebAppsSinglePageAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listWebApps( this.client.getEndpoint(), @@ -3466,6 +3492,7 @@ public Mono> getServerFarmSkusWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getServerFarmSkus( this.client.getEndpoint(), @@ -3647,6 +3674,7 @@ public Mono> listUsagesSinglePageAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listUsages( this.client.getEndpoint(), @@ -3857,6 +3885,7 @@ public Mono>> listVnetsWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listVnets( this.client.getEndpoint(), @@ -4033,6 +4062,7 @@ public Mono> getVnetFromServerFarmWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getVnetFromServerFarm( this.client.getEndpoint(), @@ -4225,6 +4255,7 @@ public Mono> getVnetGatewayWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getVnetGateway( this.client.getEndpoint(), @@ -4449,6 +4480,7 @@ public Mono> updateVnetGatewayWithResponseAsync( } else { connectionEnvelope.validate(); } + context = this.client.mergeContext(context); return service .updateVnetGateway( this.client.getEndpoint(), @@ -4668,6 +4700,7 @@ public Mono>> listRoutesForVnetWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listRoutesForVnet( this.client.getEndpoint(), @@ -4860,6 +4893,7 @@ public Mono>> getRouteForVnetWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getRouteForVnet( this.client.getEndpoint(), @@ -5077,6 +5111,7 @@ public Mono> createOrUpdateVnetRouteWithResponseAsync( } else { route.validate(); } + context = this.client.mergeContext(context); return service .createOrUpdateVnetRoute( this.client.getEndpoint(), @@ -5291,6 +5326,7 @@ public Mono> deleteVnetRouteWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .deleteVnetRoute( this.client.getEndpoint(), @@ -5490,6 +5526,7 @@ public Mono> updateVnetRouteWithResponseAsync( } else { route.validate(); } + context = this.client.mergeContext(context); return service .updateVnetRoute( this.client.getEndpoint(), @@ -5695,6 +5732,7 @@ public Mono> rebootWorkerWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .rebootWorker( this.client.getEndpoint(), @@ -5772,195 +5810,6 @@ public void rebootWorker(String resourceGroupName, String name, String workerNam rebootWorkerAsync(resourceGroupName, name, workerName, context).block(); } - /** - * Description for Creates or updates an App Service Plan. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @param appServicePlan App Service plan. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return app Service plan. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginCreateOrUpdateWithoutPollingWithResponseAsync( - String resourceGroupName, String name, AppServicePlanInner appServicePlan) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (appServicePlan == null) { - return Mono.error(new IllegalArgumentException("Parameter appServicePlan is required and cannot be null.")); - } else { - appServicePlan.validate(); - } - return FluxUtil - .withContext( - context -> - service - .beginCreateOrUpdateWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - appServicePlan, - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Description for Creates or updates an App Service Plan. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @param appServicePlan App Service plan. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return app Service plan. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginCreateOrUpdateWithoutPollingWithResponseAsync( - String resourceGroupName, String name, AppServicePlanInner appServicePlan, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (appServicePlan == null) { - return Mono.error(new IllegalArgumentException("Parameter appServicePlan is required and cannot be null.")); - } else { - appServicePlan.validate(); - } - return service - .beginCreateOrUpdateWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - appServicePlan, - context); - } - - /** - * Description for Creates or updates an App Service Plan. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @param appServicePlan App Service plan. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return app Service plan. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginCreateOrUpdateWithoutPollingAsync( - String resourceGroupName, String name, AppServicePlanInner appServicePlan) { - return beginCreateOrUpdateWithoutPollingWithResponseAsync(resourceGroupName, name, appServicePlan) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Description for Creates or updates an App Service Plan. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @param appServicePlan App Service plan. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return app Service plan. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginCreateOrUpdateWithoutPollingAsync( - String resourceGroupName, String name, AppServicePlanInner appServicePlan, Context context) { - return beginCreateOrUpdateWithoutPollingWithResponseAsync(resourceGroupName, name, appServicePlan, context) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Description for Creates or updates an App Service Plan. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @param appServicePlan App Service plan. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return app Service plan. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public AppServicePlanInner beginCreateOrUpdateWithoutPolling( - String resourceGroupName, String name, AppServicePlanInner appServicePlan) { - return beginCreateOrUpdateWithoutPollingAsync(resourceGroupName, name, appServicePlan).block(); - } - - /** - * Description for Creates or updates an App Service Plan. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @param appServicePlan App Service plan. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return app Service plan. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public AppServicePlanInner beginCreateOrUpdateWithoutPolling( - String resourceGroupName, String name, AppServicePlanInner appServicePlan, Context context) { - return beginCreateOrUpdateWithoutPollingAsync(resourceGroupName, name, appServicePlan, context).block(); - } - /** * Get the next page of items. * @@ -6004,6 +5853,7 @@ public Mono> listNextSinglePageAsync(String n if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listNext(nextLink, context) .map( @@ -6061,6 +5911,7 @@ public Mono> listByResourceGroupNextSinglePag if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listByResourceGroupNext(nextLink, context) .map( @@ -6118,6 +5969,7 @@ public Mono> listWebAppsByHybridConnectionNextSinglePageAs if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listWebAppsByHybridConnectionNext(nextLink, context) .map( @@ -6175,6 +6027,7 @@ public Mono> listHybridConnectionsNextSingl if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listHybridConnectionsNext(nextLink, context) .map( @@ -6231,6 +6084,7 @@ public Mono> listWebAppsNextSinglePageAsync(String next if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listWebAppsNext(nextLink, context) .map( @@ -6287,6 +6141,7 @@ public Mono> listUsagesNextSinglePageAsync(Str if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listUsagesNext(nextLink, context) .map( diff --git a/sdk/appservice/mgmt/src/main/java/com/azure/resourcemanager/appservice/fluent/CertificateRegistrationProvidersClient.java b/sdk/appservice/mgmt/src/main/java/com/azure/resourcemanager/appservice/fluent/CertificateRegistrationProvidersClient.java index d9a4bc50e874e..6f119194d0362 100644 --- a/sdk/appservice/mgmt/src/main/java/com/azure/resourcemanager/appservice/fluent/CertificateRegistrationProvidersClient.java +++ b/sdk/appservice/mgmt/src/main/java/com/azure/resourcemanager/appservice/fluent/CertificateRegistrationProvidersClient.java @@ -126,6 +126,7 @@ public Mono> listOperationsSinglePag new IllegalArgumentException( "Parameter this.client.getEndpoint() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listOperations(this.client.getEndpoint(), this.client.getApiVersion(), context) .map( @@ -241,6 +242,7 @@ public Mono> listOperationsNextSingl if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listOperationsNext(nextLink, context) .map( diff --git a/sdk/appservice/mgmt/src/main/java/com/azure/resourcemanager/appservice/fluent/CertificatesClient.java b/sdk/appservice/mgmt/src/main/java/com/azure/resourcemanager/appservice/fluent/CertificatesClient.java index bdb48e2f64ba9..948e95fe9f067 100644 --- a/sdk/appservice/mgmt/src/main/java/com/azure/resourcemanager/appservice/fluent/CertificatesClient.java +++ b/sdk/appservice/mgmt/src/main/java/com/azure/resourcemanager/appservice/fluent/CertificatesClient.java @@ -226,6 +226,7 @@ public Mono> listSinglePageAsync(Context context new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .list(this.client.getEndpoint(), this.client.getSubscriptionId(), this.client.getApiVersion(), context) .map( @@ -369,6 +370,7 @@ public Mono> listByResourceGroupSinglePageAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listByResourceGroup( this.client.getEndpoint(), @@ -527,6 +529,7 @@ public Mono> getByResourceGroupWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getByResourceGroup( this.client.getEndpoint(), @@ -709,6 +712,7 @@ public Mono> createOrUpdateWithResponseAsync( } else { certificateEnvelope.validate(); } + context = this.client.mergeContext(context); return service .createOrUpdate( this.client.getEndpoint(), @@ -883,6 +887,7 @@ public Mono> deleteWithResponseAsync(String resourceGroupName, St new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .delete( this.client.getEndpoint(), @@ -1047,6 +1052,7 @@ public Mono> updateWithResponseAsync( } else { certificateEnvelope.validate(); } + context = this.client.mergeContext(context); return service .update( this.client.getEndpoint(), @@ -1187,6 +1193,7 @@ public Mono> listNextSinglePageAsync(String next if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listNext(nextLink, context) .map( @@ -1244,6 +1251,7 @@ public Mono> listByResourceGroupNextSinglePageAs if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listByResourceGroupNext(nextLink, context) .map( diff --git a/sdk/appservice/mgmt/src/main/java/com/azure/resourcemanager/appservice/fluent/DeletedWebAppsClient.java b/sdk/appservice/mgmt/src/main/java/com/azure/resourcemanager/appservice/fluent/DeletedWebAppsClient.java index 15b135befa773..7583e86abf310 100644 --- a/sdk/appservice/mgmt/src/main/java/com/azure/resourcemanager/appservice/fluent/DeletedWebAppsClient.java +++ b/sdk/appservice/mgmt/src/main/java/com/azure/resourcemanager/appservice/fluent/DeletedWebAppsClient.java @@ -172,6 +172,7 @@ public Mono> listSinglePageAsync(Context context new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .list(this.client.getEndpoint(), this.client.getSubscriptionId(), this.client.getApiVersion(), context) .map( @@ -312,6 +313,7 @@ public Mono> listByLocationSinglePageAsync(Strin new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listByLocation( this.client.getEndpoint(), @@ -468,6 +470,7 @@ public Mono> getDeletedWebAppByLocationWithResponseAs new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getDeletedWebAppByLocation( this.client.getEndpoint(), @@ -600,6 +603,7 @@ public Mono> listNextSinglePageAsync(String next if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listNext(nextLink, context) .map( @@ -656,6 +660,7 @@ public Mono> listByLocationNextSinglePageAsync(S if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listByLocationNext(nextLink, context) .map( diff --git a/sdk/appservice/mgmt/src/main/java/com/azure/resourcemanager/appservice/fluent/DiagnosticsClient.java b/sdk/appservice/mgmt/src/main/java/com/azure/resourcemanager/appservice/fluent/DiagnosticsClient.java index 5f300f8935d75..d2119d09811f8 100644 --- a/sdk/appservice/mgmt/src/main/java/com/azure/resourcemanager/appservice/fluent/DiagnosticsClient.java +++ b/sdk/appservice/mgmt/src/main/java/com/azure/resourcemanager/appservice/fluent/DiagnosticsClient.java @@ -584,6 +584,7 @@ public Mono> listHostingEnvironmentDetector new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listHostingEnvironmentDetectorResponses( this.client.getEndpoint(), @@ -781,6 +782,7 @@ public Mono> getHostingEnvironmentDetectorRespon new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getHostingEnvironmentDetectorResponse( this.client.getEndpoint(), @@ -1062,6 +1064,7 @@ public Mono> listSiteDetectorResponsesSingl new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listSiteDetectorResponses( this.client.getEndpoint(), @@ -1257,6 +1260,7 @@ public Mono> getSiteDetectorResponseWithResponse new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getSiteDetectorResponse( this.client.getEndpoint(), @@ -1536,6 +1540,7 @@ public Mono> listSiteDiagnosticCategories new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listSiteDiagnosticCategories( this.client.getEndpoint(), @@ -1715,6 +1720,7 @@ public Mono> getSiteDiagnosticCategoryWithResp new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getSiteDiagnosticCategory( this.client.getEndpoint(), @@ -1911,6 +1917,7 @@ public Mono> listSiteAnalysesSinglePageAs new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listSiteAnalyses( this.client.getEndpoint(), @@ -2104,6 +2111,7 @@ public Mono> getSiteAnalysisWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getSiteAnalysis( this.client.getEndpoint(), @@ -2327,6 +2335,7 @@ public Mono> executeSiteAnalysisWithResponseAs new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .executeSiteAnalysis( this.client.getEndpoint(), @@ -2630,6 +2639,7 @@ public Mono> listSiteDetectorsSinglePageA new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listSiteDetectors( this.client.getEndpoint(), @@ -2823,6 +2833,7 @@ public Mono> getSiteDetectorWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getSiteDetector( this.client.getEndpoint(), @@ -3046,6 +3057,7 @@ public Mono> executeSiteDetectorWithRe new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .executeSiteDetector( this.client.getEndpoint(), @@ -3347,6 +3359,7 @@ public Mono> listSiteDetectorResponsesSlotS new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listSiteDetectorResponsesSlot( this.client.getEndpoint(), @@ -3560,6 +3573,7 @@ public Mono> getSiteDetectorResponseSlotWithResp new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getSiteDetectorResponseSlot( this.client.getEndpoint(), @@ -3861,6 +3875,7 @@ public Mono> listSiteDiagnosticCategories new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listSiteDiagnosticCategoriesSlot( this.client.getEndpoint(), @@ -4054,6 +4069,7 @@ public Mono> getSiteDiagnosticCategorySlotWith new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getSiteDiagnosticCategorySlot( this.client.getEndpoint(), @@ -4266,6 +4282,7 @@ public Mono> listSiteAnalysesSlotSinglePa new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listSiteAnalysesSlot( this.client.getEndpoint(), @@ -4479,6 +4496,7 @@ public Mono> getSiteAnalysisSlotWithResponseAs new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getSiteAnalysisSlot( this.client.getEndpoint(), @@ -4730,6 +4748,7 @@ public Mono> executeSiteAnalysisSlotWithRespon new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .executeSiteAnalysisSlot( this.client.getEndpoint(), @@ -5069,6 +5088,7 @@ public Mono> listSiteDetectorsSlotSingleP new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listSiteDetectorsSlot( this.client.getEndpoint(), @@ -5282,6 +5302,7 @@ public Mono> getSiteDetectorSlotWithResponseAs new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getSiteDetectorSlot( this.client.getEndpoint(), @@ -5533,6 +5554,7 @@ public Mono> executeSiteDetectorSlotWi new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .executeSiteDetectorSlot( this.client.getEndpoint(), @@ -5809,6 +5831,7 @@ public Mono> listHostingEnvironmentDetector if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listHostingEnvironmentDetectorResponsesNext(nextLink, context) .map( @@ -5866,6 +5889,7 @@ public Mono> listSiteDetectorResponsesNextS if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listSiteDetectorResponsesNext(nextLink, context) .map( @@ -5924,6 +5948,7 @@ public Mono> listSiteDiagnosticCategories if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listSiteDiagnosticCategoriesNext(nextLink, context) .map( @@ -5981,6 +6006,7 @@ public Mono> listSiteAnalysesNextSinglePa if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listSiteAnalysesNext(nextLink, context) .map( @@ -6038,6 +6064,7 @@ public Mono> listSiteDetectorsNextSingleP if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listSiteDetectorsNext(nextLink, context) .map( @@ -6096,6 +6123,7 @@ public Mono> listSiteDetectorResponsesSlotN if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listSiteDetectorResponsesSlotNext(nextLink, context) .map( @@ -6154,6 +6182,7 @@ public Mono> listSiteDiagnosticCategories if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listSiteDiagnosticCategoriesSlotNext(nextLink, context) .map( @@ -6211,6 +6240,7 @@ public Mono> listSiteAnalysesSlotNextSing if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listSiteAnalysesSlotNext(nextLink, context) .map( @@ -6268,6 +6298,7 @@ public Mono> listSiteDetectorsSlotNextSin if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listSiteDetectorsSlotNext(nextLink, context) .map( diff --git a/sdk/appservice/mgmt/src/main/java/com/azure/resourcemanager/appservice/fluent/DomainRegistrationProvidersClient.java b/sdk/appservice/mgmt/src/main/java/com/azure/resourcemanager/appservice/fluent/DomainRegistrationProvidersClient.java index 7eed1cecc2b6a..f8c2dd735509c 100644 --- a/sdk/appservice/mgmt/src/main/java/com/azure/resourcemanager/appservice/fluent/DomainRegistrationProvidersClient.java +++ b/sdk/appservice/mgmt/src/main/java/com/azure/resourcemanager/appservice/fluent/DomainRegistrationProvidersClient.java @@ -124,6 +124,7 @@ public Mono> listOperationsSinglePag new IllegalArgumentException( "Parameter this.client.getEndpoint() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listOperations(this.client.getEndpoint(), this.client.getApiVersion(), context) .map( @@ -239,6 +240,7 @@ public Mono> listOperationsNextSingl if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listOperationsNext(nextLink, context) .map( diff --git a/sdk/appservice/mgmt/src/main/java/com/azure/resourcemanager/appservice/fluent/DomainsClient.java b/sdk/appservice/mgmt/src/main/java/com/azure/resourcemanager/appservice/fluent/DomainsClient.java index 3e7157c3002c6..8f0670685147b 100644 --- a/sdk/appservice/mgmt/src/main/java/com/azure/resourcemanager/appservice/fluent/DomainsClient.java +++ b/sdk/appservice/mgmt/src/main/java/com/azure/resourcemanager/appservice/fluent/DomainsClient.java @@ -31,6 +31,7 @@ import com.azure.core.util.FluxUtil; import com.azure.core.util.logging.ClientLogger; import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.appservice.WebSiteManagementClient; import com.azure.resourcemanager.appservice.fluent.inner.DomainAvailabilityCheckResultInner; import com.azure.resourcemanager.appservice.fluent.inner.DomainCollectionInner; @@ -282,21 +283,6 @@ Mono> renew( @QueryParam("api-version") String apiVersion, Context context); - @Headers({"Accept: application/json", "Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DomainRegistration" - + "/domains/{domainName}") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> beginCreateOrUpdateWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("domainName") String domainName, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") DomainInner domain, - Context context); - @Headers({"Accept: application/json", "Content-Type: application/json"}) @Get("{nextLink}") @ExpectedResponses({200}) @@ -391,6 +377,7 @@ public Mono> checkAvailabilityWithR } NameIdentifierInner identifier = new NameIdentifierInner(); identifier.withName(name); + context = this.client.mergeContext(context); return service .checkAvailability( this.client.getEndpoint(), @@ -539,6 +526,7 @@ public Mono> listSinglePageAsync(Context context) { new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .list(this.client.getEndpoint(), this.client.getSubscriptionId(), this.client.getApiVersion(), context) .map( @@ -661,6 +649,7 @@ public Mono> getControlCenterSsoReq new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getControlCenterSsoRequest( this.client.getEndpoint(), this.client.getSubscriptionId(), this.client.getApiVersion(), context); @@ -815,6 +804,7 @@ public Mono> listRecommendationsSinglePageAsy } else { parameters.validate(); } + context = this.client.mergeContext(context); return service .listRecommendations( this.client.getEndpoint(), @@ -975,6 +965,7 @@ public Mono> listByResourceGroupSinglePageAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listByResourceGroup( this.client.getEndpoint(), @@ -1134,6 +1125,7 @@ public Mono> getByResourceGroupWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getByResourceGroup( this.client.getEndpoint(), @@ -1314,6 +1306,7 @@ public Mono>> createOrUpdateWithResponseAsync( } else { domain.validate(); } + context = this.client.mergeContext(context); return service .createOrUpdate( this.client.getEndpoint(), @@ -1337,7 +1330,7 @@ public Mono>> createOrUpdateWithResponseAsync( * @return information about a domain. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, DomainInner> beginCreateOrUpdate( + public PollerFlux, DomainInner> beginCreateOrUpdateAsync( String resourceGroupName, String domainName, DomainInner domain) { Mono>> mono = createOrUpdateWithResponseAsync(resourceGroupName, domainName, domain); return this @@ -1359,7 +1352,7 @@ public PollerFlux, DomainInner> beginCreateOrUpdate( * @return information about a domain. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, DomainInner> beginCreateOrUpdate( + public PollerFlux, DomainInner> beginCreateOrUpdateAsync( String resourceGroupName, String domainName, DomainInner domain, Context context) { Mono>> mono = createOrUpdateWithResponseAsync(resourceGroupName, domainName, domain, context); @@ -1369,6 +1362,41 @@ public PollerFlux, DomainInner> beginCreateOrUpdate( mono, this.client.getHttpPipeline(), DomainInner.class, DomainInner.class); } + /** + * Description for Creates or updates a domain. + * + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param domainName Name of the domain. + * @param domain Information about a domain. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about a domain. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, DomainInner> beginCreateOrUpdate( + String resourceGroupName, String domainName, DomainInner domain) { + return beginCreateOrUpdateAsync(resourceGroupName, domainName, domain).getSyncPoller(); + } + + /** + * Description for Creates or updates a domain. + * + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param domainName Name of the domain. + * @param domain Information about a domain. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about a domain. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, DomainInner> beginCreateOrUpdate( + String resourceGroupName, String domainName, DomainInner domain, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, domainName, domain, context).getSyncPoller(); + } + /** * Description for Creates or updates a domain. * @@ -1382,13 +1410,9 @@ public PollerFlux, DomainInner> beginCreateOrUpdate( */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono createOrUpdateAsync(String resourceGroupName, String domainName, DomainInner domain) { - Mono>> mono = createOrUpdateWithResponseAsync(resourceGroupName, domainName, domain); - return this - .client - .getLroResultAsync( - mono, this.client.getHttpPipeline(), DomainInner.class, DomainInner.class) + return beginCreateOrUpdateAsync(resourceGroupName, domainName, domain) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -1406,14 +1430,9 @@ public Mono createOrUpdateAsync(String resourceGroupName, String do @ServiceMethod(returns = ReturnType.SINGLE) public Mono createOrUpdateAsync( String resourceGroupName, String domainName, DomainInner domain, Context context) { - Mono>> mono = - createOrUpdateWithResponseAsync(resourceGroupName, domainName, domain, context); - return this - .client - .getLroResultAsync( - mono, this.client.getHttpPipeline(), DomainInner.class, DomainInner.class) + return beginCreateOrUpdateAsync(resourceGroupName, domainName, domain, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -1534,6 +1553,7 @@ public Mono> deleteWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .delete( this.client.getEndpoint(), @@ -1742,6 +1762,7 @@ public Mono> updateWithResponseAsync( } else { domain.validate(); } + context = this.client.mergeContext(context); return service .update( this.client.getEndpoint(), @@ -1925,6 +1946,7 @@ public Mono> listOwnershipIdentifi new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listOwnershipIdentifiers( this.client.getEndpoint(), @@ -2102,6 +2124,7 @@ public Mono> getOwnershipIdentifierWith new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getOwnershipIdentifier( this.client.getEndpoint(), @@ -2315,6 +2338,7 @@ public Mono> createOrUpdateOwnershipIde } else { domainOwnershipIdentifier.validate(); } + context = this.client.mergeContext(context); return service .createOrUpdateOwnershipIdentifier( this.client.getEndpoint(), @@ -2528,6 +2552,7 @@ public Mono> deleteOwnershipIdentifierWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .deleteOwnershipIdentifier( this.client.getEndpoint(), @@ -2722,6 +2747,7 @@ public Mono> updateOwnershipIdentifierW } else { domainOwnershipIdentifier.validate(); } + context = this.client.mergeContext(context); return service .updateOwnershipIdentifier( this.client.getEndpoint(), @@ -2922,6 +2948,7 @@ public Mono> renewWithResponseAsync(String resourceGroupName, Str new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .renew( this.client.getEndpoint(), @@ -2993,195 +3020,6 @@ public void renew(String resourceGroupName, String domainName, Context context) renewAsync(resourceGroupName, domainName, context).block(); } - /** - * Description for Creates or updates a domain. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param domainName Name of the domain. - * @param domain Information about a domain. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about a domain. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginCreateOrUpdateWithoutPollingWithResponseAsync( - String resourceGroupName, String domainName, DomainInner domain) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (domainName == null) { - return Mono.error(new IllegalArgumentException("Parameter domainName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (domain == null) { - return Mono.error(new IllegalArgumentException("Parameter domain is required and cannot be null.")); - } else { - domain.validate(); - } - return FluxUtil - .withContext( - context -> - service - .beginCreateOrUpdateWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - domainName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - domain, - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Description for Creates or updates a domain. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param domainName Name of the domain. - * @param domain Information about a domain. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about a domain. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginCreateOrUpdateWithoutPollingWithResponseAsync( - String resourceGroupName, String domainName, DomainInner domain, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (domainName == null) { - return Mono.error(new IllegalArgumentException("Parameter domainName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (domain == null) { - return Mono.error(new IllegalArgumentException("Parameter domain is required and cannot be null.")); - } else { - domain.validate(); - } - return service - .beginCreateOrUpdateWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - domainName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - domain, - context); - } - - /** - * Description for Creates or updates a domain. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param domainName Name of the domain. - * @param domain Information about a domain. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about a domain. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginCreateOrUpdateWithoutPollingAsync( - String resourceGroupName, String domainName, DomainInner domain) { - return beginCreateOrUpdateWithoutPollingWithResponseAsync(resourceGroupName, domainName, domain) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Description for Creates or updates a domain. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param domainName Name of the domain. - * @param domain Information about a domain. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about a domain. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginCreateOrUpdateWithoutPollingAsync( - String resourceGroupName, String domainName, DomainInner domain, Context context) { - return beginCreateOrUpdateWithoutPollingWithResponseAsync(resourceGroupName, domainName, domain, context) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Description for Creates or updates a domain. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param domainName Name of the domain. - * @param domain Information about a domain. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about a domain. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public DomainInner beginCreateOrUpdateWithoutPolling( - String resourceGroupName, String domainName, DomainInner domain) { - return beginCreateOrUpdateWithoutPollingAsync(resourceGroupName, domainName, domain).block(); - } - - /** - * Description for Creates or updates a domain. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param domainName Name of the domain. - * @param domain Information about a domain. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about a domain. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public DomainInner beginCreateOrUpdateWithoutPolling( - String resourceGroupName, String domainName, DomainInner domain, Context context) { - return beginCreateOrUpdateWithoutPollingAsync(resourceGroupName, domainName, domain, context).block(); - } - /** * Get the next page of items. * @@ -3225,6 +3063,7 @@ public Mono> listNextSinglePageAsync(String nextLink, if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listNext(nextLink, context) .map( @@ -3282,6 +3121,7 @@ public Mono> listRecommendationsNextSinglePag if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listRecommendationsNext(nextLink, context) .map( @@ -3338,6 +3178,7 @@ public Mono> listByResourceGroupNextSinglePageAsync(S if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listByResourceGroupNext(nextLink, context) .map( @@ -3396,6 +3237,7 @@ public Mono> listOwnershipIdentifi if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listOwnershipIdentifiersNext(nextLink, context) .map( diff --git a/sdk/appservice/mgmt/src/main/java/com/azure/resourcemanager/appservice/fluent/ProvidersClient.java b/sdk/appservice/mgmt/src/main/java/com/azure/resourcemanager/appservice/fluent/ProvidersClient.java index 6c201bb0d1371..cffc01e192bd1 100644 --- a/sdk/appservice/mgmt/src/main/java/com/azure/resourcemanager/appservice/fluent/ProvidersClient.java +++ b/sdk/appservice/mgmt/src/main/java/com/azure/resourcemanager/appservice/fluent/ProvidersClient.java @@ -166,6 +166,7 @@ public Mono> getAvailableStacksSing new IllegalArgumentException( "Parameter this.client.getEndpoint() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getAvailableStacks(this.client.getEndpoint(), osTypeSelected, this.client.getApiVersion(), context) .map( @@ -322,6 +323,7 @@ public Mono> listOperationsSinglePag new IllegalArgumentException( "Parameter this.client.getEndpoint() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listOperations(this.client.getEndpoint(), this.client.getApiVersion(), context) .map( @@ -464,6 +466,7 @@ public Mono> listSinglePageAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .list( this.client.getEndpoint(), @@ -618,6 +621,7 @@ public Mono> getAvailableStacksNext if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getAvailableStacksNext(nextLink, context) .map( @@ -675,6 +679,7 @@ public Mono> listOperationsNextSingl if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listOperationsNext(nextLink, context) .map( @@ -733,6 +738,7 @@ public Mono> getAvailableStacksOnPr if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getAvailableStacksOnPremNext(nextLink, context) .map( diff --git a/sdk/appservice/mgmt/src/main/java/com/azure/resourcemanager/appservice/fluent/RecommendationsClient.java b/sdk/appservice/mgmt/src/main/java/com/azure/resourcemanager/appservice/fluent/RecommendationsClient.java index a596d839a5089..07d5fee61bd75 100644 --- a/sdk/appservice/mgmt/src/main/java/com/azure/resourcemanager/appservice/fluent/RecommendationsClient.java +++ b/sdk/appservice/mgmt/src/main/java/com/azure/resourcemanager/appservice/fluent/RecommendationsClient.java @@ -395,6 +395,7 @@ public Mono> listSinglePageAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .list( this.client.getEndpoint(), @@ -577,6 +578,7 @@ public Mono> resetAllFiltersWithResponseAsync(Context context) { new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .resetAllFilters( this.client.getEndpoint(), this.client.getSubscriptionId(), this.client.getApiVersion(), context); @@ -698,6 +700,7 @@ public Mono> disableRecommendationForSubscriptionWithResponseAsyn new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .disableRecommendationForSubscription( this.client.getEndpoint(), name, this.client.getSubscriptionId(), this.client.getApiVersion(), context); @@ -865,6 +868,7 @@ public Mono> listHistoryForHostingEnvironment new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listHistoryForHostingEnvironment( this.client.getEndpoint(), @@ -1128,6 +1132,7 @@ public Mono> listRecommendedRulesForHostingEn new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listRecommendedRulesForHostingEnvironment( this.client.getEndpoint(), @@ -1381,6 +1386,7 @@ public Mono> disableAllForHostingEnvironmentWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .disableAllForHostingEnvironment( this.client.getEndpoint(), @@ -1559,6 +1565,7 @@ public Mono> resetAllFiltersForHostingEnvironmentWithResponseAsyn new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .resetAllFiltersForHostingEnvironment( this.client.getEndpoint(), @@ -1754,6 +1761,7 @@ public Mono> getRuleDetailsByHostingEnvironmen new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getRuleDetailsByHostingEnvironment( this.client.getEndpoint(), @@ -2047,6 +2055,7 @@ public Mono> disableRecommendationForHostingEnvironmentWithRespon new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .disableRecommendationForHostingEnvironment( this.client.getEndpoint(), @@ -2239,6 +2248,7 @@ public Mono> listHistoryForWebAppSinglePageAs new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listHistoryForWebApp( this.client.getEndpoint(), @@ -2487,6 +2497,7 @@ public Mono> listRecommendedRulesForWebAppSin new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listRecommendedRulesForWebApp( this.client.getEndpoint(), @@ -2712,6 +2723,7 @@ public Mono> disableAllForWebAppWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .disableAllForWebApp( this.client.getEndpoint(), @@ -2862,6 +2874,7 @@ public Mono> resetAllFiltersForWebAppWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .resetAllFiltersForWebApp( this.client.getEndpoint(), @@ -3037,6 +3050,7 @@ public Mono> getRuleDetailsByWebAppWithRespons new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getRuleDetailsByWebApp( this.client.getEndpoint(), @@ -3299,6 +3313,7 @@ public Mono> disableRecommendationForSiteWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .disableRecommendationForSite( this.client.getEndpoint(), @@ -3420,6 +3435,7 @@ public Mono> listNextSinglePageAsync(String n if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listNext(nextLink, context) .map( @@ -3478,6 +3494,7 @@ public Mono> listHistoryForHostingEnvironment if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listHistoryForHostingEnvironmentNext(nextLink, context) .map( @@ -3536,6 +3553,7 @@ public Mono> listRecommendedRulesForHostingEn if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listRecommendedRulesForHostingEnvironmentNext(nextLink, context) .map( @@ -3593,6 +3611,7 @@ public Mono> listHistoryForWebAppNextSinglePa if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listHistoryForWebAppNext(nextLink, context) .map( @@ -3650,6 +3669,7 @@ public Mono> listRecommendedRulesForWebAppNex if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listRecommendedRulesForWebAppNext(nextLink, context) .map( diff --git a/sdk/appservice/mgmt/src/main/java/com/azure/resourcemanager/appservice/fluent/ResourceHealthMetadatasClient.java b/sdk/appservice/mgmt/src/main/java/com/azure/resourcemanager/appservice/fluent/ResourceHealthMetadatasClient.java index 4726bbf10c534..8ca374b254ad8 100644 --- a/sdk/appservice/mgmt/src/main/java/com/azure/resourcemanager/appservice/fluent/ResourceHealthMetadatasClient.java +++ b/sdk/appservice/mgmt/src/main/java/com/azure/resourcemanager/appservice/fluent/ResourceHealthMetadatasClient.java @@ -235,6 +235,7 @@ public Mono> listSinglePageAsync(Cont new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .list(this.client.getEndpoint(), this.client.getSubscriptionId(), this.client.getApiVersion(), context) .map( @@ -379,6 +380,7 @@ public Mono> listByResourceGroupSingl new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listByResourceGroup( this.client.getEndpoint(), @@ -547,6 +549,7 @@ public Mono> listBySiteSinglePageAsyn new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listBySite( this.client.getEndpoint(), @@ -713,6 +716,7 @@ public Mono> getBySiteWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getBySite( this.client.getEndpoint(), @@ -898,6 +902,7 @@ public Mono> listBySiteSlotSinglePage new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listBySiteSlot( this.client.getEndpoint(), @@ -1080,6 +1085,7 @@ public Mono> getBySiteSlotWithResponseAsyn new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getBySiteSlot( this.client.getEndpoint(), @@ -1218,6 +1224,7 @@ public Mono> listNextSinglePageAsync( if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listNext(nextLink, context) .map( @@ -1275,6 +1282,7 @@ public Mono> listByResourceGroupNextS if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listByResourceGroupNext(nextLink, context) .map( @@ -1332,6 +1340,7 @@ public Mono> listBySiteNextSinglePage if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listBySiteNext(nextLink, context) .map( @@ -1389,6 +1398,7 @@ public Mono> listBySiteSlotNextSingle if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listBySiteSlotNext(nextLink, context) .map( diff --git a/sdk/appservice/mgmt/src/main/java/com/azure/resourcemanager/appservice/fluent/ResourceProvidersClient.java b/sdk/appservice/mgmt/src/main/java/com/azure/resourcemanager/appservice/fluent/ResourceProvidersClient.java index 09e58a2cc6bb7..35d8dd6d09833 100644 --- a/sdk/appservice/mgmt/src/main/java/com/azure/resourcemanager/appservice/fluent/ResourceProvidersClient.java +++ b/sdk/appservice/mgmt/src/main/java/com/azure/resourcemanager/appservice/fluent/ResourceProvidersClient.java @@ -326,6 +326,7 @@ public Mono> getPublishingUserWithResponseAsync(Context cont new IllegalArgumentException( "Parameter this.client.getEndpoint() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service.getPublishingUser(this.client.getEndpoint(), this.client.getApiVersion(), context); } @@ -451,6 +452,7 @@ public Mono> updatePublishingUserWithResponseAsync(UserInner } else { userDetails.validate(); } + context = this.client.mergeContext(context); return service .updatePublishingUser(this.client.getEndpoint(), this.client.getApiVersion(), userDetails, context); } @@ -576,6 +578,7 @@ public Mono> listSourceControlsSinglePageAsync new IllegalArgumentException( "Parameter this.client.getEndpoint() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listSourceControls(this.client.getEndpoint(), this.client.getApiVersion(), context) .map( @@ -697,6 +700,7 @@ public Mono> getSourceControlWithResponseAsync( return Mono .error(new IllegalArgumentException("Parameter sourceControlType is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getSourceControl(this.client.getEndpoint(), sourceControlType, this.client.getApiVersion(), context); } @@ -845,6 +849,7 @@ public Mono> updateSourceControlWithResponseAsync( } else { requestMessage.validate(); } + context = this.client.mergeContext(context); return service .updateSourceControl( this.client.getEndpoint(), sourceControlType, this.client.getApiVersion(), requestMessage, context); @@ -1004,6 +1009,7 @@ public Mono> listSinglePageAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .list( this.client.getEndpoint(), @@ -1207,6 +1213,7 @@ public Mono> checkNameAvailabilityWithRe request.withName(name); request.withType(type); request.withIsFqdn(isFqdn); + context = this.client.mergeContext(context); return service .checkNameAvailability( this.client.getEndpoint(), @@ -1361,6 +1368,7 @@ public Mono> getSubscriptionDeploymentLocatio new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getSubscriptionDeploymentLocations( this.client.getEndpoint(), this.client.getSubscriptionId(), this.client.getApiVersion(), context); @@ -1528,6 +1536,7 @@ public Mono> listGeoRegionsSinglePageAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listGeoRegions( this.client.getEndpoint(), @@ -1766,6 +1775,7 @@ public Mono> listSiteIdentifiersAssignedToHostnam } NameIdentifierInner nameIdentifier = new NameIdentifierInner(); nameIdentifier.withName(name); + context = this.client.mergeContext(context); return service .listSiteIdentifiersAssignedToHostname( this.client.getEndpoint(), @@ -1911,6 +1921,7 @@ public Mono> listPremierAddOnOffersSingleP new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listPremierAddOnOffers( this.client.getEndpoint(), this.client.getSubscriptionId(), this.client.getApiVersion(), context) @@ -2037,6 +2048,7 @@ public Mono> listSkusWithResponseAsync(Context context) new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listSkus(this.client.getEndpoint(), this.client.getSubscriptionId(), this.client.getApiVersion(), context); } @@ -2183,6 +2195,7 @@ public Mono> verifyHostingEnvironmen } else { parameters.validate(); } + context = this.client.mergeContext(context); return service .verifyHostingEnvironmentVnet( this.client.getEndpoint(), @@ -2358,6 +2371,7 @@ public Mono> moveWithResponseAsync( } else { moveResourceEnvelope.validate(); } + context = this.client.mergeContext(context); return service .move( this.client.getEndpoint(), @@ -2520,6 +2534,7 @@ public Mono> validateWithResponseAsync( } else { validateRequest.validate(); } + context = this.client.mergeContext(context); return service .validate( this.client.getEndpoint(), @@ -2696,6 +2711,7 @@ public Mono> validateMoveWithResponseAsync( } else { moveResourceEnvelope.validate(); } + context = this.client.mergeContext(context); return service .validateMove( this.client.getEndpoint(), @@ -2817,6 +2833,7 @@ public Mono> listSourceControlsNextSinglePageA if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listSourceControlsNext(nextLink, context) .map( @@ -2874,6 +2891,7 @@ public Mono> listBillingMetersNextSinglePageAsy if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listBillingMetersNext(nextLink, context) .map( @@ -2930,6 +2948,7 @@ public Mono> listGeoRegionsNextSinglePageAsync(Str if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listGeoRegionsNext(nextLink, context) .map( @@ -2988,6 +3007,7 @@ public Mono> listSiteIdentifiersAssignedToHostnam if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listSiteIdentifiersAssignedToHostnameNext(nextLink, context) .map( @@ -3045,6 +3065,7 @@ public Mono> listPremierAddOnOffersNextSin if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listPremierAddOnOffersNext(nextLink, context) .map( diff --git a/sdk/appservice/mgmt/src/main/java/com/azure/resourcemanager/appservice/fluent/StaticSitesClient.java b/sdk/appservice/mgmt/src/main/java/com/azure/resourcemanager/appservice/fluent/StaticSitesClient.java index fac6576dbf672..349cb28c6e698 100644 --- a/sdk/appservice/mgmt/src/main/java/com/azure/resourcemanager/appservice/fluent/StaticSitesClient.java +++ b/sdk/appservice/mgmt/src/main/java/com/azure/resourcemanager/appservice/fluent/StaticSitesClient.java @@ -572,6 +572,7 @@ public Mono> listSinglePageAsync(Conte new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .list(this.client.getEndpoint(), this.client.getSubscriptionId(), this.client.getApiVersion(), context) .map( @@ -716,6 +717,7 @@ public Mono> listByResourceGroupSingle new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listByResourceGroup( this.client.getEndpoint(), @@ -875,6 +877,7 @@ public Mono> getByResourceGroupWithResponse new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getByResourceGroup( this.client.getEndpoint(), @@ -1058,6 +1061,7 @@ public Mono> createOrUpdateStaticSiteWithRe } else { staticSiteEnvelope.validate(); } + context = this.client.mergeContext(context); return service .createOrUpdateStaticSite( this.client.getEndpoint(), @@ -1233,6 +1237,7 @@ public Mono> deleteStaticSiteWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .deleteStaticSite( this.client.getEndpoint(), @@ -1398,6 +1403,7 @@ public Mono> updateStaticSiteWithResponseAs } else { staticSiteEnvelope.validate(); } + context = this.client.mergeContext(context); return service .updateStaticSite( this.client.getEndpoint(), @@ -1592,6 +1598,7 @@ public Mono> listStaticSiteUsersSi new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listStaticSiteUsers( this.client.getEndpoint(), @@ -1783,6 +1790,7 @@ public Mono> deleteStaticSiteUserWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .deleteStaticSiteUser( this.client.getEndpoint(), @@ -1991,6 +1999,7 @@ public Mono> updateStaticSiteUserWithRe } else { staticSiteUserEnvelope.validate(); } + context = this.client.mergeContext(context); return service .updateStaticSiteUser( this.client.getEndpoint(), @@ -2207,6 +2216,7 @@ public Mono> getStaticSiteBuildsS new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getStaticSiteBuilds( this.client.getEndpoint(), @@ -2382,6 +2392,7 @@ public Mono> getStaticSiteBuildWithRes new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getStaticSiteBuild( this.client.getEndpoint(), @@ -2566,6 +2577,7 @@ public Mono> deleteStaticSiteBuildWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .deleteStaticSiteBuild( this.client.getEndpoint(), @@ -2744,6 +2756,7 @@ public Mono> createOrUpdateStaticSiteBuildFuncti } else { appSettings.validate(); } + context = this.client.mergeContext(context); return service .createOrUpdateStaticSiteBuildFunctionAppSettings( this.client.getEndpoint(), @@ -2948,6 +2961,7 @@ public Mono> listStati new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listStaticSiteBuildFunctions( this.client.getEndpoint(), @@ -3130,6 +3144,7 @@ public Mono> listStaticSiteBuildFunctionAppSetti new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listStaticSiteBuildFunctionAppSettings( this.client.getEndpoint(), @@ -3319,6 +3334,7 @@ public Mono> createOrUpdateStaticSiteFunctionApp } else { appSettings.validate(); } + context = this.client.mergeContext(context); return service .createOrUpdateStaticSiteFunctionAppSettings( this.client.getEndpoint(), @@ -3520,6 +3536,7 @@ public Mono> createUserR } else { staticSiteUserRolesInvitationEnvelope.validate(); } + context = this.client.mergeContext(context); return service .createUserRolesInvitationLink( this.client.getEndpoint(), @@ -3720,6 +3737,7 @@ public StaticSiteUserInvitationResponseResourceInner createUserRolesInvitationLi new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listStaticSiteCustomDomains( this.client.getEndpoint(), @@ -3899,6 +3917,7 @@ public PagedIterable listStaticS new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .createOrUpdateStaticSiteCustomDomain( this.client.getEndpoint(), @@ -4084,6 +4103,7 @@ public Mono> deleteStaticSiteCustomDomainWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .deleteStaticSiteCustomDomain( this.client.getEndpoint(), @@ -4251,6 +4271,7 @@ public Mono> validateCustomDomainCanBeAddedToStaticSiteWithRespon new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .validateCustomDomainCanBeAddedToStaticSite( this.client.getEndpoint(), @@ -4409,6 +4430,7 @@ public Mono> detachStaticSiteWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .detachStaticSite( this.client.getEndpoint(), @@ -4568,6 +4590,7 @@ public Mono> listStati new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listStaticSiteFunctions( this.client.getEndpoint(), @@ -4736,6 +4759,7 @@ public Mono> listStaticSiteFunctionAppSettingsWi new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listStaticSiteFunctionAppSettings( this.client.getEndpoint(), @@ -4905,6 +4929,7 @@ public Mono> listStaticSiteSecretsWithResponseAs new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listStaticSiteSecrets( this.client.getEndpoint(), @@ -5093,6 +5118,7 @@ public Mono> resetStaticSiteApiKeyWithResponseAsync( } else { resetPropertiesEnvelope.validate(); } + context = this.client.mergeContext(context); return service .resetStaticSiteApiKey( this.client.getEndpoint(), @@ -5223,6 +5249,7 @@ public Mono> listNextSinglePageAsync(S if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listNext(nextLink, context) .map( @@ -5281,6 +5308,7 @@ public Mono> getStaticSitesByResourceG if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getStaticSitesByResourceGroupNext(nextLink, context) .map( @@ -5338,6 +5366,7 @@ public Mono> listStaticSiteUsersNe if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listStaticSiteUsersNext(nextLink, context) .map( @@ -5396,6 +5425,7 @@ public Mono> getStaticSiteBuildsN if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getStaticSiteBuildsNext(nextLink, context) .map( @@ -5454,6 +5484,7 @@ public Mono> getStaticSiteBuildsN if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listStaticSiteBuildFunctionsNext(nextLink, context) .map( @@ -5512,6 +5543,7 @@ public Mono> getStaticSiteBuildsN if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listStaticSiteCustomDomainsNext(nextLink, context) .map( @@ -5570,6 +5602,7 @@ public Mono> listStati if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listStaticSiteFunctionsNext(nextLink, context) .map( diff --git a/sdk/appservice/mgmt/src/main/java/com/azure/resourcemanager/appservice/fluent/TopLevelDomainsClient.java b/sdk/appservice/mgmt/src/main/java/com/azure/resourcemanager/appservice/fluent/TopLevelDomainsClient.java index 35435edb0ffd1..d9fbced033e4c 100644 --- a/sdk/appservice/mgmt/src/main/java/com/azure/resourcemanager/appservice/fluent/TopLevelDomainsClient.java +++ b/sdk/appservice/mgmt/src/main/java/com/azure/resourcemanager/appservice/fluent/TopLevelDomainsClient.java @@ -178,6 +178,7 @@ public Mono> listSinglePageAsync(Context cont new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .list(this.client.getEndpoint(), this.client.getSubscriptionId(), this.client.getApiVersion(), context) .map( @@ -309,6 +310,7 @@ public Mono> getWithResponseAsync(String name, Con new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .get( this.client.getEndpoint(), name, this.client.getSubscriptionId(), this.client.getApiVersion(), context); @@ -480,6 +482,7 @@ public Mono> listAgreementsSinglePageAsync } else { agreementOption.validate(); } + context = this.client.mergeContext(context); return service .listAgreements( this.client.getEndpoint(), @@ -612,6 +615,7 @@ public Mono> listNextSinglePageAsync(String n if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listNext(nextLink, context) .map( @@ -669,6 +673,7 @@ public Mono> listAgreementsNextSinglePageA if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listAgreementsNext(nextLink, context) .map( diff --git a/sdk/appservice/mgmt/src/main/java/com/azure/resourcemanager/appservice/fluent/WebAppsClient.java b/sdk/appservice/mgmt/src/main/java/com/azure/resourcemanager/appservice/fluent/WebAppsClient.java index 97a01737de3ca..a3b283d380417 100644 --- a/sdk/appservice/mgmt/src/main/java/com/azure/resourcemanager/appservice/fluent/WebAppsClient.java +++ b/sdk/appservice/mgmt/src/main/java/com/azure/resourcemanager/appservice/fluent/WebAppsClient.java @@ -33,6 +33,7 @@ import com.azure.core.util.FluxUtil; import com.azure.core.util.logging.ClientLogger; import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.appservice.WebSiteManagementClient; import com.azure.resourcemanager.appservice.fluent.inner.AzureStoragePropertyDictionaryResourceInner; import com.azure.resourcemanager.appservice.fluent.inner.BackupItemCollectionInner; @@ -135,7 +136,8 @@ import java.io.InputStream; import java.io.SequenceInputStream; import java.nio.ByteBuffer; -import java.util.Collections; +import java.util.Enumeration; +import java.util.Iterator; import java.util.List; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; @@ -5890,544 +5892,6 @@ Mono> getWebJob( @QueryParam("api-version") String apiVersion, Context context); - @Headers({"Accept: application/json", "Content-Type: application/json"}) - @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> beginCreateOrUpdateWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") SiteInner siteEnvelope, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/backups/{backupId}/restore") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> beginRestoreWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("backupId") String backupId, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") RestoreRequestInner request, - Context context); - - @Headers({"Accept: application/json", "Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/config/publishingcredentials/list") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> beginListPublishingCredentialsWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - Context context); - - @Headers({"Accept: application/json", "Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/extensions/MSDeploy") - @ExpectedResponses({201, 409}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> beginCreateMSDeployOperationWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") MSDeploy mSDeploy, - Context context); - - @Headers({"Accept: application/json", "Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/functions/{functionName}") - @ExpectedResponses({201}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> beginCreateFunctionWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("functionName") String functionName, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") FunctionEnvelopeInner functionEnvelope, - Context context); - - @Headers({"Accept: application/json", "Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/instances/{instanceId}/extensions/MSDeploy") - @ExpectedResponses({201, 409}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> beginCreateInstanceMSDeployOperationWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("instanceId") String instanceId, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") MSDeploy mSDeploy, - Context context); - - @Headers({"Accept: application/json", "Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/migrate") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> beginMigrateStorageWithoutPolling( - @HostParam("$host") String endpoint, - @QueryParam("subscriptionName") String subscriptionName, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") StorageMigrationOptions migrationOptions, - Context context); - - @Headers({"Accept: application/json", "Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/migratemysql") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> beginMigrateMySqlWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") MigrateMySqlRequest migrationRequestEnvelope, - Context context); - - @Headers({"Accept: application/json", "Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/networkTrace/startOperation") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> beginStartWebSiteNetworkTraceOperationWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @QueryParam("durationInSeconds") Integer durationInSeconds, - @QueryParam("maxFrameLength") Integer maxFrameLength, - @QueryParam("sasUrl") String sasUrl, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/restoreFromBackupBlob") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> beginRestoreFromBackupBlobWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") RestoreRequestInner request, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/restoreFromDeletedApp") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> beginRestoreFromDeletedAppWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") DeletedAppRestoreRequest restoreRequest, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/restoreSnapshot") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> beginRestoreSnapshotWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") SnapshotRestoreRequest restoreRequest, - Context context); - - @Headers({"Accept: application/json", "Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/siteextensions/{siteExtensionId}") - @ExpectedResponses({200, 201, 429}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> beginInstallSiteExtensionWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("siteExtensionId") String siteExtensionId, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/slotcopy") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> beginCopyProductionSlotWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") CsmCopySlotEntityInner copySlotEntity, - Context context); - - @Headers({"Accept: application/json", "Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/slots/{slot}") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> beginCreateOrUpdateSlotWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("slot") String slot, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") SiteInner siteEnvelope, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/slots/{slot}/backups/{backupId}/restore") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> beginRestoreSlotWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("backupId") String backupId, - @PathParam("slot") String slot, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") RestoreRequestInner request, - Context context); - - @Headers({"Accept: application/json", "Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/slots/{slot}/config/publishingcredentials/list") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> beginListPublishingCredentialsSlotWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("slot") String slot, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - Context context); - - @Headers({"Accept: application/json", "Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/slots/{slot}/extensions/MSDeploy") - @ExpectedResponses({201, 409}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> beginCreateMSDeployOperationSlotWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("slot") String slot, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") MSDeploy mSDeploy, - Context context); - - @Headers({"Accept: application/json", "Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/slots/{slot}/functions/{functionName}") - @ExpectedResponses({201}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> beginCreateInstanceFunctionSlotWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("functionName") String functionName, - @PathParam("slot") String slot, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") FunctionEnvelopeInner functionEnvelope, - Context context); - - @Headers({"Accept: application/json", "Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/slots/{slot}/instances/{instanceId}/extensions/MSDeploy") - @ExpectedResponses({201, 409}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> beginCreateInstanceMSDeployOperationSlotWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("slot") String slot, - @PathParam("instanceId") String instanceId, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") MSDeploy mSDeploy, - Context context); - - @Headers({"Accept: application/json", "Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/slots/{slot}/networkTrace/startOperation") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> beginStartWebSiteNetworkTraceOperationSlotWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @QueryParam("durationInSeconds") Integer durationInSeconds, - @PathParam("slot") String slot, - @QueryParam("maxFrameLength") Integer maxFrameLength, - @QueryParam("sasUrl") String sasUrl, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - Context context); - - @Headers({"Accept: application/json", "Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/privateEndpointConnections/{privateEndpointConnectionName}") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> - beginApproveOrRejectPrivateEndpointConnectionWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") PrivateLinkConnectionApprovalRequestResource privateEndpointWrapper, - Context context); - - @Headers({"Accept: application/json", "Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/privateEndpointConnections/{privateEndpointConnectionName}") - @ExpectedResponses({200, 202, 204}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> beginDeletePrivateEndpointConnectionWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/slots/{slot}/restoreFromBackupBlob") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> beginRestoreFromBackupBlobSlotWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("slot") String slot, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") RestoreRequestInner request, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/slots/{slot}/restoreFromDeletedApp") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> beginRestoreFromDeletedAppSlotWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("slot") String slot, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") DeletedAppRestoreRequest restoreRequest, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/slots/{slot}/restoreSnapshot") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> beginRestoreSnapshotSlotWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("slot") String slot, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") SnapshotRestoreRequest restoreRequest, - Context context); - - @Headers({"Accept: application/json", "Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/slots/{slot}/siteextensions/{siteExtensionId}") - @ExpectedResponses({200, 201, 429}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> beginInstallSiteExtensionSlotWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("siteExtensionId") String siteExtensionId, - @PathParam("slot") String slot, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/slots/{slot}/slotcopy") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> beginCopySlotWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("slot") String slot, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") CsmCopySlotEntityInner copySlotEntity, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/slots/{slot}/slotsswap") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> beginSwapSlotWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("slot") String slot, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") CsmSlotEntity slotSwapEntity, - Context context); - - @Headers({"Accept: application/json", "Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/slots/{slot}/sourcecontrols/web") - @ExpectedResponses({200, 201, 202}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> beginCreateOrUpdateSourceControlSlotWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("slot") String slot, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") SiteSourceControlInner siteSourceControl, - Context context); - - @Headers({"Accept: application/json", "Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/slots/{slot}/startNetworkTrace") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> beginStartNetworkTraceSlotWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @QueryParam("durationInSeconds") Integer durationInSeconds, - @PathParam("slot") String slot, - @QueryParam("maxFrameLength") Integer maxFrameLength, - @QueryParam("sasUrl") String sasUrl, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/slotsswap") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> beginSwapSlotWithProductionWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") CsmSlotEntity slotSwapEntity, - Context context); - - @Headers({"Accept: application/json", "Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/sourcecontrols/web") - @ExpectedResponses({200, 201, 202}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> beginCreateOrUpdateSourceControlWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") SiteSourceControlInner siteSourceControl, - Context context); - - @Headers({"Accept: application/json", "Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/startNetworkTrace") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> beginStartNetworkTraceWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @QueryParam("durationInSeconds") Integer durationInSeconds, - @QueryParam("maxFrameLength") Integer maxFrameLength, - @QueryParam("sasUrl") String sasUrl, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - Context context); - @Headers({"Accept: application/json", "Content-Type: application/json"}) @Get("{nextLink}") @ExpectedResponses({200}) @@ -6879,6 +6343,7 @@ public Mono> listSinglePageAsync(Context context) { new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .list(this.client.getEndpoint(), this.client.getSubscriptionId(), this.client.getApiVersion(), context) .map( @@ -7028,6 +6493,7 @@ public Mono> listByResourceGroupSinglePageAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listByResourceGroup( this.client.getEndpoint(), @@ -7231,6 +6697,7 @@ public Mono> getByResourceGroupWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getByResourceGroup( this.client.getEndpoint(), @@ -7413,6 +6880,7 @@ public Mono>> createOrUpdateWithResponseAsync( } else { siteEnvelope.validate(); } + context = this.client.mergeContext(context); return service .createOrUpdate( this.client.getEndpoint(), @@ -7437,7 +6905,7 @@ public Mono>> createOrUpdateWithResponseAsync( * @return a web app, a mobile app backend, or an API app. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, SiteInner> beginCreateOrUpdate( + public PollerFlux, SiteInner> beginCreateOrUpdateAsync( String resourceGroupName, String name, SiteInner siteEnvelope) { Mono>> mono = createOrUpdateWithResponseAsync(resourceGroupName, name, siteEnvelope); return this @@ -7460,7 +6928,7 @@ public PollerFlux, SiteInner> beginCreateOrUpdate( * @return a web app, a mobile app backend, or an API app. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, SiteInner> beginCreateOrUpdate( + public PollerFlux, SiteInner> beginCreateOrUpdateAsync( String resourceGroupName, String name, SiteInner siteEnvelope, Context context) { Mono>> mono = createOrUpdateWithResponseAsync(resourceGroupName, name, siteEnvelope, context); @@ -7470,6 +6938,43 @@ public PollerFlux, SiteInner> beginCreateOrUpdate( mono, this.client.getHttpPipeline(), SiteInner.class, SiteInner.class); } + /** + * Description for Creates a new web, mobile, or API app in an existing resource group, or updates an existing app. + * + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Unique name of the app to create or update. To create or update a deployment slot, use the {slot} + * parameter. + * @param siteEnvelope A web app, a mobile app backend, or an API app. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a web app, a mobile app backend, or an API app. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, SiteInner> beginCreateOrUpdate( + String resourceGroupName, String name, SiteInner siteEnvelope) { + return beginCreateOrUpdateAsync(resourceGroupName, name, siteEnvelope).getSyncPoller(); + } + + /** + * Description for Creates a new web, mobile, or API app in an existing resource group, or updates an existing app. + * + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Unique name of the app to create or update. To create or update a deployment slot, use the {slot} + * parameter. + * @param siteEnvelope A web app, a mobile app backend, or an API app. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a web app, a mobile app backend, or an API app. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, SiteInner> beginCreateOrUpdate( + String resourceGroupName, String name, SiteInner siteEnvelope, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, name, siteEnvelope, context).getSyncPoller(); + } + /** * Description for Creates a new web, mobile, or API app in an existing resource group, or updates an existing app. * @@ -7484,13 +6989,9 @@ public PollerFlux, SiteInner> beginCreateOrUpdate( */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono createOrUpdateAsync(String resourceGroupName, String name, SiteInner siteEnvelope) { - Mono>> mono = createOrUpdateWithResponseAsync(resourceGroupName, name, siteEnvelope); - return this - .client - .getLroResultAsync( - mono, this.client.getHttpPipeline(), SiteInner.class, SiteInner.class) + return beginCreateOrUpdateAsync(resourceGroupName, name, siteEnvelope) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -7509,14 +7010,9 @@ public Mono createOrUpdateAsync(String resourceGroupName, String name @ServiceMethod(returns = ReturnType.SINGLE) public Mono createOrUpdateAsync( String resourceGroupName, String name, SiteInner siteEnvelope, Context context) { - Mono>> mono = - createOrUpdateWithResponseAsync(resourceGroupName, name, siteEnvelope, context); - return this - .client - .getLroResultAsync( - mono, this.client.getHttpPipeline(), SiteInner.class, SiteInner.class) + return beginCreateOrUpdateAsync(resourceGroupName, name, siteEnvelope, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -7641,6 +7137,7 @@ public Mono> deleteWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .delete( this.client.getEndpoint(), @@ -7860,6 +7357,7 @@ public Mono> updateWithResponseAsync( } else { siteEnvelope.validate(); } + context = this.client.mergeContext(context); return service .update( this.client.getEndpoint(), @@ -8041,6 +7539,7 @@ public Mono> analyzeCustomHostnameWi new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .analyzeCustomHostname( this.client.getEndpoint(), @@ -8272,6 +7771,7 @@ public Mono> applySlotConfigToProductionWithResponseAsync( } else { slotSwapEntity.validate(); } + context = this.client.mergeContext(context); return service .applySlotConfigToProduction( this.client.getEndpoint(), @@ -8444,6 +7944,7 @@ public Mono> backupWithResponseAsync( } else { request.validate(); } + context = this.client.mergeContext(context); return service .backup( this.client.getEndpoint(), @@ -8625,6 +8126,7 @@ public Mono> listBackupsSinglePageAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listBackups( this.client.getEndpoint(), @@ -8798,6 +8300,7 @@ public Mono> getBackupStatusWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getBackupStatus( this.client.getEndpoint(), @@ -8979,6 +8482,7 @@ public Mono> deleteBackupWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .deleteBackup( this.client.getEndpoint(), @@ -9161,6 +8665,7 @@ public Mono> listBackupStatusSecretsWithResponseAsync( } else { request.validate(); } + context = this.client.mergeContext(context); return service .listBackupStatusSecrets( this.client.getEndpoint(), @@ -9372,6 +8877,7 @@ public Mono>> restoreWithResponseAsync( } else { request.validate(); } + context = this.client.mergeContext(context); return service .restore( this.client.getEndpoint(), @@ -9397,7 +8903,7 @@ public Mono>> restoreWithResponseAsync( * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, Void> beginRestore( + public PollerFlux, Void> beginRestoreAsync( String resourceGroupName, String name, String backupId, RestoreRequestInner request) { Mono>> mono = restoreWithResponseAsync(resourceGroupName, name, backupId, request); return this.client.getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class); @@ -9417,13 +8923,50 @@ public PollerFlux, Void> beginRestore( * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, Void> beginRestore( + public PollerFlux, Void> beginRestoreAsync( String resourceGroupName, String name, String backupId, RestoreRequestInner request, Context context) { Mono>> mono = restoreWithResponseAsync(resourceGroupName, name, backupId, request, context); return this.client.getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class); } + /** + * Description for Restores a specific backup to another app (or deployment slot, if specified). + * + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param backupId ID of the backup. + * @param request Description of a restore request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginRestore( + String resourceGroupName, String name, String backupId, RestoreRequestInner request) { + return beginRestoreAsync(resourceGroupName, name, backupId, request).getSyncPoller(); + } + + /** + * Description for Restores a specific backup to another app (or deployment slot, if specified). + * + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param backupId ID of the backup. + * @param request Description of a restore request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginRestore( + String resourceGroupName, String name, String backupId, RestoreRequestInner request, Context context) { + return beginRestoreAsync(resourceGroupName, name, backupId, request, context).getSyncPoller(); + } + /** * Description for Restores a specific backup to another app (or deployment slot, if specified). * @@ -9439,12 +8982,9 @@ public PollerFlux, Void> beginRestore( @ServiceMethod(returns = ReturnType.SINGLE) public Mono restoreAsync( String resourceGroupName, String name, String backupId, RestoreRequestInner request) { - Mono>> mono = restoreWithResponseAsync(resourceGroupName, name, backupId, request); - return this - .client - .getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class) + return beginRestoreAsync(resourceGroupName, name, backupId, request) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -9463,13 +9003,9 @@ public Mono restoreAsync( @ServiceMethod(returns = ReturnType.SINGLE) public Mono restoreAsync( String resourceGroupName, String name, String backupId, RestoreRequestInner request, Context context) { - Mono>> mono = - restoreWithResponseAsync(resourceGroupName, name, backupId, request, context); - return this - .client - .getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class) + return beginRestoreAsync(resourceGroupName, name, backupId, request, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -9585,6 +9121,7 @@ public void restore( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getBasicPublishingCredentialsPolicies( this.client.getEndpoint(), @@ -9756,6 +9293,7 @@ public Mono> getFtpAllowed new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getFtpAllowed( this.client.getEndpoint(), @@ -9949,6 +9487,7 @@ public Mono> updateFtpAllo } else { csmPublishingAccessPoliciesEntity.validate(); } + context = this.client.mergeContext(context); return service .updateFtpAllowed( this.client.getEndpoint(), @@ -10135,6 +9674,7 @@ public Mono> getScmAllowed new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getScmAllowed( this.client.getEndpoint(), @@ -10328,6 +9868,7 @@ public Mono> updateScmAllo } else { csmPublishingAccessPoliciesEntity.validate(); } + context = this.client.mergeContext(context); return service .updateScmAllowed( this.client.getEndpoint(), @@ -10523,6 +10064,7 @@ public Mono> listConfigurationsSinglePage new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listConfigurations( this.client.getEndpoint(), @@ -10702,6 +10244,7 @@ public Mono> updateApplicationSettingsWithRespon } else { appSettings.validate(); } + context = this.client.mergeContext(context); return service .updateApplicationSettings( this.client.getEndpoint(), @@ -10878,6 +10421,7 @@ public Mono> listApplicationSettingsWithResponse new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listApplicationSettings( this.client.getEndpoint(), @@ -11061,6 +10605,7 @@ public Mono> updateAuthSettingsWithResponseAsync } else { siteAuthSettings.validate(); } + context = this.client.mergeContext(context); return service .updateAuthSettings( this.client.getEndpoint(), @@ -11237,6 +10782,7 @@ public Mono> getAuthSettingsWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getAuthSettings( this.client.getEndpoint(), @@ -11422,6 +10968,7 @@ public Mono> updateAzureSt } else { azureStorageAccounts.validate(); } + context = this.client.mergeContext(context); return service .updateAzureStorageAccounts( this.client.getEndpoint(), @@ -11604,6 +11151,7 @@ public Mono> listAzureStor new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listAzureStorageAccounts( this.client.getEndpoint(), @@ -11787,6 +11335,7 @@ public Mono> updateBackupConfigurationWithResponseA } else { request.validate(); } + context = this.client.mergeContext(context); return service .updateBackupConfiguration( this.client.getEndpoint(), @@ -11962,6 +11511,7 @@ public Mono> deleteBackupConfigurationWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .deleteBackupConfiguration( this.client.getEndpoint(), @@ -12113,6 +11663,7 @@ public Mono> getBackupConfigurationWithResponseAsyn new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getBackupConfiguration( this.client.getEndpoint(), @@ -12281,6 +11832,7 @@ public Mono> getAppSettingsKeyVaultRe new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getAppSettingsKeyVaultReferences( this.client.getEndpoint(), @@ -12460,6 +12012,7 @@ public Mono> getAppSettingKeyVaultRefer new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getAppSettingKeyVaultReference( this.client.getEndpoint(), @@ -12651,6 +12204,7 @@ public Mono> updateConnectionStringsWi } else { connectionStrings.validate(); } + context = this.client.mergeContext(context); return service .updateConnectionStrings( this.client.getEndpoint(), @@ -12827,6 +12381,7 @@ public Mono> listConnectionStringsWith new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listConnectionStrings( this.client.getEndpoint(), @@ -12996,6 +12551,7 @@ public Mono> getDiagnosticLogsConfigurationWithRes new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getDiagnosticLogsConfiguration( this.client.getEndpoint(), @@ -13177,6 +12733,7 @@ public Mono> updateDiagnosticLogsConfigWithRespons } else { siteLogsConfig.validate(); } + context = this.client.mergeContext(context); return service .updateDiagnosticLogsConfig( this.client.getEndpoint(), @@ -13366,6 +12923,7 @@ public Mono> updateMetadataWithResponseAsync( } else { metadata.validate(); } + context = this.client.mergeContext(context); return service .updateMetadata( this.client.getEndpoint(), @@ -13540,6 +13098,7 @@ public Mono> listMetadataWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listMetadata( this.client.getEndpoint(), @@ -13707,6 +13266,7 @@ public Mono>> listPublishingCredentialsWithResponseAsy new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listPublishingCredentials( this.client.getEndpoint(), @@ -13728,7 +13288,7 @@ public Mono>> listPublishingCredentialsWithResponseAsy * @return user credentials used for publishing activity. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, UserInner> beginListPublishingCredentials( + public PollerFlux, UserInner> beginListPublishingCredentialsAsync( String resourceGroupName, String name) { Mono>> mono = listPublishingCredentialsWithResponseAsync(resourceGroupName, name); return this @@ -13749,7 +13309,7 @@ public PollerFlux, UserInner> beginListPublishingCredentia * @return user credentials used for publishing activity. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, UserInner> beginListPublishingCredentials( + public PollerFlux, UserInner> beginListPublishingCredentialsAsync( String resourceGroupName, String name, Context context) { Mono>> mono = listPublishingCredentialsWithResponseAsync(resourceGroupName, name, context); @@ -13759,6 +13319,39 @@ public PollerFlux, UserInner> beginListPublishingCredentia mono, this.client.getHttpPipeline(), UserInner.class, UserInner.class); } + /** + * Description for Gets the Git/FTP publishing credentials of an app. + * + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return user credentials used for publishing activity. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, UserInner> beginListPublishingCredentials( + String resourceGroupName, String name) { + return beginListPublishingCredentialsAsync(resourceGroupName, name).getSyncPoller(); + } + + /** + * Description for Gets the Git/FTP publishing credentials of an app. + * + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return user credentials used for publishing activity. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, UserInner> beginListPublishingCredentials( + String resourceGroupName, String name, Context context) { + return beginListPublishingCredentialsAsync(resourceGroupName, name, context).getSyncPoller(); + } + /** * Description for Gets the Git/FTP publishing credentials of an app. * @@ -13771,13 +13364,9 @@ public PollerFlux, UserInner> beginListPublishingCredentia */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono listPublishingCredentialsAsync(String resourceGroupName, String name) { - Mono>> mono = listPublishingCredentialsWithResponseAsync(resourceGroupName, name); - return this - .client - .getLroResultAsync( - mono, this.client.getHttpPipeline(), UserInner.class, UserInner.class) + return beginListPublishingCredentialsAsync(resourceGroupName, name) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -13793,14 +13382,9 @@ public Mono listPublishingCredentialsAsync(String resourceGroupName, */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono listPublishingCredentialsAsync(String resourceGroupName, String name, Context context) { - Mono>> mono = - listPublishingCredentialsWithResponseAsync(resourceGroupName, name, context); - return this - .client - .getLroResultAsync( - mono, this.client.getHttpPipeline(), UserInner.class, UserInner.class) + return beginListPublishingCredentialsAsync(resourceGroupName, name, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -13926,6 +13510,7 @@ public Mono> updateSitePushSettingsWithResponseAsync } else { pushSettings.validate(); } + context = this.client.mergeContext(context); return service .updateSitePushSettings( this.client.getEndpoint(), @@ -14102,6 +13687,7 @@ public Mono> listSitePushSettingsWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listSitePushSettings( this.client.getEndpoint(), @@ -14269,6 +13855,7 @@ public Mono> listSlotConfigurationNamesWi new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listSlotConfigurationNames( this.client.getEndpoint(), @@ -14455,6 +14042,7 @@ public Mono> updateSlotConfigurationNames } else { slotConfigNames.validate(); } + context = this.client.mergeContext(context); return service .updateSlotConfigurationNames( this.client.getEndpoint(), @@ -14637,6 +14225,7 @@ public Mono> getConfigurationWithResponseAsync new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getConfiguration( this.client.getEndpoint(), @@ -14821,6 +14410,7 @@ public Mono> createOrUpdateConfigurationWithRe } else { siteConfig.validate(); } + context = this.client.mergeContext(context); return service .createOrUpdateConfiguration( this.client.getEndpoint(), @@ -15010,6 +14600,7 @@ public Mono> updateConfigurationWithResponseAs } else { siteConfig.validate(); } + context = this.client.mergeContext(context); return service .updateConfiguration( this.client.getEndpoint(), @@ -15197,6 +14788,7 @@ public Mono> listConfiguration new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listConfigurationSnapshotInfo( this.client.getEndpoint(), @@ -15378,6 +14970,7 @@ public Mono> getConfigurationSnapshotWithRespo new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getConfigurationSnapshot( this.client.getEndpoint(), @@ -15562,6 +15155,7 @@ public Mono> recoverSiteConfigurationSnapshotWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .recoverSiteConfigurationSnapshot( this.client.getEndpoint(), @@ -15719,6 +15313,7 @@ public Mono getWebSiteContainerLogsWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getWebSiteContainerLogs( this.client.getEndpoint(), @@ -15773,11 +15368,24 @@ public Flux getWebSiteContainerLogsAsync(String resourceGroupName, S */ @ServiceMethod(returns = ReturnType.SINGLE) public InputStream getWebSiteContainerLogs(String resourceGroupName, String name) { - return getWebSiteContainerLogsAsync(resourceGroupName, name) - .map(ByteBufferBackedInputStream::new) - .collectList() - .map(list -> new SequenceInputStream(Collections.enumeration(list))) - .block(); + Iterator iterator = + getWebSiteContainerLogsAsync(resourceGroupName, name) + .map(ByteBufferBackedInputStream::new) + .toStream() + .iterator(); + Enumeration enumeration = + new Enumeration() { + @Override + public boolean hasMoreElements() { + return iterator.hasNext(); + } + + @Override + public InputStream nextElement() { + return iterator.next(); + } + }; + return new SequenceInputStream(enumeration); } /** @@ -15793,11 +15401,24 @@ public InputStream getWebSiteContainerLogs(String resourceGroupName, String name */ @ServiceMethod(returns = ReturnType.SINGLE) public InputStream getWebSiteContainerLogs(String resourceGroupName, String name, Context context) { - return getWebSiteContainerLogsAsync(resourceGroupName, name, context) - .map(ByteBufferBackedInputStream::new) - .collectList() - .map(list -> new SequenceInputStream(Collections.enumeration(list))) - .block(); + Iterator iterator = + getWebSiteContainerLogsAsync(resourceGroupName, name, context) + .map(ByteBufferBackedInputStream::new) + .toStream() + .iterator(); + Enumeration enumeration = + new Enumeration() { + @Override + public boolean hasMoreElements() { + return iterator.hasNext(); + } + + @Override + public InputStream nextElement() { + return iterator.next(); + } + }; + return new SequenceInputStream(enumeration); } /** @@ -15878,6 +15499,7 @@ public Mono getContainerLogsZipWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getContainerLogsZip( this.client.getEndpoint(), @@ -15932,11 +15554,24 @@ public Flux getContainerLogsZipAsync(String resourceGroupName, Strin */ @ServiceMethod(returns = ReturnType.SINGLE) public InputStream getContainerLogsZip(String resourceGroupName, String name) { - return getContainerLogsZipAsync(resourceGroupName, name) - .map(ByteBufferBackedInputStream::new) - .collectList() - .map(list -> new SequenceInputStream(Collections.enumeration(list))) - .block(); + Iterator iterator = + getContainerLogsZipAsync(resourceGroupName, name) + .map(ByteBufferBackedInputStream::new) + .toStream() + .iterator(); + Enumeration enumeration = + new Enumeration() { + @Override + public boolean hasMoreElements() { + return iterator.hasNext(); + } + + @Override + public InputStream nextElement() { + return iterator.next(); + } + }; + return new SequenceInputStream(enumeration); } /** @@ -15952,11 +15587,24 @@ public InputStream getContainerLogsZip(String resourceGroupName, String name) { */ @ServiceMethod(returns = ReturnType.SINGLE) public InputStream getContainerLogsZip(String resourceGroupName, String name, Context context) { - return getContainerLogsZipAsync(resourceGroupName, name, context) - .map(ByteBufferBackedInputStream::new) - .collectList() - .map(list -> new SequenceInputStream(Collections.enumeration(list))) - .block(); + Iterator iterator = + getContainerLogsZipAsync(resourceGroupName, name, context) + .map(ByteBufferBackedInputStream::new) + .toStream() + .iterator(); + Enumeration enumeration = + new Enumeration() { + @Override + public boolean hasMoreElements() { + return iterator.hasNext(); + } + + @Override + public InputStream nextElement() { + return iterator.next(); + } + }; + return new SequenceInputStream(enumeration); } /** @@ -16047,6 +15695,7 @@ public Mono> listContinuousWebJobsSinglePag new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listContinuousWebJobs( this.client.getEndpoint(), @@ -16222,6 +15871,7 @@ public Mono> getContinuousWebJobWithResponseAsyn new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getContinuousWebJob( this.client.getEndpoint(), @@ -16406,6 +16056,7 @@ public Mono> deleteContinuousWebJobWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .deleteContinuousWebJob( this.client.getEndpoint(), @@ -16572,6 +16223,7 @@ public Mono> startContinuousWebJobWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .startContinuousWebJob( this.client.getEndpoint(), @@ -16738,6 +16390,7 @@ public Mono> stopContinuousWebJobWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .stopContinuousWebJob( this.client.getEndpoint(), @@ -16903,6 +16556,7 @@ public Mono> listDeploymentsSinglePageAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listDeployments( this.client.getEndpoint(), @@ -17076,6 +16730,7 @@ public Mono> getDeploymentWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getDeployment( this.client.getEndpoint(), @@ -17270,6 +16925,7 @@ public Mono> createDeploymentWithResponseAsync( } else { deployment.validate(); } + context = this.client.mergeContext(context); return service .createDeployment( this.client.getEndpoint(), @@ -17459,6 +17115,7 @@ public Mono> deleteDeploymentWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .deleteDeployment( this.client.getEndpoint(), @@ -17626,6 +17283,7 @@ public Mono> listDeploymentLogWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listDeploymentLog( this.client.getEndpoint(), @@ -17818,6 +17476,7 @@ public Mono> discoverBackupWithResponseAsync( } else { request.validate(); } + context = this.client.mergeContext(context); return service .discoverBackup( this.client.getEndpoint(), @@ -18006,6 +17665,7 @@ public Mono> listDomainOwnershipIdentifiersSingle new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listDomainOwnershipIdentifiers( this.client.getEndpoint(), @@ -18187,6 +17847,7 @@ public Mono> getDomainOwnershipIdentifierWithResponseA new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getDomainOwnershipIdentifier( this.client.getEndpoint(), @@ -18406,6 +18067,7 @@ public Mono> createOrUpdateDomainOwnershipIdentifierWi } else { domainOwnershipIdentifier.validate(); } + context = this.client.mergeContext(context); return service .createOrUpdateDomainOwnershipIdentifier( this.client.getEndpoint(), @@ -18622,6 +18284,7 @@ public Mono> deleteDomainOwnershipIdentifierWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .deleteDomainOwnershipIdentifier( this.client.getEndpoint(), @@ -18824,6 +18487,7 @@ public Mono> updateDomainOwnershipIdentifierWithRespon } else { domainOwnershipIdentifier.validate(); } + context = this.client.mergeContext(context); return service .updateDomainOwnershipIdentifier( this.client.getEndpoint(), @@ -19025,6 +18689,7 @@ public Mono> getMSDeployStatusWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getMSDeployStatus( this.client.getEndpoint(), @@ -19205,6 +18870,7 @@ public Mono>> createMSDeployOperationWithResponseAsync } else { mSDeploy.validate(); } + context = this.client.mergeContext(context); return service .createMSDeployOperation( this.client.getEndpoint(), @@ -19228,7 +18894,7 @@ public Mono>> createMSDeployOperationWithResponseAsync * @return mSDeploy ARM response. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, MSDeployStatusInner> beginCreateMSDeployOperation( + public PollerFlux, MSDeployStatusInner> beginCreateMSDeployOperationAsync( String resourceGroupName, String name, MSDeploy mSDeploy) { Mono>> mono = createMSDeployOperationWithResponseAsync(resourceGroupName, name, mSDeploy); @@ -19251,7 +18917,7 @@ public PollerFlux, MSDeployStatusInner> beginCre * @return mSDeploy ARM response. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, MSDeployStatusInner> beginCreateMSDeployOperation( + public PollerFlux, MSDeployStatusInner> beginCreateMSDeployOperationAsync( String resourceGroupName, String name, MSDeploy mSDeploy, Context context) { Mono>> mono = createMSDeployOperationWithResponseAsync(resourceGroupName, name, mSDeploy, context); @@ -19261,6 +18927,41 @@ public PollerFlux, MSDeployStatusInner> beginCre mono, this.client.getHttpPipeline(), MSDeployStatusInner.class, MSDeployStatusInner.class); } + /** + * Description for Invoke the MSDeploy web app extension. + * + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of web app. + * @param mSDeploy MSDeploy ARM PUT information. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return mSDeploy ARM response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, MSDeployStatusInner> beginCreateMSDeployOperation( + String resourceGroupName, String name, MSDeploy mSDeploy) { + return beginCreateMSDeployOperationAsync(resourceGroupName, name, mSDeploy).getSyncPoller(); + } + + /** + * Description for Invoke the MSDeploy web app extension. + * + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of web app. + * @param mSDeploy MSDeploy ARM PUT information. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return mSDeploy ARM response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, MSDeployStatusInner> beginCreateMSDeployOperation( + String resourceGroupName, String name, MSDeploy mSDeploy, Context context) { + return beginCreateMSDeployOperationAsync(resourceGroupName, name, mSDeploy, context).getSyncPoller(); + } + /** * Description for Invoke the MSDeploy web app extension. * @@ -19275,14 +18976,9 @@ public PollerFlux, MSDeployStatusInner> beginCre @ServiceMethod(returns = ReturnType.SINGLE) public Mono createMSDeployOperationAsync( String resourceGroupName, String name, MSDeploy mSDeploy) { - Mono>> mono = - createMSDeployOperationWithResponseAsync(resourceGroupName, name, mSDeploy); - return this - .client - .getLroResultAsync( - mono, this.client.getHttpPipeline(), MSDeployStatusInner.class, MSDeployStatusInner.class) + return beginCreateMSDeployOperationAsync(resourceGroupName, name, mSDeploy) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -19300,14 +18996,9 @@ public Mono createMSDeployOperationAsync( @ServiceMethod(returns = ReturnType.SINGLE) public Mono createMSDeployOperationAsync( String resourceGroupName, String name, MSDeploy mSDeploy, Context context) { - Mono>> mono = - createMSDeployOperationWithResponseAsync(resourceGroupName, name, mSDeploy, context); - return this - .client - .getLroResultAsync( - mono, this.client.getHttpPipeline(), MSDeployStatusInner.class, MSDeployStatusInner.class) + return beginCreateMSDeployOperationAsync(resourceGroupName, name, mSDeploy, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -19422,6 +19113,7 @@ public Mono> getMSDeployLogWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getMSDeployLog( this.client.getEndpoint(), @@ -19598,6 +19290,7 @@ public Mono> listFunctionsSinglePageAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listFunctions( this.client.getEndpoint(), @@ -19761,6 +19454,7 @@ public Mono> getFunctionsAdminTokenWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getFunctionsAdminToken( this.client.getEndpoint(), @@ -19937,6 +19631,7 @@ public Mono> getFunctionWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getFunction( this.client.getEndpoint(), @@ -20139,6 +19834,7 @@ public Mono>> createFunctionWithResponseAsync( } else { functionEnvelope.validate(); } + context = this.client.mergeContext(context); return service .createFunction( this.client.getEndpoint(), @@ -20164,7 +19860,7 @@ public Mono>> createFunctionWithResponseAsync( * @return function information. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, FunctionEnvelopeInner> beginCreateFunction( + public PollerFlux, FunctionEnvelopeInner> beginCreateFunctionAsync( String resourceGroupName, String name, String functionName, FunctionEnvelopeInner functionEnvelope) { Mono>> mono = createFunctionWithResponseAsync(resourceGroupName, name, functionName, functionEnvelope); @@ -20188,7 +19884,7 @@ public PollerFlux, FunctionEnvelopeInner> begi * @return function information. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, FunctionEnvelopeInner> beginCreateFunction( + public PollerFlux, FunctionEnvelopeInner> beginCreateFunctionAsync( String resourceGroupName, String name, String functionName, @@ -20202,6 +19898,48 @@ public PollerFlux, FunctionEnvelopeInner> begi mono, this.client.getHttpPipeline(), FunctionEnvelopeInner.class, FunctionEnvelopeInner.class); } + /** + * Description for Create function for web site, or a deployment slot. + * + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param functionName Function name. + * @param functionEnvelope Function information. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return function information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, FunctionEnvelopeInner> beginCreateFunction( + String resourceGroupName, String name, String functionName, FunctionEnvelopeInner functionEnvelope) { + return beginCreateFunctionAsync(resourceGroupName, name, functionName, functionEnvelope).getSyncPoller(); + } + + /** + * Description for Create function for web site, or a deployment slot. + * + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param functionName Function name. + * @param functionEnvelope Function information. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return function information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, FunctionEnvelopeInner> beginCreateFunction( + String resourceGroupName, + String name, + String functionName, + FunctionEnvelopeInner functionEnvelope, + Context context) { + return beginCreateFunctionAsync(resourceGroupName, name, functionName, functionEnvelope, context) + .getSyncPoller(); + } + /** * Description for Create function for web site, or a deployment slot. * @@ -20217,14 +19955,9 @@ public PollerFlux, FunctionEnvelopeInner> begi @ServiceMethod(returns = ReturnType.SINGLE) public Mono createFunctionAsync( String resourceGroupName, String name, String functionName, FunctionEnvelopeInner functionEnvelope) { - Mono>> mono = - createFunctionWithResponseAsync(resourceGroupName, name, functionName, functionEnvelope); - return this - .client - .getLroResultAsync( - mono, this.client.getHttpPipeline(), FunctionEnvelopeInner.class, FunctionEnvelopeInner.class) + return beginCreateFunctionAsync(resourceGroupName, name, functionName, functionEnvelope) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -20247,14 +19980,9 @@ public Mono createFunctionAsync( String functionName, FunctionEnvelopeInner functionEnvelope, Context context) { - Mono>> mono = - createFunctionWithResponseAsync(resourceGroupName, name, functionName, functionEnvelope, context); - return this - .client - .getLroResultAsync( - mono, this.client.getHttpPipeline(), FunctionEnvelopeInner.class, FunctionEnvelopeInner.class) + return beginCreateFunctionAsync(resourceGroupName, name, functionName, functionEnvelope, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -20386,6 +20114,7 @@ public Mono> deleteFunctionWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .deleteFunction( this.client.getEndpoint(), @@ -20573,6 +20302,7 @@ public Mono> createOrUpdateFunctionSecretWithResponseAsyn } else { key.validate(); } + context = this.client.mergeContext(context); return service .createOrUpdateFunctionSecret( this.client.getEndpoint(), @@ -20778,6 +20508,7 @@ public Mono> deleteFunctionSecretWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .deleteFunctionSecret( this.client.getEndpoint(), @@ -20951,6 +20682,7 @@ public Mono> listFunctionKeysWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listFunctionKeys( this.client.getEndpoint(), @@ -21135,6 +20867,7 @@ public Mono> listFunctionSecretsWithResponseAsync new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listFunctionSecrets( this.client.getEndpoint(), @@ -21309,6 +21042,7 @@ public Mono> listHostKeysWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listHostKeys( this.client.getEndpoint(), @@ -21475,6 +21209,7 @@ public Mono> listSyncStatusWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listSyncStatus( this.client.getEndpoint(), @@ -21623,6 +21358,7 @@ public Mono> syncFunctionsWithResponseAsync(String resourceGroupN new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .syncFunctions( this.client.getEndpoint(), @@ -21804,6 +21540,7 @@ public Mono> createOrUpdateHostSecretWithResponseAsync( } else { key.validate(); } + context = this.client.mergeContext(context); return service .createOrUpdateHostSecret( this.client.getEndpoint(), @@ -22008,6 +21745,7 @@ public Mono> deleteHostSecretWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .deleteHostSecret( this.client.getEndpoint(), @@ -22180,6 +21918,7 @@ public Mono> listHostnameBindingsSinglePageA new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listHostnameBindings( this.client.getEndpoint(), @@ -22355,6 +22094,7 @@ public Mono> getHostnameBindingWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getHostnameBinding( this.client.getEndpoint(), @@ -22553,6 +22293,7 @@ public Mono> createOrUpdateHostnameBindingWithRes } else { hostnameBinding.validate(); } + context = this.client.mergeContext(context); return service .createOrUpdateHostnameBinding( this.client.getEndpoint(), @@ -22744,6 +22485,7 @@ public Mono> deleteHostnameBindingWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .deleteHostnameBinding( this.client.getEndpoint(), @@ -22919,6 +22661,7 @@ public Mono> getHybridConnectionWithResponseAsyn new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getHybridConnection( this.client.getEndpoint(), @@ -23142,6 +22885,7 @@ public Mono> createOrUpdateHybridConnectionWithR } else { connectionEnvelope.validate(); } + context = this.client.mergeContext(context); return service .createOrUpdateHybridConnection( this.client.getEndpoint(), @@ -23370,6 +23114,7 @@ public Mono> deleteHybridConnectionWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .deleteHybridConnection( this.client.getEndpoint(), @@ -23576,6 +23321,7 @@ public Mono> updateHybridConnectionWithResponseA } else { connectionEnvelope.validate(); } + context = this.client.mergeContext(context); return service .updateHybridConnection( this.client.getEndpoint(), @@ -23785,6 +23531,7 @@ public Mono> listHybridConnectionsWithResponseAs new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listHybridConnections( this.client.getEndpoint(), @@ -23953,6 +23700,7 @@ public Mono> listRelayServiceConnect new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listRelayServiceConnections( this.client.getEndpoint(), @@ -24132,6 +23880,7 @@ public Mono> getRelayServiceConnecti new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getRelayServiceConnection( this.client.getEndpoint(), @@ -24339,6 +24088,7 @@ public Mono> createOrUpdateRelayServ } else { connectionEnvelope.validate(); } + context = this.client.mergeContext(context); return service .createOrUpdateRelayServiceConnection( this.client.getEndpoint(), @@ -24548,6 +24298,7 @@ public Mono> deleteRelayServiceConnectionWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .deleteRelayServiceConnection( this.client.getEndpoint(), @@ -24737,6 +24488,7 @@ public Mono> updateRelayServiceConne } else { connectionEnvelope.validate(); } + context = this.client.mergeContext(context); return service .updateRelayServiceConnection( this.client.getEndpoint(), @@ -24943,6 +24695,7 @@ public Mono> listInstanceIdentifiersSinglePageA new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listInstanceIdentifiers( this.client.getEndpoint(), @@ -25118,6 +24871,7 @@ public Mono> getInstanceInfoWithResponseAsy new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getInstanceInfo( this.client.getEndpoint(), @@ -25302,6 +25056,7 @@ public Mono> getInstanceMsDeployStatusWithResponse new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getInstanceMsDeployStatus( this.client.getEndpoint(), @@ -25499,6 +25254,7 @@ public Mono>> createInstanceMSDeployOperationWithRespo } else { mSDeploy.validate(); } + context = this.client.mergeContext(context); return service .createInstanceMSDeployOperation( this.client.getEndpoint(), @@ -25524,7 +25280,7 @@ public Mono>> createInstanceMSDeployOperationWithRespo * @return mSDeploy ARM response. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, MSDeployStatusInner> beginCreateInstanceMSDeployOperation( + public PollerFlux, MSDeployStatusInner> beginCreateInstanceMSDeployOperationAsync( String resourceGroupName, String name, String instanceId, MSDeploy mSDeploy) { Mono>> mono = createInstanceMSDeployOperationWithResponseAsync(resourceGroupName, name, instanceId, mSDeploy); @@ -25548,7 +25304,7 @@ public PollerFlux, MSDeployStatusInner> beginCre * @return mSDeploy ARM response. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, MSDeployStatusInner> beginCreateInstanceMSDeployOperation( + public PollerFlux, MSDeployStatusInner> beginCreateInstanceMSDeployOperationAsync( String resourceGroupName, String name, String instanceId, MSDeploy mSDeploy, Context context) { Mono>> mono = createInstanceMSDeployOperationWithResponseAsync(resourceGroupName, name, instanceId, mSDeploy, context); @@ -25558,6 +25314,44 @@ public PollerFlux, MSDeployStatusInner> beginCre mono, this.client.getHttpPipeline(), MSDeployStatusInner.class, MSDeployStatusInner.class); } + /** + * Description for Invoke the MSDeploy web app extension. + * + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of web app. + * @param instanceId ID of web app instance. + * @param mSDeploy MSDeploy ARM PUT information. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return mSDeploy ARM response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, MSDeployStatusInner> beginCreateInstanceMSDeployOperation( + String resourceGroupName, String name, String instanceId, MSDeploy mSDeploy) { + return beginCreateInstanceMSDeployOperationAsync(resourceGroupName, name, instanceId, mSDeploy).getSyncPoller(); + } + + /** + * Description for Invoke the MSDeploy web app extension. + * + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of web app. + * @param instanceId ID of web app instance. + * @param mSDeploy MSDeploy ARM PUT information. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return mSDeploy ARM response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, MSDeployStatusInner> beginCreateInstanceMSDeployOperation( + String resourceGroupName, String name, String instanceId, MSDeploy mSDeploy, Context context) { + return beginCreateInstanceMSDeployOperationAsync(resourceGroupName, name, instanceId, mSDeploy, context) + .getSyncPoller(); + } + /** * Description for Invoke the MSDeploy web app extension. * @@ -25573,14 +25367,9 @@ public PollerFlux, MSDeployStatusInner> beginCre @ServiceMethod(returns = ReturnType.SINGLE) public Mono createInstanceMSDeployOperationAsync( String resourceGroupName, String name, String instanceId, MSDeploy mSDeploy) { - Mono>> mono = - createInstanceMSDeployOperationWithResponseAsync(resourceGroupName, name, instanceId, mSDeploy); - return this - .client - .getLroResultAsync( - mono, this.client.getHttpPipeline(), MSDeployStatusInner.class, MSDeployStatusInner.class) + return beginCreateInstanceMSDeployOperationAsync(resourceGroupName, name, instanceId, mSDeploy) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -25599,14 +25388,9 @@ public Mono createInstanceMSDeployOperationAsync( @ServiceMethod(returns = ReturnType.SINGLE) public Mono createInstanceMSDeployOperationAsync( String resourceGroupName, String name, String instanceId, MSDeploy mSDeploy, Context context) { - Mono>> mono = - createInstanceMSDeployOperationWithResponseAsync(resourceGroupName, name, instanceId, mSDeploy, context); - return this - .client - .getLroResultAsync( - mono, this.client.getHttpPipeline(), MSDeployStatusInner.class, MSDeployStatusInner.class) + return beginCreateInstanceMSDeployOperationAsync(resourceGroupName, name, instanceId, mSDeploy, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -25734,6 +25518,7 @@ public Mono> getInstanceMSDeployLogWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getInstanceMSDeployLog( this.client.getEndpoint(), @@ -25931,6 +25716,7 @@ public Mono> listInstanceProcessesSinglePageAsyn new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listInstanceProcesses( this.client.getEndpoint(), @@ -26132,6 +25918,7 @@ public Mono> getInstanceProcessWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getInstanceProcess( this.client.getEndpoint(), @@ -26339,6 +26126,7 @@ public Mono> deleteInstanceProcessWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .deleteInstanceProcess( this.client.getEndpoint(), @@ -26531,6 +26319,7 @@ public Mono getInstanceProcessDumpWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getInstanceProcessDump( this.client.getEndpoint(), @@ -26600,11 +26389,24 @@ public Flux getInstanceProcessDumpAsync( @ServiceMethod(returns = ReturnType.SINGLE) public InputStream getInstanceProcessDump( String resourceGroupName, String name, String processId, String instanceId) { - return getInstanceProcessDumpAsync(resourceGroupName, name, processId, instanceId) - .map(ByteBufferBackedInputStream::new) - .collectList() - .map(list -> new SequenceInputStream(Collections.enumeration(list))) - .block(); + Iterator iterator = + getInstanceProcessDumpAsync(resourceGroupName, name, processId, instanceId) + .map(ByteBufferBackedInputStream::new) + .toStream() + .iterator(); + Enumeration enumeration = + new Enumeration() { + @Override + public boolean hasMoreElements() { + return iterator.hasNext(); + } + + @Override + public InputStream nextElement() { + return iterator.next(); + } + }; + return new SequenceInputStream(enumeration); } /** @@ -26624,11 +26426,24 @@ public InputStream getInstanceProcessDump( @ServiceMethod(returns = ReturnType.SINGLE) public InputStream getInstanceProcessDump( String resourceGroupName, String name, String processId, String instanceId, Context context) { - return getInstanceProcessDumpAsync(resourceGroupName, name, processId, instanceId, context) - .map(ByteBufferBackedInputStream::new) - .collectList() - .map(list -> new SequenceInputStream(Collections.enumeration(list))) - .block(); + Iterator iterator = + getInstanceProcessDumpAsync(resourceGroupName, name, processId, instanceId, context) + .map(ByteBufferBackedInputStream::new) + .toStream() + .iterator(); + Enumeration enumeration = + new Enumeration() { + @Override + public boolean hasMoreElements() { + return iterator.hasNext(); + } + + @Override + public InputStream nextElement() { + return iterator.next(); + } + }; + return new SequenceInputStream(enumeration); } /** @@ -26739,6 +26554,7 @@ public Mono> listInstanceProcessModulesSin new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listInstanceProcessModules( this.client.getEndpoint(), @@ -26956,6 +26772,7 @@ public Mono> getInstanceProcessModuleWithRespon new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getInstanceProcessModule( this.client.getEndpoint(), @@ -27187,6 +27004,7 @@ public Mono> listInstanceProcessThreadsSin new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listInstanceProcessThreads( this.client.getEndpoint(), @@ -27369,6 +27187,7 @@ public Mono> isCloneableWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .isCloneable( this.client.getEndpoint(), @@ -27544,6 +27363,7 @@ public Mono> listSiteBackupsSinglePageAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listSiteBackups( this.client.getEndpoint(), @@ -27708,6 +27528,7 @@ public Mono> listSyncFunctionTriggersWithResponse new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listSyncFunctionTriggers( this.client.getEndpoint(), @@ -27906,6 +27727,7 @@ public Mono>> migrateStorageWithResponseAsync( } else { migrationOptions.validate(); } + context = this.client.mergeContext(context); return service .migrateStorage( this.client.getEndpoint(), @@ -27931,8 +27753,9 @@ public Mono>> migrateStorageWithResponseAsync( * @return response for a migration of app content request. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, StorageMigrationResponseInner> beginMigrateStorage( - String subscriptionName, String resourceGroupName, String name, StorageMigrationOptions migrationOptions) { + public PollerFlux, StorageMigrationResponseInner> + beginMigrateStorageAsync( + String subscriptionName, String resourceGroupName, String name, StorageMigrationOptions migrationOptions) { Mono>> mono = migrateStorageWithResponseAsync(subscriptionName, resourceGroupName, name, migrationOptions); return this @@ -27958,12 +27781,13 @@ public PollerFlux, StorageMigrationRes * @return response for a migration of app content request. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, StorageMigrationResponseInner> beginMigrateStorage( - String subscriptionName, - String resourceGroupName, - String name, - StorageMigrationOptions migrationOptions, - Context context) { + public PollerFlux, StorageMigrationResponseInner> + beginMigrateStorageAsync( + String subscriptionName, + String resourceGroupName, + String name, + StorageMigrationOptions migrationOptions, + Context context) { Mono>> mono = migrateStorageWithResponseAsync(subscriptionName, resourceGroupName, name, migrationOptions, context); return this @@ -27975,6 +27799,48 @@ public PollerFlux, StorageMigrationRes StorageMigrationResponseInner.class); } + /** + * Description for Restores a web app. + * + * @param subscriptionName Azure subscription. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of web app. + * @param migrationOptions Options for app content migration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for a migration of app content request. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, StorageMigrationResponseInner> beginMigrateStorage( + String subscriptionName, String resourceGroupName, String name, StorageMigrationOptions migrationOptions) { + return beginMigrateStorageAsync(subscriptionName, resourceGroupName, name, migrationOptions).getSyncPoller(); + } + + /** + * Description for Restores a web app. + * + * @param subscriptionName Azure subscription. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of web app. + * @param migrationOptions Options for app content migration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for a migration of app content request. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, StorageMigrationResponseInner> beginMigrateStorage( + String subscriptionName, + String resourceGroupName, + String name, + StorageMigrationOptions migrationOptions, + Context context) { + return beginMigrateStorageAsync(subscriptionName, resourceGroupName, name, migrationOptions, context) + .getSyncPoller(); + } + /** * Description for Restores a web app. * @@ -27990,17 +27856,9 @@ public PollerFlux, StorageMigrationRes @ServiceMethod(returns = ReturnType.SINGLE) public Mono migrateStorageAsync( String subscriptionName, String resourceGroupName, String name, StorageMigrationOptions migrationOptions) { - Mono>> mono = - migrateStorageWithResponseAsync(subscriptionName, resourceGroupName, name, migrationOptions); - return this - .client - .getLroResultAsync( - mono, - this.client.getHttpPipeline(), - StorageMigrationResponseInner.class, - StorageMigrationResponseInner.class) + return beginMigrateStorageAsync(subscriptionName, resourceGroupName, name, migrationOptions) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -28023,17 +27881,9 @@ public Mono migrateStorageAsync( String name, StorageMigrationOptions migrationOptions, Context context) { - Mono>> mono = - migrateStorageWithResponseAsync(subscriptionName, resourceGroupName, name, migrationOptions, context); - return this - .client - .getLroResultAsync( - mono, - this.client.getHttpPipeline(), - StorageMigrationResponseInner.class, - StorageMigrationResponseInner.class) + return beginMigrateStorageAsync(subscriptionName, resourceGroupName, name, migrationOptions, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -28173,6 +28023,7 @@ public Mono>> migrateMySqlWithResponseAsync( } else { migrationRequestEnvelope.validate(); } + context = this.client.mergeContext(context); return service .migrateMySql( this.client.getEndpoint(), @@ -28196,7 +28047,7 @@ public Mono>> migrateMySqlWithResponseAsync( * @return an operation on a resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, OperationInner> beginMigrateMySql( + public PollerFlux, OperationInner> beginMigrateMySqlAsync( String resourceGroupName, String name, MigrateMySqlRequest migrationRequestEnvelope) { Mono>> mono = migrateMySqlWithResponseAsync(resourceGroupName, name, migrationRequestEnvelope); @@ -28219,7 +28070,7 @@ public PollerFlux, OperationInner> beginMigrateMySql( * @return an operation on a resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, OperationInner> beginMigrateMySql( + public PollerFlux, OperationInner> beginMigrateMySqlAsync( String resourceGroupName, String name, MigrateMySqlRequest migrationRequestEnvelope, Context context) { Mono>> mono = migrateMySqlWithResponseAsync(resourceGroupName, name, migrationRequestEnvelope, context); @@ -28229,6 +28080,41 @@ public PollerFlux, OperationInner> beginMigrateMySql( mono, this.client.getHttpPipeline(), OperationInner.class, OperationInner.class); } + /** + * Description for Migrates a local (in-app) MySql database to a remote MySql database. + * + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of web app. + * @param migrationRequestEnvelope MySQL migration request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an operation on a resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, OperationInner> beginMigrateMySql( + String resourceGroupName, String name, MigrateMySqlRequest migrationRequestEnvelope) { + return beginMigrateMySqlAsync(resourceGroupName, name, migrationRequestEnvelope).getSyncPoller(); + } + + /** + * Description for Migrates a local (in-app) MySql database to a remote MySql database. + * + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of web app. + * @param migrationRequestEnvelope MySQL migration request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an operation on a resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, OperationInner> beginMigrateMySql( + String resourceGroupName, String name, MigrateMySqlRequest migrationRequestEnvelope, Context context) { + return beginMigrateMySqlAsync(resourceGroupName, name, migrationRequestEnvelope, context).getSyncPoller(); + } + /** * Description for Migrates a local (in-app) MySql database to a remote MySql database. * @@ -28243,14 +28129,9 @@ public PollerFlux, OperationInner> beginMigrateMySql( @ServiceMethod(returns = ReturnType.SINGLE) public Mono migrateMySqlAsync( String resourceGroupName, String name, MigrateMySqlRequest migrationRequestEnvelope) { - Mono>> mono = - migrateMySqlWithResponseAsync(resourceGroupName, name, migrationRequestEnvelope); - return this - .client - .getLroResultAsync( - mono, this.client.getHttpPipeline(), OperationInner.class, OperationInner.class) + return beginMigrateMySqlAsync(resourceGroupName, name, migrationRequestEnvelope) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -28268,14 +28149,9 @@ public Mono migrateMySqlAsync( @ServiceMethod(returns = ReturnType.SINGLE) public Mono migrateMySqlAsync( String resourceGroupName, String name, MigrateMySqlRequest migrationRequestEnvelope, Context context) { - Mono>> mono = - migrateMySqlWithResponseAsync(resourceGroupName, name, migrationRequestEnvelope, context); - return this - .client - .getLroResultAsync( - mono, this.client.getHttpPipeline(), OperationInner.class, OperationInner.class) + return beginMigrateMySqlAsync(resourceGroupName, name, migrationRequestEnvelope, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -28394,6 +28270,7 @@ public Mono> getMigrateMySqlStatusWithResponse new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getMigrateMySqlStatus( this.client.getEndpoint(), @@ -28566,6 +28443,7 @@ public Mono> getSwiftVirtualNetworkConnection new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getSwiftVirtualNetworkConnection( this.client.getEndpoint(), @@ -28756,6 +28634,7 @@ public Mono> createOrUpdateSwiftVirtualNetwor } else { connectionEnvelope.validate(); } + context = this.client.mergeContext(context); return service .createOrUpdateSwiftVirtualNetworkConnection( this.client.getEndpoint(), @@ -28945,6 +28824,7 @@ public Mono> deleteSwiftVirtualNetworkWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .deleteSwiftVirtualNetwork( this.client.getEndpoint(), @@ -29117,6 +28997,7 @@ public Mono> updateSwiftVirtualNetworkConnect } else { connectionEnvelope.validate(); } + context = this.client.mergeContext(context); return service .updateSwiftVirtualNetworkConnection( this.client.getEndpoint(), @@ -29315,6 +29196,7 @@ public Mono> listNetworkFeaturesWithResponseAsync new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listNetworkFeatures( this.client.getEndpoint(), @@ -29498,6 +29380,7 @@ public Mono> getNetworkTraceOperationWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getNetworkTraceOperation( this.client.getEndpoint(), @@ -29685,6 +29568,7 @@ public Mono> startWebSiteNetworkTraceWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .startWebSiteNetworkTrace( this.client.getEndpoint(), @@ -29948,6 +29832,7 @@ public Mono>> startWebSiteNetworkTraceOperationWithRes new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .startWebSiteNetworkTraceOperation( this.client.getEndpoint(), @@ -29975,7 +29860,7 @@ public Mono>> startWebSiteNetworkTraceOperationWithRes * @return array of NetworkTrace. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, Object> beginStartWebSiteNetworkTraceOperation( + public PollerFlux, Object> beginStartWebSiteNetworkTraceOperationAsync( String resourceGroupName, String name, Integer durationInSeconds, Integer maxFrameLength, String sasUrl) { Mono>> mono = startWebSiteNetworkTraceOperationWithResponseAsync( @@ -30000,7 +29885,7 @@ public PollerFlux, Object> beginStartWebSiteNetworkTraceOpera * @return array of NetworkTrace. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, Object> beginStartWebSiteNetworkTraceOperation( + public PollerFlux, Object> beginStartWebSiteNetworkTraceOperationAsync( String resourceGroupName, String name, Integer durationInSeconds, @@ -30015,6 +29900,54 @@ public PollerFlux, Object> beginStartWebSiteNetworkTraceOpera .getLroResultAsync(mono, this.client.getHttpPipeline(), Object.class, Object.class); } + /** + * Description for Start capturing network packets for the site. + * + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name The name of the web app. + * @param durationInSeconds The duration to keep capturing in seconds. + * @param maxFrameLength The maximum frame length in bytes (Optional). + * @param sasUrl The Blob URL to store capture file. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return array of NetworkTrace. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Object> beginStartWebSiteNetworkTraceOperation( + String resourceGroupName, String name, Integer durationInSeconds, Integer maxFrameLength, String sasUrl) { + return beginStartWebSiteNetworkTraceOperationAsync( + resourceGroupName, name, durationInSeconds, maxFrameLength, sasUrl) + .getSyncPoller(); + } + + /** + * Description for Start capturing network packets for the site. + * + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name The name of the web app. + * @param durationInSeconds The duration to keep capturing in seconds. + * @param maxFrameLength The maximum frame length in bytes (Optional). + * @param sasUrl The Blob URL to store capture file. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return array of NetworkTrace. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Object> beginStartWebSiteNetworkTraceOperation( + String resourceGroupName, + String name, + Integer durationInSeconds, + Integer maxFrameLength, + String sasUrl, + Context context) { + return beginStartWebSiteNetworkTraceOperationAsync( + resourceGroupName, name, durationInSeconds, maxFrameLength, sasUrl, context) + .getSyncPoller(); + } + /** * Description for Start capturing network packets for the site. * @@ -30031,14 +29964,10 @@ public PollerFlux, Object> beginStartWebSiteNetworkTraceOpera @ServiceMethod(returns = ReturnType.SINGLE) public Mono startWebSiteNetworkTraceOperationAsync( String resourceGroupName, String name, Integer durationInSeconds, Integer maxFrameLength, String sasUrl) { - Mono>> mono = - startWebSiteNetworkTraceOperationWithResponseAsync( - resourceGroupName, name, durationInSeconds, maxFrameLength, sasUrl); - return this - .client - .getLroResultAsync(mono, this.client.getHttpPipeline(), Object.class, Object.class) + return beginStartWebSiteNetworkTraceOperationAsync( + resourceGroupName, name, durationInSeconds, maxFrameLength, sasUrl) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -30063,14 +29992,10 @@ public Mono startWebSiteNetworkTraceOperationAsync( Integer maxFrameLength, String sasUrl, Context context) { - Mono>> mono = - startWebSiteNetworkTraceOperationWithResponseAsync( - resourceGroupName, name, durationInSeconds, maxFrameLength, sasUrl, context); - return this - .client - .getLroResultAsync(mono, this.client.getHttpPipeline(), Object.class, Object.class) + return beginStartWebSiteNetworkTraceOperationAsync( + resourceGroupName, name, durationInSeconds, maxFrameLength, sasUrl, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -30089,14 +30014,10 @@ public Mono startWebSiteNetworkTraceOperationAsync(String resourceGroupN final Integer maxFrameLength = null; final String sasUrl = null; final Context context = null; - Mono>> mono = - startWebSiteNetworkTraceOperationWithResponseAsync( - resourceGroupName, name, durationInSeconds, maxFrameLength, sasUrl); - return this - .client - .getLroResultAsync(mono, this.client.getHttpPipeline(), Object.class, Object.class) + return beginStartWebSiteNetworkTraceOperationAsync( + resourceGroupName, name, durationInSeconds, maxFrameLength, sasUrl) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -30246,6 +30167,7 @@ public Mono> stopWebSiteNetworkTraceWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .stopWebSiteNetworkTrace( this.client.getEndpoint(), @@ -30406,6 +30328,7 @@ public Mono>> getNetworkTracesWithResponseAsync new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getNetworkTraces( this.client.getEndpoint(), @@ -30590,6 +30513,7 @@ public Mono> getNetworkTraceOperationV2WithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getNetworkTraceOperationV2( this.client.getEndpoint(), @@ -30773,6 +30697,7 @@ public Mono>> getNetworkTracesV2WithResponseAsy new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getNetworkTracesV2( this.client.getEndpoint(), @@ -30948,6 +30873,7 @@ public Mono> generateNewSitePublishingPasswordWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .generateNewSitePublishingPassword( this.client.getEndpoint(), @@ -31115,6 +31041,7 @@ public Mono> listPerfMonCountersSinglePageAs new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listPerfMonCounters( this.client.getEndpoint(), @@ -31332,6 +31259,7 @@ public Mono> getSitePhpErrorLogFlagWithRespon new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getSitePhpErrorLogFlag( this.client.getEndpoint(), @@ -31499,6 +31427,7 @@ public Mono> listPremierAddOnsWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listPremierAddOns( this.client.getEndpoint(), @@ -31677,6 +31606,7 @@ public Mono> getPremierAddOnWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getPremierAddOn( this.client.getEndpoint(), @@ -31880,6 +31810,7 @@ public Mono> addPremierAddOnWithResponseAsync( } else { premierAddOn.validate(); } + context = this.client.mergeContext(context); return service .addPremierAddOn( this.client.getEndpoint(), @@ -32080,6 +32011,7 @@ public Mono> deletePremierAddOnWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .deletePremierAddOn( this.client.getEndpoint(), @@ -32265,6 +32197,7 @@ public Mono> updatePremierAddOnWithResponseAsync( } else { premierAddOn.validate(); } + context = this.client.mergeContext(context); return service .updatePremierAddOn( this.client.getEndpoint(), @@ -32455,6 +32388,7 @@ public Mono> getPrivateAccessWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getPrivateAccess( this.client.getEndpoint(), @@ -32641,6 +32575,7 @@ public Mono> putPrivateAccessVnetWithResponseAsync( } else { access.validate(); } + context = this.client.mergeContext(context); return service .putPrivateAccessVnet( this.client.getEndpoint(), @@ -32830,6 +32765,7 @@ public Mono> listProcessesSinglePageAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listProcesses( this.client.getEndpoint(), @@ -33007,6 +32943,7 @@ public Mono> getProcessWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getProcess( this.client.getEndpoint(), @@ -33191,6 +33128,7 @@ public Mono> deleteProcessWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .deleteProcess( this.client.getEndpoint(), @@ -33360,6 +33298,7 @@ public Mono getProcessDumpWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getProcessDump( this.client.getEndpoint(), @@ -33420,11 +33359,24 @@ public Flux getProcessDumpAsync( */ @ServiceMethod(returns = ReturnType.SINGLE) public InputStream getProcessDump(String resourceGroupName, String name, String processId) { - return getProcessDumpAsync(resourceGroupName, name, processId) - .map(ByteBufferBackedInputStream::new) - .collectList() - .map(list -> new SequenceInputStream(Collections.enumeration(list))) - .block(); + Iterator iterator = + getProcessDumpAsync(resourceGroupName, name, processId) + .map(ByteBufferBackedInputStream::new) + .toStream() + .iterator(); + Enumeration enumeration = + new Enumeration() { + @Override + public boolean hasMoreElements() { + return iterator.hasNext(); + } + + @Override + public InputStream nextElement() { + return iterator.next(); + } + }; + return new SequenceInputStream(enumeration); } /** @@ -33441,11 +33393,24 @@ public InputStream getProcessDump(String resourceGroupName, String name, String */ @ServiceMethod(returns = ReturnType.SINGLE) public InputStream getProcessDump(String resourceGroupName, String name, String processId, Context context) { - return getProcessDumpAsync(resourceGroupName, name, processId, context) - .map(ByteBufferBackedInputStream::new) - .collectList() - .map(list -> new SequenceInputStream(Collections.enumeration(list))) - .block(); + Iterator iterator = + getProcessDumpAsync(resourceGroupName, name, processId, context) + .map(ByteBufferBackedInputStream::new) + .toStream() + .iterator(); + Enumeration enumeration = + new Enumeration() { + @Override + public boolean hasMoreElements() { + return iterator.hasNext(); + } + + @Override + public InputStream nextElement() { + return iterator.next(); + } + }; + return new SequenceInputStream(enumeration); } /** @@ -33545,6 +33510,7 @@ public Mono> listProcessModulesSinglePageA new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listProcessModules( this.client.getEndpoint(), @@ -33736,6 +33702,7 @@ public Mono> getProcessModuleWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getProcessModule( this.client.getEndpoint(), @@ -33935,6 +33902,7 @@ public Mono> listProcessThreadsSinglePageA new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listProcessThreads( this.client.getEndpoint(), @@ -34117,6 +34085,7 @@ public Mono> listPublicCertificatesSingleP new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listPublicCertificates( this.client.getEndpoint(), @@ -34294,6 +34263,7 @@ public Mono> getPublicCertificateWithResponseAs new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getPublicCertificate( this.client.getEndpoint(), @@ -34500,6 +34470,7 @@ public Mono> createOrUpdatePublicCertificateWit } else { publicCertificate.validate(); } + context = this.client.mergeContext(context); return service .createOrUpdatePublicCertificate( this.client.getEndpoint(), @@ -34705,6 +34676,7 @@ public Mono> deletePublicCertificateWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .deletePublicCertificate( this.client.getEndpoint(), @@ -34881,6 +34853,7 @@ public Mono listPublishingProfileXmlWithSecretsWithResponseAsync } else { publishingProfileOptions.validate(); } + context = this.client.mergeContext(context); return service .listPublishingProfileXmlWithSecrets( this.client.getEndpoint(), @@ -34944,11 +34917,24 @@ public Flux listPublishingProfileXmlWithSecretsAsync( @ServiceMethod(returns = ReturnType.SINGLE) public InputStream listPublishingProfileXmlWithSecrets( String resourceGroupName, String name, CsmPublishingProfileOptions publishingProfileOptions) { - return listPublishingProfileXmlWithSecretsAsync(resourceGroupName, name, publishingProfileOptions) - .map(ByteBufferBackedInputStream::new) - .collectList() - .map(list -> new SequenceInputStream(Collections.enumeration(list))) - .block(); + Iterator iterator = + listPublishingProfileXmlWithSecretsAsync(resourceGroupName, name, publishingProfileOptions) + .map(ByteBufferBackedInputStream::new) + .toStream() + .iterator(); + Enumeration enumeration = + new Enumeration() { + @Override + public boolean hasMoreElements() { + return iterator.hasNext(); + } + + @Override + public InputStream nextElement() { + return iterator.next(); + } + }; + return new SequenceInputStream(enumeration); } /** @@ -34966,11 +34952,24 @@ public InputStream listPublishingProfileXmlWithSecrets( @ServiceMethod(returns = ReturnType.SINGLE) public InputStream listPublishingProfileXmlWithSecrets( String resourceGroupName, String name, CsmPublishingProfileOptions publishingProfileOptions, Context context) { - return listPublishingProfileXmlWithSecretsAsync(resourceGroupName, name, publishingProfileOptions, context) - .map(ByteBufferBackedInputStream::new) - .collectList() - .map(list -> new SequenceInputStream(Collections.enumeration(list))) - .block(); + Iterator iterator = + listPublishingProfileXmlWithSecretsAsync(resourceGroupName, name, publishingProfileOptions, context) + .map(ByteBufferBackedInputStream::new) + .toStream() + .iterator(); + Enumeration enumeration = + new Enumeration() { + @Override + public boolean hasMoreElements() { + return iterator.hasNext(); + } + + @Override + public InputStream nextElement() { + return iterator.next(); + } + }; + return new SequenceInputStream(enumeration); } /** @@ -35053,6 +35052,7 @@ public Mono> resetProductionSlotConfigWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .resetProductionSlotConfig( this.client.getEndpoint(), @@ -35218,6 +35218,7 @@ public Mono> restartWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .restart( this.client.getEndpoint(), @@ -35438,6 +35439,7 @@ public Mono>> restoreFromBackupBlobWithResponseAsync( } else { request.validate(); } + context = this.client.mergeContext(context); return service .restoreFromBackupBlob( this.client.getEndpoint(), @@ -35461,7 +35463,7 @@ public Mono>> restoreFromBackupBlobWithResponseAsync( * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, Void> beginRestoreFromBackupBlob( + public PollerFlux, Void> beginRestoreFromBackupBlobAsync( String resourceGroupName, String name, RestoreRequestInner request) { Mono>> mono = restoreFromBackupBlobWithResponseAsync(resourceGroupName, name, request); @@ -35481,7 +35483,7 @@ public PollerFlux, Void> beginRestoreFromBackupBlob( * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, Void> beginRestoreFromBackupBlob( + public PollerFlux, Void> beginRestoreFromBackupBlobAsync( String resourceGroupName, String name, RestoreRequestInner request, Context context) { Mono>> mono = restoreFromBackupBlobWithResponseAsync(resourceGroupName, name, request, context); @@ -35500,14 +35502,9 @@ public PollerFlux, Void> beginRestoreFromBackupBlob( * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono restoreFromBackupBlobAsync(String resourceGroupName, String name, RestoreRequestInner request) { - Mono>> mono = - restoreFromBackupBlobWithResponseAsync(resourceGroupName, name, request); - return this - .client - .getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class) - .last() - .flatMap(client::getLroFinalResultOrError); + public SyncPoller, Void> beginRestoreFromBackupBlob( + String resourceGroupName, String name, RestoreRequestInner request) { + return beginRestoreFromBackupBlobAsync(resourceGroupName, name, request).getSyncPoller(); } /** @@ -35523,15 +35520,9 @@ public Mono restoreFromBackupBlobAsync(String resourceGroupName, String na * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono restoreFromBackupBlobAsync( + public SyncPoller, Void> beginRestoreFromBackupBlob( String resourceGroupName, String name, RestoreRequestInner request, Context context) { - Mono>> mono = - restoreFromBackupBlobWithResponseAsync(resourceGroupName, name, request, context); - return this - .client - .getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class) - .last() - .flatMap(client::getLroFinalResultOrError); + return beginRestoreFromBackupBlobAsync(resourceGroupName, name, request, context).getSyncPoller(); } /** @@ -35543,10 +35534,13 @@ public Mono restoreFromBackupBlobAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void restoreFromBackupBlob(String resourceGroupName, String name, RestoreRequestInner request) { - restoreFromBackupBlobAsync(resourceGroupName, name, request).block(); + public Mono restoreFromBackupBlobAsync(String resourceGroupName, String name, RestoreRequestInner request) { + return beginRestoreFromBackupBlobAsync(resourceGroupName, name, request) + .last() + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -35559,64 +35553,46 @@ public void restoreFromBackupBlob(String resourceGroupName, String name, Restore * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void restoreFromBackupBlob( + public Mono restoreFromBackupBlobAsync( String resourceGroupName, String name, RestoreRequestInner request, Context context) { - restoreFromBackupBlobAsync(resourceGroupName, name, request, context).block(); + return beginRestoreFromBackupBlobAsync(resourceGroupName, name, request, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); } /** - * Description for Restores a deleted web app to this web app. + * Description for Restores an app from a backup blob in Azure Storage. * * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param restoreRequest Details about restoring a deleted app. + * @param name Name of the app. + * @param request Description of a restore request. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> restoreFromDeletedAppWithResponseAsync( - String resourceGroupName, String name, DeletedAppRestoreRequest restoreRequest) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (restoreRequest == null) { - return Mono.error(new IllegalArgumentException("Parameter restoreRequest is required and cannot be null.")); - } else { - restoreRequest.validate(); - } - return FluxUtil - .withContext( - context -> - service - .restoreFromDeletedApp( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - restoreRequest, - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + public void restoreFromBackupBlob(String resourceGroupName, String name, RestoreRequestInner request) { + restoreFromBackupBlobAsync(resourceGroupName, name, request).block(); + } + + /** + * Description for Restores an app from a backup blob in Azure Storage. + * + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param request Description of a restore request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void restoreFromBackupBlob( + String resourceGroupName, String name, RestoreRequestInner request, Context context) { + restoreFromBackupBlobAsync(resourceGroupName, name, request, context).block(); } /** @@ -35625,7 +35601,6 @@ public Mono>> restoreFromDeletedAppWithResponseAsync( * @param resourceGroupName Name of the resource group to which the resource belongs. * @param name Name of web app. * @param restoreRequest Details about restoring a deleted app. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -35633,7 +35608,7 @@ public Mono>> restoreFromDeletedAppWithResponseAsync( */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono>> restoreFromDeletedAppWithResponseAsync( - String resourceGroupName, String name, DeletedAppRestoreRequest restoreRequest, Context context) { + String resourceGroupName, String name, DeletedAppRestoreRequest restoreRequest) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -35658,6 +35633,61 @@ public Mono>> restoreFromDeletedAppWithResponseAsync( } else { restoreRequest.validate(); } + return FluxUtil + .withContext( + context -> + service + .restoreFromDeletedApp( + this.client.getEndpoint(), + resourceGroupName, + name, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + restoreRequest, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Description for Restores a deleted web app to this web app. + * + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of web app. + * @param restoreRequest Details about restoring a deleted app. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono>> restoreFromDeletedAppWithResponseAsync( + String resourceGroupName, String name, DeletedAppRestoreRequest restoreRequest, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (restoreRequest == null) { + return Mono.error(new IllegalArgumentException("Parameter restoreRequest is required and cannot be null.")); + } else { + restoreRequest.validate(); + } + context = this.client.mergeContext(context); return service .restoreFromDeletedApp( this.client.getEndpoint(), @@ -35681,7 +35711,7 @@ public Mono>> restoreFromDeletedAppWithResponseAsync( * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, Void> beginRestoreFromDeletedApp( + public PollerFlux, Void> beginRestoreFromDeletedAppAsync( String resourceGroupName, String name, DeletedAppRestoreRequest restoreRequest) { Mono>> mono = restoreFromDeletedAppWithResponseAsync(resourceGroupName, name, restoreRequest); @@ -35701,13 +35731,48 @@ public PollerFlux, Void> beginRestoreFromDeletedApp( * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, Void> beginRestoreFromDeletedApp( + public PollerFlux, Void> beginRestoreFromDeletedAppAsync( String resourceGroupName, String name, DeletedAppRestoreRequest restoreRequest, Context context) { Mono>> mono = restoreFromDeletedAppWithResponseAsync(resourceGroupName, name, restoreRequest, context); return this.client.getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class); } + /** + * Description for Restores a deleted web app to this web app. + * + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of web app. + * @param restoreRequest Details about restoring a deleted app. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginRestoreFromDeletedApp( + String resourceGroupName, String name, DeletedAppRestoreRequest restoreRequest) { + return beginRestoreFromDeletedAppAsync(resourceGroupName, name, restoreRequest).getSyncPoller(); + } + + /** + * Description for Restores a deleted web app to this web app. + * + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of web app. + * @param restoreRequest Details about restoring a deleted app. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginRestoreFromDeletedApp( + String resourceGroupName, String name, DeletedAppRestoreRequest restoreRequest, Context context) { + return beginRestoreFromDeletedAppAsync(resourceGroupName, name, restoreRequest, context).getSyncPoller(); + } + /** * Description for Restores a deleted web app to this web app. * @@ -35722,13 +35787,9 @@ public PollerFlux, Void> beginRestoreFromDeletedApp( @ServiceMethod(returns = ReturnType.SINGLE) public Mono restoreFromDeletedAppAsync( String resourceGroupName, String name, DeletedAppRestoreRequest restoreRequest) { - Mono>> mono = - restoreFromDeletedAppWithResponseAsync(resourceGroupName, name, restoreRequest); - return this - .client - .getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class) + return beginRestoreFromDeletedAppAsync(resourceGroupName, name, restoreRequest) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -35746,13 +35807,9 @@ public Mono restoreFromDeletedAppAsync( @ServiceMethod(returns = ReturnType.SINGLE) public Mono restoreFromDeletedAppAsync( String resourceGroupName, String name, DeletedAppRestoreRequest restoreRequest, Context context) { - Mono>> mono = - restoreFromDeletedAppWithResponseAsync(resourceGroupName, name, restoreRequest, context); - return this - .client - .getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class) + return beginRestoreFromDeletedAppAsync(resourceGroupName, name, restoreRequest, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -35879,6 +35936,7 @@ public Mono>> restoreSnapshotWithResponseAsync( } else { restoreRequest.validate(); } + context = this.client.mergeContext(context); return service .restoreSnapshot( this.client.getEndpoint(), @@ -35902,7 +35960,7 @@ public Mono>> restoreSnapshotWithResponseAsync( * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, Void> beginRestoreSnapshot( + public PollerFlux, Void> beginRestoreSnapshotAsync( String resourceGroupName, String name, SnapshotRestoreRequest restoreRequest) { Mono>> mono = restoreSnapshotWithResponseAsync(resourceGroupName, name, restoreRequest); @@ -35922,13 +35980,48 @@ public PollerFlux, Void> beginRestoreSnapshot( * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, Void> beginRestoreSnapshot( + public PollerFlux, Void> beginRestoreSnapshotAsync( String resourceGroupName, String name, SnapshotRestoreRequest restoreRequest, Context context) { Mono>> mono = restoreSnapshotWithResponseAsync(resourceGroupName, name, restoreRequest, context); return this.client.getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class); } + /** + * Description for Restores a web app from a snapshot. + * + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of web app. + * @param restoreRequest Details about app recovery operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginRestoreSnapshot( + String resourceGroupName, String name, SnapshotRestoreRequest restoreRequest) { + return beginRestoreSnapshotAsync(resourceGroupName, name, restoreRequest).getSyncPoller(); + } + + /** + * Description for Restores a web app from a snapshot. + * + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of web app. + * @param restoreRequest Details about app recovery operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginRestoreSnapshot( + String resourceGroupName, String name, SnapshotRestoreRequest restoreRequest, Context context) { + return beginRestoreSnapshotAsync(resourceGroupName, name, restoreRequest, context).getSyncPoller(); + } + /** * Description for Restores a web app from a snapshot. * @@ -35943,13 +36036,9 @@ public PollerFlux, Void> beginRestoreSnapshot( @ServiceMethod(returns = ReturnType.SINGLE) public Mono restoreSnapshotAsync( String resourceGroupName, String name, SnapshotRestoreRequest restoreRequest) { - Mono>> mono = - restoreSnapshotWithResponseAsync(resourceGroupName, name, restoreRequest); - return this - .client - .getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class) + return beginRestoreSnapshotAsync(resourceGroupName, name, restoreRequest) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -35967,13 +36056,9 @@ public Mono restoreSnapshotAsync( @ServiceMethod(returns = ReturnType.SINGLE) public Mono restoreSnapshotAsync( String resourceGroupName, String name, SnapshotRestoreRequest restoreRequest, Context context) { - Mono>> mono = - restoreSnapshotWithResponseAsync(resourceGroupName, name, restoreRequest, context); - return this - .client - .getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class) + return beginRestoreSnapshotAsync(resourceGroupName, name, restoreRequest, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -36096,6 +36181,7 @@ public Mono> listSiteExtensionsSinglePageA new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listSiteExtensions( this.client.getEndpoint(), @@ -36273,6 +36359,7 @@ public Mono> getSiteExtensionWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getSiteExtension( this.client.getEndpoint(), @@ -36459,6 +36546,7 @@ public Mono>> installSiteExtensionWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .installSiteExtension( this.client.getEndpoint(), @@ -36482,7 +36570,7 @@ public Mono>> installSiteExtensionWithResponseAsync( * @return site Extension Information. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, SiteExtensionInfoInner> beginInstallSiteExtension( + public PollerFlux, SiteExtensionInfoInner> beginInstallSiteExtensionAsync( String resourceGroupName, String name, String siteExtensionId) { Mono>> mono = installSiteExtensionWithResponseAsync(resourceGroupName, name, siteExtensionId); @@ -36505,7 +36593,7 @@ public PollerFlux, SiteExtensionInfoInner> be * @return site Extension Information. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, SiteExtensionInfoInner> beginInstallSiteExtension( + public PollerFlux, SiteExtensionInfoInner> beginInstallSiteExtensionAsync( String resourceGroupName, String name, String siteExtensionId, Context context) { Mono>> mono = installSiteExtensionWithResponseAsync(resourceGroupName, name, siteExtensionId, context); @@ -36515,6 +36603,41 @@ public PollerFlux, SiteExtensionInfoInner> be mono, this.client.getHttpPipeline(), SiteExtensionInfoInner.class, SiteExtensionInfoInner.class); } + /** + * Description for Install site extension on a web site, or a deployment slot. + * + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param siteExtensionId Site extension name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return site Extension Information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, SiteExtensionInfoInner> beginInstallSiteExtension( + String resourceGroupName, String name, String siteExtensionId) { + return beginInstallSiteExtensionAsync(resourceGroupName, name, siteExtensionId).getSyncPoller(); + } + + /** + * Description for Install site extension on a web site, or a deployment slot. + * + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param siteExtensionId Site extension name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return site Extension Information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, SiteExtensionInfoInner> beginInstallSiteExtension( + String resourceGroupName, String name, String siteExtensionId, Context context) { + return beginInstallSiteExtensionAsync(resourceGroupName, name, siteExtensionId, context).getSyncPoller(); + } + /** * Description for Install site extension on a web site, or a deployment slot. * @@ -36529,14 +36652,9 @@ public PollerFlux, SiteExtensionInfoInner> be @ServiceMethod(returns = ReturnType.SINGLE) public Mono installSiteExtensionAsync( String resourceGroupName, String name, String siteExtensionId) { - Mono>> mono = - installSiteExtensionWithResponseAsync(resourceGroupName, name, siteExtensionId); - return this - .client - .getLroResultAsync( - mono, this.client.getHttpPipeline(), SiteExtensionInfoInner.class, SiteExtensionInfoInner.class) + return beginInstallSiteExtensionAsync(resourceGroupName, name, siteExtensionId) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -36554,14 +36672,9 @@ public Mono installSiteExtensionAsync( @ServiceMethod(returns = ReturnType.SINGLE) public Mono installSiteExtensionAsync( String resourceGroupName, String name, String siteExtensionId, Context context) { - Mono>> mono = - installSiteExtensionWithResponseAsync(resourceGroupName, name, siteExtensionId, context); - return this - .client - .getLroResultAsync( - mono, this.client.getHttpPipeline(), SiteExtensionInfoInner.class, SiteExtensionInfoInner.class) + return beginInstallSiteExtensionAsync(resourceGroupName, name, siteExtensionId, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -36688,6 +36801,7 @@ public Mono> deleteSiteExtensionWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .deleteSiteExtension( this.client.getEndpoint(), @@ -36858,6 +36972,7 @@ public Mono>> copyProductionSlotWithResponseAsync( } else { copySlotEntity.validate(); } + context = this.client.mergeContext(context); return service .copyProductionSlot( this.client.getEndpoint(), @@ -36881,7 +36996,7 @@ public Mono>> copyProductionSlotWithResponseAsync( * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, Void> beginCopyProductionSlot( + public PollerFlux, Void> beginCopyProductionSlotAsync( String resourceGroupName, String name, CsmCopySlotEntityInner copySlotEntity) { Mono>> mono = copyProductionSlotWithResponseAsync(resourceGroupName, name, copySlotEntity); @@ -36901,13 +37016,48 @@ public PollerFlux, Void> beginCopyProductionSlot( * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, Void> beginCopyProductionSlot( + public PollerFlux, Void> beginCopyProductionSlotAsync( String resourceGroupName, String name, CsmCopySlotEntityInner copySlotEntity, Context context) { Mono>> mono = copyProductionSlotWithResponseAsync(resourceGroupName, name, copySlotEntity, context); return this.client.getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class); } + /** + * Description for Copies a deployment slot to another deployment slot of an app. + * + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param copySlotEntity Copy deployment slot parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginCopyProductionSlot( + String resourceGroupName, String name, CsmCopySlotEntityInner copySlotEntity) { + return beginCopyProductionSlotAsync(resourceGroupName, name, copySlotEntity).getSyncPoller(); + } + + /** + * Description for Copies a deployment slot to another deployment slot of an app. + * + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param copySlotEntity Copy deployment slot parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginCopyProductionSlot( + String resourceGroupName, String name, CsmCopySlotEntityInner copySlotEntity, Context context) { + return beginCopyProductionSlotAsync(resourceGroupName, name, copySlotEntity, context).getSyncPoller(); + } + /** * Description for Copies a deployment slot to another deployment slot of an app. * @@ -36922,13 +37072,9 @@ public PollerFlux, Void> beginCopyProductionSlot( @ServiceMethod(returns = ReturnType.SINGLE) public Mono copyProductionSlotAsync( String resourceGroupName, String name, CsmCopySlotEntityInner copySlotEntity) { - Mono>> mono = - copyProductionSlotWithResponseAsync(resourceGroupName, name, copySlotEntity); - return this - .client - .getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class) + return beginCopyProductionSlotAsync(resourceGroupName, name, copySlotEntity) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -36946,13 +37092,9 @@ public Mono copyProductionSlotAsync( @ServiceMethod(returns = ReturnType.SINGLE) public Mono copyProductionSlotAsync( String resourceGroupName, String name, CsmCopySlotEntityInner copySlotEntity, Context context) { - Mono>> mono = - copyProductionSlotWithResponseAsync(resourceGroupName, name, copySlotEntity, context); - return this - .client - .getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class) + return beginCopyProductionSlotAsync(resourceGroupName, name, copySlotEntity, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -37074,6 +37216,7 @@ public Mono> listSlotsSinglePageAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listSlots( this.client.getEndpoint(), @@ -37246,6 +37389,7 @@ public Mono> getSlotWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getSlot( this.client.getEndpoint(), @@ -37444,6 +37588,7 @@ public Mono>> createOrUpdateSlotWithResponseAsync( } else { siteEnvelope.validate(); } + context = this.client.mergeContext(context); return service .createOrUpdateSlot( this.client.getEndpoint(), @@ -37471,7 +37616,7 @@ public Mono>> createOrUpdateSlotWithResponseAsync( * @return a web app, a mobile app backend, or an API app. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, SiteInner> beginCreateOrUpdateSlot( + public PollerFlux, SiteInner> beginCreateOrUpdateSlotAsync( String resourceGroupName, String name, String slot, SiteInner siteEnvelope) { Mono>> mono = createOrUpdateSlotWithResponseAsync(resourceGroupName, name, slot, siteEnvelope); @@ -37497,7 +37642,7 @@ public PollerFlux, SiteInner> beginCreateOrUpdateSlot( * @return a web app, a mobile app backend, or an API app. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, SiteInner> beginCreateOrUpdateSlot( + public PollerFlux, SiteInner> beginCreateOrUpdateSlotAsync( String resourceGroupName, String name, String slot, SiteInner siteEnvelope, Context context) { Mono>> mono = createOrUpdateSlotWithResponseAsync(resourceGroupName, name, slot, siteEnvelope, context); @@ -37507,6 +37652,47 @@ public PollerFlux, SiteInner> beginCreateOrUpdateSlot( mono, this.client.getHttpPipeline(), SiteInner.class, SiteInner.class); } + /** + * Description for Creates a new web, mobile, or API app in an existing resource group, or updates an existing app. + * + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Unique name of the app to create or update. To create or update a deployment slot, use the {slot} + * parameter. + * @param slot Name of the deployment slot to create or update. By default, this API attempts to create or modify + * the production slot. + * @param siteEnvelope A web app, a mobile app backend, or an API app. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a web app, a mobile app backend, or an API app. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, SiteInner> beginCreateOrUpdateSlot( + String resourceGroupName, String name, String slot, SiteInner siteEnvelope) { + return beginCreateOrUpdateSlotAsync(resourceGroupName, name, slot, siteEnvelope).getSyncPoller(); + } + + /** + * Description for Creates a new web, mobile, or API app in an existing resource group, or updates an existing app. + * + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Unique name of the app to create or update. To create or update a deployment slot, use the {slot} + * parameter. + * @param slot Name of the deployment slot to create or update. By default, this API attempts to create or modify + * the production slot. + * @param siteEnvelope A web app, a mobile app backend, or an API app. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a web app, a mobile app backend, or an API app. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, SiteInner> beginCreateOrUpdateSlot( + String resourceGroupName, String name, String slot, SiteInner siteEnvelope, Context context) { + return beginCreateOrUpdateSlotAsync(resourceGroupName, name, slot, siteEnvelope, context).getSyncPoller(); + } + /** * Description for Creates a new web, mobile, or API app in an existing resource group, or updates an existing app. * @@ -37524,14 +37710,9 @@ public PollerFlux, SiteInner> beginCreateOrUpdateSlot( @ServiceMethod(returns = ReturnType.SINGLE) public Mono createOrUpdateSlotAsync( String resourceGroupName, String name, String slot, SiteInner siteEnvelope) { - Mono>> mono = - createOrUpdateSlotWithResponseAsync(resourceGroupName, name, slot, siteEnvelope); - return this - .client - .getLroResultAsync( - mono, this.client.getHttpPipeline(), SiteInner.class, SiteInner.class) + return beginCreateOrUpdateSlotAsync(resourceGroupName, name, slot, siteEnvelope) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -37552,14 +37733,9 @@ public Mono createOrUpdateSlotAsync( @ServiceMethod(returns = ReturnType.SINGLE) public Mono createOrUpdateSlotAsync( String resourceGroupName, String name, String slot, SiteInner siteEnvelope, Context context) { - Mono>> mono = - createOrUpdateSlotWithResponseAsync(resourceGroupName, name, slot, siteEnvelope, context); - return this - .client - .getLroResultAsync( - mono, this.client.getHttpPipeline(), SiteInner.class, SiteInner.class) + return beginCreateOrUpdateSlotAsync(resourceGroupName, name, slot, siteEnvelope, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -37703,6 +37879,7 @@ public Mono> deleteSlotWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .deleteSlot( this.client.getEndpoint(), @@ -37951,6 +38128,7 @@ public Mono> updateSlotWithResponseAsync( } else { siteEnvelope.validate(); } + context = this.client.mergeContext(context); return service .updateSlot( this.client.getEndpoint(), @@ -38152,6 +38330,7 @@ public Mono> analyzeCustomHostnameSl new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .analyzeCustomHostnameSlot( this.client.getEndpoint(), @@ -38401,6 +38580,7 @@ public Mono> applySlotConfigurationSlotWithResponseAsync( } else { slotSwapEntity.validate(); } + context = this.client.mergeContext(context); return service .applySlotConfigurationSlot( this.client.getEndpoint(), @@ -38590,6 +38770,7 @@ public Mono> backupSlotWithResponseAsync( } else { request.validate(); } + context = this.client.mergeContext(context); return service .backupSlot( this.client.getEndpoint(), @@ -38794,6 +38975,7 @@ public Mono> listBackupsSlotSinglePageAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listBackupsSlot( this.client.getEndpoint(), @@ -38989,6 +39171,7 @@ public Mono> getBackupStatusSlotWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getBackupStatusSlot( this.client.getEndpoint(), @@ -39193,6 +39376,7 @@ public Mono> deleteBackupSlotWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .deleteBackupSlot( this.client.getEndpoint(), @@ -39399,6 +39583,7 @@ public Mono> listBackupStatusSecretsSlotWithResponseAs } else { request.validate(); } + context = this.client.mergeContext(context); return service .listBackupStatusSecretsSlot( this.client.getEndpoint(), @@ -39641,6 +39826,7 @@ public Mono>> restoreSlotWithResponseAsync( } else { request.validate(); } + context = this.client.mergeContext(context); return service .restoreSlot( this.client.getEndpoint(), @@ -39669,7 +39855,7 @@ public Mono>> restoreSlotWithResponseAsync( * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, Void> beginRestoreSlot( + public PollerFlux, Void> beginRestoreSlotAsync( String resourceGroupName, String name, String backupId, String slot, RestoreRequestInner request) { Mono>> mono = restoreSlotWithResponseAsync(resourceGroupName, name, backupId, slot, request); @@ -39692,7 +39878,7 @@ public PollerFlux, Void> beginRestoreSlot( * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, Void> beginRestoreSlot( + public PollerFlux, Void> beginRestoreSlotAsync( String resourceGroupName, String name, String backupId, @@ -39704,6 +39890,52 @@ public PollerFlux, Void> beginRestoreSlot( return this.client.getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class); } + /** + * Description for Restores a specific backup to another app (or deployment slot, if specified). + * + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param backupId ID of the backup. + * @param slot Name of the deployment slot. If a slot is not specified, the API will restore a backup of the + * production slot. + * @param request Description of a restore request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginRestoreSlot( + String resourceGroupName, String name, String backupId, String slot, RestoreRequestInner request) { + return beginRestoreSlotAsync(resourceGroupName, name, backupId, slot, request).getSyncPoller(); + } + + /** + * Description for Restores a specific backup to another app (or deployment slot, if specified). + * + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param backupId ID of the backup. + * @param slot Name of the deployment slot. If a slot is not specified, the API will restore a backup of the + * production slot. + * @param request Description of a restore request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginRestoreSlot( + String resourceGroupName, + String name, + String backupId, + String slot, + RestoreRequestInner request, + Context context) { + return beginRestoreSlotAsync(resourceGroupName, name, backupId, slot, request, context).getSyncPoller(); + } + /** * Description for Restores a specific backup to another app (or deployment slot, if specified). * @@ -39721,13 +39953,9 @@ public PollerFlux, Void> beginRestoreSlot( @ServiceMethod(returns = ReturnType.SINGLE) public Mono restoreSlotAsync( String resourceGroupName, String name, String backupId, String slot, RestoreRequestInner request) { - Mono>> mono = - restoreSlotWithResponseAsync(resourceGroupName, name, backupId, slot, request); - return this - .client - .getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class) + return beginRestoreSlotAsync(resourceGroupName, name, backupId, slot, request) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -39753,13 +39981,9 @@ public Mono restoreSlotAsync( String slot, RestoreRequestInner request, Context context) { - Mono>> mono = - restoreSlotWithResponseAsync(resourceGroupName, name, backupId, slot, request, context); - return this - .client - .getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class) + return beginRestoreSlotAsync(resourceGroupName, name, backupId, slot, request, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -39905,6 +40129,7 @@ public Mono> listConfigurationsSlotSingle new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listConfigurationsSlot( this.client.getEndpoint(), @@ -40106,6 +40331,7 @@ public Mono> updateApplicationSettingsSlotWithRe } else { appSettings.validate(); } + context = this.client.mergeContext(context); return service .updateApplicationSettingsSlot( this.client.getEndpoint(), @@ -40302,6 +40528,7 @@ public Mono> listApplicationSettingsSlotWithResp new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listApplicationSettingsSlot( this.client.getEndpoint(), @@ -40505,6 +40732,7 @@ public Mono> updateAuthSettingsSlotWithResponseA } else { siteAuthSettings.validate(); } + context = this.client.mergeContext(context); return service .updateAuthSettingsSlot( this.client.getEndpoint(), @@ -40697,6 +40925,7 @@ public Mono> getAuthSettingsSlotWithResponseAsyn new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getAuthSettingsSlot( this.client.getEndpoint(), @@ -40908,6 +41137,7 @@ public Mono> updateAzureSt } else { azureStorageAccounts.validate(); } + context = this.client.mergeContext(context); return service .updateAzureStorageAccountsSlot( this.client.getEndpoint(), @@ -41120,6 +41350,7 @@ public Mono> listAzureStor new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listAzureStorageAccountsSlot( this.client.getEndpoint(), @@ -41324,6 +41555,7 @@ public Mono> updateBackupConfigurationSlotWithRespo } else { request.validate(); } + context = this.client.mergeContext(context); return service .updateBackupConfigurationSlot( this.client.getEndpoint(), @@ -41520,6 +41752,7 @@ public Mono> deleteBackupConfigurationSlotWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .deleteBackupConfigurationSlot( this.client.getEndpoint(), @@ -41692,6 +41925,7 @@ public Mono> getBackupConfigurationSlotWithResponse new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getBackupConfigurationSlot( this.client.getEndpoint(), @@ -41901,6 +42135,7 @@ public Mono> updateConnectionStringsSl } else { connectionStrings.validate(); } + context = this.client.mergeContext(context); return service .updateConnectionStringsSlot( this.client.getEndpoint(), @@ -42105,6 +42340,7 @@ public Mono> listConnectionStringsSlot new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listConnectionStringsSlot( this.client.getEndpoint(), @@ -42296,6 +42532,7 @@ public Mono> getDiagnosticLogsConfigurationSlotWit new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getDiagnosticLogsConfigurationSlot( this.client.getEndpoint(), @@ -42499,6 +42736,7 @@ public Mono> updateDiagnosticLogsConfigSlotWithRes } else { siteLogsConfig.validate(); } + context = this.client.mergeContext(context); return service .updateDiagnosticLogsConfigSlot( this.client.getEndpoint(), @@ -42708,6 +42946,7 @@ public Mono> updateMetadataSlotWithResponseAsync } else { metadata.validate(); } + context = this.client.mergeContext(context); return service .updateMetadataSlot( this.client.getEndpoint(), @@ -42904,6 +43143,7 @@ public Mono> listMetadataSlotWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listMetadataSlot( this.client.getEndpoint(), @@ -43092,6 +43332,7 @@ public Mono>> listPublishingCredentialsSlotWithRespons new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listPublishingCredentialsSlot( this.client.getEndpoint(), @@ -43116,7 +43357,7 @@ public Mono>> listPublishingCredentialsSlotWithRespons * @return user credentials used for publishing activity. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, UserInner> beginListPublishingCredentialsSlot( + public PollerFlux, UserInner> beginListPublishingCredentialsSlotAsync( String resourceGroupName, String name, String slot) { Mono>> mono = listPublishingCredentialsSlotWithResponseAsync(resourceGroupName, name, slot); @@ -43140,7 +43381,7 @@ public PollerFlux, UserInner> beginListPublishingCredentia * @return user credentials used for publishing activity. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, UserInner> beginListPublishingCredentialsSlot( + public PollerFlux, UserInner> beginListPublishingCredentialsSlotAsync( String resourceGroupName, String name, String slot, Context context) { Mono>> mono = listPublishingCredentialsSlotWithResponseAsync(resourceGroupName, name, slot, context); @@ -43163,15 +43404,9 @@ public PollerFlux, UserInner> beginListPublishingCredentia * @return user credentials used for publishing activity. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono listPublishingCredentialsSlotAsync(String resourceGroupName, String name, String slot) { - Mono>> mono = - listPublishingCredentialsSlotWithResponseAsync(resourceGroupName, name, slot); - return this - .client - .getLroResultAsync( - mono, this.client.getHttpPipeline(), UserInner.class, UserInner.class) - .last() - .flatMap(client::getLroFinalResultOrError); + public SyncPoller, UserInner> beginListPublishingCredentialsSlot( + String resourceGroupName, String name, String slot) { + return beginListPublishingCredentialsSlotAsync(resourceGroupName, name, slot).getSyncPoller(); } /** @@ -43188,16 +43423,9 @@ public Mono listPublishingCredentialsSlotAsync(String resourceGroupNa * @return user credentials used for publishing activity. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono listPublishingCredentialsSlotAsync( + public SyncPoller, UserInner> beginListPublishingCredentialsSlot( String resourceGroupName, String name, String slot, Context context) { - Mono>> mono = - listPublishingCredentialsSlotWithResponseAsync(resourceGroupName, name, slot, context); - return this - .client - .getLroResultAsync( - mono, this.client.getHttpPipeline(), UserInner.class, UserInner.class) - .last() - .flatMap(client::getLroFinalResultOrError); + return beginListPublishingCredentialsSlotAsync(resourceGroupName, name, slot, context).getSyncPoller(); } /** @@ -43213,8 +43441,10 @@ public Mono listPublishingCredentialsSlotAsync( * @return user credentials used for publishing activity. */ @ServiceMethod(returns = ReturnType.SINGLE) - public UserInner listPublishingCredentialsSlot(String resourceGroupName, String name, String slot) { - return listPublishingCredentialsSlotAsync(resourceGroupName, name, slot).block(); + public Mono listPublishingCredentialsSlotAsync(String resourceGroupName, String name, String slot) { + return beginListPublishingCredentialsSlotAsync(resourceGroupName, name, slot) + .last() + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -43231,175 +43461,47 @@ public UserInner listPublishingCredentialsSlot(String resourceGroupName, String * @return user credentials used for publishing activity. */ @ServiceMethod(returns = ReturnType.SINGLE) - public UserInner listPublishingCredentialsSlot( + public Mono listPublishingCredentialsSlotAsync( String resourceGroupName, String name, String slot, Context context) { - return listPublishingCredentialsSlotAsync(resourceGroupName, name, slot, context).block(); - } - - /** - * Description for Updates the Push settings associated with web app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param pushSettings Push settings for the App. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return push settings for the App. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> updateSitePushSettingsSlotWithResponseAsync( - String resourceGroupName, String name, String slot, PushSettingsInner pushSettings) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (pushSettings == null) { - return Mono.error(new IllegalArgumentException("Parameter pushSettings is required and cannot be null.")); - } else { - pushSettings.validate(); - } - return FluxUtil - .withContext( - context -> - service - .updateSitePushSettingsSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - pushSettings, - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Description for Updates the Push settings associated with web app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param pushSettings Push settings for the App. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return push settings for the App. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> updateSitePushSettingsSlotWithResponseAsync( - String resourceGroupName, String name, String slot, PushSettingsInner pushSettings, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (pushSettings == null) { - return Mono.error(new IllegalArgumentException("Parameter pushSettings is required and cannot be null.")); - } else { - pushSettings.validate(); - } - return service - .updateSitePushSettingsSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - pushSettings, - context); + return beginListPublishingCredentialsSlotAsync(resourceGroupName, name, slot, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); } /** - * Description for Updates the Push settings associated with web app. + * Description for Gets the Git/FTP publishing credentials of an app. * * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param pushSettings Push settings for the App. + * @param name Name of the app. + * @param slot Name of the deployment slot. If a slot is not specified, the API will get the publishing credentials + * for the production slot. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return push settings for the App. + * @return user credentials used for publishing activity. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono updateSitePushSettingsSlotAsync( - String resourceGroupName, String name, String slot, PushSettingsInner pushSettings) { - return updateSitePushSettingsSlotWithResponseAsync(resourceGroupName, name, slot, pushSettings) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + public UserInner listPublishingCredentialsSlot(String resourceGroupName, String name, String slot) { + return listPublishingCredentialsSlotAsync(resourceGroupName, name, slot).block(); } /** - * Description for Updates the Push settings associated with web app. + * Description for Gets the Git/FTP publishing credentials of an app. * * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param pushSettings Push settings for the App. + * @param name Name of the app. + * @param slot Name of the deployment slot. If a slot is not specified, the API will get the publishing credentials + * for the production slot. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return push settings for the App. + * @return user credentials used for publishing activity. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono updateSitePushSettingsSlotAsync( - String resourceGroupName, String name, String slot, PushSettingsInner pushSettings, Context context) { - return updateSitePushSettingsSlotWithResponseAsync(resourceGroupName, name, slot, pushSettings, context) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + public UserInner listPublishingCredentialsSlot( + String resourceGroupName, String name, String slot, Context context) { + return listPublishingCredentialsSlotAsync(resourceGroupName, name, slot, context).block(); } /** @@ -43415,44 +43517,8 @@ public Mono updateSitePushSettingsSlotAsync( * @return push settings for the App. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PushSettingsInner updateSitePushSettingsSlot( + public Mono> updateSitePushSettingsSlotWithResponseAsync( String resourceGroupName, String name, String slot, PushSettingsInner pushSettings) { - return updateSitePushSettingsSlotAsync(resourceGroupName, name, slot, pushSettings).block(); - } - - /** - * Description for Updates the Push settings associated with web app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param pushSettings Push settings for the App. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return push settings for the App. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PushSettingsInner updateSitePushSettingsSlot( - String resourceGroupName, String name, String slot, PushSettingsInner pushSettings, Context context) { - return updateSitePushSettingsSlotAsync(resourceGroupName, name, slot, pushSettings, context).block(); - } - - /** - * Description for Gets the Push settings associated with web app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return push settings for the App. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> listSitePushSettingsSlotWithResponseAsync( - String resourceGroupName, String name, String slot) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -43475,27 +43541,34 @@ public Mono> listSitePushSettingsSlotWithResponseAsy new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + if (pushSettings == null) { + return Mono.error(new IllegalArgumentException("Parameter pushSettings is required and cannot be null.")); + } else { + pushSettings.validate(); + } return FluxUtil .withContext( context -> service - .listSitePushSettingsSlot( + .updateSitePushSettingsSlot( this.client.getEndpoint(), resourceGroupName, name, slot, this.client.getSubscriptionId(), this.client.getApiVersion(), + pushSettings, context)) .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); } /** - * Description for Gets the Push settings associated with web app. + * Description for Updates the Push settings associated with web app. * * @param resourceGroupName Name of the resource group to which the resource belongs. * @param name Name of web app. * @param slot Name of web app slot. If not specified then will default to production slot. + * @param pushSettings Push settings for the App. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. @@ -43503,8 +43576,8 @@ public Mono> listSitePushSettingsSlotWithResponseAsy * @return push settings for the App. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> listSitePushSettingsSlotWithResponseAsync( - String resourceGroupName, String name, String slot, Context context) { + public Mono> updateSitePushSettingsSlotWithResponseAsync( + String resourceGroupName, String name, String slot, PushSettingsInner pushSettings, Context context) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -43527,31 +43600,40 @@ public Mono> listSitePushSettingsSlotWithResponseAsy new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + if (pushSettings == null) { + return Mono.error(new IllegalArgumentException("Parameter pushSettings is required and cannot be null.")); + } else { + pushSettings.validate(); + } + context = this.client.mergeContext(context); return service - .listSitePushSettingsSlot( + .updateSitePushSettingsSlot( this.client.getEndpoint(), resourceGroupName, name, slot, this.client.getSubscriptionId(), this.client.getApiVersion(), + pushSettings, context); } /** - * Description for Gets the Push settings associated with web app. + * Description for Updates the Push settings associated with web app. * * @param resourceGroupName Name of the resource group to which the resource belongs. * @param name Name of web app. * @param slot Name of web app slot. If not specified then will default to production slot. + * @param pushSettings Push settings for the App. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return push settings for the App. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono listSitePushSettingsSlotAsync(String resourceGroupName, String name, String slot) { - return listSitePushSettingsSlotWithResponseAsync(resourceGroupName, name, slot) + public Mono updateSitePushSettingsSlotAsync( + String resourceGroupName, String name, String slot, PushSettingsInner pushSettings) { + return updateSitePushSettingsSlotWithResponseAsync(resourceGroupName, name, slot, pushSettings) .flatMap( (Response res) -> { if (res.getValue() != null) { @@ -43563,11 +43645,12 @@ public Mono listSitePushSettingsSlotAsync(String resourceGrou } /** - * Description for Gets the Push settings associated with web app. + * Description for Updates the Push settings associated with web app. * * @param resourceGroupName Name of the resource group to which the resource belongs. * @param name Name of web app. * @param slot Name of web app slot. If not specified then will default to production slot. + * @param pushSettings Push settings for the App. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. @@ -43575,9 +43658,9 @@ public Mono listSitePushSettingsSlotAsync(String resourceGrou * @return push settings for the App. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono listSitePushSettingsSlotAsync( - String resourceGroupName, String name, String slot, Context context) { - return listSitePushSettingsSlotWithResponseAsync(resourceGroupName, name, slot, context) + public Mono updateSitePushSettingsSlotAsync( + String resourceGroupName, String name, String slot, PushSettingsInner pushSettings, Context context) { + return updateSitePushSettingsSlotWithResponseAsync(resourceGroupName, name, slot, pushSettings, context) .flatMap( (Response res) -> { if (res.getValue() != null) { @@ -43589,27 +43672,30 @@ public Mono listSitePushSettingsSlotAsync( } /** - * Description for Gets the Push settings associated with web app. + * Description for Updates the Push settings associated with web app. * * @param resourceGroupName Name of the resource group to which the resource belongs. * @param name Name of web app. * @param slot Name of web app slot. If not specified then will default to production slot. + * @param pushSettings Push settings for the App. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return push settings for the App. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PushSettingsInner listSitePushSettingsSlot(String resourceGroupName, String name, String slot) { - return listSitePushSettingsSlotAsync(resourceGroupName, name, slot).block(); + public PushSettingsInner updateSitePushSettingsSlot( + String resourceGroupName, String name, String slot, PushSettingsInner pushSettings) { + return updateSitePushSettingsSlotAsync(resourceGroupName, name, slot, pushSettings).block(); } /** - * Description for Gets the Push settings associated with web app. + * Description for Updates the Push settings associated with web app. * * @param resourceGroupName Name of the resource group to which the resource belongs. * @param name Name of web app. * @param slot Name of web app slot. If not specified then will default to production slot. + * @param pushSettings Push settings for the App. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. @@ -43617,26 +43703,24 @@ public PushSettingsInner listSitePushSettingsSlot(String resourceGroupName, Stri * @return push settings for the App. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PushSettingsInner listSitePushSettingsSlot( - String resourceGroupName, String name, String slot, Context context) { - return listSitePushSettingsSlotAsync(resourceGroupName, name, slot, context).block(); + public PushSettingsInner updateSitePushSettingsSlot( + String resourceGroupName, String name, String slot, PushSettingsInner pushSettings, Context context) { + return updateSitePushSettingsSlotAsync(resourceGroupName, name, slot, pushSettings, context).block(); } /** - * Description for Gets the configuration of an app, such as platform version and bitness, default documents, - * virtual applications, Always On, etc. + * Description for Gets the Push settings associated with web app. * * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will return configuration for the - * production slot. + * @param name Name of web app. + * @param slot Name of web app slot. If not specified then will default to production slot. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return web app configuration ARM resource. + * @return push settings for the App. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getConfigurationSlotWithResponseAsync( + public Mono> listSitePushSettingsSlotWithResponseAsync( String resourceGroupName, String name, String slot) { if (this.client.getEndpoint() == null) { return Mono @@ -43664,7 +43748,7 @@ public Mono> getConfigurationSlotWithResponseA .withContext( context -> service - .getConfigurationSlot( + .listSitePushSettingsSlot( this.client.getEndpoint(), resourceGroupName, name, @@ -43676,21 +43760,19 @@ public Mono> getConfigurationSlotWithResponseA } /** - * Description for Gets the configuration of an app, such as platform version and bitness, default documents, - * virtual applications, Always On, etc. + * Description for Gets the Push settings associated with web app. * * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will return configuration for the - * production slot. + * @param name Name of web app. + * @param slot Name of web app slot. If not specified then will default to production slot. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return web app configuration ARM resource. + * @return push settings for the App. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getConfigurationSlotWithResponseAsync( + public Mono> listSitePushSettingsSlotWithResponseAsync( String resourceGroupName, String name, String slot, Context context) { if (this.client.getEndpoint() == null) { return Mono @@ -43714,8 +43796,9 @@ public Mono> getConfigurationSlotWithResponseA new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service - .getConfigurationSlot( + .listSitePushSettingsSlot( this.client.getEndpoint(), resourceGroupName, name, @@ -43726,23 +43809,21 @@ public Mono> getConfigurationSlotWithResponseA } /** - * Description for Gets the configuration of an app, such as platform version and bitness, default documents, - * virtual applications, Always On, etc. + * Description for Gets the Push settings associated with web app. * * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will return configuration for the - * production slot. + * @param name Name of web app. + * @param slot Name of web app slot. If not specified then will default to production slot. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return web app configuration ARM resource. + * @return push settings for the App. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getConfigurationSlotAsync(String resourceGroupName, String name, String slot) { - return getConfigurationSlotWithResponseAsync(resourceGroupName, name, slot) + public Mono listSitePushSettingsSlotAsync(String resourceGroupName, String name, String slot) { + return listSitePushSettingsSlotWithResponseAsync(resourceGroupName, name, slot) .flatMap( - (Response res) -> { + (Response res) -> { if (res.getValue() != null) { return Mono.just(res.getValue()); } else { @@ -43752,25 +43833,23 @@ public Mono getConfigurationSlotAsync(String resourceGr } /** - * Description for Gets the configuration of an app, such as platform version and bitness, default documents, - * virtual applications, Always On, etc. + * Description for Gets the Push settings associated with web app. * * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will return configuration for the - * production slot. + * @param name Name of web app. + * @param slot Name of web app slot. If not specified then will default to production slot. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return web app configuration ARM resource. + * @return push settings for the App. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getConfigurationSlotAsync( + public Mono listSitePushSettingsSlotAsync( String resourceGroupName, String name, String slot, Context context) { - return getConfigurationSlotWithResponseAsync(resourceGroupName, name, slot, context) + return listSitePushSettingsSlotWithResponseAsync(resourceGroupName, name, slot, context) .flatMap( - (Response res) -> { + (Response res) -> { if (res.getValue() != null) { return Mono.just(res.getValue()); } else { @@ -43780,59 +43859,55 @@ public Mono getConfigurationSlotAsync( } /** - * Description for Gets the configuration of an app, such as platform version and bitness, default documents, - * virtual applications, Always On, etc. + * Description for Gets the Push settings associated with web app. * * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will return configuration for the - * production slot. + * @param name Name of web app. + * @param slot Name of web app slot. If not specified then will default to production slot. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return web app configuration ARM resource. + * @return push settings for the App. */ @ServiceMethod(returns = ReturnType.SINGLE) - public SiteConfigResourceInner getConfigurationSlot(String resourceGroupName, String name, String slot) { - return getConfigurationSlotAsync(resourceGroupName, name, slot).block(); + public PushSettingsInner listSitePushSettingsSlot(String resourceGroupName, String name, String slot) { + return listSitePushSettingsSlotAsync(resourceGroupName, name, slot).block(); } /** - * Description for Gets the configuration of an app, such as platform version and bitness, default documents, - * virtual applications, Always On, etc. + * Description for Gets the Push settings associated with web app. * * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will return configuration for the - * production slot. + * @param name Name of web app. + * @param slot Name of web app slot. If not specified then will default to production slot. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return web app configuration ARM resource. + * @return push settings for the App. */ @ServiceMethod(returns = ReturnType.SINGLE) - public SiteConfigResourceInner getConfigurationSlot( + public PushSettingsInner listSitePushSettingsSlot( String resourceGroupName, String name, String slot, Context context) { - return getConfigurationSlotAsync(resourceGroupName, name, slot, context).block(); + return listSitePushSettingsSlotAsync(resourceGroupName, name, slot, context).block(); } /** - * Description for Updates the configuration of an app. + * Description for Gets the configuration of an app, such as platform version and bitness, default documents, + * virtual applications, Always On, etc. * * @param resourceGroupName Name of the resource group to which the resource belongs. * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will update configuration for the + * @param slot Name of the deployment slot. If a slot is not specified, the API will return configuration for the * production slot. - * @param siteConfig Web app configuration ARM resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return web app configuration ARM resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createOrUpdateConfigurationSlotWithResponseAsync( - String resourceGroupName, String name, String slot, SiteConfigResourceInner siteConfig) { + public Mono> getConfigurationSlotWithResponseAsync( + String resourceGroupName, String name, String slot) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -43855,35 +43930,29 @@ public Mono> createOrUpdateConfigurationSlotWi new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - if (siteConfig == null) { - return Mono.error(new IllegalArgumentException("Parameter siteConfig is required and cannot be null.")); - } else { - siteConfig.validate(); - } return FluxUtil .withContext( context -> service - .createOrUpdateConfigurationSlot( + .getConfigurationSlot( this.client.getEndpoint(), resourceGroupName, name, slot, this.client.getSubscriptionId(), this.client.getApiVersion(), - siteConfig, context)) .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); } /** - * Description for Updates the configuration of an app. + * Description for Gets the configuration of an app, such as platform version and bitness, default documents, + * virtual applications, Always On, etc. * * @param resourceGroupName Name of the resource group to which the resource belongs. * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will update configuration for the + * @param slot Name of the deployment slot. If a slot is not specified, the API will return configuration for the * production slot. - * @param siteConfig Web app configuration ARM resource. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. @@ -43891,8 +43960,8 @@ public Mono> createOrUpdateConfigurationSlotWi * @return web app configuration ARM resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createOrUpdateConfigurationSlotWithResponseAsync( - String resourceGroupName, String name, String slot, SiteConfigResourceInner siteConfig, Context context) { + public Mono> getConfigurationSlotWithResponseAsync( + String resourceGroupName, String name, String slot, Context context) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -43915,40 +43984,34 @@ public Mono> createOrUpdateConfigurationSlotWi new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - if (siteConfig == null) { - return Mono.error(new IllegalArgumentException("Parameter siteConfig is required and cannot be null.")); - } else { - siteConfig.validate(); - } + context = this.client.mergeContext(context); return service - .createOrUpdateConfigurationSlot( + .getConfigurationSlot( this.client.getEndpoint(), resourceGroupName, name, slot, this.client.getSubscriptionId(), this.client.getApiVersion(), - siteConfig, context); } /** - * Description for Updates the configuration of an app. + * Description for Gets the configuration of an app, such as platform version and bitness, default documents, + * virtual applications, Always On, etc. * * @param resourceGroupName Name of the resource group to which the resource belongs. * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will update configuration for the + * @param slot Name of the deployment slot. If a slot is not specified, the API will return configuration for the * production slot. - * @param siteConfig Web app configuration ARM resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return web app configuration ARM resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createOrUpdateConfigurationSlotAsync( - String resourceGroupName, String name, String slot, SiteConfigResourceInner siteConfig) { - return createOrUpdateConfigurationSlotWithResponseAsync(resourceGroupName, name, slot, siteConfig) + public Mono getConfigurationSlotAsync(String resourceGroupName, String name, String slot) { + return getConfigurationSlotWithResponseAsync(resourceGroupName, name, slot) .flatMap( (Response res) -> { if (res.getValue() != null) { @@ -43960,13 +44023,13 @@ public Mono createOrUpdateConfigurationSlotAsync( } /** - * Description for Updates the configuration of an app. + * Description for Gets the configuration of an app, such as platform version and bitness, default documents, + * virtual applications, Always On, etc. * * @param resourceGroupName Name of the resource group to which the resource belongs. * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will update configuration for the + * @param slot Name of the deployment slot. If a slot is not specified, the API will return configuration for the * production slot. - * @param siteConfig Web app configuration ARM resource. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. @@ -43974,9 +44037,9 @@ public Mono createOrUpdateConfigurationSlotAsync( * @return web app configuration ARM resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createOrUpdateConfigurationSlotAsync( - String resourceGroupName, String name, String slot, SiteConfigResourceInner siteConfig, Context context) { - return createOrUpdateConfigurationSlotWithResponseAsync(resourceGroupName, name, slot, siteConfig, context) + public Mono getConfigurationSlotAsync( + String resourceGroupName, String name, String slot, Context context) { + return getConfigurationSlotWithResponseAsync(resourceGroupName, name, slot, context) .flatMap( (Response res) -> { if (res.getValue() != null) { @@ -43988,32 +44051,31 @@ public Mono createOrUpdateConfigurationSlotAsync( } /** - * Description for Updates the configuration of an app. + * Description for Gets the configuration of an app, such as platform version and bitness, default documents, + * virtual applications, Always On, etc. * * @param resourceGroupName Name of the resource group to which the resource belongs. * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will update configuration for the + * @param slot Name of the deployment slot. If a slot is not specified, the API will return configuration for the * production slot. - * @param siteConfig Web app configuration ARM resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return web app configuration ARM resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public SiteConfigResourceInner createOrUpdateConfigurationSlot( - String resourceGroupName, String name, String slot, SiteConfigResourceInner siteConfig) { - return createOrUpdateConfigurationSlotAsync(resourceGroupName, name, slot, siteConfig).block(); + public SiteConfigResourceInner getConfigurationSlot(String resourceGroupName, String name, String slot) { + return getConfigurationSlotAsync(resourceGroupName, name, slot).block(); } /** - * Description for Updates the configuration of an app. + * Description for Gets the configuration of an app, such as platform version and bitness, default documents, + * virtual applications, Always On, etc. * * @param resourceGroupName Name of the resource group to which the resource belongs. * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will update configuration for the + * @param slot Name of the deployment slot. If a slot is not specified, the API will return configuration for the * production slot. - * @param siteConfig Web app configuration ARM resource. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. @@ -44021,9 +44083,9 @@ public SiteConfigResourceInner createOrUpdateConfigurationSlot( * @return web app configuration ARM resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public SiteConfigResourceInner createOrUpdateConfigurationSlot( - String resourceGroupName, String name, String slot, SiteConfigResourceInner siteConfig, Context context) { - return createOrUpdateConfigurationSlotAsync(resourceGroupName, name, slot, siteConfig, context).block(); + public SiteConfigResourceInner getConfigurationSlot( + String resourceGroupName, String name, String slot, Context context) { + return getConfigurationSlotAsync(resourceGroupName, name, slot, context).block(); } /** @@ -44040,7 +44102,7 @@ public SiteConfigResourceInner createOrUpdateConfigurationSlot( * @return web app configuration ARM resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> updateConfigurationSlotWithResponseAsync( + public Mono> createOrUpdateConfigurationSlotWithResponseAsync( String resourceGroupName, String name, String slot, SiteConfigResourceInner siteConfig) { if (this.client.getEndpoint() == null) { return Mono @@ -44073,7 +44135,7 @@ public Mono> updateConfigurationSlotWithRespon .withContext( context -> service - .updateConfigurationSlot( + .createOrUpdateConfigurationSlot( this.client.getEndpoint(), resourceGroupName, name, @@ -44100,7 +44162,7 @@ public Mono> updateConfigurationSlotWithRespon * @return web app configuration ARM resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> updateConfigurationSlotWithResponseAsync( + public Mono> createOrUpdateConfigurationSlotWithResponseAsync( String resourceGroupName, String name, String slot, SiteConfigResourceInner siteConfig, Context context) { if (this.client.getEndpoint() == null) { return Mono @@ -44129,8 +44191,9 @@ public Mono> updateConfigurationSlotWithRespon } else { siteConfig.validate(); } + context = this.client.mergeContext(context); return service - .updateConfigurationSlot( + .createOrUpdateConfigurationSlot( this.client.getEndpoint(), resourceGroupName, name, @@ -44155,9 +44218,9 @@ public Mono> updateConfigurationSlotWithRespon * @return web app configuration ARM resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono updateConfigurationSlotAsync( + public Mono createOrUpdateConfigurationSlotAsync( String resourceGroupName, String name, String slot, SiteConfigResourceInner siteConfig) { - return updateConfigurationSlotWithResponseAsync(resourceGroupName, name, slot, siteConfig) + return createOrUpdateConfigurationSlotWithResponseAsync(resourceGroupName, name, slot, siteConfig) .flatMap( (Response res) -> { if (res.getValue() != null) { @@ -44183,9 +44246,9 @@ public Mono updateConfigurationSlotAsync( * @return web app configuration ARM resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono updateConfigurationSlotAsync( + public Mono createOrUpdateConfigurationSlotAsync( String resourceGroupName, String name, String slot, SiteConfigResourceInner siteConfig, Context context) { - return updateConfigurationSlotWithResponseAsync(resourceGroupName, name, slot, siteConfig, context) + return createOrUpdateConfigurationSlotWithResponseAsync(resourceGroupName, name, slot, siteConfig, context) .flatMap( (Response res) -> { if (res.getValue() != null) { @@ -44210,9 +44273,9 @@ public Mono updateConfigurationSlotAsync( * @return web app configuration ARM resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public SiteConfigResourceInner updateConfigurationSlot( + public SiteConfigResourceInner createOrUpdateConfigurationSlot( String resourceGroupName, String name, String slot, SiteConfigResourceInner siteConfig) { - return updateConfigurationSlotAsync(resourceGroupName, name, slot, siteConfig).block(); + return createOrUpdateConfigurationSlotAsync(resourceGroupName, name, slot, siteConfig).block(); } /** @@ -44230,27 +44293,237 @@ public SiteConfigResourceInner updateConfigurationSlot( * @return web app configuration ARM resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public SiteConfigResourceInner updateConfigurationSlot( + public SiteConfigResourceInner createOrUpdateConfigurationSlot( String resourceGroupName, String name, String slot, SiteConfigResourceInner siteConfig, Context context) { - return updateConfigurationSlotAsync(resourceGroupName, name, slot, siteConfig, context).block(); + return createOrUpdateConfigurationSlotAsync(resourceGroupName, name, slot, siteConfig, context).block(); } /** - * Description for Gets a list of web app configuration snapshots identifiers. Each element of the list contains a - * timestamp and the ID of the snapshot. + * Description for Updates the configuration of an app. * * @param resourceGroupName Name of the resource group to which the resource belongs. * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will return configuration for the + * @param slot Name of the deployment slot. If a slot is not specified, the API will update configuration for the * production slot. + * @param siteConfig Web app configuration ARM resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of metadata for the app configuration snapshots that can be restored. + * @return web app configuration ARM resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> listConfigurationSnapshotInfoSlotSinglePageAsync( - String resourceGroupName, String name, String slot) { + public Mono> updateConfigurationSlotWithResponseAsync( + String resourceGroupName, String name, String slot, SiteConfigResourceInner siteConfig) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (slot == null) { + return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (siteConfig == null) { + return Mono.error(new IllegalArgumentException("Parameter siteConfig is required and cannot be null.")); + } else { + siteConfig.validate(); + } + return FluxUtil + .withContext( + context -> + service + .updateConfigurationSlot( + this.client.getEndpoint(), + resourceGroupName, + name, + slot, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + siteConfig, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Description for Updates the configuration of an app. + * + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param slot Name of the deployment slot. If a slot is not specified, the API will update configuration for the + * production slot. + * @param siteConfig Web app configuration ARM resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return web app configuration ARM resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> updateConfigurationSlotWithResponseAsync( + String resourceGroupName, String name, String slot, SiteConfigResourceInner siteConfig, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (slot == null) { + return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (siteConfig == null) { + return Mono.error(new IllegalArgumentException("Parameter siteConfig is required and cannot be null.")); + } else { + siteConfig.validate(); + } + context = this.client.mergeContext(context); + return service + .updateConfigurationSlot( + this.client.getEndpoint(), + resourceGroupName, + name, + slot, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + siteConfig, + context); + } + + /** + * Description for Updates the configuration of an app. + * + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param slot Name of the deployment slot. If a slot is not specified, the API will update configuration for the + * production slot. + * @param siteConfig Web app configuration ARM resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return web app configuration ARM resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono updateConfigurationSlotAsync( + String resourceGroupName, String name, String slot, SiteConfigResourceInner siteConfig) { + return updateConfigurationSlotWithResponseAsync(resourceGroupName, name, slot, siteConfig) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Description for Updates the configuration of an app. + * + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param slot Name of the deployment slot. If a slot is not specified, the API will update configuration for the + * production slot. + * @param siteConfig Web app configuration ARM resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return web app configuration ARM resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono updateConfigurationSlotAsync( + String resourceGroupName, String name, String slot, SiteConfigResourceInner siteConfig, Context context) { + return updateConfigurationSlotWithResponseAsync(resourceGroupName, name, slot, siteConfig, context) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Description for Updates the configuration of an app. + * + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param slot Name of the deployment slot. If a slot is not specified, the API will update configuration for the + * production slot. + * @param siteConfig Web app configuration ARM resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return web app configuration ARM resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SiteConfigResourceInner updateConfigurationSlot( + String resourceGroupName, String name, String slot, SiteConfigResourceInner siteConfig) { + return updateConfigurationSlotAsync(resourceGroupName, name, slot, siteConfig).block(); + } + + /** + * Description for Updates the configuration of an app. + * + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param slot Name of the deployment slot. If a slot is not specified, the API will update configuration for the + * production slot. + * @param siteConfig Web app configuration ARM resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return web app configuration ARM resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SiteConfigResourceInner updateConfigurationSlot( + String resourceGroupName, String name, String slot, SiteConfigResourceInner siteConfig, Context context) { + return updateConfigurationSlotAsync(resourceGroupName, name, slot, siteConfig, context).block(); + } + + /** + * Description for Gets a list of web app configuration snapshots identifiers. Each element of the list contains a + * timestamp and the ID of the snapshot. + * + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param slot Name of the deployment slot. If a slot is not specified, the API will return configuration for the + * production slot. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of metadata for the app configuration snapshots that can be restored. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listConfigurationSnapshotInfoSlotSinglePageAsync( + String resourceGroupName, String name, String slot) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -44336,6 +44609,7 @@ public Mono> listConfiguration new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listConfigurationSnapshotInfoSlot( this.client.getEndpoint(), @@ -44537,6 +44811,7 @@ public Mono> getConfigurationSnapshotSlotWithR new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getConfigurationSnapshotSlot( this.client.getEndpoint(), @@ -44742,6 +45017,7 @@ public Mono> recoverSiteConfigurationSnapshotSlotWithResponseAsyn new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .recoverSiteConfigurationSnapshotSlot( this.client.getEndpoint(), @@ -44920,6 +45196,7 @@ public Mono getWebSiteContainerLogsSlotWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getWebSiteContainerLogsSlot( this.client.getEndpoint(), @@ -44980,11 +45257,24 @@ public Flux getWebSiteContainerLogsSlotAsync( */ @ServiceMethod(returns = ReturnType.SINGLE) public InputStream getWebSiteContainerLogsSlot(String resourceGroupName, String name, String slot) { - return getWebSiteContainerLogsSlotAsync(resourceGroupName, name, slot) - .map(ByteBufferBackedInputStream::new) - .collectList() - .map(list -> new SequenceInputStream(Collections.enumeration(list))) - .block(); + Iterator iterator = + getWebSiteContainerLogsSlotAsync(resourceGroupName, name, slot) + .map(ByteBufferBackedInputStream::new) + .toStream() + .iterator(); + Enumeration enumeration = + new Enumeration() { + @Override + public boolean hasMoreElements() { + return iterator.hasNext(); + } + + @Override + public InputStream nextElement() { + return iterator.next(); + } + }; + return new SequenceInputStream(enumeration); } /** @@ -45002,11 +45292,24 @@ public InputStream getWebSiteContainerLogsSlot(String resourceGroupName, String @ServiceMethod(returns = ReturnType.SINGLE) public InputStream getWebSiteContainerLogsSlot( String resourceGroupName, String name, String slot, Context context) { - return getWebSiteContainerLogsSlotAsync(resourceGroupName, name, slot, context) - .map(ByteBufferBackedInputStream::new) - .collectList() - .map(list -> new SequenceInputStream(Collections.enumeration(list))) - .block(); + Iterator iterator = + getWebSiteContainerLogsSlotAsync(resourceGroupName, name, slot, context) + .map(ByteBufferBackedInputStream::new) + .toStream() + .iterator(); + Enumeration enumeration = + new Enumeration() { + @Override + public boolean hasMoreElements() { + return iterator.hasNext(); + } + + @Override + public InputStream nextElement() { + return iterator.next(); + } + }; + return new SequenceInputStream(enumeration); } /** @@ -45097,6 +45400,7 @@ public Mono getContainerLogsZipSlotWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getContainerLogsZipSlot( this.client.getEndpoint(), @@ -45157,11 +45461,24 @@ public Flux getContainerLogsZipSlotAsync( */ @ServiceMethod(returns = ReturnType.SINGLE) public InputStream getContainerLogsZipSlot(String resourceGroupName, String name, String slot) { - return getContainerLogsZipSlotAsync(resourceGroupName, name, slot) - .map(ByteBufferBackedInputStream::new) - .collectList() - .map(list -> new SequenceInputStream(Collections.enumeration(list))) - .block(); + Iterator iterator = + getContainerLogsZipSlotAsync(resourceGroupName, name, slot) + .map(ByteBufferBackedInputStream::new) + .toStream() + .iterator(); + Enumeration enumeration = + new Enumeration() { + @Override + public boolean hasMoreElements() { + return iterator.hasNext(); + } + + @Override + public InputStream nextElement() { + return iterator.next(); + } + }; + return new SequenceInputStream(enumeration); } /** @@ -45178,11 +45495,24 @@ public InputStream getContainerLogsZipSlot(String resourceGroupName, String name */ @ServiceMethod(returns = ReturnType.SINGLE) public InputStream getContainerLogsZipSlot(String resourceGroupName, String name, String slot, Context context) { - return getContainerLogsZipSlotAsync(resourceGroupName, name, slot, context) - .map(ByteBufferBackedInputStream::new) - .collectList() - .map(list -> new SequenceInputStream(Collections.enumeration(list))) - .block(); + Iterator iterator = + getContainerLogsZipSlotAsync(resourceGroupName, name, slot, context) + .map(ByteBufferBackedInputStream::new) + .toStream() + .iterator(); + Enumeration enumeration = + new Enumeration() { + @Override + public boolean hasMoreElements() { + return iterator.hasNext(); + } + + @Override + public InputStream nextElement() { + return iterator.next(); + } + }; + return new SequenceInputStream(enumeration); } /** @@ -45284,6 +45614,7 @@ public Mono> listContinuousWebJobsSlotSingl new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listContinuousWebJobsSlot( this.client.getEndpoint(), @@ -45481,6 +45812,7 @@ public Mono> getContinuousWebJobSlotWithResponse new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getContinuousWebJobSlot( this.client.getEndpoint(), @@ -45686,6 +46018,7 @@ public Mono> deleteContinuousWebJobSlotWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .deleteContinuousWebJobSlot( this.client.getEndpoint(), @@ -45874,6 +46207,7 @@ public Mono> startContinuousWebJobSlotWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .startContinuousWebJobSlot( this.client.getEndpoint(), @@ -46062,6 +46396,7 @@ public Mono> stopContinuousWebJobSlotWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .stopContinuousWebJobSlot( this.client.getEndpoint(), @@ -46250,6 +46585,7 @@ public Mono> listDeploymentsSlotSinglePageAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listDeploymentsSlot( this.client.getEndpoint(), @@ -46445,6 +46781,7 @@ public Mono> getDeploymentSlotWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getDeploymentSlot( this.client.getEndpoint(), @@ -46661,6 +46998,7 @@ public Mono> createDeploymentSlotWithResponseAsync( } else { deployment.validate(); } + context = this.client.mergeContext(context); return service .createDeploymentSlot( this.client.getEndpoint(), @@ -46871,6 +47209,7 @@ public Mono> deleteDeploymentSlotWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .deleteDeploymentSlot( this.client.getEndpoint(), @@ -47059,6 +47398,7 @@ public Mono> listDeploymentLogSlotWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listDeploymentLogSlot( this.client.getEndpoint(), @@ -47273,6 +47613,7 @@ public Mono> discoverBackupSlotWithResponseAsync( } else { request.validate(); } + context = this.client.mergeContext(context); return service .discoverBackupSlot( this.client.getEndpoint(), @@ -47482,6 +47823,7 @@ public Mono> listDomainOwnershipIdentifiersSlotSi new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listDomainOwnershipIdentifiersSlot( this.client.getEndpoint(), @@ -47685,6 +48027,7 @@ public Mono> getDomainOwnershipIdentifierSlotWithRespo new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getDomainOwnershipIdentifierSlot( this.client.getEndpoint(), @@ -47929,6 +48272,7 @@ public Mono> createOrUpdateDomainOwnershipIdentifierSl } else { domainOwnershipIdentifier.validate(); } + context = this.client.mergeContext(context); return service .createOrUpdateDomainOwnershipIdentifierSlot( this.client.getEndpoint(), @@ -48169,6 +48513,7 @@ public Mono> deleteDomainOwnershipIdentifierSlotWithResponseAsync new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .deleteDomainOwnershipIdentifierSlot( this.client.getEndpoint(), @@ -48395,6 +48740,7 @@ public Mono> updateDomainOwnershipIdentifierSlotWithRe } else { domainOwnershipIdentifier.validate(); } + context = this.client.mergeContext(context); return service .updateDomainOwnershipIdentifierSlot( this.client.getEndpoint(), @@ -48618,6 +48964,7 @@ public Mono> getMSDeployStatusSlotWithResponseAsyn new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getMSDeployStatusSlot( this.client.getEndpoint(), @@ -48814,6 +49161,7 @@ public Mono>> createMSDeployOperationSlotWithResponseA } else { mSDeploy.validate(); } + context = this.client.mergeContext(context); return service .createMSDeployOperationSlot( this.client.getEndpoint(), @@ -48839,7 +49187,7 @@ public Mono>> createMSDeployOperationSlotWithResponseA * @return mSDeploy ARM response. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, MSDeployStatusInner> beginCreateMSDeployOperationSlot( + public PollerFlux, MSDeployStatusInner> beginCreateMSDeployOperationSlotAsync( String resourceGroupName, String name, String slot, MSDeploy mSDeploy) { Mono>> mono = createMSDeployOperationSlotWithResponseAsync(resourceGroupName, name, slot, mSDeploy); @@ -48863,7 +49211,7 @@ public PollerFlux, MSDeployStatusInner> beginCre * @return mSDeploy ARM response. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, MSDeployStatusInner> beginCreateMSDeployOperationSlot( + public PollerFlux, MSDeployStatusInner> beginCreateMSDeployOperationSlotAsync( String resourceGroupName, String name, String slot, MSDeploy mSDeploy, Context context) { Mono>> mono = createMSDeployOperationSlotWithResponseAsync(resourceGroupName, name, slot, mSDeploy, context); @@ -48886,16 +49234,9 @@ public PollerFlux, MSDeployStatusInner> beginCre * @return mSDeploy ARM response. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createMSDeployOperationSlotAsync( + public SyncPoller, MSDeployStatusInner> beginCreateMSDeployOperationSlot( String resourceGroupName, String name, String slot, MSDeploy mSDeploy) { - Mono>> mono = - createMSDeployOperationSlotWithResponseAsync(resourceGroupName, name, slot, mSDeploy); - return this - .client - .getLroResultAsync( - mono, this.client.getHttpPipeline(), MSDeployStatusInner.class, MSDeployStatusInner.class) - .last() - .flatMap(client::getLroFinalResultOrError); + return beginCreateMSDeployOperationSlotAsync(resourceGroupName, name, slot, mSDeploy).getSyncPoller(); } /** @@ -48912,16 +49253,9 @@ public Mono createMSDeployOperationSlotAsync( * @return mSDeploy ARM response. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createMSDeployOperationSlotAsync( + public SyncPoller, MSDeployStatusInner> beginCreateMSDeployOperationSlot( String resourceGroupName, String name, String slot, MSDeploy mSDeploy, Context context) { - Mono>> mono = - createMSDeployOperationSlotWithResponseAsync(resourceGroupName, name, slot, mSDeploy, context); - return this - .client - .getLroResultAsync( - mono, this.client.getHttpPipeline(), MSDeployStatusInner.class, MSDeployStatusInner.class) - .last() - .flatMap(client::getLroFinalResultOrError); + return beginCreateMSDeployOperationSlotAsync(resourceGroupName, name, slot, mSDeploy, context).getSyncPoller(); } /** @@ -48937,9 +49271,11 @@ public Mono createMSDeployOperationSlotAsync( * @return mSDeploy ARM response. */ @ServiceMethod(returns = ReturnType.SINGLE) - public MSDeployStatusInner createMSDeployOperationSlot( + public Mono createMSDeployOperationSlotAsync( String resourceGroupName, String name, String slot, MSDeploy mSDeploy) { - return createMSDeployOperationSlotAsync(resourceGroupName, name, slot, mSDeploy).block(); + return beginCreateMSDeployOperationSlotAsync(resourceGroupName, name, slot, mSDeploy) + .last() + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -48956,77 +49292,64 @@ public MSDeployStatusInner createMSDeployOperationSlot( * @return mSDeploy ARM response. */ @ServiceMethod(returns = ReturnType.SINGLE) - public MSDeployStatusInner createMSDeployOperationSlot( + public Mono createMSDeployOperationSlotAsync( String resourceGroupName, String name, String slot, MSDeploy mSDeploy, Context context) { - return createMSDeployOperationSlotAsync(resourceGroupName, name, slot, mSDeploy, context).block(); + return beginCreateMSDeployOperationSlotAsync(resourceGroupName, name, slot, mSDeploy, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); } /** - * Description for Get the MSDeploy Log for the last MSDeploy operation. + * Description for Invoke the MSDeploy web app extension. * * @param resourceGroupName Name of the resource group to which the resource belongs. * @param name Name of web app. * @param slot Name of web app slot. If not specified then will default to production slot. + * @param mSDeploy MSDeploy ARM PUT information. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return mSDeploy log. + * @return mSDeploy ARM response. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getMSDeployLogSlotWithResponseAsync( - String resourceGroupName, String name, String slot) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - return FluxUtil - .withContext( - context -> - service - .getMSDeployLogSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + public MSDeployStatusInner createMSDeployOperationSlot( + String resourceGroupName, String name, String slot, MSDeploy mSDeploy) { + return createMSDeployOperationSlotAsync(resourceGroupName, name, slot, mSDeploy).block(); } /** - * Description for Get the MSDeploy Log for the last MSDeploy operation. + * Description for Invoke the MSDeploy web app extension. * * @param resourceGroupName Name of the resource group to which the resource belongs. * @param name Name of web app. * @param slot Name of web app slot. If not specified then will default to production slot. + * @param mSDeploy MSDeploy ARM PUT information. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return mSDeploy ARM response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public MSDeployStatusInner createMSDeployOperationSlot( + String resourceGroupName, String name, String slot, MSDeploy mSDeploy, Context context) { + return createMSDeployOperationSlotAsync(resourceGroupName, name, slot, mSDeploy, context).block(); + } + + /** + * Description for Get the MSDeploy Log for the last MSDeploy operation. + * + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of web app. + * @param slot Name of web app slot. If not specified then will default to production slot. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return mSDeploy log. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getMSDeployLogSlotWithResponseAsync( - String resourceGroupName, String name, String slot, Context context) { + String resourceGroupName, String name, String slot) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -49049,6 +49372,59 @@ public Mono> getMSDeployLogSlotWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + return FluxUtil + .withContext( + context -> + service + .getMSDeployLogSlot( + this.client.getEndpoint(), + resourceGroupName, + name, + slot, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Description for Get the MSDeploy Log for the last MSDeploy operation. + * + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of web app. + * @param slot Name of web app slot. If not specified then will default to production slot. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return mSDeploy log. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getMSDeployLogSlotWithResponseAsync( + String resourceGroupName, String name, String slot, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (slot == null) { + return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + context = this.client.mergeContext(context); return service .getMSDeployLogSlot( this.client.getEndpoint(), @@ -49240,6 +49616,7 @@ public Mono> listInstanceFunctionsSlotSingl new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listInstanceFunctionsSlot( this.client.getEndpoint(), @@ -49422,6 +49799,7 @@ public Mono> getFunctionsAdminTokenSlotWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getFunctionsAdminTokenSlot( this.client.getEndpoint(), @@ -49613,6 +49991,7 @@ public Mono> getInstanceFunctionSlotWithResponse new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getInstanceFunctionSlot( this.client.getEndpoint(), @@ -49836,6 +50215,7 @@ public Mono>> createInstanceFunctionSlotWithResponseAs } else { functionEnvelope.validate(); } + context = this.client.mergeContext(context); return service .createInstanceFunctionSlot( this.client.getEndpoint(), @@ -49863,7 +50243,7 @@ public Mono>> createInstanceFunctionSlotWithResponseAs * @return function information. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, FunctionEnvelopeInner> beginCreateInstanceFunctionSlot( + public PollerFlux, FunctionEnvelopeInner> beginCreateInstanceFunctionSlotAsync( String resourceGroupName, String name, String functionName, @@ -49892,7 +50272,7 @@ public PollerFlux, FunctionEnvelopeInner> begi * @return function information. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, FunctionEnvelopeInner> beginCreateInstanceFunctionSlot( + public PollerFlux, FunctionEnvelopeInner> beginCreateInstanceFunctionSlotAsync( String resourceGroupName, String name, String functionName, @@ -49908,6 +50288,57 @@ public PollerFlux, FunctionEnvelopeInner> begi mono, this.client.getHttpPipeline(), FunctionEnvelopeInner.class, FunctionEnvelopeInner.class); } + /** + * Description for Create function for web site, or a deployment slot. + * + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param functionName Function name. + * @param slot Name of the deployment slot. + * @param functionEnvelope Function information. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return function information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, FunctionEnvelopeInner> beginCreateInstanceFunctionSlot( + String resourceGroupName, + String name, + String functionName, + String slot, + FunctionEnvelopeInner functionEnvelope) { + return beginCreateInstanceFunctionSlotAsync(resourceGroupName, name, functionName, slot, functionEnvelope) + .getSyncPoller(); + } + + /** + * Description for Create function for web site, or a deployment slot. + * + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param functionName Function name. + * @param slot Name of the deployment slot. + * @param functionEnvelope Function information. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return function information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, FunctionEnvelopeInner> beginCreateInstanceFunctionSlot( + String resourceGroupName, + String name, + String functionName, + String slot, + FunctionEnvelopeInner functionEnvelope, + Context context) { + return beginCreateInstanceFunctionSlotAsync( + resourceGroupName, name, functionName, slot, functionEnvelope, context) + .getSyncPoller(); + } + /** * Description for Create function for web site, or a deployment slot. * @@ -49928,14 +50359,9 @@ public Mono createInstanceFunctionSlotAsync( String functionName, String slot, FunctionEnvelopeInner functionEnvelope) { - Mono>> mono = - createInstanceFunctionSlotWithResponseAsync(resourceGroupName, name, functionName, slot, functionEnvelope); - return this - .client - .getLroResultAsync( - mono, this.client.getHttpPipeline(), FunctionEnvelopeInner.class, FunctionEnvelopeInner.class) + return beginCreateInstanceFunctionSlotAsync(resourceGroupName, name, functionName, slot, functionEnvelope) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -49960,15 +50386,10 @@ public Mono createInstanceFunctionSlotAsync( String slot, FunctionEnvelopeInner functionEnvelope, Context context) { - Mono>> mono = - createInstanceFunctionSlotWithResponseAsync( - resourceGroupName, name, functionName, slot, functionEnvelope, context); - return this - .client - .getLroResultAsync( - mono, this.client.getHttpPipeline(), FunctionEnvelopeInner.class, FunctionEnvelopeInner.class) + return beginCreateInstanceFunctionSlotAsync( + resourceGroupName, name, functionName, slot, functionEnvelope, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -50117,6 +50538,7 @@ public Mono> deleteInstanceFunctionSlotWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .deleteInstanceFunctionSlot( this.client.getEndpoint(), @@ -50327,6 +50749,7 @@ public Mono> createOrUpdateFunctionSecretSlotWithResponse } else { key.validate(); } + context = this.client.mergeContext(context); return service .createOrUpdateFunctionSecretSlot( this.client.getEndpoint(), @@ -50560,6 +50983,7 @@ public Mono> deleteFunctionSecretSlotWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .deleteFunctionSecretSlot( this.client.getEndpoint(), @@ -50748,6 +51172,7 @@ public Mono> listFunctionKeysSlotWithResponseAsy new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listFunctionKeysSlot( this.client.getEndpoint(), @@ -50947,6 +51372,7 @@ public Mono> listFunctionSecretsSlotWithResponseA new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listFunctionSecretsSlot( this.client.getEndpoint(), @@ -51137,6 +51563,7 @@ public Mono> listHostKeysSlotWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listHostKeysSlot( this.client.getEndpoint(), @@ -51319,6 +51746,7 @@ public Mono> listSyncStatusSlotWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listSyncStatusSlot( this.client.getEndpoint(), @@ -51483,6 +51911,7 @@ public Mono> syncFunctionsSlotWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .syncFunctionsSlot( this.client.getEndpoint(), @@ -51685,6 +52114,7 @@ public Mono> createOrUpdateHostSecretSlotWithResponseAsyn } else { key.validate(); } + context = this.client.mergeContext(context); return service .createOrUpdateHostSecretSlot( this.client.getEndpoint(), @@ -51916,6 +52346,7 @@ public Mono> deleteHostSecretSlotWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .deleteHostSecretSlot( this.client.getEndpoint(), @@ -52106,6 +52537,7 @@ public Mono> listHostnameBindingsSlotSingleP new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listHostnameBindingsSlot( this.client.getEndpoint(), @@ -52303,6 +52735,7 @@ public Mono> getHostnameBindingSlotWithResponseAs new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getHostnameBindingSlot( this.client.getEndpoint(), @@ -52528,6 +52961,7 @@ public Mono> createOrUpdateHostnameBindingSlotWit } else { hostnameBinding.validate(); } + context = this.client.mergeContext(context); return service .createOrUpdateHostnameBindingSlot( this.client.getEndpoint(), @@ -52751,6 +53185,7 @@ public Mono> deleteHostnameBindingSlotWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .deleteHostnameBindingSlot( this.client.getEndpoint(), @@ -52946,6 +53381,7 @@ public Mono> getHybridConnectionSlotWithResponse new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getHybridConnectionSlot( this.client.getEndpoint(), @@ -53186,6 +53622,7 @@ public Mono> createOrUpdateHybridConnectionSlotW } else { connectionEnvelope.validate(); } + context = this.client.mergeContext(context); return service .createOrUpdateHybridConnectionSlot( this.client.getEndpoint(), @@ -53432,6 +53869,7 @@ public Mono> deleteHybridConnectionSlotWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .deleteHybridConnectionSlot( this.client.getEndpoint(), @@ -53656,6 +54094,7 @@ public Mono> updateHybridConnectionSlotWithRespo } else { connectionEnvelope.validate(); } + context = this.client.mergeContext(context); return service .updateHybridConnectionSlot( this.client.getEndpoint(), @@ -53884,6 +54323,7 @@ public Mono> listHybridConnectionsSlotWithRespon new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listHybridConnectionsSlot( this.client.getEndpoint(), @@ -54070,6 +54510,7 @@ public Mono> listRelayServiceConnect new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listRelayServiceConnectionsSlot( this.client.getEndpoint(), @@ -54270,6 +54711,7 @@ public Mono> getRelayServiceConnecti new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getRelayServiceConnectionSlot( this.client.getEndpoint(), @@ -54499,6 +54941,7 @@ public Mono> createOrUpdateRelayServ } else { connectionEnvelope.validate(); } + context = this.client.mergeContext(context); return service .createOrUpdateRelayServiceConnectionSlot( this.client.getEndpoint(), @@ -54733,6 +55176,7 @@ public Mono> deleteRelayServiceConnectionSlotWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .deleteRelayServiceConnectionSlot( this.client.getEndpoint(), @@ -54946,6 +55390,7 @@ public Mono> updateRelayServiceConne } else { connectionEnvelope.validate(); } + context = this.client.mergeContext(context); return service .updateRelayServiceConnectionSlot( this.client.getEndpoint(), @@ -55177,6 +55622,7 @@ public Mono> listInstanceIdentifiersSlotSingleP new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listInstanceIdentifiersSlot( this.client.getEndpoint(), @@ -55368,6 +55814,7 @@ public Mono> getInstanceInfoSlotWithRespons new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getInstanceInfoSlot( this.client.getEndpoint(), @@ -55567,6 +56014,7 @@ public Mono> getInstanceMsDeployStatusSlotWithResp new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getInstanceMsDeployStatusSlot( this.client.getEndpoint(), @@ -55779,6 +56227,7 @@ public Mono>> createInstanceMSDeployOperationSlotWithR } else { mSDeploy.validate(); } + context = this.client.mergeContext(context); return service .createInstanceMSDeployOperationSlot( this.client.getEndpoint(), @@ -55806,8 +56255,9 @@ public Mono>> createInstanceMSDeployOperationSlotWithR * @return mSDeploy ARM response. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, MSDeployStatusInner> beginCreateInstanceMSDeployOperationSlot( - String resourceGroupName, String name, String slot, String instanceId, MSDeploy mSDeploy) { + public PollerFlux, MSDeployStatusInner> + beginCreateInstanceMSDeployOperationSlotAsync( + String resourceGroupName, String name, String slot, String instanceId, MSDeploy mSDeploy) { Mono>> mono = createInstanceMSDeployOperationSlotWithResponseAsync(resourceGroupName, name, slot, instanceId, mSDeploy); return this @@ -55831,8 +56281,9 @@ public PollerFlux, MSDeployStatusInner> beginCre * @return mSDeploy ARM response. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, MSDeployStatusInner> beginCreateInstanceMSDeployOperationSlot( - String resourceGroupName, String name, String slot, String instanceId, MSDeploy mSDeploy, Context context) { + public PollerFlux, MSDeployStatusInner> + beginCreateInstanceMSDeployOperationSlotAsync( + String resourceGroupName, String name, String slot, String instanceId, MSDeploy mSDeploy, Context context) { Mono>> mono = createInstanceMSDeployOperationSlotWithResponseAsync( resourceGroupName, name, slot, instanceId, mSDeploy, context); @@ -55842,6 +56293,48 @@ public PollerFlux, MSDeployStatusInner> beginCre mono, this.client.getHttpPipeline(), MSDeployStatusInner.class, MSDeployStatusInner.class); } + /** + * Description for Invoke the MSDeploy web app extension. + * + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of web app. + * @param slot Name of web app slot. If not specified then will default to production slot. + * @param instanceId ID of web app instance. + * @param mSDeploy MSDeploy ARM PUT information. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return mSDeploy ARM response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, MSDeployStatusInner> beginCreateInstanceMSDeployOperationSlot( + String resourceGroupName, String name, String slot, String instanceId, MSDeploy mSDeploy) { + return beginCreateInstanceMSDeployOperationSlotAsync(resourceGroupName, name, slot, instanceId, mSDeploy) + .getSyncPoller(); + } + + /** + * Description for Invoke the MSDeploy web app extension. + * + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of web app. + * @param slot Name of web app slot. If not specified then will default to production slot. + * @param instanceId ID of web app instance. + * @param mSDeploy MSDeploy ARM PUT information. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return mSDeploy ARM response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, MSDeployStatusInner> beginCreateInstanceMSDeployOperationSlot( + String resourceGroupName, String name, String slot, String instanceId, MSDeploy mSDeploy, Context context) { + return beginCreateInstanceMSDeployOperationSlotAsync( + resourceGroupName, name, slot, instanceId, mSDeploy, context) + .getSyncPoller(); + } + /** * Description for Invoke the MSDeploy web app extension. * @@ -55858,14 +56351,9 @@ public PollerFlux, MSDeployStatusInner> beginCre @ServiceMethod(returns = ReturnType.SINGLE) public Mono createInstanceMSDeployOperationSlotAsync( String resourceGroupName, String name, String slot, String instanceId, MSDeploy mSDeploy) { - Mono>> mono = - createInstanceMSDeployOperationSlotWithResponseAsync(resourceGroupName, name, slot, instanceId, mSDeploy); - return this - .client - .getLroResultAsync( - mono, this.client.getHttpPipeline(), MSDeployStatusInner.class, MSDeployStatusInner.class) + return beginCreateInstanceMSDeployOperationSlotAsync(resourceGroupName, name, slot, instanceId, mSDeploy) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -55885,15 +56373,10 @@ public Mono createInstanceMSDeployOperationSlotAsync( @ServiceMethod(returns = ReturnType.SINGLE) public Mono createInstanceMSDeployOperationSlotAsync( String resourceGroupName, String name, String slot, String instanceId, MSDeploy mSDeploy, Context context) { - Mono>> mono = - createInstanceMSDeployOperationSlotWithResponseAsync( - resourceGroupName, name, slot, instanceId, mSDeploy, context); - return this - .client - .getLroResultAsync( - mono, this.client.getHttpPipeline(), MSDeployStatusInner.class, MSDeployStatusInner.class) + return beginCreateInstanceMSDeployOperationSlotAsync( + resourceGroupName, name, slot, instanceId, mSDeploy, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -56033,6 +56516,7 @@ public Mono> getInstanceMSDeployLogSlotWithResponseAs new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getInstanceMSDeployLogSlot( this.client.getEndpoint(), @@ -56247,6 +56731,7 @@ public Mono> listInstanceProcessesSlotSinglePage new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listInstanceProcessesSlot( this.client.getEndpoint(), @@ -56468,6 +56953,7 @@ public Mono> getInstanceProcessSlotWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getInstanceProcessSlot( this.client.getEndpoint(), @@ -56695,6 +57181,7 @@ public Mono> deleteInstanceProcessSlotWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .deleteInstanceProcessSlot( this.client.getEndpoint(), @@ -56908,6 +57395,7 @@ public Mono getInstanceProcessDumpSlotWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getInstanceProcessDumpSlot( this.client.getEndpoint(), @@ -56985,11 +57473,24 @@ public Flux getInstanceProcessDumpSlotAsync( @ServiceMethod(returns = ReturnType.SINGLE) public InputStream getInstanceProcessDumpSlot( String resourceGroupName, String name, String processId, String slot, String instanceId) { - return getInstanceProcessDumpSlotAsync(resourceGroupName, name, processId, slot, instanceId) - .map(ByteBufferBackedInputStream::new) - .collectList() - .map(list -> new SequenceInputStream(Collections.enumeration(list))) - .block(); + Iterator iterator = + getInstanceProcessDumpSlotAsync(resourceGroupName, name, processId, slot, instanceId) + .map(ByteBufferBackedInputStream::new) + .toStream() + .iterator(); + Enumeration enumeration = + new Enumeration() { + @Override + public boolean hasMoreElements() { + return iterator.hasNext(); + } + + @Override + public InputStream nextElement() { + return iterator.next(); + } + }; + return new SequenceInputStream(enumeration); } /** @@ -57011,11 +57512,24 @@ public InputStream getInstanceProcessDumpSlot( @ServiceMethod(returns = ReturnType.SINGLE) public InputStream getInstanceProcessDumpSlot( String resourceGroupName, String name, String processId, String slot, String instanceId, Context context) { - return getInstanceProcessDumpSlotAsync(resourceGroupName, name, processId, slot, instanceId, context) - .map(ByteBufferBackedInputStream::new) - .collectList() - .map(list -> new SequenceInputStream(Collections.enumeration(list))) - .block(); + Iterator iterator = + getInstanceProcessDumpSlotAsync(resourceGroupName, name, processId, slot, instanceId, context) + .map(ByteBufferBackedInputStream::new) + .toStream() + .iterator(); + Enumeration enumeration = + new Enumeration() { + @Override + public boolean hasMoreElements() { + return iterator.hasNext(); + } + + @Override + public InputStream nextElement() { + return iterator.next(); + } + }; + return new SequenceInputStream(enumeration); } /** @@ -57137,6 +57651,7 @@ public Mono> listInstanceProcessModulesSlo new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listInstanceProcessModulesSlot( this.client.getEndpoint(), @@ -57378,6 +57893,7 @@ public Mono> getInstanceProcessModuleSlotWithRe new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getInstanceProcessModuleSlot( this.client.getEndpoint(), @@ -57634,6 +58150,7 @@ public Mono> listInstanceProcessThreadsSlo new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listInstanceProcessThreadsSlot( this.client.getEndpoint(), @@ -57838,6 +58355,7 @@ public Mono> isCloneableSlotWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .isCloneableSlot( this.client.getEndpoint(), @@ -58031,6 +58549,7 @@ public Mono> listSiteBackupsSlotSinglePageAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listSiteBackupsSlot( this.client.getEndpoint(), @@ -58215,6 +58734,7 @@ public Mono> listSyncFunctionTriggersSlotWithResp new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listSyncFunctionTriggersSlot( this.client.getEndpoint(), @@ -58401,6 +58921,7 @@ public Mono> getMigrateMySqlStatusSlotWithResp new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getMigrateMySqlStatusSlot( this.client.getEndpoint(), @@ -58591,6 +59112,7 @@ public Mono> getSwiftVirtualNetworkConnection new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getSwiftVirtualNetworkConnectionSlot( this.client.getEndpoint(), @@ -58807,6 +59329,7 @@ public Mono> createOrUpdateSwiftVirtualNetwor } else { connectionEnvelope.validate(); } + context = this.client.mergeContext(context); return service .createOrUpdateSwiftVirtualNetworkConnectionSlot( this.client.getEndpoint(), @@ -59028,6 +59551,7 @@ public Mono> deleteSwiftVirtualNetworkSlotWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .deleteSwiftVirtualNetworkSlot( this.client.getEndpoint(), @@ -59225,6 +59749,7 @@ public Mono> updateSwiftVirtualNetworkConnect } else { connectionEnvelope.validate(); } + context = this.client.mergeContext(context); return service .updateSwiftVirtualNetworkConnectionSlot( this.client.getEndpoint(), @@ -59453,6 +59978,7 @@ public Mono> listNetworkFeaturesSlotWithResponseA new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listNetworkFeaturesSlot( this.client.getEndpoint(), @@ -59658,6 +60184,7 @@ public Mono> getNetworkTraceOperationSlotWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getNetworkTraceOperationSlot( this.client.getEndpoint(), @@ -59871,6 +60398,7 @@ public Mono> startWebSiteNetworkTraceSlotWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .startWebSiteNetworkTraceSlot( this.client.getEndpoint(), @@ -60170,6 +60698,7 @@ public Mono>> startWebSiteNetworkTraceOperationSlotWit new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .startWebSiteNetworkTraceOperationSlot( this.client.getEndpoint(), @@ -60199,7 +60728,7 @@ public Mono>> startWebSiteNetworkTraceOperationSlotWit * @return array of NetworkTrace. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, Object> beginStartWebSiteNetworkTraceOperationSlot( + public PollerFlux, Object> beginStartWebSiteNetworkTraceOperationSlotAsync( String resourceGroupName, String name, String slot, @@ -60230,7 +60759,7 @@ public PollerFlux, Object> beginStartWebSiteNetworkTraceOpera * @return array of NetworkTrace. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, Object> beginStartWebSiteNetworkTraceOperationSlot( + public PollerFlux, Object> beginStartWebSiteNetworkTraceOperationSlotAsync( String resourceGroupName, String name, String slot, @@ -60246,6 +60775,62 @@ public PollerFlux, Object> beginStartWebSiteNetworkTraceOpera .getLroResultAsync(mono, this.client.getHttpPipeline(), Object.class, Object.class); } + /** + * Description for Start capturing network packets for the site. + * + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name The name of the web app. + * @param slot The name of the slot for this web app. + * @param durationInSeconds The duration to keep capturing in seconds. + * @param maxFrameLength The maximum frame length in bytes (Optional). + * @param sasUrl The Blob URL to store capture file. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return array of NetworkTrace. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Object> beginStartWebSiteNetworkTraceOperationSlot( + String resourceGroupName, + String name, + String slot, + Integer durationInSeconds, + Integer maxFrameLength, + String sasUrl) { + return beginStartWebSiteNetworkTraceOperationSlotAsync( + resourceGroupName, name, slot, durationInSeconds, maxFrameLength, sasUrl) + .getSyncPoller(); + } + + /** + * Description for Start capturing network packets for the site. + * + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name The name of the web app. + * @param slot The name of the slot for this web app. + * @param durationInSeconds The duration to keep capturing in seconds. + * @param maxFrameLength The maximum frame length in bytes (Optional). + * @param sasUrl The Blob URL to store capture file. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return array of NetworkTrace. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Object> beginStartWebSiteNetworkTraceOperationSlot( + String resourceGroupName, + String name, + String slot, + Integer durationInSeconds, + Integer maxFrameLength, + String sasUrl, + Context context) { + return beginStartWebSiteNetworkTraceOperationSlotAsync( + resourceGroupName, name, slot, durationInSeconds, maxFrameLength, sasUrl, context) + .getSyncPoller(); + } + /** * Description for Start capturing network packets for the site. * @@ -60268,14 +60853,10 @@ public Mono startWebSiteNetworkTraceOperationSlotAsync( Integer durationInSeconds, Integer maxFrameLength, String sasUrl) { - Mono>> mono = - startWebSiteNetworkTraceOperationSlotWithResponseAsync( - resourceGroupName, name, slot, durationInSeconds, maxFrameLength, sasUrl); - return this - .client - .getLroResultAsync(mono, this.client.getHttpPipeline(), Object.class, Object.class) + return beginStartWebSiteNetworkTraceOperationSlotAsync( + resourceGroupName, name, slot, durationInSeconds, maxFrameLength, sasUrl) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -60302,14 +60883,10 @@ public Mono startWebSiteNetworkTraceOperationSlotAsync( Integer maxFrameLength, String sasUrl, Context context) { - Mono>> mono = - startWebSiteNetworkTraceOperationSlotWithResponseAsync( - resourceGroupName, name, slot, durationInSeconds, maxFrameLength, sasUrl, context); - return this - .client - .getLroResultAsync(mono, this.client.getHttpPipeline(), Object.class, Object.class) + return beginStartWebSiteNetworkTraceOperationSlotAsync( + resourceGroupName, name, slot, durationInSeconds, maxFrameLength, sasUrl, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -60329,14 +60906,10 @@ public Mono startWebSiteNetworkTraceOperationSlotAsync(String resourceGr final Integer maxFrameLength = null; final String sasUrl = null; final Context context = null; - Mono>> mono = - startWebSiteNetworkTraceOperationSlotWithResponseAsync( - resourceGroupName, name, slot, durationInSeconds, maxFrameLength, sasUrl); - return this - .client - .getLroResultAsync(mono, this.client.getHttpPipeline(), Object.class, Object.class) + return beginStartWebSiteNetworkTraceOperationSlotAsync( + resourceGroupName, name, slot, durationInSeconds, maxFrameLength, sasUrl) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -60505,6 +61078,7 @@ public Mono> stopWebSiteNetworkTraceSlotWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .stopWebSiteNetworkTraceSlot( this.client.getEndpoint(), @@ -60682,6 +61256,7 @@ public Mono>> getNetworkTracesSlotWithResponseA new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getNetworkTracesSlot( this.client.getEndpoint(), @@ -60887,6 +61462,7 @@ public Mono> getNetworkTraceOperationSlotV2WithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getNetworkTraceOperationSlotV2( this.client.getEndpoint(), @@ -61092,6 +61668,7 @@ public Mono>> getNetworkTracesSlotV2WithRespons new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getNetworkTracesSlotV2( this.client.getEndpoint(), @@ -61288,6 +61865,7 @@ public Mono> generateNewSitePublishingPasswordSlotWithResponseAsy new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .generateNewSitePublishingPasswordSlot( this.client.getEndpoint(), @@ -61475,6 +62053,7 @@ public Mono> listPerfMonCountersSlotSinglePa new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listPerfMonCountersSlot( this.client.getEndpoint(), @@ -61710,6 +62289,7 @@ public Mono> getSitePhpErrorLogFlagSlotWithRe new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getSitePhpErrorLogFlagSlot( this.client.getEndpoint(), @@ -61896,6 +62476,7 @@ public Mono> listPremierAddOnsSlotWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listPremierAddOnsSlot( this.client.getEndpoint(), @@ -62096,6 +62677,7 @@ public Mono> getPremierAddOnSlotWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getPremierAddOnSlot( this.client.getEndpoint(), @@ -62321,6 +62903,7 @@ public Mono> addPremierAddOnSlotWithResponseAsync( } else { premierAddOn.validate(); } + context = this.client.mergeContext(context); return service .addPremierAddOnSlot( this.client.getEndpoint(), @@ -62544,6 +63127,7 @@ public Mono> deletePremierAddOnSlotWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .deletePremierAddOnSlot( this.client.getEndpoint(), @@ -62756,6 +63340,7 @@ public Mono> updatePremierAddOnSlotWithResponseAsync } else { premierAddOn.validate(); } + context = this.client.mergeContext(context); return service .updatePremierAddOnSlot( this.client.getEndpoint(), @@ -62977,6 +63562,7 @@ public Mono> getPrivateAccessSlotWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getPrivateAccessSlot( this.client.getEndpoint(), @@ -63179,6 +63765,7 @@ public Mono> putPrivateAccessVnetSlotWithResponseAs } else { access.validate(); } + context = this.client.mergeContext(context); return service .putPrivateAccessVnetSlot( this.client.getEndpoint(), @@ -63379,6 +63966,7 @@ public Mono> getPrivateEndpoint new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getPrivateEndpointConnection( this.client.getEndpoint(), @@ -63596,6 +64184,7 @@ public Mono>> approveOrRejectPrivateEndpointConnection } else { privateEndpointWrapper.validate(); } + context = this.client.mergeContext(context); return service .approveOrRejectPrivateEndpointConnection( this.client.getEndpoint(), @@ -63622,7 +64211,7 @@ public Mono>> approveOrRejectPrivateEndpointConnection */ @ServiceMethod(returns = ReturnType.SINGLE) public PollerFlux, PrivateEndpointConnectionResourceInner> - beginApproveOrRejectPrivateEndpointConnection( + beginApproveOrRejectPrivateEndpointConnectionAsync( String resourceGroupName, String name, String privateEndpointConnectionName, @@ -63654,7 +64243,7 @@ public Mono>> approveOrRejectPrivateEndpointConnection */ @ServiceMethod(returns = ReturnType.SINGLE) public PollerFlux, PrivateEndpointConnectionResourceInner> - beginApproveOrRejectPrivateEndpointConnection( + beginApproveOrRejectPrivateEndpointConnectionAsync( String resourceGroupName, String name, String privateEndpointConnectionName, @@ -63672,6 +64261,56 @@ public Mono>> approveOrRejectPrivateEndpointConnection PrivateEndpointConnectionResourceInner.class); } + /** + * Description for Approves or rejects a private endpoint connection. + * + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the site. + * @param privateEndpointConnectionName The privateEndpointConnectionName parameter. + * @param privateEndpointWrapper Private Endpoint Connection Approval ARM resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return private Endpoint Connection ARM resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, PrivateEndpointConnectionResourceInner> + beginApproveOrRejectPrivateEndpointConnection( + String resourceGroupName, + String name, + String privateEndpointConnectionName, + PrivateLinkConnectionApprovalRequestResource privateEndpointWrapper) { + return beginApproveOrRejectPrivateEndpointConnectionAsync( + resourceGroupName, name, privateEndpointConnectionName, privateEndpointWrapper) + .getSyncPoller(); + } + + /** + * Description for Approves or rejects a private endpoint connection. + * + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the site. + * @param privateEndpointConnectionName The privateEndpointConnectionName parameter. + * @param privateEndpointWrapper Private Endpoint Connection Approval ARM resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return private Endpoint Connection ARM resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, PrivateEndpointConnectionResourceInner> + beginApproveOrRejectPrivateEndpointConnection( + String resourceGroupName, + String name, + String privateEndpointConnectionName, + PrivateLinkConnectionApprovalRequestResource privateEndpointWrapper, + Context context) { + return beginApproveOrRejectPrivateEndpointConnectionAsync( + resourceGroupName, name, privateEndpointConnectionName, privateEndpointWrapper, context) + .getSyncPoller(); + } + /** * Description for Approves or rejects a private endpoint connection. * @@ -63690,18 +64329,10 @@ public Mono approveOrRejectPrivateEndpoi String name, String privateEndpointConnectionName, PrivateLinkConnectionApprovalRequestResource privateEndpointWrapper) { - Mono>> mono = - approveOrRejectPrivateEndpointConnectionWithResponseAsync( - resourceGroupName, name, privateEndpointConnectionName, privateEndpointWrapper); - return this - .client - .getLroResultAsync( - mono, - this.client.getHttpPipeline(), - PrivateEndpointConnectionResourceInner.class, - PrivateEndpointConnectionResourceInner.class) + return beginApproveOrRejectPrivateEndpointConnectionAsync( + resourceGroupName, name, privateEndpointConnectionName, privateEndpointWrapper) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -63724,18 +64355,10 @@ public Mono approveOrRejectPrivateEndpoi String privateEndpointConnectionName, PrivateLinkConnectionApprovalRequestResource privateEndpointWrapper, Context context) { - Mono>> mono = - approveOrRejectPrivateEndpointConnectionWithResponseAsync( - resourceGroupName, name, privateEndpointConnectionName, privateEndpointWrapper, context); - return this - .client - .getLroResultAsync( - mono, - this.client.getHttpPipeline(), - PrivateEndpointConnectionResourceInner.class, - PrivateEndpointConnectionResourceInner.class) + return beginApproveOrRejectPrivateEndpointConnectionAsync( + resourceGroupName, name, privateEndpointConnectionName, privateEndpointWrapper, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -63880,6 +64503,7 @@ public Mono>> deletePrivateEndpointConnectionWithRespo new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .deletePrivateEndpointConnection( this.client.getEndpoint(), @@ -63903,7 +64527,7 @@ public Mono>> deletePrivateEndpointConnectionWithRespo * @return any object. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, Object> beginDeletePrivateEndpointConnection( + public PollerFlux, Object> beginDeletePrivateEndpointConnectionAsync( String resourceGroupName, String name, String privateEndpointConnectionName) { Mono>> mono = deletePrivateEndpointConnectionWithResponseAsync(resourceGroupName, name, privateEndpointConnectionName); @@ -63925,7 +64549,7 @@ public PollerFlux, Object> beginDeletePrivateEndpointConnecti * @return any object. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, Object> beginDeletePrivateEndpointConnection( + public PollerFlux, Object> beginDeletePrivateEndpointConnectionAsync( String resourceGroupName, String name, String privateEndpointConnectionName, Context context) { Mono>> mono = deletePrivateEndpointConnectionWithResponseAsync( @@ -63935,6 +64559,44 @@ public PollerFlux, Object> beginDeletePrivateEndpointConnecti .getLroResultAsync(mono, this.client.getHttpPipeline(), Object.class, Object.class); } + /** + * Description for Deletes a private endpoint connection. + * + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the site. + * @param privateEndpointConnectionName The privateEndpointConnectionName parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return any object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Object> beginDeletePrivateEndpointConnection( + String resourceGroupName, String name, String privateEndpointConnectionName) { + return beginDeletePrivateEndpointConnectionAsync(resourceGroupName, name, privateEndpointConnectionName) + .getSyncPoller(); + } + + /** + * Description for Deletes a private endpoint connection. + * + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the site. + * @param privateEndpointConnectionName The privateEndpointConnectionName parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return any object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Object> beginDeletePrivateEndpointConnection( + String resourceGroupName, String name, String privateEndpointConnectionName, Context context) { + return beginDeletePrivateEndpointConnectionAsync( + resourceGroupName, name, privateEndpointConnectionName, context) + .getSyncPoller(); + } + /** * Description for Deletes a private endpoint connection. * @@ -63949,13 +64611,9 @@ public PollerFlux, Object> beginDeletePrivateEndpointConnecti @ServiceMethod(returns = ReturnType.SINGLE) public Mono deletePrivateEndpointConnectionAsync( String resourceGroupName, String name, String privateEndpointConnectionName) { - Mono>> mono = - deletePrivateEndpointConnectionWithResponseAsync(resourceGroupName, name, privateEndpointConnectionName); - return this - .client - .getLroResultAsync(mono, this.client.getHttpPipeline(), Object.class, Object.class) + return beginDeletePrivateEndpointConnectionAsync(resourceGroupName, name, privateEndpointConnectionName) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -63973,14 +64631,10 @@ public Mono deletePrivateEndpointConnectionAsync( @ServiceMethod(returns = ReturnType.SINGLE) public Mono deletePrivateEndpointConnectionAsync( String resourceGroupName, String name, String privateEndpointConnectionName, Context context) { - Mono>> mono = - deletePrivateEndpointConnectionWithResponseAsync( - resourceGroupName, name, privateEndpointConnectionName, context); - return this - .client - .getLroResultAsync(mono, this.client.getHttpPipeline(), Object.class, Object.class) + return beginDeletePrivateEndpointConnectionAsync( + resourceGroupName, name, privateEndpointConnectionName, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -64098,6 +64752,7 @@ public Mono> getPrivateLinkResourcesW new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getPrivateLinkResources( this.client.getEndpoint(), @@ -64289,6 +64944,7 @@ public Mono> listProcessesSlotSinglePageAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listProcessesSlot( this.client.getEndpoint(), @@ -64488,6 +65144,7 @@ public Mono> getProcessSlotWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getProcessSlot( this.client.getEndpoint(), @@ -64694,6 +65351,7 @@ public Mono> deleteProcessSlotWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .deleteProcessSlot( this.client.getEndpoint(), @@ -64885,6 +65543,7 @@ public Mono getProcessDumpSlotWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getProcessDumpSlot( this.client.getEndpoint(), @@ -64953,11 +65612,24 @@ public Flux getProcessDumpSlotAsync( */ @ServiceMethod(returns = ReturnType.SINGLE) public InputStream getProcessDumpSlot(String resourceGroupName, String name, String processId, String slot) { - return getProcessDumpSlotAsync(resourceGroupName, name, processId, slot) - .map(ByteBufferBackedInputStream::new) - .collectList() - .map(list -> new SequenceInputStream(Collections.enumeration(list))) - .block(); + Iterator iterator = + getProcessDumpSlotAsync(resourceGroupName, name, processId, slot) + .map(ByteBufferBackedInputStream::new) + .toStream() + .iterator(); + Enumeration enumeration = + new Enumeration() { + @Override + public boolean hasMoreElements() { + return iterator.hasNext(); + } + + @Override + public InputStream nextElement() { + return iterator.next(); + } + }; + return new SequenceInputStream(enumeration); } /** @@ -64977,11 +65649,24 @@ public InputStream getProcessDumpSlot(String resourceGroupName, String name, Str @ServiceMethod(returns = ReturnType.SINGLE) public InputStream getProcessDumpSlot( String resourceGroupName, String name, String processId, String slot, Context context) { - return getProcessDumpSlotAsync(resourceGroupName, name, processId, slot, context) - .map(ByteBufferBackedInputStream::new) - .collectList() - .map(list -> new SequenceInputStream(Collections.enumeration(list))) - .block(); + Iterator iterator = + getProcessDumpSlotAsync(resourceGroupName, name, processId, slot, context) + .map(ByteBufferBackedInputStream::new) + .toStream() + .iterator(); + Enumeration enumeration = + new Enumeration() { + @Override + public boolean hasMoreElements() { + return iterator.hasNext(); + } + + @Override + public InputStream nextElement() { + return iterator.next(); + } + }; + return new SequenceInputStream(enumeration); } /** @@ -65092,6 +65777,7 @@ public Mono> listProcessModulesSlotSingleP new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listProcessModulesSlot( this.client.getEndpoint(), @@ -65303,6 +65989,7 @@ public Mono> getProcessModuleSlotWithResponseAs new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getProcessModuleSlot( this.client.getEndpoint(), @@ -65522,6 +66209,7 @@ public Mono> listProcessThreadsSlotSingleP new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listProcessThreadsSlot( this.client.getEndpoint(), @@ -65724,6 +66412,7 @@ public Mono> listPublicCertificatesSlotSin new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listPublicCertificatesSlot( this.client.getEndpoint(), @@ -65923,6 +66612,7 @@ public Mono> getPublicCertificateSlotWithRespon new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getPublicCertificateSlot( this.client.getEndpoint(), @@ -66154,6 +66844,7 @@ public Mono> createOrUpdatePublicCertificateSlo } else { publicCertificate.validate(); } + context = this.client.mergeContext(context); return service .createOrUpdatePublicCertificateSlot( this.client.getEndpoint(), @@ -66390,6 +67081,7 @@ public Mono> deletePublicCertificateSlotWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .deletePublicCertificateSlot( this.client.getEndpoint(), @@ -66592,6 +67284,7 @@ public Mono listPublishingProfileXmlWithSecretsSlotWithResponseA } else { publishingProfileOptions.validate(); } + context = this.client.mergeContext(context); return service .listPublishingProfileXmlWithSecretsSlot( this.client.getEndpoint(), @@ -66667,11 +67360,24 @@ public Flux listPublishingProfileXmlWithSecretsSlotAsync( @ServiceMethod(returns = ReturnType.SINGLE) public InputStream listPublishingProfileXmlWithSecretsSlot( String resourceGroupName, String name, String slot, CsmPublishingProfileOptions publishingProfileOptions) { - return listPublishingProfileXmlWithSecretsSlotAsync(resourceGroupName, name, slot, publishingProfileOptions) - .map(ByteBufferBackedInputStream::new) - .collectList() - .map(list -> new SequenceInputStream(Collections.enumeration(list))) - .block(); + Iterator iterator = + listPublishingProfileXmlWithSecretsSlotAsync(resourceGroupName, name, slot, publishingProfileOptions) + .map(ByteBufferBackedInputStream::new) + .toStream() + .iterator(); + Enumeration enumeration = + new Enumeration() { + @Override + public boolean hasMoreElements() { + return iterator.hasNext(); + } + + @Override + public InputStream nextElement() { + return iterator.next(); + } + }; + return new SequenceInputStream(enumeration); } /** @@ -66695,12 +67401,25 @@ public InputStream listPublishingProfileXmlWithSecretsSlot( String slot, CsmPublishingProfileOptions publishingProfileOptions, Context context) { - return listPublishingProfileXmlWithSecretsSlotAsync( - resourceGroupName, name, slot, publishingProfileOptions, context) - .map(ByteBufferBackedInputStream::new) - .collectList() - .map(list -> new SequenceInputStream(Collections.enumeration(list))) - .block(); + Iterator iterator = + listPublishingProfileXmlWithSecretsSlotAsync( + resourceGroupName, name, slot, publishingProfileOptions, context) + .map(ByteBufferBackedInputStream::new) + .toStream() + .iterator(); + Enumeration enumeration = + new Enumeration() { + @Override + public boolean hasMoreElements() { + return iterator.hasNext(); + } + + @Override + public InputStream nextElement() { + return iterator.next(); + } + }; + return new SequenceInputStream(enumeration); } /** @@ -66795,6 +67514,7 @@ public Mono> resetSlotConfigurationSlotWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .resetSlotConfigurationSlot( this.client.getEndpoint(), @@ -66979,6 +67699,7 @@ public Mono> restartSlotWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .restartSlot( this.client.getEndpoint(), @@ -67219,6 +67940,7 @@ public Mono>> restoreFromBackupBlobSlotWithResponseAsy } else { request.validate(); } + context = this.client.mergeContext(context); return service .restoreFromBackupBlobSlot( this.client.getEndpoint(), @@ -67245,7 +67967,7 @@ public Mono>> restoreFromBackupBlobSlotWithResponseAsy * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, Void> beginRestoreFromBackupBlobSlot( + public PollerFlux, Void> beginRestoreFromBackupBlobSlotAsync( String resourceGroupName, String name, String slot, RestoreRequestInner request) { Mono>> mono = restoreFromBackupBlobSlotWithResponseAsync(resourceGroupName, name, slot, request); @@ -67267,13 +67989,52 @@ public PollerFlux, Void> beginRestoreFromBackupBlobSlot( * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, Void> beginRestoreFromBackupBlobSlot( + public PollerFlux, Void> beginRestoreFromBackupBlobSlotAsync( String resourceGroupName, String name, String slot, RestoreRequestInner request, Context context) { Mono>> mono = restoreFromBackupBlobSlotWithResponseAsync(resourceGroupName, name, slot, request, context); return this.client.getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class); } + /** + * Description for Restores an app from a backup blob in Azure Storage. + * + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param slot Name of the deployment slot. If a slot is not specified, the API will restore a backup of the + * production slot. + * @param request Description of a restore request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginRestoreFromBackupBlobSlot( + String resourceGroupName, String name, String slot, RestoreRequestInner request) { + return beginRestoreFromBackupBlobSlotAsync(resourceGroupName, name, slot, request).getSyncPoller(); + } + + /** + * Description for Restores an app from a backup blob in Azure Storage. + * + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param slot Name of the deployment slot. If a slot is not specified, the API will restore a backup of the + * production slot. + * @param request Description of a restore request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginRestoreFromBackupBlobSlot( + String resourceGroupName, String name, String slot, RestoreRequestInner request, Context context) { + return beginRestoreFromBackupBlobSlotAsync(resourceGroupName, name, slot, request, context).getSyncPoller(); + } + /** * Description for Restores an app from a backup blob in Azure Storage. * @@ -67290,13 +68051,9 @@ public PollerFlux, Void> beginRestoreFromBackupBlobSlot( @ServiceMethod(returns = ReturnType.SINGLE) public Mono restoreFromBackupBlobSlotAsync( String resourceGroupName, String name, String slot, RestoreRequestInner request) { - Mono>> mono = - restoreFromBackupBlobSlotWithResponseAsync(resourceGroupName, name, slot, request); - return this - .client - .getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class) + return beginRestoreFromBackupBlobSlotAsync(resourceGroupName, name, slot, request) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -67316,13 +68073,9 @@ public Mono restoreFromBackupBlobSlotAsync( @ServiceMethod(returns = ReturnType.SINGLE) public Mono restoreFromBackupBlobSlotAsync( String resourceGroupName, String name, String slot, RestoreRequestInner request, Context context) { - Mono>> mono = - restoreFromBackupBlobSlotWithResponseAsync(resourceGroupName, name, slot, request, context); - return this - .client - .getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class) + return beginRestoreFromBackupBlobSlotAsync(resourceGroupName, name, slot, request, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -67463,6 +68216,7 @@ public Mono>> restoreFromDeletedAppSlotWithResponseAsy } else { restoreRequest.validate(); } + context = this.client.mergeContext(context); return service .restoreFromDeletedAppSlot( this.client.getEndpoint(), @@ -67488,7 +68242,7 @@ public Mono>> restoreFromDeletedAppSlotWithResponseAsy * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, Void> beginRestoreFromDeletedAppSlot( + public PollerFlux, Void> beginRestoreFromDeletedAppSlotAsync( String resourceGroupName, String name, String slot, DeletedAppRestoreRequest restoreRequest) { Mono>> mono = restoreFromDeletedAppSlotWithResponseAsync(resourceGroupName, name, slot, restoreRequest); @@ -67509,13 +68263,51 @@ public PollerFlux, Void> beginRestoreFromDeletedAppSlot( * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, Void> beginRestoreFromDeletedAppSlot( + public PollerFlux, Void> beginRestoreFromDeletedAppSlotAsync( String resourceGroupName, String name, String slot, DeletedAppRestoreRequest restoreRequest, Context context) { Mono>> mono = restoreFromDeletedAppSlotWithResponseAsync(resourceGroupName, name, slot, restoreRequest, context); return this.client.getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class); } + /** + * Description for Restores a deleted web app to this web app. + * + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of web app. + * @param slot Name of web app slot. If not specified then will default to production slot. + * @param restoreRequest Details about restoring a deleted app. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginRestoreFromDeletedAppSlot( + String resourceGroupName, String name, String slot, DeletedAppRestoreRequest restoreRequest) { + return beginRestoreFromDeletedAppSlotAsync(resourceGroupName, name, slot, restoreRequest).getSyncPoller(); + } + + /** + * Description for Restores a deleted web app to this web app. + * + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of web app. + * @param slot Name of web app slot. If not specified then will default to production slot. + * @param restoreRequest Details about restoring a deleted app. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginRestoreFromDeletedAppSlot( + String resourceGroupName, String name, String slot, DeletedAppRestoreRequest restoreRequest, Context context) { + return beginRestoreFromDeletedAppSlotAsync(resourceGroupName, name, slot, restoreRequest, context) + .getSyncPoller(); + } + /** * Description for Restores a deleted web app to this web app. * @@ -67531,13 +68323,9 @@ public PollerFlux, Void> beginRestoreFromDeletedAppSlot( @ServiceMethod(returns = ReturnType.SINGLE) public Mono restoreFromDeletedAppSlotAsync( String resourceGroupName, String name, String slot, DeletedAppRestoreRequest restoreRequest) { - Mono>> mono = - restoreFromDeletedAppSlotWithResponseAsync(resourceGroupName, name, slot, restoreRequest); - return this - .client - .getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class) + return beginRestoreFromDeletedAppSlotAsync(resourceGroupName, name, slot, restoreRequest) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -67556,13 +68344,9 @@ public Mono restoreFromDeletedAppSlotAsync( @ServiceMethod(returns = ReturnType.SINGLE) public Mono restoreFromDeletedAppSlotAsync( String resourceGroupName, String name, String slot, DeletedAppRestoreRequest restoreRequest, Context context) { - Mono>> mono = - restoreFromDeletedAppSlotWithResponseAsync(resourceGroupName, name, slot, restoreRequest, context); - return this - .client - .getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class) + return beginRestoreFromDeletedAppSlotAsync(resourceGroupName, name, slot, restoreRequest, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -67701,6 +68485,7 @@ public Mono>> restoreSnapshotSlotWithResponseAsync( } else { restoreRequest.validate(); } + context = this.client.mergeContext(context); return service .restoreSnapshotSlot( this.client.getEndpoint(), @@ -67726,7 +68511,7 @@ public Mono>> restoreSnapshotSlotWithResponseAsync( * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, Void> beginRestoreSnapshotSlot( + public PollerFlux, Void> beginRestoreSnapshotSlotAsync( String resourceGroupName, String name, String slot, SnapshotRestoreRequest restoreRequest) { Mono>> mono = restoreSnapshotSlotWithResponseAsync(resourceGroupName, name, slot, restoreRequest); @@ -67747,13 +68532,50 @@ public PollerFlux, Void> beginRestoreSnapshotSlot( * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, Void> beginRestoreSnapshotSlot( + public PollerFlux, Void> beginRestoreSnapshotSlotAsync( String resourceGroupName, String name, String slot, SnapshotRestoreRequest restoreRequest, Context context) { Mono>> mono = restoreSnapshotSlotWithResponseAsync(resourceGroupName, name, slot, restoreRequest, context); return this.client.getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class); } + /** + * Description for Restores a web app from a snapshot. + * + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of web app. + * @param slot Name of web app slot. If not specified then will default to production slot. + * @param restoreRequest Details about app recovery operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginRestoreSnapshotSlot( + String resourceGroupName, String name, String slot, SnapshotRestoreRequest restoreRequest) { + return beginRestoreSnapshotSlotAsync(resourceGroupName, name, slot, restoreRequest).getSyncPoller(); + } + + /** + * Description for Restores a web app from a snapshot. + * + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of web app. + * @param slot Name of web app slot. If not specified then will default to production slot. + * @param restoreRequest Details about app recovery operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginRestoreSnapshotSlot( + String resourceGroupName, String name, String slot, SnapshotRestoreRequest restoreRequest, Context context) { + return beginRestoreSnapshotSlotAsync(resourceGroupName, name, slot, restoreRequest, context).getSyncPoller(); + } + /** * Description for Restores a web app from a snapshot. * @@ -67769,13 +68591,9 @@ public PollerFlux, Void> beginRestoreSnapshotSlot( @ServiceMethod(returns = ReturnType.SINGLE) public Mono restoreSnapshotSlotAsync( String resourceGroupName, String name, String slot, SnapshotRestoreRequest restoreRequest) { - Mono>> mono = - restoreSnapshotSlotWithResponseAsync(resourceGroupName, name, slot, restoreRequest); - return this - .client - .getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class) + return beginRestoreSnapshotSlotAsync(resourceGroupName, name, slot, restoreRequest) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -67794,13 +68612,9 @@ public Mono restoreSnapshotSlotAsync( @ServiceMethod(returns = ReturnType.SINGLE) public Mono restoreSnapshotSlotAsync( String resourceGroupName, String name, String slot, SnapshotRestoreRequest restoreRequest, Context context) { - Mono>> mono = - restoreSnapshotSlotWithResponseAsync(resourceGroupName, name, slot, restoreRequest, context); - return this - .client - .getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class) + return beginRestoreSnapshotSlotAsync(resourceGroupName, name, slot, restoreRequest, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -67935,6 +68749,7 @@ public Mono> listSiteExtensionsSlotSingleP new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listSiteExtensionsSlot( this.client.getEndpoint(), @@ -68128,6 +68943,7 @@ public Mono> getSiteExtensionSlotWithResponseAs new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getSiteExtensionSlot( this.client.getEndpoint(), @@ -68329,6 +69145,7 @@ public Mono>> installSiteExtensionSlotWithResponseAsyn new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .installSiteExtensionSlot( this.client.getEndpoint(), @@ -68354,7 +69171,7 @@ public Mono>> installSiteExtensionSlotWithResponseAsyn * @return site Extension Information. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, SiteExtensionInfoInner> beginInstallSiteExtensionSlot( + public PollerFlux, SiteExtensionInfoInner> beginInstallSiteExtensionSlotAsync( String resourceGroupName, String name, String siteExtensionId, String slot) { Mono>> mono = installSiteExtensionSlotWithResponseAsync(resourceGroupName, name, siteExtensionId, slot); @@ -68378,7 +69195,7 @@ public PollerFlux, SiteExtensionInfoInner> be * @return site Extension Information. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, SiteExtensionInfoInner> beginInstallSiteExtensionSlot( + public PollerFlux, SiteExtensionInfoInner> beginInstallSiteExtensionSlotAsync( String resourceGroupName, String name, String siteExtensionId, String slot, Context context) { Mono>> mono = installSiteExtensionSlotWithResponseAsync(resourceGroupName, name, siteExtensionId, slot, context); @@ -68388,6 +69205,44 @@ public PollerFlux, SiteExtensionInfoInner> be mono, this.client.getHttpPipeline(), SiteExtensionInfoInner.class, SiteExtensionInfoInner.class); } + /** + * Description for Install site extension on a web site, or a deployment slot. + * + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param siteExtensionId Site extension name. + * @param slot Name of the deployment slot. If a slot is not specified, the API uses the production slot. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return site Extension Information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, SiteExtensionInfoInner> beginInstallSiteExtensionSlot( + String resourceGroupName, String name, String siteExtensionId, String slot) { + return beginInstallSiteExtensionSlotAsync(resourceGroupName, name, siteExtensionId, slot).getSyncPoller(); + } + + /** + * Description for Install site extension on a web site, or a deployment slot. + * + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param siteExtensionId Site extension name. + * @param slot Name of the deployment slot. If a slot is not specified, the API uses the production slot. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return site Extension Information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, SiteExtensionInfoInner> beginInstallSiteExtensionSlot( + String resourceGroupName, String name, String siteExtensionId, String slot, Context context) { + return beginInstallSiteExtensionSlotAsync(resourceGroupName, name, siteExtensionId, slot, context) + .getSyncPoller(); + } + /** * Description for Install site extension on a web site, or a deployment slot. * @@ -68403,14 +69258,9 @@ public PollerFlux, SiteExtensionInfoInner> be @ServiceMethod(returns = ReturnType.SINGLE) public Mono installSiteExtensionSlotAsync( String resourceGroupName, String name, String siteExtensionId, String slot) { - Mono>> mono = - installSiteExtensionSlotWithResponseAsync(resourceGroupName, name, siteExtensionId, slot); - return this - .client - .getLroResultAsync( - mono, this.client.getHttpPipeline(), SiteExtensionInfoInner.class, SiteExtensionInfoInner.class) + return beginInstallSiteExtensionSlotAsync(resourceGroupName, name, siteExtensionId, slot) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -68429,14 +69279,9 @@ public Mono installSiteExtensionSlotAsync( @ServiceMethod(returns = ReturnType.SINGLE) public Mono installSiteExtensionSlotAsync( String resourceGroupName, String name, String siteExtensionId, String slot, Context context) { - Mono>> mono = - installSiteExtensionSlotWithResponseAsync(resourceGroupName, name, siteExtensionId, slot, context); - return this - .client - .getLroResultAsync( - mono, this.client.getHttpPipeline(), SiteExtensionInfoInner.class, SiteExtensionInfoInner.class) + return beginInstallSiteExtensionSlotAsync(resourceGroupName, name, siteExtensionId, slot, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -68577,6 +69422,7 @@ public Mono> deleteSiteExtensionSlotWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .deleteSiteExtensionSlot( this.client.getEndpoint(), @@ -68767,6 +69613,7 @@ public Mono>> copySlotWithResponseAsync( } else { copySlotEntity.validate(); } + context = this.client.mergeContext(context); return service .copySlot( this.client.getEndpoint(), @@ -68792,7 +69639,7 @@ public Mono>> copySlotWithResponseAsync( * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, Void> beginCopySlot( + public PollerFlux, Void> beginCopySlotAsync( String resourceGroupName, String name, String slot, CsmCopySlotEntityInner copySlotEntity) { Mono>> mono = copySlotWithResponseAsync(resourceGroupName, name, slot, copySlotEntity); @@ -68813,13 +69660,50 @@ public PollerFlux, Void> beginCopySlot( * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, Void> beginCopySlot( + public PollerFlux, Void> beginCopySlotAsync( String resourceGroupName, String name, String slot, CsmCopySlotEntityInner copySlotEntity, Context context) { Mono>> mono = copySlotWithResponseAsync(resourceGroupName, name, slot, copySlotEntity, context); return this.client.getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class); } + /** + * Description for Copies a deployment slot to another deployment slot of an app. + * + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param slot Name of the source slot. If a slot is not specified, the production slot is used as the source slot. + * @param copySlotEntity Copy deployment slot parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginCopySlot( + String resourceGroupName, String name, String slot, CsmCopySlotEntityInner copySlotEntity) { + return beginCopySlotAsync(resourceGroupName, name, slot, copySlotEntity).getSyncPoller(); + } + + /** + * Description for Copies a deployment slot to another deployment slot of an app. + * + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param slot Name of the source slot. If a slot is not specified, the production slot is used as the source slot. + * @param copySlotEntity Copy deployment slot parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginCopySlot( + String resourceGroupName, String name, String slot, CsmCopySlotEntityInner copySlotEntity, Context context) { + return beginCopySlotAsync(resourceGroupName, name, slot, copySlotEntity, context).getSyncPoller(); + } + /** * Description for Copies a deployment slot to another deployment slot of an app. * @@ -68835,13 +69719,9 @@ public PollerFlux, Void> beginCopySlot( @ServiceMethod(returns = ReturnType.SINGLE) public Mono copySlotAsync( String resourceGroupName, String name, String slot, CsmCopySlotEntityInner copySlotEntity) { - Mono>> mono = - copySlotWithResponseAsync(resourceGroupName, name, slot, copySlotEntity); - return this - .client - .getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class) + return beginCopySlotAsync(resourceGroupName, name, slot, copySlotEntity) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -68860,13 +69740,9 @@ public Mono copySlotAsync( @ServiceMethod(returns = ReturnType.SINGLE) public Mono copySlotAsync( String resourceGroupName, String name, String slot, CsmCopySlotEntityInner copySlotEntity, Context context) { - Mono>> mono = - copySlotWithResponseAsync(resourceGroupName, name, slot, copySlotEntity, context); - return this - .client - .getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class) + return beginCopySlotAsync(resourceGroupName, name, slot, copySlotEntity, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -69013,6 +69889,7 @@ public Mono> listSlotDifferencesSlotSinglePag } else { slotSwapEntity.validate(); } + context = this.client.mergeContext(context); return service .listSlotDifferencesSlot( this.client.getEndpoint(), @@ -69214,6 +70091,7 @@ public Mono>> swapSlotWithResponseAsync( } else { slotSwapEntity.validate(); } + context = this.client.mergeContext(context); return service .swapSlot( this.client.getEndpoint(), @@ -69239,7 +70117,7 @@ public Mono>> swapSlotWithResponseAsync( * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, Void> beginSwapSlot( + public PollerFlux, Void> beginSwapSlotAsync( String resourceGroupName, String name, String slot, CsmSlotEntity slotSwapEntity) { Mono>> mono = swapSlotWithResponseAsync(resourceGroupName, name, slot, slotSwapEntity); @@ -69260,13 +70138,50 @@ public PollerFlux, Void> beginSwapSlot( * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, Void> beginSwapSlot( + public PollerFlux, Void> beginSwapSlotAsync( String resourceGroupName, String name, String slot, CsmSlotEntity slotSwapEntity, Context context) { Mono>> mono = swapSlotWithResponseAsync(resourceGroupName, name, slot, slotSwapEntity, context); return this.client.getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class); } + /** + * Description for Swaps two deployment slots of an app. + * + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param slot Name of the source slot. If a slot is not specified, the production slot is used as the source slot. + * @param slotSwapEntity Deployment slot parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginSwapSlot( + String resourceGroupName, String name, String slot, CsmSlotEntity slotSwapEntity) { + return beginSwapSlotAsync(resourceGroupName, name, slot, slotSwapEntity).getSyncPoller(); + } + + /** + * Description for Swaps two deployment slots of an app. + * + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param slot Name of the source slot. If a slot is not specified, the production slot is used as the source slot. + * @param slotSwapEntity Deployment slot parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginSwapSlot( + String resourceGroupName, String name, String slot, CsmSlotEntity slotSwapEntity, Context context) { + return beginSwapSlotAsync(resourceGroupName, name, slot, slotSwapEntity, context).getSyncPoller(); + } + /** * Description for Swaps two deployment slots of an app. * @@ -69281,13 +70196,9 @@ public PollerFlux, Void> beginSwapSlot( */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono swapSlotAsync(String resourceGroupName, String name, String slot, CsmSlotEntity slotSwapEntity) { - Mono>> mono = - swapSlotWithResponseAsync(resourceGroupName, name, slot, slotSwapEntity); - return this - .client - .getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class) + return beginSwapSlotAsync(resourceGroupName, name, slot, slotSwapEntity) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -69306,13 +70217,9 @@ public Mono swapSlotAsync(String resourceGroupName, String name, String sl @ServiceMethod(returns = ReturnType.SINGLE) public Mono swapSlotAsync( String resourceGroupName, String name, String slot, CsmSlotEntity slotSwapEntity, Context context) { - Mono>> mono = - swapSlotWithResponseAsync(resourceGroupName, name, slot, slotSwapEntity, context); - return this - .client - .getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class) + return beginSwapSlotAsync(resourceGroupName, name, slot, slotSwapEntity, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -69446,6 +70353,7 @@ public Mono> listSnapshotsSlotSinglePageAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listSnapshotsSlot( this.client.getEndpoint(), @@ -69635,6 +70543,7 @@ public Mono> listSnapshotsFromDRSecondarySlotSingle new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listSnapshotsFromDRSecondarySlot( this.client.getEndpoint(), @@ -69819,6 +70728,7 @@ public Mono> getSourceControlSlotWithResponseAs new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getSourceControlSlot( this.client.getEndpoint(), @@ -70023,6 +70933,7 @@ public Mono>> createOrUpdateSourceControlSlotWithRespo } else { siteSourceControl.validate(); } + context = this.client.mergeContext(context); return service .createOrUpdateSourceControlSlot( this.client.getEndpoint(), @@ -70049,8 +70960,9 @@ public Mono>> createOrUpdateSourceControlSlotWithRespo * @return source control configuration for an app. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, SiteSourceControlInner> beginCreateOrUpdateSourceControlSlot( - String resourceGroupName, String name, String slot, SiteSourceControlInner siteSourceControl) { + public PollerFlux, SiteSourceControlInner> + beginCreateOrUpdateSourceControlSlotAsync( + String resourceGroupName, String name, String slot, SiteSourceControlInner siteSourceControl) { Mono>> mono = createOrUpdateSourceControlSlotWithResponseAsync(resourceGroupName, name, slot, siteSourceControl); return this @@ -70074,8 +70986,13 @@ public PollerFlux, SiteSourceControlInner> be * @return source control configuration for an app. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, SiteSourceControlInner> beginCreateOrUpdateSourceControlSlot( - String resourceGroupName, String name, String slot, SiteSourceControlInner siteSourceControl, Context context) { + public PollerFlux, SiteSourceControlInner> + beginCreateOrUpdateSourceControlSlotAsync( + String resourceGroupName, + String name, + String slot, + SiteSourceControlInner siteSourceControl, + Context context) { Mono>> mono = createOrUpdateSourceControlSlotWithResponseAsync(resourceGroupName, name, slot, siteSourceControl, context); return this @@ -70084,6 +71001,47 @@ public PollerFlux, SiteSourceControlInner> be mono, this.client.getHttpPipeline(), SiteSourceControlInner.class, SiteSourceControlInner.class); } + /** + * Description for Updates the source control configuration of an app. + * + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param slot Name of the deployment slot. If a slot is not specified, the API will update the source control + * configuration for the production slot. + * @param siteSourceControl Source control configuration for an app. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return source control configuration for an app. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, SiteSourceControlInner> beginCreateOrUpdateSourceControlSlot( + String resourceGroupName, String name, String slot, SiteSourceControlInner siteSourceControl) { + return beginCreateOrUpdateSourceControlSlotAsync(resourceGroupName, name, slot, siteSourceControl) + .getSyncPoller(); + } + + /** + * Description for Updates the source control configuration of an app. + * + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param slot Name of the deployment slot. If a slot is not specified, the API will update the source control + * configuration for the production slot. + * @param siteSourceControl Source control configuration for an app. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return source control configuration for an app. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, SiteSourceControlInner> beginCreateOrUpdateSourceControlSlot( + String resourceGroupName, String name, String slot, SiteSourceControlInner siteSourceControl, Context context) { + return beginCreateOrUpdateSourceControlSlotAsync(resourceGroupName, name, slot, siteSourceControl, context) + .getSyncPoller(); + } + /** * Description for Updates the source control configuration of an app. * @@ -70100,14 +71058,9 @@ public PollerFlux, SiteSourceControlInner> be @ServiceMethod(returns = ReturnType.SINGLE) public Mono createOrUpdateSourceControlSlotAsync( String resourceGroupName, String name, String slot, SiteSourceControlInner siteSourceControl) { - Mono>> mono = - createOrUpdateSourceControlSlotWithResponseAsync(resourceGroupName, name, slot, siteSourceControl); - return this - .client - .getLroResultAsync( - mono, this.client.getHttpPipeline(), SiteSourceControlInner.class, SiteSourceControlInner.class) + return beginCreateOrUpdateSourceControlSlotAsync(resourceGroupName, name, slot, siteSourceControl) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -70127,14 +71080,9 @@ public Mono createOrUpdateSourceControlSlotAsync( @ServiceMethod(returns = ReturnType.SINGLE) public Mono createOrUpdateSourceControlSlotAsync( String resourceGroupName, String name, String slot, SiteSourceControlInner siteSourceControl, Context context) { - Mono>> mono = - createOrUpdateSourceControlSlotWithResponseAsync(resourceGroupName, name, slot, siteSourceControl, context); - return this - .client - .getLroResultAsync( - mono, this.client.getHttpPipeline(), SiteSourceControlInner.class, SiteSourceControlInner.class) + return beginCreateOrUpdateSourceControlSlotAsync(resourceGroupName, name, slot, siteSourceControl, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -70266,6 +71214,7 @@ public Mono> deleteSourceControlSlotWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .deleteSourceControlSlot( this.client.getEndpoint(), @@ -70453,6 +71402,7 @@ public Mono> updateSourceControlSlotWithRespons } else { siteSourceControl.validate(); } + context = this.client.mergeContext(context); return service .updateSourceControlSlot( this.client.getEndpoint(), @@ -70646,6 +71596,7 @@ public Mono> startSlotWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .startSlot( this.client.getEndpoint(), @@ -70830,6 +71781,7 @@ public Mono>> startNetworkTraceSlotWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .startNetworkTraceSlot( this.client.getEndpoint(), @@ -70859,7 +71811,7 @@ public Mono>> startNetworkTraceSlotWithResponseAsync( * @return array of NetworkTrace. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, Object> beginStartNetworkTraceSlot( + public PollerFlux, Object> beginStartNetworkTraceSlotAsync( String resourceGroupName, String name, String slot, @@ -70890,7 +71842,7 @@ public PollerFlux, Object> beginStartNetworkTraceSlot( * @return array of NetworkTrace. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, Object> beginStartNetworkTraceSlot( + public PollerFlux, Object> beginStartNetworkTraceSlotAsync( String resourceGroupName, String name, String slot, @@ -70906,6 +71858,61 @@ public PollerFlux, Object> beginStartNetworkTraceSlot( .getLroResultAsync(mono, this.client.getHttpPipeline(), Object.class, Object.class); } + /** + * Description for Start capturing network packets for the site. + * + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name The name of the web app. + * @param slot The name of the slot for this web app. + * @param durationInSeconds The duration to keep capturing in seconds. + * @param maxFrameLength The maximum frame length in bytes (Optional). + * @param sasUrl The Blob URL to store capture file. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return array of NetworkTrace. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Object> beginStartNetworkTraceSlot( + String resourceGroupName, + String name, + String slot, + Integer durationInSeconds, + Integer maxFrameLength, + String sasUrl) { + return beginStartNetworkTraceSlotAsync(resourceGroupName, name, slot, durationInSeconds, maxFrameLength, sasUrl) + .getSyncPoller(); + } + + /** + * Description for Start capturing network packets for the site. + * + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name The name of the web app. + * @param slot The name of the slot for this web app. + * @param durationInSeconds The duration to keep capturing in seconds. + * @param maxFrameLength The maximum frame length in bytes (Optional). + * @param sasUrl The Blob URL to store capture file. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return array of NetworkTrace. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Object> beginStartNetworkTraceSlot( + String resourceGroupName, + String name, + String slot, + Integer durationInSeconds, + Integer maxFrameLength, + String sasUrl, + Context context) { + return beginStartNetworkTraceSlotAsync( + resourceGroupName, name, slot, durationInSeconds, maxFrameLength, sasUrl, context) + .getSyncPoller(); + } + /** * Description for Start capturing network packets for the site. * @@ -70928,14 +71935,9 @@ public Mono startNetworkTraceSlotAsync( Integer durationInSeconds, Integer maxFrameLength, String sasUrl) { - Mono>> mono = - startNetworkTraceSlotWithResponseAsync( - resourceGroupName, name, slot, durationInSeconds, maxFrameLength, sasUrl); - return this - .client - .getLroResultAsync(mono, this.client.getHttpPipeline(), Object.class, Object.class) + return beginStartNetworkTraceSlotAsync(resourceGroupName, name, slot, durationInSeconds, maxFrameLength, sasUrl) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -70962,14 +71964,10 @@ public Mono startNetworkTraceSlotAsync( Integer maxFrameLength, String sasUrl, Context context) { - Mono>> mono = - startNetworkTraceSlotWithResponseAsync( - resourceGroupName, name, slot, durationInSeconds, maxFrameLength, sasUrl, context); - return this - .client - .getLroResultAsync(mono, this.client.getHttpPipeline(), Object.class, Object.class) + return beginStartNetworkTraceSlotAsync( + resourceGroupName, name, slot, durationInSeconds, maxFrameLength, sasUrl, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -70989,14 +71987,9 @@ public Mono startNetworkTraceSlotAsync(String resourceGroupName, String final Integer maxFrameLength = null; final String sasUrl = null; final Context context = null; - Mono>> mono = - startNetworkTraceSlotWithResponseAsync( - resourceGroupName, name, slot, durationInSeconds, maxFrameLength, sasUrl); - return this - .client - .getLroResultAsync(mono, this.client.getHttpPipeline(), Object.class, Object.class) + return beginStartNetworkTraceSlotAsync(resourceGroupName, name, slot, durationInSeconds, maxFrameLength, sasUrl) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -71162,6 +72155,7 @@ public Mono> stopSlotWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .stopSlot( this.client.getEndpoint(), @@ -71326,6 +72320,7 @@ public Mono> stopNetworkTraceSlotWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .stopNetworkTraceSlot( this.client.getEndpoint(), @@ -71491,6 +72486,7 @@ public Mono> syncRepositorySlotWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .syncRepositorySlot( this.client.getEndpoint(), @@ -71656,6 +72652,7 @@ public Mono> syncFunctionTriggersSlotWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .syncFunctionTriggersSlot( this.client.getEndpoint(), @@ -71833,6 +72830,7 @@ public Mono> listTriggeredWebJobsSlotSingleP new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listTriggeredWebJobsSlot( this.client.getEndpoint(), @@ -72028,6 +73026,7 @@ public Mono> getTriggeredWebJobSlotWithResponseAs new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getTriggeredWebJobSlot( this.client.getEndpoint(), @@ -72229,6 +73228,7 @@ public Mono> deleteTriggeredWebJobSlotWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .deleteTriggeredWebJobSlot( this.client.getEndpoint(), @@ -72424,6 +73424,7 @@ public Mono> listTriggeredWebJobHistoryS new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listTriggeredWebJobHistorySlot( this.client.getEndpoint(), @@ -72630,6 +73631,7 @@ public Mono> getTriggeredWebJobHistorySlotWit new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getTriggeredWebJobHistorySlot( this.client.getEndpoint(), @@ -72834,6 +73836,7 @@ public Mono> runTriggeredWebJobSlotWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .runTriggeredWebJobSlot( this.client.getEndpoint(), @@ -73025,6 +74028,7 @@ public Mono> listUsagesSlotSinglePageAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listUsagesSlot( this.client.getEndpoint(), @@ -73266,6 +74270,7 @@ public Mono>> listVnetConnectionsSlotWithResponseAs new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listVnetConnectionsSlot( this.client.getEndpoint(), @@ -73464,6 +74469,7 @@ public Mono> getVnetConnectionSlotWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getVnetConnectionSlot( this.client.getEndpoint(), @@ -73690,6 +74696,7 @@ public Mono> createOrUpdateVnetConnectionSlotWithRespons } else { connectionEnvelope.validate(); } + context = this.client.mergeContext(context); return service .createOrUpdateVnetConnectionSlot( this.client.getEndpoint(), @@ -73919,6 +74926,7 @@ public Mono> deleteVnetConnectionSlotWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .deleteVnetConnectionSlot( this.client.getEndpoint(), @@ -74129,6 +75137,7 @@ public Mono> updateVnetConnectionSlotWithResponseAsync( } else { connectionEnvelope.validate(); } + context = this.client.mergeContext(context); return service .updateVnetConnectionSlot( this.client.getEndpoint(), @@ -74364,6 +75373,7 @@ public Mono> getVnetConnectionGatewaySlotWithResponse new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getVnetConnectionGatewaySlot( this.client.getEndpoint(), @@ -74612,6 +75622,7 @@ public Mono> createOrUpdateVnetConnectionGatewaySlotW } else { connectionEnvelope.validate(); } + context = this.client.mergeContext(context); return service .createOrUpdateVnetConnectionGatewaySlot( this.client.getEndpoint(), @@ -74896,6 +75907,7 @@ public Mono> updateVnetConnectionGatewaySlotWithRespo } else { connectionEnvelope.validate(); } + context = this.client.mergeContext(context); return service .updateVnetConnectionGatewaySlot( this.client.getEndpoint(), @@ -75143,6 +76155,7 @@ public Mono> listWebJobsSlotSinglePageAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listWebJobsSlot( this.client.getEndpoint(), @@ -75338,6 +76351,7 @@ public Mono> getWebJobSlotWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getWebJobSlot( this.client.getEndpoint(), @@ -75543,6 +76557,7 @@ public Mono> listSlotDifferencesFromProductio } else { slotSwapEntity.validate(); } + context = this.client.mergeContext(context); return service .listSlotDifferencesFromProduction( this.client.getEndpoint(), @@ -75730,6 +76745,7 @@ public Mono>> swapSlotWithProductionWithResponseAsync( } else { slotSwapEntity.validate(); } + context = this.client.mergeContext(context); return service .swapSlotWithProduction( this.client.getEndpoint(), @@ -75753,7 +76769,7 @@ public Mono>> swapSlotWithProductionWithResponseAsync( * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, Void> beginSwapSlotWithProduction( + public PollerFlux, Void> beginSwapSlotWithProductionAsync( String resourceGroupName, String name, CsmSlotEntity slotSwapEntity) { Mono>> mono = swapSlotWithProductionWithResponseAsync(resourceGroupName, name, slotSwapEntity); @@ -75773,13 +76789,48 @@ public PollerFlux, Void> beginSwapSlotWithProduction( * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, Void> beginSwapSlotWithProduction( + public PollerFlux, Void> beginSwapSlotWithProductionAsync( String resourceGroupName, String name, CsmSlotEntity slotSwapEntity, Context context) { Mono>> mono = swapSlotWithProductionWithResponseAsync(resourceGroupName, name, slotSwapEntity, context); return this.client.getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class); } + /** + * Description for Swaps two deployment slots of an app. + * + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param slotSwapEntity Deployment slot parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginSwapSlotWithProduction( + String resourceGroupName, String name, CsmSlotEntity slotSwapEntity) { + return beginSwapSlotWithProductionAsync(resourceGroupName, name, slotSwapEntity).getSyncPoller(); + } + + /** + * Description for Swaps two deployment slots of an app. + * + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param slotSwapEntity Deployment slot parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginSwapSlotWithProduction( + String resourceGroupName, String name, CsmSlotEntity slotSwapEntity, Context context) { + return beginSwapSlotWithProductionAsync(resourceGroupName, name, slotSwapEntity, context).getSyncPoller(); + } + /** * Description for Swaps two deployment slots of an app. * @@ -75793,13 +76844,9 @@ public PollerFlux, Void> beginSwapSlotWithProduction( */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono swapSlotWithProductionAsync(String resourceGroupName, String name, CsmSlotEntity slotSwapEntity) { - Mono>> mono = - swapSlotWithProductionWithResponseAsync(resourceGroupName, name, slotSwapEntity); - return this - .client - .getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class) + return beginSwapSlotWithProductionAsync(resourceGroupName, name, slotSwapEntity) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -75817,13 +76864,9 @@ public Mono swapSlotWithProductionAsync(String resourceGroupName, String n @ServiceMethod(returns = ReturnType.SINGLE) public Mono swapSlotWithProductionAsync( String resourceGroupName, String name, CsmSlotEntity slotSwapEntity, Context context) { - Mono>> mono = - swapSlotWithProductionWithResponseAsync(resourceGroupName, name, slotSwapEntity, context); - return this - .client - .getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class) + return beginSwapSlotWithProductionAsync(resourceGroupName, name, slotSwapEntity, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -75945,6 +76988,7 @@ public Mono> listSnapshotsSinglePageAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listSnapshots( this.client.getEndpoint(), @@ -76118,6 +77162,7 @@ public Mono> listSnapshotsFromDRSecondarySinglePage new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listSnapshotsFromDRSecondary( this.client.getEndpoint(), @@ -76284,6 +77329,7 @@ public Mono> getSourceControlWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getSourceControl( this.client.getEndpoint(), @@ -76466,6 +77512,7 @@ public Mono>> createOrUpdateSourceControlWithResponseA } else { siteSourceControl.validate(); } + context = this.client.mergeContext(context); return service .createOrUpdateSourceControl( this.client.getEndpoint(), @@ -76489,7 +77536,7 @@ public Mono>> createOrUpdateSourceControlWithResponseA * @return source control configuration for an app. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, SiteSourceControlInner> beginCreateOrUpdateSourceControl( + public PollerFlux, SiteSourceControlInner> beginCreateOrUpdateSourceControlAsync( String resourceGroupName, String name, SiteSourceControlInner siteSourceControl) { Mono>> mono = createOrUpdateSourceControlWithResponseAsync(resourceGroupName, name, siteSourceControl); @@ -76512,7 +77559,7 @@ public PollerFlux, SiteSourceControlInner> be * @return source control configuration for an app. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, SiteSourceControlInner> beginCreateOrUpdateSourceControl( + public PollerFlux, SiteSourceControlInner> beginCreateOrUpdateSourceControlAsync( String resourceGroupName, String name, SiteSourceControlInner siteSourceControl, Context context) { Mono>> mono = createOrUpdateSourceControlWithResponseAsync(resourceGroupName, name, siteSourceControl, context); @@ -76522,6 +77569,42 @@ public PollerFlux, SiteSourceControlInner> be mono, this.client.getHttpPipeline(), SiteSourceControlInner.class, SiteSourceControlInner.class); } + /** + * Description for Updates the source control configuration of an app. + * + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param siteSourceControl Source control configuration for an app. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return source control configuration for an app. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, SiteSourceControlInner> beginCreateOrUpdateSourceControl( + String resourceGroupName, String name, SiteSourceControlInner siteSourceControl) { + return beginCreateOrUpdateSourceControlAsync(resourceGroupName, name, siteSourceControl).getSyncPoller(); + } + + /** + * Description for Updates the source control configuration of an app. + * + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param siteSourceControl Source control configuration for an app. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return source control configuration for an app. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, SiteSourceControlInner> beginCreateOrUpdateSourceControl( + String resourceGroupName, String name, SiteSourceControlInner siteSourceControl, Context context) { + return beginCreateOrUpdateSourceControlAsync(resourceGroupName, name, siteSourceControl, context) + .getSyncPoller(); + } + /** * Description for Updates the source control configuration of an app. * @@ -76536,14 +77619,9 @@ public PollerFlux, SiteSourceControlInner> be @ServiceMethod(returns = ReturnType.SINGLE) public Mono createOrUpdateSourceControlAsync( String resourceGroupName, String name, SiteSourceControlInner siteSourceControl) { - Mono>> mono = - createOrUpdateSourceControlWithResponseAsync(resourceGroupName, name, siteSourceControl); - return this - .client - .getLroResultAsync( - mono, this.client.getHttpPipeline(), SiteSourceControlInner.class, SiteSourceControlInner.class) + return beginCreateOrUpdateSourceControlAsync(resourceGroupName, name, siteSourceControl) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -76561,14 +77639,9 @@ public Mono createOrUpdateSourceControlAsync( @ServiceMethod(returns = ReturnType.SINGLE) public Mono createOrUpdateSourceControlAsync( String resourceGroupName, String name, SiteSourceControlInner siteSourceControl, Context context) { - Mono>> mono = - createOrUpdateSourceControlWithResponseAsync(resourceGroupName, name, siteSourceControl, context); - return this - .client - .getLroResultAsync( - mono, this.client.getHttpPipeline(), SiteSourceControlInner.class, SiteSourceControlInner.class) + return beginCreateOrUpdateSourceControlAsync(resourceGroupName, name, siteSourceControl, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -76684,6 +77757,7 @@ public Mono> deleteSourceControlWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .deleteSourceControl( this.client.getEndpoint(), @@ -76850,6 +77924,7 @@ public Mono> updateSourceControlWithResponseAsy } else { siteSourceControl.validate(); } + context = this.client.mergeContext(context); return service .updateSourceControl( this.client.getEndpoint(), @@ -77024,6 +78099,7 @@ public Mono> startWithResponseAsync(String resourceGroupName, Str new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .start( this.client.getEndpoint(), @@ -77187,6 +78263,7 @@ public Mono>> startNetworkTraceWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .startNetworkTrace( this.client.getEndpoint(), @@ -77214,7 +78291,7 @@ public Mono>> startNetworkTraceWithResponseAsync( * @return array of NetworkTrace. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, Object> beginStartNetworkTrace( + public PollerFlux, Object> beginStartNetworkTraceAsync( String resourceGroupName, String name, Integer durationInSeconds, Integer maxFrameLength, String sasUrl) { Mono>> mono = startNetworkTraceWithResponseAsync(resourceGroupName, name, durationInSeconds, maxFrameLength, sasUrl); @@ -77238,7 +78315,7 @@ public PollerFlux, Object> beginStartNetworkTrace( * @return array of NetworkTrace. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, Object> beginStartNetworkTrace( + public PollerFlux, Object> beginStartNetworkTraceAsync( String resourceGroupName, String name, Integer durationInSeconds, @@ -77253,6 +78330,52 @@ public PollerFlux, Object> beginStartNetworkTrace( .getLroResultAsync(mono, this.client.getHttpPipeline(), Object.class, Object.class); } + /** + * Description for Start capturing network packets for the site. + * + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name The name of the web app. + * @param durationInSeconds The duration to keep capturing in seconds. + * @param maxFrameLength The maximum frame length in bytes (Optional). + * @param sasUrl The Blob URL to store capture file. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return array of NetworkTrace. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Object> beginStartNetworkTrace( + String resourceGroupName, String name, Integer durationInSeconds, Integer maxFrameLength, String sasUrl) { + return beginStartNetworkTraceAsync(resourceGroupName, name, durationInSeconds, maxFrameLength, sasUrl) + .getSyncPoller(); + } + + /** + * Description for Start capturing network packets for the site. + * + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name The name of the web app. + * @param durationInSeconds The duration to keep capturing in seconds. + * @param maxFrameLength The maximum frame length in bytes (Optional). + * @param sasUrl The Blob URL to store capture file. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return array of NetworkTrace. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Object> beginStartNetworkTrace( + String resourceGroupName, + String name, + Integer durationInSeconds, + Integer maxFrameLength, + String sasUrl, + Context context) { + return beginStartNetworkTraceAsync(resourceGroupName, name, durationInSeconds, maxFrameLength, sasUrl, context) + .getSyncPoller(); + } + /** * Description for Start capturing network packets for the site. * @@ -77269,13 +78392,9 @@ public PollerFlux, Object> beginStartNetworkTrace( @ServiceMethod(returns = ReturnType.SINGLE) public Mono startNetworkTraceAsync( String resourceGroupName, String name, Integer durationInSeconds, Integer maxFrameLength, String sasUrl) { - Mono>> mono = - startNetworkTraceWithResponseAsync(resourceGroupName, name, durationInSeconds, maxFrameLength, sasUrl); - return this - .client - .getLroResultAsync(mono, this.client.getHttpPipeline(), Object.class, Object.class) + return beginStartNetworkTraceAsync(resourceGroupName, name, durationInSeconds, maxFrameLength, sasUrl) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -77300,14 +78419,9 @@ public Mono startNetworkTraceAsync( Integer maxFrameLength, String sasUrl, Context context) { - Mono>> mono = - startNetworkTraceWithResponseAsync( - resourceGroupName, name, durationInSeconds, maxFrameLength, sasUrl, context); - return this - .client - .getLroResultAsync(mono, this.client.getHttpPipeline(), Object.class, Object.class) + return beginStartNetworkTraceAsync(resourceGroupName, name, durationInSeconds, maxFrameLength, sasUrl, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -77326,13 +78440,9 @@ public Mono startNetworkTraceAsync(String resourceGroupName, String name final Integer maxFrameLength = null; final String sasUrl = null; final Context context = null; - Mono>> mono = - startNetworkTraceWithResponseAsync(resourceGroupName, name, durationInSeconds, maxFrameLength, sasUrl); - return this - .client - .getLroResultAsync(mono, this.client.getHttpPipeline(), Object.class, Object.class) + return beginStartNetworkTraceAsync(resourceGroupName, name, durationInSeconds, maxFrameLength, sasUrl) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -77476,6 +78586,7 @@ public Mono> stopWithResponseAsync(String resourceGroupName, Stri new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .stop( this.client.getEndpoint(), @@ -77624,6 +78735,7 @@ public Mono> stopNetworkTraceWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .stopNetworkTrace( this.client.getEndpoint(), @@ -77773,6 +78885,7 @@ public Mono> syncRepositoryWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .syncRepository( this.client.getEndpoint(), @@ -77922,6 +79035,7 @@ public Mono> syncFunctionTriggersWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .syncFunctionTriggers( this.client.getEndpoint(), @@ -78082,6 +79196,7 @@ public Mono> listTriggeredWebJobsSinglePageA new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listTriggeredWebJobs( this.client.getEndpoint(), @@ -78257,6 +79372,7 @@ public Mono> getTriggeredWebJobWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getTriggeredWebJob( this.client.getEndpoint(), @@ -78441,6 +79557,7 @@ public Mono> deleteTriggeredWebJobWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .deleteTriggeredWebJob( this.client.getEndpoint(), @@ -78616,6 +79733,7 @@ public Mono> listTriggeredWebJobHistoryS new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listTriggeredWebJobHistory( this.client.getEndpoint(), @@ -78807,6 +79925,7 @@ public Mono> getTriggeredWebJobHistoryWithRes new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getTriggeredWebJobHistory( this.client.getEndpoint(), @@ -78997,6 +80116,7 @@ public Mono> runTriggeredWebJobWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .runTriggeredWebJob( this.client.getEndpoint(), @@ -79170,6 +80290,7 @@ public Mono> listUsagesSinglePageAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listUsages( this.client.getEndpoint(), @@ -79385,6 +80506,7 @@ public Mono>> listVnetConnectionsWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listVnetConnections( this.client.getEndpoint(), @@ -79561,6 +80683,7 @@ public Mono> getVnetConnectionWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getVnetConnection( this.client.getEndpoint(), @@ -79760,6 +80883,7 @@ public Mono> createOrUpdateVnetConnectionWithResponseAsy } else { connectionEnvelope.validate(); } + context = this.client.mergeContext(context); return service .createOrUpdateVnetConnection( this.client.getEndpoint(), @@ -79956,6 +81080,7 @@ public Mono> deleteVnetConnectionWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .deleteVnetConnection( this.client.getEndpoint(), @@ -80139,6 +81264,7 @@ public Mono> updateVnetConnectionWithResponseAsync( } else { connectionEnvelope.validate(); } + context = this.client.mergeContext(context); return service .updateVnetConnection( this.client.getEndpoint(), @@ -80342,6 +81468,7 @@ public Mono> getVnetConnectionGatewayWithResponseAsyn new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getVnetConnectionGateway( this.client.getEndpoint(), @@ -80567,6 +81694,7 @@ public Mono> createOrUpdateVnetConnectionGatewayWithR } else { connectionEnvelope.validate(); } + context = this.client.mergeContext(context); return service .createOrUpdateVnetConnectionGateway( this.client.getEndpoint(), @@ -80825,6 +81953,7 @@ public Mono> updateVnetConnectionGatewayWithResponseA } else { connectionEnvelope.validate(); } + context = this.client.mergeContext(context); return service .updateVnetConnectionGateway( this.client.getEndpoint(), @@ -81046,6 +82175,7 @@ public Mono> listWebJobsSinglePageAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listWebJobs( this.client.getEndpoint(), @@ -81219,6 +82349,7 @@ public Mono> getWebJobWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getWebJob( this.client.getEndpoint(), @@ -81312,7089 +82443,6 @@ public WebJobInner getWebJob(String resourceGroupName, String name, String webJo return getWebJobAsync(resourceGroupName, name, webJobName, context).block(); } - /** - * Description for Creates a new web, mobile, or API app in an existing resource group, or updates an existing app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Unique name of the app to create or update. To create or update a deployment slot, use the {slot} - * parameter. - * @param siteEnvelope A web app, a mobile app backend, or an API app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a web app, a mobile app backend, or an API app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginCreateOrUpdateWithoutPollingWithResponseAsync( - String resourceGroupName, String name, SiteInner siteEnvelope) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (siteEnvelope == null) { - return Mono.error(new IllegalArgumentException("Parameter siteEnvelope is required and cannot be null.")); - } else { - siteEnvelope.validate(); - } - return FluxUtil - .withContext( - context -> - service - .beginCreateOrUpdateWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - siteEnvelope, - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Description for Creates a new web, mobile, or API app in an existing resource group, or updates an existing app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Unique name of the app to create or update. To create or update a deployment slot, use the {slot} - * parameter. - * @param siteEnvelope A web app, a mobile app backend, or an API app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a web app, a mobile app backend, or an API app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginCreateOrUpdateWithoutPollingWithResponseAsync( - String resourceGroupName, String name, SiteInner siteEnvelope, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (siteEnvelope == null) { - return Mono.error(new IllegalArgumentException("Parameter siteEnvelope is required and cannot be null.")); - } else { - siteEnvelope.validate(); - } - return service - .beginCreateOrUpdateWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - siteEnvelope, - context); - } - - /** - * Description for Creates a new web, mobile, or API app in an existing resource group, or updates an existing app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Unique name of the app to create or update. To create or update a deployment slot, use the {slot} - * parameter. - * @param siteEnvelope A web app, a mobile app backend, or an API app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a web app, a mobile app backend, or an API app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginCreateOrUpdateWithoutPollingAsync( - String resourceGroupName, String name, SiteInner siteEnvelope) { - return beginCreateOrUpdateWithoutPollingWithResponseAsync(resourceGroupName, name, siteEnvelope) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Description for Creates a new web, mobile, or API app in an existing resource group, or updates an existing app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Unique name of the app to create or update. To create or update a deployment slot, use the {slot} - * parameter. - * @param siteEnvelope A web app, a mobile app backend, or an API app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a web app, a mobile app backend, or an API app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginCreateOrUpdateWithoutPollingAsync( - String resourceGroupName, String name, SiteInner siteEnvelope, Context context) { - return beginCreateOrUpdateWithoutPollingWithResponseAsync(resourceGroupName, name, siteEnvelope, context) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Description for Creates a new web, mobile, or API app in an existing resource group, or updates an existing app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Unique name of the app to create or update. To create or update a deployment slot, use the {slot} - * parameter. - * @param siteEnvelope A web app, a mobile app backend, or an API app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a web app, a mobile app backend, or an API app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SiteInner beginCreateOrUpdateWithoutPolling(String resourceGroupName, String name, SiteInner siteEnvelope) { - return beginCreateOrUpdateWithoutPollingAsync(resourceGroupName, name, siteEnvelope).block(); - } - - /** - * Description for Creates a new web, mobile, or API app in an existing resource group, or updates an existing app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Unique name of the app to create or update. To create or update a deployment slot, use the {slot} - * parameter. - * @param siteEnvelope A web app, a mobile app backend, or an API app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a web app, a mobile app backend, or an API app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SiteInner beginCreateOrUpdateWithoutPolling( - String resourceGroupName, String name, SiteInner siteEnvelope, Context context) { - return beginCreateOrUpdateWithoutPollingAsync(resourceGroupName, name, siteEnvelope, context).block(); - } - - /** - * Description for Restores a specific backup to another app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param backupId ID of the backup. - * @param request Description of a restore request. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginRestoreWithoutPollingWithResponseAsync( - String resourceGroupName, String name, String backupId, RestoreRequestInner request) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (backupId == null) { - return Mono.error(new IllegalArgumentException("Parameter backupId is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (request == null) { - return Mono.error(new IllegalArgumentException("Parameter request is required and cannot be null.")); - } else { - request.validate(); - } - return FluxUtil - .withContext( - context -> - service - .beginRestoreWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - name, - backupId, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - request, - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Description for Restores a specific backup to another app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param backupId ID of the backup. - * @param request Description of a restore request. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginRestoreWithoutPollingWithResponseAsync( - String resourceGroupName, String name, String backupId, RestoreRequestInner request, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (backupId == null) { - return Mono.error(new IllegalArgumentException("Parameter backupId is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (request == null) { - return Mono.error(new IllegalArgumentException("Parameter request is required and cannot be null.")); - } else { - request.validate(); - } - return service - .beginRestoreWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - name, - backupId, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - request, - context); - } - - /** - * Description for Restores a specific backup to another app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param backupId ID of the backup. - * @param request Description of a restore request. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginRestoreWithoutPollingAsync( - String resourceGroupName, String name, String backupId, RestoreRequestInner request) { - return beginRestoreWithoutPollingWithResponseAsync(resourceGroupName, name, backupId, request) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Description for Restores a specific backup to another app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param backupId ID of the backup. - * @param request Description of a restore request. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginRestoreWithoutPollingAsync( - String resourceGroupName, String name, String backupId, RestoreRequestInner request, Context context) { - return beginRestoreWithoutPollingWithResponseAsync(resourceGroupName, name, backupId, request, context) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Description for Restores a specific backup to another app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param backupId ID of the backup. - * @param request Description of a restore request. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void beginRestoreWithoutPolling( - String resourceGroupName, String name, String backupId, RestoreRequestInner request) { - beginRestoreWithoutPollingAsync(resourceGroupName, name, backupId, request).block(); - } - - /** - * Description for Restores a specific backup to another app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param backupId ID of the backup. - * @param request Description of a restore request. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void beginRestoreWithoutPolling( - String resourceGroupName, String name, String backupId, RestoreRequestInner request, Context context) { - beginRestoreWithoutPollingAsync(resourceGroupName, name, backupId, request, context).block(); - } - - /** - * Description for Gets the Git/FTP publishing credentials of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return user credentials used for publishing activity. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginListPublishingCredentialsWithoutPollingWithResponseAsync( - String resourceGroupName, String name) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - return FluxUtil - .withContext( - context -> - service - .beginListPublishingCredentialsWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Description for Gets the Git/FTP publishing credentials of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return user credentials used for publishing activity. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginListPublishingCredentialsWithoutPollingWithResponseAsync( - String resourceGroupName, String name, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - return service - .beginListPublishingCredentialsWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context); - } - - /** - * Description for Gets the Git/FTP publishing credentials of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return user credentials used for publishing activity. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginListPublishingCredentialsWithoutPollingAsync(String resourceGroupName, String name) { - return beginListPublishingCredentialsWithoutPollingWithResponseAsync(resourceGroupName, name) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Description for Gets the Git/FTP publishing credentials of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return user credentials used for publishing activity. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginListPublishingCredentialsWithoutPollingAsync( - String resourceGroupName, String name, Context context) { - return beginListPublishingCredentialsWithoutPollingWithResponseAsync(resourceGroupName, name, context) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Description for Gets the Git/FTP publishing credentials of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return user credentials used for publishing activity. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public UserInner beginListPublishingCredentialsWithoutPolling(String resourceGroupName, String name) { - return beginListPublishingCredentialsWithoutPollingAsync(resourceGroupName, name).block(); - } - - /** - * Description for Gets the Git/FTP publishing credentials of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return user credentials used for publishing activity. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public UserInner beginListPublishingCredentialsWithoutPolling( - String resourceGroupName, String name, Context context) { - return beginListPublishingCredentialsWithoutPollingAsync(resourceGroupName, name, context).block(); - } - - /** - * Description for Invoke the MSDeploy web app extension. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param mSDeploy MSDeploy ARM PUT information. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return mSDeploy ARM response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginCreateMSDeployOperationWithoutPollingWithResponseAsync( - String resourceGroupName, String name, MSDeploy mSDeploy) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (mSDeploy == null) { - return Mono.error(new IllegalArgumentException("Parameter mSDeploy is required and cannot be null.")); - } else { - mSDeploy.validate(); - } - return FluxUtil - .withContext( - context -> - service - .beginCreateMSDeployOperationWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - mSDeploy, - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Description for Invoke the MSDeploy web app extension. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param mSDeploy MSDeploy ARM PUT information. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return mSDeploy ARM response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginCreateMSDeployOperationWithoutPollingWithResponseAsync( - String resourceGroupName, String name, MSDeploy mSDeploy, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (mSDeploy == null) { - return Mono.error(new IllegalArgumentException("Parameter mSDeploy is required and cannot be null.")); - } else { - mSDeploy.validate(); - } - return service - .beginCreateMSDeployOperationWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - mSDeploy, - context); - } - - /** - * Description for Invoke the MSDeploy web app extension. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param mSDeploy MSDeploy ARM PUT information. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return mSDeploy ARM response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginCreateMSDeployOperationWithoutPollingAsync( - String resourceGroupName, String name, MSDeploy mSDeploy) { - return beginCreateMSDeployOperationWithoutPollingWithResponseAsync(resourceGroupName, name, mSDeploy) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Description for Invoke the MSDeploy web app extension. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param mSDeploy MSDeploy ARM PUT information. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return mSDeploy ARM response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginCreateMSDeployOperationWithoutPollingAsync( - String resourceGroupName, String name, MSDeploy mSDeploy, Context context) { - return beginCreateMSDeployOperationWithoutPollingWithResponseAsync(resourceGroupName, name, mSDeploy, context) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Description for Invoke the MSDeploy web app extension. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param mSDeploy MSDeploy ARM PUT information. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return mSDeploy ARM response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public MSDeployStatusInner beginCreateMSDeployOperationWithoutPolling( - String resourceGroupName, String name, MSDeploy mSDeploy) { - return beginCreateMSDeployOperationWithoutPollingAsync(resourceGroupName, name, mSDeploy).block(); - } - - /** - * Description for Invoke the MSDeploy web app extension. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param mSDeploy MSDeploy ARM PUT information. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return mSDeploy ARM response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public MSDeployStatusInner beginCreateMSDeployOperationWithoutPolling( - String resourceGroupName, String name, MSDeploy mSDeploy, Context context) { - return beginCreateMSDeployOperationWithoutPollingAsync(resourceGroupName, name, mSDeploy, context).block(); - } - - /** - * Description for Create function for web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param functionName Function name. - * @param functionEnvelope Function information. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return function information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginCreateFunctionWithoutPollingWithResponseAsync( - String resourceGroupName, String name, String functionName, FunctionEnvelopeInner functionEnvelope) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (functionName == null) { - return Mono.error(new IllegalArgumentException("Parameter functionName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (functionEnvelope == null) { - return Mono - .error(new IllegalArgumentException("Parameter functionEnvelope is required and cannot be null.")); - } else { - functionEnvelope.validate(); - } - return FluxUtil - .withContext( - context -> - service - .beginCreateFunctionWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - name, - functionName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - functionEnvelope, - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Description for Create function for web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param functionName Function name. - * @param functionEnvelope Function information. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return function information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginCreateFunctionWithoutPollingWithResponseAsync( - String resourceGroupName, - String name, - String functionName, - FunctionEnvelopeInner functionEnvelope, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (functionName == null) { - return Mono.error(new IllegalArgumentException("Parameter functionName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (functionEnvelope == null) { - return Mono - .error(new IllegalArgumentException("Parameter functionEnvelope is required and cannot be null.")); - } else { - functionEnvelope.validate(); - } - return service - .beginCreateFunctionWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - name, - functionName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - functionEnvelope, - context); - } - - /** - * Description for Create function for web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param functionName Function name. - * @param functionEnvelope Function information. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return function information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginCreateFunctionWithoutPollingAsync( - String resourceGroupName, String name, String functionName, FunctionEnvelopeInner functionEnvelope) { - return beginCreateFunctionWithoutPollingWithResponseAsync( - resourceGroupName, name, functionName, functionEnvelope) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Description for Create function for web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param functionName Function name. - * @param functionEnvelope Function information. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return function information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginCreateFunctionWithoutPollingAsync( - String resourceGroupName, - String name, - String functionName, - FunctionEnvelopeInner functionEnvelope, - Context context) { - return beginCreateFunctionWithoutPollingWithResponseAsync( - resourceGroupName, name, functionName, functionEnvelope, context) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Description for Create function for web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param functionName Function name. - * @param functionEnvelope Function information. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return function information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public FunctionEnvelopeInner beginCreateFunctionWithoutPolling( - String resourceGroupName, String name, String functionName, FunctionEnvelopeInner functionEnvelope) { - return beginCreateFunctionWithoutPollingAsync(resourceGroupName, name, functionName, functionEnvelope).block(); - } - - /** - * Description for Create function for web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param functionName Function name. - * @param functionEnvelope Function information. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return function information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public FunctionEnvelopeInner beginCreateFunctionWithoutPolling( - String resourceGroupName, - String name, - String functionName, - FunctionEnvelopeInner functionEnvelope, - Context context) { - return beginCreateFunctionWithoutPollingAsync(resourceGroupName, name, functionName, functionEnvelope, context) - .block(); - } - - /** - * Description for Invoke the MSDeploy web app extension. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param instanceId ID of web app instance. - * @param mSDeploy MSDeploy ARM PUT information. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return mSDeploy ARM response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginCreateInstanceMSDeployOperationWithoutPollingWithResponseAsync( - String resourceGroupName, String name, String instanceId, MSDeploy mSDeploy) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (instanceId == null) { - return Mono.error(new IllegalArgumentException("Parameter instanceId is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (mSDeploy == null) { - return Mono.error(new IllegalArgumentException("Parameter mSDeploy is required and cannot be null.")); - } else { - mSDeploy.validate(); - } - return FluxUtil - .withContext( - context -> - service - .beginCreateInstanceMSDeployOperationWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - name, - instanceId, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - mSDeploy, - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Description for Invoke the MSDeploy web app extension. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param instanceId ID of web app instance. - * @param mSDeploy MSDeploy ARM PUT information. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return mSDeploy ARM response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginCreateInstanceMSDeployOperationWithoutPollingWithResponseAsync( - String resourceGroupName, String name, String instanceId, MSDeploy mSDeploy, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (instanceId == null) { - return Mono.error(new IllegalArgumentException("Parameter instanceId is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (mSDeploy == null) { - return Mono.error(new IllegalArgumentException("Parameter mSDeploy is required and cannot be null.")); - } else { - mSDeploy.validate(); - } - return service - .beginCreateInstanceMSDeployOperationWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - name, - instanceId, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - mSDeploy, - context); - } - - /** - * Description for Invoke the MSDeploy web app extension. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param instanceId ID of web app instance. - * @param mSDeploy MSDeploy ARM PUT information. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return mSDeploy ARM response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginCreateInstanceMSDeployOperationWithoutPollingAsync( - String resourceGroupName, String name, String instanceId, MSDeploy mSDeploy) { - return beginCreateInstanceMSDeployOperationWithoutPollingWithResponseAsync( - resourceGroupName, name, instanceId, mSDeploy) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Description for Invoke the MSDeploy web app extension. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param instanceId ID of web app instance. - * @param mSDeploy MSDeploy ARM PUT information. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return mSDeploy ARM response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginCreateInstanceMSDeployOperationWithoutPollingAsync( - String resourceGroupName, String name, String instanceId, MSDeploy mSDeploy, Context context) { - return beginCreateInstanceMSDeployOperationWithoutPollingWithResponseAsync( - resourceGroupName, name, instanceId, mSDeploy, context) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Description for Invoke the MSDeploy web app extension. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param instanceId ID of web app instance. - * @param mSDeploy MSDeploy ARM PUT information. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return mSDeploy ARM response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public MSDeployStatusInner beginCreateInstanceMSDeployOperationWithoutPolling( - String resourceGroupName, String name, String instanceId, MSDeploy mSDeploy) { - return beginCreateInstanceMSDeployOperationWithoutPollingAsync(resourceGroupName, name, instanceId, mSDeploy) - .block(); - } - - /** - * Description for Invoke the MSDeploy web app extension. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param instanceId ID of web app instance. - * @param mSDeploy MSDeploy ARM PUT information. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return mSDeploy ARM response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public MSDeployStatusInner beginCreateInstanceMSDeployOperationWithoutPolling( - String resourceGroupName, String name, String instanceId, MSDeploy mSDeploy, Context context) { - return beginCreateInstanceMSDeployOperationWithoutPollingAsync( - resourceGroupName, name, instanceId, mSDeploy, context) - .block(); - } - - /** - * Description for Restores a web app. - * - * @param subscriptionName Azure subscription. - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param migrationOptions Options for app content migration. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for a migration of app content request. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginMigrateStorageWithoutPollingWithResponseAsync( - String subscriptionName, String resourceGroupName, String name, StorageMigrationOptions migrationOptions) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (subscriptionName == null) { - return Mono - .error(new IllegalArgumentException("Parameter subscriptionName is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (migrationOptions == null) { - return Mono - .error(new IllegalArgumentException("Parameter migrationOptions is required and cannot be null.")); - } else { - migrationOptions.validate(); - } - return FluxUtil - .withContext( - context -> - service - .beginMigrateStorageWithoutPolling( - this.client.getEndpoint(), - subscriptionName, - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - migrationOptions, - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Description for Restores a web app. - * - * @param subscriptionName Azure subscription. - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param migrationOptions Options for app content migration. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for a migration of app content request. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginMigrateStorageWithoutPollingWithResponseAsync( - String subscriptionName, - String resourceGroupName, - String name, - StorageMigrationOptions migrationOptions, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (subscriptionName == null) { - return Mono - .error(new IllegalArgumentException("Parameter subscriptionName is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (migrationOptions == null) { - return Mono - .error(new IllegalArgumentException("Parameter migrationOptions is required and cannot be null.")); - } else { - migrationOptions.validate(); - } - return service - .beginMigrateStorageWithoutPolling( - this.client.getEndpoint(), - subscriptionName, - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - migrationOptions, - context); - } - - /** - * Description for Restores a web app. - * - * @param subscriptionName Azure subscription. - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param migrationOptions Options for app content migration. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for a migration of app content request. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginMigrateStorageWithoutPollingAsync( - String subscriptionName, String resourceGroupName, String name, StorageMigrationOptions migrationOptions) { - return beginMigrateStorageWithoutPollingWithResponseAsync( - subscriptionName, resourceGroupName, name, migrationOptions) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Description for Restores a web app. - * - * @param subscriptionName Azure subscription. - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param migrationOptions Options for app content migration. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for a migration of app content request. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginMigrateStorageWithoutPollingAsync( - String subscriptionName, - String resourceGroupName, - String name, - StorageMigrationOptions migrationOptions, - Context context) { - return beginMigrateStorageWithoutPollingWithResponseAsync( - subscriptionName, resourceGroupName, name, migrationOptions, context) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Description for Restores a web app. - * - * @param subscriptionName Azure subscription. - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param migrationOptions Options for app content migration. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for a migration of app content request. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public StorageMigrationResponseInner beginMigrateStorageWithoutPolling( - String subscriptionName, String resourceGroupName, String name, StorageMigrationOptions migrationOptions) { - return beginMigrateStorageWithoutPollingAsync(subscriptionName, resourceGroupName, name, migrationOptions) - .block(); - } - - /** - * Description for Restores a web app. - * - * @param subscriptionName Azure subscription. - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param migrationOptions Options for app content migration. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for a migration of app content request. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public StorageMigrationResponseInner beginMigrateStorageWithoutPolling( - String subscriptionName, - String resourceGroupName, - String name, - StorageMigrationOptions migrationOptions, - Context context) { - return beginMigrateStorageWithoutPollingAsync( - subscriptionName, resourceGroupName, name, migrationOptions, context) - .block(); - } - - /** - * Description for Migrates a local (in-app) MySql database to a remote MySql database. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param migrationRequestEnvelope MySQL migration request. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an operation on a resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginMigrateMySqlWithoutPollingWithResponseAsync( - String resourceGroupName, String name, MigrateMySqlRequest migrationRequestEnvelope) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (migrationRequestEnvelope == null) { - return Mono - .error( - new IllegalArgumentException("Parameter migrationRequestEnvelope is required and cannot be null.")); - } else { - migrationRequestEnvelope.validate(); - } - return FluxUtil - .withContext( - context -> - service - .beginMigrateMySqlWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - migrationRequestEnvelope, - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Description for Migrates a local (in-app) MySql database to a remote MySql database. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param migrationRequestEnvelope MySQL migration request. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an operation on a resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginMigrateMySqlWithoutPollingWithResponseAsync( - String resourceGroupName, String name, MigrateMySqlRequest migrationRequestEnvelope, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (migrationRequestEnvelope == null) { - return Mono - .error( - new IllegalArgumentException("Parameter migrationRequestEnvelope is required and cannot be null.")); - } else { - migrationRequestEnvelope.validate(); - } - return service - .beginMigrateMySqlWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - migrationRequestEnvelope, - context); - } - - /** - * Description for Migrates a local (in-app) MySql database to a remote MySql database. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param migrationRequestEnvelope MySQL migration request. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an operation on a resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginMigrateMySqlWithoutPollingAsync( - String resourceGroupName, String name, MigrateMySqlRequest migrationRequestEnvelope) { - return beginMigrateMySqlWithoutPollingWithResponseAsync(resourceGroupName, name, migrationRequestEnvelope) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Description for Migrates a local (in-app) MySql database to a remote MySql database. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param migrationRequestEnvelope MySQL migration request. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an operation on a resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginMigrateMySqlWithoutPollingAsync( - String resourceGroupName, String name, MigrateMySqlRequest migrationRequestEnvelope, Context context) { - return beginMigrateMySqlWithoutPollingWithResponseAsync( - resourceGroupName, name, migrationRequestEnvelope, context) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Description for Migrates a local (in-app) MySql database to a remote MySql database. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param migrationRequestEnvelope MySQL migration request. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an operation on a resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public OperationInner beginMigrateMySqlWithoutPolling( - String resourceGroupName, String name, MigrateMySqlRequest migrationRequestEnvelope) { - return beginMigrateMySqlWithoutPollingAsync(resourceGroupName, name, migrationRequestEnvelope).block(); - } - - /** - * Description for Migrates a local (in-app) MySql database to a remote MySql database. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param migrationRequestEnvelope MySQL migration request. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an operation on a resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public OperationInner beginMigrateMySqlWithoutPolling( - String resourceGroupName, String name, MigrateMySqlRequest migrationRequestEnvelope, Context context) { - return beginMigrateMySqlWithoutPollingAsync(resourceGroupName, name, migrationRequestEnvelope, context).block(); - } - - /** - * Description for Start capturing network packets for the site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param durationInSeconds The duration to keep capturing in seconds. - * @param maxFrameLength The maximum frame length in bytes (Optional). - * @param sasUrl The Blob URL to store capture file. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return array of NetworkTrace. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginStartWebSiteNetworkTraceOperationWithoutPollingWithResponseAsync( - String resourceGroupName, String name, Integer durationInSeconds, Integer maxFrameLength, String sasUrl) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - return FluxUtil - .withContext( - context -> - service - .beginStartWebSiteNetworkTraceOperationWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - name, - durationInSeconds, - maxFrameLength, - sasUrl, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Description for Start capturing network packets for the site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param durationInSeconds The duration to keep capturing in seconds. - * @param maxFrameLength The maximum frame length in bytes (Optional). - * @param sasUrl The Blob URL to store capture file. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return array of NetworkTrace. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginStartWebSiteNetworkTraceOperationWithoutPollingWithResponseAsync( - String resourceGroupName, - String name, - Integer durationInSeconds, - Integer maxFrameLength, - String sasUrl, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - return service - .beginStartWebSiteNetworkTraceOperationWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - name, - durationInSeconds, - maxFrameLength, - sasUrl, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context); - } - - /** - * Description for Start capturing network packets for the site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param durationInSeconds The duration to keep capturing in seconds. - * @param maxFrameLength The maximum frame length in bytes (Optional). - * @param sasUrl The Blob URL to store capture file. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return array of NetworkTrace. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginStartWebSiteNetworkTraceOperationWithoutPollingAsync( - String resourceGroupName, String name, Integer durationInSeconds, Integer maxFrameLength, String sasUrl) { - return beginStartWebSiteNetworkTraceOperationWithoutPollingWithResponseAsync( - resourceGroupName, name, durationInSeconds, maxFrameLength, sasUrl) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Description for Start capturing network packets for the site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param durationInSeconds The duration to keep capturing in seconds. - * @param maxFrameLength The maximum frame length in bytes (Optional). - * @param sasUrl The Blob URL to store capture file. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return array of NetworkTrace. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginStartWebSiteNetworkTraceOperationWithoutPollingAsync( - String resourceGroupName, - String name, - Integer durationInSeconds, - Integer maxFrameLength, - String sasUrl, - Context context) { - return beginStartWebSiteNetworkTraceOperationWithoutPollingWithResponseAsync( - resourceGroupName, name, durationInSeconds, maxFrameLength, sasUrl, context) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Description for Start capturing network packets for the site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return array of NetworkTrace. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginStartWebSiteNetworkTraceOperationWithoutPollingAsync( - String resourceGroupName, String name) { - final Integer durationInSeconds = null; - final Integer maxFrameLength = null; - final String sasUrl = null; - final Context context = null; - return beginStartWebSiteNetworkTraceOperationWithoutPollingWithResponseAsync( - resourceGroupName, name, durationInSeconds, maxFrameLength, sasUrl) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Description for Start capturing network packets for the site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param durationInSeconds The duration to keep capturing in seconds. - * @param maxFrameLength The maximum frame length in bytes (Optional). - * @param sasUrl The Blob URL to store capture file. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return array of NetworkTrace. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Object beginStartWebSiteNetworkTraceOperationWithoutPolling( - String resourceGroupName, String name, Integer durationInSeconds, Integer maxFrameLength, String sasUrl) { - return beginStartWebSiteNetworkTraceOperationWithoutPollingAsync( - resourceGroupName, name, durationInSeconds, maxFrameLength, sasUrl) - .block(); - } - - /** - * Description for Start capturing network packets for the site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param durationInSeconds The duration to keep capturing in seconds. - * @param maxFrameLength The maximum frame length in bytes (Optional). - * @param sasUrl The Blob URL to store capture file. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return array of NetworkTrace. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Object beginStartWebSiteNetworkTraceOperationWithoutPolling( - String resourceGroupName, - String name, - Integer durationInSeconds, - Integer maxFrameLength, - String sasUrl, - Context context) { - return beginStartWebSiteNetworkTraceOperationWithoutPollingAsync( - resourceGroupName, name, durationInSeconds, maxFrameLength, sasUrl, context) - .block(); - } - - /** - * Description for Start capturing network packets for the site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return array of NetworkTrace. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Object beginStartWebSiteNetworkTraceOperationWithoutPolling(String resourceGroupName, String name) { - final Integer durationInSeconds = null; - final Integer maxFrameLength = null; - final String sasUrl = null; - final Context context = null; - return beginStartWebSiteNetworkTraceOperationWithoutPollingAsync( - resourceGroupName, name, durationInSeconds, maxFrameLength, sasUrl) - .block(); - } - - /** - * Description for Restores an app from a backup blob in Azure Storage. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param request Description of a restore request. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginRestoreFromBackupBlobWithoutPollingWithResponseAsync( - String resourceGroupName, String name, RestoreRequestInner request) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (request == null) { - return Mono.error(new IllegalArgumentException("Parameter request is required and cannot be null.")); - } else { - request.validate(); - } - return FluxUtil - .withContext( - context -> - service - .beginRestoreFromBackupBlobWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - request, - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Description for Restores an app from a backup blob in Azure Storage. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param request Description of a restore request. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginRestoreFromBackupBlobWithoutPollingWithResponseAsync( - String resourceGroupName, String name, RestoreRequestInner request, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (request == null) { - return Mono.error(new IllegalArgumentException("Parameter request is required and cannot be null.")); - } else { - request.validate(); - } - return service - .beginRestoreFromBackupBlobWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - request, - context); - } - - /** - * Description for Restores an app from a backup blob in Azure Storage. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param request Description of a restore request. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginRestoreFromBackupBlobWithoutPollingAsync( - String resourceGroupName, String name, RestoreRequestInner request) { - return beginRestoreFromBackupBlobWithoutPollingWithResponseAsync(resourceGroupName, name, request) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Description for Restores an app from a backup blob in Azure Storage. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param request Description of a restore request. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginRestoreFromBackupBlobWithoutPollingAsync( - String resourceGroupName, String name, RestoreRequestInner request, Context context) { - return beginRestoreFromBackupBlobWithoutPollingWithResponseAsync(resourceGroupName, name, request, context) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Description for Restores an app from a backup blob in Azure Storage. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param request Description of a restore request. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void beginRestoreFromBackupBlobWithoutPolling( - String resourceGroupName, String name, RestoreRequestInner request) { - beginRestoreFromBackupBlobWithoutPollingAsync(resourceGroupName, name, request).block(); - } - - /** - * Description for Restores an app from a backup blob in Azure Storage. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param request Description of a restore request. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void beginRestoreFromBackupBlobWithoutPolling( - String resourceGroupName, String name, RestoreRequestInner request, Context context) { - beginRestoreFromBackupBlobWithoutPollingAsync(resourceGroupName, name, request, context).block(); - } - - /** - * Description for Restores a deleted web app to this web app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param restoreRequest Details about restoring a deleted app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginRestoreFromDeletedAppWithoutPollingWithResponseAsync( - String resourceGroupName, String name, DeletedAppRestoreRequest restoreRequest) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (restoreRequest == null) { - return Mono.error(new IllegalArgumentException("Parameter restoreRequest is required and cannot be null.")); - } else { - restoreRequest.validate(); - } - return FluxUtil - .withContext( - context -> - service - .beginRestoreFromDeletedAppWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - restoreRequest, - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Description for Restores a deleted web app to this web app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param restoreRequest Details about restoring a deleted app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginRestoreFromDeletedAppWithoutPollingWithResponseAsync( - String resourceGroupName, String name, DeletedAppRestoreRequest restoreRequest, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (restoreRequest == null) { - return Mono.error(new IllegalArgumentException("Parameter restoreRequest is required and cannot be null.")); - } else { - restoreRequest.validate(); - } - return service - .beginRestoreFromDeletedAppWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - restoreRequest, - context); - } - - /** - * Description for Restores a deleted web app to this web app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param restoreRequest Details about restoring a deleted app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginRestoreFromDeletedAppWithoutPollingAsync( - String resourceGroupName, String name, DeletedAppRestoreRequest restoreRequest) { - return beginRestoreFromDeletedAppWithoutPollingWithResponseAsync(resourceGroupName, name, restoreRequest) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Description for Restores a deleted web app to this web app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param restoreRequest Details about restoring a deleted app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginRestoreFromDeletedAppWithoutPollingAsync( - String resourceGroupName, String name, DeletedAppRestoreRequest restoreRequest, Context context) { - return beginRestoreFromDeletedAppWithoutPollingWithResponseAsync( - resourceGroupName, name, restoreRequest, context) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Description for Restores a deleted web app to this web app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param restoreRequest Details about restoring a deleted app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void beginRestoreFromDeletedAppWithoutPolling( - String resourceGroupName, String name, DeletedAppRestoreRequest restoreRequest) { - beginRestoreFromDeletedAppWithoutPollingAsync(resourceGroupName, name, restoreRequest).block(); - } - - /** - * Description for Restores a deleted web app to this web app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param restoreRequest Details about restoring a deleted app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void beginRestoreFromDeletedAppWithoutPolling( - String resourceGroupName, String name, DeletedAppRestoreRequest restoreRequest, Context context) { - beginRestoreFromDeletedAppWithoutPollingAsync(resourceGroupName, name, restoreRequest, context).block(); - } - - /** - * Description for Restores a web app from a snapshot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param restoreRequest Details about app recovery operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginRestoreSnapshotWithoutPollingWithResponseAsync( - String resourceGroupName, String name, SnapshotRestoreRequest restoreRequest) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (restoreRequest == null) { - return Mono.error(new IllegalArgumentException("Parameter restoreRequest is required and cannot be null.")); - } else { - restoreRequest.validate(); - } - return FluxUtil - .withContext( - context -> - service - .beginRestoreSnapshotWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - restoreRequest, - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Description for Restores a web app from a snapshot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param restoreRequest Details about app recovery operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginRestoreSnapshotWithoutPollingWithResponseAsync( - String resourceGroupName, String name, SnapshotRestoreRequest restoreRequest, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (restoreRequest == null) { - return Mono.error(new IllegalArgumentException("Parameter restoreRequest is required and cannot be null.")); - } else { - restoreRequest.validate(); - } - return service - .beginRestoreSnapshotWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - restoreRequest, - context); - } - - /** - * Description for Restores a web app from a snapshot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param restoreRequest Details about app recovery operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginRestoreSnapshotWithoutPollingAsync( - String resourceGroupName, String name, SnapshotRestoreRequest restoreRequest) { - return beginRestoreSnapshotWithoutPollingWithResponseAsync(resourceGroupName, name, restoreRequest) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Description for Restores a web app from a snapshot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param restoreRequest Details about app recovery operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginRestoreSnapshotWithoutPollingAsync( - String resourceGroupName, String name, SnapshotRestoreRequest restoreRequest, Context context) { - return beginRestoreSnapshotWithoutPollingWithResponseAsync(resourceGroupName, name, restoreRequest, context) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Description for Restores a web app from a snapshot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param restoreRequest Details about app recovery operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void beginRestoreSnapshotWithoutPolling( - String resourceGroupName, String name, SnapshotRestoreRequest restoreRequest) { - beginRestoreSnapshotWithoutPollingAsync(resourceGroupName, name, restoreRequest).block(); - } - - /** - * Description for Restores a web app from a snapshot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param restoreRequest Details about app recovery operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void beginRestoreSnapshotWithoutPolling( - String resourceGroupName, String name, SnapshotRestoreRequest restoreRequest, Context context) { - beginRestoreSnapshotWithoutPollingAsync(resourceGroupName, name, restoreRequest, context).block(); - } - - /** - * Description for Install site extension on a web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param siteExtensionId Site extension name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return site Extension Information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginInstallSiteExtensionWithoutPollingWithResponseAsync( - String resourceGroupName, String name, String siteExtensionId) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (siteExtensionId == null) { - return Mono - .error(new IllegalArgumentException("Parameter siteExtensionId is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - return FluxUtil - .withContext( - context -> - service - .beginInstallSiteExtensionWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - name, - siteExtensionId, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Description for Install site extension on a web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param siteExtensionId Site extension name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return site Extension Information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginInstallSiteExtensionWithoutPollingWithResponseAsync( - String resourceGroupName, String name, String siteExtensionId, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (siteExtensionId == null) { - return Mono - .error(new IllegalArgumentException("Parameter siteExtensionId is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - return service - .beginInstallSiteExtensionWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - name, - siteExtensionId, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context); - } - - /** - * Description for Install site extension on a web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param siteExtensionId Site extension name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return site Extension Information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginInstallSiteExtensionWithoutPollingAsync( - String resourceGroupName, String name, String siteExtensionId) { - return beginInstallSiteExtensionWithoutPollingWithResponseAsync(resourceGroupName, name, siteExtensionId) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Description for Install site extension on a web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param siteExtensionId Site extension name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return site Extension Information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginInstallSiteExtensionWithoutPollingAsync( - String resourceGroupName, String name, String siteExtensionId, Context context) { - return beginInstallSiteExtensionWithoutPollingWithResponseAsync( - resourceGroupName, name, siteExtensionId, context) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Description for Install site extension on a web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param siteExtensionId Site extension name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return site Extension Information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SiteExtensionInfoInner beginInstallSiteExtensionWithoutPolling( - String resourceGroupName, String name, String siteExtensionId) { - return beginInstallSiteExtensionWithoutPollingAsync(resourceGroupName, name, siteExtensionId).block(); - } - - /** - * Description for Install site extension on a web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param siteExtensionId Site extension name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return site Extension Information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SiteExtensionInfoInner beginInstallSiteExtensionWithoutPolling( - String resourceGroupName, String name, String siteExtensionId, Context context) { - return beginInstallSiteExtensionWithoutPollingAsync(resourceGroupName, name, siteExtensionId, context).block(); - } - - /** - * Description for Copies a deployment slot to another deployment slot of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param copySlotEntity Copy deployment slot parameters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginCopyProductionSlotWithoutPollingWithResponseAsync( - String resourceGroupName, String name, CsmCopySlotEntityInner copySlotEntity) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (copySlotEntity == null) { - return Mono.error(new IllegalArgumentException("Parameter copySlotEntity is required and cannot be null.")); - } else { - copySlotEntity.validate(); - } - return FluxUtil - .withContext( - context -> - service - .beginCopyProductionSlotWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - copySlotEntity, - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Description for Copies a deployment slot to another deployment slot of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param copySlotEntity Copy deployment slot parameters. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginCopyProductionSlotWithoutPollingWithResponseAsync( - String resourceGroupName, String name, CsmCopySlotEntityInner copySlotEntity, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (copySlotEntity == null) { - return Mono.error(new IllegalArgumentException("Parameter copySlotEntity is required and cannot be null.")); - } else { - copySlotEntity.validate(); - } - return service - .beginCopyProductionSlotWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - copySlotEntity, - context); - } - - /** - * Description for Copies a deployment slot to another deployment slot of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param copySlotEntity Copy deployment slot parameters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginCopyProductionSlotWithoutPollingAsync( - String resourceGroupName, String name, CsmCopySlotEntityInner copySlotEntity) { - return beginCopyProductionSlotWithoutPollingWithResponseAsync(resourceGroupName, name, copySlotEntity) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Description for Copies a deployment slot to another deployment slot of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param copySlotEntity Copy deployment slot parameters. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginCopyProductionSlotWithoutPollingAsync( - String resourceGroupName, String name, CsmCopySlotEntityInner copySlotEntity, Context context) { - return beginCopyProductionSlotWithoutPollingWithResponseAsync(resourceGroupName, name, copySlotEntity, context) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Description for Copies a deployment slot to another deployment slot of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param copySlotEntity Copy deployment slot parameters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void beginCopyProductionSlotWithoutPolling( - String resourceGroupName, String name, CsmCopySlotEntityInner copySlotEntity) { - beginCopyProductionSlotWithoutPollingAsync(resourceGroupName, name, copySlotEntity).block(); - } - - /** - * Description for Copies a deployment slot to another deployment slot of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param copySlotEntity Copy deployment slot parameters. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void beginCopyProductionSlotWithoutPolling( - String resourceGroupName, String name, CsmCopySlotEntityInner copySlotEntity, Context context) { - beginCopyProductionSlotWithoutPollingAsync(resourceGroupName, name, copySlotEntity, context).block(); - } - - /** - * Description for Creates a new web, mobile, or API app in an existing resource group, or updates an existing app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Unique name of the app to create or update. To create or update a deployment slot, use the {slot} - * parameter. - * @param slot Name of the deployment slot to create or update. By default, this API attempts to create or modify - * the production slot. - * @param siteEnvelope A web app, a mobile app backend, or an API app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a web app, a mobile app backend, or an API app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginCreateOrUpdateSlotWithoutPollingWithResponseAsync( - String resourceGroupName, String name, String slot, SiteInner siteEnvelope) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (siteEnvelope == null) { - return Mono.error(new IllegalArgumentException("Parameter siteEnvelope is required and cannot be null.")); - } else { - siteEnvelope.validate(); - } - return FluxUtil - .withContext( - context -> - service - .beginCreateOrUpdateSlotWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - siteEnvelope, - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Description for Creates a new web, mobile, or API app in an existing resource group, or updates an existing app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Unique name of the app to create or update. To create or update a deployment slot, use the {slot} - * parameter. - * @param slot Name of the deployment slot to create or update. By default, this API attempts to create or modify - * the production slot. - * @param siteEnvelope A web app, a mobile app backend, or an API app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a web app, a mobile app backend, or an API app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginCreateOrUpdateSlotWithoutPollingWithResponseAsync( - String resourceGroupName, String name, String slot, SiteInner siteEnvelope, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (siteEnvelope == null) { - return Mono.error(new IllegalArgumentException("Parameter siteEnvelope is required and cannot be null.")); - } else { - siteEnvelope.validate(); - } - return service - .beginCreateOrUpdateSlotWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - siteEnvelope, - context); - } - - /** - * Description for Creates a new web, mobile, or API app in an existing resource group, or updates an existing app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Unique name of the app to create or update. To create or update a deployment slot, use the {slot} - * parameter. - * @param slot Name of the deployment slot to create or update. By default, this API attempts to create or modify - * the production slot. - * @param siteEnvelope A web app, a mobile app backend, or an API app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a web app, a mobile app backend, or an API app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginCreateOrUpdateSlotWithoutPollingAsync( - String resourceGroupName, String name, String slot, SiteInner siteEnvelope) { - return beginCreateOrUpdateSlotWithoutPollingWithResponseAsync(resourceGroupName, name, slot, siteEnvelope) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Description for Creates a new web, mobile, or API app in an existing resource group, or updates an existing app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Unique name of the app to create or update. To create or update a deployment slot, use the {slot} - * parameter. - * @param slot Name of the deployment slot to create or update. By default, this API attempts to create or modify - * the production slot. - * @param siteEnvelope A web app, a mobile app backend, or an API app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a web app, a mobile app backend, or an API app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginCreateOrUpdateSlotWithoutPollingAsync( - String resourceGroupName, String name, String slot, SiteInner siteEnvelope, Context context) { - return beginCreateOrUpdateSlotWithoutPollingWithResponseAsync( - resourceGroupName, name, slot, siteEnvelope, context) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Description for Creates a new web, mobile, or API app in an existing resource group, or updates an existing app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Unique name of the app to create or update. To create or update a deployment slot, use the {slot} - * parameter. - * @param slot Name of the deployment slot to create or update. By default, this API attempts to create or modify - * the production slot. - * @param siteEnvelope A web app, a mobile app backend, or an API app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a web app, a mobile app backend, or an API app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SiteInner beginCreateOrUpdateSlotWithoutPolling( - String resourceGroupName, String name, String slot, SiteInner siteEnvelope) { - return beginCreateOrUpdateSlotWithoutPollingAsync(resourceGroupName, name, slot, siteEnvelope).block(); - } - - /** - * Description for Creates a new web, mobile, or API app in an existing resource group, or updates an existing app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Unique name of the app to create or update. To create or update a deployment slot, use the {slot} - * parameter. - * @param slot Name of the deployment slot to create or update. By default, this API attempts to create or modify - * the production slot. - * @param siteEnvelope A web app, a mobile app backend, or an API app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a web app, a mobile app backend, or an API app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SiteInner beginCreateOrUpdateSlotWithoutPolling( - String resourceGroupName, String name, String slot, SiteInner siteEnvelope, Context context) { - return beginCreateOrUpdateSlotWithoutPollingAsync(resourceGroupName, name, slot, siteEnvelope, context).block(); - } - - /** - * Description for Restores a specific backup to another app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param backupId ID of the backup. - * @param slot Name of the deployment slot. If a slot is not specified, the API will restore a backup of the - * production slot. - * @param request Description of a restore request. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginRestoreSlotWithoutPollingWithResponseAsync( - String resourceGroupName, String name, String backupId, String slot, RestoreRequestInner request) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (backupId == null) { - return Mono.error(new IllegalArgumentException("Parameter backupId is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (request == null) { - return Mono.error(new IllegalArgumentException("Parameter request is required and cannot be null.")); - } else { - request.validate(); - } - return FluxUtil - .withContext( - context -> - service - .beginRestoreSlotWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - name, - backupId, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - request, - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Description for Restores a specific backup to another app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param backupId ID of the backup. - * @param slot Name of the deployment slot. If a slot is not specified, the API will restore a backup of the - * production slot. - * @param request Description of a restore request. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginRestoreSlotWithoutPollingWithResponseAsync( - String resourceGroupName, - String name, - String backupId, - String slot, - RestoreRequestInner request, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (backupId == null) { - return Mono.error(new IllegalArgumentException("Parameter backupId is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (request == null) { - return Mono.error(new IllegalArgumentException("Parameter request is required and cannot be null.")); - } else { - request.validate(); - } - return service - .beginRestoreSlotWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - name, - backupId, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - request, - context); - } - - /** - * Description for Restores a specific backup to another app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param backupId ID of the backup. - * @param slot Name of the deployment slot. If a slot is not specified, the API will restore a backup of the - * production slot. - * @param request Description of a restore request. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginRestoreSlotWithoutPollingAsync( - String resourceGroupName, String name, String backupId, String slot, RestoreRequestInner request) { - return beginRestoreSlotWithoutPollingWithResponseAsync(resourceGroupName, name, backupId, slot, request) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Description for Restores a specific backup to another app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param backupId ID of the backup. - * @param slot Name of the deployment slot. If a slot is not specified, the API will restore a backup of the - * production slot. - * @param request Description of a restore request. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginRestoreSlotWithoutPollingAsync( - String resourceGroupName, - String name, - String backupId, - String slot, - RestoreRequestInner request, - Context context) { - return beginRestoreSlotWithoutPollingWithResponseAsync( - resourceGroupName, name, backupId, slot, request, context) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Description for Restores a specific backup to another app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param backupId ID of the backup. - * @param slot Name of the deployment slot. If a slot is not specified, the API will restore a backup of the - * production slot. - * @param request Description of a restore request. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void beginRestoreSlotWithoutPolling( - String resourceGroupName, String name, String backupId, String slot, RestoreRequestInner request) { - beginRestoreSlotWithoutPollingAsync(resourceGroupName, name, backupId, slot, request).block(); - } - - /** - * Description for Restores a specific backup to another app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param backupId ID of the backup. - * @param slot Name of the deployment slot. If a slot is not specified, the API will restore a backup of the - * production slot. - * @param request Description of a restore request. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void beginRestoreSlotWithoutPolling( - String resourceGroupName, - String name, - String backupId, - String slot, - RestoreRequestInner request, - Context context) { - beginRestoreSlotWithoutPollingAsync(resourceGroupName, name, backupId, slot, request, context).block(); - } - - /** - * Description for Gets the Git/FTP publishing credentials of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get the publishing credentials - * for the production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return user credentials used for publishing activity. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginListPublishingCredentialsSlotWithoutPollingWithResponseAsync( - String resourceGroupName, String name, String slot) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - return FluxUtil - .withContext( - context -> - service - .beginListPublishingCredentialsSlotWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Description for Gets the Git/FTP publishing credentials of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get the publishing credentials - * for the production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return user credentials used for publishing activity. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginListPublishingCredentialsSlotWithoutPollingWithResponseAsync( - String resourceGroupName, String name, String slot, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - return service - .beginListPublishingCredentialsSlotWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context); - } - - /** - * Description for Gets the Git/FTP publishing credentials of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get the publishing credentials - * for the production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return user credentials used for publishing activity. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginListPublishingCredentialsSlotWithoutPollingAsync( - String resourceGroupName, String name, String slot) { - return beginListPublishingCredentialsSlotWithoutPollingWithResponseAsync(resourceGroupName, name, slot) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Description for Gets the Git/FTP publishing credentials of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get the publishing credentials - * for the production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return user credentials used for publishing activity. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginListPublishingCredentialsSlotWithoutPollingAsync( - String resourceGroupName, String name, String slot, Context context) { - return beginListPublishingCredentialsSlotWithoutPollingWithResponseAsync(resourceGroupName, name, slot, context) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Description for Gets the Git/FTP publishing credentials of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get the publishing credentials - * for the production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return user credentials used for publishing activity. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public UserInner beginListPublishingCredentialsSlotWithoutPolling( - String resourceGroupName, String name, String slot) { - return beginListPublishingCredentialsSlotWithoutPollingAsync(resourceGroupName, name, slot).block(); - } - - /** - * Description for Gets the Git/FTP publishing credentials of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get the publishing credentials - * for the production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return user credentials used for publishing activity. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public UserInner beginListPublishingCredentialsSlotWithoutPolling( - String resourceGroupName, String name, String slot, Context context) { - return beginListPublishingCredentialsSlotWithoutPollingAsync(resourceGroupName, name, slot, context).block(); - } - - /** - * Description for Invoke the MSDeploy web app extension. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param mSDeploy MSDeploy ARM PUT information. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return mSDeploy ARM response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginCreateMSDeployOperationSlotWithoutPollingWithResponseAsync( - String resourceGroupName, String name, String slot, MSDeploy mSDeploy) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (mSDeploy == null) { - return Mono.error(new IllegalArgumentException("Parameter mSDeploy is required and cannot be null.")); - } else { - mSDeploy.validate(); - } - return FluxUtil - .withContext( - context -> - service - .beginCreateMSDeployOperationSlotWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - mSDeploy, - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Description for Invoke the MSDeploy web app extension. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param mSDeploy MSDeploy ARM PUT information. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return mSDeploy ARM response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginCreateMSDeployOperationSlotWithoutPollingWithResponseAsync( - String resourceGroupName, String name, String slot, MSDeploy mSDeploy, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (mSDeploy == null) { - return Mono.error(new IllegalArgumentException("Parameter mSDeploy is required and cannot be null.")); - } else { - mSDeploy.validate(); - } - return service - .beginCreateMSDeployOperationSlotWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - mSDeploy, - context); - } - - /** - * Description for Invoke the MSDeploy web app extension. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param mSDeploy MSDeploy ARM PUT information. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return mSDeploy ARM response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginCreateMSDeployOperationSlotWithoutPollingAsync( - String resourceGroupName, String name, String slot, MSDeploy mSDeploy) { - return beginCreateMSDeployOperationSlotWithoutPollingWithResponseAsync(resourceGroupName, name, slot, mSDeploy) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Description for Invoke the MSDeploy web app extension. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param mSDeploy MSDeploy ARM PUT information. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return mSDeploy ARM response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginCreateMSDeployOperationSlotWithoutPollingAsync( - String resourceGroupName, String name, String slot, MSDeploy mSDeploy, Context context) { - return beginCreateMSDeployOperationSlotWithoutPollingWithResponseAsync( - resourceGroupName, name, slot, mSDeploy, context) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Description for Invoke the MSDeploy web app extension. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param mSDeploy MSDeploy ARM PUT information. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return mSDeploy ARM response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public MSDeployStatusInner beginCreateMSDeployOperationSlotWithoutPolling( - String resourceGroupName, String name, String slot, MSDeploy mSDeploy) { - return beginCreateMSDeployOperationSlotWithoutPollingAsync(resourceGroupName, name, slot, mSDeploy).block(); - } - - /** - * Description for Invoke the MSDeploy web app extension. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param mSDeploy MSDeploy ARM PUT information. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return mSDeploy ARM response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public MSDeployStatusInner beginCreateMSDeployOperationSlotWithoutPolling( - String resourceGroupName, String name, String slot, MSDeploy mSDeploy, Context context) { - return beginCreateMSDeployOperationSlotWithoutPollingAsync(resourceGroupName, name, slot, mSDeploy, context) - .block(); - } - - /** - * Description for Create function for web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param functionName Function name. - * @param slot Name of the deployment slot. - * @param functionEnvelope Function information. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return function information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginCreateInstanceFunctionSlotWithoutPollingWithResponseAsync( - String resourceGroupName, - String name, - String functionName, - String slot, - FunctionEnvelopeInner functionEnvelope) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (functionName == null) { - return Mono.error(new IllegalArgumentException("Parameter functionName is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (functionEnvelope == null) { - return Mono - .error(new IllegalArgumentException("Parameter functionEnvelope is required and cannot be null.")); - } else { - functionEnvelope.validate(); - } - return FluxUtil - .withContext( - context -> - service - .beginCreateInstanceFunctionSlotWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - name, - functionName, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - functionEnvelope, - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Description for Create function for web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param functionName Function name. - * @param slot Name of the deployment slot. - * @param functionEnvelope Function information. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return function information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginCreateInstanceFunctionSlotWithoutPollingWithResponseAsync( - String resourceGroupName, - String name, - String functionName, - String slot, - FunctionEnvelopeInner functionEnvelope, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (functionName == null) { - return Mono.error(new IllegalArgumentException("Parameter functionName is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (functionEnvelope == null) { - return Mono - .error(new IllegalArgumentException("Parameter functionEnvelope is required and cannot be null.")); - } else { - functionEnvelope.validate(); - } - return service - .beginCreateInstanceFunctionSlotWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - name, - functionName, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - functionEnvelope, - context); - } - - /** - * Description for Create function for web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param functionName Function name. - * @param slot Name of the deployment slot. - * @param functionEnvelope Function information. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return function information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginCreateInstanceFunctionSlotWithoutPollingAsync( - String resourceGroupName, - String name, - String functionName, - String slot, - FunctionEnvelopeInner functionEnvelope) { - return beginCreateInstanceFunctionSlotWithoutPollingWithResponseAsync( - resourceGroupName, name, functionName, slot, functionEnvelope) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Description for Create function for web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param functionName Function name. - * @param slot Name of the deployment slot. - * @param functionEnvelope Function information. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return function information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginCreateInstanceFunctionSlotWithoutPollingAsync( - String resourceGroupName, - String name, - String functionName, - String slot, - FunctionEnvelopeInner functionEnvelope, - Context context) { - return beginCreateInstanceFunctionSlotWithoutPollingWithResponseAsync( - resourceGroupName, name, functionName, slot, functionEnvelope, context) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Description for Create function for web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param functionName Function name. - * @param slot Name of the deployment slot. - * @param functionEnvelope Function information. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return function information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public FunctionEnvelopeInner beginCreateInstanceFunctionSlotWithoutPolling( - String resourceGroupName, - String name, - String functionName, - String slot, - FunctionEnvelopeInner functionEnvelope) { - return beginCreateInstanceFunctionSlotWithoutPollingAsync( - resourceGroupName, name, functionName, slot, functionEnvelope) - .block(); - } - - /** - * Description for Create function for web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param functionName Function name. - * @param slot Name of the deployment slot. - * @param functionEnvelope Function information. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return function information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public FunctionEnvelopeInner beginCreateInstanceFunctionSlotWithoutPolling( - String resourceGroupName, - String name, - String functionName, - String slot, - FunctionEnvelopeInner functionEnvelope, - Context context) { - return beginCreateInstanceFunctionSlotWithoutPollingAsync( - resourceGroupName, name, functionName, slot, functionEnvelope, context) - .block(); - } - - /** - * Description for Invoke the MSDeploy web app extension. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param instanceId ID of web app instance. - * @param mSDeploy MSDeploy ARM PUT information. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return mSDeploy ARM response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginCreateInstanceMSDeployOperationSlotWithoutPollingWithResponseAsync( - String resourceGroupName, String name, String slot, String instanceId, MSDeploy mSDeploy) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (instanceId == null) { - return Mono.error(new IllegalArgumentException("Parameter instanceId is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (mSDeploy == null) { - return Mono.error(new IllegalArgumentException("Parameter mSDeploy is required and cannot be null.")); - } else { - mSDeploy.validate(); - } - return FluxUtil - .withContext( - context -> - service - .beginCreateInstanceMSDeployOperationSlotWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - instanceId, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - mSDeploy, - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Description for Invoke the MSDeploy web app extension. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param instanceId ID of web app instance. - * @param mSDeploy MSDeploy ARM PUT information. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return mSDeploy ARM response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginCreateInstanceMSDeployOperationSlotWithoutPollingWithResponseAsync( - String resourceGroupName, String name, String slot, String instanceId, MSDeploy mSDeploy, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (instanceId == null) { - return Mono.error(new IllegalArgumentException("Parameter instanceId is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (mSDeploy == null) { - return Mono.error(new IllegalArgumentException("Parameter mSDeploy is required and cannot be null.")); - } else { - mSDeploy.validate(); - } - return service - .beginCreateInstanceMSDeployOperationSlotWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - instanceId, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - mSDeploy, - context); - } - - /** - * Description for Invoke the MSDeploy web app extension. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param instanceId ID of web app instance. - * @param mSDeploy MSDeploy ARM PUT information. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return mSDeploy ARM response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginCreateInstanceMSDeployOperationSlotWithoutPollingAsync( - String resourceGroupName, String name, String slot, String instanceId, MSDeploy mSDeploy) { - return beginCreateInstanceMSDeployOperationSlotWithoutPollingWithResponseAsync( - resourceGroupName, name, slot, instanceId, mSDeploy) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Description for Invoke the MSDeploy web app extension. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param instanceId ID of web app instance. - * @param mSDeploy MSDeploy ARM PUT information. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return mSDeploy ARM response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginCreateInstanceMSDeployOperationSlotWithoutPollingAsync( - String resourceGroupName, String name, String slot, String instanceId, MSDeploy mSDeploy, Context context) { - return beginCreateInstanceMSDeployOperationSlotWithoutPollingWithResponseAsync( - resourceGroupName, name, slot, instanceId, mSDeploy, context) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Description for Invoke the MSDeploy web app extension. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param instanceId ID of web app instance. - * @param mSDeploy MSDeploy ARM PUT information. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return mSDeploy ARM response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public MSDeployStatusInner beginCreateInstanceMSDeployOperationSlotWithoutPolling( - String resourceGroupName, String name, String slot, String instanceId, MSDeploy mSDeploy) { - return beginCreateInstanceMSDeployOperationSlotWithoutPollingAsync( - resourceGroupName, name, slot, instanceId, mSDeploy) - .block(); - } - - /** - * Description for Invoke the MSDeploy web app extension. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param instanceId ID of web app instance. - * @param mSDeploy MSDeploy ARM PUT information. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return mSDeploy ARM response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public MSDeployStatusInner beginCreateInstanceMSDeployOperationSlotWithoutPolling( - String resourceGroupName, String name, String slot, String instanceId, MSDeploy mSDeploy, Context context) { - return beginCreateInstanceMSDeployOperationSlotWithoutPollingAsync( - resourceGroupName, name, slot, instanceId, mSDeploy, context) - .block(); - } - - /** - * Description for Start capturing network packets for the site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param slot The name of the slot for this web app. - * @param durationInSeconds The duration to keep capturing in seconds. - * @param maxFrameLength The maximum frame length in bytes (Optional). - * @param sasUrl The Blob URL to store capture file. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return array of NetworkTrace. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginStartWebSiteNetworkTraceOperationSlotWithoutPollingWithResponseAsync( - String resourceGroupName, - String name, - String slot, - Integer durationInSeconds, - Integer maxFrameLength, - String sasUrl) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - return FluxUtil - .withContext( - context -> - service - .beginStartWebSiteNetworkTraceOperationSlotWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - name, - durationInSeconds, - slot, - maxFrameLength, - sasUrl, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Description for Start capturing network packets for the site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param slot The name of the slot for this web app. - * @param durationInSeconds The duration to keep capturing in seconds. - * @param maxFrameLength The maximum frame length in bytes (Optional). - * @param sasUrl The Blob URL to store capture file. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return array of NetworkTrace. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginStartWebSiteNetworkTraceOperationSlotWithoutPollingWithResponseAsync( - String resourceGroupName, - String name, - String slot, - Integer durationInSeconds, - Integer maxFrameLength, - String sasUrl, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - return service - .beginStartWebSiteNetworkTraceOperationSlotWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - name, - durationInSeconds, - slot, - maxFrameLength, - sasUrl, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context); - } - - /** - * Description for Start capturing network packets for the site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param slot The name of the slot for this web app. - * @param durationInSeconds The duration to keep capturing in seconds. - * @param maxFrameLength The maximum frame length in bytes (Optional). - * @param sasUrl The Blob URL to store capture file. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return array of NetworkTrace. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginStartWebSiteNetworkTraceOperationSlotWithoutPollingAsync( - String resourceGroupName, - String name, - String slot, - Integer durationInSeconds, - Integer maxFrameLength, - String sasUrl) { - return beginStartWebSiteNetworkTraceOperationSlotWithoutPollingWithResponseAsync( - resourceGroupName, name, slot, durationInSeconds, maxFrameLength, sasUrl) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Description for Start capturing network packets for the site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param slot The name of the slot for this web app. - * @param durationInSeconds The duration to keep capturing in seconds. - * @param maxFrameLength The maximum frame length in bytes (Optional). - * @param sasUrl The Blob URL to store capture file. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return array of NetworkTrace. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginStartWebSiteNetworkTraceOperationSlotWithoutPollingAsync( - String resourceGroupName, - String name, - String slot, - Integer durationInSeconds, - Integer maxFrameLength, - String sasUrl, - Context context) { - return beginStartWebSiteNetworkTraceOperationSlotWithoutPollingWithResponseAsync( - resourceGroupName, name, slot, durationInSeconds, maxFrameLength, sasUrl, context) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Description for Start capturing network packets for the site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param slot The name of the slot for this web app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return array of NetworkTrace. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginStartWebSiteNetworkTraceOperationSlotWithoutPollingAsync( - String resourceGroupName, String name, String slot) { - final Integer durationInSeconds = null; - final Integer maxFrameLength = null; - final String sasUrl = null; - final Context context = null; - return beginStartWebSiteNetworkTraceOperationSlotWithoutPollingWithResponseAsync( - resourceGroupName, name, slot, durationInSeconds, maxFrameLength, sasUrl) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Description for Start capturing network packets for the site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param slot The name of the slot for this web app. - * @param durationInSeconds The duration to keep capturing in seconds. - * @param maxFrameLength The maximum frame length in bytes (Optional). - * @param sasUrl The Blob URL to store capture file. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return array of NetworkTrace. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Object beginStartWebSiteNetworkTraceOperationSlotWithoutPolling( - String resourceGroupName, - String name, - String slot, - Integer durationInSeconds, - Integer maxFrameLength, - String sasUrl) { - return beginStartWebSiteNetworkTraceOperationSlotWithoutPollingAsync( - resourceGroupName, name, slot, durationInSeconds, maxFrameLength, sasUrl) - .block(); - } - - /** - * Description for Start capturing network packets for the site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param slot The name of the slot for this web app. - * @param durationInSeconds The duration to keep capturing in seconds. - * @param maxFrameLength The maximum frame length in bytes (Optional). - * @param sasUrl The Blob URL to store capture file. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return array of NetworkTrace. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Object beginStartWebSiteNetworkTraceOperationSlotWithoutPolling( - String resourceGroupName, - String name, - String slot, - Integer durationInSeconds, - Integer maxFrameLength, - String sasUrl, - Context context) { - return beginStartWebSiteNetworkTraceOperationSlotWithoutPollingAsync( - resourceGroupName, name, slot, durationInSeconds, maxFrameLength, sasUrl, context) - .block(); - } - - /** - * Description for Start capturing network packets for the site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param slot The name of the slot for this web app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return array of NetworkTrace. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Object beginStartWebSiteNetworkTraceOperationSlotWithoutPolling( - String resourceGroupName, String name, String slot) { - final Integer durationInSeconds = null; - final Integer maxFrameLength = null; - final String sasUrl = null; - final Context context = null; - return beginStartWebSiteNetworkTraceOperationSlotWithoutPollingAsync( - resourceGroupName, name, slot, durationInSeconds, maxFrameLength, sasUrl) - .block(); - } - - /** - * Description for Approves or rejects a private endpoint connection. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the site. - * @param privateEndpointConnectionName The privateEndpointConnectionName parameter. - * @param privateEndpointWrapper Private Endpoint Connection Approval ARM resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return private Endpoint Connection ARM resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> - beginApproveOrRejectPrivateEndpointConnectionWithoutPollingWithResponseAsync( - String resourceGroupName, - String name, - String privateEndpointConnectionName, - PrivateLinkConnectionApprovalRequestResource privateEndpointWrapper) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (privateEndpointConnectionName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter privateEndpointConnectionName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (privateEndpointWrapper == null) { - return Mono - .error( - new IllegalArgumentException("Parameter privateEndpointWrapper is required and cannot be null.")); - } else { - privateEndpointWrapper.validate(); - } - return FluxUtil - .withContext( - context -> - service - .beginApproveOrRejectPrivateEndpointConnectionWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - name, - privateEndpointConnectionName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - privateEndpointWrapper, - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Description for Approves or rejects a private endpoint connection. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the site. - * @param privateEndpointConnectionName The privateEndpointConnectionName parameter. - * @param privateEndpointWrapper Private Endpoint Connection Approval ARM resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return private Endpoint Connection ARM resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> - beginApproveOrRejectPrivateEndpointConnectionWithoutPollingWithResponseAsync( - String resourceGroupName, - String name, - String privateEndpointConnectionName, - PrivateLinkConnectionApprovalRequestResource privateEndpointWrapper, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (privateEndpointConnectionName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter privateEndpointConnectionName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (privateEndpointWrapper == null) { - return Mono - .error( - new IllegalArgumentException("Parameter privateEndpointWrapper is required and cannot be null.")); - } else { - privateEndpointWrapper.validate(); - } - return service - .beginApproveOrRejectPrivateEndpointConnectionWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - name, - privateEndpointConnectionName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - privateEndpointWrapper, - context); - } - - /** - * Description for Approves or rejects a private endpoint connection. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the site. - * @param privateEndpointConnectionName The privateEndpointConnectionName parameter. - * @param privateEndpointWrapper Private Endpoint Connection Approval ARM resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return private Endpoint Connection ARM resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono - beginApproveOrRejectPrivateEndpointConnectionWithoutPollingAsync( - String resourceGroupName, - String name, - String privateEndpointConnectionName, - PrivateLinkConnectionApprovalRequestResource privateEndpointWrapper) { - return beginApproveOrRejectPrivateEndpointConnectionWithoutPollingWithResponseAsync( - resourceGroupName, name, privateEndpointConnectionName, privateEndpointWrapper) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Description for Approves or rejects a private endpoint connection. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the site. - * @param privateEndpointConnectionName The privateEndpointConnectionName parameter. - * @param privateEndpointWrapper Private Endpoint Connection Approval ARM resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return private Endpoint Connection ARM resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono - beginApproveOrRejectPrivateEndpointConnectionWithoutPollingAsync( - String resourceGroupName, - String name, - String privateEndpointConnectionName, - PrivateLinkConnectionApprovalRequestResource privateEndpointWrapper, - Context context) { - return beginApproveOrRejectPrivateEndpointConnectionWithoutPollingWithResponseAsync( - resourceGroupName, name, privateEndpointConnectionName, privateEndpointWrapper, context) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Description for Approves or rejects a private endpoint connection. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the site. - * @param privateEndpointConnectionName The privateEndpointConnectionName parameter. - * @param privateEndpointWrapper Private Endpoint Connection Approval ARM resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return private Endpoint Connection ARM resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PrivateEndpointConnectionResourceInner beginApproveOrRejectPrivateEndpointConnectionWithoutPolling( - String resourceGroupName, - String name, - String privateEndpointConnectionName, - PrivateLinkConnectionApprovalRequestResource privateEndpointWrapper) { - return beginApproveOrRejectPrivateEndpointConnectionWithoutPollingAsync( - resourceGroupName, name, privateEndpointConnectionName, privateEndpointWrapper) - .block(); - } - - /** - * Description for Approves or rejects a private endpoint connection. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the site. - * @param privateEndpointConnectionName The privateEndpointConnectionName parameter. - * @param privateEndpointWrapper Private Endpoint Connection Approval ARM resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return private Endpoint Connection ARM resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PrivateEndpointConnectionResourceInner beginApproveOrRejectPrivateEndpointConnectionWithoutPolling( - String resourceGroupName, - String name, - String privateEndpointConnectionName, - PrivateLinkConnectionApprovalRequestResource privateEndpointWrapper, - Context context) { - return beginApproveOrRejectPrivateEndpointConnectionWithoutPollingAsync( - resourceGroupName, name, privateEndpointConnectionName, privateEndpointWrapper, context) - .block(); - } - - /** - * Description for Deletes a private endpoint connection. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the site. - * @param privateEndpointConnectionName The privateEndpointConnectionName parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return any object. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginDeletePrivateEndpointConnectionWithoutPollingWithResponseAsync( - String resourceGroupName, String name, String privateEndpointConnectionName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (privateEndpointConnectionName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter privateEndpointConnectionName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - return FluxUtil - .withContext( - context -> - service - .beginDeletePrivateEndpointConnectionWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - name, - privateEndpointConnectionName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Description for Deletes a private endpoint connection. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the site. - * @param privateEndpointConnectionName The privateEndpointConnectionName parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return any object. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginDeletePrivateEndpointConnectionWithoutPollingWithResponseAsync( - String resourceGroupName, String name, String privateEndpointConnectionName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (privateEndpointConnectionName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter privateEndpointConnectionName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - return service - .beginDeletePrivateEndpointConnectionWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - name, - privateEndpointConnectionName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context); - } - - /** - * Description for Deletes a private endpoint connection. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the site. - * @param privateEndpointConnectionName The privateEndpointConnectionName parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return any object. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginDeletePrivateEndpointConnectionWithoutPollingAsync( - String resourceGroupName, String name, String privateEndpointConnectionName) { - return beginDeletePrivateEndpointConnectionWithoutPollingWithResponseAsync( - resourceGroupName, name, privateEndpointConnectionName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Description for Deletes a private endpoint connection. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the site. - * @param privateEndpointConnectionName The privateEndpointConnectionName parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return any object. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginDeletePrivateEndpointConnectionWithoutPollingAsync( - String resourceGroupName, String name, String privateEndpointConnectionName, Context context) { - return beginDeletePrivateEndpointConnectionWithoutPollingWithResponseAsync( - resourceGroupName, name, privateEndpointConnectionName, context) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Description for Deletes a private endpoint connection. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the site. - * @param privateEndpointConnectionName The privateEndpointConnectionName parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return any object. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Object beginDeletePrivateEndpointConnectionWithoutPolling( - String resourceGroupName, String name, String privateEndpointConnectionName) { - return beginDeletePrivateEndpointConnectionWithoutPollingAsync( - resourceGroupName, name, privateEndpointConnectionName) - .block(); - } - - /** - * Description for Deletes a private endpoint connection. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the site. - * @param privateEndpointConnectionName The privateEndpointConnectionName parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return any object. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Object beginDeletePrivateEndpointConnectionWithoutPolling( - String resourceGroupName, String name, String privateEndpointConnectionName, Context context) { - return beginDeletePrivateEndpointConnectionWithoutPollingAsync( - resourceGroupName, name, privateEndpointConnectionName, context) - .block(); - } - - /** - * Description for Restores an app from a backup blob in Azure Storage. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will restore a backup of the - * production slot. - * @param request Description of a restore request. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginRestoreFromBackupBlobSlotWithoutPollingWithResponseAsync( - String resourceGroupName, String name, String slot, RestoreRequestInner request) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (request == null) { - return Mono.error(new IllegalArgumentException("Parameter request is required and cannot be null.")); - } else { - request.validate(); - } - return FluxUtil - .withContext( - context -> - service - .beginRestoreFromBackupBlobSlotWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - request, - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Description for Restores an app from a backup blob in Azure Storage. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will restore a backup of the - * production slot. - * @param request Description of a restore request. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginRestoreFromBackupBlobSlotWithoutPollingWithResponseAsync( - String resourceGroupName, String name, String slot, RestoreRequestInner request, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (request == null) { - return Mono.error(new IllegalArgumentException("Parameter request is required and cannot be null.")); - } else { - request.validate(); - } - return service - .beginRestoreFromBackupBlobSlotWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - request, - context); - } - - /** - * Description for Restores an app from a backup blob in Azure Storage. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will restore a backup of the - * production slot. - * @param request Description of a restore request. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginRestoreFromBackupBlobSlotWithoutPollingAsync( - String resourceGroupName, String name, String slot, RestoreRequestInner request) { - return beginRestoreFromBackupBlobSlotWithoutPollingWithResponseAsync(resourceGroupName, name, slot, request) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Description for Restores an app from a backup blob in Azure Storage. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will restore a backup of the - * production slot. - * @param request Description of a restore request. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginRestoreFromBackupBlobSlotWithoutPollingAsync( - String resourceGroupName, String name, String slot, RestoreRequestInner request, Context context) { - return beginRestoreFromBackupBlobSlotWithoutPollingWithResponseAsync( - resourceGroupName, name, slot, request, context) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Description for Restores an app from a backup blob in Azure Storage. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will restore a backup of the - * production slot. - * @param request Description of a restore request. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void beginRestoreFromBackupBlobSlotWithoutPolling( - String resourceGroupName, String name, String slot, RestoreRequestInner request) { - beginRestoreFromBackupBlobSlotWithoutPollingAsync(resourceGroupName, name, slot, request).block(); - } - - /** - * Description for Restores an app from a backup blob in Azure Storage. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will restore a backup of the - * production slot. - * @param request Description of a restore request. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void beginRestoreFromBackupBlobSlotWithoutPolling( - String resourceGroupName, String name, String slot, RestoreRequestInner request, Context context) { - beginRestoreFromBackupBlobSlotWithoutPollingAsync(resourceGroupName, name, slot, request, context).block(); - } - - /** - * Description for Restores a deleted web app to this web app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param restoreRequest Details about restoring a deleted app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginRestoreFromDeletedAppSlotWithoutPollingWithResponseAsync( - String resourceGroupName, String name, String slot, DeletedAppRestoreRequest restoreRequest) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (restoreRequest == null) { - return Mono.error(new IllegalArgumentException("Parameter restoreRequest is required and cannot be null.")); - } else { - restoreRequest.validate(); - } - return FluxUtil - .withContext( - context -> - service - .beginRestoreFromDeletedAppSlotWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - restoreRequest, - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Description for Restores a deleted web app to this web app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param restoreRequest Details about restoring a deleted app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginRestoreFromDeletedAppSlotWithoutPollingWithResponseAsync( - String resourceGroupName, String name, String slot, DeletedAppRestoreRequest restoreRequest, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (restoreRequest == null) { - return Mono.error(new IllegalArgumentException("Parameter restoreRequest is required and cannot be null.")); - } else { - restoreRequest.validate(); - } - return service - .beginRestoreFromDeletedAppSlotWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - restoreRequest, - context); - } - - /** - * Description for Restores a deleted web app to this web app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param restoreRequest Details about restoring a deleted app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginRestoreFromDeletedAppSlotWithoutPollingAsync( - String resourceGroupName, String name, String slot, DeletedAppRestoreRequest restoreRequest) { - return beginRestoreFromDeletedAppSlotWithoutPollingWithResponseAsync( - resourceGroupName, name, slot, restoreRequest) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Description for Restores a deleted web app to this web app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param restoreRequest Details about restoring a deleted app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginRestoreFromDeletedAppSlotWithoutPollingAsync( - String resourceGroupName, String name, String slot, DeletedAppRestoreRequest restoreRequest, Context context) { - return beginRestoreFromDeletedAppSlotWithoutPollingWithResponseAsync( - resourceGroupName, name, slot, restoreRequest, context) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Description for Restores a deleted web app to this web app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param restoreRequest Details about restoring a deleted app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void beginRestoreFromDeletedAppSlotWithoutPolling( - String resourceGroupName, String name, String slot, DeletedAppRestoreRequest restoreRequest) { - beginRestoreFromDeletedAppSlotWithoutPollingAsync(resourceGroupName, name, slot, restoreRequest).block(); - } - - /** - * Description for Restores a deleted web app to this web app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param restoreRequest Details about restoring a deleted app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void beginRestoreFromDeletedAppSlotWithoutPolling( - String resourceGroupName, String name, String slot, DeletedAppRestoreRequest restoreRequest, Context context) { - beginRestoreFromDeletedAppSlotWithoutPollingAsync(resourceGroupName, name, slot, restoreRequest, context) - .block(); - } - - /** - * Description for Restores a web app from a snapshot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param restoreRequest Details about app recovery operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginRestoreSnapshotSlotWithoutPollingWithResponseAsync( - String resourceGroupName, String name, String slot, SnapshotRestoreRequest restoreRequest) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (restoreRequest == null) { - return Mono.error(new IllegalArgumentException("Parameter restoreRequest is required and cannot be null.")); - } else { - restoreRequest.validate(); - } - return FluxUtil - .withContext( - context -> - service - .beginRestoreSnapshotSlotWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - restoreRequest, - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Description for Restores a web app from a snapshot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param restoreRequest Details about app recovery operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginRestoreSnapshotSlotWithoutPollingWithResponseAsync( - String resourceGroupName, String name, String slot, SnapshotRestoreRequest restoreRequest, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (restoreRequest == null) { - return Mono.error(new IllegalArgumentException("Parameter restoreRequest is required and cannot be null.")); - } else { - restoreRequest.validate(); - } - return service - .beginRestoreSnapshotSlotWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - restoreRequest, - context); - } - - /** - * Description for Restores a web app from a snapshot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param restoreRequest Details about app recovery operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginRestoreSnapshotSlotWithoutPollingAsync( - String resourceGroupName, String name, String slot, SnapshotRestoreRequest restoreRequest) { - return beginRestoreSnapshotSlotWithoutPollingWithResponseAsync(resourceGroupName, name, slot, restoreRequest) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Description for Restores a web app from a snapshot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param restoreRequest Details about app recovery operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginRestoreSnapshotSlotWithoutPollingAsync( - String resourceGroupName, String name, String slot, SnapshotRestoreRequest restoreRequest, Context context) { - return beginRestoreSnapshotSlotWithoutPollingWithResponseAsync( - resourceGroupName, name, slot, restoreRequest, context) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Description for Restores a web app from a snapshot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param restoreRequest Details about app recovery operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void beginRestoreSnapshotSlotWithoutPolling( - String resourceGroupName, String name, String slot, SnapshotRestoreRequest restoreRequest) { - beginRestoreSnapshotSlotWithoutPollingAsync(resourceGroupName, name, slot, restoreRequest).block(); - } - - /** - * Description for Restores a web app from a snapshot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param restoreRequest Details about app recovery operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void beginRestoreSnapshotSlotWithoutPolling( - String resourceGroupName, String name, String slot, SnapshotRestoreRequest restoreRequest, Context context) { - beginRestoreSnapshotSlotWithoutPollingAsync(resourceGroupName, name, slot, restoreRequest, context).block(); - } - - /** - * Description for Install site extension on a web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param siteExtensionId Site extension name. - * @param slot Name of the deployment slot. If a slot is not specified, the API uses the production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return site Extension Information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginInstallSiteExtensionSlotWithoutPollingWithResponseAsync( - String resourceGroupName, String name, String siteExtensionId, String slot) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (siteExtensionId == null) { - return Mono - .error(new IllegalArgumentException("Parameter siteExtensionId is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - return FluxUtil - .withContext( - context -> - service - .beginInstallSiteExtensionSlotWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - name, - siteExtensionId, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Description for Install site extension on a web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param siteExtensionId Site extension name. - * @param slot Name of the deployment slot. If a slot is not specified, the API uses the production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return site Extension Information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginInstallSiteExtensionSlotWithoutPollingWithResponseAsync( - String resourceGroupName, String name, String siteExtensionId, String slot, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (siteExtensionId == null) { - return Mono - .error(new IllegalArgumentException("Parameter siteExtensionId is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - return service - .beginInstallSiteExtensionSlotWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - name, - siteExtensionId, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context); - } - - /** - * Description for Install site extension on a web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param siteExtensionId Site extension name. - * @param slot Name of the deployment slot. If a slot is not specified, the API uses the production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return site Extension Information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginInstallSiteExtensionSlotWithoutPollingAsync( - String resourceGroupName, String name, String siteExtensionId, String slot) { - return beginInstallSiteExtensionSlotWithoutPollingWithResponseAsync( - resourceGroupName, name, siteExtensionId, slot) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Description for Install site extension on a web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param siteExtensionId Site extension name. - * @param slot Name of the deployment slot. If a slot is not specified, the API uses the production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return site Extension Information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginInstallSiteExtensionSlotWithoutPollingAsync( - String resourceGroupName, String name, String siteExtensionId, String slot, Context context) { - return beginInstallSiteExtensionSlotWithoutPollingWithResponseAsync( - resourceGroupName, name, siteExtensionId, slot, context) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Description for Install site extension on a web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param siteExtensionId Site extension name. - * @param slot Name of the deployment slot. If a slot is not specified, the API uses the production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return site Extension Information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SiteExtensionInfoInner beginInstallSiteExtensionSlotWithoutPolling( - String resourceGroupName, String name, String siteExtensionId, String slot) { - return beginInstallSiteExtensionSlotWithoutPollingAsync(resourceGroupName, name, siteExtensionId, slot).block(); - } - - /** - * Description for Install site extension on a web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param siteExtensionId Site extension name. - * @param slot Name of the deployment slot. If a slot is not specified, the API uses the production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return site Extension Information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SiteExtensionInfoInner beginInstallSiteExtensionSlotWithoutPolling( - String resourceGroupName, String name, String siteExtensionId, String slot, Context context) { - return beginInstallSiteExtensionSlotWithoutPollingAsync(resourceGroupName, name, siteExtensionId, slot, context) - .block(); - } - - /** - * Description for Copies a deployment slot to another deployment slot of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the source slot. If a slot is not specified, the production slot is used as the source slot. - * @param copySlotEntity Copy deployment slot parameters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginCopySlotWithoutPollingWithResponseAsync( - String resourceGroupName, String name, String slot, CsmCopySlotEntityInner copySlotEntity) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (copySlotEntity == null) { - return Mono.error(new IllegalArgumentException("Parameter copySlotEntity is required and cannot be null.")); - } else { - copySlotEntity.validate(); - } - return FluxUtil - .withContext( - context -> - service - .beginCopySlotWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - copySlotEntity, - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Description for Copies a deployment slot to another deployment slot of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the source slot. If a slot is not specified, the production slot is used as the source slot. - * @param copySlotEntity Copy deployment slot parameters. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginCopySlotWithoutPollingWithResponseAsync( - String resourceGroupName, String name, String slot, CsmCopySlotEntityInner copySlotEntity, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (copySlotEntity == null) { - return Mono.error(new IllegalArgumentException("Parameter copySlotEntity is required and cannot be null.")); - } else { - copySlotEntity.validate(); - } - return service - .beginCopySlotWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - copySlotEntity, - context); - } - - /** - * Description for Copies a deployment slot to another deployment slot of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the source slot. If a slot is not specified, the production slot is used as the source slot. - * @param copySlotEntity Copy deployment slot parameters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginCopySlotWithoutPollingAsync( - String resourceGroupName, String name, String slot, CsmCopySlotEntityInner copySlotEntity) { - return beginCopySlotWithoutPollingWithResponseAsync(resourceGroupName, name, slot, copySlotEntity) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Description for Copies a deployment slot to another deployment slot of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the source slot. If a slot is not specified, the production slot is used as the source slot. - * @param copySlotEntity Copy deployment slot parameters. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginCopySlotWithoutPollingAsync( - String resourceGroupName, String name, String slot, CsmCopySlotEntityInner copySlotEntity, Context context) { - return beginCopySlotWithoutPollingWithResponseAsync(resourceGroupName, name, slot, copySlotEntity, context) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Description for Copies a deployment slot to another deployment slot of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the source slot. If a slot is not specified, the production slot is used as the source slot. - * @param copySlotEntity Copy deployment slot parameters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void beginCopySlotWithoutPolling( - String resourceGroupName, String name, String slot, CsmCopySlotEntityInner copySlotEntity) { - beginCopySlotWithoutPollingAsync(resourceGroupName, name, slot, copySlotEntity).block(); - } - - /** - * Description for Copies a deployment slot to another deployment slot of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the source slot. If a slot is not specified, the production slot is used as the source slot. - * @param copySlotEntity Copy deployment slot parameters. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void beginCopySlotWithoutPolling( - String resourceGroupName, String name, String slot, CsmCopySlotEntityInner copySlotEntity, Context context) { - beginCopySlotWithoutPollingAsync(resourceGroupName, name, slot, copySlotEntity, context).block(); - } - - /** - * Description for Swaps two deployment slots of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the source slot. If a slot is not specified, the production slot is used as the source slot. - * @param slotSwapEntity Deployment slot parameters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginSwapSlotWithoutPollingWithResponseAsync( - String resourceGroupName, String name, String slot, CsmSlotEntity slotSwapEntity) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (slotSwapEntity == null) { - return Mono.error(new IllegalArgumentException("Parameter slotSwapEntity is required and cannot be null.")); - } else { - slotSwapEntity.validate(); - } - return FluxUtil - .withContext( - context -> - service - .beginSwapSlotWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - slotSwapEntity, - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Description for Swaps two deployment slots of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the source slot. If a slot is not specified, the production slot is used as the source slot. - * @param slotSwapEntity Deployment slot parameters. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginSwapSlotWithoutPollingWithResponseAsync( - String resourceGroupName, String name, String slot, CsmSlotEntity slotSwapEntity, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (slotSwapEntity == null) { - return Mono.error(new IllegalArgumentException("Parameter slotSwapEntity is required and cannot be null.")); - } else { - slotSwapEntity.validate(); - } - return service - .beginSwapSlotWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - slotSwapEntity, - context); - } - - /** - * Description for Swaps two deployment slots of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the source slot. If a slot is not specified, the production slot is used as the source slot. - * @param slotSwapEntity Deployment slot parameters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginSwapSlotWithoutPollingAsync( - String resourceGroupName, String name, String slot, CsmSlotEntity slotSwapEntity) { - return beginSwapSlotWithoutPollingWithResponseAsync(resourceGroupName, name, slot, slotSwapEntity) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Description for Swaps two deployment slots of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the source slot. If a slot is not specified, the production slot is used as the source slot. - * @param slotSwapEntity Deployment slot parameters. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginSwapSlotWithoutPollingAsync( - String resourceGroupName, String name, String slot, CsmSlotEntity slotSwapEntity, Context context) { - return beginSwapSlotWithoutPollingWithResponseAsync(resourceGroupName, name, slot, slotSwapEntity, context) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Description for Swaps two deployment slots of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the source slot. If a slot is not specified, the production slot is used as the source slot. - * @param slotSwapEntity Deployment slot parameters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void beginSwapSlotWithoutPolling( - String resourceGroupName, String name, String slot, CsmSlotEntity slotSwapEntity) { - beginSwapSlotWithoutPollingAsync(resourceGroupName, name, slot, slotSwapEntity).block(); - } - - /** - * Description for Swaps two deployment slots of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the source slot. If a slot is not specified, the production slot is used as the source slot. - * @param slotSwapEntity Deployment slot parameters. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void beginSwapSlotWithoutPolling( - String resourceGroupName, String name, String slot, CsmSlotEntity slotSwapEntity, Context context) { - beginSwapSlotWithoutPollingAsync(resourceGroupName, name, slot, slotSwapEntity, context).block(); - } - - /** - * Description for Updates the source control configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will update the source control - * configuration for the production slot. - * @param siteSourceControl Source control configuration for an app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return source control configuration for an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginCreateOrUpdateSourceControlSlotWithoutPollingWithResponseAsync( - String resourceGroupName, String name, String slot, SiteSourceControlInner siteSourceControl) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (siteSourceControl == null) { - return Mono - .error(new IllegalArgumentException("Parameter siteSourceControl is required and cannot be null.")); - } else { - siteSourceControl.validate(); - } - return FluxUtil - .withContext( - context -> - service - .beginCreateOrUpdateSourceControlSlotWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - siteSourceControl, - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Description for Updates the source control configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will update the source control - * configuration for the production slot. - * @param siteSourceControl Source control configuration for an app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return source control configuration for an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginCreateOrUpdateSourceControlSlotWithoutPollingWithResponseAsync( - String resourceGroupName, String name, String slot, SiteSourceControlInner siteSourceControl, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (siteSourceControl == null) { - return Mono - .error(new IllegalArgumentException("Parameter siteSourceControl is required and cannot be null.")); - } else { - siteSourceControl.validate(); - } - return service - .beginCreateOrUpdateSourceControlSlotWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - siteSourceControl, - context); - } - - /** - * Description for Updates the source control configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will update the source control - * configuration for the production slot. - * @param siteSourceControl Source control configuration for an app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return source control configuration for an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginCreateOrUpdateSourceControlSlotWithoutPollingAsync( - String resourceGroupName, String name, String slot, SiteSourceControlInner siteSourceControl) { - return beginCreateOrUpdateSourceControlSlotWithoutPollingWithResponseAsync( - resourceGroupName, name, slot, siteSourceControl) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Description for Updates the source control configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will update the source control - * configuration for the production slot. - * @param siteSourceControl Source control configuration for an app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return source control configuration for an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginCreateOrUpdateSourceControlSlotWithoutPollingAsync( - String resourceGroupName, String name, String slot, SiteSourceControlInner siteSourceControl, Context context) { - return beginCreateOrUpdateSourceControlSlotWithoutPollingWithResponseAsync( - resourceGroupName, name, slot, siteSourceControl, context) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Description for Updates the source control configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will update the source control - * configuration for the production slot. - * @param siteSourceControl Source control configuration for an app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return source control configuration for an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SiteSourceControlInner beginCreateOrUpdateSourceControlSlotWithoutPolling( - String resourceGroupName, String name, String slot, SiteSourceControlInner siteSourceControl) { - return beginCreateOrUpdateSourceControlSlotWithoutPollingAsync(resourceGroupName, name, slot, siteSourceControl) - .block(); - } - - /** - * Description for Updates the source control configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will update the source control - * configuration for the production slot. - * @param siteSourceControl Source control configuration for an app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return source control configuration for an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SiteSourceControlInner beginCreateOrUpdateSourceControlSlotWithoutPolling( - String resourceGroupName, String name, String slot, SiteSourceControlInner siteSourceControl, Context context) { - return beginCreateOrUpdateSourceControlSlotWithoutPollingAsync( - resourceGroupName, name, slot, siteSourceControl, context) - .block(); - } - - /** - * Description for Start capturing network packets for the site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param slot The name of the slot for this web app. - * @param durationInSeconds The duration to keep capturing in seconds. - * @param maxFrameLength The maximum frame length in bytes (Optional). - * @param sasUrl The Blob URL to store capture file. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return array of NetworkTrace. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginStartNetworkTraceSlotWithoutPollingWithResponseAsync( - String resourceGroupName, - String name, - String slot, - Integer durationInSeconds, - Integer maxFrameLength, - String sasUrl) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - return FluxUtil - .withContext( - context -> - service - .beginStartNetworkTraceSlotWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - name, - durationInSeconds, - slot, - maxFrameLength, - sasUrl, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Description for Start capturing network packets for the site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param slot The name of the slot for this web app. - * @param durationInSeconds The duration to keep capturing in seconds. - * @param maxFrameLength The maximum frame length in bytes (Optional). - * @param sasUrl The Blob URL to store capture file. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return array of NetworkTrace. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginStartNetworkTraceSlotWithoutPollingWithResponseAsync( - String resourceGroupName, - String name, - String slot, - Integer durationInSeconds, - Integer maxFrameLength, - String sasUrl, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - return service - .beginStartNetworkTraceSlotWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - name, - durationInSeconds, - slot, - maxFrameLength, - sasUrl, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context); - } - - /** - * Description for Start capturing network packets for the site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param slot The name of the slot for this web app. - * @param durationInSeconds The duration to keep capturing in seconds. - * @param maxFrameLength The maximum frame length in bytes (Optional). - * @param sasUrl The Blob URL to store capture file. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return array of NetworkTrace. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginStartNetworkTraceSlotWithoutPollingAsync( - String resourceGroupName, - String name, - String slot, - Integer durationInSeconds, - Integer maxFrameLength, - String sasUrl) { - return beginStartNetworkTraceSlotWithoutPollingWithResponseAsync( - resourceGroupName, name, slot, durationInSeconds, maxFrameLength, sasUrl) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Description for Start capturing network packets for the site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param slot The name of the slot for this web app. - * @param durationInSeconds The duration to keep capturing in seconds. - * @param maxFrameLength The maximum frame length in bytes (Optional). - * @param sasUrl The Blob URL to store capture file. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return array of NetworkTrace. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginStartNetworkTraceSlotWithoutPollingAsync( - String resourceGroupName, - String name, - String slot, - Integer durationInSeconds, - Integer maxFrameLength, - String sasUrl, - Context context) { - return beginStartNetworkTraceSlotWithoutPollingWithResponseAsync( - resourceGroupName, name, slot, durationInSeconds, maxFrameLength, sasUrl, context) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Description for Start capturing network packets for the site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param slot The name of the slot for this web app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return array of NetworkTrace. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginStartNetworkTraceSlotWithoutPollingAsync( - String resourceGroupName, String name, String slot) { - final Integer durationInSeconds = null; - final Integer maxFrameLength = null; - final String sasUrl = null; - final Context context = null; - return beginStartNetworkTraceSlotWithoutPollingWithResponseAsync( - resourceGroupName, name, slot, durationInSeconds, maxFrameLength, sasUrl) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Description for Start capturing network packets for the site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param slot The name of the slot for this web app. - * @param durationInSeconds The duration to keep capturing in seconds. - * @param maxFrameLength The maximum frame length in bytes (Optional). - * @param sasUrl The Blob URL to store capture file. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return array of NetworkTrace. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Object beginStartNetworkTraceSlotWithoutPolling( - String resourceGroupName, - String name, - String slot, - Integer durationInSeconds, - Integer maxFrameLength, - String sasUrl) { - return beginStartNetworkTraceSlotWithoutPollingAsync( - resourceGroupName, name, slot, durationInSeconds, maxFrameLength, sasUrl) - .block(); - } - - /** - * Description for Start capturing network packets for the site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param slot The name of the slot for this web app. - * @param durationInSeconds The duration to keep capturing in seconds. - * @param maxFrameLength The maximum frame length in bytes (Optional). - * @param sasUrl The Blob URL to store capture file. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return array of NetworkTrace. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Object beginStartNetworkTraceSlotWithoutPolling( - String resourceGroupName, - String name, - String slot, - Integer durationInSeconds, - Integer maxFrameLength, - String sasUrl, - Context context) { - return beginStartNetworkTraceSlotWithoutPollingAsync( - resourceGroupName, name, slot, durationInSeconds, maxFrameLength, sasUrl, context) - .block(); - } - - /** - * Description for Start capturing network packets for the site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param slot The name of the slot for this web app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return array of NetworkTrace. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Object beginStartNetworkTraceSlotWithoutPolling(String resourceGroupName, String name, String slot) { - final Integer durationInSeconds = null; - final Integer maxFrameLength = null; - final String sasUrl = null; - final Context context = null; - return beginStartNetworkTraceSlotWithoutPollingAsync( - resourceGroupName, name, slot, durationInSeconds, maxFrameLength, sasUrl) - .block(); - } - - /** - * Description for Swaps two deployment slots of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slotSwapEntity Deployment slot parameters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginSwapSlotWithProductionWithoutPollingWithResponseAsync( - String resourceGroupName, String name, CsmSlotEntity slotSwapEntity) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (slotSwapEntity == null) { - return Mono.error(new IllegalArgumentException("Parameter slotSwapEntity is required and cannot be null.")); - } else { - slotSwapEntity.validate(); - } - return FluxUtil - .withContext( - context -> - service - .beginSwapSlotWithProductionWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - slotSwapEntity, - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Description for Swaps two deployment slots of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slotSwapEntity Deployment slot parameters. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginSwapSlotWithProductionWithoutPollingWithResponseAsync( - String resourceGroupName, String name, CsmSlotEntity slotSwapEntity, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (slotSwapEntity == null) { - return Mono.error(new IllegalArgumentException("Parameter slotSwapEntity is required and cannot be null.")); - } else { - slotSwapEntity.validate(); - } - return service - .beginSwapSlotWithProductionWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - slotSwapEntity, - context); - } - - /** - * Description for Swaps two deployment slots of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slotSwapEntity Deployment slot parameters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginSwapSlotWithProductionWithoutPollingAsync( - String resourceGroupName, String name, CsmSlotEntity slotSwapEntity) { - return beginSwapSlotWithProductionWithoutPollingWithResponseAsync(resourceGroupName, name, slotSwapEntity) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Description for Swaps two deployment slots of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slotSwapEntity Deployment slot parameters. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginSwapSlotWithProductionWithoutPollingAsync( - String resourceGroupName, String name, CsmSlotEntity slotSwapEntity, Context context) { - return beginSwapSlotWithProductionWithoutPollingWithResponseAsync( - resourceGroupName, name, slotSwapEntity, context) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Description for Swaps two deployment slots of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slotSwapEntity Deployment slot parameters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void beginSwapSlotWithProductionWithoutPolling( - String resourceGroupName, String name, CsmSlotEntity slotSwapEntity) { - beginSwapSlotWithProductionWithoutPollingAsync(resourceGroupName, name, slotSwapEntity).block(); - } - - /** - * Description for Swaps two deployment slots of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slotSwapEntity Deployment slot parameters. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void beginSwapSlotWithProductionWithoutPolling( - String resourceGroupName, String name, CsmSlotEntity slotSwapEntity, Context context) { - beginSwapSlotWithProductionWithoutPollingAsync(resourceGroupName, name, slotSwapEntity, context).block(); - } - - /** - * Description for Updates the source control configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param siteSourceControl Source control configuration for an app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return source control configuration for an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginCreateOrUpdateSourceControlWithoutPollingWithResponseAsync( - String resourceGroupName, String name, SiteSourceControlInner siteSourceControl) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (siteSourceControl == null) { - return Mono - .error(new IllegalArgumentException("Parameter siteSourceControl is required and cannot be null.")); - } else { - siteSourceControl.validate(); - } - return FluxUtil - .withContext( - context -> - service - .beginCreateOrUpdateSourceControlWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - siteSourceControl, - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Description for Updates the source control configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param siteSourceControl Source control configuration for an app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return source control configuration for an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginCreateOrUpdateSourceControlWithoutPollingWithResponseAsync( - String resourceGroupName, String name, SiteSourceControlInner siteSourceControl, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (siteSourceControl == null) { - return Mono - .error(new IllegalArgumentException("Parameter siteSourceControl is required and cannot be null.")); - } else { - siteSourceControl.validate(); - } - return service - .beginCreateOrUpdateSourceControlWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - siteSourceControl, - context); - } - - /** - * Description for Updates the source control configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param siteSourceControl Source control configuration for an app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return source control configuration for an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginCreateOrUpdateSourceControlWithoutPollingAsync( - String resourceGroupName, String name, SiteSourceControlInner siteSourceControl) { - return beginCreateOrUpdateSourceControlWithoutPollingWithResponseAsync( - resourceGroupName, name, siteSourceControl) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Description for Updates the source control configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param siteSourceControl Source control configuration for an app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return source control configuration for an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginCreateOrUpdateSourceControlWithoutPollingAsync( - String resourceGroupName, String name, SiteSourceControlInner siteSourceControl, Context context) { - return beginCreateOrUpdateSourceControlWithoutPollingWithResponseAsync( - resourceGroupName, name, siteSourceControl, context) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Description for Updates the source control configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param siteSourceControl Source control configuration for an app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return source control configuration for an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SiteSourceControlInner beginCreateOrUpdateSourceControlWithoutPolling( - String resourceGroupName, String name, SiteSourceControlInner siteSourceControl) { - return beginCreateOrUpdateSourceControlWithoutPollingAsync(resourceGroupName, name, siteSourceControl).block(); - } - - /** - * Description for Updates the source control configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param siteSourceControl Source control configuration for an app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return source control configuration for an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SiteSourceControlInner beginCreateOrUpdateSourceControlWithoutPolling( - String resourceGroupName, String name, SiteSourceControlInner siteSourceControl, Context context) { - return beginCreateOrUpdateSourceControlWithoutPollingAsync(resourceGroupName, name, siteSourceControl, context) - .block(); - } - - /** - * Description for Start capturing network packets for the site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param durationInSeconds The duration to keep capturing in seconds. - * @param maxFrameLength The maximum frame length in bytes (Optional). - * @param sasUrl The Blob URL to store capture file. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return array of NetworkTrace. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginStartNetworkTraceWithoutPollingWithResponseAsync( - String resourceGroupName, String name, Integer durationInSeconds, Integer maxFrameLength, String sasUrl) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - return FluxUtil - .withContext( - context -> - service - .beginStartNetworkTraceWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - name, - durationInSeconds, - maxFrameLength, - sasUrl, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Description for Start capturing network packets for the site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param durationInSeconds The duration to keep capturing in seconds. - * @param maxFrameLength The maximum frame length in bytes (Optional). - * @param sasUrl The Blob URL to store capture file. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return array of NetworkTrace. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginStartNetworkTraceWithoutPollingWithResponseAsync( - String resourceGroupName, - String name, - Integer durationInSeconds, - Integer maxFrameLength, - String sasUrl, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - return service - .beginStartNetworkTraceWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - name, - durationInSeconds, - maxFrameLength, - sasUrl, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context); - } - - /** - * Description for Start capturing network packets for the site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param durationInSeconds The duration to keep capturing in seconds. - * @param maxFrameLength The maximum frame length in bytes (Optional). - * @param sasUrl The Blob URL to store capture file. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return array of NetworkTrace. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginStartNetworkTraceWithoutPollingAsync( - String resourceGroupName, String name, Integer durationInSeconds, Integer maxFrameLength, String sasUrl) { - return beginStartNetworkTraceWithoutPollingWithResponseAsync( - resourceGroupName, name, durationInSeconds, maxFrameLength, sasUrl) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Description for Start capturing network packets for the site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param durationInSeconds The duration to keep capturing in seconds. - * @param maxFrameLength The maximum frame length in bytes (Optional). - * @param sasUrl The Blob URL to store capture file. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return array of NetworkTrace. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginStartNetworkTraceWithoutPollingAsync( - String resourceGroupName, - String name, - Integer durationInSeconds, - Integer maxFrameLength, - String sasUrl, - Context context) { - return beginStartNetworkTraceWithoutPollingWithResponseAsync( - resourceGroupName, name, durationInSeconds, maxFrameLength, sasUrl, context) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Description for Start capturing network packets for the site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return array of NetworkTrace. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginStartNetworkTraceWithoutPollingAsync(String resourceGroupName, String name) { - final Integer durationInSeconds = null; - final Integer maxFrameLength = null; - final String sasUrl = null; - final Context context = null; - return beginStartNetworkTraceWithoutPollingWithResponseAsync( - resourceGroupName, name, durationInSeconds, maxFrameLength, sasUrl) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Description for Start capturing network packets for the site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param durationInSeconds The duration to keep capturing in seconds. - * @param maxFrameLength The maximum frame length in bytes (Optional). - * @param sasUrl The Blob URL to store capture file. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return array of NetworkTrace. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Object beginStartNetworkTraceWithoutPolling( - String resourceGroupName, String name, Integer durationInSeconds, Integer maxFrameLength, String sasUrl) { - return beginStartNetworkTraceWithoutPollingAsync( - resourceGroupName, name, durationInSeconds, maxFrameLength, sasUrl) - .block(); - } - - /** - * Description for Start capturing network packets for the site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param durationInSeconds The duration to keep capturing in seconds. - * @param maxFrameLength The maximum frame length in bytes (Optional). - * @param sasUrl The Blob URL to store capture file. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return array of NetworkTrace. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Object beginStartNetworkTraceWithoutPolling( - String resourceGroupName, - String name, - Integer durationInSeconds, - Integer maxFrameLength, - String sasUrl, - Context context) { - return beginStartNetworkTraceWithoutPollingAsync( - resourceGroupName, name, durationInSeconds, maxFrameLength, sasUrl, context) - .block(); - } - - /** - * Description for Start capturing network packets for the site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return array of NetworkTrace. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Object beginStartNetworkTraceWithoutPolling(String resourceGroupName, String name) { - final Integer durationInSeconds = null; - final Integer maxFrameLength = null; - final String sasUrl = null; - final Context context = null; - return beginStartNetworkTraceWithoutPollingAsync( - resourceGroupName, name, durationInSeconds, maxFrameLength, sasUrl) - .block(); - } - /** * Get the next page of items. * @@ -88438,6 +82486,7 @@ public Mono> listNextSinglePageAsync(String nextLink, C if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listNext(nextLink, context) .map( @@ -88494,6 +82543,7 @@ public Mono> listByResourceGroupNextSinglePageAsync(Str if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listByResourceGroupNext(nextLink, context) .map( @@ -88550,6 +82600,7 @@ public Mono> listBackupsNextSinglePageAsync(Strin if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listBackupsNext(nextLink, context) .map( @@ -88607,6 +82658,7 @@ public Mono> listConfigurationsNextSingle if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listConfigurationsNext(nextLink, context) .map( @@ -88665,6 +82717,7 @@ public Mono> listConfiguration if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listConfigurationSnapshotInfoNext(nextLink, context) .map( @@ -88722,6 +82775,7 @@ public Mono> listContinuousWebJobsNextSingl if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listContinuousWebJobsNext(nextLink, context) .map( @@ -88778,6 +82832,7 @@ public Mono> listDeploymentsNextSinglePageAsync(S if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listDeploymentsNext(nextLink, context) .map( @@ -88835,6 +82890,7 @@ public Mono> listDomainOwnershipIdentifiersNextSi if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listDomainOwnershipIdentifiersNext(nextLink, context) .map( @@ -88892,6 +82948,7 @@ public Mono> listFunctionsNextSinglePageAsy if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listFunctionsNext(nextLink, context) .map( @@ -88949,6 +83006,7 @@ public Mono> listHostnameBindingsNextSingleP if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listHostnameBindingsNext(nextLink, context) .map( @@ -89006,6 +83064,7 @@ public Mono> listInstanceIdentifiersNextSingleP if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listInstanceIdentifiersNext(nextLink, context) .map( @@ -89063,6 +83122,7 @@ public Mono> listInstanceProcessesNextSinglePage if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listInstanceProcessesNext(nextLink, context) .map( @@ -89120,6 +83180,7 @@ public Mono> listInstanceProcessModulesNex if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listInstanceProcessModulesNext(nextLink, context) .map( @@ -89177,6 +83238,7 @@ public Mono> listInstanceProcessThreadsNex if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listInstanceProcessThreadsNext(nextLink, context) .map( @@ -89233,6 +83295,7 @@ public Mono> listSiteBackupsNextSinglePageAsync(S if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listSiteBackupsNext(nextLink, context) .map( @@ -89290,6 +83353,7 @@ public Mono> listPerfMonCountersNextSinglePa if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listPerfMonCountersNext(nextLink, context) .map( @@ -89346,6 +83410,7 @@ public Mono> listProcessesNextSinglePageAsync(St if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listProcessesNext(nextLink, context) .map( @@ -89403,6 +83468,7 @@ public Mono> listProcessModulesNextSingleP if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listProcessModulesNext(nextLink, context) .map( @@ -89460,6 +83526,7 @@ public Mono> listProcessThreadsNextSingleP if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listProcessThreadsNext(nextLink, context) .map( @@ -89517,6 +83584,7 @@ public Mono> listPublicCertificatesNextSin if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listPublicCertificatesNext(nextLink, context) .map( @@ -89574,6 +83642,7 @@ public Mono> listSiteExtensionsNextSingleP if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listSiteExtensionsNext(nextLink, context) .map( @@ -89630,6 +83699,7 @@ public Mono> listSlotsNextSinglePageAsync(String nextLi if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listSlotsNext(nextLink, context) .map( @@ -89686,6 +83756,7 @@ public Mono> listBackupsSlotNextSinglePageAsync(S if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listBackupsSlotNext(nextLink, context) .map( @@ -89743,6 +83814,7 @@ public Mono> listConfigurationsSlotNextSi if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listConfigurationsSlotNext(nextLink, context) .map( @@ -89801,6 +83873,7 @@ public Mono> listConfiguration if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listConfigurationSnapshotInfoSlotNext(nextLink, context) .map( @@ -89858,6 +83931,7 @@ public Mono> listContinuousWebJobsSlotNextS if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listContinuousWebJobsSlotNext(nextLink, context) .map( @@ -89915,6 +83989,7 @@ public Mono> listDeploymentsSlotNextSinglePageAsy if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listDeploymentsSlotNext(nextLink, context) .map( @@ -89972,6 +84047,7 @@ public Mono> listDomainOwnershipIdentifiersSlotNe if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listDomainOwnershipIdentifiersSlotNext(nextLink, context) .map( @@ -90029,6 +84105,7 @@ public Mono> listInstanceFunctionsSlotNextS if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listInstanceFunctionsSlotNext(nextLink, context) .map( @@ -90086,6 +84163,7 @@ public Mono> listHostnameBindingsSlotNextSin if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listHostnameBindingsSlotNext(nextLink, context) .map( @@ -90143,6 +84221,7 @@ public Mono> listInstanceIdentifiersSlotNextSin if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listInstanceIdentifiersSlotNext(nextLink, context) .map( @@ -90200,6 +84279,7 @@ public Mono> listInstanceProcessesSlotNextSingle if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listInstanceProcessesSlotNext(nextLink, context) .map( @@ -90258,6 +84338,7 @@ public Mono> listInstanceProcessModulesSlo if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listInstanceProcessModulesSlotNext(nextLink, context) .map( @@ -90316,6 +84397,7 @@ public Mono> listInstanceProcessThreadsSlo if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listInstanceProcessThreadsSlotNext(nextLink, context) .map( @@ -90373,6 +84455,7 @@ public Mono> listSiteBackupsSlotNextSinglePageAsy if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listSiteBackupsSlotNext(nextLink, context) .map( @@ -90430,6 +84513,7 @@ public Mono> listPerfMonCountersSlotNextSing if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listPerfMonCountersSlotNext(nextLink, context) .map( @@ -90487,6 +84571,7 @@ public Mono> listProcessesSlotNextSinglePageAsyn if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listProcessesSlotNext(nextLink, context) .map( @@ -90544,6 +84629,7 @@ public Mono> listProcessModulesSlotNextSin if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listProcessModulesSlotNext(nextLink, context) .map( @@ -90601,6 +84687,7 @@ public Mono> listProcessThreadsSlotNextSin if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listProcessThreadsSlotNext(nextLink, context) .map( @@ -90658,6 +84745,7 @@ public Mono> listPublicCertificatesSlotNex if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listPublicCertificatesSlotNext(nextLink, context) .map( @@ -90715,6 +84803,7 @@ public Mono> listSiteExtensionsSlotNextSin if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listSiteExtensionsSlotNext(nextLink, context) .map( @@ -90772,6 +84861,7 @@ public Mono> listSlotDifferencesSlotNextSingl if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listSlotDifferencesSlotNext(nextLink, context) .map( @@ -90828,6 +84918,7 @@ public Mono> listSnapshotsSlotNextSinglePageAsync(S if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listSnapshotsSlotNext(nextLink, context) .map( @@ -90885,6 +84976,7 @@ public Mono> listSnapshotsFromDRSecondarySlotNextSi if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listSnapshotsFromDRSecondarySlotNext(nextLink, context) .map( @@ -90942,6 +85034,7 @@ public Mono> listTriggeredWebJobsSlotNextSin if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listTriggeredWebJobsSlotNext(nextLink, context) .map( @@ -91000,6 +85093,7 @@ public Mono> listTriggeredWebJobHistoryS if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listTriggeredWebJobHistorySlotNext(nextLink, context) .map( @@ -91056,6 +85150,7 @@ public Mono> listUsagesSlotNextSinglePageAsync if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listUsagesSlotNext(nextLink, context) .map( @@ -91112,6 +85207,7 @@ public Mono> listWebJobsSlotNextSinglePageAsync(Strin if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listWebJobsSlotNext(nextLink, context) .map( @@ -91170,6 +85266,7 @@ public Mono> listSlotDifferencesFromProductio if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listSlotDifferencesFromProductionNext(nextLink, context) .map( @@ -91226,6 +85323,7 @@ public Mono> listSnapshotsNextSinglePageAsync(Strin if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listSnapshotsNext(nextLink, context) .map( @@ -91283,6 +85381,7 @@ public Mono> listSnapshotsFromDRSecondaryNextSingle if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listSnapshotsFromDRSecondaryNext(nextLink, context) .map( @@ -91340,6 +85439,7 @@ public Mono> listTriggeredWebJobsNextSingleP if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listTriggeredWebJobsNext(nextLink, context) .map( @@ -91398,6 +85498,7 @@ public Mono> listTriggeredWebJobHistoryN if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listTriggeredWebJobHistoryNext(nextLink, context) .map( @@ -91454,6 +85555,7 @@ public Mono> listUsagesNextSinglePageAsync(Str if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listUsagesNext(nextLink, context) .map( @@ -91510,6 +85612,7 @@ public Mono> listWebJobsNextSinglePageAsync(String ne if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listWebJobsNext(nextLink, context) .map( diff --git a/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/ComputeManagementClient.java b/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/ComputeManagementClient.java index c2c288d7c6fe2..129b08aa11037 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/ComputeManagementClient.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/ComputeManagementClient.java @@ -8,7 +8,6 @@ import com.azure.core.http.HttpPipeline; import com.azure.core.management.AzureEnvironment; import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.resources.fluentcore.AzureServiceClient; import com.azure.resourcemanager.compute.fluent.AvailabilitySetsClient; import com.azure.resourcemanager.compute.fluent.ContainerServicesClient; import com.azure.resourcemanager.compute.fluent.DedicatedHostGroupsClient; @@ -39,6 +38,7 @@ import com.azure.resourcemanager.compute.fluent.VirtualMachineScaleSetsClient; import com.azure.resourcemanager.compute.fluent.VirtualMachineSizesClient; import com.azure.resourcemanager.compute.fluent.VirtualMachinesClient; +import com.azure.resourcemanager.resources.fluentcore.AzureServiceClient; /** Initializes a new instance of the ComputeManagementClient type. */ @ServiceClient(builder = ComputeManagementClientBuilder.class) diff --git a/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/AvailabilitySetsClient.java b/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/AvailabilitySetsClient.java index 97020ea8fd54c..19c7bf0fc60cf 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/AvailabilitySetsClient.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/AvailabilitySetsClient.java @@ -294,6 +294,7 @@ public Mono> createOrUpdateWithResponseAsync( parameters.validate(); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .createOrUpdate( this.client.getEndpoint(), @@ -521,6 +522,7 @@ public Mono> updateWithResponseAsync( parameters.validate(); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .update( this.client.getEndpoint(), @@ -704,6 +706,7 @@ public Mono> deleteWithResponseAsync( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .delete( this.client.getEndpoint(), @@ -859,6 +862,7 @@ public Mono> getByResourceGroupWithResponseAsync( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .getByResourceGroup( this.client.getEndpoint(), @@ -1015,6 +1019,7 @@ public Mono> listSinglePageAsync(String expa "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), expand, context) .map( @@ -1197,6 +1202,7 @@ public Mono> listByResourceGroupSinglePageAs "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .listByResourceGroup( this.client.getEndpoint(), resourceGroupName, apiVersion, this.client.getSubscriptionId(), context) @@ -1361,6 +1367,7 @@ public Mono> listAvailableSizesSinglePage "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .listAvailableSizes( this.client.getEndpoint(), @@ -1490,6 +1497,7 @@ public Mono> listBySubscriptionNextSinglePag if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listBySubscriptionNext(nextLink, context) .map( @@ -1546,6 +1554,7 @@ public Mono> listNextSinglePageAsync(String if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listNext(nextLink, context) .map( diff --git a/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/ContainerServicesClient.java b/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/ContainerServicesClient.java index 3c6731cc10398..623a5a520c332 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/ContainerServicesClient.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/ContainerServicesClient.java @@ -138,35 +138,6 @@ Mono> listByResourceGroup( @PathParam("subscriptionId") String subscriptionId, Context context); - @Headers({"Accept: application/json", "Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService" - + "/containerServices/{containerServiceName}") - @ExpectedResponses({200, 201, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> beginCreateOrUpdateWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("containerServiceName") String containerServiceName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") ContainerServiceInner parameters, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService" - + "/containerServices/{containerServiceName}") - @ExpectedResponses({202, 204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> beginDeleteWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("containerServiceName") String containerServiceName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - Context context); - @Headers({"Accept: application/json", "Content-Type: application/json"}) @Get("{nextLink}") @ExpectedResponses({200}) @@ -246,6 +217,7 @@ public Mono> listSinglePageAsync(Context co "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2017-01-31"; + context = this.client.mergeContext(context); return service .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), context) .map( @@ -411,6 +383,7 @@ public Mono>> createOrUpdateWithResponseAsync( parameters.validate(); } final String apiVersion = "2017-01-31"; + context = this.client.mergeContext(context); return service .createOrUpdate( this.client.getEndpoint(), @@ -518,7 +491,7 @@ public Mono createOrUpdateAsync( String resourceGroupName, String containerServiceName, ContainerServiceInner parameters) { return beginCreateOrUpdateAsync(resourceGroupName, containerServiceName, parameters) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -538,7 +511,7 @@ public Mono createOrUpdateAsync( String resourceGroupName, String containerServiceName, ContainerServiceInner parameters, Context context) { return beginCreateOrUpdateAsync(resourceGroupName, containerServiceName, parameters, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -663,6 +636,7 @@ public Mono> getByResourceGroupWithResponseAsync "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2017-01-31"; + context = this.client.mergeContext(context); return service .getByResourceGroup( this.client.getEndpoint(), @@ -850,6 +824,7 @@ public Mono>> deleteWithResponseAsync( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2017-01-31"; + context = this.client.mergeContext(context); return service .delete( this.client.getEndpoint(), @@ -956,7 +931,7 @@ public SyncPoller, Void> beginDelete( public Mono deleteAsync(String resourceGroupName, String containerServiceName) { return beginDeleteAsync(resourceGroupName, containerServiceName) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -977,7 +952,7 @@ public Mono deleteAsync(String resourceGroupName, String containerServiceN public Mono deleteAsync(String resourceGroupName, String containerServiceName, Context context) { return beginDeleteAsync(resourceGroupName, containerServiceName, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -1099,6 +1074,7 @@ public Mono> listByResourceGroupSinglePageA "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2017-01-31"; + context = this.client.mergeContext(context); return service .listByResourceGroup( this.client.getEndpoint(), resourceGroupName, apiVersion, this.client.getSubscriptionId(), context) @@ -1183,375 +1159,6 @@ public PagedIterable listByResourceGroup(String resourceG return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); } - /** - * Creates or updates a container service with the specified configuration of orchestrator, masters, and agents. - * - * @param resourceGroupName The name of the resource group. - * @param containerServiceName The name of the container service in the specified subscription and resource group. - * @param parameters Container service. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return container service. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginCreateOrUpdateWithoutPollingWithResponseAsync( - String resourceGroupName, String containerServiceName, ContainerServiceInner parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (containerServiceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter containerServiceName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2017-01-31"; - return FluxUtil - .withContext( - context -> - service - .beginCreateOrUpdateWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - containerServiceName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Creates or updates a container service with the specified configuration of orchestrator, masters, and agents. - * - * @param resourceGroupName The name of the resource group. - * @param containerServiceName The name of the container service in the specified subscription and resource group. - * @param parameters Container service. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return container service. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginCreateOrUpdateWithoutPollingWithResponseAsync( - String resourceGroupName, String containerServiceName, ContainerServiceInner parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (containerServiceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter containerServiceName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2017-01-31"; - return service - .beginCreateOrUpdateWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - containerServiceName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - context); - } - - /** - * Creates or updates a container service with the specified configuration of orchestrator, masters, and agents. - * - * @param resourceGroupName The name of the resource group. - * @param containerServiceName The name of the container service in the specified subscription and resource group. - * @param parameters Container service. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return container service. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginCreateOrUpdateWithoutPollingAsync( - String resourceGroupName, String containerServiceName, ContainerServiceInner parameters) { - return beginCreateOrUpdateWithoutPollingWithResponseAsync(resourceGroupName, containerServiceName, parameters) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Creates or updates a container service with the specified configuration of orchestrator, masters, and agents. - * - * @param resourceGroupName The name of the resource group. - * @param containerServiceName The name of the container service in the specified subscription and resource group. - * @param parameters Container service. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return container service. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginCreateOrUpdateWithoutPollingAsync( - String resourceGroupName, String containerServiceName, ContainerServiceInner parameters, Context context) { - return beginCreateOrUpdateWithoutPollingWithResponseAsync( - resourceGroupName, containerServiceName, parameters, context) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Creates or updates a container service with the specified configuration of orchestrator, masters, and agents. - * - * @param resourceGroupName The name of the resource group. - * @param containerServiceName The name of the container service in the specified subscription and resource group. - * @param parameters Container service. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return container service. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ContainerServiceInner beginCreateOrUpdateWithoutPolling( - String resourceGroupName, String containerServiceName, ContainerServiceInner parameters) { - return beginCreateOrUpdateWithoutPollingAsync(resourceGroupName, containerServiceName, parameters).block(); - } - - /** - * Creates or updates a container service with the specified configuration of orchestrator, masters, and agents. - * - * @param resourceGroupName The name of the resource group. - * @param containerServiceName The name of the container service in the specified subscription and resource group. - * @param parameters Container service. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return container service. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ContainerServiceInner beginCreateOrUpdateWithoutPolling( - String resourceGroupName, String containerServiceName, ContainerServiceInner parameters, Context context) { - return beginCreateOrUpdateWithoutPollingAsync(resourceGroupName, containerServiceName, parameters, context) - .block(); - } - - /** - * Deletes the specified container service in the specified subscription and resource group. The operation does not - * delete other resources created as part of creating a container service, including storage accounts, VMs, and - * availability sets. All the other resources created with the container service are part of the same resource group - * and can be deleted individually. - * - * @param resourceGroupName The name of the resource group. - * @param containerServiceName The name of the container service in the specified subscription and resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginDeleteWithoutPollingWithResponseAsync( - String resourceGroupName, String containerServiceName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (containerServiceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter containerServiceName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2017-01-31"; - return FluxUtil - .withContext( - context -> - service - .beginDeleteWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - containerServiceName, - apiVersion, - this.client.getSubscriptionId(), - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Deletes the specified container service in the specified subscription and resource group. The operation does not - * delete other resources created as part of creating a container service, including storage accounts, VMs, and - * availability sets. All the other resources created with the container service are part of the same resource group - * and can be deleted individually. - * - * @param resourceGroupName The name of the resource group. - * @param containerServiceName The name of the container service in the specified subscription and resource group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginDeleteWithoutPollingWithResponseAsync( - String resourceGroupName, String containerServiceName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (containerServiceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter containerServiceName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2017-01-31"; - return service - .beginDeleteWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - containerServiceName, - apiVersion, - this.client.getSubscriptionId(), - context); - } - - /** - * Deletes the specified container service in the specified subscription and resource group. The operation does not - * delete other resources created as part of creating a container service, including storage accounts, VMs, and - * availability sets. All the other resources created with the container service are part of the same resource group - * and can be deleted individually. - * - * @param resourceGroupName The name of the resource group. - * @param containerServiceName The name of the container service in the specified subscription and resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginDeleteWithoutPollingAsync(String resourceGroupName, String containerServiceName) { - return beginDeleteWithoutPollingWithResponseAsync(resourceGroupName, containerServiceName) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Deletes the specified container service in the specified subscription and resource group. The operation does not - * delete other resources created as part of creating a container service, including storage accounts, VMs, and - * availability sets. All the other resources created with the container service are part of the same resource group - * and can be deleted individually. - * - * @param resourceGroupName The name of the resource group. - * @param containerServiceName The name of the container service in the specified subscription and resource group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginDeleteWithoutPollingAsync( - String resourceGroupName, String containerServiceName, Context context) { - return beginDeleteWithoutPollingWithResponseAsync(resourceGroupName, containerServiceName, context) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Deletes the specified container service in the specified subscription and resource group. The operation does not - * delete other resources created as part of creating a container service, including storage accounts, VMs, and - * availability sets. All the other resources created with the container service are part of the same resource group - * and can be deleted individually. - * - * @param resourceGroupName The name of the resource group. - * @param containerServiceName The name of the container service in the specified subscription and resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void beginDeleteWithoutPolling(String resourceGroupName, String containerServiceName) { - beginDeleteWithoutPollingAsync(resourceGroupName, containerServiceName).block(); - } - - /** - * Deletes the specified container service in the specified subscription and resource group. The operation does not - * delete other resources created as part of creating a container service, including storage accounts, VMs, and - * availability sets. All the other resources created with the container service are part of the same resource group - * and can be deleted individually. - * - * @param resourceGroupName The name of the resource group. - * @param containerServiceName The name of the container service in the specified subscription and resource group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void beginDeleteWithoutPolling(String resourceGroupName, String containerServiceName, Context context) { - beginDeleteWithoutPollingAsync(resourceGroupName, containerServiceName, context).block(); - } - /** * Get the next page of items. * @@ -1595,6 +1202,7 @@ public Mono> listNextSinglePageAsync(String if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listNext(nextLink, context) .map( @@ -1652,6 +1260,7 @@ public Mono> listByResourceGroupNextSingleP if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listByResourceGroupNext(nextLink, context) .map( diff --git a/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/DedicatedHostGroupsClient.java b/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/DedicatedHostGroupsClient.java index 724b71cb4cec8..3a3f6019aefba 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/DedicatedHostGroupsClient.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/DedicatedHostGroupsClient.java @@ -264,6 +264,7 @@ public Mono> createOrUpdateWithResponseAsync( parameters.validate(); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .createOrUpdate( this.client.getEndpoint(), @@ -469,6 +470,7 @@ public Mono> updateWithResponseAsync( parameters.validate(); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .update( this.client.getEndpoint(), @@ -650,6 +652,7 @@ public Mono> deleteWithResponseAsync( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .delete( this.client.getEndpoint(), @@ -802,6 +805,7 @@ public Mono> getByResourceGroupWithResponseAsy "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .getByResourceGroup( this.client.getEndpoint(), @@ -973,6 +977,7 @@ public Mono> listByResourceGroupSinglePag "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .listByResourceGroup( this.client.getEndpoint(), resourceGroupName, apiVersion, this.client.getSubscriptionId(), context) @@ -1117,6 +1122,7 @@ public Mono> listSinglePageAsync(Context "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), context) .map( @@ -1232,6 +1238,7 @@ public Mono> listByResourceGroupNextSingl if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listByResourceGroupNext(nextLink, context) .map( @@ -1289,6 +1296,7 @@ public Mono> listBySubscriptionNextSingle if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listBySubscriptionNext(nextLink, context) .map( diff --git a/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/DedicatedHostsClient.java b/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/DedicatedHostsClient.java index 11b802e7e403a..9635c340da219 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/DedicatedHostsClient.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/DedicatedHostsClient.java @@ -146,53 +146,6 @@ Mono> listByHostGroup( @PathParam("subscriptionId") String subscriptionId, Context context); - @Headers({"Accept: application/json", "Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups" - + "/{hostGroupName}/hosts/{hostName}") - @ExpectedResponses({200, 201}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> beginCreateOrUpdateWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("hostGroupName") String hostGroupName, - @PathParam("hostName") String hostname, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") DedicatedHostInner parameters, - Context context); - - @Headers({"Accept: application/json", "Content-Type: application/json"}) - @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups" - + "/{hostGroupName}/hosts/{hostName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> beginUpdateWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("hostGroupName") String hostGroupName, - @PathParam("hostName") String hostname, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") DedicatedHostUpdate parameters, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups" - + "/{hostGroupName}/hosts/{hostName}") - @ExpectedResponses({200, 202, 204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> beginDeleteWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("hostGroupName") String hostGroupName, - @PathParam("hostName") String hostname, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - Context context); - @Headers({"Accept: application/json", "Content-Type: application/json"}) @Get("{nextLink}") @ExpectedResponses({200}) @@ -308,6 +261,7 @@ public Mono>> createOrUpdateWithResponseAsync( parameters.validate(); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .createOrUpdate( this.client.getEndpoint(), @@ -430,7 +384,7 @@ public Mono createOrUpdateAsync( String resourceGroupName, String hostGroupName, String hostname, DedicatedHostInner parameters) { return beginCreateOrUpdateAsync(resourceGroupName, hostGroupName, hostname, parameters) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -455,7 +409,7 @@ public Mono createOrUpdateAsync( Context context) { return beginCreateOrUpdateAsync(resourceGroupName, hostGroupName, hostname, parameters, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -608,6 +562,7 @@ public Mono>> updateWithResponseAsync( parameters.validate(); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .update( this.client.getEndpoint(), @@ -734,7 +689,7 @@ public Mono updateAsync( String resourceGroupName, String hostGroupName, String hostname, DedicatedHostUpdate parameters) { return beginUpdateAsync(resourceGroupName, hostGroupName, hostname, parameters) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -760,7 +715,7 @@ public Mono updateAsync( Context context) { return beginUpdateAsync(resourceGroupName, hostGroupName, hostname, parameters, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -896,6 +851,7 @@ public Mono>> deleteWithResponseAsync( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .delete( this.client.getEndpoint(), @@ -995,7 +951,7 @@ public SyncPoller, Void> beginDelete( public Mono deleteAsync(String resourceGroupName, String hostGroupName, String hostname) { return beginDeleteAsync(resourceGroupName, hostGroupName, hostname) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -1014,7 +970,7 @@ public Mono deleteAsync(String resourceGroupName, String hostGroupName, St public Mono deleteAsync(String resourceGroupName, String hostGroupName, String hostname, Context context) { return beginDeleteAsync(resourceGroupName, hostGroupName, hostname, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -1141,6 +1097,7 @@ public Mono> getWithResponseAsync( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .get( this.client.getEndpoint(), @@ -1379,6 +1336,7 @@ public Mono> listByHostGroupSinglePageAsync( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .listByHostGroup( this.client.getEndpoint(), @@ -1470,619 +1428,6 @@ public PagedIterable listByHostGroup( return new PagedIterable<>(listByHostGroupAsync(resourceGroupName, hostGroupName, context)); } - /** - * Create or update a dedicated host . - * - * @param resourceGroupName The name of the resource group. - * @param hostGroupName The name of the dedicated host group. - * @param hostname The name of the dedicated host . - * @param parameters Specifies information about the Dedicated host. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the Dedicated host. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginCreateOrUpdateWithoutPollingWithResponseAsync( - String resourceGroupName, String hostGroupName, String hostname, DedicatedHostInner parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (hostGroupName == null) { - return Mono.error(new IllegalArgumentException("Parameter hostGroupName is required and cannot be null.")); - } - if (hostname == null) { - return Mono.error(new IllegalArgumentException("Parameter hostname is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2019-12-01"; - return FluxUtil - .withContext( - context -> - service - .beginCreateOrUpdateWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - hostGroupName, - hostname, - apiVersion, - this.client.getSubscriptionId(), - parameters, - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Create or update a dedicated host . - * - * @param resourceGroupName The name of the resource group. - * @param hostGroupName The name of the dedicated host group. - * @param hostname The name of the dedicated host . - * @param parameters Specifies information about the Dedicated host. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the Dedicated host. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginCreateOrUpdateWithoutPollingWithResponseAsync( - String resourceGroupName, - String hostGroupName, - String hostname, - DedicatedHostInner parameters, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (hostGroupName == null) { - return Mono.error(new IllegalArgumentException("Parameter hostGroupName is required and cannot be null.")); - } - if (hostname == null) { - return Mono.error(new IllegalArgumentException("Parameter hostname is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2019-12-01"; - return service - .beginCreateOrUpdateWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - hostGroupName, - hostname, - apiVersion, - this.client.getSubscriptionId(), - parameters, - context); - } - - /** - * Create or update a dedicated host . - * - * @param resourceGroupName The name of the resource group. - * @param hostGroupName The name of the dedicated host group. - * @param hostname The name of the dedicated host . - * @param parameters Specifies information about the Dedicated host. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the Dedicated host. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginCreateOrUpdateWithoutPollingAsync( - String resourceGroupName, String hostGroupName, String hostname, DedicatedHostInner parameters) { - return beginCreateOrUpdateWithoutPollingWithResponseAsync( - resourceGroupName, hostGroupName, hostname, parameters) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Create or update a dedicated host . - * - * @param resourceGroupName The name of the resource group. - * @param hostGroupName The name of the dedicated host group. - * @param hostname The name of the dedicated host . - * @param parameters Specifies information about the Dedicated host. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the Dedicated host. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginCreateOrUpdateWithoutPollingAsync( - String resourceGroupName, - String hostGroupName, - String hostname, - DedicatedHostInner parameters, - Context context) { - return beginCreateOrUpdateWithoutPollingWithResponseAsync( - resourceGroupName, hostGroupName, hostname, parameters, context) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Create or update a dedicated host . - * - * @param resourceGroupName The name of the resource group. - * @param hostGroupName The name of the dedicated host group. - * @param hostname The name of the dedicated host . - * @param parameters Specifies information about the Dedicated host. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the Dedicated host. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public DedicatedHostInner beginCreateOrUpdateWithoutPolling( - String resourceGroupName, String hostGroupName, String hostname, DedicatedHostInner parameters) { - return beginCreateOrUpdateWithoutPollingAsync(resourceGroupName, hostGroupName, hostname, parameters).block(); - } - - /** - * Create or update a dedicated host . - * - * @param resourceGroupName The name of the resource group. - * @param hostGroupName The name of the dedicated host group. - * @param hostname The name of the dedicated host . - * @param parameters Specifies information about the Dedicated host. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the Dedicated host. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public DedicatedHostInner beginCreateOrUpdateWithoutPolling( - String resourceGroupName, - String hostGroupName, - String hostname, - DedicatedHostInner parameters, - Context context) { - return beginCreateOrUpdateWithoutPollingAsync(resourceGroupName, hostGroupName, hostname, parameters, context) - .block(); - } - - /** - * Update an dedicated host . - * - * @param resourceGroupName The name of the resource group. - * @param hostGroupName The name of the dedicated host group. - * @param hostname The name of the dedicated host . - * @param parameters Specifies information about the dedicated host. Only tags, autoReplaceOnFailure and licenseType - * may be updated. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the Dedicated host. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginUpdateWithoutPollingWithResponseAsync( - String resourceGroupName, String hostGroupName, String hostname, DedicatedHostUpdate parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (hostGroupName == null) { - return Mono.error(new IllegalArgumentException("Parameter hostGroupName is required and cannot be null.")); - } - if (hostname == null) { - return Mono.error(new IllegalArgumentException("Parameter hostname is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2019-12-01"; - return FluxUtil - .withContext( - context -> - service - .beginUpdateWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - hostGroupName, - hostname, - apiVersion, - this.client.getSubscriptionId(), - parameters, - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Update an dedicated host . - * - * @param resourceGroupName The name of the resource group. - * @param hostGroupName The name of the dedicated host group. - * @param hostname The name of the dedicated host . - * @param parameters Specifies information about the dedicated host. Only tags, autoReplaceOnFailure and licenseType - * may be updated. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the Dedicated host. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginUpdateWithoutPollingWithResponseAsync( - String resourceGroupName, - String hostGroupName, - String hostname, - DedicatedHostUpdate parameters, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (hostGroupName == null) { - return Mono.error(new IllegalArgumentException("Parameter hostGroupName is required and cannot be null.")); - } - if (hostname == null) { - return Mono.error(new IllegalArgumentException("Parameter hostname is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2019-12-01"; - return service - .beginUpdateWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - hostGroupName, - hostname, - apiVersion, - this.client.getSubscriptionId(), - parameters, - context); - } - - /** - * Update an dedicated host . - * - * @param resourceGroupName The name of the resource group. - * @param hostGroupName The name of the dedicated host group. - * @param hostname The name of the dedicated host . - * @param parameters Specifies information about the dedicated host. Only tags, autoReplaceOnFailure and licenseType - * may be updated. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the Dedicated host. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginUpdateWithoutPollingAsync( - String resourceGroupName, String hostGroupName, String hostname, DedicatedHostUpdate parameters) { - return beginUpdateWithoutPollingWithResponseAsync(resourceGroupName, hostGroupName, hostname, parameters) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Update an dedicated host . - * - * @param resourceGroupName The name of the resource group. - * @param hostGroupName The name of the dedicated host group. - * @param hostname The name of the dedicated host . - * @param parameters Specifies information about the dedicated host. Only tags, autoReplaceOnFailure and licenseType - * may be updated. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the Dedicated host. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginUpdateWithoutPollingAsync( - String resourceGroupName, - String hostGroupName, - String hostname, - DedicatedHostUpdate parameters, - Context context) { - return beginUpdateWithoutPollingWithResponseAsync( - resourceGroupName, hostGroupName, hostname, parameters, context) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Update an dedicated host . - * - * @param resourceGroupName The name of the resource group. - * @param hostGroupName The name of the dedicated host group. - * @param hostname The name of the dedicated host . - * @param parameters Specifies information about the dedicated host. Only tags, autoReplaceOnFailure and licenseType - * may be updated. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the Dedicated host. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public DedicatedHostInner beginUpdateWithoutPolling( - String resourceGroupName, String hostGroupName, String hostname, DedicatedHostUpdate parameters) { - return beginUpdateWithoutPollingAsync(resourceGroupName, hostGroupName, hostname, parameters).block(); - } - - /** - * Update an dedicated host . - * - * @param resourceGroupName The name of the resource group. - * @param hostGroupName The name of the dedicated host group. - * @param hostname The name of the dedicated host . - * @param parameters Specifies information about the dedicated host. Only tags, autoReplaceOnFailure and licenseType - * may be updated. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the Dedicated host. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public DedicatedHostInner beginUpdateWithoutPolling( - String resourceGroupName, - String hostGroupName, - String hostname, - DedicatedHostUpdate parameters, - Context context) { - return beginUpdateWithoutPollingAsync(resourceGroupName, hostGroupName, hostname, parameters, context).block(); - } - - /** - * Delete a dedicated host. - * - * @param resourceGroupName The name of the resource group. - * @param hostGroupName The name of the dedicated host group. - * @param hostname The name of the dedicated host. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginDeleteWithoutPollingWithResponseAsync( - String resourceGroupName, String hostGroupName, String hostname) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (hostGroupName == null) { - return Mono.error(new IllegalArgumentException("Parameter hostGroupName is required and cannot be null.")); - } - if (hostname == null) { - return Mono.error(new IllegalArgumentException("Parameter hostname is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2019-12-01"; - return FluxUtil - .withContext( - context -> - service - .beginDeleteWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - hostGroupName, - hostname, - apiVersion, - this.client.getSubscriptionId(), - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Delete a dedicated host. - * - * @param resourceGroupName The name of the resource group. - * @param hostGroupName The name of the dedicated host group. - * @param hostname The name of the dedicated host. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginDeleteWithoutPollingWithResponseAsync( - String resourceGroupName, String hostGroupName, String hostname, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (hostGroupName == null) { - return Mono.error(new IllegalArgumentException("Parameter hostGroupName is required and cannot be null.")); - } - if (hostname == null) { - return Mono.error(new IllegalArgumentException("Parameter hostname is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2019-12-01"; - return service - .beginDeleteWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - hostGroupName, - hostname, - apiVersion, - this.client.getSubscriptionId(), - context); - } - - /** - * Delete a dedicated host. - * - * @param resourceGroupName The name of the resource group. - * @param hostGroupName The name of the dedicated host group. - * @param hostname The name of the dedicated host. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginDeleteWithoutPollingAsync(String resourceGroupName, String hostGroupName, String hostname) { - return beginDeleteWithoutPollingWithResponseAsync(resourceGroupName, hostGroupName, hostname) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Delete a dedicated host. - * - * @param resourceGroupName The name of the resource group. - * @param hostGroupName The name of the dedicated host group. - * @param hostname The name of the dedicated host. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginDeleteWithoutPollingAsync( - String resourceGroupName, String hostGroupName, String hostname, Context context) { - return beginDeleteWithoutPollingWithResponseAsync(resourceGroupName, hostGroupName, hostname, context) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Delete a dedicated host. - * - * @param resourceGroupName The name of the resource group. - * @param hostGroupName The name of the dedicated host group. - * @param hostname The name of the dedicated host. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void beginDeleteWithoutPolling(String resourceGroupName, String hostGroupName, String hostname) { - beginDeleteWithoutPollingAsync(resourceGroupName, hostGroupName, hostname).block(); - } - - /** - * Delete a dedicated host. - * - * @param resourceGroupName The name of the resource group. - * @param hostGroupName The name of the dedicated host group. - * @param hostname The name of the dedicated host. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void beginDeleteWithoutPolling( - String resourceGroupName, String hostGroupName, String hostname, Context context) { - beginDeleteWithoutPollingAsync(resourceGroupName, hostGroupName, hostname, context).block(); - } - /** * Get the next page of items. * @@ -2127,6 +1472,7 @@ public Mono> listByHostGroupNextSinglePageAsyn if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listByHostGroupNext(nextLink, context) .map( diff --git a/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/DiskEncryptionSetsClient.java b/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/DiskEncryptionSetsClient.java index ce206fd2d93ad..24e8473f7c324 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/DiskEncryptionSetsClient.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/DiskEncryptionSetsClient.java @@ -155,50 +155,6 @@ Mono> list( @QueryParam("api-version") String apiVersion, Context context); - @Headers({"Accept: application/json", "Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" - + "/diskEncryptionSets/{diskEncryptionSetName}") - @ExpectedResponses({200, 201}) - @UnexpectedResponseExceptionType(ApiErrorException.class) - Mono> beginCreateOrUpdateWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("diskEncryptionSetName") String diskEncryptionSetName, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") DiskEncryptionSetInner diskEncryptionSet, - Context context); - - @Headers({"Accept: application/json", "Content-Type: application/json"}) - @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" - + "/diskEncryptionSets/{diskEncryptionSetName}") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ApiErrorException.class) - Mono> beginUpdateWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("diskEncryptionSetName") String diskEncryptionSetName, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") DiskEncryptionSetUpdate diskEncryptionSet, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" - + "/diskEncryptionSets/{diskEncryptionSetName}") - @ExpectedResponses({200, 202, 204}) - @UnexpectedResponseExceptionType(ApiErrorException.class) - Mono> beginDeleteWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("diskEncryptionSetName") String diskEncryptionSetName, - @QueryParam("api-version") String apiVersion, - Context context); - @Headers({"Accept: application/json", "Content-Type: application/json"}) @Get("{nextLink}") @ExpectedResponses({200}) @@ -319,6 +275,7 @@ public Mono>> createOrUpdateWithResponseAsync( diskEncryptionSet.validate(); } final String apiVersion = "2019-11-01"; + context = this.client.mergeContext(context); return service .createOrUpdate( this.client.getEndpoint(), @@ -443,7 +400,7 @@ public Mono createOrUpdateAsync( String resourceGroupName, String diskEncryptionSetName, DiskEncryptionSetInner diskEncryptionSet) { return beginCreateOrUpdateAsync(resourceGroupName, diskEncryptionSetName, diskEncryptionSet) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -468,7 +425,7 @@ public Mono createOrUpdateAsync( Context context) { return beginCreateOrUpdateAsync(resourceGroupName, diskEncryptionSetName, diskEncryptionSet, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -618,6 +575,7 @@ public Mono>> updateWithResponseAsync( diskEncryptionSet.validate(); } final String apiVersion = "2019-11-01"; + context = this.client.mergeContext(context); return service .update( this.client.getEndpoint(), @@ -741,7 +699,7 @@ public Mono updateAsync( String resourceGroupName, String diskEncryptionSetName, DiskEncryptionSetUpdate diskEncryptionSet) { return beginUpdateAsync(resourceGroupName, diskEncryptionSetName, diskEncryptionSet) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -766,7 +724,7 @@ public Mono updateAsync( Context context) { return beginUpdateAsync(resourceGroupName, diskEncryptionSetName, diskEncryptionSet, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -898,6 +856,7 @@ public Mono> getByResourceGroupWithResponseAsyn .error(new IllegalArgumentException("Parameter diskEncryptionSetName is required and cannot be null.")); } final String apiVersion = "2019-11-01"; + context = this.client.mergeContext(context); return service .getByResourceGroup( this.client.getEndpoint(), @@ -1084,6 +1043,7 @@ public Mono>> deleteWithResponseAsync( .error(new IllegalArgumentException("Parameter diskEncryptionSetName is required and cannot be null.")); } final String apiVersion = "2019-11-01"; + context = this.client.mergeContext(context); return service .delete( this.client.getEndpoint(), @@ -1185,7 +1145,7 @@ public SyncPoller, Void> beginDelete( public Mono deleteAsync(String resourceGroupName, String diskEncryptionSetName) { return beginDeleteAsync(resourceGroupName, diskEncryptionSetName) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -1205,7 +1165,7 @@ public Mono deleteAsync(String resourceGroupName, String diskEncryptionSet public Mono deleteAsync(String resourceGroupName, String diskEncryptionSetName, Context context) { return beginDeleteAsync(resourceGroupName, diskEncryptionSetName, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -1321,6 +1281,7 @@ public Mono> listByResourceGroupSinglePage .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } final String apiVersion = "2019-11-01"; + context = this.client.mergeContext(context); return service .listByResourceGroup( this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, apiVersion, context) @@ -1459,6 +1420,7 @@ public Mono> listSinglePageAsync(Context c "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2019-11-01"; + context = this.client.mergeContext(context); return service .list(this.client.getEndpoint(), this.client.getSubscriptionId(), apiVersion, context) .map( @@ -1524,613 +1486,6 @@ public PagedIterable list(Context context) { return new PagedIterable<>(listAsync(context)); } - /** - * Creates or updates a disk encryption set. - * - * @param resourceGroupName The name of the resource group. - * @param diskEncryptionSetName The name of the disk encryption set that is being created. The name can't be changed - * after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The - * maximum name length is 80 characters. - * @param diskEncryptionSet disk encryption set 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. - * @return disk encryption set resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginCreateOrUpdateWithoutPollingWithResponseAsync( - String resourceGroupName, String diskEncryptionSetName, DiskEncryptionSetInner diskEncryptionSet) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (diskEncryptionSetName == null) { - return Mono - .error(new IllegalArgumentException("Parameter diskEncryptionSetName is required and cannot be null.")); - } - if (diskEncryptionSet == null) { - return Mono - .error(new IllegalArgumentException("Parameter diskEncryptionSet is required and cannot be null.")); - } else { - diskEncryptionSet.validate(); - } - final String apiVersion = "2019-11-01"; - return FluxUtil - .withContext( - context -> - service - .beginCreateOrUpdateWithoutPolling( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - diskEncryptionSetName, - apiVersion, - diskEncryptionSet, - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Creates or updates a disk encryption set. - * - * @param resourceGroupName The name of the resource group. - * @param diskEncryptionSetName The name of the disk encryption set that is being created. The name can't be changed - * after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The - * maximum name length is 80 characters. - * @param diskEncryptionSet disk encryption set resource. - * @param context The context to associate with this 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 disk encryption set resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginCreateOrUpdateWithoutPollingWithResponseAsync( - String resourceGroupName, - String diskEncryptionSetName, - DiskEncryptionSetInner diskEncryptionSet, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (diskEncryptionSetName == null) { - return Mono - .error(new IllegalArgumentException("Parameter diskEncryptionSetName is required and cannot be null.")); - } - if (diskEncryptionSet == null) { - return Mono - .error(new IllegalArgumentException("Parameter diskEncryptionSet is required and cannot be null.")); - } else { - diskEncryptionSet.validate(); - } - final String apiVersion = "2019-11-01"; - return service - .beginCreateOrUpdateWithoutPolling( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - diskEncryptionSetName, - apiVersion, - diskEncryptionSet, - context); - } - - /** - * Creates or updates a disk encryption set. - * - * @param resourceGroupName The name of the resource group. - * @param diskEncryptionSetName The name of the disk encryption set that is being created. The name can't be changed - * after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The - * maximum name length is 80 characters. - * @param diskEncryptionSet disk encryption set 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. - * @return disk encryption set resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginCreateOrUpdateWithoutPollingAsync( - String resourceGroupName, String diskEncryptionSetName, DiskEncryptionSetInner diskEncryptionSet) { - return beginCreateOrUpdateWithoutPollingWithResponseAsync( - resourceGroupName, diskEncryptionSetName, diskEncryptionSet) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Creates or updates a disk encryption set. - * - * @param resourceGroupName The name of the resource group. - * @param diskEncryptionSetName The name of the disk encryption set that is being created. The name can't be changed - * after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The - * maximum name length is 80 characters. - * @param diskEncryptionSet disk encryption set resource. - * @param context The context to associate with this 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 disk encryption set resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginCreateOrUpdateWithoutPollingAsync( - String resourceGroupName, - String diskEncryptionSetName, - DiskEncryptionSetInner diskEncryptionSet, - Context context) { - return beginCreateOrUpdateWithoutPollingWithResponseAsync( - resourceGroupName, diskEncryptionSetName, diskEncryptionSet, context) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Creates or updates a disk encryption set. - * - * @param resourceGroupName The name of the resource group. - * @param diskEncryptionSetName The name of the disk encryption set that is being created. The name can't be changed - * after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The - * maximum name length is 80 characters. - * @param diskEncryptionSet disk encryption set 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. - * @return disk encryption set resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public DiskEncryptionSetInner beginCreateOrUpdateWithoutPolling( - String resourceGroupName, String diskEncryptionSetName, DiskEncryptionSetInner diskEncryptionSet) { - return beginCreateOrUpdateWithoutPollingAsync(resourceGroupName, diskEncryptionSetName, diskEncryptionSet) - .block(); - } - - /** - * Creates or updates a disk encryption set. - * - * @param resourceGroupName The name of the resource group. - * @param diskEncryptionSetName The name of the disk encryption set that is being created. The name can't be changed - * after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The - * maximum name length is 80 characters. - * @param diskEncryptionSet disk encryption set resource. - * @param context The context to associate with this 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 disk encryption set resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public DiskEncryptionSetInner beginCreateOrUpdateWithoutPolling( - String resourceGroupName, - String diskEncryptionSetName, - DiskEncryptionSetInner diskEncryptionSet, - Context context) { - return beginCreateOrUpdateWithoutPollingAsync( - resourceGroupName, diskEncryptionSetName, diskEncryptionSet, context) - .block(); - } - - /** - * Updates (patches) a disk encryption set. - * - * @param resourceGroupName The name of the resource group. - * @param diskEncryptionSetName The name of the disk encryption set that is being created. The name can't be changed - * after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The - * maximum name length is 80 characters. - * @param diskEncryptionSet disk encryption set update 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. - * @return disk encryption set resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginUpdateWithoutPollingWithResponseAsync( - String resourceGroupName, String diskEncryptionSetName, DiskEncryptionSetUpdate diskEncryptionSet) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (diskEncryptionSetName == null) { - return Mono - .error(new IllegalArgumentException("Parameter diskEncryptionSetName is required and cannot be null.")); - } - if (diskEncryptionSet == null) { - return Mono - .error(new IllegalArgumentException("Parameter diskEncryptionSet is required and cannot be null.")); - } else { - diskEncryptionSet.validate(); - } - final String apiVersion = "2019-11-01"; - return FluxUtil - .withContext( - context -> - service - .beginUpdateWithoutPolling( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - diskEncryptionSetName, - apiVersion, - diskEncryptionSet, - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Updates (patches) a disk encryption set. - * - * @param resourceGroupName The name of the resource group. - * @param diskEncryptionSetName The name of the disk encryption set that is being created. The name can't be changed - * after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The - * maximum name length is 80 characters. - * @param diskEncryptionSet disk encryption set update resource. - * @param context The context to associate with this 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 disk encryption set resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginUpdateWithoutPollingWithResponseAsync( - String resourceGroupName, - String diskEncryptionSetName, - DiskEncryptionSetUpdate diskEncryptionSet, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (diskEncryptionSetName == null) { - return Mono - .error(new IllegalArgumentException("Parameter diskEncryptionSetName is required and cannot be null.")); - } - if (diskEncryptionSet == null) { - return Mono - .error(new IllegalArgumentException("Parameter diskEncryptionSet is required and cannot be null.")); - } else { - diskEncryptionSet.validate(); - } - final String apiVersion = "2019-11-01"; - return service - .beginUpdateWithoutPolling( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - diskEncryptionSetName, - apiVersion, - diskEncryptionSet, - context); - } - - /** - * Updates (patches) a disk encryption set. - * - * @param resourceGroupName The name of the resource group. - * @param diskEncryptionSetName The name of the disk encryption set that is being created. The name can't be changed - * after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The - * maximum name length is 80 characters. - * @param diskEncryptionSet disk encryption set update 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. - * @return disk encryption set resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginUpdateWithoutPollingAsync( - String resourceGroupName, String diskEncryptionSetName, DiskEncryptionSetUpdate diskEncryptionSet) { - return beginUpdateWithoutPollingWithResponseAsync(resourceGroupName, diskEncryptionSetName, diskEncryptionSet) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Updates (patches) a disk encryption set. - * - * @param resourceGroupName The name of the resource group. - * @param diskEncryptionSetName The name of the disk encryption set that is being created. The name can't be changed - * after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The - * maximum name length is 80 characters. - * @param diskEncryptionSet disk encryption set update resource. - * @param context The context to associate with this 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 disk encryption set resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginUpdateWithoutPollingAsync( - String resourceGroupName, - String diskEncryptionSetName, - DiskEncryptionSetUpdate diskEncryptionSet, - Context context) { - return beginUpdateWithoutPollingWithResponseAsync( - resourceGroupName, diskEncryptionSetName, diskEncryptionSet, context) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Updates (patches) a disk encryption set. - * - * @param resourceGroupName The name of the resource group. - * @param diskEncryptionSetName The name of the disk encryption set that is being created. The name can't be changed - * after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The - * maximum name length is 80 characters. - * @param diskEncryptionSet disk encryption set update 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. - * @return disk encryption set resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public DiskEncryptionSetInner beginUpdateWithoutPolling( - String resourceGroupName, String diskEncryptionSetName, DiskEncryptionSetUpdate diskEncryptionSet) { - return beginUpdateWithoutPollingAsync(resourceGroupName, diskEncryptionSetName, diskEncryptionSet).block(); - } - - /** - * Updates (patches) a disk encryption set. - * - * @param resourceGroupName The name of the resource group. - * @param diskEncryptionSetName The name of the disk encryption set that is being created. The name can't be changed - * after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The - * maximum name length is 80 characters. - * @param diskEncryptionSet disk encryption set update resource. - * @param context The context to associate with this 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 disk encryption set resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public DiskEncryptionSetInner beginUpdateWithoutPolling( - String resourceGroupName, - String diskEncryptionSetName, - DiskEncryptionSetUpdate diskEncryptionSet, - Context context) { - return beginUpdateWithoutPollingAsync(resourceGroupName, diskEncryptionSetName, diskEncryptionSet, context) - .block(); - } - - /** - * Deletes a disk encryption set. - * - * @param resourceGroupName The name of the resource group. - * @param diskEncryptionSetName The name of the disk encryption set that is being created. The name can't be changed - * after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The - * maximum name length is 80 characters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginDeleteWithoutPollingWithResponseAsync( - String resourceGroupName, String diskEncryptionSetName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (diskEncryptionSetName == null) { - return Mono - .error(new IllegalArgumentException("Parameter diskEncryptionSetName is required and cannot be null.")); - } - final String apiVersion = "2019-11-01"; - return FluxUtil - .withContext( - context -> - service - .beginDeleteWithoutPolling( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - diskEncryptionSetName, - apiVersion, - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Deletes a disk encryption set. - * - * @param resourceGroupName The name of the resource group. - * @param diskEncryptionSetName The name of the disk encryption set that is being created. The name can't be changed - * after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The - * maximum name length is 80 characters. - * @param context The context to associate with this 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 completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginDeleteWithoutPollingWithResponseAsync( - String resourceGroupName, String diskEncryptionSetName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (diskEncryptionSetName == null) { - return Mono - .error(new IllegalArgumentException("Parameter diskEncryptionSetName is required and cannot be null.")); - } - final String apiVersion = "2019-11-01"; - return service - .beginDeleteWithoutPolling( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - diskEncryptionSetName, - apiVersion, - context); - } - - /** - * Deletes a disk encryption set. - * - * @param resourceGroupName The name of the resource group. - * @param diskEncryptionSetName The name of the disk encryption set that is being created. The name can't be changed - * after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The - * maximum name length is 80 characters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginDeleteWithoutPollingAsync(String resourceGroupName, String diskEncryptionSetName) { - return beginDeleteWithoutPollingWithResponseAsync(resourceGroupName, diskEncryptionSetName) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Deletes a disk encryption set. - * - * @param resourceGroupName The name of the resource group. - * @param diskEncryptionSetName The name of the disk encryption set that is being created. The name can't be changed - * after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The - * maximum name length is 80 characters. - * @param context The context to associate with this 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 completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginDeleteWithoutPollingAsync( - String resourceGroupName, String diskEncryptionSetName, Context context) { - return beginDeleteWithoutPollingWithResponseAsync(resourceGroupName, diskEncryptionSetName, context) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Deletes a disk encryption set. - * - * @param resourceGroupName The name of the resource group. - * @param diskEncryptionSetName The name of the disk encryption set that is being created. The name can't be changed - * after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The - * maximum name length is 80 characters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void beginDeleteWithoutPolling(String resourceGroupName, String diskEncryptionSetName) { - beginDeleteWithoutPollingAsync(resourceGroupName, diskEncryptionSetName).block(); - } - - /** - * Deletes a disk encryption set. - * - * @param resourceGroupName The name of the resource group. - * @param diskEncryptionSetName The name of the disk encryption set that is being created. The name can't be changed - * after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The - * maximum name length is 80 characters. - * @param context The context to associate with this 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. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void beginDeleteWithoutPolling(String resourceGroupName, String diskEncryptionSetName, Context context) { - beginDeleteWithoutPollingAsync(resourceGroupName, diskEncryptionSetName, context).block(); - } - /** * Get the next page of items. * @@ -2175,6 +1530,7 @@ public Mono> listByResourceGroupNextSingle if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listByResourceGroupNext(nextLink, context) .map( @@ -2231,6 +1587,7 @@ public Mono> listNextSinglePageAsync(Strin if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listNext(nextLink, context) .map( diff --git a/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/DisksClient.java b/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/DisksClient.java index fa403cb03caf0..1795861ee990e 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/DisksClient.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/DisksClient.java @@ -182,79 +182,6 @@ Mono>> revokeAccess( @QueryParam("api-version") String apiVersion, Context context); - @Headers({"Accept: application/json", "Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks" - + "/{diskName}") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> beginCreateOrUpdateWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("diskName") String diskName, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") DiskInner disk, - Context context); - - @Headers({"Accept: application/json", "Content-Type: application/json"}) - @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks" - + "/{diskName}") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> beginUpdateWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("diskName") String diskName, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") DiskUpdate disk, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks" - + "/{diskName}") - @ExpectedResponses({200, 202, 204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> beginDeleteWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("diskName") String diskName, - @QueryParam("api-version") String apiVersion, - Context context); - - @Headers({"Accept: application/json", "Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks" - + "/{diskName}/beginGetAccess") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> beginGrantAccessWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("diskName") String diskName, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") GrantAccessData grantAccessData, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks" - + "/{diskName}/endGetAccess") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> beginRevokeAccessWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("diskName") String diskName, - @QueryParam("api-version") String apiVersion, - Context context); - @Headers({"Accept: application/json", "Content-Type: application/json"}) @Get("{nextLink}") @ExpectedResponses({200}) @@ -366,6 +293,7 @@ public Mono>> createOrUpdateWithResponseAsync( disk.validate(); } final String apiVersion = "2019-11-01"; + context = this.client.mergeContext(context); return service .createOrUpdate( this.client.getEndpoint(), @@ -476,7 +404,7 @@ public SyncPoller, DiskInner> beginCreateOrUpdate( public Mono createOrUpdateAsync(String resourceGroupName, String diskName, DiskInner disk) { return beginCreateOrUpdateAsync(resourceGroupName, diskName, disk) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -497,7 +425,7 @@ public Mono createOrUpdateAsync( String resourceGroupName, String diskName, DiskInner disk, Context context) { return beginCreateOrUpdateAsync(resourceGroupName, diskName, disk, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -631,6 +559,7 @@ public Mono>> updateWithResponseAsync( disk.validate(); } final String apiVersion = "2019-11-01"; + context = this.client.mergeContext(context); return service .update( this.client.getEndpoint(), @@ -738,7 +667,9 @@ public SyncPoller, DiskInner> beginUpdate( */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono updateAsync(String resourceGroupName, String diskName, DiskUpdate disk) { - return beginUpdateAsync(resourceGroupName, diskName, disk).last().flatMap(client::getLroFinalResultOrError); + return beginUpdateAsync(resourceGroupName, diskName, disk) + .last() + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -758,7 +689,7 @@ public Mono updateAsync(String resourceGroupName, String diskName, Di public Mono updateAsync(String resourceGroupName, String diskName, DiskUpdate disk, Context context) { return beginUpdateAsync(resourceGroupName, diskName, disk, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -878,6 +809,7 @@ public Mono> getByResourceGroupWithResponseAsync( return Mono.error(new IllegalArgumentException("Parameter diskName is required and cannot be null.")); } final String apiVersion = "2019-11-01"; + context = this.client.mergeContext(context); return service .getByResourceGroup( this.client.getEndpoint(), @@ -1052,6 +984,7 @@ public Mono>> deleteWithResponseAsync( return Mono.error(new IllegalArgumentException("Parameter diskName is required and cannot be null.")); } final String apiVersion = "2019-11-01"; + context = this.client.mergeContext(context); return service .delete( this.client.getEndpoint(), @@ -1144,7 +1077,7 @@ public SyncPoller, Void> beginDelete(String resourceGroupName, */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono deleteAsync(String resourceGroupName, String diskName) { - return beginDeleteAsync(resourceGroupName, diskName).last().flatMap(client::getLroFinalResultOrError); + return beginDeleteAsync(resourceGroupName, diskName).last().flatMap(this.client::getLroFinalResultOrError); } /** @@ -1161,7 +1094,9 @@ public Mono deleteAsync(String resourceGroupName, String diskName) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono deleteAsync(String resourceGroupName, String diskName, Context context) { - return beginDeleteAsync(resourceGroupName, diskName, context).last().flatMap(client::getLroFinalResultOrError); + return beginDeleteAsync(resourceGroupName, diskName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -1275,6 +1210,7 @@ public Mono> listByResourceGroupSinglePageAsync( .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } final String apiVersion = "2019-11-01"; + context = this.client.mergeContext(context); return service .listByResourceGroup( this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, apiVersion, context) @@ -1413,6 +1349,7 @@ public Mono> listSinglePageAsync(Context context) { "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2019-11-01"; + context = this.client.mergeContext(context); return service .list(this.client.getEndpoint(), this.client.getSubscriptionId(), apiVersion, context) .map( @@ -1576,6 +1513,7 @@ public Mono>> grantAccessWithResponseAsync( grantAccessData.validate(); } final String apiVersion = "2019-11-01"; + context = this.client.mergeContext(context); return service .grantAccess( this.client.getEndpoint(), @@ -1688,7 +1626,7 @@ public Mono grantAccessAsync( String resourceGroupName, String diskName, GrantAccessData grantAccessData) { return beginGrantAccessAsync(resourceGroupName, diskName, grantAccessData) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -1709,7 +1647,7 @@ public Mono grantAccessAsync( String resourceGroupName, String diskName, GrantAccessData grantAccessData, Context context) { return beginGrantAccessAsync(resourceGroupName, diskName, grantAccessData, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -1830,6 +1768,7 @@ public Mono>> revokeAccessWithResponseAsync( return Mono.error(new IllegalArgumentException("Parameter diskName is required and cannot be null.")); } final String apiVersion = "2019-11-01"; + context = this.client.mergeContext(context); return service .revokeAccess( this.client.getEndpoint(), @@ -1923,7 +1862,9 @@ public SyncPoller, Void> beginRevokeAccess( */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono revokeAccessAsync(String resourceGroupName, String diskName) { - return beginRevokeAccessAsync(resourceGroupName, diskName).last().flatMap(client::getLroFinalResultOrError); + return beginRevokeAccessAsync(resourceGroupName, diskName) + .last() + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -1942,7 +1883,7 @@ public Mono revokeAccessAsync(String resourceGroupName, String diskName) { public Mono revokeAccessAsync(String resourceGroupName, String diskName, Context context) { return beginRevokeAccessAsync(resourceGroupName, diskName, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -1976,913 +1917,6 @@ public void revokeAccess(String resourceGroupName, String diskName, Context cont revokeAccessAsync(resourceGroupName, diskName, context).block(); } - /** - * Creates or updates a disk. - * - * @param resourceGroupName The name of the resource group. - * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is - * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. - * @param disk Disk resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return disk resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginCreateOrUpdateWithoutPollingWithResponseAsync( - String resourceGroupName, String diskName, DiskInner disk) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (diskName == null) { - return Mono.error(new IllegalArgumentException("Parameter diskName is required and cannot be null.")); - } - if (disk == null) { - return Mono.error(new IllegalArgumentException("Parameter disk is required and cannot be null.")); - } else { - disk.validate(); - } - final String apiVersion = "2019-11-01"; - return FluxUtil - .withContext( - context -> - service - .beginCreateOrUpdateWithoutPolling( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - diskName, - apiVersion, - disk, - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Creates or updates a disk. - * - * @param resourceGroupName The name of the resource group. - * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is - * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. - * @param disk Disk resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return disk resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginCreateOrUpdateWithoutPollingWithResponseAsync( - String resourceGroupName, String diskName, DiskInner disk, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (diskName == null) { - return Mono.error(new IllegalArgumentException("Parameter diskName is required and cannot be null.")); - } - if (disk == null) { - return Mono.error(new IllegalArgumentException("Parameter disk is required and cannot be null.")); - } else { - disk.validate(); - } - final String apiVersion = "2019-11-01"; - return service - .beginCreateOrUpdateWithoutPolling( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - diskName, - apiVersion, - disk, - context); - } - - /** - * Creates or updates a disk. - * - * @param resourceGroupName The name of the resource group. - * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is - * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. - * @param disk Disk resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return disk resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginCreateOrUpdateWithoutPollingAsync( - String resourceGroupName, String diskName, DiskInner disk) { - return beginCreateOrUpdateWithoutPollingWithResponseAsync(resourceGroupName, diskName, disk) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Creates or updates a disk. - * - * @param resourceGroupName The name of the resource group. - * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is - * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. - * @param disk Disk resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return disk resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginCreateOrUpdateWithoutPollingAsync( - String resourceGroupName, String diskName, DiskInner disk, Context context) { - return beginCreateOrUpdateWithoutPollingWithResponseAsync(resourceGroupName, diskName, disk, context) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Creates or updates a disk. - * - * @param resourceGroupName The name of the resource group. - * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is - * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. - * @param disk Disk resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return disk resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public DiskInner beginCreateOrUpdateWithoutPolling(String resourceGroupName, String diskName, DiskInner disk) { - return beginCreateOrUpdateWithoutPollingAsync(resourceGroupName, diskName, disk).block(); - } - - /** - * Creates or updates a disk. - * - * @param resourceGroupName The name of the resource group. - * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is - * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. - * @param disk Disk resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return disk resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public DiskInner beginCreateOrUpdateWithoutPolling( - String resourceGroupName, String diskName, DiskInner disk, Context context) { - return beginCreateOrUpdateWithoutPollingAsync(resourceGroupName, diskName, disk, context).block(); - } - - /** - * Updates (patches) a disk. - * - * @param resourceGroupName The name of the resource group. - * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is - * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. - * @param disk Disk update resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return disk resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginUpdateWithoutPollingWithResponseAsync( - String resourceGroupName, String diskName, DiskUpdate disk) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (diskName == null) { - return Mono.error(new IllegalArgumentException("Parameter diskName is required and cannot be null.")); - } - if (disk == null) { - return Mono.error(new IllegalArgumentException("Parameter disk is required and cannot be null.")); - } else { - disk.validate(); - } - final String apiVersion = "2019-11-01"; - return FluxUtil - .withContext( - context -> - service - .beginUpdateWithoutPolling( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - diskName, - apiVersion, - disk, - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Updates (patches) a disk. - * - * @param resourceGroupName The name of the resource group. - * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is - * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. - * @param disk Disk update resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return disk resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginUpdateWithoutPollingWithResponseAsync( - String resourceGroupName, String diskName, DiskUpdate disk, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (diskName == null) { - return Mono.error(new IllegalArgumentException("Parameter diskName is required and cannot be null.")); - } - if (disk == null) { - return Mono.error(new IllegalArgumentException("Parameter disk is required and cannot be null.")); - } else { - disk.validate(); - } - final String apiVersion = "2019-11-01"; - return service - .beginUpdateWithoutPolling( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - diskName, - apiVersion, - disk, - context); - } - - /** - * Updates (patches) a disk. - * - * @param resourceGroupName The name of the resource group. - * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is - * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. - * @param disk Disk update resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return disk resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginUpdateWithoutPollingAsync(String resourceGroupName, String diskName, DiskUpdate disk) { - return beginUpdateWithoutPollingWithResponseAsync(resourceGroupName, diskName, disk) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Updates (patches) a disk. - * - * @param resourceGroupName The name of the resource group. - * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is - * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. - * @param disk Disk update resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return disk resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginUpdateWithoutPollingAsync( - String resourceGroupName, String diskName, DiskUpdate disk, Context context) { - return beginUpdateWithoutPollingWithResponseAsync(resourceGroupName, diskName, disk, context) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Updates (patches) a disk. - * - * @param resourceGroupName The name of the resource group. - * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is - * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. - * @param disk Disk update resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return disk resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public DiskInner beginUpdateWithoutPolling(String resourceGroupName, String diskName, DiskUpdate disk) { - return beginUpdateWithoutPollingAsync(resourceGroupName, diskName, disk).block(); - } - - /** - * Updates (patches) a disk. - * - * @param resourceGroupName The name of the resource group. - * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is - * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. - * @param disk Disk update resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return disk resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public DiskInner beginUpdateWithoutPolling( - String resourceGroupName, String diskName, DiskUpdate disk, Context context) { - return beginUpdateWithoutPollingAsync(resourceGroupName, diskName, disk, context).block(); - } - - /** - * Deletes a disk. - * - * @param resourceGroupName The name of the resource group. - * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is - * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginDeleteWithoutPollingWithResponseAsync(String resourceGroupName, String diskName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (diskName == null) { - return Mono.error(new IllegalArgumentException("Parameter diskName is required and cannot be null.")); - } - final String apiVersion = "2019-11-01"; - return FluxUtil - .withContext( - context -> - service - .beginDeleteWithoutPolling( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - diskName, - apiVersion, - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Deletes a disk. - * - * @param resourceGroupName The name of the resource group. - * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is - * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginDeleteWithoutPollingWithResponseAsync( - String resourceGroupName, String diskName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (diskName == null) { - return Mono.error(new IllegalArgumentException("Parameter diskName is required and cannot be null.")); - } - final String apiVersion = "2019-11-01"; - return service - .beginDeleteWithoutPolling( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - diskName, - apiVersion, - context); - } - - /** - * Deletes a disk. - * - * @param resourceGroupName The name of the resource group. - * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is - * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginDeleteWithoutPollingAsync(String resourceGroupName, String diskName) { - return beginDeleteWithoutPollingWithResponseAsync(resourceGroupName, diskName) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Deletes a disk. - * - * @param resourceGroupName The name of the resource group. - * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is - * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginDeleteWithoutPollingAsync(String resourceGroupName, String diskName, Context context) { - return beginDeleteWithoutPollingWithResponseAsync(resourceGroupName, diskName, context) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Deletes a disk. - * - * @param resourceGroupName The name of the resource group. - * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is - * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void beginDeleteWithoutPolling(String resourceGroupName, String diskName) { - beginDeleteWithoutPollingAsync(resourceGroupName, diskName).block(); - } - - /** - * Deletes a disk. - * - * @param resourceGroupName The name of the resource group. - * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is - * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void beginDeleteWithoutPolling(String resourceGroupName, String diskName, Context context) { - beginDeleteWithoutPollingAsync(resourceGroupName, diskName, context).block(); - } - - /** - * Grants access to a disk. - * - * @param resourceGroupName The name of the resource group. - * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is - * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. - * @param grantAccessData Data used for requesting a SAS. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a disk access SAS uri. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginGrantAccessWithoutPollingWithResponseAsync( - String resourceGroupName, String diskName, GrantAccessData grantAccessData) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (diskName == null) { - return Mono.error(new IllegalArgumentException("Parameter diskName is required and cannot be null.")); - } - if (grantAccessData == null) { - return Mono - .error(new IllegalArgumentException("Parameter grantAccessData is required and cannot be null.")); - } else { - grantAccessData.validate(); - } - final String apiVersion = "2019-11-01"; - return FluxUtil - .withContext( - context -> - service - .beginGrantAccessWithoutPolling( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - diskName, - apiVersion, - grantAccessData, - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Grants access to a disk. - * - * @param resourceGroupName The name of the resource group. - * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is - * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. - * @param grantAccessData Data used for requesting a SAS. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a disk access SAS uri. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginGrantAccessWithoutPollingWithResponseAsync( - String resourceGroupName, String diskName, GrantAccessData grantAccessData, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (diskName == null) { - return Mono.error(new IllegalArgumentException("Parameter diskName is required and cannot be null.")); - } - if (grantAccessData == null) { - return Mono - .error(new IllegalArgumentException("Parameter grantAccessData is required and cannot be null.")); - } else { - grantAccessData.validate(); - } - final String apiVersion = "2019-11-01"; - return service - .beginGrantAccessWithoutPolling( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - diskName, - apiVersion, - grantAccessData, - context); - } - - /** - * Grants access to a disk. - * - * @param resourceGroupName The name of the resource group. - * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is - * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. - * @param grantAccessData Data used for requesting a SAS. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a disk access SAS uri. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginGrantAccessWithoutPollingAsync( - String resourceGroupName, String diskName, GrantAccessData grantAccessData) { - return beginGrantAccessWithoutPollingWithResponseAsync(resourceGroupName, diskName, grantAccessData) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Grants access to a disk. - * - * @param resourceGroupName The name of the resource group. - * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is - * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. - * @param grantAccessData Data used for requesting a SAS. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a disk access SAS uri. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginGrantAccessWithoutPollingAsync( - String resourceGroupName, String diskName, GrantAccessData grantAccessData, Context context) { - return beginGrantAccessWithoutPollingWithResponseAsync(resourceGroupName, diskName, grantAccessData, context) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Grants access to a disk. - * - * @param resourceGroupName The name of the resource group. - * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is - * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. - * @param grantAccessData Data used for requesting a SAS. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a disk access SAS uri. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public AccessUriInner beginGrantAccessWithoutPolling( - String resourceGroupName, String diskName, GrantAccessData grantAccessData) { - return beginGrantAccessWithoutPollingAsync(resourceGroupName, diskName, grantAccessData).block(); - } - - /** - * Grants access to a disk. - * - * @param resourceGroupName The name of the resource group. - * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is - * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. - * @param grantAccessData Data used for requesting a SAS. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a disk access SAS uri. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public AccessUriInner beginGrantAccessWithoutPolling( - String resourceGroupName, String diskName, GrantAccessData grantAccessData, Context context) { - return beginGrantAccessWithoutPollingAsync(resourceGroupName, diskName, grantAccessData, context).block(); - } - - /** - * Revokes access to a disk. - * - * @param resourceGroupName The name of the resource group. - * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is - * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginRevokeAccessWithoutPollingWithResponseAsync( - String resourceGroupName, String diskName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (diskName == null) { - return Mono.error(new IllegalArgumentException("Parameter diskName is required and cannot be null.")); - } - final String apiVersion = "2019-11-01"; - return FluxUtil - .withContext( - context -> - service - .beginRevokeAccessWithoutPolling( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - diskName, - apiVersion, - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Revokes access to a disk. - * - * @param resourceGroupName The name of the resource group. - * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is - * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginRevokeAccessWithoutPollingWithResponseAsync( - String resourceGroupName, String diskName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (diskName == null) { - return Mono.error(new IllegalArgumentException("Parameter diskName is required and cannot be null.")); - } - final String apiVersion = "2019-11-01"; - return service - .beginRevokeAccessWithoutPolling( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - diskName, - apiVersion, - context); - } - - /** - * Revokes access to a disk. - * - * @param resourceGroupName The name of the resource group. - * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is - * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginRevokeAccessWithoutPollingAsync(String resourceGroupName, String diskName) { - return beginRevokeAccessWithoutPollingWithResponseAsync(resourceGroupName, diskName) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Revokes access to a disk. - * - * @param resourceGroupName The name of the resource group. - * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is - * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginRevokeAccessWithoutPollingAsync(String resourceGroupName, String diskName, Context context) { - return beginRevokeAccessWithoutPollingWithResponseAsync(resourceGroupName, diskName, context) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Revokes access to a disk. - * - * @param resourceGroupName The name of the resource group. - * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is - * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void beginRevokeAccessWithoutPolling(String resourceGroupName, String diskName) { - beginRevokeAccessWithoutPollingAsync(resourceGroupName, diskName).block(); - } - - /** - * Revokes access to a disk. - * - * @param resourceGroupName The name of the resource group. - * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is - * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void beginRevokeAccessWithoutPolling(String resourceGroupName, String diskName, Context context) { - beginRevokeAccessWithoutPollingAsync(resourceGroupName, diskName, context).block(); - } - /** * Get the next page of items. * @@ -2926,6 +1960,7 @@ public Mono> listByResourceGroupNextSinglePageAsync(Str if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listByResourceGroupNext(nextLink, context) .map( @@ -2982,6 +2017,7 @@ public Mono> listNextSinglePageAsync(String nextLink, C if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listNext(nextLink, context) .map( diff --git a/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/GalleriesClient.java b/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/GalleriesClient.java index 98839c6f9ff39..52d07399997a6 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/GalleriesClient.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/GalleriesClient.java @@ -151,50 +151,6 @@ Mono> list( @QueryParam("api-version") String apiVersion, Context context); - @Headers({"Accept: application/json", "Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries" - + "/{galleryName}") - @ExpectedResponses({200, 201, 202}) - @UnexpectedResponseExceptionType(ApiErrorException.class) - Mono> beginCreateOrUpdateWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("galleryName") String galleryName, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") GalleryInner gallery, - Context context); - - @Headers({"Accept: application/json", "Content-Type: application/json"}) - @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries" - + "/{galleryName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ApiErrorException.class) - Mono> beginUpdateWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("galleryName") String galleryName, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") GalleryUpdate gallery, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries" - + "/{galleryName}") - @ExpectedResponses({200, 202, 204}) - @UnexpectedResponseExceptionType(ApiErrorException.class) - Mono> beginDeleteWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("galleryName") String galleryName, - @QueryParam("api-version") String apiVersion, - Context context); - @Headers({"Accept: application/json", "Content-Type: application/json"}) @Get("{nextLink}") @ExpectedResponses({200}) @@ -306,6 +262,7 @@ public Mono>> createOrUpdateWithResponseAsync( gallery.validate(); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .createOrUpdate( this.client.getEndpoint(), @@ -417,7 +374,7 @@ public SyncPoller, GalleryInner> beginCreateOrUpdate( public Mono createOrUpdateAsync(String resourceGroupName, String galleryName, GalleryInner gallery) { return beginCreateOrUpdateAsync(resourceGroupName, galleryName, gallery) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -438,7 +395,7 @@ public Mono createOrUpdateAsync( String resourceGroupName, String galleryName, GalleryInner gallery, Context context) { return beginCreateOrUpdateAsync(resourceGroupName, galleryName, gallery, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -573,6 +530,7 @@ public Mono>> updateWithResponseAsync( gallery.validate(); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .update( this.client.getEndpoint(), @@ -683,7 +641,7 @@ public SyncPoller, GalleryInner> beginUpdate( public Mono updateAsync(String resourceGroupName, String galleryName, GalleryUpdate gallery) { return beginUpdateAsync(resourceGroupName, galleryName, gallery) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -704,7 +662,7 @@ public Mono updateAsync( String resourceGroupName, String galleryName, GalleryUpdate gallery, Context context) { return beginUpdateAsync(resourceGroupName, galleryName, gallery, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -823,6 +781,7 @@ public Mono> getByResourceGroupWithResponseAsync( return Mono.error(new IllegalArgumentException("Parameter galleryName is required and cannot be null.")); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .getByResourceGroup( this.client.getEndpoint(), @@ -991,6 +950,7 @@ public Mono>> deleteWithResponseAsync( return Mono.error(new IllegalArgumentException("Parameter galleryName is required and cannot be null.")); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .delete( this.client.getEndpoint(), @@ -1079,7 +1039,7 @@ public SyncPoller, Void> beginDelete( */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono deleteAsync(String resourceGroupName, String galleryName) { - return beginDeleteAsync(resourceGroupName, galleryName).last().flatMap(client::getLroFinalResultOrError); + return beginDeleteAsync(resourceGroupName, galleryName).last().flatMap(this.client::getLroFinalResultOrError); } /** @@ -1097,7 +1057,7 @@ public Mono deleteAsync(String resourceGroupName, String galleryName) { public Mono deleteAsync(String resourceGroupName, String galleryName, Context context) { return beginDeleteAsync(resourceGroupName, galleryName, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -1209,6 +1169,7 @@ public Mono> listByResourceGroupSinglePageAsync( .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .listByResourceGroup( this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, apiVersion, context) @@ -1347,6 +1308,7 @@ public Mono> listSinglePageAsync(Context context) { "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .list(this.client.getEndpoint(), this.client.getSubscriptionId(), apiVersion, context) .map( @@ -1412,552 +1374,6 @@ public PagedIterable list(Context context) { return new PagedIterable<>(listAsync(context)); } - /** - * Create or update a Shared Image Gallery. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery. The allowed characters are alphabets and numbers with - * dots and periods allowed in the middle. The maximum length is 80 characters. - * @param gallery Specifies information about the Shared Image Gallery that you want to create or update. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the Shared Image Gallery that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginCreateOrUpdateWithoutPollingWithResponseAsync( - String resourceGroupName, String galleryName, GalleryInner gallery) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (galleryName == null) { - return Mono.error(new IllegalArgumentException("Parameter galleryName is required and cannot be null.")); - } - if (gallery == null) { - return Mono.error(new IllegalArgumentException("Parameter gallery is required and cannot be null.")); - } else { - gallery.validate(); - } - final String apiVersion = "2019-12-01"; - return FluxUtil - .withContext( - context -> - service - .beginCreateOrUpdateWithoutPolling( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - galleryName, - apiVersion, - gallery, - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Create or update a Shared Image Gallery. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery. The allowed characters are alphabets and numbers with - * dots and periods allowed in the middle. The maximum length is 80 characters. - * @param gallery Specifies information about the Shared Image Gallery that you want to create or update. - * @param context The context to associate with this 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 specifies information about the Shared Image Gallery that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginCreateOrUpdateWithoutPollingWithResponseAsync( - String resourceGroupName, String galleryName, GalleryInner gallery, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (galleryName == null) { - return Mono.error(new IllegalArgumentException("Parameter galleryName is required and cannot be null.")); - } - if (gallery == null) { - return Mono.error(new IllegalArgumentException("Parameter gallery is required and cannot be null.")); - } else { - gallery.validate(); - } - final String apiVersion = "2019-12-01"; - return service - .beginCreateOrUpdateWithoutPolling( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - galleryName, - apiVersion, - gallery, - context); - } - - /** - * Create or update a Shared Image Gallery. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery. The allowed characters are alphabets and numbers with - * dots and periods allowed in the middle. The maximum length is 80 characters. - * @param gallery Specifies information about the Shared Image Gallery that you want to create or update. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the Shared Image Gallery that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginCreateOrUpdateWithoutPollingAsync( - String resourceGroupName, String galleryName, GalleryInner gallery) { - return beginCreateOrUpdateWithoutPollingWithResponseAsync(resourceGroupName, galleryName, gallery) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Create or update a Shared Image Gallery. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery. The allowed characters are alphabets and numbers with - * dots and periods allowed in the middle. The maximum length is 80 characters. - * @param gallery Specifies information about the Shared Image Gallery that you want to create or update. - * @param context The context to associate with this 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 specifies information about the Shared Image Gallery that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginCreateOrUpdateWithoutPollingAsync( - String resourceGroupName, String galleryName, GalleryInner gallery, Context context) { - return beginCreateOrUpdateWithoutPollingWithResponseAsync(resourceGroupName, galleryName, gallery, context) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Create or update a Shared Image Gallery. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery. The allowed characters are alphabets and numbers with - * dots and periods allowed in the middle. The maximum length is 80 characters. - * @param gallery Specifies information about the Shared Image Gallery that you want to create or update. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the Shared Image Gallery that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public GalleryInner beginCreateOrUpdateWithoutPolling( - String resourceGroupName, String galleryName, GalleryInner gallery) { - return beginCreateOrUpdateWithoutPollingAsync(resourceGroupName, galleryName, gallery).block(); - } - - /** - * Create or update a Shared Image Gallery. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery. The allowed characters are alphabets and numbers with - * dots and periods allowed in the middle. The maximum length is 80 characters. - * @param gallery Specifies information about the Shared Image Gallery that you want to create or update. - * @param context The context to associate with this 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 specifies information about the Shared Image Gallery that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public GalleryInner beginCreateOrUpdateWithoutPolling( - String resourceGroupName, String galleryName, GalleryInner gallery, Context context) { - return beginCreateOrUpdateWithoutPollingAsync(resourceGroupName, galleryName, gallery, context).block(); - } - - /** - * Update a Shared Image Gallery. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery. The allowed characters are alphabets and numbers with - * dots and periods allowed in the middle. The maximum length is 80 characters. - * @param gallery Specifies information about the Shared Image Gallery that you want to update. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the Shared Image Gallery that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginUpdateWithoutPollingWithResponseAsync( - String resourceGroupName, String galleryName, GalleryUpdate gallery) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (galleryName == null) { - return Mono.error(new IllegalArgumentException("Parameter galleryName is required and cannot be null.")); - } - if (gallery == null) { - return Mono.error(new IllegalArgumentException("Parameter gallery is required and cannot be null.")); - } else { - gallery.validate(); - } - final String apiVersion = "2019-12-01"; - return FluxUtil - .withContext( - context -> - service - .beginUpdateWithoutPolling( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - galleryName, - apiVersion, - gallery, - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Update a Shared Image Gallery. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery. The allowed characters are alphabets and numbers with - * dots and periods allowed in the middle. The maximum length is 80 characters. - * @param gallery Specifies information about the Shared Image Gallery that you want to update. - * @param context The context to associate with this 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 specifies information about the Shared Image Gallery that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginUpdateWithoutPollingWithResponseAsync( - String resourceGroupName, String galleryName, GalleryUpdate gallery, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (galleryName == null) { - return Mono.error(new IllegalArgumentException("Parameter galleryName is required and cannot be null.")); - } - if (gallery == null) { - return Mono.error(new IllegalArgumentException("Parameter gallery is required and cannot be null.")); - } else { - gallery.validate(); - } - final String apiVersion = "2019-12-01"; - return service - .beginUpdateWithoutPolling( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - galleryName, - apiVersion, - gallery, - context); - } - - /** - * Update a Shared Image Gallery. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery. The allowed characters are alphabets and numbers with - * dots and periods allowed in the middle. The maximum length is 80 characters. - * @param gallery Specifies information about the Shared Image Gallery that you want to update. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the Shared Image Gallery that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginUpdateWithoutPollingAsync( - String resourceGroupName, String galleryName, GalleryUpdate gallery) { - return beginUpdateWithoutPollingWithResponseAsync(resourceGroupName, galleryName, gallery) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Update a Shared Image Gallery. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery. The allowed characters are alphabets and numbers with - * dots and periods allowed in the middle. The maximum length is 80 characters. - * @param gallery Specifies information about the Shared Image Gallery that you want to update. - * @param context The context to associate with this 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 specifies information about the Shared Image Gallery that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginUpdateWithoutPollingAsync( - String resourceGroupName, String galleryName, GalleryUpdate gallery, Context context) { - return beginUpdateWithoutPollingWithResponseAsync(resourceGroupName, galleryName, gallery, context) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Update a Shared Image Gallery. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery. The allowed characters are alphabets and numbers with - * dots and periods allowed in the middle. The maximum length is 80 characters. - * @param gallery Specifies information about the Shared Image Gallery that you want to update. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the Shared Image Gallery that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public GalleryInner beginUpdateWithoutPolling(String resourceGroupName, String galleryName, GalleryUpdate gallery) { - return beginUpdateWithoutPollingAsync(resourceGroupName, galleryName, gallery).block(); - } - - /** - * Update a Shared Image Gallery. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery. The allowed characters are alphabets and numbers with - * dots and periods allowed in the middle. The maximum length is 80 characters. - * @param gallery Specifies information about the Shared Image Gallery that you want to update. - * @param context The context to associate with this 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 specifies information about the Shared Image Gallery that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public GalleryInner beginUpdateWithoutPolling( - String resourceGroupName, String galleryName, GalleryUpdate gallery, Context context) { - return beginUpdateWithoutPollingAsync(resourceGroupName, galleryName, gallery, context).block(); - } - - /** - * Delete a Shared Image Gallery. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery to be deleted. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginDeleteWithoutPollingWithResponseAsync( - String resourceGroupName, String galleryName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (galleryName == null) { - return Mono.error(new IllegalArgumentException("Parameter galleryName is required and cannot be null.")); - } - final String apiVersion = "2019-12-01"; - return FluxUtil - .withContext( - context -> - service - .beginDeleteWithoutPolling( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - galleryName, - apiVersion, - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Delete a Shared Image Gallery. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery to be deleted. - * @param context The context to associate with this 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 completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginDeleteWithoutPollingWithResponseAsync( - String resourceGroupName, String galleryName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (galleryName == null) { - return Mono.error(new IllegalArgumentException("Parameter galleryName is required and cannot be null.")); - } - final String apiVersion = "2019-12-01"; - return service - .beginDeleteWithoutPolling( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - galleryName, - apiVersion, - context); - } - - /** - * Delete a Shared Image Gallery. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery to be deleted. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginDeleteWithoutPollingAsync(String resourceGroupName, String galleryName) { - return beginDeleteWithoutPollingWithResponseAsync(resourceGroupName, galleryName) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Delete a Shared Image Gallery. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery to be deleted. - * @param context The context to associate with this 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 completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginDeleteWithoutPollingAsync(String resourceGroupName, String galleryName, Context context) { - return beginDeleteWithoutPollingWithResponseAsync(resourceGroupName, galleryName, context) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Delete a Shared Image Gallery. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery to be deleted. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void beginDeleteWithoutPolling(String resourceGroupName, String galleryName) { - beginDeleteWithoutPollingAsync(resourceGroupName, galleryName).block(); - } - - /** - * Delete a Shared Image Gallery. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery to be deleted. - * @param context The context to associate with this 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. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void beginDeleteWithoutPolling(String resourceGroupName, String galleryName, Context context) { - beginDeleteWithoutPollingAsync(resourceGroupName, galleryName, context).block(); - } - /** * Get the next page of items. * @@ -2001,6 +1417,7 @@ public Mono> listByResourceGroupNextSinglePageAsync( if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listByResourceGroupNext(nextLink, context) .map( @@ -2057,6 +1474,7 @@ public Mono> listNextSinglePageAsync(String nextLink if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listNext(nextLink, context) .map( diff --git a/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/GalleryApplicationVersionsClient.java b/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/GalleryApplicationVersionsClient.java index 8c338b4d06b20..5db021c4f73c3 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/GalleryApplicationVersionsClient.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/GalleryApplicationVersionsClient.java @@ -153,56 +153,6 @@ Mono> listByGalleryApplication( @QueryParam("api-version") String apiVersion, Context context); - @Headers({"Accept: application/json", "Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries" - + "/{galleryName}/applications/{galleryApplicationName}/versions/{galleryApplicationVersionName}") - @ExpectedResponses({200, 201, 202}) - @UnexpectedResponseExceptionType(ApiErrorException.class) - Mono> beginCreateOrUpdateWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("galleryName") String galleryName, - @PathParam("galleryApplicationName") String galleryApplicationName, - @PathParam("galleryApplicationVersionName") String galleryApplicationVersionName, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") GalleryApplicationVersionInner galleryApplicationVersion, - Context context); - - @Headers({"Accept: application/json", "Content-Type: application/json"}) - @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries" - + "/{galleryName}/applications/{galleryApplicationName}/versions/{galleryApplicationVersionName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ApiErrorException.class) - Mono> beginUpdateWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("galleryName") String galleryName, - @PathParam("galleryApplicationName") String galleryApplicationName, - @PathParam("galleryApplicationVersionName") String galleryApplicationVersionName, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") GalleryApplicationVersionUpdate galleryApplicationVersion, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries" - + "/{galleryName}/applications/{galleryApplicationName}/versions/{galleryApplicationVersionName}") - @ExpectedResponses({200, 202, 204}) - @UnexpectedResponseExceptionType(ApiErrorException.class) - Mono> beginDeleteWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("galleryName") String galleryName, - @PathParam("galleryApplicationName") String galleryApplicationName, - @PathParam("galleryApplicationVersionName") String galleryApplicationVersionName, - @QueryParam("api-version") String apiVersion, - Context context); - @Headers({"Accept: application/json", "Content-Type: application/json"}) @Get("{nextLink}") @ExpectedResponses({200}) @@ -356,6 +306,7 @@ public Mono>> createOrUpdateWithResponseAsync( galleryApplicationVersion.validate(); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .createOrUpdate( this.client.getEndpoint(), @@ -554,7 +505,7 @@ public Mono createOrUpdateAsync( galleryApplicationVersionName, galleryApplicationVersion) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -591,7 +542,7 @@ public Mono createOrUpdateAsync( galleryApplicationVersion, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -808,6 +759,7 @@ public Mono>> updateWithResponseAsync( galleryApplicationVersion.validate(); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .update( this.client.getEndpoint(), @@ -1004,7 +956,7 @@ public Mono updateAsync( galleryApplicationVersionName, galleryApplicationVersion) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -1041,7 +993,7 @@ public Mono updateAsync( galleryApplicationVersion, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -1236,6 +1188,7 @@ public Mono> getWithResponseAsync( "Parameter galleryApplicationVersionName is required and cannot be null.")); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .get( this.client.getEndpoint(), @@ -1546,6 +1499,7 @@ public Mono>> deleteWithResponseAsync( "Parameter galleryApplicationVersionName is required and cannot be null.")); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .delete( this.client.getEndpoint(), @@ -1680,7 +1634,7 @@ public Mono deleteAsync( String galleryApplicationVersionName) { return beginDeleteAsync(resourceGroupName, galleryName, galleryApplicationName, galleryApplicationVersionName) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -1707,7 +1661,7 @@ public Mono deleteAsync( return beginDeleteAsync( resourceGroupName, galleryName, galleryApplicationName, galleryApplicationVersionName, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -1860,6 +1814,7 @@ public Mono> listByGalleryApplicat new IllegalArgumentException("Parameter galleryApplicationName is required and cannot be null.")); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .listByGalleryApplication( this.client.getEndpoint(), @@ -1962,854 +1917,6 @@ public PagedIterable listByGalleryApplication( listByGalleryApplicationAsync(resourceGroupName, galleryName, galleryApplicationName, context)); } - /** - * Create or update a gallery Application Version. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Application Gallery in which the Application Definition resides. - * @param galleryApplicationName The name of the gallery Application Definition in which the Application Version is - * to be created. - * @param galleryApplicationVersionName The name of the gallery Application Version to be created. Needs to follow - * semantic version name pattern: The allowed characters are digit and period. Digits must be within the range - * of a 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch>. - * @param galleryApplicationVersion Specifies information about the gallery Application Version that you want to - * create or update. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Application Version that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginCreateOrUpdateWithoutPollingWithResponseAsync( - String resourceGroupName, - String galleryName, - String galleryApplicationName, - String galleryApplicationVersionName, - GalleryApplicationVersionInner galleryApplicationVersion) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (galleryName == null) { - return Mono.error(new IllegalArgumentException("Parameter galleryName is required and cannot be null.")); - } - if (galleryApplicationName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter galleryApplicationName is required and cannot be null.")); - } - if (galleryApplicationVersionName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter galleryApplicationVersionName is required and cannot be null.")); - } - if (galleryApplicationVersion == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter galleryApplicationVersion is required and cannot be null.")); - } else { - galleryApplicationVersion.validate(); - } - final String apiVersion = "2019-12-01"; - return FluxUtil - .withContext( - context -> - service - .beginCreateOrUpdateWithoutPolling( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - galleryName, - galleryApplicationName, - galleryApplicationVersionName, - apiVersion, - galleryApplicationVersion, - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Create or update a gallery Application Version. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Application Gallery in which the Application Definition resides. - * @param galleryApplicationName The name of the gallery Application Definition in which the Application Version is - * to be created. - * @param galleryApplicationVersionName The name of the gallery Application Version to be created. Needs to follow - * semantic version name pattern: The allowed characters are digit and period. Digits must be within the range - * of a 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch>. - * @param galleryApplicationVersion Specifies information about the gallery Application Version that you want to - * create or update. - * @param context The context to associate with this 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 specifies information about the gallery Application Version that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginCreateOrUpdateWithoutPollingWithResponseAsync( - String resourceGroupName, - String galleryName, - String galleryApplicationName, - String galleryApplicationVersionName, - GalleryApplicationVersionInner galleryApplicationVersion, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (galleryName == null) { - return Mono.error(new IllegalArgumentException("Parameter galleryName is required and cannot be null.")); - } - if (galleryApplicationName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter galleryApplicationName is required and cannot be null.")); - } - if (galleryApplicationVersionName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter galleryApplicationVersionName is required and cannot be null.")); - } - if (galleryApplicationVersion == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter galleryApplicationVersion is required and cannot be null.")); - } else { - galleryApplicationVersion.validate(); - } - final String apiVersion = "2019-12-01"; - return service - .beginCreateOrUpdateWithoutPolling( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - galleryName, - galleryApplicationName, - galleryApplicationVersionName, - apiVersion, - galleryApplicationVersion, - context); - } - - /** - * Create or update a gallery Application Version. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Application Gallery in which the Application Definition resides. - * @param galleryApplicationName The name of the gallery Application Definition in which the Application Version is - * to be created. - * @param galleryApplicationVersionName The name of the gallery Application Version to be created. Needs to follow - * semantic version name pattern: The allowed characters are digit and period. Digits must be within the range - * of a 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch>. - * @param galleryApplicationVersion Specifies information about the gallery Application Version that you want to - * create or update. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Application Version that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginCreateOrUpdateWithoutPollingAsync( - String resourceGroupName, - String galleryName, - String galleryApplicationName, - String galleryApplicationVersionName, - GalleryApplicationVersionInner galleryApplicationVersion) { - return beginCreateOrUpdateWithoutPollingWithResponseAsync( - resourceGroupName, - galleryName, - galleryApplicationName, - galleryApplicationVersionName, - galleryApplicationVersion) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Create or update a gallery Application Version. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Application Gallery in which the Application Definition resides. - * @param galleryApplicationName The name of the gallery Application Definition in which the Application Version is - * to be created. - * @param galleryApplicationVersionName The name of the gallery Application Version to be created. Needs to follow - * semantic version name pattern: The allowed characters are digit and period. Digits must be within the range - * of a 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch>. - * @param galleryApplicationVersion Specifies information about the gallery Application Version that you want to - * create or update. - * @param context The context to associate with this 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 specifies information about the gallery Application Version that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginCreateOrUpdateWithoutPollingAsync( - String resourceGroupName, - String galleryName, - String galleryApplicationName, - String galleryApplicationVersionName, - GalleryApplicationVersionInner galleryApplicationVersion, - Context context) { - return beginCreateOrUpdateWithoutPollingWithResponseAsync( - resourceGroupName, - galleryName, - galleryApplicationName, - galleryApplicationVersionName, - galleryApplicationVersion, - context) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Create or update a gallery Application Version. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Application Gallery in which the Application Definition resides. - * @param galleryApplicationName The name of the gallery Application Definition in which the Application Version is - * to be created. - * @param galleryApplicationVersionName The name of the gallery Application Version to be created. Needs to follow - * semantic version name pattern: The allowed characters are digit and period. Digits must be within the range - * of a 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch>. - * @param galleryApplicationVersion Specifies information about the gallery Application Version that you want to - * create or update. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Application Version that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public GalleryApplicationVersionInner beginCreateOrUpdateWithoutPolling( - String resourceGroupName, - String galleryName, - String galleryApplicationName, - String galleryApplicationVersionName, - GalleryApplicationVersionInner galleryApplicationVersion) { - return beginCreateOrUpdateWithoutPollingAsync( - resourceGroupName, - galleryName, - galleryApplicationName, - galleryApplicationVersionName, - galleryApplicationVersion) - .block(); - } - - /** - * Create or update a gallery Application Version. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Application Gallery in which the Application Definition resides. - * @param galleryApplicationName The name of the gallery Application Definition in which the Application Version is - * to be created. - * @param galleryApplicationVersionName The name of the gallery Application Version to be created. Needs to follow - * semantic version name pattern: The allowed characters are digit and period. Digits must be within the range - * of a 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch>. - * @param galleryApplicationVersion Specifies information about the gallery Application Version that you want to - * create or update. - * @param context The context to associate with this 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 specifies information about the gallery Application Version that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public GalleryApplicationVersionInner beginCreateOrUpdateWithoutPolling( - String resourceGroupName, - String galleryName, - String galleryApplicationName, - String galleryApplicationVersionName, - GalleryApplicationVersionInner galleryApplicationVersion, - Context context) { - return beginCreateOrUpdateWithoutPollingAsync( - resourceGroupName, - galleryName, - galleryApplicationName, - galleryApplicationVersionName, - galleryApplicationVersion, - context) - .block(); - } - - /** - * Update a gallery Application Version. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Application Gallery in which the Application Definition resides. - * @param galleryApplicationName The name of the gallery Application Definition in which the Application Version is - * to be updated. - * @param galleryApplicationVersionName The name of the gallery Application Version to be updated. Needs to follow - * semantic version name pattern: The allowed characters are digit and period. Digits must be within the range - * of a 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch>. - * @param galleryApplicationVersion Specifies information about the gallery Application Version that you want to - * update. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Application Version that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginUpdateWithoutPollingWithResponseAsync( - String resourceGroupName, - String galleryName, - String galleryApplicationName, - String galleryApplicationVersionName, - GalleryApplicationVersionUpdate galleryApplicationVersion) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (galleryName == null) { - return Mono.error(new IllegalArgumentException("Parameter galleryName is required and cannot be null.")); - } - if (galleryApplicationName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter galleryApplicationName is required and cannot be null.")); - } - if (galleryApplicationVersionName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter galleryApplicationVersionName is required and cannot be null.")); - } - if (galleryApplicationVersion == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter galleryApplicationVersion is required and cannot be null.")); - } else { - galleryApplicationVersion.validate(); - } - final String apiVersion = "2019-12-01"; - return FluxUtil - .withContext( - context -> - service - .beginUpdateWithoutPolling( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - galleryName, - galleryApplicationName, - galleryApplicationVersionName, - apiVersion, - galleryApplicationVersion, - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Update a gallery Application Version. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Application Gallery in which the Application Definition resides. - * @param galleryApplicationName The name of the gallery Application Definition in which the Application Version is - * to be updated. - * @param galleryApplicationVersionName The name of the gallery Application Version to be updated. Needs to follow - * semantic version name pattern: The allowed characters are digit and period. Digits must be within the range - * of a 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch>. - * @param galleryApplicationVersion Specifies information about the gallery Application Version that you want to - * update. - * @param context The context to associate with this 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 specifies information about the gallery Application Version that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginUpdateWithoutPollingWithResponseAsync( - String resourceGroupName, - String galleryName, - String galleryApplicationName, - String galleryApplicationVersionName, - GalleryApplicationVersionUpdate galleryApplicationVersion, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (galleryName == null) { - return Mono.error(new IllegalArgumentException("Parameter galleryName is required and cannot be null.")); - } - if (galleryApplicationName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter galleryApplicationName is required and cannot be null.")); - } - if (galleryApplicationVersionName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter galleryApplicationVersionName is required and cannot be null.")); - } - if (galleryApplicationVersion == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter galleryApplicationVersion is required and cannot be null.")); - } else { - galleryApplicationVersion.validate(); - } - final String apiVersion = "2019-12-01"; - return service - .beginUpdateWithoutPolling( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - galleryName, - galleryApplicationName, - galleryApplicationVersionName, - apiVersion, - galleryApplicationVersion, - context); - } - - /** - * Update a gallery Application Version. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Application Gallery in which the Application Definition resides. - * @param galleryApplicationName The name of the gallery Application Definition in which the Application Version is - * to be updated. - * @param galleryApplicationVersionName The name of the gallery Application Version to be updated. Needs to follow - * semantic version name pattern: The allowed characters are digit and period. Digits must be within the range - * of a 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch>. - * @param galleryApplicationVersion Specifies information about the gallery Application Version that you want to - * update. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Application Version that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginUpdateWithoutPollingAsync( - String resourceGroupName, - String galleryName, - String galleryApplicationName, - String galleryApplicationVersionName, - GalleryApplicationVersionUpdate galleryApplicationVersion) { - return beginUpdateWithoutPollingWithResponseAsync( - resourceGroupName, - galleryName, - galleryApplicationName, - galleryApplicationVersionName, - galleryApplicationVersion) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Update a gallery Application Version. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Application Gallery in which the Application Definition resides. - * @param galleryApplicationName The name of the gallery Application Definition in which the Application Version is - * to be updated. - * @param galleryApplicationVersionName The name of the gallery Application Version to be updated. Needs to follow - * semantic version name pattern: The allowed characters are digit and period. Digits must be within the range - * of a 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch>. - * @param galleryApplicationVersion Specifies information about the gallery Application Version that you want to - * update. - * @param context The context to associate with this 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 specifies information about the gallery Application Version that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginUpdateWithoutPollingAsync( - String resourceGroupName, - String galleryName, - String galleryApplicationName, - String galleryApplicationVersionName, - GalleryApplicationVersionUpdate galleryApplicationVersion, - Context context) { - return beginUpdateWithoutPollingWithResponseAsync( - resourceGroupName, - galleryName, - galleryApplicationName, - galleryApplicationVersionName, - galleryApplicationVersion, - context) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Update a gallery Application Version. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Application Gallery in which the Application Definition resides. - * @param galleryApplicationName The name of the gallery Application Definition in which the Application Version is - * to be updated. - * @param galleryApplicationVersionName The name of the gallery Application Version to be updated. Needs to follow - * semantic version name pattern: The allowed characters are digit and period. Digits must be within the range - * of a 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch>. - * @param galleryApplicationVersion Specifies information about the gallery Application Version that you want to - * update. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Application Version that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public GalleryApplicationVersionInner beginUpdateWithoutPolling( - String resourceGroupName, - String galleryName, - String galleryApplicationName, - String galleryApplicationVersionName, - GalleryApplicationVersionUpdate galleryApplicationVersion) { - return beginUpdateWithoutPollingAsync( - resourceGroupName, - galleryName, - galleryApplicationName, - galleryApplicationVersionName, - galleryApplicationVersion) - .block(); - } - - /** - * Update a gallery Application Version. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Application Gallery in which the Application Definition resides. - * @param galleryApplicationName The name of the gallery Application Definition in which the Application Version is - * to be updated. - * @param galleryApplicationVersionName The name of the gallery Application Version to be updated. Needs to follow - * semantic version name pattern: The allowed characters are digit and period. Digits must be within the range - * of a 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch>. - * @param galleryApplicationVersion Specifies information about the gallery Application Version that you want to - * update. - * @param context The context to associate with this 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 specifies information about the gallery Application Version that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public GalleryApplicationVersionInner beginUpdateWithoutPolling( - String resourceGroupName, - String galleryName, - String galleryApplicationName, - String galleryApplicationVersionName, - GalleryApplicationVersionUpdate galleryApplicationVersion, - Context context) { - return beginUpdateWithoutPollingAsync( - resourceGroupName, - galleryName, - galleryApplicationName, - galleryApplicationVersionName, - galleryApplicationVersion, - context) - .block(); - } - - /** - * Delete a gallery Application Version. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Application Gallery in which the Application Definition resides. - * @param galleryApplicationName The name of the gallery Application Definition in which the Application Version - * resides. - * @param galleryApplicationVersionName The name of the gallery Application Version to be deleted. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginDeleteWithoutPollingWithResponseAsync( - String resourceGroupName, - String galleryName, - String galleryApplicationName, - String galleryApplicationVersionName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (galleryName == null) { - return Mono.error(new IllegalArgumentException("Parameter galleryName is required and cannot be null.")); - } - if (galleryApplicationName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter galleryApplicationName is required and cannot be null.")); - } - if (galleryApplicationVersionName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter galleryApplicationVersionName is required and cannot be null.")); - } - final String apiVersion = "2019-12-01"; - return FluxUtil - .withContext( - context -> - service - .beginDeleteWithoutPolling( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - galleryName, - galleryApplicationName, - galleryApplicationVersionName, - apiVersion, - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Delete a gallery Application Version. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Application Gallery in which the Application Definition resides. - * @param galleryApplicationName The name of the gallery Application Definition in which the Application Version - * resides. - * @param galleryApplicationVersionName The name of the gallery Application Version to be deleted. - * @param context The context to associate with this 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 completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginDeleteWithoutPollingWithResponseAsync( - String resourceGroupName, - String galleryName, - String galleryApplicationName, - String galleryApplicationVersionName, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (galleryName == null) { - return Mono.error(new IllegalArgumentException("Parameter galleryName is required and cannot be null.")); - } - if (galleryApplicationName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter galleryApplicationName is required and cannot be null.")); - } - if (galleryApplicationVersionName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter galleryApplicationVersionName is required and cannot be null.")); - } - final String apiVersion = "2019-12-01"; - return service - .beginDeleteWithoutPolling( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - galleryName, - galleryApplicationName, - galleryApplicationVersionName, - apiVersion, - context); - } - - /** - * Delete a gallery Application Version. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Application Gallery in which the Application Definition resides. - * @param galleryApplicationName The name of the gallery Application Definition in which the Application Version - * resides. - * @param galleryApplicationVersionName The name of the gallery Application Version to be deleted. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginDeleteWithoutPollingAsync( - String resourceGroupName, - String galleryName, - String galleryApplicationName, - String galleryApplicationVersionName) { - return beginDeleteWithoutPollingWithResponseAsync( - resourceGroupName, galleryName, galleryApplicationName, galleryApplicationVersionName) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Delete a gallery Application Version. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Application Gallery in which the Application Definition resides. - * @param galleryApplicationName The name of the gallery Application Definition in which the Application Version - * resides. - * @param galleryApplicationVersionName The name of the gallery Application Version to be deleted. - * @param context The context to associate with this 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 completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginDeleteWithoutPollingAsync( - String resourceGroupName, - String galleryName, - String galleryApplicationName, - String galleryApplicationVersionName, - Context context) { - return beginDeleteWithoutPollingWithResponseAsync( - resourceGroupName, galleryName, galleryApplicationName, galleryApplicationVersionName, context) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Delete a gallery Application Version. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Application Gallery in which the Application Definition resides. - * @param galleryApplicationName The name of the gallery Application Definition in which the Application Version - * resides. - * @param galleryApplicationVersionName The name of the gallery Application Version to be deleted. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void beginDeleteWithoutPolling( - String resourceGroupName, - String galleryName, - String galleryApplicationName, - String galleryApplicationVersionName) { - beginDeleteWithoutPollingAsync( - resourceGroupName, galleryName, galleryApplicationName, galleryApplicationVersionName) - .block(); - } - - /** - * Delete a gallery Application Version. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Application Gallery in which the Application Definition resides. - * @param galleryApplicationName The name of the gallery Application Definition in which the Application Version - * resides. - * @param galleryApplicationVersionName The name of the gallery Application Version to be deleted. - * @param context The context to associate with this 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. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void beginDeleteWithoutPolling( - String resourceGroupName, - String galleryName, - String galleryApplicationName, - String galleryApplicationVersionName, - Context context) { - beginDeleteWithoutPollingAsync( - resourceGroupName, galleryName, galleryApplicationName, galleryApplicationVersionName, context) - .block(); - } - /** * Get the next page of items. * @@ -2855,6 +1962,7 @@ public Mono> listByGalleryApplicat if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listByGalleryApplicationNext(nextLink, context) .map( diff --git a/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/GalleryApplicationsClient.java b/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/GalleryApplicationsClient.java index 7d057a8238e56..1d58caac63b3e 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/GalleryApplicationsClient.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/GalleryApplicationsClient.java @@ -144,53 +144,6 @@ Mono> listByGallery( @QueryParam("api-version") String apiVersion, Context context); - @Headers({"Accept: application/json", "Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries" - + "/{galleryName}/applications/{galleryApplicationName}") - @ExpectedResponses({200, 201, 202}) - @UnexpectedResponseExceptionType(ApiErrorException.class) - Mono> beginCreateOrUpdateWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("galleryName") String galleryName, - @PathParam("galleryApplicationName") String galleryApplicationName, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") GalleryApplicationInner galleryApplication, - Context context); - - @Headers({"Accept: application/json", "Content-Type: application/json"}) - @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries" - + "/{galleryName}/applications/{galleryApplicationName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ApiErrorException.class) - Mono> beginUpdateWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("galleryName") String galleryName, - @PathParam("galleryApplicationName") String galleryApplicationName, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") GalleryApplicationUpdate galleryApplication, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries" - + "/{galleryName}/applications/{galleryApplicationName}") - @ExpectedResponses({200, 202, 204}) - @UnexpectedResponseExceptionType(ApiErrorException.class) - Mono> beginDeleteWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("galleryName") String galleryName, - @PathParam("galleryApplicationName") String galleryApplicationName, - @QueryParam("api-version") String apiVersion, - Context context); - @Headers({"Accept: application/json", "Content-Type: application/json"}) @Get("{nextLink}") @ExpectedResponses({200}) @@ -323,6 +276,7 @@ public Mono>> createOrUpdateWithResponseAsync( galleryApplication.validate(); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .createOrUpdate( this.client.getEndpoint(), @@ -477,7 +431,7 @@ public Mono createOrUpdateAsync( GalleryApplicationInner galleryApplication) { return beginCreateOrUpdateAsync(resourceGroupName, galleryName, galleryApplicationName, galleryApplication) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -507,7 +461,7 @@ public Mono createOrUpdateAsync( return beginCreateOrUpdateAsync( resourceGroupName, galleryName, galleryApplicationName, galleryApplication, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -685,6 +639,7 @@ public Mono>> updateWithResponseAsync( galleryApplication.validate(); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .update( this.client.getEndpoint(), @@ -833,7 +788,7 @@ public Mono updateAsync( GalleryApplicationUpdate galleryApplication) { return beginUpdateAsync(resourceGroupName, galleryName, galleryApplicationName, galleryApplication) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -861,7 +816,7 @@ public Mono updateAsync( Context context) { return beginUpdateAsync(resourceGroupName, galleryName, galleryApplicationName, galleryApplication, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -1010,6 +965,7 @@ public Mono> getWithResponseAsync( new IllegalArgumentException("Parameter galleryApplicationName is required and cannot be null.")); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .get( this.client.getEndpoint(), @@ -1206,6 +1162,7 @@ public Mono>> deleteWithResponseAsync( new IllegalArgumentException("Parameter galleryApplicationName is required and cannot be null.")); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .delete( this.client.getEndpoint(), @@ -1311,7 +1268,7 @@ public SyncPoller, Void> beginDelete( public Mono deleteAsync(String resourceGroupName, String galleryName, String galleryApplicationName) { return beginDeleteAsync(resourceGroupName, galleryName, galleryApplicationName) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -1332,7 +1289,7 @@ public Mono deleteAsync( String resourceGroupName, String galleryName, String galleryApplicationName, Context context) { return beginDeleteAsync(resourceGroupName, galleryName, galleryApplicationName, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -1460,6 +1417,7 @@ public Mono> listByGallerySinglePageAsync return Mono.error(new IllegalArgumentException("Parameter galleryName is required and cannot be null.")); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .listByGallery( this.client.getEndpoint(), @@ -1551,705 +1509,6 @@ public PagedIterable listByGallery( return new PagedIterable<>(listByGalleryAsync(resourceGroupName, galleryName, context)); } - /** - * Create or update a gallery Application Definition. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Application Gallery in which the Application Definition is to be - * created. - * @param galleryApplicationName The name of the gallery Application Definition to be created or updated. The - * allowed characters are alphabets and numbers with dots, dashes, and periods allowed in the middle. The - * maximum length is 80 characters. - * @param galleryApplication Specifies information about the gallery Application Definition that you want to create - * or update. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Application Definition that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginCreateOrUpdateWithoutPollingWithResponseAsync( - String resourceGroupName, - String galleryName, - String galleryApplicationName, - GalleryApplicationInner galleryApplication) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (galleryName == null) { - return Mono.error(new IllegalArgumentException("Parameter galleryName is required and cannot be null.")); - } - if (galleryApplicationName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter galleryApplicationName is required and cannot be null.")); - } - if (galleryApplication == null) { - return Mono - .error(new IllegalArgumentException("Parameter galleryApplication is required and cannot be null.")); - } else { - galleryApplication.validate(); - } - final String apiVersion = "2019-12-01"; - return FluxUtil - .withContext( - context -> - service - .beginCreateOrUpdateWithoutPolling( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - galleryName, - galleryApplicationName, - apiVersion, - galleryApplication, - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Create or update a gallery Application Definition. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Application Gallery in which the Application Definition is to be - * created. - * @param galleryApplicationName The name of the gallery Application Definition to be created or updated. The - * allowed characters are alphabets and numbers with dots, dashes, and periods allowed in the middle. The - * maximum length is 80 characters. - * @param galleryApplication Specifies information about the gallery Application Definition that you want to create - * or update. - * @param context The context to associate with this 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 specifies information about the gallery Application Definition that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginCreateOrUpdateWithoutPollingWithResponseAsync( - String resourceGroupName, - String galleryName, - String galleryApplicationName, - GalleryApplicationInner galleryApplication, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (galleryName == null) { - return Mono.error(new IllegalArgumentException("Parameter galleryName is required and cannot be null.")); - } - if (galleryApplicationName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter galleryApplicationName is required and cannot be null.")); - } - if (galleryApplication == null) { - return Mono - .error(new IllegalArgumentException("Parameter galleryApplication is required and cannot be null.")); - } else { - galleryApplication.validate(); - } - final String apiVersion = "2019-12-01"; - return service - .beginCreateOrUpdateWithoutPolling( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - galleryName, - galleryApplicationName, - apiVersion, - galleryApplication, - context); - } - - /** - * Create or update a gallery Application Definition. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Application Gallery in which the Application Definition is to be - * created. - * @param galleryApplicationName The name of the gallery Application Definition to be created or updated. The - * allowed characters are alphabets and numbers with dots, dashes, and periods allowed in the middle. The - * maximum length is 80 characters. - * @param galleryApplication Specifies information about the gallery Application Definition that you want to create - * or update. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Application Definition that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginCreateOrUpdateWithoutPollingAsync( - String resourceGroupName, - String galleryName, - String galleryApplicationName, - GalleryApplicationInner galleryApplication) { - return beginCreateOrUpdateWithoutPollingWithResponseAsync( - resourceGroupName, galleryName, galleryApplicationName, galleryApplication) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Create or update a gallery Application Definition. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Application Gallery in which the Application Definition is to be - * created. - * @param galleryApplicationName The name of the gallery Application Definition to be created or updated. The - * allowed characters are alphabets and numbers with dots, dashes, and periods allowed in the middle. The - * maximum length is 80 characters. - * @param galleryApplication Specifies information about the gallery Application Definition that you want to create - * or update. - * @param context The context to associate with this 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 specifies information about the gallery Application Definition that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginCreateOrUpdateWithoutPollingAsync( - String resourceGroupName, - String galleryName, - String galleryApplicationName, - GalleryApplicationInner galleryApplication, - Context context) { - return beginCreateOrUpdateWithoutPollingWithResponseAsync( - resourceGroupName, galleryName, galleryApplicationName, galleryApplication, context) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Create or update a gallery Application Definition. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Application Gallery in which the Application Definition is to be - * created. - * @param galleryApplicationName The name of the gallery Application Definition to be created or updated. The - * allowed characters are alphabets and numbers with dots, dashes, and periods allowed in the middle. The - * maximum length is 80 characters. - * @param galleryApplication Specifies information about the gallery Application Definition that you want to create - * or update. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Application Definition that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public GalleryApplicationInner beginCreateOrUpdateWithoutPolling( - String resourceGroupName, - String galleryName, - String galleryApplicationName, - GalleryApplicationInner galleryApplication) { - return beginCreateOrUpdateWithoutPollingAsync( - resourceGroupName, galleryName, galleryApplicationName, galleryApplication) - .block(); - } - - /** - * Create or update a gallery Application Definition. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Application Gallery in which the Application Definition is to be - * created. - * @param galleryApplicationName The name of the gallery Application Definition to be created or updated. The - * allowed characters are alphabets and numbers with dots, dashes, and periods allowed in the middle. The - * maximum length is 80 characters. - * @param galleryApplication Specifies information about the gallery Application Definition that you want to create - * or update. - * @param context The context to associate with this 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 specifies information about the gallery Application Definition that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public GalleryApplicationInner beginCreateOrUpdateWithoutPolling( - String resourceGroupName, - String galleryName, - String galleryApplicationName, - GalleryApplicationInner galleryApplication, - Context context) { - return beginCreateOrUpdateWithoutPollingAsync( - resourceGroupName, galleryName, galleryApplicationName, galleryApplication, context) - .block(); - } - - /** - * Update a gallery Application Definition. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Application Gallery in which the Application Definition is to be - * updated. - * @param galleryApplicationName The name of the gallery Application Definition to be updated. The allowed - * characters are alphabets and numbers with dots, dashes, and periods allowed in the middle. The maximum length - * is 80 characters. - * @param galleryApplication Specifies information about the gallery Application Definition that you want to update. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Application Definition that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginUpdateWithoutPollingWithResponseAsync( - String resourceGroupName, - String galleryName, - String galleryApplicationName, - GalleryApplicationUpdate galleryApplication) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (galleryName == null) { - return Mono.error(new IllegalArgumentException("Parameter galleryName is required and cannot be null.")); - } - if (galleryApplicationName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter galleryApplicationName is required and cannot be null.")); - } - if (galleryApplication == null) { - return Mono - .error(new IllegalArgumentException("Parameter galleryApplication is required and cannot be null.")); - } else { - galleryApplication.validate(); - } - final String apiVersion = "2019-12-01"; - return FluxUtil - .withContext( - context -> - service - .beginUpdateWithoutPolling( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - galleryName, - galleryApplicationName, - apiVersion, - galleryApplication, - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Update a gallery Application Definition. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Application Gallery in which the Application Definition is to be - * updated. - * @param galleryApplicationName The name of the gallery Application Definition to be updated. The allowed - * characters are alphabets and numbers with dots, dashes, and periods allowed in the middle. The maximum length - * is 80 characters. - * @param galleryApplication Specifies information about the gallery Application Definition that you want to update. - * @param context The context to associate with this 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 specifies information about the gallery Application Definition that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginUpdateWithoutPollingWithResponseAsync( - String resourceGroupName, - String galleryName, - String galleryApplicationName, - GalleryApplicationUpdate galleryApplication, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (galleryName == null) { - return Mono.error(new IllegalArgumentException("Parameter galleryName is required and cannot be null.")); - } - if (galleryApplicationName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter galleryApplicationName is required and cannot be null.")); - } - if (galleryApplication == null) { - return Mono - .error(new IllegalArgumentException("Parameter galleryApplication is required and cannot be null.")); - } else { - galleryApplication.validate(); - } - final String apiVersion = "2019-12-01"; - return service - .beginUpdateWithoutPolling( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - galleryName, - galleryApplicationName, - apiVersion, - galleryApplication, - context); - } - - /** - * Update a gallery Application Definition. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Application Gallery in which the Application Definition is to be - * updated. - * @param galleryApplicationName The name of the gallery Application Definition to be updated. The allowed - * characters are alphabets and numbers with dots, dashes, and periods allowed in the middle. The maximum length - * is 80 characters. - * @param galleryApplication Specifies information about the gallery Application Definition that you want to update. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Application Definition that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginUpdateWithoutPollingAsync( - String resourceGroupName, - String galleryName, - String galleryApplicationName, - GalleryApplicationUpdate galleryApplication) { - return beginUpdateWithoutPollingWithResponseAsync( - resourceGroupName, galleryName, galleryApplicationName, galleryApplication) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Update a gallery Application Definition. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Application Gallery in which the Application Definition is to be - * updated. - * @param galleryApplicationName The name of the gallery Application Definition to be updated. The allowed - * characters are alphabets and numbers with dots, dashes, and periods allowed in the middle. The maximum length - * is 80 characters. - * @param galleryApplication Specifies information about the gallery Application Definition that you want to update. - * @param context The context to associate with this 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 specifies information about the gallery Application Definition that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginUpdateWithoutPollingAsync( - String resourceGroupName, - String galleryName, - String galleryApplicationName, - GalleryApplicationUpdate galleryApplication, - Context context) { - return beginUpdateWithoutPollingWithResponseAsync( - resourceGroupName, galleryName, galleryApplicationName, galleryApplication, context) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Update a gallery Application Definition. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Application Gallery in which the Application Definition is to be - * updated. - * @param galleryApplicationName The name of the gallery Application Definition to be updated. The allowed - * characters are alphabets and numbers with dots, dashes, and periods allowed in the middle. The maximum length - * is 80 characters. - * @param galleryApplication Specifies information about the gallery Application Definition that you want to update. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Application Definition that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public GalleryApplicationInner beginUpdateWithoutPolling( - String resourceGroupName, - String galleryName, - String galleryApplicationName, - GalleryApplicationUpdate galleryApplication) { - return beginUpdateWithoutPollingAsync( - resourceGroupName, galleryName, galleryApplicationName, galleryApplication) - .block(); - } - - /** - * Update a gallery Application Definition. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Application Gallery in which the Application Definition is to be - * updated. - * @param galleryApplicationName The name of the gallery Application Definition to be updated. The allowed - * characters are alphabets and numbers with dots, dashes, and periods allowed in the middle. The maximum length - * is 80 characters. - * @param galleryApplication Specifies information about the gallery Application Definition that you want to update. - * @param context The context to associate with this 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 specifies information about the gallery Application Definition that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public GalleryApplicationInner beginUpdateWithoutPolling( - String resourceGroupName, - String galleryName, - String galleryApplicationName, - GalleryApplicationUpdate galleryApplication, - Context context) { - return beginUpdateWithoutPollingAsync( - resourceGroupName, galleryName, galleryApplicationName, galleryApplication, context) - .block(); - } - - /** - * Delete a gallery Application. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Application Gallery in which the Application Definition is to be - * deleted. - * @param galleryApplicationName The name of the gallery Application Definition to be deleted. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginDeleteWithoutPollingWithResponseAsync( - String resourceGroupName, String galleryName, String galleryApplicationName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (galleryName == null) { - return Mono.error(new IllegalArgumentException("Parameter galleryName is required and cannot be null.")); - } - if (galleryApplicationName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter galleryApplicationName is required and cannot be null.")); - } - final String apiVersion = "2019-12-01"; - return FluxUtil - .withContext( - context -> - service - .beginDeleteWithoutPolling( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - galleryName, - galleryApplicationName, - apiVersion, - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Delete a gallery Application. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Application Gallery in which the Application Definition is to be - * deleted. - * @param galleryApplicationName The name of the gallery Application Definition to be deleted. - * @param context The context to associate with this 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 completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginDeleteWithoutPollingWithResponseAsync( - String resourceGroupName, String galleryName, String galleryApplicationName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (galleryName == null) { - return Mono.error(new IllegalArgumentException("Parameter galleryName is required and cannot be null.")); - } - if (galleryApplicationName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter galleryApplicationName is required and cannot be null.")); - } - final String apiVersion = "2019-12-01"; - return service - .beginDeleteWithoutPolling( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - galleryName, - galleryApplicationName, - apiVersion, - context); - } - - /** - * Delete a gallery Application. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Application Gallery in which the Application Definition is to be - * deleted. - * @param galleryApplicationName The name of the gallery Application Definition to be deleted. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginDeleteWithoutPollingAsync( - String resourceGroupName, String galleryName, String galleryApplicationName) { - return beginDeleteWithoutPollingWithResponseAsync(resourceGroupName, galleryName, galleryApplicationName) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Delete a gallery Application. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Application Gallery in which the Application Definition is to be - * deleted. - * @param galleryApplicationName The name of the gallery Application Definition to be deleted. - * @param context The context to associate with this 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 completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginDeleteWithoutPollingAsync( - String resourceGroupName, String galleryName, String galleryApplicationName, Context context) { - return beginDeleteWithoutPollingWithResponseAsync( - resourceGroupName, galleryName, galleryApplicationName, context) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Delete a gallery Application. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Application Gallery in which the Application Definition is to be - * deleted. - * @param galleryApplicationName The name of the gallery Application Definition to be deleted. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void beginDeleteWithoutPolling(String resourceGroupName, String galleryName, String galleryApplicationName) { - beginDeleteWithoutPollingAsync(resourceGroupName, galleryName, galleryApplicationName).block(); - } - - /** - * Delete a gallery Application. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Application Gallery in which the Application Definition is to be - * deleted. - * @param galleryApplicationName The name of the gallery Application Definition to be deleted. - * @param context The context to associate with this 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. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void beginDeleteWithoutPolling( - String resourceGroupName, String galleryName, String galleryApplicationName, Context context) { - beginDeleteWithoutPollingAsync(resourceGroupName, galleryName, galleryApplicationName, context).block(); - } - /** * Get the next page of items. * @@ -2294,6 +1553,7 @@ public Mono> listByGalleryNextSinglePageA if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listByGalleryNext(nextLink, context) .map( diff --git a/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/GalleryImageVersionsClient.java b/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/GalleryImageVersionsClient.java index e8ac9eb58037d..53d0acbe851c7 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/GalleryImageVersionsClient.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/GalleryImageVersionsClient.java @@ -152,56 +152,6 @@ Mono> listByGalleryImage( @QueryParam("api-version") String apiVersion, Context context); - @Headers({"Accept: application/json", "Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries" - + "/{galleryName}/images/{galleryImageName}/versions/{galleryImageVersionName}") - @ExpectedResponses({200, 201, 202}) - @UnexpectedResponseExceptionType(ApiErrorException.class) - Mono> beginCreateOrUpdateWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("galleryName") String galleryName, - @PathParam("galleryImageName") String galleryImageName, - @PathParam("galleryImageVersionName") String galleryImageVersionName, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") GalleryImageVersionInner galleryImageVersion, - Context context); - - @Headers({"Accept: application/json", "Content-Type: application/json"}) - @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries" - + "/{galleryName}/images/{galleryImageName}/versions/{galleryImageVersionName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ApiErrorException.class) - Mono> beginUpdateWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("galleryName") String galleryName, - @PathParam("galleryImageName") String galleryImageName, - @PathParam("galleryImageVersionName") String galleryImageVersionName, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") GalleryImageVersionUpdate galleryImageVersion, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries" - + "/{galleryName}/images/{galleryImageName}/versions/{galleryImageVersionName}") - @ExpectedResponses({200, 202, 204}) - @UnexpectedResponseExceptionType(ApiErrorException.class) - Mono> beginDeleteWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("galleryName") String galleryName, - @PathParam("galleryImageName") String galleryImageName, - @PathParam("galleryImageVersionName") String galleryImageVersionName, - @QueryParam("api-version") String apiVersion, - Context context); - @Headers({"Accept: application/json", "Content-Type: application/json"}) @Get("{nextLink}") @ExpectedResponses({200}) @@ -345,6 +295,7 @@ public Mono>> createOrUpdateWithResponseAsync( galleryImageVersion.validate(); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .createOrUpdate( this.client.getEndpoint(), @@ -513,7 +464,7 @@ public Mono createOrUpdateAsync( return beginCreateOrUpdateAsync( resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, galleryImageVersion) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -544,7 +495,7 @@ public Mono createOrUpdateAsync( return beginCreateOrUpdateAsync( resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, galleryImageVersion, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -738,6 +689,7 @@ public Mono>> updateWithResponseAsync( galleryImageVersion.validate(); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .update( this.client.getEndpoint(), @@ -901,7 +853,7 @@ public Mono updateAsync( return beginUpdateAsync( resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, galleryImageVersion) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -931,7 +883,7 @@ public Mono updateAsync( return beginUpdateAsync( resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, galleryImageVersion, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -1107,6 +1059,7 @@ public Mono> getWithResponseAsync( new IllegalArgumentException("Parameter galleryImageVersionName is required and cannot be null.")); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .get( this.client.getEndpoint(), @@ -1391,6 +1344,7 @@ public Mono>> deleteWithResponseAsync( new IllegalArgumentException("Parameter galleryImageVersionName is required and cannot be null.")); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .delete( this.client.getEndpoint(), @@ -1508,7 +1462,7 @@ public Mono deleteAsync( String resourceGroupName, String galleryName, String galleryImageName, String galleryImageVersionName) { return beginDeleteAsync(resourceGroupName, galleryName, galleryImageName, galleryImageVersionName) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -1533,7 +1487,7 @@ public Mono deleteAsync( Context context) { return beginDeleteAsync(resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -1678,6 +1632,7 @@ public Mono> listByGalleryImageSinglePag .error(new IllegalArgumentException("Parameter galleryImageName is required and cannot be null.")); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .listByGalleryImage( this.client.getEndpoint(), @@ -1776,764 +1731,6 @@ public PagedIterable listByGalleryImage( return new PagedIterable<>(listByGalleryImageAsync(resourceGroupName, galleryName, galleryImageName, context)); } - /** - * Create or update a gallery Image Version. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery in which the Image Definition resides. - * @param galleryImageName The name of the gallery Image Definition in which the Image Version is to be created. - * @param galleryImageVersionName The name of the gallery Image Version to be created. Needs to follow semantic - * version name pattern: The allowed characters are digit and period. Digits must be within the range of a - * 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch>. - * @param galleryImageVersion Specifies information about the gallery Image Version that you want to create or - * update. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Image Version that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginCreateOrUpdateWithoutPollingWithResponseAsync( - String resourceGroupName, - String galleryName, - String galleryImageName, - String galleryImageVersionName, - GalleryImageVersionInner galleryImageVersion) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (galleryName == null) { - return Mono.error(new IllegalArgumentException("Parameter galleryName is required and cannot be null.")); - } - if (galleryImageName == null) { - return Mono - .error(new IllegalArgumentException("Parameter galleryImageName is required and cannot be null.")); - } - if (galleryImageVersionName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter galleryImageVersionName is required and cannot be null.")); - } - if (galleryImageVersion == null) { - return Mono - .error(new IllegalArgumentException("Parameter galleryImageVersion is required and cannot be null.")); - } else { - galleryImageVersion.validate(); - } - final String apiVersion = "2019-12-01"; - return FluxUtil - .withContext( - context -> - service - .beginCreateOrUpdateWithoutPolling( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - galleryName, - galleryImageName, - galleryImageVersionName, - apiVersion, - galleryImageVersion, - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Create or update a gallery Image Version. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery in which the Image Definition resides. - * @param galleryImageName The name of the gallery Image Definition in which the Image Version is to be created. - * @param galleryImageVersionName The name of the gallery Image Version to be created. Needs to follow semantic - * version name pattern: The allowed characters are digit and period. Digits must be within the range of a - * 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch>. - * @param galleryImageVersion Specifies information about the gallery Image Version that you want to create or - * update. - * @param context The context to associate with this 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 specifies information about the gallery Image Version that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginCreateOrUpdateWithoutPollingWithResponseAsync( - String resourceGroupName, - String galleryName, - String galleryImageName, - String galleryImageVersionName, - GalleryImageVersionInner galleryImageVersion, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (galleryName == null) { - return Mono.error(new IllegalArgumentException("Parameter galleryName is required and cannot be null.")); - } - if (galleryImageName == null) { - return Mono - .error(new IllegalArgumentException("Parameter galleryImageName is required and cannot be null.")); - } - if (galleryImageVersionName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter galleryImageVersionName is required and cannot be null.")); - } - if (galleryImageVersion == null) { - return Mono - .error(new IllegalArgumentException("Parameter galleryImageVersion is required and cannot be null.")); - } else { - galleryImageVersion.validate(); - } - final String apiVersion = "2019-12-01"; - return service - .beginCreateOrUpdateWithoutPolling( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - galleryName, - galleryImageName, - galleryImageVersionName, - apiVersion, - galleryImageVersion, - context); - } - - /** - * Create or update a gallery Image Version. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery in which the Image Definition resides. - * @param galleryImageName The name of the gallery Image Definition in which the Image Version is to be created. - * @param galleryImageVersionName The name of the gallery Image Version to be created. Needs to follow semantic - * version name pattern: The allowed characters are digit and period. Digits must be within the range of a - * 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch>. - * @param galleryImageVersion Specifies information about the gallery Image Version that you want to create or - * update. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Image Version that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginCreateOrUpdateWithoutPollingAsync( - String resourceGroupName, - String galleryName, - String galleryImageName, - String galleryImageVersionName, - GalleryImageVersionInner galleryImageVersion) { - return beginCreateOrUpdateWithoutPollingWithResponseAsync( - resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, galleryImageVersion) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Create or update a gallery Image Version. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery in which the Image Definition resides. - * @param galleryImageName The name of the gallery Image Definition in which the Image Version is to be created. - * @param galleryImageVersionName The name of the gallery Image Version to be created. Needs to follow semantic - * version name pattern: The allowed characters are digit and period. Digits must be within the range of a - * 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch>. - * @param galleryImageVersion Specifies information about the gallery Image Version that you want to create or - * update. - * @param context The context to associate with this 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 specifies information about the gallery Image Version that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginCreateOrUpdateWithoutPollingAsync( - String resourceGroupName, - String galleryName, - String galleryImageName, - String galleryImageVersionName, - GalleryImageVersionInner galleryImageVersion, - Context context) { - return beginCreateOrUpdateWithoutPollingWithResponseAsync( - resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, galleryImageVersion, context) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Create or update a gallery Image Version. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery in which the Image Definition resides. - * @param galleryImageName The name of the gallery Image Definition in which the Image Version is to be created. - * @param galleryImageVersionName The name of the gallery Image Version to be created. Needs to follow semantic - * version name pattern: The allowed characters are digit and period. Digits must be within the range of a - * 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch>. - * @param galleryImageVersion Specifies information about the gallery Image Version that you want to create or - * update. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Image Version that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public GalleryImageVersionInner beginCreateOrUpdateWithoutPolling( - String resourceGroupName, - String galleryName, - String galleryImageName, - String galleryImageVersionName, - GalleryImageVersionInner galleryImageVersion) { - return beginCreateOrUpdateWithoutPollingAsync( - resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, galleryImageVersion) - .block(); - } - - /** - * Create or update a gallery Image Version. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery in which the Image Definition resides. - * @param galleryImageName The name of the gallery Image Definition in which the Image Version is to be created. - * @param galleryImageVersionName The name of the gallery Image Version to be created. Needs to follow semantic - * version name pattern: The allowed characters are digit and period. Digits must be within the range of a - * 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch>. - * @param galleryImageVersion Specifies information about the gallery Image Version that you want to create or - * update. - * @param context The context to associate with this 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 specifies information about the gallery Image Version that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public GalleryImageVersionInner beginCreateOrUpdateWithoutPolling( - String resourceGroupName, - String galleryName, - String galleryImageName, - String galleryImageVersionName, - GalleryImageVersionInner galleryImageVersion, - Context context) { - return beginCreateOrUpdateWithoutPollingAsync( - resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, galleryImageVersion, context) - .block(); - } - - /** - * Update a gallery Image Version. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery in which the Image Definition resides. - * @param galleryImageName The name of the gallery Image Definition in which the Image Version is to be updated. - * @param galleryImageVersionName The name of the gallery Image Version to be updated. Needs to follow semantic - * version name pattern: The allowed characters are digit and period. Digits must be within the range of a - * 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch>. - * @param galleryImageVersion Specifies information about the gallery Image Version that you want to update. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Image Version that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginUpdateWithoutPollingWithResponseAsync( - String resourceGroupName, - String galleryName, - String galleryImageName, - String galleryImageVersionName, - GalleryImageVersionUpdate galleryImageVersion) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (galleryName == null) { - return Mono.error(new IllegalArgumentException("Parameter galleryName is required and cannot be null.")); - } - if (galleryImageName == null) { - return Mono - .error(new IllegalArgumentException("Parameter galleryImageName is required and cannot be null.")); - } - if (galleryImageVersionName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter galleryImageVersionName is required and cannot be null.")); - } - if (galleryImageVersion == null) { - return Mono - .error(new IllegalArgumentException("Parameter galleryImageVersion is required and cannot be null.")); - } else { - galleryImageVersion.validate(); - } - final String apiVersion = "2019-12-01"; - return FluxUtil - .withContext( - context -> - service - .beginUpdateWithoutPolling( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - galleryName, - galleryImageName, - galleryImageVersionName, - apiVersion, - galleryImageVersion, - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Update a gallery Image Version. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery in which the Image Definition resides. - * @param galleryImageName The name of the gallery Image Definition in which the Image Version is to be updated. - * @param galleryImageVersionName The name of the gallery Image Version to be updated. Needs to follow semantic - * version name pattern: The allowed characters are digit and period. Digits must be within the range of a - * 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch>. - * @param galleryImageVersion Specifies information about the gallery Image Version that you want to update. - * @param context The context to associate with this 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 specifies information about the gallery Image Version that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginUpdateWithoutPollingWithResponseAsync( - String resourceGroupName, - String galleryName, - String galleryImageName, - String galleryImageVersionName, - GalleryImageVersionUpdate galleryImageVersion, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (galleryName == null) { - return Mono.error(new IllegalArgumentException("Parameter galleryName is required and cannot be null.")); - } - if (galleryImageName == null) { - return Mono - .error(new IllegalArgumentException("Parameter galleryImageName is required and cannot be null.")); - } - if (galleryImageVersionName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter galleryImageVersionName is required and cannot be null.")); - } - if (galleryImageVersion == null) { - return Mono - .error(new IllegalArgumentException("Parameter galleryImageVersion is required and cannot be null.")); - } else { - galleryImageVersion.validate(); - } - final String apiVersion = "2019-12-01"; - return service - .beginUpdateWithoutPolling( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - galleryName, - galleryImageName, - galleryImageVersionName, - apiVersion, - galleryImageVersion, - context); - } - - /** - * Update a gallery Image Version. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery in which the Image Definition resides. - * @param galleryImageName The name of the gallery Image Definition in which the Image Version is to be updated. - * @param galleryImageVersionName The name of the gallery Image Version to be updated. Needs to follow semantic - * version name pattern: The allowed characters are digit and period. Digits must be within the range of a - * 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch>. - * @param galleryImageVersion Specifies information about the gallery Image Version that you want to update. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Image Version that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginUpdateWithoutPollingAsync( - String resourceGroupName, - String galleryName, - String galleryImageName, - String galleryImageVersionName, - GalleryImageVersionUpdate galleryImageVersion) { - return beginUpdateWithoutPollingWithResponseAsync( - resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, galleryImageVersion) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Update a gallery Image Version. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery in which the Image Definition resides. - * @param galleryImageName The name of the gallery Image Definition in which the Image Version is to be updated. - * @param galleryImageVersionName The name of the gallery Image Version to be updated. Needs to follow semantic - * version name pattern: The allowed characters are digit and period. Digits must be within the range of a - * 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch>. - * @param galleryImageVersion Specifies information about the gallery Image Version that you want to update. - * @param context The context to associate with this 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 specifies information about the gallery Image Version that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginUpdateWithoutPollingAsync( - String resourceGroupName, - String galleryName, - String galleryImageName, - String galleryImageVersionName, - GalleryImageVersionUpdate galleryImageVersion, - Context context) { - return beginUpdateWithoutPollingWithResponseAsync( - resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, galleryImageVersion, context) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Update a gallery Image Version. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery in which the Image Definition resides. - * @param galleryImageName The name of the gallery Image Definition in which the Image Version is to be updated. - * @param galleryImageVersionName The name of the gallery Image Version to be updated. Needs to follow semantic - * version name pattern: The allowed characters are digit and period. Digits must be within the range of a - * 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch>. - * @param galleryImageVersion Specifies information about the gallery Image Version that you want to update. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Image Version that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public GalleryImageVersionInner beginUpdateWithoutPolling( - String resourceGroupName, - String galleryName, - String galleryImageName, - String galleryImageVersionName, - GalleryImageVersionUpdate galleryImageVersion) { - return beginUpdateWithoutPollingAsync( - resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, galleryImageVersion) - .block(); - } - - /** - * Update a gallery Image Version. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery in which the Image Definition resides. - * @param galleryImageName The name of the gallery Image Definition in which the Image Version is to be updated. - * @param galleryImageVersionName The name of the gallery Image Version to be updated. Needs to follow semantic - * version name pattern: The allowed characters are digit and period. Digits must be within the range of a - * 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch>. - * @param galleryImageVersion Specifies information about the gallery Image Version that you want to update. - * @param context The context to associate with this 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 specifies information about the gallery Image Version that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public GalleryImageVersionInner beginUpdateWithoutPolling( - String resourceGroupName, - String galleryName, - String galleryImageName, - String galleryImageVersionName, - GalleryImageVersionUpdate galleryImageVersion, - Context context) { - return beginUpdateWithoutPollingAsync( - resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, galleryImageVersion, context) - .block(); - } - - /** - * Delete a gallery Image Version. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery in which the Image Definition resides. - * @param galleryImageName The name of the gallery Image Definition in which the Image Version resides. - * @param galleryImageVersionName The name of the gallery Image Version to be deleted. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginDeleteWithoutPollingWithResponseAsync( - String resourceGroupName, String galleryName, String galleryImageName, String galleryImageVersionName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (galleryName == null) { - return Mono.error(new IllegalArgumentException("Parameter galleryName is required and cannot be null.")); - } - if (galleryImageName == null) { - return Mono - .error(new IllegalArgumentException("Parameter galleryImageName is required and cannot be null.")); - } - if (galleryImageVersionName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter galleryImageVersionName is required and cannot be null.")); - } - final String apiVersion = "2019-12-01"; - return FluxUtil - .withContext( - context -> - service - .beginDeleteWithoutPolling( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - galleryName, - galleryImageName, - galleryImageVersionName, - apiVersion, - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Delete a gallery Image Version. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery in which the Image Definition resides. - * @param galleryImageName The name of the gallery Image Definition in which the Image Version resides. - * @param galleryImageVersionName The name of the gallery Image Version to be deleted. - * @param context The context to associate with this 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 completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginDeleteWithoutPollingWithResponseAsync( - String resourceGroupName, - String galleryName, - String galleryImageName, - String galleryImageVersionName, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (galleryName == null) { - return Mono.error(new IllegalArgumentException("Parameter galleryName is required and cannot be null.")); - } - if (galleryImageName == null) { - return Mono - .error(new IllegalArgumentException("Parameter galleryImageName is required and cannot be null.")); - } - if (galleryImageVersionName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter galleryImageVersionName is required and cannot be null.")); - } - final String apiVersion = "2019-12-01"; - return service - .beginDeleteWithoutPolling( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - galleryName, - galleryImageName, - galleryImageVersionName, - apiVersion, - context); - } - - /** - * Delete a gallery Image Version. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery in which the Image Definition resides. - * @param galleryImageName The name of the gallery Image Definition in which the Image Version resides. - * @param galleryImageVersionName The name of the gallery Image Version to be deleted. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginDeleteWithoutPollingAsync( - String resourceGroupName, String galleryName, String galleryImageName, String galleryImageVersionName) { - return beginDeleteWithoutPollingWithResponseAsync( - resourceGroupName, galleryName, galleryImageName, galleryImageVersionName) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Delete a gallery Image Version. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery in which the Image Definition resides. - * @param galleryImageName The name of the gallery Image Definition in which the Image Version resides. - * @param galleryImageVersionName The name of the gallery Image Version to be deleted. - * @param context The context to associate with this 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 completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginDeleteWithoutPollingAsync( - String resourceGroupName, - String galleryName, - String galleryImageName, - String galleryImageVersionName, - Context context) { - return beginDeleteWithoutPollingWithResponseAsync( - resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, context) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Delete a gallery Image Version. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery in which the Image Definition resides. - * @param galleryImageName The name of the gallery Image Definition in which the Image Version resides. - * @param galleryImageVersionName The name of the gallery Image Version to be deleted. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void beginDeleteWithoutPolling( - String resourceGroupName, String galleryName, String galleryImageName, String galleryImageVersionName) { - beginDeleteWithoutPollingAsync(resourceGroupName, galleryName, galleryImageName, galleryImageVersionName) - .block(); - } - - /** - * Delete a gallery Image Version. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery in which the Image Definition resides. - * @param galleryImageName The name of the gallery Image Definition in which the Image Version resides. - * @param galleryImageVersionName The name of the gallery Image Version to be deleted. - * @param context The context to associate with this 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. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void beginDeleteWithoutPolling( - String resourceGroupName, - String galleryName, - String galleryImageName, - String galleryImageVersionName, - Context context) { - beginDeleteWithoutPollingAsync( - resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, context) - .block(); - } - /** * Get the next page of items. * @@ -2578,6 +1775,7 @@ public Mono> listByGalleryImageNextSingl if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listByGalleryImageNext(nextLink, context) .map( diff --git a/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/GalleryImagesClient.java b/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/GalleryImagesClient.java index 45cf925620a81..5244e88152089 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/GalleryImagesClient.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/GalleryImagesClient.java @@ -144,53 +144,6 @@ Mono> listByGallery( @QueryParam("api-version") String apiVersion, Context context); - @Headers({"Accept: application/json", "Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries" - + "/{galleryName}/images/{galleryImageName}") - @ExpectedResponses({200, 201, 202}) - @UnexpectedResponseExceptionType(ApiErrorException.class) - Mono> beginCreateOrUpdateWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("galleryName") String galleryName, - @PathParam("galleryImageName") String galleryImageName, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") GalleryImageInner galleryImage, - Context context); - - @Headers({"Accept: application/json", "Content-Type: application/json"}) - @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries" - + "/{galleryName}/images/{galleryImageName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ApiErrorException.class) - Mono> beginUpdateWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("galleryName") String galleryName, - @PathParam("galleryImageName") String galleryImageName, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") GalleryImageUpdate galleryImage, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries" - + "/{galleryName}/images/{galleryImageName}") - @ExpectedResponses({200, 202, 204}) - @UnexpectedResponseExceptionType(ApiErrorException.class) - Mono> beginDeleteWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("galleryName") String galleryName, - @PathParam("galleryImageName") String galleryImageName, - @QueryParam("api-version") String apiVersion, - Context context); - @Headers({"Accept: application/json", "Content-Type: application/json"}) @Get("{nextLink}") @ExpectedResponses({200}) @@ -312,6 +265,7 @@ public Mono>> createOrUpdateWithResponseAsync( galleryImage.validate(); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .createOrUpdate( this.client.getEndpoint(), @@ -444,7 +398,7 @@ public Mono createOrUpdateAsync( String resourceGroupName, String galleryName, String galleryImageName, GalleryImageInner galleryImage) { return beginCreateOrUpdateAsync(resourceGroupName, galleryName, galleryImageName, galleryImage) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -471,7 +425,7 @@ public Mono createOrUpdateAsync( Context context) { return beginCreateOrUpdateAsync(resourceGroupName, galleryName, galleryImageName, galleryImage, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -632,6 +586,7 @@ public Mono>> updateWithResponseAsync( galleryImage.validate(); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .update( this.client.getEndpoint(), @@ -764,7 +719,7 @@ public Mono updateAsync( String resourceGroupName, String galleryName, String galleryImageName, GalleryImageUpdate galleryImage) { return beginUpdateAsync(resourceGroupName, galleryName, galleryImageName, galleryImage) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -791,7 +746,7 @@ public Mono updateAsync( Context context) { return beginUpdateAsync(resourceGroupName, galleryName, galleryImageName, galleryImage, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -931,6 +886,7 @@ public Mono> getWithResponseAsync( .error(new IllegalArgumentException("Parameter galleryImageName is required and cannot be null.")); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .get( this.client.getEndpoint(), @@ -1118,6 +1074,7 @@ public Mono>> deleteWithResponseAsync( .error(new IllegalArgumentException("Parameter galleryImageName is required and cannot be null.")); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .delete( this.client.getEndpoint(), @@ -1218,7 +1175,7 @@ public SyncPoller, Void> beginDelete( public Mono deleteAsync(String resourceGroupName, String galleryName, String galleryImageName) { return beginDeleteAsync(resourceGroupName, galleryName, galleryImageName) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -1238,7 +1195,7 @@ public Mono deleteAsync( String resourceGroupName, String galleryName, String galleryImageName, Context context) { return beginDeleteAsync(resourceGroupName, galleryName, galleryImageName, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -1362,6 +1319,7 @@ public Mono> listByGallerySinglePageAsync( return Mono.error(new IllegalArgumentException("Parameter galleryName is required and cannot be null.")); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .listByGallery( this.client.getEndpoint(), @@ -1449,648 +1407,6 @@ public PagedIterable listByGallery( return new PagedIterable<>(listByGalleryAsync(resourceGroupName, galleryName, context)); } - /** - * Create or update a gallery Image Definition. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery in which the Image Definition is to be created. - * @param galleryImageName The name of the gallery Image Definition to be created or updated. The allowed characters - * are alphabets and numbers with dots, dashes, and periods allowed in the middle. The maximum length is 80 - * characters. - * @param galleryImage Specifies information about the gallery Image Definition that you want to create or update. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Image Definition that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginCreateOrUpdateWithoutPollingWithResponseAsync( - String resourceGroupName, String galleryName, String galleryImageName, GalleryImageInner galleryImage) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (galleryName == null) { - return Mono.error(new IllegalArgumentException("Parameter galleryName is required and cannot be null.")); - } - if (galleryImageName == null) { - return Mono - .error(new IllegalArgumentException("Parameter galleryImageName is required and cannot be null.")); - } - if (galleryImage == null) { - return Mono.error(new IllegalArgumentException("Parameter galleryImage is required and cannot be null.")); - } else { - galleryImage.validate(); - } - final String apiVersion = "2019-12-01"; - return FluxUtil - .withContext( - context -> - service - .beginCreateOrUpdateWithoutPolling( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - galleryName, - galleryImageName, - apiVersion, - galleryImage, - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Create or update a gallery Image Definition. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery in which the Image Definition is to be created. - * @param galleryImageName The name of the gallery Image Definition to be created or updated. The allowed characters - * are alphabets and numbers with dots, dashes, and periods allowed in the middle. The maximum length is 80 - * characters. - * @param galleryImage Specifies information about the gallery Image Definition that you want to create or update. - * @param context The context to associate with this 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 specifies information about the gallery Image Definition that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginCreateOrUpdateWithoutPollingWithResponseAsync( - String resourceGroupName, - String galleryName, - String galleryImageName, - GalleryImageInner galleryImage, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (galleryName == null) { - return Mono.error(new IllegalArgumentException("Parameter galleryName is required and cannot be null.")); - } - if (galleryImageName == null) { - return Mono - .error(new IllegalArgumentException("Parameter galleryImageName is required and cannot be null.")); - } - if (galleryImage == null) { - return Mono.error(new IllegalArgumentException("Parameter galleryImage is required and cannot be null.")); - } else { - galleryImage.validate(); - } - final String apiVersion = "2019-12-01"; - return service - .beginCreateOrUpdateWithoutPolling( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - galleryName, - galleryImageName, - apiVersion, - galleryImage, - context); - } - - /** - * Create or update a gallery Image Definition. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery in which the Image Definition is to be created. - * @param galleryImageName The name of the gallery Image Definition to be created or updated. The allowed characters - * are alphabets and numbers with dots, dashes, and periods allowed in the middle. The maximum length is 80 - * characters. - * @param galleryImage Specifies information about the gallery Image Definition that you want to create or update. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Image Definition that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginCreateOrUpdateWithoutPollingAsync( - String resourceGroupName, String galleryName, String galleryImageName, GalleryImageInner galleryImage) { - return beginCreateOrUpdateWithoutPollingWithResponseAsync( - resourceGroupName, galleryName, galleryImageName, galleryImage) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Create or update a gallery Image Definition. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery in which the Image Definition is to be created. - * @param galleryImageName The name of the gallery Image Definition to be created or updated. The allowed characters - * are alphabets and numbers with dots, dashes, and periods allowed in the middle. The maximum length is 80 - * characters. - * @param galleryImage Specifies information about the gallery Image Definition that you want to create or update. - * @param context The context to associate with this 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 specifies information about the gallery Image Definition that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginCreateOrUpdateWithoutPollingAsync( - String resourceGroupName, - String galleryName, - String galleryImageName, - GalleryImageInner galleryImage, - Context context) { - return beginCreateOrUpdateWithoutPollingWithResponseAsync( - resourceGroupName, galleryName, galleryImageName, galleryImage, context) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Create or update a gallery Image Definition. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery in which the Image Definition is to be created. - * @param galleryImageName The name of the gallery Image Definition to be created or updated. The allowed characters - * are alphabets and numbers with dots, dashes, and periods allowed in the middle. The maximum length is 80 - * characters. - * @param galleryImage Specifies information about the gallery Image Definition that you want to create or update. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Image Definition that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public GalleryImageInner beginCreateOrUpdateWithoutPolling( - String resourceGroupName, String galleryName, String galleryImageName, GalleryImageInner galleryImage) { - return beginCreateOrUpdateWithoutPollingAsync(resourceGroupName, galleryName, galleryImageName, galleryImage) - .block(); - } - - /** - * Create or update a gallery Image Definition. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery in which the Image Definition is to be created. - * @param galleryImageName The name of the gallery Image Definition to be created or updated. The allowed characters - * are alphabets and numbers with dots, dashes, and periods allowed in the middle. The maximum length is 80 - * characters. - * @param galleryImage Specifies information about the gallery Image Definition that you want to create or update. - * @param context The context to associate with this 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 specifies information about the gallery Image Definition that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public GalleryImageInner beginCreateOrUpdateWithoutPolling( - String resourceGroupName, - String galleryName, - String galleryImageName, - GalleryImageInner galleryImage, - Context context) { - return beginCreateOrUpdateWithoutPollingAsync( - resourceGroupName, galleryName, galleryImageName, galleryImage, context) - .block(); - } - - /** - * Update a gallery Image Definition. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery in which the Image Definition is to be updated. - * @param galleryImageName The name of the gallery Image Definition to be updated. The allowed characters are - * alphabets and numbers with dots, dashes, and periods allowed in the middle. The maximum length is 80 - * characters. - * @param galleryImage Specifies information about the gallery Image Definition that you want to update. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Image Definition that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginUpdateWithoutPollingWithResponseAsync( - String resourceGroupName, String galleryName, String galleryImageName, GalleryImageUpdate galleryImage) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (galleryName == null) { - return Mono.error(new IllegalArgumentException("Parameter galleryName is required and cannot be null.")); - } - if (galleryImageName == null) { - return Mono - .error(new IllegalArgumentException("Parameter galleryImageName is required and cannot be null.")); - } - if (galleryImage == null) { - return Mono.error(new IllegalArgumentException("Parameter galleryImage is required and cannot be null.")); - } else { - galleryImage.validate(); - } - final String apiVersion = "2019-12-01"; - return FluxUtil - .withContext( - context -> - service - .beginUpdateWithoutPolling( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - galleryName, - galleryImageName, - apiVersion, - galleryImage, - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Update a gallery Image Definition. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery in which the Image Definition is to be updated. - * @param galleryImageName The name of the gallery Image Definition to be updated. The allowed characters are - * alphabets and numbers with dots, dashes, and periods allowed in the middle. The maximum length is 80 - * characters. - * @param galleryImage Specifies information about the gallery Image Definition that you want to update. - * @param context The context to associate with this 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 specifies information about the gallery Image Definition that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginUpdateWithoutPollingWithResponseAsync( - String resourceGroupName, - String galleryName, - String galleryImageName, - GalleryImageUpdate galleryImage, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (galleryName == null) { - return Mono.error(new IllegalArgumentException("Parameter galleryName is required and cannot be null.")); - } - if (galleryImageName == null) { - return Mono - .error(new IllegalArgumentException("Parameter galleryImageName is required and cannot be null.")); - } - if (galleryImage == null) { - return Mono.error(new IllegalArgumentException("Parameter galleryImage is required and cannot be null.")); - } else { - galleryImage.validate(); - } - final String apiVersion = "2019-12-01"; - return service - .beginUpdateWithoutPolling( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - galleryName, - galleryImageName, - apiVersion, - galleryImage, - context); - } - - /** - * Update a gallery Image Definition. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery in which the Image Definition is to be updated. - * @param galleryImageName The name of the gallery Image Definition to be updated. The allowed characters are - * alphabets and numbers with dots, dashes, and periods allowed in the middle. The maximum length is 80 - * characters. - * @param galleryImage Specifies information about the gallery Image Definition that you want to update. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Image Definition that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginUpdateWithoutPollingAsync( - String resourceGroupName, String galleryName, String galleryImageName, GalleryImageUpdate galleryImage) { - return beginUpdateWithoutPollingWithResponseAsync( - resourceGroupName, galleryName, galleryImageName, galleryImage) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Update a gallery Image Definition. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery in which the Image Definition is to be updated. - * @param galleryImageName The name of the gallery Image Definition to be updated. The allowed characters are - * alphabets and numbers with dots, dashes, and periods allowed in the middle. The maximum length is 80 - * characters. - * @param galleryImage Specifies information about the gallery Image Definition that you want to update. - * @param context The context to associate with this 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 specifies information about the gallery Image Definition that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginUpdateWithoutPollingAsync( - String resourceGroupName, - String galleryName, - String galleryImageName, - GalleryImageUpdate galleryImage, - Context context) { - return beginUpdateWithoutPollingWithResponseAsync( - resourceGroupName, galleryName, galleryImageName, galleryImage, context) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Update a gallery Image Definition. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery in which the Image Definition is to be updated. - * @param galleryImageName The name of the gallery Image Definition to be updated. The allowed characters are - * alphabets and numbers with dots, dashes, and periods allowed in the middle. The maximum length is 80 - * characters. - * @param galleryImage Specifies information about the gallery Image Definition that you want to update. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Image Definition that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public GalleryImageInner beginUpdateWithoutPolling( - String resourceGroupName, String galleryName, String galleryImageName, GalleryImageUpdate galleryImage) { - return beginUpdateWithoutPollingAsync(resourceGroupName, galleryName, galleryImageName, galleryImage).block(); - } - - /** - * Update a gallery Image Definition. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery in which the Image Definition is to be updated. - * @param galleryImageName The name of the gallery Image Definition to be updated. The allowed characters are - * alphabets and numbers with dots, dashes, and periods allowed in the middle. The maximum length is 80 - * characters. - * @param galleryImage Specifies information about the gallery Image Definition that you want to update. - * @param context The context to associate with this 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 specifies information about the gallery Image Definition that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public GalleryImageInner beginUpdateWithoutPolling( - String resourceGroupName, - String galleryName, - String galleryImageName, - GalleryImageUpdate galleryImage, - Context context) { - return beginUpdateWithoutPollingAsync(resourceGroupName, galleryName, galleryImageName, galleryImage, context) - .block(); - } - - /** - * Delete a gallery image. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery in which the Image Definition is to be deleted. - * @param galleryImageName The name of the gallery Image Definition to be deleted. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginDeleteWithoutPollingWithResponseAsync( - String resourceGroupName, String galleryName, String galleryImageName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (galleryName == null) { - return Mono.error(new IllegalArgumentException("Parameter galleryName is required and cannot be null.")); - } - if (galleryImageName == null) { - return Mono - .error(new IllegalArgumentException("Parameter galleryImageName is required and cannot be null.")); - } - final String apiVersion = "2019-12-01"; - return FluxUtil - .withContext( - context -> - service - .beginDeleteWithoutPolling( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - galleryName, - galleryImageName, - apiVersion, - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Delete a gallery image. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery in which the Image Definition is to be deleted. - * @param galleryImageName The name of the gallery Image Definition to be deleted. - * @param context The context to associate with this 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 completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginDeleteWithoutPollingWithResponseAsync( - String resourceGroupName, String galleryName, String galleryImageName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (galleryName == null) { - return Mono.error(new IllegalArgumentException("Parameter galleryName is required and cannot be null.")); - } - if (galleryImageName == null) { - return Mono - .error(new IllegalArgumentException("Parameter galleryImageName is required and cannot be null.")); - } - final String apiVersion = "2019-12-01"; - return service - .beginDeleteWithoutPolling( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - galleryName, - galleryImageName, - apiVersion, - context); - } - - /** - * Delete a gallery image. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery in which the Image Definition is to be deleted. - * @param galleryImageName The name of the gallery Image Definition to be deleted. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginDeleteWithoutPollingAsync( - String resourceGroupName, String galleryName, String galleryImageName) { - return beginDeleteWithoutPollingWithResponseAsync(resourceGroupName, galleryName, galleryImageName) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Delete a gallery image. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery in which the Image Definition is to be deleted. - * @param galleryImageName The name of the gallery Image Definition to be deleted. - * @param context The context to associate with this 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 completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginDeleteWithoutPollingAsync( - String resourceGroupName, String galleryName, String galleryImageName, Context context) { - return beginDeleteWithoutPollingWithResponseAsync(resourceGroupName, galleryName, galleryImageName, context) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Delete a gallery image. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery in which the Image Definition is to be deleted. - * @param galleryImageName The name of the gallery Image Definition to be deleted. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void beginDeleteWithoutPolling(String resourceGroupName, String galleryName, String galleryImageName) { - beginDeleteWithoutPollingAsync(resourceGroupName, galleryName, galleryImageName).block(); - } - - /** - * Delete a gallery image. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery in which the Image Definition is to be deleted. - * @param galleryImageName The name of the gallery Image Definition to be deleted. - * @param context The context to associate with this 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. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void beginDeleteWithoutPolling( - String resourceGroupName, String galleryName, String galleryImageName, Context context) { - beginDeleteWithoutPollingAsync(resourceGroupName, galleryName, galleryImageName, context).block(); - } - /** * Get the next page of items. * @@ -2134,6 +1450,7 @@ public Mono> listByGalleryNextSinglePageAsync(S if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listByGalleryNext(nextLink, context) .map( diff --git a/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/ImagesClient.java b/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/ImagesClient.java index e2a752d015cca..9a06ed1154f80 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/ImagesClient.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/ImagesClient.java @@ -151,50 +151,6 @@ Mono> list( @PathParam("subscriptionId") String subscriptionId, Context context); - @Headers({"Accept: application/json", "Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/images" - + "/{imageName}") - @ExpectedResponses({200, 201}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> beginCreateOrUpdateWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("imageName") String imageName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") ImageInner parameters, - Context context); - - @Headers({"Accept: application/json", "Content-Type: application/json"}) - @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/images" - + "/{imageName}") - @ExpectedResponses({200, 201}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> beginUpdateWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("imageName") String imageName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") ImageUpdate parameters, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/images" - + "/{imageName}") - @ExpectedResponses({200, 202, 204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> beginDeleteWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("imageName") String imageName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - Context context); - @Headers({"Accept: application/json", "Content-Type: application/json"}) @Get("{nextLink}") @ExpectedResponses({200}) @@ -308,6 +264,7 @@ public Mono>> createOrUpdateWithResponseAsync( parameters.validate(); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .createOrUpdate( this.client.getEndpoint(), @@ -424,7 +381,7 @@ public SyncPoller, ImageInner> beginCreateOrUpdate( public Mono createOrUpdateAsync(String resourceGroupName, String imageName, ImageInner parameters) { return beginCreateOrUpdateAsync(resourceGroupName, imageName, parameters) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -446,7 +403,7 @@ public Mono createOrUpdateAsync( String resourceGroupName, String imageName, ImageInner parameters, Context context) { return beginCreateOrUpdateAsync(resourceGroupName, imageName, parameters, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -581,6 +538,7 @@ public Mono>> updateWithResponseAsync( parameters.validate(); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .update( this.client.getEndpoint(), @@ -686,7 +644,7 @@ public SyncPoller, ImageInner> beginUpdate( public Mono updateAsync(String resourceGroupName, String imageName, ImageUpdate parameters) { return beginUpdateAsync(resourceGroupName, imageName, parameters) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -706,7 +664,7 @@ public Mono updateAsync( String resourceGroupName, String imageName, ImageUpdate parameters, Context context) { return beginUpdateAsync(resourceGroupName, imageName, parameters, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -822,6 +780,7 @@ public Mono>> deleteWithResponseAsync( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .delete( this.client.getEndpoint(), @@ -909,7 +868,7 @@ public SyncPoller, Void> beginDelete(String resourceGroupName, */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono deleteAsync(String resourceGroupName, String imageName) { - return beginDeleteAsync(resourceGroupName, imageName).last().flatMap(client::getLroFinalResultOrError); + return beginDeleteAsync(resourceGroupName, imageName).last().flatMap(this.client::getLroFinalResultOrError); } /** @@ -927,7 +886,7 @@ public Mono deleteAsync(String resourceGroupName, String imageName) { public Mono deleteAsync(String resourceGroupName, String imageName, Context context) { return beginDeleteAsync(resourceGroupName, imageName, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -1043,6 +1002,7 @@ public Mono> getByResourceGroupWithResponseAsync( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .getByResourceGroup( this.client.getEndpoint(), @@ -1259,6 +1219,7 @@ public Mono> listByResourceGroupSinglePageAsync( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .listByResourceGroup( this.client.getEndpoint(), resourceGroupName, apiVersion, this.client.getSubscriptionId(), context) @@ -1399,6 +1360,7 @@ public Mono> listSinglePageAsync(Context context) { "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), context) .map( @@ -1468,551 +1430,6 @@ public PagedIterable list(Context context) { return new PagedIterable<>(listAsync(context)); } - /** - * Create or update an image. - * - * @param resourceGroupName The name of the resource group. - * @param imageName The name of the image. - * @param parameters The source user image virtual hard disk. The virtual hard disk will be copied before being - * attached to the virtual machine. If SourceImage is provided, the destination virtual hard drive must not - * exist. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the source user image virtual hard disk. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginCreateOrUpdateWithoutPollingWithResponseAsync( - String resourceGroupName, String imageName, ImageInner parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (imageName == null) { - return Mono.error(new IllegalArgumentException("Parameter imageName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2019-12-01"; - return FluxUtil - .withContext( - context -> - service - .beginCreateOrUpdateWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - imageName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Create or update an image. - * - * @param resourceGroupName The name of the resource group. - * @param imageName The name of the image. - * @param parameters The source user image virtual hard disk. The virtual hard disk will be copied before being - * attached to the virtual machine. If SourceImage is provided, the destination virtual hard drive must not - * exist. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the source user image virtual hard disk. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginCreateOrUpdateWithoutPollingWithResponseAsync( - String resourceGroupName, String imageName, ImageInner parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (imageName == null) { - return Mono.error(new IllegalArgumentException("Parameter imageName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2019-12-01"; - return service - .beginCreateOrUpdateWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - imageName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - context); - } - - /** - * Create or update an image. - * - * @param resourceGroupName The name of the resource group. - * @param imageName The name of the image. - * @param parameters The source user image virtual hard disk. The virtual hard disk will be copied before being - * attached to the virtual machine. If SourceImage is provided, the destination virtual hard drive must not - * exist. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the source user image virtual hard disk. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginCreateOrUpdateWithoutPollingAsync( - String resourceGroupName, String imageName, ImageInner parameters) { - return beginCreateOrUpdateWithoutPollingWithResponseAsync(resourceGroupName, imageName, parameters) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Create or update an image. - * - * @param resourceGroupName The name of the resource group. - * @param imageName The name of the image. - * @param parameters The source user image virtual hard disk. The virtual hard disk will be copied before being - * attached to the virtual machine. If SourceImage is provided, the destination virtual hard drive must not - * exist. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the source user image virtual hard disk. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginCreateOrUpdateWithoutPollingAsync( - String resourceGroupName, String imageName, ImageInner parameters, Context context) { - return beginCreateOrUpdateWithoutPollingWithResponseAsync(resourceGroupName, imageName, parameters, context) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Create or update an image. - * - * @param resourceGroupName The name of the resource group. - * @param imageName The name of the image. - * @param parameters The source user image virtual hard disk. The virtual hard disk will be copied before being - * attached to the virtual machine. If SourceImage is provided, the destination virtual hard drive must not - * exist. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the source user image virtual hard disk. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ImageInner beginCreateOrUpdateWithoutPolling( - String resourceGroupName, String imageName, ImageInner parameters) { - return beginCreateOrUpdateWithoutPollingAsync(resourceGroupName, imageName, parameters).block(); - } - - /** - * Create or update an image. - * - * @param resourceGroupName The name of the resource group. - * @param imageName The name of the image. - * @param parameters The source user image virtual hard disk. The virtual hard disk will be copied before being - * attached to the virtual machine. If SourceImage is provided, the destination virtual hard drive must not - * exist. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the source user image virtual hard disk. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ImageInner beginCreateOrUpdateWithoutPolling( - String resourceGroupName, String imageName, ImageInner parameters, Context context) { - return beginCreateOrUpdateWithoutPollingAsync(resourceGroupName, imageName, parameters, context).block(); - } - - /** - * Update an image. - * - * @param resourceGroupName The name of the resource group. - * @param imageName The name of the image. - * @param parameters The source user image virtual hard disk. Only tags may be updated. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the source user image virtual hard disk. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginUpdateWithoutPollingWithResponseAsync( - String resourceGroupName, String imageName, ImageUpdate parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (imageName == null) { - return Mono.error(new IllegalArgumentException("Parameter imageName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2019-12-01"; - return FluxUtil - .withContext( - context -> - service - .beginUpdateWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - imageName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Update an image. - * - * @param resourceGroupName The name of the resource group. - * @param imageName The name of the image. - * @param parameters The source user image virtual hard disk. Only tags may be updated. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the source user image virtual hard disk. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginUpdateWithoutPollingWithResponseAsync( - String resourceGroupName, String imageName, ImageUpdate parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (imageName == null) { - return Mono.error(new IllegalArgumentException("Parameter imageName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2019-12-01"; - return service - .beginUpdateWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - imageName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - context); - } - - /** - * Update an image. - * - * @param resourceGroupName The name of the resource group. - * @param imageName The name of the image. - * @param parameters The source user image virtual hard disk. Only tags may be updated. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the source user image virtual hard disk. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginUpdateWithoutPollingAsync( - String resourceGroupName, String imageName, ImageUpdate parameters) { - return beginUpdateWithoutPollingWithResponseAsync(resourceGroupName, imageName, parameters) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Update an image. - * - * @param resourceGroupName The name of the resource group. - * @param imageName The name of the image. - * @param parameters The source user image virtual hard disk. Only tags may be updated. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the source user image virtual hard disk. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginUpdateWithoutPollingAsync( - String resourceGroupName, String imageName, ImageUpdate parameters, Context context) { - return beginUpdateWithoutPollingWithResponseAsync(resourceGroupName, imageName, parameters, context) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Update an image. - * - * @param resourceGroupName The name of the resource group. - * @param imageName The name of the image. - * @param parameters The source user image virtual hard disk. Only tags may be updated. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the source user image virtual hard disk. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ImageInner beginUpdateWithoutPolling(String resourceGroupName, String imageName, ImageUpdate parameters) { - return beginUpdateWithoutPollingAsync(resourceGroupName, imageName, parameters).block(); - } - - /** - * Update an image. - * - * @param resourceGroupName The name of the resource group. - * @param imageName The name of the image. - * @param parameters The source user image virtual hard disk. Only tags may be updated. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the source user image virtual hard disk. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ImageInner beginUpdateWithoutPolling( - String resourceGroupName, String imageName, ImageUpdate parameters, Context context) { - return beginUpdateWithoutPollingAsync(resourceGroupName, imageName, parameters, context).block(); - } - - /** - * Deletes an Image. - * - * @param resourceGroupName The name of the resource group. - * @param imageName The name of the image. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginDeleteWithoutPollingWithResponseAsync(String resourceGroupName, String imageName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (imageName == null) { - return Mono.error(new IllegalArgumentException("Parameter imageName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2019-12-01"; - return FluxUtil - .withContext( - context -> - service - .beginDeleteWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - imageName, - apiVersion, - this.client.getSubscriptionId(), - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Deletes an Image. - * - * @param resourceGroupName The name of the resource group. - * @param imageName The name of the image. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginDeleteWithoutPollingWithResponseAsync( - String resourceGroupName, String imageName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (imageName == null) { - return Mono.error(new IllegalArgumentException("Parameter imageName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2019-12-01"; - return service - .beginDeleteWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - imageName, - apiVersion, - this.client.getSubscriptionId(), - context); - } - - /** - * Deletes an Image. - * - * @param resourceGroupName The name of the resource group. - * @param imageName The name of the image. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginDeleteWithoutPollingAsync(String resourceGroupName, String imageName) { - return beginDeleteWithoutPollingWithResponseAsync(resourceGroupName, imageName) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Deletes an Image. - * - * @param resourceGroupName The name of the resource group. - * @param imageName The name of the image. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginDeleteWithoutPollingAsync(String resourceGroupName, String imageName, Context context) { - return beginDeleteWithoutPollingWithResponseAsync(resourceGroupName, imageName, context) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Deletes an Image. - * - * @param resourceGroupName The name of the resource group. - * @param imageName The name of the image. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void beginDeleteWithoutPolling(String resourceGroupName, String imageName) { - beginDeleteWithoutPollingAsync(resourceGroupName, imageName).block(); - } - - /** - * Deletes an Image. - * - * @param resourceGroupName The name of the resource group. - * @param imageName The name of the image. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void beginDeleteWithoutPolling(String resourceGroupName, String imageName, Context context) { - beginDeleteWithoutPollingAsync(resourceGroupName, imageName, context).block(); - } - /** * Get the next page of items. * @@ -2056,6 +1473,7 @@ public Mono> listByResourceGroupNextSinglePageAsync(St if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listByResourceGroupNext(nextLink, context) .map( @@ -2112,6 +1530,7 @@ public Mono> listNextSinglePageAsync(String nextLink, if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listNext(nextLink, context) .map( diff --git a/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/LogAnalyticsClient.java b/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/LogAnalyticsClient.java index 3e5652556eba7..e028c7cb9ce04 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/LogAnalyticsClient.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/LogAnalyticsClient.java @@ -88,34 +88,6 @@ Mono>> exportThrottledRequests( @PathParam("subscriptionId") String subscriptionId, @BodyParam("application/json") LogAnalyticsInputBase parameters, Context context); - - @Headers({"Accept: application/json", "Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/logAnalytics/apiAccess" - + "/getRequestRateByInterval") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> beginExportRequestRateByIntervalWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("location") String location, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") RequestRateByIntervalInput parameters, - Context context); - - @Headers({"Accept: application/json", "Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/logAnalytics/apiAccess" - + "/getThrottledRequests") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> beginExportThrottledRequestsWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("location") String location, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") LogAnalyticsInputBase parameters, - Context context); } /** @@ -203,6 +175,7 @@ public Mono>> exportRequestRateByIntervalWithResponseA parameters.validate(); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .exportRequestRateByInterval( this.client.getEndpoint(), location, apiVersion, this.client.getSubscriptionId(), parameters, context); @@ -309,7 +282,7 @@ public Mono exportRequestRateByIntervalAsync( String location, RequestRateByIntervalInput parameters) { return beginExportRequestRateByIntervalAsync(location, parameters) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -329,7 +302,7 @@ public Mono exportRequestRateByIntervalAsync( String location, RequestRateByIntervalInput parameters, Context context) { return beginExportRequestRateByIntervalAsync(location, parameters, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -450,6 +423,7 @@ public Mono>> exportThrottledRequestsWithResponseAsync parameters.validate(); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .exportThrottledRequests( this.client.getEndpoint(), location, apiVersion, this.client.getSubscriptionId(), parameters, context); @@ -550,7 +524,7 @@ public Mono exportThrottledRequestsAsync( String location, LogAnalyticsInputBase parameters) { return beginExportThrottledRequestsAsync(location, parameters) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -569,7 +543,7 @@ public Mono exportThrottledRequestsAsync( String location, LogAnalyticsInputBase parameters, Context context) { return beginExportThrottledRequestsAsync(location, parameters, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -603,352 +577,4 @@ public LogAnalyticsOperationResultInner exportThrottledRequests( String location, LogAnalyticsInputBase parameters, Context context) { return exportThrottledRequestsAsync(location, parameters, context).block(); } - - /** - * Export logs that show Api requests made by this subscription in the given time window to show throttling - * activities. - * - * @param location The location upon which virtual-machine-sizes is queried. - * @param parameters Api request input for LogAnalytics getRequestRateByInterval Api. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return logAnalytics operation status response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> - beginExportRequestRateByIntervalWithoutPollingWithResponseAsync( - String location, RequestRateByIntervalInput parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (location == null) { - return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2019-12-01"; - return FluxUtil - .withContext( - context -> - service - .beginExportRequestRateByIntervalWithoutPolling( - this.client.getEndpoint(), - location, - apiVersion, - this.client.getSubscriptionId(), - parameters, - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Export logs that show Api requests made by this subscription in the given time window to show throttling - * activities. - * - * @param location The location upon which virtual-machine-sizes is queried. - * @param parameters Api request input for LogAnalytics getRequestRateByInterval Api. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return logAnalytics operation status response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> - beginExportRequestRateByIntervalWithoutPollingWithResponseAsync( - String location, RequestRateByIntervalInput parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (location == null) { - return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2019-12-01"; - return service - .beginExportRequestRateByIntervalWithoutPolling( - this.client.getEndpoint(), location, apiVersion, this.client.getSubscriptionId(), parameters, context); - } - - /** - * Export logs that show Api requests made by this subscription in the given time window to show throttling - * activities. - * - * @param location The location upon which virtual-machine-sizes is queried. - * @param parameters Api request input for LogAnalytics getRequestRateByInterval Api. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return logAnalytics operation status response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginExportRequestRateByIntervalWithoutPollingAsync( - String location, RequestRateByIntervalInput parameters) { - return beginExportRequestRateByIntervalWithoutPollingWithResponseAsync(location, parameters) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Export logs that show Api requests made by this subscription in the given time window to show throttling - * activities. - * - * @param location The location upon which virtual-machine-sizes is queried. - * @param parameters Api request input for LogAnalytics getRequestRateByInterval Api. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return logAnalytics operation status response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginExportRequestRateByIntervalWithoutPollingAsync( - String location, RequestRateByIntervalInput parameters, Context context) { - return beginExportRequestRateByIntervalWithoutPollingWithResponseAsync(location, parameters, context) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Export logs that show Api requests made by this subscription in the given time window to show throttling - * activities. - * - * @param location The location upon which virtual-machine-sizes is queried. - * @param parameters Api request input for LogAnalytics getRequestRateByInterval Api. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return logAnalytics operation status response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public LogAnalyticsOperationResultInner beginExportRequestRateByIntervalWithoutPolling( - String location, RequestRateByIntervalInput parameters) { - return beginExportRequestRateByIntervalWithoutPollingAsync(location, parameters).block(); - } - - /** - * Export logs that show Api requests made by this subscription in the given time window to show throttling - * activities. - * - * @param location The location upon which virtual-machine-sizes is queried. - * @param parameters Api request input for LogAnalytics getRequestRateByInterval Api. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return logAnalytics operation status response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public LogAnalyticsOperationResultInner beginExportRequestRateByIntervalWithoutPolling( - String location, RequestRateByIntervalInput parameters, Context context) { - return beginExportRequestRateByIntervalWithoutPollingAsync(location, parameters, context).block(); - } - - /** - * Export logs that show total throttled Api requests for this subscription in the given time window. - * - * @param location The location upon which virtual-machine-sizes is queried. - * @param parameters Api input base class for LogAnalytics Api. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return logAnalytics operation status response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginExportThrottledRequestsWithoutPollingWithResponseAsync( - String location, LogAnalyticsInputBase parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (location == null) { - return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2019-12-01"; - return FluxUtil - .withContext( - context -> - service - .beginExportThrottledRequestsWithoutPolling( - this.client.getEndpoint(), - location, - apiVersion, - this.client.getSubscriptionId(), - parameters, - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Export logs that show total throttled Api requests for this subscription in the given time window. - * - * @param location The location upon which virtual-machine-sizes is queried. - * @param parameters Api input base class for LogAnalytics Api. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return logAnalytics operation status response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginExportThrottledRequestsWithoutPollingWithResponseAsync( - String location, LogAnalyticsInputBase parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (location == null) { - return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2019-12-01"; - return service - .beginExportThrottledRequestsWithoutPolling( - this.client.getEndpoint(), location, apiVersion, this.client.getSubscriptionId(), parameters, context); - } - - /** - * Export logs that show total throttled Api requests for this subscription in the given time window. - * - * @param location The location upon which virtual-machine-sizes is queried. - * @param parameters Api input base class for LogAnalytics Api. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return logAnalytics operation status response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginExportThrottledRequestsWithoutPollingAsync( - String location, LogAnalyticsInputBase parameters) { - return beginExportThrottledRequestsWithoutPollingWithResponseAsync(location, parameters) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Export logs that show total throttled Api requests for this subscription in the given time window. - * - * @param location The location upon which virtual-machine-sizes is queried. - * @param parameters Api input base class for LogAnalytics Api. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return logAnalytics operation status response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginExportThrottledRequestsWithoutPollingAsync( - String location, LogAnalyticsInputBase parameters, Context context) { - return beginExportThrottledRequestsWithoutPollingWithResponseAsync(location, parameters, context) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Export logs that show total throttled Api requests for this subscription in the given time window. - * - * @param location The location upon which virtual-machine-sizes is queried. - * @param parameters Api input base class for LogAnalytics Api. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return logAnalytics operation status response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public LogAnalyticsOperationResultInner beginExportThrottledRequestsWithoutPolling( - String location, LogAnalyticsInputBase parameters) { - return beginExportThrottledRequestsWithoutPollingAsync(location, parameters).block(); - } - - /** - * Export logs that show total throttled Api requests for this subscription in the given time window. - * - * @param location The location upon which virtual-machine-sizes is queried. - * @param parameters Api input base class for LogAnalytics Api. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return logAnalytics operation status response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public LogAnalyticsOperationResultInner beginExportThrottledRequestsWithoutPolling( - String location, LogAnalyticsInputBase parameters, Context context) { - return beginExportThrottledRequestsWithoutPollingAsync(location, parameters, context).block(); - } } diff --git a/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/OperationsClient.java b/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/OperationsClient.java index acfa82adde4b2..8dcd55d1b7e7b 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/OperationsClient.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/OperationsClient.java @@ -108,6 +108,7 @@ public Mono> listSinglePageAsync(Conte "Parameter this.client.getEndpoint() is required and cannot be null.")); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .list(this.client.getEndpoint(), apiVersion, context) .map( diff --git a/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/ProximityPlacementGroupsClient.java b/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/ProximityPlacementGroupsClient.java index 0e7920237e5ec..c0cceda83dc5e 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/ProximityPlacementGroupsClient.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/ProximityPlacementGroupsClient.java @@ -271,6 +271,7 @@ public Mono> createOrUpdateWithResponseAs parameters.validate(); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .createOrUpdate( this.client.getEndpoint(), @@ -468,6 +469,7 @@ public Mono> updateWithResponseAsync( final String apiVersion = "2019-12-01"; UpdateResource parameters = new UpdateResource(); parameters.withTags(tags); + context = this.client.mergeContext(context); return service .update( this.client.getEndpoint(), @@ -651,6 +653,7 @@ public Mono> deleteWithResponseAsync( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .delete( this.client.getEndpoint(), @@ -815,6 +818,7 @@ public Mono> getByResourceGroupWithRespon "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .getByResourceGroup( this.client.getEndpoint(), @@ -1026,6 +1030,7 @@ public Mono> listSinglePageAsync(Con "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), context) .map( @@ -1174,6 +1179,7 @@ public Mono> listByResourceGroupSing "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .listByResourceGroup( this.client.getEndpoint(), resourceGroupName, apiVersion, this.client.getSubscriptionId(), context) @@ -1294,6 +1300,7 @@ public Mono> listBySubscriptionNextS if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listBySubscriptionNext(nextLink, context) .map( @@ -1351,6 +1358,7 @@ public Mono> listByResourceGroupNext if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listByResourceGroupNext(nextLink, context) .map( diff --git a/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/ResourceSkusClient.java b/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/ResourceSkusClient.java index 26d1bb7b1b314..e1a493a133d3b 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/ResourceSkusClient.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/ResourceSkusClient.java @@ -143,6 +143,7 @@ public Mono> listSinglePageAsync(String filter, "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2019-04-01"; + context = this.client.mergeContext(context); return service .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), filter, context) .map( @@ -286,6 +287,7 @@ public Mono> listNextSinglePageAsync(String next if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listNext(nextLink, context) .map( diff --git a/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/SnapshotsClient.java b/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/SnapshotsClient.java index 32220bff368b5..ccb61f253f381 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/SnapshotsClient.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/SnapshotsClient.java @@ -183,79 +183,6 @@ Mono>> revokeAccess( @QueryParam("api-version") String apiVersion, Context context); - @Headers({"Accept: application/json", "Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots" - + "/{snapshotName}") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> beginCreateOrUpdateWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("snapshotName") String snapshotName, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") SnapshotInner snapshot, - Context context); - - @Headers({"Accept: application/json", "Content-Type: application/json"}) - @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots" - + "/{snapshotName}") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> beginUpdateWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("snapshotName") String snapshotName, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") SnapshotUpdate snapshot, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots" - + "/{snapshotName}") - @ExpectedResponses({200, 202, 204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> beginDeleteWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("snapshotName") String snapshotName, - @QueryParam("api-version") String apiVersion, - Context context); - - @Headers({"Accept: application/json", "Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots" - + "/{snapshotName}/beginGetAccess") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> beginGrantAccessWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("snapshotName") String snapshotName, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") GrantAccessData grantAccessData, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots" - + "/{snapshotName}/endGetAccess") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> beginRevokeAccessWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("snapshotName") String snapshotName, - @QueryParam("api-version") String apiVersion, - Context context); - @Headers({"Accept: application/json", "Content-Type: application/json"}) @Get("{nextLink}") @ExpectedResponses({200}) @@ -367,6 +294,7 @@ public Mono>> createOrUpdateWithResponseAsync( snapshot.validate(); } final String apiVersion = "2019-11-01"; + context = this.client.mergeContext(context); return service .createOrUpdate( this.client.getEndpoint(), @@ -479,7 +407,7 @@ public Mono createOrUpdateAsync( String resourceGroupName, String snapshotName, SnapshotInner snapshot) { return beginCreateOrUpdateAsync(resourceGroupName, snapshotName, snapshot) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -500,7 +428,7 @@ public Mono createOrUpdateAsync( String resourceGroupName, String snapshotName, SnapshotInner snapshot, Context context) { return beginCreateOrUpdateAsync(resourceGroupName, snapshotName, snapshot, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -635,6 +563,7 @@ public Mono>> updateWithResponseAsync( snapshot.validate(); } final String apiVersion = "2019-11-01"; + context = this.client.mergeContext(context); return service .update( this.client.getEndpoint(), @@ -745,7 +674,7 @@ public SyncPoller, SnapshotInner> beginUpdate( public Mono updateAsync(String resourceGroupName, String snapshotName, SnapshotUpdate snapshot) { return beginUpdateAsync(resourceGroupName, snapshotName, snapshot) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -766,7 +695,7 @@ public Mono updateAsync( String resourceGroupName, String snapshotName, SnapshotUpdate snapshot, Context context) { return beginUpdateAsync(resourceGroupName, snapshotName, snapshot, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -888,6 +817,7 @@ public Mono> getByResourceGroupWithResponseAsync( return Mono.error(new IllegalArgumentException("Parameter snapshotName is required and cannot be null.")); } final String apiVersion = "2019-11-01"; + context = this.client.mergeContext(context); return service .getByResourceGroup( this.client.getEndpoint(), @@ -1062,6 +992,7 @@ public Mono>> deleteWithResponseAsync( return Mono.error(new IllegalArgumentException("Parameter snapshotName is required and cannot be null.")); } final String apiVersion = "2019-11-01"; + context = this.client.mergeContext(context); return service .delete( this.client.getEndpoint(), @@ -1155,7 +1086,7 @@ public SyncPoller, Void> beginDelete( */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono deleteAsync(String resourceGroupName, String snapshotName) { - return beginDeleteAsync(resourceGroupName, snapshotName).last().flatMap(client::getLroFinalResultOrError); + return beginDeleteAsync(resourceGroupName, snapshotName).last().flatMap(this.client::getLroFinalResultOrError); } /** @@ -1174,7 +1105,7 @@ public Mono deleteAsync(String resourceGroupName, String snapshotName) { public Mono deleteAsync(String resourceGroupName, String snapshotName, Context context) { return beginDeleteAsync(resourceGroupName, snapshotName, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -1288,6 +1219,7 @@ public Mono> listByResourceGroupSinglePageAsync( .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } final String apiVersion = "2019-11-01"; + context = this.client.mergeContext(context); return service .listByResourceGroup( this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, apiVersion, context) @@ -1426,6 +1358,7 @@ public Mono> listSinglePageAsync(Context context) { "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2019-11-01"; + context = this.client.mergeContext(context); return service .list(this.client.getEndpoint(), this.client.getSubscriptionId(), apiVersion, context) .map( @@ -1589,6 +1522,7 @@ public Mono>> grantAccessWithResponseAsync( grantAccessData.validate(); } final String apiVersion = "2019-11-01"; + context = this.client.mergeContext(context); return service .grantAccess( this.client.getEndpoint(), @@ -1701,7 +1635,7 @@ public Mono grantAccessAsync( String resourceGroupName, String snapshotName, GrantAccessData grantAccessData) { return beginGrantAccessAsync(resourceGroupName, snapshotName, grantAccessData) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -1722,7 +1656,7 @@ public Mono grantAccessAsync( String resourceGroupName, String snapshotName, GrantAccessData grantAccessData, Context context) { return beginGrantAccessAsync(resourceGroupName, snapshotName, grantAccessData, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -1844,6 +1778,7 @@ public Mono>> revokeAccessWithResponseAsync( return Mono.error(new IllegalArgumentException("Parameter snapshotName is required and cannot be null.")); } final String apiVersion = "2019-11-01"; + context = this.client.mergeContext(context); return service .revokeAccess( this.client.getEndpoint(), @@ -1939,7 +1874,7 @@ public SyncPoller, Void> beginRevokeAccess( public Mono revokeAccessAsync(String resourceGroupName, String snapshotName) { return beginRevokeAccessAsync(resourceGroupName, snapshotName) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -1958,7 +1893,7 @@ public Mono revokeAccessAsync(String resourceGroupName, String snapshotNam public Mono revokeAccessAsync(String resourceGroupName, String snapshotName, Context context) { return beginRevokeAccessAsync(resourceGroupName, snapshotName, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -1992,919 +1927,6 @@ public void revokeAccess(String resourceGroupName, String snapshotName, Context revokeAccessAsync(resourceGroupName, snapshotName, context).block(); } - /** - * Creates or updates a snapshot. - * - * @param resourceGroupName The name of the resource group. - * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot - * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. - * @param snapshot Snapshot resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return snapshot resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginCreateOrUpdateWithoutPollingWithResponseAsync( - String resourceGroupName, String snapshotName, SnapshotInner snapshot) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (snapshotName == null) { - return Mono.error(new IllegalArgumentException("Parameter snapshotName is required and cannot be null.")); - } - if (snapshot == null) { - return Mono.error(new IllegalArgumentException("Parameter snapshot is required and cannot be null.")); - } else { - snapshot.validate(); - } - final String apiVersion = "2019-11-01"; - return FluxUtil - .withContext( - context -> - service - .beginCreateOrUpdateWithoutPolling( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - snapshotName, - apiVersion, - snapshot, - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Creates or updates a snapshot. - * - * @param resourceGroupName The name of the resource group. - * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot - * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. - * @param snapshot Snapshot resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return snapshot resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginCreateOrUpdateWithoutPollingWithResponseAsync( - String resourceGroupName, String snapshotName, SnapshotInner snapshot, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (snapshotName == null) { - return Mono.error(new IllegalArgumentException("Parameter snapshotName is required and cannot be null.")); - } - if (snapshot == null) { - return Mono.error(new IllegalArgumentException("Parameter snapshot is required and cannot be null.")); - } else { - snapshot.validate(); - } - final String apiVersion = "2019-11-01"; - return service - .beginCreateOrUpdateWithoutPolling( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - snapshotName, - apiVersion, - snapshot, - context); - } - - /** - * Creates or updates a snapshot. - * - * @param resourceGroupName The name of the resource group. - * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot - * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. - * @param snapshot Snapshot resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return snapshot resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginCreateOrUpdateWithoutPollingAsync( - String resourceGroupName, String snapshotName, SnapshotInner snapshot) { - return beginCreateOrUpdateWithoutPollingWithResponseAsync(resourceGroupName, snapshotName, snapshot) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Creates or updates a snapshot. - * - * @param resourceGroupName The name of the resource group. - * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot - * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. - * @param snapshot Snapshot resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return snapshot resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginCreateOrUpdateWithoutPollingAsync( - String resourceGroupName, String snapshotName, SnapshotInner snapshot, Context context) { - return beginCreateOrUpdateWithoutPollingWithResponseAsync(resourceGroupName, snapshotName, snapshot, context) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Creates or updates a snapshot. - * - * @param resourceGroupName The name of the resource group. - * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot - * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. - * @param snapshot Snapshot resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return snapshot resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SnapshotInner beginCreateOrUpdateWithoutPolling( - String resourceGroupName, String snapshotName, SnapshotInner snapshot) { - return beginCreateOrUpdateWithoutPollingAsync(resourceGroupName, snapshotName, snapshot).block(); - } - - /** - * Creates or updates a snapshot. - * - * @param resourceGroupName The name of the resource group. - * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot - * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. - * @param snapshot Snapshot resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return snapshot resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SnapshotInner beginCreateOrUpdateWithoutPolling( - String resourceGroupName, String snapshotName, SnapshotInner snapshot, Context context) { - return beginCreateOrUpdateWithoutPollingAsync(resourceGroupName, snapshotName, snapshot, context).block(); - } - - /** - * Updates (patches) a snapshot. - * - * @param resourceGroupName The name of the resource group. - * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot - * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. - * @param snapshot Snapshot update resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return snapshot resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginUpdateWithoutPollingWithResponseAsync( - String resourceGroupName, String snapshotName, SnapshotUpdate snapshot) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (snapshotName == null) { - return Mono.error(new IllegalArgumentException("Parameter snapshotName is required and cannot be null.")); - } - if (snapshot == null) { - return Mono.error(new IllegalArgumentException("Parameter snapshot is required and cannot be null.")); - } else { - snapshot.validate(); - } - final String apiVersion = "2019-11-01"; - return FluxUtil - .withContext( - context -> - service - .beginUpdateWithoutPolling( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - snapshotName, - apiVersion, - snapshot, - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Updates (patches) a snapshot. - * - * @param resourceGroupName The name of the resource group. - * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot - * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. - * @param snapshot Snapshot update resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return snapshot resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginUpdateWithoutPollingWithResponseAsync( - String resourceGroupName, String snapshotName, SnapshotUpdate snapshot, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (snapshotName == null) { - return Mono.error(new IllegalArgumentException("Parameter snapshotName is required and cannot be null.")); - } - if (snapshot == null) { - return Mono.error(new IllegalArgumentException("Parameter snapshot is required and cannot be null.")); - } else { - snapshot.validate(); - } - final String apiVersion = "2019-11-01"; - return service - .beginUpdateWithoutPolling( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - snapshotName, - apiVersion, - snapshot, - context); - } - - /** - * Updates (patches) a snapshot. - * - * @param resourceGroupName The name of the resource group. - * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot - * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. - * @param snapshot Snapshot update resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return snapshot resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginUpdateWithoutPollingAsync( - String resourceGroupName, String snapshotName, SnapshotUpdate snapshot) { - return beginUpdateWithoutPollingWithResponseAsync(resourceGroupName, snapshotName, snapshot) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Updates (patches) a snapshot. - * - * @param resourceGroupName The name of the resource group. - * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot - * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. - * @param snapshot Snapshot update resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return snapshot resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginUpdateWithoutPollingAsync( - String resourceGroupName, String snapshotName, SnapshotUpdate snapshot, Context context) { - return beginUpdateWithoutPollingWithResponseAsync(resourceGroupName, snapshotName, snapshot, context) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Updates (patches) a snapshot. - * - * @param resourceGroupName The name of the resource group. - * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot - * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. - * @param snapshot Snapshot update resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return snapshot resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SnapshotInner beginUpdateWithoutPolling( - String resourceGroupName, String snapshotName, SnapshotUpdate snapshot) { - return beginUpdateWithoutPollingAsync(resourceGroupName, snapshotName, snapshot).block(); - } - - /** - * Updates (patches) a snapshot. - * - * @param resourceGroupName The name of the resource group. - * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot - * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. - * @param snapshot Snapshot update resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return snapshot resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SnapshotInner beginUpdateWithoutPolling( - String resourceGroupName, String snapshotName, SnapshotUpdate snapshot, Context context) { - return beginUpdateWithoutPollingAsync(resourceGroupName, snapshotName, snapshot, context).block(); - } - - /** - * Deletes a snapshot. - * - * @param resourceGroupName The name of the resource group. - * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot - * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginDeleteWithoutPollingWithResponseAsync( - String resourceGroupName, String snapshotName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (snapshotName == null) { - return Mono.error(new IllegalArgumentException("Parameter snapshotName is required and cannot be null.")); - } - final String apiVersion = "2019-11-01"; - return FluxUtil - .withContext( - context -> - service - .beginDeleteWithoutPolling( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - snapshotName, - apiVersion, - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Deletes a snapshot. - * - * @param resourceGroupName The name of the resource group. - * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot - * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginDeleteWithoutPollingWithResponseAsync( - String resourceGroupName, String snapshotName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (snapshotName == null) { - return Mono.error(new IllegalArgumentException("Parameter snapshotName is required and cannot be null.")); - } - final String apiVersion = "2019-11-01"; - return service - .beginDeleteWithoutPolling( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - snapshotName, - apiVersion, - context); - } - - /** - * Deletes a snapshot. - * - * @param resourceGroupName The name of the resource group. - * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot - * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginDeleteWithoutPollingAsync(String resourceGroupName, String snapshotName) { - return beginDeleteWithoutPollingWithResponseAsync(resourceGroupName, snapshotName) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Deletes a snapshot. - * - * @param resourceGroupName The name of the resource group. - * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot - * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginDeleteWithoutPollingAsync(String resourceGroupName, String snapshotName, Context context) { - return beginDeleteWithoutPollingWithResponseAsync(resourceGroupName, snapshotName, context) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Deletes a snapshot. - * - * @param resourceGroupName The name of the resource group. - * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot - * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void beginDeleteWithoutPolling(String resourceGroupName, String snapshotName) { - beginDeleteWithoutPollingAsync(resourceGroupName, snapshotName).block(); - } - - /** - * Deletes a snapshot. - * - * @param resourceGroupName The name of the resource group. - * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot - * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void beginDeleteWithoutPolling(String resourceGroupName, String snapshotName, Context context) { - beginDeleteWithoutPollingAsync(resourceGroupName, snapshotName, context).block(); - } - - /** - * Grants access to a snapshot. - * - * @param resourceGroupName The name of the resource group. - * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot - * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. - * @param grantAccessData Data used for requesting a SAS. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a disk access SAS uri. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginGrantAccessWithoutPollingWithResponseAsync( - String resourceGroupName, String snapshotName, GrantAccessData grantAccessData) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (snapshotName == null) { - return Mono.error(new IllegalArgumentException("Parameter snapshotName is required and cannot be null.")); - } - if (grantAccessData == null) { - return Mono - .error(new IllegalArgumentException("Parameter grantAccessData is required and cannot be null.")); - } else { - grantAccessData.validate(); - } - final String apiVersion = "2019-11-01"; - return FluxUtil - .withContext( - context -> - service - .beginGrantAccessWithoutPolling( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - snapshotName, - apiVersion, - grantAccessData, - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Grants access to a snapshot. - * - * @param resourceGroupName The name of the resource group. - * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot - * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. - * @param grantAccessData Data used for requesting a SAS. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a disk access SAS uri. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginGrantAccessWithoutPollingWithResponseAsync( - String resourceGroupName, String snapshotName, GrantAccessData grantAccessData, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (snapshotName == null) { - return Mono.error(new IllegalArgumentException("Parameter snapshotName is required and cannot be null.")); - } - if (grantAccessData == null) { - return Mono - .error(new IllegalArgumentException("Parameter grantAccessData is required and cannot be null.")); - } else { - grantAccessData.validate(); - } - final String apiVersion = "2019-11-01"; - return service - .beginGrantAccessWithoutPolling( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - snapshotName, - apiVersion, - grantAccessData, - context); - } - - /** - * Grants access to a snapshot. - * - * @param resourceGroupName The name of the resource group. - * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot - * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. - * @param grantAccessData Data used for requesting a SAS. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a disk access SAS uri. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginGrantAccessWithoutPollingAsync( - String resourceGroupName, String snapshotName, GrantAccessData grantAccessData) { - return beginGrantAccessWithoutPollingWithResponseAsync(resourceGroupName, snapshotName, grantAccessData) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Grants access to a snapshot. - * - * @param resourceGroupName The name of the resource group. - * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot - * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. - * @param grantAccessData Data used for requesting a SAS. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a disk access SAS uri. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginGrantAccessWithoutPollingAsync( - String resourceGroupName, String snapshotName, GrantAccessData grantAccessData, Context context) { - return beginGrantAccessWithoutPollingWithResponseAsync( - resourceGroupName, snapshotName, grantAccessData, context) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Grants access to a snapshot. - * - * @param resourceGroupName The name of the resource group. - * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot - * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. - * @param grantAccessData Data used for requesting a SAS. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a disk access SAS uri. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public AccessUriInner beginGrantAccessWithoutPolling( - String resourceGroupName, String snapshotName, GrantAccessData grantAccessData) { - return beginGrantAccessWithoutPollingAsync(resourceGroupName, snapshotName, grantAccessData).block(); - } - - /** - * Grants access to a snapshot. - * - * @param resourceGroupName The name of the resource group. - * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot - * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. - * @param grantAccessData Data used for requesting a SAS. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a disk access SAS uri. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public AccessUriInner beginGrantAccessWithoutPolling( - String resourceGroupName, String snapshotName, GrantAccessData grantAccessData, Context context) { - return beginGrantAccessWithoutPollingAsync(resourceGroupName, snapshotName, grantAccessData, context).block(); - } - - /** - * Revokes access to a snapshot. - * - * @param resourceGroupName The name of the resource group. - * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot - * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginRevokeAccessWithoutPollingWithResponseAsync( - String resourceGroupName, String snapshotName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (snapshotName == null) { - return Mono.error(new IllegalArgumentException("Parameter snapshotName is required and cannot be null.")); - } - final String apiVersion = "2019-11-01"; - return FluxUtil - .withContext( - context -> - service - .beginRevokeAccessWithoutPolling( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - snapshotName, - apiVersion, - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Revokes access to a snapshot. - * - * @param resourceGroupName The name of the resource group. - * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot - * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginRevokeAccessWithoutPollingWithResponseAsync( - String resourceGroupName, String snapshotName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (snapshotName == null) { - return Mono.error(new IllegalArgumentException("Parameter snapshotName is required and cannot be null.")); - } - final String apiVersion = "2019-11-01"; - return service - .beginRevokeAccessWithoutPolling( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - snapshotName, - apiVersion, - context); - } - - /** - * Revokes access to a snapshot. - * - * @param resourceGroupName The name of the resource group. - * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot - * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginRevokeAccessWithoutPollingAsync(String resourceGroupName, String snapshotName) { - return beginRevokeAccessWithoutPollingWithResponseAsync(resourceGroupName, snapshotName) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Revokes access to a snapshot. - * - * @param resourceGroupName The name of the resource group. - * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot - * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginRevokeAccessWithoutPollingAsync( - String resourceGroupName, String snapshotName, Context context) { - return beginRevokeAccessWithoutPollingWithResponseAsync(resourceGroupName, snapshotName, context) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Revokes access to a snapshot. - * - * @param resourceGroupName The name of the resource group. - * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot - * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void beginRevokeAccessWithoutPolling(String resourceGroupName, String snapshotName) { - beginRevokeAccessWithoutPollingAsync(resourceGroupName, snapshotName).block(); - } - - /** - * Revokes access to a snapshot. - * - * @param resourceGroupName The name of the resource group. - * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot - * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void beginRevokeAccessWithoutPolling(String resourceGroupName, String snapshotName, Context context) { - beginRevokeAccessWithoutPollingAsync(resourceGroupName, snapshotName, context).block(); - } - /** * Get the next page of items. * @@ -2948,6 +1970,7 @@ public Mono> listByResourceGroupNextSinglePageAsync if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listByResourceGroupNext(nextLink, context) .map( @@ -3004,6 +2027,7 @@ public Mono> listNextSinglePageAsync(String nextLin if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listNext(nextLink, context) .map( diff --git a/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/SshPublicKeysClient.java b/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/SshPublicKeysClient.java index a235536e529f5..b03342bad4d4f 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/SshPublicKeysClient.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/SshPublicKeysClient.java @@ -245,6 +245,7 @@ public Mono> listSinglePageAsync(Contex "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), context) .map( @@ -398,6 +399,7 @@ public Mono> listByResourceGroupSingleP "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .listByResourceGroup( this.client.getEndpoint(), resourceGroupName, apiVersion, this.client.getSubscriptionId(), context) @@ -574,6 +576,7 @@ public Mono> createWithResponseAsync( parameters.validate(); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .create( this.client.getEndpoint(), @@ -767,6 +770,7 @@ public Mono> updateWithResponseAsync( parameters.validate(); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .update( this.client.getEndpoint(), @@ -946,6 +950,7 @@ public Mono> deleteWithResponseAsync( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .delete( this.client.getEndpoint(), @@ -1101,6 +1106,7 @@ public Mono> getByResourceGroupWithResponseA "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .getByResourceGroup( this.client.getEndpoint(), @@ -1276,6 +1282,7 @@ public Mono> generateKeyPairWit "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .generateKeyPair( this.client.getEndpoint(), @@ -1415,6 +1422,7 @@ public Mono> listBySubscriptionNextSing if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listBySubscriptionNext(nextLink, context) .map( @@ -1472,6 +1480,7 @@ public Mono> listByResourceGroupNextSin if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listByResourceGroupNext(nextLink, context) .map( diff --git a/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/UsagesClient.java b/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/UsagesClient.java index a4d631bffb95a..0b064146aaeb2 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/UsagesClient.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/UsagesClient.java @@ -151,6 +151,7 @@ public Mono> listSinglePageAsync(String location, Cont "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .list(this.client.getEndpoint(), location, apiVersion, this.client.getSubscriptionId(), context) .map( @@ -270,6 +271,7 @@ public Mono> listNextSinglePageAsync(String nextLink, if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listNext(nextLink, context) .map( diff --git a/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/VirtualMachineExtensionImagesClient.java b/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/VirtualMachineExtensionImagesClient.java index bb19231dd7f94..8fca1070ab839 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/VirtualMachineExtensionImagesClient.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/VirtualMachineExtensionImagesClient.java @@ -204,6 +204,7 @@ public Mono> getWithResponseAsync( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .get( this.client.getEndpoint(), @@ -384,6 +385,7 @@ public Mono>> listTypesWithResp "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .listTypes( this.client.getEndpoint(), @@ -576,6 +578,7 @@ public Mono>> listVersionsWithR "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .listVersions( this.client.getEndpoint(), diff --git a/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/VirtualMachineExtensionsClient.java b/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/VirtualMachineExtensionsClient.java index c913c72feb05a..d2e67bc7b23e3 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/VirtualMachineExtensionsClient.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/VirtualMachineExtensionsClient.java @@ -142,53 +142,6 @@ Mono> list( @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, Context context); - - @Headers({"Accept: application/json", "Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" - + "/virtualMachines/{vmName}/extensions/{vmExtensionName}") - @ExpectedResponses({200, 201}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> beginCreateOrUpdateWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("vmName") String vmName, - @PathParam("vmExtensionName") String vmExtensionName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") VirtualMachineExtensionInner extensionParameters, - Context context); - - @Headers({"Accept: application/json", "Content-Type: application/json"}) - @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" - + "/virtualMachines/{vmName}/extensions/{vmExtensionName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> beginUpdateWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("vmName") String vmName, - @PathParam("vmExtensionName") String vmExtensionName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") VirtualMachineExtensionUpdate extensionParameters, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" - + "/virtualMachines/{vmName}/extensions/{vmExtensionName}") - @ExpectedResponses({200, 202, 204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> beginDeleteWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("vmName") String vmName, - @PathParam("vmExtensionName") String vmExtensionName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - Context context); } /** @@ -305,6 +258,7 @@ public Mono>> createOrUpdateWithResponseAsync( extensionParameters.validate(); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .createOrUpdate( this.client.getEndpoint(), @@ -443,7 +397,7 @@ public Mono createOrUpdateAsync( VirtualMachineExtensionInner extensionParameters) { return beginCreateOrUpdateAsync(resourceGroupName, vmName, vmExtensionName, extensionParameters) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -468,7 +422,7 @@ public Mono createOrUpdateAsync( Context context) { return beginCreateOrUpdateAsync(resourceGroupName, vmName, vmExtensionName, extensionParameters, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -629,6 +583,7 @@ public Mono>> updateWithResponseAsync( extensionParameters.validate(); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .update( this.client.getEndpoint(), @@ -766,7 +721,7 @@ public Mono updateAsync( VirtualMachineExtensionUpdate extensionParameters) { return beginUpdateAsync(resourceGroupName, vmName, vmExtensionName, extensionParameters) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -791,7 +746,7 @@ public Mono updateAsync( Context context) { return beginUpdateAsync(resourceGroupName, vmName, vmExtensionName, extensionParameters, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -930,6 +885,7 @@ public Mono>> deleteWithResponseAsync( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .delete( this.client.getEndpoint(), @@ -1029,7 +985,7 @@ public SyncPoller, Void> beginDelete( public Mono deleteAsync(String resourceGroupName, String vmName, String vmExtensionName) { return beginDeleteAsync(resourceGroupName, vmName, vmExtensionName) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -1048,7 +1004,7 @@ public Mono deleteAsync(String resourceGroupName, String vmName, String vm public Mono deleteAsync(String resourceGroupName, String vmName, String vmExtensionName, Context context) { return beginDeleteAsync(resourceGroupName, vmName, vmExtensionName, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -1177,6 +1133,7 @@ public Mono> getWithResponseAsync( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .get( this.client.getEndpoint(), @@ -1408,6 +1365,7 @@ public Mono> listWithResponseA "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .list( this.client.getEndpoint(), @@ -1545,643 +1503,4 @@ public VirtualMachineExtensionsListResultInner list(String resourceGroupName, St final Context context = null; return listAsync(resourceGroupName, vmName, expand).block(); } - - /** - * The operation to create or update the extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine where the extension should be created or updated. - * @param vmExtensionName The name of the virtual machine extension. - * @param extensionParameters Describes a Virtual Machine Extension. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine Extension. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginCreateOrUpdateWithoutPollingWithResponseAsync( - String resourceGroupName, - String vmName, - String vmExtensionName, - VirtualMachineExtensionInner extensionParameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmName is required and cannot be null.")); - } - if (vmExtensionName == null) { - return Mono - .error(new IllegalArgumentException("Parameter vmExtensionName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (extensionParameters == null) { - return Mono - .error(new IllegalArgumentException("Parameter extensionParameters is required and cannot be null.")); - } else { - extensionParameters.validate(); - } - final String apiVersion = "2019-12-01"; - return FluxUtil - .withContext( - context -> - service - .beginCreateOrUpdateWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - vmName, - vmExtensionName, - apiVersion, - this.client.getSubscriptionId(), - extensionParameters, - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * The operation to create or update the extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine where the extension should be created or updated. - * @param vmExtensionName The name of the virtual machine extension. - * @param extensionParameters Describes a Virtual Machine Extension. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine Extension. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginCreateOrUpdateWithoutPollingWithResponseAsync( - String resourceGroupName, - String vmName, - String vmExtensionName, - VirtualMachineExtensionInner extensionParameters, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmName is required and cannot be null.")); - } - if (vmExtensionName == null) { - return Mono - .error(new IllegalArgumentException("Parameter vmExtensionName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (extensionParameters == null) { - return Mono - .error(new IllegalArgumentException("Parameter extensionParameters is required and cannot be null.")); - } else { - extensionParameters.validate(); - } - final String apiVersion = "2019-12-01"; - return service - .beginCreateOrUpdateWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - vmName, - vmExtensionName, - apiVersion, - this.client.getSubscriptionId(), - extensionParameters, - context); - } - - /** - * The operation to create or update the extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine where the extension should be created or updated. - * @param vmExtensionName The name of the virtual machine extension. - * @param extensionParameters Describes a Virtual Machine Extension. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine Extension. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginCreateOrUpdateWithoutPollingAsync( - String resourceGroupName, - String vmName, - String vmExtensionName, - VirtualMachineExtensionInner extensionParameters) { - return beginCreateOrUpdateWithoutPollingWithResponseAsync( - resourceGroupName, vmName, vmExtensionName, extensionParameters) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * The operation to create or update the extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine where the extension should be created or updated. - * @param vmExtensionName The name of the virtual machine extension. - * @param extensionParameters Describes a Virtual Machine Extension. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine Extension. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginCreateOrUpdateWithoutPollingAsync( - String resourceGroupName, - String vmName, - String vmExtensionName, - VirtualMachineExtensionInner extensionParameters, - Context context) { - return beginCreateOrUpdateWithoutPollingWithResponseAsync( - resourceGroupName, vmName, vmExtensionName, extensionParameters, context) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * The operation to create or update the extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine where the extension should be created or updated. - * @param vmExtensionName The name of the virtual machine extension. - * @param extensionParameters Describes a Virtual Machine Extension. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine Extension. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public VirtualMachineExtensionInner beginCreateOrUpdateWithoutPolling( - String resourceGroupName, - String vmName, - String vmExtensionName, - VirtualMachineExtensionInner extensionParameters) { - return beginCreateOrUpdateWithoutPollingAsync(resourceGroupName, vmName, vmExtensionName, extensionParameters) - .block(); - } - - /** - * The operation to create or update the extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine where the extension should be created or updated. - * @param vmExtensionName The name of the virtual machine extension. - * @param extensionParameters Describes a Virtual Machine Extension. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine Extension. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public VirtualMachineExtensionInner beginCreateOrUpdateWithoutPolling( - String resourceGroupName, - String vmName, - String vmExtensionName, - VirtualMachineExtensionInner extensionParameters, - Context context) { - return beginCreateOrUpdateWithoutPollingAsync( - resourceGroupName, vmName, vmExtensionName, extensionParameters, context) - .block(); - } - - /** - * The operation to update the extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine where the extension should be updated. - * @param vmExtensionName The name of the virtual machine extension. - * @param extensionParameters Describes a Virtual Machine Extension. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine Extension. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginUpdateWithoutPollingWithResponseAsync( - String resourceGroupName, - String vmName, - String vmExtensionName, - VirtualMachineExtensionUpdate extensionParameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmName is required and cannot be null.")); - } - if (vmExtensionName == null) { - return Mono - .error(new IllegalArgumentException("Parameter vmExtensionName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (extensionParameters == null) { - return Mono - .error(new IllegalArgumentException("Parameter extensionParameters is required and cannot be null.")); - } else { - extensionParameters.validate(); - } - final String apiVersion = "2019-12-01"; - return FluxUtil - .withContext( - context -> - service - .beginUpdateWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - vmName, - vmExtensionName, - apiVersion, - this.client.getSubscriptionId(), - extensionParameters, - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * The operation to update the extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine where the extension should be updated. - * @param vmExtensionName The name of the virtual machine extension. - * @param extensionParameters Describes a Virtual Machine Extension. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine Extension. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginUpdateWithoutPollingWithResponseAsync( - String resourceGroupName, - String vmName, - String vmExtensionName, - VirtualMachineExtensionUpdate extensionParameters, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmName is required and cannot be null.")); - } - if (vmExtensionName == null) { - return Mono - .error(new IllegalArgumentException("Parameter vmExtensionName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (extensionParameters == null) { - return Mono - .error(new IllegalArgumentException("Parameter extensionParameters is required and cannot be null.")); - } else { - extensionParameters.validate(); - } - final String apiVersion = "2019-12-01"; - return service - .beginUpdateWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - vmName, - vmExtensionName, - apiVersion, - this.client.getSubscriptionId(), - extensionParameters, - context); - } - - /** - * The operation to update the extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine where the extension should be updated. - * @param vmExtensionName The name of the virtual machine extension. - * @param extensionParameters Describes a Virtual Machine Extension. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine Extension. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginUpdateWithoutPollingAsync( - String resourceGroupName, - String vmName, - String vmExtensionName, - VirtualMachineExtensionUpdate extensionParameters) { - return beginUpdateWithoutPollingWithResponseAsync( - resourceGroupName, vmName, vmExtensionName, extensionParameters) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * The operation to update the extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine where the extension should be updated. - * @param vmExtensionName The name of the virtual machine extension. - * @param extensionParameters Describes a Virtual Machine Extension. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine Extension. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginUpdateWithoutPollingAsync( - String resourceGroupName, - String vmName, - String vmExtensionName, - VirtualMachineExtensionUpdate extensionParameters, - Context context) { - return beginUpdateWithoutPollingWithResponseAsync( - resourceGroupName, vmName, vmExtensionName, extensionParameters, context) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * The operation to update the extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine where the extension should be updated. - * @param vmExtensionName The name of the virtual machine extension. - * @param extensionParameters Describes a Virtual Machine Extension. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine Extension. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public VirtualMachineExtensionInner beginUpdateWithoutPolling( - String resourceGroupName, - String vmName, - String vmExtensionName, - VirtualMachineExtensionUpdate extensionParameters) { - return beginUpdateWithoutPollingAsync(resourceGroupName, vmName, vmExtensionName, extensionParameters).block(); - } - - /** - * The operation to update the extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine where the extension should be updated. - * @param vmExtensionName The name of the virtual machine extension. - * @param extensionParameters Describes a Virtual Machine Extension. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine Extension. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public VirtualMachineExtensionInner beginUpdateWithoutPolling( - String resourceGroupName, - String vmName, - String vmExtensionName, - VirtualMachineExtensionUpdate extensionParameters, - Context context) { - return beginUpdateWithoutPollingAsync(resourceGroupName, vmName, vmExtensionName, extensionParameters, context) - .block(); - } - - /** - * The operation to delete the extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine where the extension should be deleted. - * @param vmExtensionName The name of the virtual machine extension. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginDeleteWithoutPollingWithResponseAsync( - String resourceGroupName, String vmName, String vmExtensionName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmName is required and cannot be null.")); - } - if (vmExtensionName == null) { - return Mono - .error(new IllegalArgumentException("Parameter vmExtensionName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2019-12-01"; - return FluxUtil - .withContext( - context -> - service - .beginDeleteWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - vmName, - vmExtensionName, - apiVersion, - this.client.getSubscriptionId(), - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * The operation to delete the extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine where the extension should be deleted. - * @param vmExtensionName The name of the virtual machine extension. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginDeleteWithoutPollingWithResponseAsync( - String resourceGroupName, String vmName, String vmExtensionName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmName is required and cannot be null.")); - } - if (vmExtensionName == null) { - return Mono - .error(new IllegalArgumentException("Parameter vmExtensionName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2019-12-01"; - return service - .beginDeleteWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - vmName, - vmExtensionName, - apiVersion, - this.client.getSubscriptionId(), - context); - } - - /** - * The operation to delete the extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine where the extension should be deleted. - * @param vmExtensionName The name of the virtual machine extension. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginDeleteWithoutPollingAsync(String resourceGroupName, String vmName, String vmExtensionName) { - return beginDeleteWithoutPollingWithResponseAsync(resourceGroupName, vmName, vmExtensionName) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * The operation to delete the extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine where the extension should be deleted. - * @param vmExtensionName The name of the virtual machine extension. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginDeleteWithoutPollingAsync( - String resourceGroupName, String vmName, String vmExtensionName, Context context) { - return beginDeleteWithoutPollingWithResponseAsync(resourceGroupName, vmName, vmExtensionName, context) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * The operation to delete the extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine where the extension should be deleted. - * @param vmExtensionName The name of the virtual machine extension. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void beginDeleteWithoutPolling(String resourceGroupName, String vmName, String vmExtensionName) { - beginDeleteWithoutPollingAsync(resourceGroupName, vmName, vmExtensionName).block(); - } - - /** - * The operation to delete the extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine where the extension should be deleted. - * @param vmExtensionName The name of the virtual machine extension. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void beginDeleteWithoutPolling( - String resourceGroupName, String vmName, String vmExtensionName, Context context) { - beginDeleteWithoutPollingAsync(resourceGroupName, vmName, vmExtensionName, context).block(); - } } diff --git a/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/VirtualMachineImagesClient.java b/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/VirtualMachineImagesClient.java index 454896511ae82..c69154278b53a 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/VirtualMachineImagesClient.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/VirtualMachineImagesClient.java @@ -239,6 +239,7 @@ public Mono> getWithResponseAsync( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .get( this.client.getEndpoint(), @@ -459,6 +460,7 @@ public Mono>> listWithResponseAs "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .list( this.client.getEndpoint(), @@ -721,6 +723,7 @@ public Mono>> listOffersWithResp "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .listOffers( this.client.getEndpoint(), @@ -875,6 +878,7 @@ public Mono>> listPublishersWith "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .listPublishers(this.client.getEndpoint(), location, apiVersion, this.client.getSubscriptionId(), context); } @@ -1041,6 +1045,7 @@ public Mono>> listSkusWithRespon "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .listSkus( this.client.getEndpoint(), diff --git a/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/VirtualMachineRunCommandsClient.java b/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/VirtualMachineRunCommandsClient.java index da4489de1202d..4bad1232cdbc8 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/VirtualMachineRunCommandsClient.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/VirtualMachineRunCommandsClient.java @@ -165,6 +165,7 @@ public Mono> listSinglePageAsync(Stri "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .list(this.client.getEndpoint(), location, apiVersion, this.client.getSubscriptionId(), context) .map( @@ -315,6 +316,7 @@ public Mono> getWithResponseAsync( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .get(this.client.getEndpoint(), location, commandId, apiVersion, this.client.getSubscriptionId(), context); } @@ -440,6 +442,7 @@ public Mono> listNextSinglePageAsync( if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listNext(nextLink, context) .map( diff --git a/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/VirtualMachineScaleSetExtensionsClient.java b/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/VirtualMachineScaleSetExtensionsClient.java index def470e91cc30..ea603ecf3b872 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/VirtualMachineScaleSetExtensionsClient.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/VirtualMachineScaleSetExtensionsClient.java @@ -149,53 +149,6 @@ Mono> list( @PathParam("subscriptionId") String subscriptionId, Context context); - @Headers({"Accept: application/json", "Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" - + "/virtualMachineScaleSets/{vmScaleSetName}/extensions/{vmssExtensionName}") - @ExpectedResponses({200, 201}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> beginCreateOrUpdateWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("vmScaleSetName") String vmScaleSetName, - @PathParam("vmssExtensionName") String vmssExtensionName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") VirtualMachineScaleSetExtensionInner extensionParameters, - Context context); - - @Headers({"Accept: application/json", "Content-Type: application/json"}) - @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" - + "/virtualMachineScaleSets/{vmScaleSetName}/extensions/{vmssExtensionName}") - @ExpectedResponses({200, 201}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> beginUpdateWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("vmScaleSetName") String vmScaleSetName, - @PathParam("vmssExtensionName") String vmssExtensionName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") VirtualMachineScaleSetExtensionUpdate extensionParameters, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" - + "/virtualMachineScaleSets/{vmScaleSetName}/extensions/{vmssExtensionName}") - @ExpectedResponses({200, 202, 204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> beginDeleteWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("vmScaleSetName") String vmScaleSetName, - @PathParam("vmssExtensionName") String vmssExtensionName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - Context context); - @Headers({"Accept: application/json", "Content-Type: application/json"}) @Get("{nextLink}") @ExpectedResponses({200}) @@ -318,6 +271,7 @@ public Mono>> createOrUpdateWithResponseAsync( extensionParameters.validate(); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .createOrUpdate( this.client.getEndpoint(), @@ -462,7 +416,7 @@ public Mono createOrUpdateAsync( VirtualMachineScaleSetExtensionInner extensionParameters) { return beginCreateOrUpdateAsync(resourceGroupName, vmScaleSetName, vmssExtensionName, extensionParameters) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -488,7 +442,7 @@ public Mono createOrUpdateAsync( return beginCreateOrUpdateAsync( resourceGroupName, vmScaleSetName, vmssExtensionName, extensionParameters, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -650,6 +604,7 @@ public Mono>> updateWithResponseAsync( extensionParameters.validate(); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .update( this.client.getEndpoint(), @@ -792,7 +747,7 @@ public Mono updateAsync( VirtualMachineScaleSetExtensionUpdate extensionParameters) { return beginUpdateAsync(resourceGroupName, vmScaleSetName, vmssExtensionName, extensionParameters) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -817,7 +772,7 @@ public Mono updateAsync( Context context) { return beginUpdateAsync(resourceGroupName, vmScaleSetName, vmssExtensionName, extensionParameters, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -956,6 +911,7 @@ public Mono>> deleteWithResponseAsync( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .delete( this.client.getEndpoint(), @@ -1056,7 +1012,7 @@ public SyncPoller, Void> beginDelete( public Mono deleteAsync(String resourceGroupName, String vmScaleSetName, String vmssExtensionName) { return beginDeleteAsync(resourceGroupName, vmScaleSetName, vmssExtensionName) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -1076,7 +1032,7 @@ public Mono deleteAsync( String resourceGroupName, String vmScaleSetName, String vmssExtensionName, Context context) { return beginDeleteAsync(resourceGroupName, vmScaleSetName, vmssExtensionName, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -1205,6 +1161,7 @@ public Mono> getWithResponseAsync "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .get( this.client.getEndpoint(), @@ -1443,6 +1400,7 @@ public Mono> listSinglePageA "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .list( this.client.getEndpoint(), @@ -1530,649 +1488,6 @@ public PagedIterable list( return new PagedIterable<>(listAsync(resourceGroupName, vmScaleSetName, context)); } - /** - * The operation to create or update an extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set where the extension should be create or updated. - * @param vmssExtensionName The name of the VM scale set extension. - * @param extensionParameters Describes a Virtual Machine Scale Set Extension. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine Scale Set Extension. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginCreateOrUpdateWithoutPollingWithResponseAsync( - String resourceGroupName, - String vmScaleSetName, - String vmssExtensionName, - VirtualMachineScaleSetExtensionInner extensionParameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); - } - if (vmssExtensionName == null) { - return Mono - .error(new IllegalArgumentException("Parameter vmssExtensionName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (extensionParameters == null) { - return Mono - .error(new IllegalArgumentException("Parameter extensionParameters is required and cannot be null.")); - } else { - extensionParameters.validate(); - } - final String apiVersion = "2019-12-01"; - return FluxUtil - .withContext( - context -> - service - .beginCreateOrUpdateWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - vmssExtensionName, - apiVersion, - this.client.getSubscriptionId(), - extensionParameters, - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * The operation to create or update an extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set where the extension should be create or updated. - * @param vmssExtensionName The name of the VM scale set extension. - * @param extensionParameters Describes a Virtual Machine Scale Set Extension. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine Scale Set Extension. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginCreateOrUpdateWithoutPollingWithResponseAsync( - String resourceGroupName, - String vmScaleSetName, - String vmssExtensionName, - VirtualMachineScaleSetExtensionInner extensionParameters, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); - } - if (vmssExtensionName == null) { - return Mono - .error(new IllegalArgumentException("Parameter vmssExtensionName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (extensionParameters == null) { - return Mono - .error(new IllegalArgumentException("Parameter extensionParameters is required and cannot be null.")); - } else { - extensionParameters.validate(); - } - final String apiVersion = "2019-12-01"; - return service - .beginCreateOrUpdateWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - vmssExtensionName, - apiVersion, - this.client.getSubscriptionId(), - extensionParameters, - context); - } - - /** - * The operation to create or update an extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set where the extension should be create or updated. - * @param vmssExtensionName The name of the VM scale set extension. - * @param extensionParameters Describes a Virtual Machine Scale Set Extension. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine Scale Set Extension. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginCreateOrUpdateWithoutPollingAsync( - String resourceGroupName, - String vmScaleSetName, - String vmssExtensionName, - VirtualMachineScaleSetExtensionInner extensionParameters) { - return beginCreateOrUpdateWithoutPollingWithResponseAsync( - resourceGroupName, vmScaleSetName, vmssExtensionName, extensionParameters) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * The operation to create or update an extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set where the extension should be create or updated. - * @param vmssExtensionName The name of the VM scale set extension. - * @param extensionParameters Describes a Virtual Machine Scale Set Extension. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine Scale Set Extension. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginCreateOrUpdateWithoutPollingAsync( - String resourceGroupName, - String vmScaleSetName, - String vmssExtensionName, - VirtualMachineScaleSetExtensionInner extensionParameters, - Context context) { - return beginCreateOrUpdateWithoutPollingWithResponseAsync( - resourceGroupName, vmScaleSetName, vmssExtensionName, extensionParameters, context) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * The operation to create or update an extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set where the extension should be create or updated. - * @param vmssExtensionName The name of the VM scale set extension. - * @param extensionParameters Describes a Virtual Machine Scale Set Extension. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine Scale Set Extension. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public VirtualMachineScaleSetExtensionInner beginCreateOrUpdateWithoutPolling( - String resourceGroupName, - String vmScaleSetName, - String vmssExtensionName, - VirtualMachineScaleSetExtensionInner extensionParameters) { - return beginCreateOrUpdateWithoutPollingAsync( - resourceGroupName, vmScaleSetName, vmssExtensionName, extensionParameters) - .block(); - } - - /** - * The operation to create or update an extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set where the extension should be create or updated. - * @param vmssExtensionName The name of the VM scale set extension. - * @param extensionParameters Describes a Virtual Machine Scale Set Extension. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine Scale Set Extension. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public VirtualMachineScaleSetExtensionInner beginCreateOrUpdateWithoutPolling( - String resourceGroupName, - String vmScaleSetName, - String vmssExtensionName, - VirtualMachineScaleSetExtensionInner extensionParameters, - Context context) { - return beginCreateOrUpdateWithoutPollingAsync( - resourceGroupName, vmScaleSetName, vmssExtensionName, extensionParameters, context) - .block(); - } - - /** - * The operation to update an extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set where the extension should be updated. - * @param vmssExtensionName The name of the VM scale set extension. - * @param extensionParameters Describes a Virtual Machine Scale Set Extension. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine Scale Set Extension. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginUpdateWithoutPollingWithResponseAsync( - String resourceGroupName, - String vmScaleSetName, - String vmssExtensionName, - VirtualMachineScaleSetExtensionUpdate extensionParameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); - } - if (vmssExtensionName == null) { - return Mono - .error(new IllegalArgumentException("Parameter vmssExtensionName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (extensionParameters == null) { - return Mono - .error(new IllegalArgumentException("Parameter extensionParameters is required and cannot be null.")); - } else { - extensionParameters.validate(); - } - final String apiVersion = "2019-12-01"; - return FluxUtil - .withContext( - context -> - service - .beginUpdateWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - vmssExtensionName, - apiVersion, - this.client.getSubscriptionId(), - extensionParameters, - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * The operation to update an extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set where the extension should be updated. - * @param vmssExtensionName The name of the VM scale set extension. - * @param extensionParameters Describes a Virtual Machine Scale Set Extension. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine Scale Set Extension. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginUpdateWithoutPollingWithResponseAsync( - String resourceGroupName, - String vmScaleSetName, - String vmssExtensionName, - VirtualMachineScaleSetExtensionUpdate extensionParameters, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); - } - if (vmssExtensionName == null) { - return Mono - .error(new IllegalArgumentException("Parameter vmssExtensionName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (extensionParameters == null) { - return Mono - .error(new IllegalArgumentException("Parameter extensionParameters is required and cannot be null.")); - } else { - extensionParameters.validate(); - } - final String apiVersion = "2019-12-01"; - return service - .beginUpdateWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - vmssExtensionName, - apiVersion, - this.client.getSubscriptionId(), - extensionParameters, - context); - } - - /** - * The operation to update an extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set where the extension should be updated. - * @param vmssExtensionName The name of the VM scale set extension. - * @param extensionParameters Describes a Virtual Machine Scale Set Extension. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine Scale Set Extension. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginUpdateWithoutPollingAsync( - String resourceGroupName, - String vmScaleSetName, - String vmssExtensionName, - VirtualMachineScaleSetExtensionUpdate extensionParameters) { - return beginUpdateWithoutPollingWithResponseAsync( - resourceGroupName, vmScaleSetName, vmssExtensionName, extensionParameters) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * The operation to update an extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set where the extension should be updated. - * @param vmssExtensionName The name of the VM scale set extension. - * @param extensionParameters Describes a Virtual Machine Scale Set Extension. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine Scale Set Extension. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginUpdateWithoutPollingAsync( - String resourceGroupName, - String vmScaleSetName, - String vmssExtensionName, - VirtualMachineScaleSetExtensionUpdate extensionParameters, - Context context) { - return beginUpdateWithoutPollingWithResponseAsync( - resourceGroupName, vmScaleSetName, vmssExtensionName, extensionParameters, context) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * The operation to update an extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set where the extension should be updated. - * @param vmssExtensionName The name of the VM scale set extension. - * @param extensionParameters Describes a Virtual Machine Scale Set Extension. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine Scale Set Extension. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public VirtualMachineScaleSetExtensionInner beginUpdateWithoutPolling( - String resourceGroupName, - String vmScaleSetName, - String vmssExtensionName, - VirtualMachineScaleSetExtensionUpdate extensionParameters) { - return beginUpdateWithoutPollingAsync(resourceGroupName, vmScaleSetName, vmssExtensionName, extensionParameters) - .block(); - } - - /** - * The operation to update an extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set where the extension should be updated. - * @param vmssExtensionName The name of the VM scale set extension. - * @param extensionParameters Describes a Virtual Machine Scale Set Extension. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine Scale Set Extension. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public VirtualMachineScaleSetExtensionInner beginUpdateWithoutPolling( - String resourceGroupName, - String vmScaleSetName, - String vmssExtensionName, - VirtualMachineScaleSetExtensionUpdate extensionParameters, - Context context) { - return beginUpdateWithoutPollingAsync( - resourceGroupName, vmScaleSetName, vmssExtensionName, extensionParameters, context) - .block(); - } - - /** - * The operation to delete the extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set where the extension should be deleted. - * @param vmssExtensionName The name of the VM scale set extension. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginDeleteWithoutPollingWithResponseAsync( - String resourceGroupName, String vmScaleSetName, String vmssExtensionName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); - } - if (vmssExtensionName == null) { - return Mono - .error(new IllegalArgumentException("Parameter vmssExtensionName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2019-12-01"; - return FluxUtil - .withContext( - context -> - service - .beginDeleteWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - vmssExtensionName, - apiVersion, - this.client.getSubscriptionId(), - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * The operation to delete the extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set where the extension should be deleted. - * @param vmssExtensionName The name of the VM scale set extension. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginDeleteWithoutPollingWithResponseAsync( - String resourceGroupName, String vmScaleSetName, String vmssExtensionName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); - } - if (vmssExtensionName == null) { - return Mono - .error(new IllegalArgumentException("Parameter vmssExtensionName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2019-12-01"; - return service - .beginDeleteWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - vmssExtensionName, - apiVersion, - this.client.getSubscriptionId(), - context); - } - - /** - * The operation to delete the extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set where the extension should be deleted. - * @param vmssExtensionName The name of the VM scale set extension. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginDeleteWithoutPollingAsync( - String resourceGroupName, String vmScaleSetName, String vmssExtensionName) { - return beginDeleteWithoutPollingWithResponseAsync(resourceGroupName, vmScaleSetName, vmssExtensionName) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * The operation to delete the extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set where the extension should be deleted. - * @param vmssExtensionName The name of the VM scale set extension. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginDeleteWithoutPollingAsync( - String resourceGroupName, String vmScaleSetName, String vmssExtensionName, Context context) { - return beginDeleteWithoutPollingWithResponseAsync(resourceGroupName, vmScaleSetName, vmssExtensionName, context) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * The operation to delete the extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set where the extension should be deleted. - * @param vmssExtensionName The name of the VM scale set extension. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void beginDeleteWithoutPolling(String resourceGroupName, String vmScaleSetName, String vmssExtensionName) { - beginDeleteWithoutPollingAsync(resourceGroupName, vmScaleSetName, vmssExtensionName).block(); - } - - /** - * The operation to delete the extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set where the extension should be deleted. - * @param vmssExtensionName The name of the VM scale set extension. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void beginDeleteWithoutPolling( - String resourceGroupName, String vmScaleSetName, String vmssExtensionName, Context context) { - beginDeleteWithoutPollingAsync(resourceGroupName, vmScaleSetName, vmssExtensionName, context).block(); - } - /** * Get the next page of items. * @@ -2217,6 +1532,7 @@ public Mono> listNextSingleP if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listNext(nextLink, context) .map( diff --git a/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/VirtualMachineScaleSetRollingUpgradesClient.java b/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/VirtualMachineScaleSetRollingUpgradesClient.java index 9ea4a38e9b079..743aa7e76d123 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/VirtualMachineScaleSetRollingUpgradesClient.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/VirtualMachineScaleSetRollingUpgradesClient.java @@ -118,48 +118,6 @@ Mono> getLatest( @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" - + "/virtualMachineScaleSets/{vmScaleSetName}/rollingUpgrades/cancel") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> beginCancelWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("vmScaleSetName") String vmScaleSetName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" - + "/virtualMachineScaleSets/{vmScaleSetName}/osRollingUpgrade") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> beginStartOSUpgradeWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("vmScaleSetName") String vmScaleSetName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" - + "/virtualMachineScaleSets/{vmScaleSetName}/extensionRollingUpgrade") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> beginStartExtensionUpgradeWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("vmScaleSetName") String vmScaleSetName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - Context context); } /** @@ -242,6 +200,7 @@ public Mono>> cancelWithResponseAsync( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .cancel( this.client.getEndpoint(), @@ -330,7 +289,9 @@ public SyncPoller, Void> beginCancel( */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono cancelAsync(String resourceGroupName, String vmScaleSetName) { - return beginCancelAsync(resourceGroupName, vmScaleSetName).last().flatMap(client::getLroFinalResultOrError); + return beginCancelAsync(resourceGroupName, vmScaleSetName) + .last() + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -348,7 +309,7 @@ public Mono cancelAsync(String resourceGroupName, String vmScaleSetName) { public Mono cancelAsync(String resourceGroupName, String vmScaleSetName, Context context) { return beginCancelAsync(resourceGroupName, vmScaleSetName, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -463,6 +424,7 @@ public Mono>> startOSUpgradeWithResponseAsync( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .startOSUpgrade( this.client.getEndpoint(), @@ -560,7 +522,7 @@ public SyncPoller, Void> beginStartOSUpgrade( public Mono startOSUpgradeAsync(String resourceGroupName, String vmScaleSetName) { return beginStartOSUpgradeAsync(resourceGroupName, vmScaleSetName) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -579,7 +541,7 @@ public Mono startOSUpgradeAsync(String resourceGroupName, String vmScaleSe public Mono startOSUpgradeAsync(String resourceGroupName, String vmScaleSetName, Context context) { return beginStartOSUpgradeAsync(resourceGroupName, vmScaleSetName, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -696,6 +658,7 @@ public Mono>> startExtensionUpgradeWithResponseAsync( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .startExtensionUpgrade( this.client.getEndpoint(), @@ -795,7 +758,7 @@ public SyncPoller, Void> beginStartExtensionUpgrade( public Mono startExtensionUpgradeAsync(String resourceGroupName, String vmScaleSetName) { return beginStartExtensionUpgradeAsync(resourceGroupName, vmScaleSetName) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -814,7 +777,7 @@ public Mono startExtensionUpgradeAsync(String resourceGroupName, String vm public Mono startExtensionUpgradeAsync(String resourceGroupName, String vmScaleSetName, Context context) { return beginStartExtensionUpgradeAsync(resourceGroupName, vmScaleSetName, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -929,6 +892,7 @@ public Mono> getLatestWithResponseAsync( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .getLatest( this.client.getEndpoint(), @@ -1017,478 +981,4 @@ public RollingUpgradeStatusInfoInner getLatest(String resourceGroupName, String public RollingUpgradeStatusInfoInner getLatest(String resourceGroupName, String vmScaleSetName, Context context) { return getLatestAsync(resourceGroupName, vmScaleSetName, context).block(); } - - /** - * Cancels the current virtual machine scale set rolling upgrade. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginCancelWithoutPollingWithResponseAsync( - String resourceGroupName, String vmScaleSetName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2019-12-01"; - return FluxUtil - .withContext( - context -> - service - .beginCancelWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - apiVersion, - this.client.getSubscriptionId(), - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Cancels the current virtual machine scale set rolling upgrade. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginCancelWithoutPollingWithResponseAsync( - String resourceGroupName, String vmScaleSetName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2019-12-01"; - return service - .beginCancelWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - apiVersion, - this.client.getSubscriptionId(), - context); - } - - /** - * Cancels the current virtual machine scale set rolling upgrade. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginCancelWithoutPollingAsync(String resourceGroupName, String vmScaleSetName) { - return beginCancelWithoutPollingWithResponseAsync(resourceGroupName, vmScaleSetName) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Cancels the current virtual machine scale set rolling upgrade. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginCancelWithoutPollingAsync(String resourceGroupName, String vmScaleSetName, Context context) { - return beginCancelWithoutPollingWithResponseAsync(resourceGroupName, vmScaleSetName, context) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Cancels the current virtual machine scale set rolling upgrade. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void beginCancelWithoutPolling(String resourceGroupName, String vmScaleSetName) { - beginCancelWithoutPollingAsync(resourceGroupName, vmScaleSetName).block(); - } - - /** - * Cancels the current virtual machine scale set rolling upgrade. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void beginCancelWithoutPolling(String resourceGroupName, String vmScaleSetName, Context context) { - beginCancelWithoutPollingAsync(resourceGroupName, vmScaleSetName, context).block(); - } - - /** - * Starts a rolling upgrade to move all virtual machine scale set instances to the latest available Platform Image - * OS version. Instances which are already running the latest available OS version are not affected. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginStartOSUpgradeWithoutPollingWithResponseAsync( - String resourceGroupName, String vmScaleSetName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2019-12-01"; - return FluxUtil - .withContext( - context -> - service - .beginStartOSUpgradeWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - apiVersion, - this.client.getSubscriptionId(), - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Starts a rolling upgrade to move all virtual machine scale set instances to the latest available Platform Image - * OS version. Instances which are already running the latest available OS version are not affected. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginStartOSUpgradeWithoutPollingWithResponseAsync( - String resourceGroupName, String vmScaleSetName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2019-12-01"; - return service - .beginStartOSUpgradeWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - apiVersion, - this.client.getSubscriptionId(), - context); - } - - /** - * Starts a rolling upgrade to move all virtual machine scale set instances to the latest available Platform Image - * OS version. Instances which are already running the latest available OS version are not affected. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginStartOSUpgradeWithoutPollingAsync(String resourceGroupName, String vmScaleSetName) { - return beginStartOSUpgradeWithoutPollingWithResponseAsync(resourceGroupName, vmScaleSetName) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Starts a rolling upgrade to move all virtual machine scale set instances to the latest available Platform Image - * OS version. Instances which are already running the latest available OS version are not affected. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginStartOSUpgradeWithoutPollingAsync( - String resourceGroupName, String vmScaleSetName, Context context) { - return beginStartOSUpgradeWithoutPollingWithResponseAsync(resourceGroupName, vmScaleSetName, context) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Starts a rolling upgrade to move all virtual machine scale set instances to the latest available Platform Image - * OS version. Instances which are already running the latest available OS version are not affected. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void beginStartOSUpgradeWithoutPolling(String resourceGroupName, String vmScaleSetName) { - beginStartOSUpgradeWithoutPollingAsync(resourceGroupName, vmScaleSetName).block(); - } - - /** - * Starts a rolling upgrade to move all virtual machine scale set instances to the latest available Platform Image - * OS version. Instances which are already running the latest available OS version are not affected. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void beginStartOSUpgradeWithoutPolling(String resourceGroupName, String vmScaleSetName, Context context) { - beginStartOSUpgradeWithoutPollingAsync(resourceGroupName, vmScaleSetName, context).block(); - } - - /** - * Starts a rolling upgrade to move all extensions for all virtual machine scale set instances to the latest - * available extension version. Instances which are already running the latest extension versions are not affected. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginStartExtensionUpgradeWithoutPollingWithResponseAsync( - String resourceGroupName, String vmScaleSetName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2019-12-01"; - return FluxUtil - .withContext( - context -> - service - .beginStartExtensionUpgradeWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - apiVersion, - this.client.getSubscriptionId(), - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Starts a rolling upgrade to move all extensions for all virtual machine scale set instances to the latest - * available extension version. Instances which are already running the latest extension versions are not affected. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginStartExtensionUpgradeWithoutPollingWithResponseAsync( - String resourceGroupName, String vmScaleSetName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2019-12-01"; - return service - .beginStartExtensionUpgradeWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - apiVersion, - this.client.getSubscriptionId(), - context); - } - - /** - * Starts a rolling upgrade to move all extensions for all virtual machine scale set instances to the latest - * available extension version. Instances which are already running the latest extension versions are not affected. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginStartExtensionUpgradeWithoutPollingAsync(String resourceGroupName, String vmScaleSetName) { - return beginStartExtensionUpgradeWithoutPollingWithResponseAsync(resourceGroupName, vmScaleSetName) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Starts a rolling upgrade to move all extensions for all virtual machine scale set instances to the latest - * available extension version. Instances which are already running the latest extension versions are not affected. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginStartExtensionUpgradeWithoutPollingAsync( - String resourceGroupName, String vmScaleSetName, Context context) { - return beginStartExtensionUpgradeWithoutPollingWithResponseAsync(resourceGroupName, vmScaleSetName, context) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Starts a rolling upgrade to move all extensions for all virtual machine scale set instances to the latest - * available extension version. Instances which are already running the latest extension versions are not affected. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void beginStartExtensionUpgradeWithoutPolling(String resourceGroupName, String vmScaleSetName) { - beginStartExtensionUpgradeWithoutPollingAsync(resourceGroupName, vmScaleSetName).block(); - } - - /** - * Starts a rolling upgrade to move all extensions for all virtual machine scale set instances to the latest - * available extension version. Instances which are already running the latest extension versions are not affected. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void beginStartExtensionUpgradeWithoutPolling( - String resourceGroupName, String vmScaleSetName, Context context) { - beginStartExtensionUpgradeWithoutPollingAsync(resourceGroupName, vmScaleSetName, context).block(); - } } diff --git a/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/VirtualMachineScaleSetVMExtensionsClient.java b/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/VirtualMachineScaleSetVMExtensionsClient.java index 5525467cc624a..79eb0dc757693 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/VirtualMachineScaleSetVMExtensionsClient.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/VirtualMachineScaleSetVMExtensionsClient.java @@ -150,56 +150,6 @@ Mono> list( @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, Context context); - - @Headers({"Accept: application/json", "Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" - + "/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/extensions/{vmExtensionName}") - @ExpectedResponses({200, 201}) - @UnexpectedResponseExceptionType(ApiErrorException.class) - Mono> beginCreateOrUpdateWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("vmScaleSetName") String vmScaleSetName, - @PathParam("instanceId") String instanceId, - @PathParam("vmExtensionName") String vmExtensionName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") VirtualMachineExtensionInner extensionParameters, - Context context); - - @Headers({"Accept: application/json", "Content-Type: application/json"}) - @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" - + "/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/extensions/{vmExtensionName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ApiErrorException.class) - Mono> beginUpdateWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("vmScaleSetName") String vmScaleSetName, - @PathParam("instanceId") String instanceId, - @PathParam("vmExtensionName") String vmExtensionName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") VirtualMachineExtensionUpdate extensionParameters, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" - + "/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/extensions/{vmExtensionName}") - @ExpectedResponses({200, 202, 204}) - @UnexpectedResponseExceptionType(ApiErrorException.class) - Mono> beginDeleteWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("vmScaleSetName") String vmScaleSetName, - @PathParam("instanceId") String instanceId, - @PathParam("vmExtensionName") String vmExtensionName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - Context context); } /** @@ -327,6 +277,7 @@ public Mono>> createOrUpdateWithResponseAsync( extensionParameters.validate(); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .createOrUpdate( this.client.getEndpoint(), @@ -481,7 +432,7 @@ public Mono createOrUpdateAsync( return beginCreateOrUpdateAsync( resourceGroupName, vmScaleSetName, instanceId, vmExtensionName, extensionParameters) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -509,7 +460,7 @@ public Mono createOrUpdateAsync( return beginCreateOrUpdateAsync( resourceGroupName, vmScaleSetName, instanceId, vmExtensionName, extensionParameters, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -688,6 +639,7 @@ public Mono>> updateWithResponseAsync( extensionParameters.validate(); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .update( this.client.getEndpoint(), @@ -840,7 +792,7 @@ public Mono updateAsync( VirtualMachineExtensionUpdate extensionParameters) { return beginUpdateAsync(resourceGroupName, vmScaleSetName, instanceId, vmExtensionName, extensionParameters) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -868,7 +820,7 @@ public Mono updateAsync( return beginUpdateAsync( resourceGroupName, vmScaleSetName, instanceId, vmExtensionName, extensionParameters, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -1021,6 +973,7 @@ public Mono>> deleteWithResponseAsync( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .delete( this.client.getEndpoint(), @@ -1129,7 +1082,7 @@ public Mono deleteAsync( String resourceGroupName, String vmScaleSetName, String instanceId, String vmExtensionName) { return beginDeleteAsync(resourceGroupName, vmScaleSetName, instanceId, vmExtensionName) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -1150,7 +1103,7 @@ public Mono deleteAsync( String resourceGroupName, String vmScaleSetName, String instanceId, String vmExtensionName, Context context) { return beginDeleteAsync(resourceGroupName, vmScaleSetName, instanceId, vmExtensionName, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -1296,6 +1249,7 @@ public Mono> getWithResponseAsync( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .get( this.client.getEndpoint(), @@ -1554,6 +1508,7 @@ public Mono> listWithResponseA "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .list( this.client.getEndpoint(), @@ -1701,705 +1656,4 @@ public VirtualMachineExtensionsListResultInner list( final Context context = null; return listAsync(resourceGroupName, vmScaleSetName, instanceId, expand).block(); } - - /** - * The operation to create or update the VMSS VM extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param vmExtensionName The name of the virtual machine extension. - * @param extensionParameters Describes a Virtual Machine Extension. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine Extension. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginCreateOrUpdateWithoutPollingWithResponseAsync( - String resourceGroupName, - String vmScaleSetName, - String instanceId, - String vmExtensionName, - VirtualMachineExtensionInner extensionParameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); - } - if (instanceId == null) { - return Mono.error(new IllegalArgumentException("Parameter instanceId is required and cannot be null.")); - } - if (vmExtensionName == null) { - return Mono - .error(new IllegalArgumentException("Parameter vmExtensionName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (extensionParameters == null) { - return Mono - .error(new IllegalArgumentException("Parameter extensionParameters is required and cannot be null.")); - } else { - extensionParameters.validate(); - } - final String apiVersion = "2019-12-01"; - return FluxUtil - .withContext( - context -> - service - .beginCreateOrUpdateWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - instanceId, - vmExtensionName, - apiVersion, - this.client.getSubscriptionId(), - extensionParameters, - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * The operation to create or update the VMSS VM extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param vmExtensionName The name of the virtual machine extension. - * @param extensionParameters Describes a Virtual Machine Extension. - * @param context The context to associate with this 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 describes a Virtual Machine Extension. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginCreateOrUpdateWithoutPollingWithResponseAsync( - String resourceGroupName, - String vmScaleSetName, - String instanceId, - String vmExtensionName, - VirtualMachineExtensionInner extensionParameters, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); - } - if (instanceId == null) { - return Mono.error(new IllegalArgumentException("Parameter instanceId is required and cannot be null.")); - } - if (vmExtensionName == null) { - return Mono - .error(new IllegalArgumentException("Parameter vmExtensionName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (extensionParameters == null) { - return Mono - .error(new IllegalArgumentException("Parameter extensionParameters is required and cannot be null.")); - } else { - extensionParameters.validate(); - } - final String apiVersion = "2019-12-01"; - return service - .beginCreateOrUpdateWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - instanceId, - vmExtensionName, - apiVersion, - this.client.getSubscriptionId(), - extensionParameters, - context); - } - - /** - * The operation to create or update the VMSS VM extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param vmExtensionName The name of the virtual machine extension. - * @param extensionParameters Describes a Virtual Machine Extension. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine Extension. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginCreateOrUpdateWithoutPollingAsync( - String resourceGroupName, - String vmScaleSetName, - String instanceId, - String vmExtensionName, - VirtualMachineExtensionInner extensionParameters) { - return beginCreateOrUpdateWithoutPollingWithResponseAsync( - resourceGroupName, vmScaleSetName, instanceId, vmExtensionName, extensionParameters) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * The operation to create or update the VMSS VM extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param vmExtensionName The name of the virtual machine extension. - * @param extensionParameters Describes a Virtual Machine Extension. - * @param context The context to associate with this 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 describes a Virtual Machine Extension. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginCreateOrUpdateWithoutPollingAsync( - String resourceGroupName, - String vmScaleSetName, - String instanceId, - String vmExtensionName, - VirtualMachineExtensionInner extensionParameters, - Context context) { - return beginCreateOrUpdateWithoutPollingWithResponseAsync( - resourceGroupName, vmScaleSetName, instanceId, vmExtensionName, extensionParameters, context) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * The operation to create or update the VMSS VM extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param vmExtensionName The name of the virtual machine extension. - * @param extensionParameters Describes a Virtual Machine Extension. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine Extension. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public VirtualMachineExtensionInner beginCreateOrUpdateWithoutPolling( - String resourceGroupName, - String vmScaleSetName, - String instanceId, - String vmExtensionName, - VirtualMachineExtensionInner extensionParameters) { - return beginCreateOrUpdateWithoutPollingAsync( - resourceGroupName, vmScaleSetName, instanceId, vmExtensionName, extensionParameters) - .block(); - } - - /** - * The operation to create or update the VMSS VM extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param vmExtensionName The name of the virtual machine extension. - * @param extensionParameters Describes a Virtual Machine Extension. - * @param context The context to associate with this 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 describes a Virtual Machine Extension. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public VirtualMachineExtensionInner beginCreateOrUpdateWithoutPolling( - String resourceGroupName, - String vmScaleSetName, - String instanceId, - String vmExtensionName, - VirtualMachineExtensionInner extensionParameters, - Context context) { - return beginCreateOrUpdateWithoutPollingAsync( - resourceGroupName, vmScaleSetName, instanceId, vmExtensionName, extensionParameters, context) - .block(); - } - - /** - * The operation to update the VMSS VM extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param vmExtensionName The name of the virtual machine extension. - * @param extensionParameters Describes a Virtual Machine Extension. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine Extension. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginUpdateWithoutPollingWithResponseAsync( - String resourceGroupName, - String vmScaleSetName, - String instanceId, - String vmExtensionName, - VirtualMachineExtensionUpdate extensionParameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); - } - if (instanceId == null) { - return Mono.error(new IllegalArgumentException("Parameter instanceId is required and cannot be null.")); - } - if (vmExtensionName == null) { - return Mono - .error(new IllegalArgumentException("Parameter vmExtensionName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (extensionParameters == null) { - return Mono - .error(new IllegalArgumentException("Parameter extensionParameters is required and cannot be null.")); - } else { - extensionParameters.validate(); - } - final String apiVersion = "2019-12-01"; - return FluxUtil - .withContext( - context -> - service - .beginUpdateWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - instanceId, - vmExtensionName, - apiVersion, - this.client.getSubscriptionId(), - extensionParameters, - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * The operation to update the VMSS VM extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param vmExtensionName The name of the virtual machine extension. - * @param extensionParameters Describes a Virtual Machine Extension. - * @param context The context to associate with this 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 describes a Virtual Machine Extension. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginUpdateWithoutPollingWithResponseAsync( - String resourceGroupName, - String vmScaleSetName, - String instanceId, - String vmExtensionName, - VirtualMachineExtensionUpdate extensionParameters, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); - } - if (instanceId == null) { - return Mono.error(new IllegalArgumentException("Parameter instanceId is required and cannot be null.")); - } - if (vmExtensionName == null) { - return Mono - .error(new IllegalArgumentException("Parameter vmExtensionName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (extensionParameters == null) { - return Mono - .error(new IllegalArgumentException("Parameter extensionParameters is required and cannot be null.")); - } else { - extensionParameters.validate(); - } - final String apiVersion = "2019-12-01"; - return service - .beginUpdateWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - instanceId, - vmExtensionName, - apiVersion, - this.client.getSubscriptionId(), - extensionParameters, - context); - } - - /** - * The operation to update the VMSS VM extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param vmExtensionName The name of the virtual machine extension. - * @param extensionParameters Describes a Virtual Machine Extension. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine Extension. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginUpdateWithoutPollingAsync( - String resourceGroupName, - String vmScaleSetName, - String instanceId, - String vmExtensionName, - VirtualMachineExtensionUpdate extensionParameters) { - return beginUpdateWithoutPollingWithResponseAsync( - resourceGroupName, vmScaleSetName, instanceId, vmExtensionName, extensionParameters) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * The operation to update the VMSS VM extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param vmExtensionName The name of the virtual machine extension. - * @param extensionParameters Describes a Virtual Machine Extension. - * @param context The context to associate with this 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 describes a Virtual Machine Extension. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginUpdateWithoutPollingAsync( - String resourceGroupName, - String vmScaleSetName, - String instanceId, - String vmExtensionName, - VirtualMachineExtensionUpdate extensionParameters, - Context context) { - return beginUpdateWithoutPollingWithResponseAsync( - resourceGroupName, vmScaleSetName, instanceId, vmExtensionName, extensionParameters, context) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * The operation to update the VMSS VM extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param vmExtensionName The name of the virtual machine extension. - * @param extensionParameters Describes a Virtual Machine Extension. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine Extension. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public VirtualMachineExtensionInner beginUpdateWithoutPolling( - String resourceGroupName, - String vmScaleSetName, - String instanceId, - String vmExtensionName, - VirtualMachineExtensionUpdate extensionParameters) { - return beginUpdateWithoutPollingAsync( - resourceGroupName, vmScaleSetName, instanceId, vmExtensionName, extensionParameters) - .block(); - } - - /** - * The operation to update the VMSS VM extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param vmExtensionName The name of the virtual machine extension. - * @param extensionParameters Describes a Virtual Machine Extension. - * @param context The context to associate with this 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 describes a Virtual Machine Extension. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public VirtualMachineExtensionInner beginUpdateWithoutPolling( - String resourceGroupName, - String vmScaleSetName, - String instanceId, - String vmExtensionName, - VirtualMachineExtensionUpdate extensionParameters, - Context context) { - return beginUpdateWithoutPollingAsync( - resourceGroupName, vmScaleSetName, instanceId, vmExtensionName, extensionParameters, context) - .block(); - } - - /** - * The operation to delete the VMSS VM extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param vmExtensionName The name of the virtual machine extension. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginDeleteWithoutPollingWithResponseAsync( - String resourceGroupName, String vmScaleSetName, String instanceId, String vmExtensionName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); - } - if (instanceId == null) { - return Mono.error(new IllegalArgumentException("Parameter instanceId is required and cannot be null.")); - } - if (vmExtensionName == null) { - return Mono - .error(new IllegalArgumentException("Parameter vmExtensionName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2019-12-01"; - return FluxUtil - .withContext( - context -> - service - .beginDeleteWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - instanceId, - vmExtensionName, - apiVersion, - this.client.getSubscriptionId(), - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * The operation to delete the VMSS VM extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param vmExtensionName The name of the virtual machine extension. - * @param context The context to associate with this 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 completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginDeleteWithoutPollingWithResponseAsync( - String resourceGroupName, String vmScaleSetName, String instanceId, String vmExtensionName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); - } - if (instanceId == null) { - return Mono.error(new IllegalArgumentException("Parameter instanceId is required and cannot be null.")); - } - if (vmExtensionName == null) { - return Mono - .error(new IllegalArgumentException("Parameter vmExtensionName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2019-12-01"; - return service - .beginDeleteWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - instanceId, - vmExtensionName, - apiVersion, - this.client.getSubscriptionId(), - context); - } - - /** - * The operation to delete the VMSS VM extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param vmExtensionName The name of the virtual machine extension. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginDeleteWithoutPollingAsync( - String resourceGroupName, String vmScaleSetName, String instanceId, String vmExtensionName) { - return beginDeleteWithoutPollingWithResponseAsync( - resourceGroupName, vmScaleSetName, instanceId, vmExtensionName) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * The operation to delete the VMSS VM extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param vmExtensionName The name of the virtual machine extension. - * @param context The context to associate with this 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 completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginDeleteWithoutPollingAsync( - String resourceGroupName, String vmScaleSetName, String instanceId, String vmExtensionName, Context context) { - return beginDeleteWithoutPollingWithResponseAsync( - resourceGroupName, vmScaleSetName, instanceId, vmExtensionName, context) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * The operation to delete the VMSS VM extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param vmExtensionName The name of the virtual machine extension. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void beginDeleteWithoutPolling( - String resourceGroupName, String vmScaleSetName, String instanceId, String vmExtensionName) { - beginDeleteWithoutPollingAsync(resourceGroupName, vmScaleSetName, instanceId, vmExtensionName).block(); - } - - /** - * The operation to delete the VMSS VM extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param vmExtensionName The name of the virtual machine extension. - * @param context The context to associate with this 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. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void beginDeleteWithoutPolling( - String resourceGroupName, String vmScaleSetName, String instanceId, String vmExtensionName, Context context) { - beginDeleteWithoutPollingAsync(resourceGroupName, vmScaleSetName, instanceId, vmExtensionName, context).block(); - } } diff --git a/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/VirtualMachineScaleSetVMsClient.java b/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/VirtualMachineScaleSetVMsClient.java index 9e137e3102c12..0ad2aa74e0027 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/VirtualMachineScaleSetVMsClient.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/VirtualMachineScaleSetVMsClient.java @@ -306,175 +306,6 @@ Mono>> runCommand( @BodyParam("application/json") RunCommandInput parameters, Context context); - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" - + "/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/reimage") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> beginReimageWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("vmScaleSetName") String vmScaleSetName, - @PathParam("instanceId") String instanceId, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") VirtualMachineReimageParameters vmScaleSetVMReimageInput, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" - + "/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/reimageall") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> beginReimageAllWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("vmScaleSetName") String vmScaleSetName, - @PathParam("instanceId") String instanceId, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" - + "/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/deallocate") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> beginDeallocateWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("vmScaleSetName") String vmScaleSetName, - @PathParam("instanceId") String instanceId, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - Context context); - - @Headers({"Accept: application/json", "Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" - + "/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> beginUpdateWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("vmScaleSetName") String vmScaleSetName, - @PathParam("instanceId") String instanceId, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") VirtualMachineScaleSetVMInner parameters, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" - + "/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}") - @ExpectedResponses({200, 202, 204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> beginDeleteWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("vmScaleSetName") String vmScaleSetName, - @PathParam("instanceId") String instanceId, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" - + "/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/poweroff") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> beginPowerOffWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("vmScaleSetName") String vmScaleSetName, - @PathParam("instanceId") String instanceId, - @QueryParam("skipShutdown") Boolean skipShutdown, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" - + "/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/restart") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> beginRestartWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("vmScaleSetName") String vmScaleSetName, - @PathParam("instanceId") String instanceId, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" - + "/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/start") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> beginStartWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("vmScaleSetName") String vmScaleSetName, - @PathParam("instanceId") String instanceId, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" - + "/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/redeploy") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> beginRedeployWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("vmScaleSetName") String vmScaleSetName, - @PathParam("instanceId") String instanceId, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" - + "/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/performMaintenance") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> beginPerformMaintenanceWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("vmScaleSetName") String vmScaleSetName, - @PathParam("instanceId") String instanceId, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - Context context); - - @Headers({"Accept: application/json,text/json", "Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" - + "/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/runCommand") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> beginRunCommandWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("vmScaleSetName") String vmScaleSetName, - @PathParam("instanceId") String instanceId, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") RunCommandInput parameters, - Context context); - @Headers({"Accept: application/json", "Content-Type: application/json"}) @Get("{nextLink}") @ExpectedResponses({200}) @@ -590,6 +421,7 @@ public Mono>> reimageWithResponseAsync( vmScaleSetVMReimageInputInternal.withTempDisk(tempDisk); } VirtualMachineReimageParameters vmScaleSetVMReimageInput = vmScaleSetVMReimageInputInternal; + context = this.client.mergeContext(context); return service .reimage( this.client.getEndpoint(), @@ -702,7 +534,7 @@ public Mono reimageAsync( String resourceGroupName, String vmScaleSetName, String instanceId, Boolean tempDisk) { return beginReimageAsync(resourceGroupName, vmScaleSetName, instanceId, tempDisk) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -724,7 +556,7 @@ public Mono reimageAsync( String resourceGroupName, String vmScaleSetName, String instanceId, Boolean tempDisk, Context context) { return beginReimageAsync(resourceGroupName, vmScaleSetName, instanceId, tempDisk, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -855,6 +687,7 @@ public Mono>> reimageAllWithResponseAsync( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .reimageAll( this.client.getEndpoint(), @@ -960,7 +793,7 @@ public SyncPoller, Void> beginReimageAll( public Mono reimageAllAsync(String resourceGroupName, String vmScaleSetName, String instanceId) { return beginReimageAllAsync(resourceGroupName, vmScaleSetName, instanceId) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -981,7 +814,7 @@ public Mono reimageAllAsync( String resourceGroupName, String vmScaleSetName, String instanceId, Context context) { return beginReimageAllAsync(resourceGroupName, vmScaleSetName, instanceId, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -1109,6 +942,7 @@ public Mono>> deallocateWithResponseAsync( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .deallocate( this.client.getEndpoint(), @@ -1214,7 +1048,7 @@ public SyncPoller, Void> beginDeallocate( public Mono deallocateAsync(String resourceGroupName, String vmScaleSetName, String instanceId) { return beginDeallocateAsync(resourceGroupName, vmScaleSetName, instanceId) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -1235,7 +1069,7 @@ public Mono deallocateAsync( String resourceGroupName, String vmScaleSetName, String instanceId, Context context) { return beginDeallocateAsync(resourceGroupName, vmScaleSetName, instanceId, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -1378,6 +1212,7 @@ public Mono>> updateWithResponseAsync( parameters.validate(); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .update( this.client.getEndpoint(), @@ -1505,7 +1340,7 @@ public Mono updateAsync( String resourceGroupName, String vmScaleSetName, String instanceId, VirtualMachineScaleSetVMInner parameters) { return beginUpdateAsync(resourceGroupName, vmScaleSetName, instanceId, parameters) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -1530,7 +1365,7 @@ public Mono updateAsync( Context context) { return beginUpdateAsync(resourceGroupName, vmScaleSetName, instanceId, parameters, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -1664,6 +1499,7 @@ public Mono>> deleteWithResponseAsync( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .delete( this.client.getEndpoint(), @@ -1763,7 +1599,7 @@ public SyncPoller, Void> beginDelete( public Mono deleteAsync(String resourceGroupName, String vmScaleSetName, String instanceId) { return beginDeleteAsync(resourceGroupName, vmScaleSetName, instanceId) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -1782,7 +1618,7 @@ public Mono deleteAsync(String resourceGroupName, String vmScaleSetName, S public Mono deleteAsync(String resourceGroupName, String vmScaleSetName, String instanceId, Context context) { return beginDeleteAsync(resourceGroupName, vmScaleSetName, instanceId, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -1909,6 +1745,7 @@ public Mono> getWithResponseAsync( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .get( this.client.getEndpoint(), @@ -2146,6 +1983,7 @@ public Mono> getInstanceView "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .getInstanceView( this.client.getEndpoint(), @@ -2355,6 +2193,7 @@ public Mono> listSinglePageAsync( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .list( this.client.getEndpoint(), @@ -2615,6 +2454,7 @@ public Mono>> powerOffWithResponseAsync( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .powerOff( this.client.getEndpoint(), @@ -2737,7 +2577,7 @@ public Mono powerOffAsync( String resourceGroupName, String vmScaleSetName, String instanceId, Boolean skipShutdown) { return beginPowerOffAsync(resourceGroupName, vmScaleSetName, instanceId, skipShutdown) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -2761,7 +2601,7 @@ public Mono powerOffAsync( String resourceGroupName, String vmScaleSetName, String instanceId, Boolean skipShutdown, Context context) { return beginPowerOffAsync(resourceGroupName, vmScaleSetName, instanceId, skipShutdown, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -2782,7 +2622,7 @@ public Mono powerOffAsync(String resourceGroupName, String vmScaleSetName, final Context context = null; return beginPowerOffAsync(resourceGroupName, vmScaleSetName, instanceId, skipShutdown) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -2933,6 +2773,7 @@ public Mono>> restartWithResponseAsync( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .restart( this.client.getEndpoint(), @@ -3032,7 +2873,7 @@ public SyncPoller, Void> beginRestart( public Mono restartAsync(String resourceGroupName, String vmScaleSetName, String instanceId) { return beginRestartAsync(resourceGroupName, vmScaleSetName, instanceId) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -3052,7 +2893,7 @@ public Mono restartAsync( String resourceGroupName, String vmScaleSetName, String instanceId, Context context) { return beginRestartAsync(resourceGroupName, vmScaleSetName, instanceId, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -3176,6 +3017,7 @@ public Mono>> startWithResponseAsync( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .start( this.client.getEndpoint(), @@ -3275,7 +3117,7 @@ public SyncPoller, Void> beginStart( public Mono startAsync(String resourceGroupName, String vmScaleSetName, String instanceId) { return beginStartAsync(resourceGroupName, vmScaleSetName, instanceId) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -3294,7 +3136,7 @@ public Mono startAsync(String resourceGroupName, String vmScaleSetName, St public Mono startAsync(String resourceGroupName, String vmScaleSetName, String instanceId, Context context) { return beginStartAsync(resourceGroupName, vmScaleSetName, instanceId, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -3418,6 +3260,7 @@ public Mono>> redeployWithResponseAsync( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .redeploy( this.client.getEndpoint(), @@ -3518,7 +3361,7 @@ public SyncPoller, Void> beginRedeploy( public Mono redeployAsync(String resourceGroupName, String vmScaleSetName, String instanceId) { return beginRedeployAsync(resourceGroupName, vmScaleSetName, instanceId) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -3538,7 +3381,7 @@ public Mono redeployAsync( String resourceGroupName, String vmScaleSetName, String instanceId, Context context) { return beginRedeployAsync(resourceGroupName, vmScaleSetName, instanceId, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -3662,6 +3505,7 @@ public Mono>> performMaintenanceWithResponseAsync( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .performMaintenance( this.client.getEndpoint(), @@ -3762,7 +3606,7 @@ public SyncPoller, Void> beginPerformMaintenance( public Mono performMaintenanceAsync(String resourceGroupName, String vmScaleSetName, String instanceId) { return beginPerformMaintenanceAsync(resourceGroupName, vmScaleSetName, instanceId) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -3782,7 +3626,7 @@ public Mono performMaintenanceAsync( String resourceGroupName, String vmScaleSetName, String instanceId, Context context) { return beginPerformMaintenanceAsync(resourceGroupName, vmScaleSetName, instanceId, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -3909,6 +3753,7 @@ public Mono> simulateEvictionWithResponseAsync( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .simulateEviction( this.client.getEndpoint(), @@ -4098,6 +3943,7 @@ public Mono>> runCommandWithResponseAsync( parameters.validate(); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .runCommand( this.client.getEndpoint(), @@ -4219,7 +4065,7 @@ public Mono runCommandAsync( String resourceGroupName, String vmScaleSetName, String instanceId, RunCommandInput parameters) { return beginRunCommandAsync(resourceGroupName, vmScaleSetName, instanceId, parameters) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -4244,7 +4090,7 @@ public Mono runCommandAsync( Context context) { return beginRunCommandAsync(resourceGroupName, vmScaleSetName, instanceId, parameters, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -4288,2083 +4134,6 @@ public RunCommandResultInner runCommand( return runCommandAsync(resourceGroupName, vmScaleSetName, instanceId, parameters, context).block(); } - /** - * Reimages (upgrade the operating system) a specific virtual machine in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param tempDisk Specifies whether to reimage temp disk. Default value: false. Note: This temp disk reimage - * parameter is only supported for VM/VMSS with Ephemeral OS disk. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginReimageWithoutPollingWithResponseAsync( - String resourceGroupName, String vmScaleSetName, String instanceId, Boolean tempDisk) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); - } - if (instanceId == null) { - return Mono.error(new IllegalArgumentException("Parameter instanceId is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2019-12-01"; - VirtualMachineReimageParameters vmScaleSetVMReimageInputInternal = null; - if (tempDisk != null) { - vmScaleSetVMReimageInputInternal = new VirtualMachineReimageParameters(); - vmScaleSetVMReimageInputInternal.withTempDisk(tempDisk); - } - VirtualMachineReimageParameters vmScaleSetVMReimageInput = vmScaleSetVMReimageInputInternal; - return FluxUtil - .withContext( - context -> - service - .beginReimageWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - instanceId, - apiVersion, - this.client.getSubscriptionId(), - vmScaleSetVMReimageInput, - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Reimages (upgrade the operating system) a specific virtual machine in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param tempDisk Specifies whether to reimage temp disk. Default value: false. Note: This temp disk reimage - * parameter is only supported for VM/VMSS with Ephemeral OS disk. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginReimageWithoutPollingWithResponseAsync( - String resourceGroupName, String vmScaleSetName, String instanceId, Boolean tempDisk, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); - } - if (instanceId == null) { - return Mono.error(new IllegalArgumentException("Parameter instanceId is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2019-12-01"; - VirtualMachineReimageParameters vmScaleSetVMReimageInputInternal = null; - if (tempDisk != null) { - vmScaleSetVMReimageInputInternal = new VirtualMachineReimageParameters(); - vmScaleSetVMReimageInputInternal.withTempDisk(tempDisk); - } - VirtualMachineReimageParameters vmScaleSetVMReimageInput = vmScaleSetVMReimageInputInternal; - return service - .beginReimageWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - instanceId, - apiVersion, - this.client.getSubscriptionId(), - vmScaleSetVMReimageInput, - context); - } - - /** - * Reimages (upgrade the operating system) a specific virtual machine in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param tempDisk Specifies whether to reimage temp disk. Default value: false. Note: This temp disk reimage - * parameter is only supported for VM/VMSS with Ephemeral OS disk. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginReimageWithoutPollingAsync( - String resourceGroupName, String vmScaleSetName, String instanceId, Boolean tempDisk) { - return beginReimageWithoutPollingWithResponseAsync(resourceGroupName, vmScaleSetName, instanceId, tempDisk) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Reimages (upgrade the operating system) a specific virtual machine in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param tempDisk Specifies whether to reimage temp disk. Default value: false. Note: This temp disk reimage - * parameter is only supported for VM/VMSS with Ephemeral OS disk. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginReimageWithoutPollingAsync( - String resourceGroupName, String vmScaleSetName, String instanceId, Boolean tempDisk, Context context) { - return beginReimageWithoutPollingWithResponseAsync( - resourceGroupName, vmScaleSetName, instanceId, tempDisk, context) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Reimages (upgrade the operating system) a specific virtual machine in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param tempDisk Specifies whether to reimage temp disk. Default value: false. Note: This temp disk reimage - * parameter is only supported for VM/VMSS with Ephemeral OS disk. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void beginReimageWithoutPolling( - String resourceGroupName, String vmScaleSetName, String instanceId, Boolean tempDisk) { - beginReimageWithoutPollingAsync(resourceGroupName, vmScaleSetName, instanceId, tempDisk).block(); - } - - /** - * Reimages (upgrade the operating system) a specific virtual machine in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param tempDisk Specifies whether to reimage temp disk. Default value: false. Note: This temp disk reimage - * parameter is only supported for VM/VMSS with Ephemeral OS disk. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void beginReimageWithoutPolling( - String resourceGroupName, String vmScaleSetName, String instanceId, Boolean tempDisk, Context context) { - beginReimageWithoutPollingAsync(resourceGroupName, vmScaleSetName, instanceId, tempDisk, context).block(); - } - - /** - * Allows you to re-image all the disks ( including data disks ) in the a VM scale set instance. This operation is - * only supported for managed disks. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginReimageAllWithoutPollingWithResponseAsync( - String resourceGroupName, String vmScaleSetName, String instanceId) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); - } - if (instanceId == null) { - return Mono.error(new IllegalArgumentException("Parameter instanceId is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2019-12-01"; - return FluxUtil - .withContext( - context -> - service - .beginReimageAllWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - instanceId, - apiVersion, - this.client.getSubscriptionId(), - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Allows you to re-image all the disks ( including data disks ) in the a VM scale set instance. This operation is - * only supported for managed disks. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginReimageAllWithoutPollingWithResponseAsync( - String resourceGroupName, String vmScaleSetName, String instanceId, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); - } - if (instanceId == null) { - return Mono.error(new IllegalArgumentException("Parameter instanceId is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2019-12-01"; - return service - .beginReimageAllWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - instanceId, - apiVersion, - this.client.getSubscriptionId(), - context); - } - - /** - * Allows you to re-image all the disks ( including data disks ) in the a VM scale set instance. This operation is - * only supported for managed disks. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginReimageAllWithoutPollingAsync( - String resourceGroupName, String vmScaleSetName, String instanceId) { - return beginReimageAllWithoutPollingWithResponseAsync(resourceGroupName, vmScaleSetName, instanceId) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Allows you to re-image all the disks ( including data disks ) in the a VM scale set instance. This operation is - * only supported for managed disks. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginReimageAllWithoutPollingAsync( - String resourceGroupName, String vmScaleSetName, String instanceId, Context context) { - return beginReimageAllWithoutPollingWithResponseAsync(resourceGroupName, vmScaleSetName, instanceId, context) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Allows you to re-image all the disks ( including data disks ) in the a VM scale set instance. This operation is - * only supported for managed disks. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void beginReimageAllWithoutPolling(String resourceGroupName, String vmScaleSetName, String instanceId) { - beginReimageAllWithoutPollingAsync(resourceGroupName, vmScaleSetName, instanceId).block(); - } - - /** - * Allows you to re-image all the disks ( including data disks ) in the a VM scale set instance. This operation is - * only supported for managed disks. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void beginReimageAllWithoutPolling( - String resourceGroupName, String vmScaleSetName, String instanceId, Context context) { - beginReimageAllWithoutPollingAsync(resourceGroupName, vmScaleSetName, instanceId, context).block(); - } - - /** - * Deallocates a specific virtual machine in a VM scale set. Shuts down the virtual machine and releases the compute - * resources it uses. You are not billed for the compute resources of this virtual machine once it is deallocated. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginDeallocateWithoutPollingWithResponseAsync( - String resourceGroupName, String vmScaleSetName, String instanceId) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); - } - if (instanceId == null) { - return Mono.error(new IllegalArgumentException("Parameter instanceId is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2019-12-01"; - return FluxUtil - .withContext( - context -> - service - .beginDeallocateWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - instanceId, - apiVersion, - this.client.getSubscriptionId(), - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Deallocates a specific virtual machine in a VM scale set. Shuts down the virtual machine and releases the compute - * resources it uses. You are not billed for the compute resources of this virtual machine once it is deallocated. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginDeallocateWithoutPollingWithResponseAsync( - String resourceGroupName, String vmScaleSetName, String instanceId, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); - } - if (instanceId == null) { - return Mono.error(new IllegalArgumentException("Parameter instanceId is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2019-12-01"; - return service - .beginDeallocateWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - instanceId, - apiVersion, - this.client.getSubscriptionId(), - context); - } - - /** - * Deallocates a specific virtual machine in a VM scale set. Shuts down the virtual machine and releases the compute - * resources it uses. You are not billed for the compute resources of this virtual machine once it is deallocated. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginDeallocateWithoutPollingAsync( - String resourceGroupName, String vmScaleSetName, String instanceId) { - return beginDeallocateWithoutPollingWithResponseAsync(resourceGroupName, vmScaleSetName, instanceId) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Deallocates a specific virtual machine in a VM scale set. Shuts down the virtual machine and releases the compute - * resources it uses. You are not billed for the compute resources of this virtual machine once it is deallocated. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginDeallocateWithoutPollingAsync( - String resourceGroupName, String vmScaleSetName, String instanceId, Context context) { - return beginDeallocateWithoutPollingWithResponseAsync(resourceGroupName, vmScaleSetName, instanceId, context) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Deallocates a specific virtual machine in a VM scale set. Shuts down the virtual machine and releases the compute - * resources it uses. You are not billed for the compute resources of this virtual machine once it is deallocated. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void beginDeallocateWithoutPolling(String resourceGroupName, String vmScaleSetName, String instanceId) { - beginDeallocateWithoutPollingAsync(resourceGroupName, vmScaleSetName, instanceId).block(); - } - - /** - * Deallocates a specific virtual machine in a VM scale set. Shuts down the virtual machine and releases the compute - * resources it uses. You are not billed for the compute resources of this virtual machine once it is deallocated. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void beginDeallocateWithoutPolling( - String resourceGroupName, String vmScaleSetName, String instanceId, Context context) { - beginDeallocateWithoutPollingAsync(resourceGroupName, vmScaleSetName, instanceId, context).block(); - } - - /** - * Updates a virtual machine of a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set where the extension should be create or updated. - * @param instanceId The instance ID of the virtual machine. - * @param parameters Describes a virtual machine scale set virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a virtual machine scale set virtual machine. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginUpdateWithoutPollingWithResponseAsync( - String resourceGroupName, String vmScaleSetName, String instanceId, VirtualMachineScaleSetVMInner parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); - } - if (instanceId == null) { - return Mono.error(new IllegalArgumentException("Parameter instanceId is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2019-12-01"; - return FluxUtil - .withContext( - context -> - service - .beginUpdateWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - instanceId, - apiVersion, - this.client.getSubscriptionId(), - parameters, - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Updates a virtual machine of a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set where the extension should be create or updated. - * @param instanceId The instance ID of the virtual machine. - * @param parameters Describes a virtual machine scale set virtual machine. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a virtual machine scale set virtual machine. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginUpdateWithoutPollingWithResponseAsync( - String resourceGroupName, - String vmScaleSetName, - String instanceId, - VirtualMachineScaleSetVMInner parameters, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); - } - if (instanceId == null) { - return Mono.error(new IllegalArgumentException("Parameter instanceId is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2019-12-01"; - return service - .beginUpdateWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - instanceId, - apiVersion, - this.client.getSubscriptionId(), - parameters, - context); - } - - /** - * Updates a virtual machine of a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set where the extension should be create or updated. - * @param instanceId The instance ID of the virtual machine. - * @param parameters Describes a virtual machine scale set virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a virtual machine scale set virtual machine. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginUpdateWithoutPollingAsync( - String resourceGroupName, String vmScaleSetName, String instanceId, VirtualMachineScaleSetVMInner parameters) { - return beginUpdateWithoutPollingWithResponseAsync(resourceGroupName, vmScaleSetName, instanceId, parameters) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Updates a virtual machine of a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set where the extension should be create or updated. - * @param instanceId The instance ID of the virtual machine. - * @param parameters Describes a virtual machine scale set virtual machine. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a virtual machine scale set virtual machine. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginUpdateWithoutPollingAsync( - String resourceGroupName, - String vmScaleSetName, - String instanceId, - VirtualMachineScaleSetVMInner parameters, - Context context) { - return beginUpdateWithoutPollingWithResponseAsync( - resourceGroupName, vmScaleSetName, instanceId, parameters, context) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Updates a virtual machine of a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set where the extension should be create or updated. - * @param instanceId The instance ID of the virtual machine. - * @param parameters Describes a virtual machine scale set virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a virtual machine scale set virtual machine. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public VirtualMachineScaleSetVMInner beginUpdateWithoutPolling( - String resourceGroupName, String vmScaleSetName, String instanceId, VirtualMachineScaleSetVMInner parameters) { - return beginUpdateWithoutPollingAsync(resourceGroupName, vmScaleSetName, instanceId, parameters).block(); - } - - /** - * Updates a virtual machine of a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set where the extension should be create or updated. - * @param instanceId The instance ID of the virtual machine. - * @param parameters Describes a virtual machine scale set virtual machine. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a virtual machine scale set virtual machine. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public VirtualMachineScaleSetVMInner beginUpdateWithoutPolling( - String resourceGroupName, - String vmScaleSetName, - String instanceId, - VirtualMachineScaleSetVMInner parameters, - Context context) { - return beginUpdateWithoutPollingAsync(resourceGroupName, vmScaleSetName, instanceId, parameters, context) - .block(); - } - - /** - * Deletes a virtual machine from a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginDeleteWithoutPollingWithResponseAsync( - String resourceGroupName, String vmScaleSetName, String instanceId) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); - } - if (instanceId == null) { - return Mono.error(new IllegalArgumentException("Parameter instanceId is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2019-12-01"; - return FluxUtil - .withContext( - context -> - service - .beginDeleteWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - instanceId, - apiVersion, - this.client.getSubscriptionId(), - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Deletes a virtual machine from a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginDeleteWithoutPollingWithResponseAsync( - String resourceGroupName, String vmScaleSetName, String instanceId, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); - } - if (instanceId == null) { - return Mono.error(new IllegalArgumentException("Parameter instanceId is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2019-12-01"; - return service - .beginDeleteWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - instanceId, - apiVersion, - this.client.getSubscriptionId(), - context); - } - - /** - * Deletes a virtual machine from a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginDeleteWithoutPollingAsync( - String resourceGroupName, String vmScaleSetName, String instanceId) { - return beginDeleteWithoutPollingWithResponseAsync(resourceGroupName, vmScaleSetName, instanceId) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Deletes a virtual machine from a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginDeleteWithoutPollingAsync( - String resourceGroupName, String vmScaleSetName, String instanceId, Context context) { - return beginDeleteWithoutPollingWithResponseAsync(resourceGroupName, vmScaleSetName, instanceId, context) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Deletes a virtual machine from a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void beginDeleteWithoutPolling(String resourceGroupName, String vmScaleSetName, String instanceId) { - beginDeleteWithoutPollingAsync(resourceGroupName, vmScaleSetName, instanceId).block(); - } - - /** - * Deletes a virtual machine from a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void beginDeleteWithoutPolling( - String resourceGroupName, String vmScaleSetName, String instanceId, Context context) { - beginDeleteWithoutPollingAsync(resourceGroupName, vmScaleSetName, instanceId, context).block(); - } - - /** - * Power off (stop) a virtual machine in a VM scale set. Note that resources are still attached and you are getting - * charged for the resources. Instead, use deallocate to release resources and avoid charges. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param skipShutdown The parameter to request non-graceful VM shutdown. True value for this flag indicates - * non-graceful shutdown whereas false indicates otherwise. Default value for this flag is false if not - * specified. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginPowerOffWithoutPollingWithResponseAsync( - String resourceGroupName, String vmScaleSetName, String instanceId, Boolean skipShutdown) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); - } - if (instanceId == null) { - return Mono.error(new IllegalArgumentException("Parameter instanceId is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2019-12-01"; - return FluxUtil - .withContext( - context -> - service - .beginPowerOffWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - instanceId, - skipShutdown, - apiVersion, - this.client.getSubscriptionId(), - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Power off (stop) a virtual machine in a VM scale set. Note that resources are still attached and you are getting - * charged for the resources. Instead, use deallocate to release resources and avoid charges. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param skipShutdown The parameter to request non-graceful VM shutdown. True value for this flag indicates - * non-graceful shutdown whereas false indicates otherwise. Default value for this flag is false if not - * specified. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginPowerOffWithoutPollingWithResponseAsync( - String resourceGroupName, String vmScaleSetName, String instanceId, Boolean skipShutdown, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); - } - if (instanceId == null) { - return Mono.error(new IllegalArgumentException("Parameter instanceId is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2019-12-01"; - return service - .beginPowerOffWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - instanceId, - skipShutdown, - apiVersion, - this.client.getSubscriptionId(), - context); - } - - /** - * Power off (stop) a virtual machine in a VM scale set. Note that resources are still attached and you are getting - * charged for the resources. Instead, use deallocate to release resources and avoid charges. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param skipShutdown The parameter to request non-graceful VM shutdown. True value for this flag indicates - * non-graceful shutdown whereas false indicates otherwise. Default value for this flag is false if not - * specified. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginPowerOffWithoutPollingAsync( - String resourceGroupName, String vmScaleSetName, String instanceId, Boolean skipShutdown) { - return beginPowerOffWithoutPollingWithResponseAsync(resourceGroupName, vmScaleSetName, instanceId, skipShutdown) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Power off (stop) a virtual machine in a VM scale set. Note that resources are still attached and you are getting - * charged for the resources. Instead, use deallocate to release resources and avoid charges. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param skipShutdown The parameter to request non-graceful VM shutdown. True value for this flag indicates - * non-graceful shutdown whereas false indicates otherwise. Default value for this flag is false if not - * specified. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginPowerOffWithoutPollingAsync( - String resourceGroupName, String vmScaleSetName, String instanceId, Boolean skipShutdown, Context context) { - return beginPowerOffWithoutPollingWithResponseAsync( - resourceGroupName, vmScaleSetName, instanceId, skipShutdown, context) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Power off (stop) a virtual machine in a VM scale set. Note that resources are still attached and you are getting - * charged for the resources. Instead, use deallocate to release resources and avoid charges. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginPowerOffWithoutPollingAsync( - String resourceGroupName, String vmScaleSetName, String instanceId) { - final Boolean skipShutdown = null; - final Context context = null; - return beginPowerOffWithoutPollingWithResponseAsync(resourceGroupName, vmScaleSetName, instanceId, skipShutdown) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Power off (stop) a virtual machine in a VM scale set. Note that resources are still attached and you are getting - * charged for the resources. Instead, use deallocate to release resources and avoid charges. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param skipShutdown The parameter to request non-graceful VM shutdown. True value for this flag indicates - * non-graceful shutdown whereas false indicates otherwise. Default value for this flag is false if not - * specified. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void beginPowerOffWithoutPolling( - String resourceGroupName, String vmScaleSetName, String instanceId, Boolean skipShutdown) { - beginPowerOffWithoutPollingAsync(resourceGroupName, vmScaleSetName, instanceId, skipShutdown).block(); - } - - /** - * Power off (stop) a virtual machine in a VM scale set. Note that resources are still attached and you are getting - * charged for the resources. Instead, use deallocate to release resources and avoid charges. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param skipShutdown The parameter to request non-graceful VM shutdown. True value for this flag indicates - * non-graceful shutdown whereas false indicates otherwise. Default value for this flag is false if not - * specified. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void beginPowerOffWithoutPolling( - String resourceGroupName, String vmScaleSetName, String instanceId, Boolean skipShutdown, Context context) { - beginPowerOffWithoutPollingAsync(resourceGroupName, vmScaleSetName, instanceId, skipShutdown, context).block(); - } - - /** - * Power off (stop) a virtual machine in a VM scale set. Note that resources are still attached and you are getting - * charged for the resources. Instead, use deallocate to release resources and avoid charges. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void beginPowerOffWithoutPolling(String resourceGroupName, String vmScaleSetName, String instanceId) { - final Boolean skipShutdown = null; - final Context context = null; - beginPowerOffWithoutPollingAsync(resourceGroupName, vmScaleSetName, instanceId, skipShutdown).block(); - } - - /** - * Restarts a virtual machine in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginRestartWithoutPollingWithResponseAsync( - String resourceGroupName, String vmScaleSetName, String instanceId) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); - } - if (instanceId == null) { - return Mono.error(new IllegalArgumentException("Parameter instanceId is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2019-12-01"; - return FluxUtil - .withContext( - context -> - service - .beginRestartWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - instanceId, - apiVersion, - this.client.getSubscriptionId(), - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Restarts a virtual machine in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginRestartWithoutPollingWithResponseAsync( - String resourceGroupName, String vmScaleSetName, String instanceId, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); - } - if (instanceId == null) { - return Mono.error(new IllegalArgumentException("Parameter instanceId is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2019-12-01"; - return service - .beginRestartWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - instanceId, - apiVersion, - this.client.getSubscriptionId(), - context); - } - - /** - * Restarts a virtual machine in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginRestartWithoutPollingAsync( - String resourceGroupName, String vmScaleSetName, String instanceId) { - return beginRestartWithoutPollingWithResponseAsync(resourceGroupName, vmScaleSetName, instanceId) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Restarts a virtual machine in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginRestartWithoutPollingAsync( - String resourceGroupName, String vmScaleSetName, String instanceId, Context context) { - return beginRestartWithoutPollingWithResponseAsync(resourceGroupName, vmScaleSetName, instanceId, context) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Restarts a virtual machine in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void beginRestartWithoutPolling(String resourceGroupName, String vmScaleSetName, String instanceId) { - beginRestartWithoutPollingAsync(resourceGroupName, vmScaleSetName, instanceId).block(); - } - - /** - * Restarts a virtual machine in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void beginRestartWithoutPolling( - String resourceGroupName, String vmScaleSetName, String instanceId, Context context) { - beginRestartWithoutPollingAsync(resourceGroupName, vmScaleSetName, instanceId, context).block(); - } - - /** - * Starts a virtual machine in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginStartWithoutPollingWithResponseAsync( - String resourceGroupName, String vmScaleSetName, String instanceId) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); - } - if (instanceId == null) { - return Mono.error(new IllegalArgumentException("Parameter instanceId is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2019-12-01"; - return FluxUtil - .withContext( - context -> - service - .beginStartWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - instanceId, - apiVersion, - this.client.getSubscriptionId(), - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Starts a virtual machine in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginStartWithoutPollingWithResponseAsync( - String resourceGroupName, String vmScaleSetName, String instanceId, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); - } - if (instanceId == null) { - return Mono.error(new IllegalArgumentException("Parameter instanceId is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2019-12-01"; - return service - .beginStartWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - instanceId, - apiVersion, - this.client.getSubscriptionId(), - context); - } - - /** - * Starts a virtual machine in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginStartWithoutPollingAsync( - String resourceGroupName, String vmScaleSetName, String instanceId) { - return beginStartWithoutPollingWithResponseAsync(resourceGroupName, vmScaleSetName, instanceId) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Starts a virtual machine in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginStartWithoutPollingAsync( - String resourceGroupName, String vmScaleSetName, String instanceId, Context context) { - return beginStartWithoutPollingWithResponseAsync(resourceGroupName, vmScaleSetName, instanceId, context) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Starts a virtual machine in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void beginStartWithoutPolling(String resourceGroupName, String vmScaleSetName, String instanceId) { - beginStartWithoutPollingAsync(resourceGroupName, vmScaleSetName, instanceId).block(); - } - - /** - * Starts a virtual machine in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void beginStartWithoutPolling( - String resourceGroupName, String vmScaleSetName, String instanceId, Context context) { - beginStartWithoutPollingAsync(resourceGroupName, vmScaleSetName, instanceId, context).block(); - } - - /** - * Shuts down the virtual machine in the virtual machine scale set, moves it to a new node, and powers it back on. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginRedeployWithoutPollingWithResponseAsync( - String resourceGroupName, String vmScaleSetName, String instanceId) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); - } - if (instanceId == null) { - return Mono.error(new IllegalArgumentException("Parameter instanceId is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2019-12-01"; - return FluxUtil - .withContext( - context -> - service - .beginRedeployWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - instanceId, - apiVersion, - this.client.getSubscriptionId(), - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Shuts down the virtual machine in the virtual machine scale set, moves it to a new node, and powers it back on. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginRedeployWithoutPollingWithResponseAsync( - String resourceGroupName, String vmScaleSetName, String instanceId, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); - } - if (instanceId == null) { - return Mono.error(new IllegalArgumentException("Parameter instanceId is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2019-12-01"; - return service - .beginRedeployWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - instanceId, - apiVersion, - this.client.getSubscriptionId(), - context); - } - - /** - * Shuts down the virtual machine in the virtual machine scale set, moves it to a new node, and powers it back on. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginRedeployWithoutPollingAsync( - String resourceGroupName, String vmScaleSetName, String instanceId) { - return beginRedeployWithoutPollingWithResponseAsync(resourceGroupName, vmScaleSetName, instanceId) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Shuts down the virtual machine in the virtual machine scale set, moves it to a new node, and powers it back on. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginRedeployWithoutPollingAsync( - String resourceGroupName, String vmScaleSetName, String instanceId, Context context) { - return beginRedeployWithoutPollingWithResponseAsync(resourceGroupName, vmScaleSetName, instanceId, context) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Shuts down the virtual machine in the virtual machine scale set, moves it to a new node, and powers it back on. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void beginRedeployWithoutPolling(String resourceGroupName, String vmScaleSetName, String instanceId) { - beginRedeployWithoutPollingAsync(resourceGroupName, vmScaleSetName, instanceId).block(); - } - - /** - * Shuts down the virtual machine in the virtual machine scale set, moves it to a new node, and powers it back on. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void beginRedeployWithoutPolling( - String resourceGroupName, String vmScaleSetName, String instanceId, Context context) { - beginRedeployWithoutPollingAsync(resourceGroupName, vmScaleSetName, instanceId, context).block(); - } - - /** - * Performs maintenance on a virtual machine in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginPerformMaintenanceWithoutPollingWithResponseAsync( - String resourceGroupName, String vmScaleSetName, String instanceId) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); - } - if (instanceId == null) { - return Mono.error(new IllegalArgumentException("Parameter instanceId is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2019-12-01"; - return FluxUtil - .withContext( - context -> - service - .beginPerformMaintenanceWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - instanceId, - apiVersion, - this.client.getSubscriptionId(), - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Performs maintenance on a virtual machine in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginPerformMaintenanceWithoutPollingWithResponseAsync( - String resourceGroupName, String vmScaleSetName, String instanceId, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); - } - if (instanceId == null) { - return Mono.error(new IllegalArgumentException("Parameter instanceId is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2019-12-01"; - return service - .beginPerformMaintenanceWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - instanceId, - apiVersion, - this.client.getSubscriptionId(), - context); - } - - /** - * Performs maintenance on a virtual machine in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginPerformMaintenanceWithoutPollingAsync( - String resourceGroupName, String vmScaleSetName, String instanceId) { - return beginPerformMaintenanceWithoutPollingWithResponseAsync(resourceGroupName, vmScaleSetName, instanceId) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Performs maintenance on a virtual machine in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginPerformMaintenanceWithoutPollingAsync( - String resourceGroupName, String vmScaleSetName, String instanceId, Context context) { - return beginPerformMaintenanceWithoutPollingWithResponseAsync( - resourceGroupName, vmScaleSetName, instanceId, context) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Performs maintenance on a virtual machine in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void beginPerformMaintenanceWithoutPolling( - String resourceGroupName, String vmScaleSetName, String instanceId) { - beginPerformMaintenanceWithoutPollingAsync(resourceGroupName, vmScaleSetName, instanceId).block(); - } - - /** - * Performs maintenance on a virtual machine in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void beginPerformMaintenanceWithoutPolling( - String resourceGroupName, String vmScaleSetName, String instanceId, Context context) { - beginPerformMaintenanceWithoutPollingAsync(resourceGroupName, vmScaleSetName, instanceId, context).block(); - } - - /** - * Run command on a virtual machine in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param parameters Capture Virtual Machine parameters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginRunCommandWithoutPollingWithResponseAsync( - String resourceGroupName, String vmScaleSetName, String instanceId, RunCommandInput parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); - } - if (instanceId == null) { - return Mono.error(new IllegalArgumentException("Parameter instanceId is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2019-12-01"; - return FluxUtil - .withContext( - context -> - service - .beginRunCommandWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - instanceId, - apiVersion, - this.client.getSubscriptionId(), - parameters, - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Run command on a virtual machine in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param parameters Capture Virtual Machine parameters. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginRunCommandWithoutPollingWithResponseAsync( - String resourceGroupName, - String vmScaleSetName, - String instanceId, - RunCommandInput parameters, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); - } - if (instanceId == null) { - return Mono.error(new IllegalArgumentException("Parameter instanceId is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2019-12-01"; - return service - .beginRunCommandWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - instanceId, - apiVersion, - this.client.getSubscriptionId(), - parameters, - context); - } - - /** - * Run command on a virtual machine in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param parameters Capture Virtual Machine parameters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginRunCommandWithoutPollingAsync( - String resourceGroupName, String vmScaleSetName, String instanceId, RunCommandInput parameters) { - return beginRunCommandWithoutPollingWithResponseAsync(resourceGroupName, vmScaleSetName, instanceId, parameters) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Run command on a virtual machine in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param parameters Capture Virtual Machine parameters. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginRunCommandWithoutPollingAsync( - String resourceGroupName, - String vmScaleSetName, - String instanceId, - RunCommandInput parameters, - Context context) { - return beginRunCommandWithoutPollingWithResponseAsync( - resourceGroupName, vmScaleSetName, instanceId, parameters, context) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Run command on a virtual machine in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param parameters Capture Virtual Machine parameters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public RunCommandResultInner beginRunCommandWithoutPolling( - String resourceGroupName, String vmScaleSetName, String instanceId, RunCommandInput parameters) { - return beginRunCommandWithoutPollingAsync(resourceGroupName, vmScaleSetName, instanceId, parameters).block(); - } - - /** - * Run command on a virtual machine in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param parameters Capture Virtual Machine parameters. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public RunCommandResultInner beginRunCommandWithoutPolling( - String resourceGroupName, - String vmScaleSetName, - String instanceId, - RunCommandInput parameters, - Context context) { - return beginRunCommandWithoutPollingAsync(resourceGroupName, vmScaleSetName, instanceId, parameters, context) - .block(); - } - /** * Get the next page of items. * @@ -6409,6 +4178,7 @@ public Mono> listNextSinglePageAsyn if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listNext(nextLink, context) .map( diff --git a/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/VirtualMachineScaleSetsClient.java b/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/VirtualMachineScaleSetsClient.java index b07582bf262ac..bf1687c26e290 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/VirtualMachineScaleSetsClient.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/VirtualMachineScaleSetsClient.java @@ -43,7 +43,6 @@ import com.azure.resourcemanager.compute.fluent.inner.VirtualMachineScaleSetListSkusResultInner; import com.azure.resourcemanager.compute.fluent.inner.VirtualMachineScaleSetListWithLinkResultInner; import com.azure.resourcemanager.compute.fluent.inner.VirtualMachineScaleSetSkuInner; -import com.azure.resourcemanager.compute.models.OrchestrationServiceStateAction; import com.azure.resourcemanager.compute.models.OrchestrationServiceStateInput; import com.azure.resourcemanager.compute.models.VMScaleSetConvertToSinglePlacementGroupInput; import com.azure.resourcemanager.compute.models.VirtualMachineScaleSetReimageParameters; @@ -409,216 +408,6 @@ Mono>> setOrchestrationServiceState( @BodyParam("application/json") OrchestrationServiceStateInput parameters, Context context); - @Headers({"Accept: application/json", "Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" - + "/virtualMachineScaleSets/{vmScaleSetName}") - @ExpectedResponses({200, 201}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> beginCreateOrUpdateWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("vmScaleSetName") String vmScaleSetName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") VirtualMachineScaleSetInner parameters, - Context context); - - @Headers({"Accept: application/json", "Content-Type: application/json"}) - @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" - + "/virtualMachineScaleSets/{vmScaleSetName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> beginUpdateWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("vmScaleSetName") String vmScaleSetName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") VirtualMachineScaleSetUpdate parameters, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" - + "/virtualMachineScaleSets/{vmScaleSetName}") - @ExpectedResponses({200, 202, 204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> beginDeleteWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("vmScaleSetName") String vmScaleSetName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" - + "/virtualMachineScaleSets/{vmScaleSetName}/deallocate") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> beginDeallocateWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("vmScaleSetName") String vmScaleSetName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" - + "/virtualMachineScaleSets/{vmScaleSetName}/delete") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> beginDeleteInstancesWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("vmScaleSetName") String vmScaleSetName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") VirtualMachineScaleSetVMInstanceRequiredIDs vmInstanceIDs, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" - + "/virtualMachineScaleSets/{vmScaleSetName}/poweroff") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> beginPowerOffWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("vmScaleSetName") String vmScaleSetName, - @QueryParam("skipShutdown") Boolean skipShutdown, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" - + "/virtualMachineScaleSets/{vmScaleSetName}/restart") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> beginRestartWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("vmScaleSetName") String vmScaleSetName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" - + "/virtualMachineScaleSets/{vmScaleSetName}/start") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> beginStartWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("vmScaleSetName") String vmScaleSetName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" - + "/virtualMachineScaleSets/{vmScaleSetName}/redeploy") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> beginRedeployWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("vmScaleSetName") String vmScaleSetName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" - + "/virtualMachineScaleSets/{vmScaleSetName}/performMaintenance") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> beginPerformMaintenanceWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("vmScaleSetName") String vmScaleSetName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" - + "/virtualMachineScaleSets/{vmScaleSetName}/manualupgrade") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> beginUpdateInstancesWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("vmScaleSetName") String vmScaleSetName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") VirtualMachineScaleSetVMInstanceRequiredIDs vmInstanceIDs, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" - + "/virtualMachineScaleSets/{vmScaleSetName}/reimage") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> beginReimageWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("vmScaleSetName") String vmScaleSetName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") VirtualMachineScaleSetReimageParameters vmScaleSetReimageInput, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" - + "/virtualMachineScaleSets/{vmScaleSetName}/reimageall") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> beginReimageAllWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("vmScaleSetName") String vmScaleSetName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" - + "/virtualMachineScaleSets/{vmScaleSetName}/setOrchestrationServiceState") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> beginSetOrchestrationServiceStateWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("vmScaleSetName") String vmScaleSetName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") OrchestrationServiceStateInput parameters, - Context context); - @Headers({"Accept: application/json", "Content-Type: application/json"}) @Get("{nextLink}") @ExpectedResponses({200}) @@ -742,6 +531,7 @@ public Mono>> createOrUpdateWithResponseAsync( parameters.validate(); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .createOrUpdate( this.client.getEndpoint(), @@ -855,7 +645,7 @@ public Mono createOrUpdateAsync( String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetInner parameters) { return beginCreateOrUpdateAsync(resourceGroupName, vmScaleSetName, parameters) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -875,7 +665,7 @@ public Mono createOrUpdateAsync( String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetInner parameters, Context context) { return beginCreateOrUpdateAsync(resourceGroupName, vmScaleSetName, parameters, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -1007,6 +797,7 @@ public Mono>> updateWithResponseAsync( parameters.validate(); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .update( this.client.getEndpoint(), @@ -1119,7 +910,7 @@ public Mono updateAsync( String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetUpdate parameters) { return beginUpdateAsync(resourceGroupName, vmScaleSetName, parameters) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -1139,7 +930,7 @@ public Mono updateAsync( String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetUpdate parameters, Context context) { return beginUpdateAsync(resourceGroupName, vmScaleSetName, parameters, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -1257,6 +1048,7 @@ public Mono>> deleteWithResponseAsync( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .delete( this.client.getEndpoint(), @@ -1345,7 +1137,9 @@ public SyncPoller, Void> beginDelete( */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono deleteAsync(String resourceGroupName, String vmScaleSetName) { - return beginDeleteAsync(resourceGroupName, vmScaleSetName).last().flatMap(client::getLroFinalResultOrError); + return beginDeleteAsync(resourceGroupName, vmScaleSetName) + .last() + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -1363,7 +1157,7 @@ public Mono deleteAsync(String resourceGroupName, String vmScaleSetName) { public Mono deleteAsync(String resourceGroupName, String vmScaleSetName, Context context) { return beginDeleteAsync(resourceGroupName, vmScaleSetName, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -1476,6 +1270,7 @@ public Mono> getByResourceGroupWithRespons "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .getByResourceGroup( this.client.getEndpoint(), @@ -1666,6 +1461,7 @@ public Mono>> deallocateWithResponseAsync( vmInstanceIDsInternal.withInstanceIds(instanceIds); } VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs = vmInstanceIDsInternal; + context = this.client.mergeContext(context); return service .deallocate( this.client.getEndpoint(), @@ -1776,7 +1572,7 @@ public SyncPoller, Void> beginDeallocate( public Mono deallocateAsync(String resourceGroupName, String vmScaleSetName, List instanceIds) { return beginDeallocateAsync(resourceGroupName, vmScaleSetName, instanceIds) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -1798,7 +1594,7 @@ public Mono deallocateAsync( String resourceGroupName, String vmScaleSetName, List instanceIds, Context context) { return beginDeallocateAsync(resourceGroupName, vmScaleSetName, instanceIds, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -1930,6 +1726,7 @@ public Mono>> deleteInstancesWithResponseAsync( final String apiVersion = "2019-12-01"; VirtualMachineScaleSetVMInstanceRequiredIDs vmInstanceIDs = new VirtualMachineScaleSetVMInstanceRequiredIDs(); vmInstanceIDs.withInstanceIds(instanceIds); + context = this.client.mergeContext(context); return service .deleteInstances( this.client.getEndpoint(), @@ -2030,7 +1827,7 @@ public SyncPoller, Void> beginDeleteInstances( public Mono deleteInstancesAsync(String resourceGroupName, String vmScaleSetName, List instanceIds) { return beginDeleteInstancesAsync(resourceGroupName, vmScaleSetName, instanceIds) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -2050,7 +1847,7 @@ public Mono deleteInstancesAsync( String resourceGroupName, String vmScaleSetName, List instanceIds, Context context) { return beginDeleteInstancesAsync(resourceGroupName, vmScaleSetName, instanceIds, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -2166,6 +1963,7 @@ public Mono> getInstanceViewWi "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .getInstanceView( this.client.getEndpoint(), @@ -2338,6 +2136,7 @@ public Mono> listByResourceGroupSingl "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .listByResourceGroup( this.client.getEndpoint(), resourceGroupName, apiVersion, this.client.getSubscriptionId(), context) @@ -2479,6 +2278,7 @@ public Mono> listSinglePageAsync(Cont "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), context) .map( @@ -2646,6 +2446,7 @@ public Mono> listSkusSinglePageAsy "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .listSkus( this.client.getEndpoint(), @@ -2831,6 +2632,7 @@ public Mono> getOSUpgra "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .getOSUpgradeHistory( this.client.getEndpoint(), @@ -3031,6 +2833,7 @@ public Mono>> powerOffWithResponseAsync( vmInstanceIDsInternal.withInstanceIds(instanceIds); } VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs = vmInstanceIDsInternal; + context = this.client.mergeContext(context); return service .powerOff( this.client.getEndpoint(), @@ -3167,7 +2970,7 @@ public Mono powerOffAsync( String resourceGroupName, String vmScaleSetName, Boolean skipShutdown, List instanceIds) { return beginPowerOffAsync(resourceGroupName, vmScaleSetName, skipShutdown, instanceIds) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -3196,7 +2999,7 @@ public Mono powerOffAsync( Context context) { return beginPowerOffAsync(resourceGroupName, vmScaleSetName, skipShutdown, instanceIds, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -3344,6 +3147,7 @@ public Mono>> restartWithResponseAsync( vmInstanceIDsInternal.withInstanceIds(instanceIds); } VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs = vmInstanceIDsInternal; + context = this.client.mergeContext(context); return service .restart( this.client.getEndpoint(), @@ -3449,7 +3253,7 @@ public SyncPoller, Void> beginRestart( public Mono restartAsync(String resourceGroupName, String vmScaleSetName, List instanceIds) { return beginRestartAsync(resourceGroupName, vmScaleSetName, instanceIds) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -3470,7 +3274,7 @@ public Mono restartAsync( String resourceGroupName, String vmScaleSetName, List instanceIds, Context context) { return beginRestartAsync(resourceGroupName, vmScaleSetName, instanceIds, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -3604,6 +3408,7 @@ public Mono>> startWithResponseAsync( vmInstanceIDsInternal.withInstanceIds(instanceIds); } VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs = vmInstanceIDsInternal; + context = this.client.mergeContext(context); return service .start( this.client.getEndpoint(), @@ -3708,7 +3513,7 @@ public SyncPoller, Void> beginStart( public Mono startAsync(String resourceGroupName, String vmScaleSetName, List instanceIds) { return beginStartAsync(resourceGroupName, vmScaleSetName, instanceIds) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -3729,7 +3534,7 @@ public Mono startAsync( String resourceGroupName, String vmScaleSetName, List instanceIds, Context context) { return beginStartAsync(resourceGroupName, vmScaleSetName, instanceIds, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -3865,6 +3670,7 @@ public Mono>> redeployWithResponseAsync( vmInstanceIDsInternal.withInstanceIds(instanceIds); } VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs = vmInstanceIDsInternal; + context = this.client.mergeContext(context); return service .redeploy( this.client.getEndpoint(), @@ -3975,7 +3781,7 @@ public SyncPoller, Void> beginRedeploy( public Mono redeployAsync(String resourceGroupName, String vmScaleSetName, List instanceIds) { return beginRedeployAsync(resourceGroupName, vmScaleSetName, instanceIds) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -3997,7 +3803,7 @@ public Mono redeployAsync( String resourceGroupName, String vmScaleSetName, List instanceIds, Context context) { return beginRedeployAsync(resourceGroupName, vmScaleSetName, instanceIds, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -4137,6 +3943,7 @@ public Mono>> performMaintenanceWithResponseAsync( vmInstanceIDsInternal.withInstanceIds(instanceIds); } VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs = vmInstanceIDsInternal; + context = this.client.mergeContext(context); return service .performMaintenance( this.client.getEndpoint(), @@ -4253,7 +4060,7 @@ public Mono performMaintenanceAsync( String resourceGroupName, String vmScaleSetName, List instanceIds) { return beginPerformMaintenanceAsync(resourceGroupName, vmScaleSetName, instanceIds) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -4276,7 +4083,7 @@ public Mono performMaintenanceAsync( String resourceGroupName, String vmScaleSetName, List instanceIds, Context context) { return beginPerformMaintenanceAsync(resourceGroupName, vmScaleSetName, instanceIds, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -4411,6 +4218,7 @@ public Mono>> updateInstancesWithResponseAsync( final String apiVersion = "2019-12-01"; VirtualMachineScaleSetVMInstanceRequiredIDs vmInstanceIDs = new VirtualMachineScaleSetVMInstanceRequiredIDs(); vmInstanceIDs.withInstanceIds(instanceIds); + context = this.client.mergeContext(context); return service .updateInstances( this.client.getEndpoint(), @@ -4511,7 +4319,7 @@ public SyncPoller, Void> beginUpdateInstances( public Mono updateInstancesAsync(String resourceGroupName, String vmScaleSetName, List instanceIds) { return beginUpdateInstancesAsync(resourceGroupName, vmScaleSetName, instanceIds) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -4531,7 +4339,7 @@ public Mono updateInstancesAsync( String resourceGroupName, String vmScaleSetName, List instanceIds, Context context) { return beginUpdateInstancesAsync(resourceGroupName, vmScaleSetName, instanceIds, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -4665,6 +4473,7 @@ public Mono>> reimageWithResponseAsync( vmScaleSetReimageInput.validate(); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .reimage( this.client.getEndpoint(), @@ -4788,7 +4597,7 @@ public Mono reimageAsync( VirtualMachineScaleSetReimageParameters vmScaleSetReimageInput) { return beginReimageAsync(resourceGroupName, vmScaleSetName, vmScaleSetReimageInput) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -4813,7 +4622,7 @@ public Mono reimageAsync( Context context) { return beginReimageAsync(resourceGroupName, vmScaleSetName, vmScaleSetReimageInput, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -4834,7 +4643,7 @@ public Mono reimageAsync(String resourceGroupName, String vmScaleSetName) final Context context = null; return beginReimageAsync(resourceGroupName, vmScaleSetName, vmScaleSetReimageInput) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -4997,6 +4806,7 @@ public Mono>> reimageAllWithResponseAsync( vmInstanceIDsInternal.withInstanceIds(instanceIds); } VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs = vmInstanceIDsInternal; + context = this.client.mergeContext(context); return service .reimageAll( this.client.getEndpoint(), @@ -5107,7 +4917,7 @@ public SyncPoller, Void> beginReimageAll( public Mono reimageAllAsync(String resourceGroupName, String vmScaleSetName, List instanceIds) { return beginReimageAllAsync(resourceGroupName, vmScaleSetName, instanceIds) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -5129,7 +4939,7 @@ public Mono reimageAllAsync( String resourceGroupName, String vmScaleSetName, List instanceIds, Context context) { return beginReimageAllAsync(resourceGroupName, vmScaleSetName, instanceIds, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -5253,6 +5063,7 @@ public void reimageAll(String resourceGroupName, String vmScaleSetName, List> convertToSinglePlacementGroupWithResponseAsync( final String apiVersion = "2019-12-01"; VMScaleSetConvertToSinglePlacementGroupInput parameters = new VMScaleSetConvertToSinglePlacementGroupInput(); parameters.withActivePlacementGroupId(activePlacementGroupId); + context = this.client.mergeContext(context); return service .convertToSinglePlacementGroup( this.client.getEndpoint(), @@ -5543,7 +5355,7 @@ public void convertToSinglePlacementGroup( * * @param resourceGroupName The name of the resource group. * @param vmScaleSetName The name of the virtual machine scale set to create or update. - * @param action The action to be performed. + * @param parameters The input for OrchestrationServiceState. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -5551,7 +5363,7 @@ public void convertToSinglePlacementGroup( */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono>> setOrchestrationServiceStateWithResponseAsync( - String resourceGroupName, String vmScaleSetName, OrchestrationServiceStateAction action) { + String resourceGroupName, String vmScaleSetName, OrchestrationServiceStateInput parameters) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -5571,12 +5383,12 @@ public Mono>> setOrchestrationServiceStateWithResponse new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - if (action == null) { - return Mono.error(new IllegalArgumentException("Parameter action is required and cannot be null.")); + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); } final String apiVersion = "2019-12-01"; - OrchestrationServiceStateInput parameters = new OrchestrationServiceStateInput(); - parameters.withAction(action); return FluxUtil .withContext( context -> @@ -5597,7 +5409,7 @@ public Mono>> setOrchestrationServiceStateWithResponse * * @param resourceGroupName The name of the resource group. * @param vmScaleSetName The name of the virtual machine scale set to create or update. - * @param action The action to be performed. + * @param parameters The input for OrchestrationServiceState. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -5606,7 +5418,7 @@ public Mono>> setOrchestrationServiceStateWithResponse */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono>> setOrchestrationServiceStateWithResponseAsync( - String resourceGroupName, String vmScaleSetName, OrchestrationServiceStateAction action, Context context) { + String resourceGroupName, String vmScaleSetName, OrchestrationServiceStateInput parameters, Context context) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -5626,12 +5438,13 @@ public Mono>> setOrchestrationServiceStateWithResponse new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - if (action == null) { - return Mono.error(new IllegalArgumentException("Parameter action is required and cannot be null.")); + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); } final String apiVersion = "2019-12-01"; - OrchestrationServiceStateInput parameters = new OrchestrationServiceStateInput(); - parameters.withAction(action); + context = this.client.mergeContext(context); return service .setOrchestrationServiceState( this.client.getEndpoint(), @@ -5648,7 +5461,7 @@ public Mono>> setOrchestrationServiceStateWithResponse * * @param resourceGroupName The name of the resource group. * @param vmScaleSetName The name of the virtual machine scale set to create or update. - * @param action The action to be performed. + * @param parameters The input for OrchestrationServiceState. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -5656,9 +5469,9 @@ public Mono>> setOrchestrationServiceStateWithResponse */ @ServiceMethod(returns = ReturnType.SINGLE) public PollerFlux, Void> beginSetOrchestrationServiceStateAsync( - String resourceGroupName, String vmScaleSetName, OrchestrationServiceStateAction action) { + String resourceGroupName, String vmScaleSetName, OrchestrationServiceStateInput parameters) { Mono>> mono = - setOrchestrationServiceStateWithResponseAsync(resourceGroupName, vmScaleSetName, action); + setOrchestrationServiceStateWithResponseAsync(resourceGroupName, vmScaleSetName, parameters); return this.client.getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class); } @@ -5667,7 +5480,7 @@ public PollerFlux, Void> beginSetOrchestrationServiceStateAsync * * @param resourceGroupName The name of the resource group. * @param vmScaleSetName The name of the virtual machine scale set to create or update. - * @param action The action to be performed. + * @param parameters The input for OrchestrationServiceState. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -5676,9 +5489,9 @@ public PollerFlux, Void> beginSetOrchestrationServiceStateAsync */ @ServiceMethod(returns = ReturnType.SINGLE) public PollerFlux, Void> beginSetOrchestrationServiceStateAsync( - String resourceGroupName, String vmScaleSetName, OrchestrationServiceStateAction action, Context context) { + String resourceGroupName, String vmScaleSetName, OrchestrationServiceStateInput parameters, Context context) { Mono>> mono = - setOrchestrationServiceStateWithResponseAsync(resourceGroupName, vmScaleSetName, action, context); + setOrchestrationServiceStateWithResponseAsync(resourceGroupName, vmScaleSetName, parameters, context); return this.client.getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class); } @@ -5687,7 +5500,7 @@ public PollerFlux, Void> beginSetOrchestrationServiceStateAsync * * @param resourceGroupName The name of the resource group. * @param vmScaleSetName The name of the virtual machine scale set to create or update. - * @param action The action to be performed. + * @param parameters The input for OrchestrationServiceState. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -5695,8 +5508,8 @@ public PollerFlux, Void> beginSetOrchestrationServiceStateAsync */ @ServiceMethod(returns = ReturnType.SINGLE) public SyncPoller, Void> beginSetOrchestrationServiceState( - String resourceGroupName, String vmScaleSetName, OrchestrationServiceStateAction action) { - return beginSetOrchestrationServiceStateAsync(resourceGroupName, vmScaleSetName, action).getSyncPoller(); + String resourceGroupName, String vmScaleSetName, OrchestrationServiceStateInput parameters) { + return beginSetOrchestrationServiceStateAsync(resourceGroupName, vmScaleSetName, parameters).getSyncPoller(); } /** @@ -5704,7 +5517,7 @@ public SyncPoller, Void> beginSetOrchestrationServiceState( * * @param resourceGroupName The name of the resource group. * @param vmScaleSetName The name of the virtual machine scale set to create or update. - * @param action The action to be performed. + * @param parameters The input for OrchestrationServiceState. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -5713,8 +5526,8 @@ public SyncPoller, Void> beginSetOrchestrationServiceState( */ @ServiceMethod(returns = ReturnType.SINGLE) public SyncPoller, Void> beginSetOrchestrationServiceState( - String resourceGroupName, String vmScaleSetName, OrchestrationServiceStateAction action, Context context) { - return beginSetOrchestrationServiceStateAsync(resourceGroupName, vmScaleSetName, action, context) + String resourceGroupName, String vmScaleSetName, OrchestrationServiceStateInput parameters, Context context) { + return beginSetOrchestrationServiceStateAsync(resourceGroupName, vmScaleSetName, parameters, context) .getSyncPoller(); } @@ -5723,7 +5536,7 @@ public SyncPoller, Void> beginSetOrchestrationServiceState( * * @param resourceGroupName The name of the resource group. * @param vmScaleSetName The name of the virtual machine scale set to create or update. - * @param action The action to be performed. + * @param parameters The input for OrchestrationServiceState. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -5731,10 +5544,10 @@ public SyncPoller, Void> beginSetOrchestrationServiceState( */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono setOrchestrationServiceStateAsync( - String resourceGroupName, String vmScaleSetName, OrchestrationServiceStateAction action) { - return beginSetOrchestrationServiceStateAsync(resourceGroupName, vmScaleSetName, action) + String resourceGroupName, String vmScaleSetName, OrchestrationServiceStateInput parameters) { + return beginSetOrchestrationServiceStateAsync(resourceGroupName, vmScaleSetName, parameters) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -5742,7 +5555,7 @@ public Mono setOrchestrationServiceStateAsync( * * @param resourceGroupName The name of the resource group. * @param vmScaleSetName The name of the virtual machine scale set to create or update. - * @param action The action to be performed. + * @param parameters The input for OrchestrationServiceState. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -5751,10 +5564,10 @@ public Mono setOrchestrationServiceStateAsync( */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono setOrchestrationServiceStateAsync( - String resourceGroupName, String vmScaleSetName, OrchestrationServiceStateAction action, Context context) { - return beginSetOrchestrationServiceStateAsync(resourceGroupName, vmScaleSetName, action, context) + String resourceGroupName, String vmScaleSetName, OrchestrationServiceStateInput parameters, Context context) { + return beginSetOrchestrationServiceStateAsync(resourceGroupName, vmScaleSetName, parameters, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -5762,15 +5575,15 @@ public Mono setOrchestrationServiceStateAsync( * * @param resourceGroupName The name of the resource group. * @param vmScaleSetName The name of the virtual machine scale set to create or update. - * @param action The action to be performed. + * @param parameters The input for OrchestrationServiceState. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ @ServiceMethod(returns = ReturnType.SINGLE) public void setOrchestrationServiceState( - String resourceGroupName, String vmScaleSetName, OrchestrationServiceStateAction action) { - setOrchestrationServiceStateAsync(resourceGroupName, vmScaleSetName, action).block(); + String resourceGroupName, String vmScaleSetName, OrchestrationServiceStateInput parameters) { + setOrchestrationServiceStateAsync(resourceGroupName, vmScaleSetName, parameters).block(); } /** @@ -5778,7 +5591,7 @@ public void setOrchestrationServiceState( * * @param resourceGroupName The name of the resource group. * @param vmScaleSetName The name of the virtual machine scale set to create or update. - * @param action The action to be performed. + * @param parameters The input for OrchestrationServiceState. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -5786,2660 +5599,8 @@ public void setOrchestrationServiceState( */ @ServiceMethod(returns = ReturnType.SINGLE) public void setOrchestrationServiceState( - String resourceGroupName, String vmScaleSetName, OrchestrationServiceStateAction action, Context context) { - setOrchestrationServiceStateAsync(resourceGroupName, vmScaleSetName, action, context).block(); - } - - /** - * Create or update a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set to create or update. - * @param parameters Describes a Virtual Machine Scale Set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine Scale Set. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginCreateOrUpdateWithoutPollingWithResponseAsync( - String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetInner parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2019-12-01"; - return FluxUtil - .withContext( - context -> - service - .beginCreateOrUpdateWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Create or update a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set to create or update. - * @param parameters Describes a Virtual Machine Scale Set. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine Scale Set. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginCreateOrUpdateWithoutPollingWithResponseAsync( - String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetInner parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2019-12-01"; - return service - .beginCreateOrUpdateWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - context); - } - - /** - * Create or update a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set to create or update. - * @param parameters Describes a Virtual Machine Scale Set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine Scale Set. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginCreateOrUpdateWithoutPollingAsync( - String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetInner parameters) { - return beginCreateOrUpdateWithoutPollingWithResponseAsync(resourceGroupName, vmScaleSetName, parameters) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Create or update a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set to create or update. - * @param parameters Describes a Virtual Machine Scale Set. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine Scale Set. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginCreateOrUpdateWithoutPollingAsync( - String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetInner parameters, Context context) { - return beginCreateOrUpdateWithoutPollingWithResponseAsync( - resourceGroupName, vmScaleSetName, parameters, context) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Create or update a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set to create or update. - * @param parameters Describes a Virtual Machine Scale Set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine Scale Set. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public VirtualMachineScaleSetInner beginCreateOrUpdateWithoutPolling( - String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetInner parameters) { - return beginCreateOrUpdateWithoutPollingAsync(resourceGroupName, vmScaleSetName, parameters).block(); - } - - /** - * Create or update a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set to create or update. - * @param parameters Describes a Virtual Machine Scale Set. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine Scale Set. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public VirtualMachineScaleSetInner beginCreateOrUpdateWithoutPolling( - String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetInner parameters, Context context) { - return beginCreateOrUpdateWithoutPollingAsync(resourceGroupName, vmScaleSetName, parameters, context).block(); - } - - /** - * Update a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set to create or update. - * @param parameters Describes a Virtual Machine Scale Set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine Scale Set. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginUpdateWithoutPollingWithResponseAsync( - String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetUpdate parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2019-12-01"; - return FluxUtil - .withContext( - context -> - service - .beginUpdateWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Update a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set to create or update. - * @param parameters Describes a Virtual Machine Scale Set. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine Scale Set. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginUpdateWithoutPollingWithResponseAsync( - String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetUpdate parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2019-12-01"; - return service - .beginUpdateWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - context); - } - - /** - * Update a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set to create or update. - * @param parameters Describes a Virtual Machine Scale Set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine Scale Set. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginUpdateWithoutPollingAsync( - String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetUpdate parameters) { - return beginUpdateWithoutPollingWithResponseAsync(resourceGroupName, vmScaleSetName, parameters) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Update a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set to create or update. - * @param parameters Describes a Virtual Machine Scale Set. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine Scale Set. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginUpdateWithoutPollingAsync( - String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetUpdate parameters, Context context) { - return beginUpdateWithoutPollingWithResponseAsync(resourceGroupName, vmScaleSetName, parameters, context) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Update a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set to create or update. - * @param parameters Describes a Virtual Machine Scale Set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine Scale Set. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public VirtualMachineScaleSetInner beginUpdateWithoutPolling( - String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetUpdate parameters) { - return beginUpdateWithoutPollingAsync(resourceGroupName, vmScaleSetName, parameters).block(); - } - - /** - * Update a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set to create or update. - * @param parameters Describes a Virtual Machine Scale Set. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine Scale Set. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public VirtualMachineScaleSetInner beginUpdateWithoutPolling( - String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetUpdate parameters, Context context) { - return beginUpdateWithoutPollingAsync(resourceGroupName, vmScaleSetName, parameters, context).block(); - } - - /** - * Deletes a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginDeleteWithoutPollingWithResponseAsync( - String resourceGroupName, String vmScaleSetName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2019-12-01"; - return FluxUtil - .withContext( - context -> - service - .beginDeleteWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - apiVersion, - this.client.getSubscriptionId(), - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Deletes a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginDeleteWithoutPollingWithResponseAsync( - String resourceGroupName, String vmScaleSetName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2019-12-01"; - return service - .beginDeleteWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - apiVersion, - this.client.getSubscriptionId(), - context); - } - - /** - * Deletes a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginDeleteWithoutPollingAsync(String resourceGroupName, String vmScaleSetName) { - return beginDeleteWithoutPollingWithResponseAsync(resourceGroupName, vmScaleSetName) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Deletes a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginDeleteWithoutPollingAsync(String resourceGroupName, String vmScaleSetName, Context context) { - return beginDeleteWithoutPollingWithResponseAsync(resourceGroupName, vmScaleSetName, context) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Deletes a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void beginDeleteWithoutPolling(String resourceGroupName, String vmScaleSetName) { - beginDeleteWithoutPollingAsync(resourceGroupName, vmScaleSetName).block(); - } - - /** - * Deletes a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void beginDeleteWithoutPolling(String resourceGroupName, String vmScaleSetName, Context context) { - beginDeleteWithoutPollingAsync(resourceGroupName, vmScaleSetName, context).block(); - } - - /** - * Deallocates specific virtual machines in a VM scale set. Shuts down the virtual machines and releases the compute - * resources. You are not billed for the compute resources that this virtual machine scale set deallocates. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceIds The virtual machine scale set instance ids. Omitting the virtual machine scale set instance - * ids will result in the operation being performed on all virtual machines in the virtual machine scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginDeallocateWithoutPollingWithResponseAsync( - String resourceGroupName, String vmScaleSetName, List instanceIds) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2019-12-01"; - VirtualMachineScaleSetVMInstanceIDs vmInstanceIDsInternal = null; - if (instanceIds != null) { - vmInstanceIDsInternal = new VirtualMachineScaleSetVMInstanceIDs(); - vmInstanceIDsInternal.withInstanceIds(instanceIds); - } - VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs = vmInstanceIDsInternal; - return FluxUtil - .withContext( - context -> - service - .beginDeallocateWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - apiVersion, - this.client.getSubscriptionId(), - vmInstanceIDs, - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Deallocates specific virtual machines in a VM scale set. Shuts down the virtual machines and releases the compute - * resources. You are not billed for the compute resources that this virtual machine scale set deallocates. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceIds The virtual machine scale set instance ids. Omitting the virtual machine scale set instance - * ids will result in the operation being performed on all virtual machines in the virtual machine scale set. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginDeallocateWithoutPollingWithResponseAsync( - String resourceGroupName, String vmScaleSetName, List instanceIds, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2019-12-01"; - VirtualMachineScaleSetVMInstanceIDs vmInstanceIDsInternal = null; - if (instanceIds != null) { - vmInstanceIDsInternal = new VirtualMachineScaleSetVMInstanceIDs(); - vmInstanceIDsInternal.withInstanceIds(instanceIds); - } - VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs = vmInstanceIDsInternal; - return service - .beginDeallocateWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - apiVersion, - this.client.getSubscriptionId(), - vmInstanceIDs, - context); - } - - /** - * Deallocates specific virtual machines in a VM scale set. Shuts down the virtual machines and releases the compute - * resources. You are not billed for the compute resources that this virtual machine scale set deallocates. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceIds The virtual machine scale set instance ids. Omitting the virtual machine scale set instance - * ids will result in the operation being performed on all virtual machines in the virtual machine scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginDeallocateWithoutPollingAsync( - String resourceGroupName, String vmScaleSetName, List instanceIds) { - return beginDeallocateWithoutPollingWithResponseAsync(resourceGroupName, vmScaleSetName, instanceIds) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Deallocates specific virtual machines in a VM scale set. Shuts down the virtual machines and releases the compute - * resources. You are not billed for the compute resources that this virtual machine scale set deallocates. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceIds The virtual machine scale set instance ids. Omitting the virtual machine scale set instance - * ids will result in the operation being performed on all virtual machines in the virtual machine scale set. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginDeallocateWithoutPollingAsync( - String resourceGroupName, String vmScaleSetName, List instanceIds, Context context) { - return beginDeallocateWithoutPollingWithResponseAsync(resourceGroupName, vmScaleSetName, instanceIds, context) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Deallocates specific virtual machines in a VM scale set. Shuts down the virtual machines and releases the compute - * resources. You are not billed for the compute resources that this virtual machine scale set deallocates. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceIds The virtual machine scale set instance ids. Omitting the virtual machine scale set instance - * ids will result in the operation being performed on all virtual machines in the virtual machine scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void beginDeallocateWithoutPolling( - String resourceGroupName, String vmScaleSetName, List instanceIds) { - beginDeallocateWithoutPollingAsync(resourceGroupName, vmScaleSetName, instanceIds).block(); - } - - /** - * Deallocates specific virtual machines in a VM scale set. Shuts down the virtual machines and releases the compute - * resources. You are not billed for the compute resources that this virtual machine scale set deallocates. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceIds The virtual machine scale set instance ids. Omitting the virtual machine scale set instance - * ids will result in the operation being performed on all virtual machines in the virtual machine scale set. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void beginDeallocateWithoutPolling( - String resourceGroupName, String vmScaleSetName, List instanceIds, Context context) { - beginDeallocateWithoutPollingAsync(resourceGroupName, vmScaleSetName, instanceIds, context).block(); - } - - /** - * Deletes virtual machines in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceIds The virtual machine scale set instance ids. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginDeleteInstancesWithoutPollingWithResponseAsync( - String resourceGroupName, String vmScaleSetName, List instanceIds) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (instanceIds == null) { - return Mono.error(new IllegalArgumentException("Parameter instanceIds is required and cannot be null.")); - } - final String apiVersion = "2019-12-01"; - VirtualMachineScaleSetVMInstanceRequiredIDs vmInstanceIDs = new VirtualMachineScaleSetVMInstanceRequiredIDs(); - vmInstanceIDs.withInstanceIds(instanceIds); - return FluxUtil - .withContext( - context -> - service - .beginDeleteInstancesWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - apiVersion, - this.client.getSubscriptionId(), - vmInstanceIDs, - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Deletes virtual machines in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceIds The virtual machine scale set instance ids. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginDeleteInstancesWithoutPollingWithResponseAsync( - String resourceGroupName, String vmScaleSetName, List instanceIds, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (instanceIds == null) { - return Mono.error(new IllegalArgumentException("Parameter instanceIds is required and cannot be null.")); - } - final String apiVersion = "2019-12-01"; - VirtualMachineScaleSetVMInstanceRequiredIDs vmInstanceIDs = new VirtualMachineScaleSetVMInstanceRequiredIDs(); - vmInstanceIDs.withInstanceIds(instanceIds); - return service - .beginDeleteInstancesWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - apiVersion, - this.client.getSubscriptionId(), - vmInstanceIDs, - context); - } - - /** - * Deletes virtual machines in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceIds The virtual machine scale set instance ids. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginDeleteInstancesWithoutPollingAsync( - String resourceGroupName, String vmScaleSetName, List instanceIds) { - return beginDeleteInstancesWithoutPollingWithResponseAsync(resourceGroupName, vmScaleSetName, instanceIds) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Deletes virtual machines in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceIds The virtual machine scale set instance ids. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginDeleteInstancesWithoutPollingAsync( - String resourceGroupName, String vmScaleSetName, List instanceIds, Context context) { - return beginDeleteInstancesWithoutPollingWithResponseAsync( - resourceGroupName, vmScaleSetName, instanceIds, context) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Deletes virtual machines in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceIds The virtual machine scale set instance ids. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void beginDeleteInstancesWithoutPolling( - String resourceGroupName, String vmScaleSetName, List instanceIds) { - beginDeleteInstancesWithoutPollingAsync(resourceGroupName, vmScaleSetName, instanceIds).block(); - } - - /** - * Deletes virtual machines in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceIds The virtual machine scale set instance ids. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void beginDeleteInstancesWithoutPolling( - String resourceGroupName, String vmScaleSetName, List instanceIds, Context context) { - beginDeleteInstancesWithoutPollingAsync(resourceGroupName, vmScaleSetName, instanceIds, context).block(); - } - - /** - * Power off (stop) one or more virtual machines in a VM scale set. Note that resources are still attached and you - * are getting charged for the resources. Instead, use deallocate to release resources and avoid charges. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param skipShutdown The parameter to request non-graceful VM shutdown. True value for this flag indicates - * non-graceful shutdown whereas false indicates otherwise. Default value for this flag is false if not - * specified. - * @param instanceIds The virtual machine scale set instance ids. Omitting the virtual machine scale set instance - * ids will result in the operation being performed on all virtual machines in the virtual machine scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginPowerOffWithoutPollingWithResponseAsync( - String resourceGroupName, String vmScaleSetName, Boolean skipShutdown, List instanceIds) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2019-12-01"; - VirtualMachineScaleSetVMInstanceIDs vmInstanceIDsInternal = null; - if (instanceIds != null) { - vmInstanceIDsInternal = new VirtualMachineScaleSetVMInstanceIDs(); - vmInstanceIDsInternal.withInstanceIds(instanceIds); - } - VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs = vmInstanceIDsInternal; - return FluxUtil - .withContext( - context -> - service - .beginPowerOffWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - skipShutdown, - apiVersion, - this.client.getSubscriptionId(), - vmInstanceIDs, - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Power off (stop) one or more virtual machines in a VM scale set. Note that resources are still attached and you - * are getting charged for the resources. Instead, use deallocate to release resources and avoid charges. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param skipShutdown The parameter to request non-graceful VM shutdown. True value for this flag indicates - * non-graceful shutdown whereas false indicates otherwise. Default value for this flag is false if not - * specified. - * @param instanceIds The virtual machine scale set instance ids. Omitting the virtual machine scale set instance - * ids will result in the operation being performed on all virtual machines in the virtual machine scale set. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginPowerOffWithoutPollingWithResponseAsync( - String resourceGroupName, - String vmScaleSetName, - Boolean skipShutdown, - List instanceIds, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2019-12-01"; - VirtualMachineScaleSetVMInstanceIDs vmInstanceIDsInternal = null; - if (instanceIds != null) { - vmInstanceIDsInternal = new VirtualMachineScaleSetVMInstanceIDs(); - vmInstanceIDsInternal.withInstanceIds(instanceIds); - } - VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs = vmInstanceIDsInternal; - return service - .beginPowerOffWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - skipShutdown, - apiVersion, - this.client.getSubscriptionId(), - vmInstanceIDs, - context); - } - - /** - * Power off (stop) one or more virtual machines in a VM scale set. Note that resources are still attached and you - * are getting charged for the resources. Instead, use deallocate to release resources and avoid charges. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param skipShutdown The parameter to request non-graceful VM shutdown. True value for this flag indicates - * non-graceful shutdown whereas false indicates otherwise. Default value for this flag is false if not - * specified. - * @param instanceIds The virtual machine scale set instance ids. Omitting the virtual machine scale set instance - * ids will result in the operation being performed on all virtual machines in the virtual machine scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginPowerOffWithoutPollingAsync( - String resourceGroupName, String vmScaleSetName, Boolean skipShutdown, List instanceIds) { - return beginPowerOffWithoutPollingWithResponseAsync( - resourceGroupName, vmScaleSetName, skipShutdown, instanceIds) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Power off (stop) one or more virtual machines in a VM scale set. Note that resources are still attached and you - * are getting charged for the resources. Instead, use deallocate to release resources and avoid charges. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param skipShutdown The parameter to request non-graceful VM shutdown. True value for this flag indicates - * non-graceful shutdown whereas false indicates otherwise. Default value for this flag is false if not - * specified. - * @param instanceIds The virtual machine scale set instance ids. Omitting the virtual machine scale set instance - * ids will result in the operation being performed on all virtual machines in the virtual machine scale set. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginPowerOffWithoutPollingAsync( - String resourceGroupName, - String vmScaleSetName, - Boolean skipShutdown, - List instanceIds, - Context context) { - return beginPowerOffWithoutPollingWithResponseAsync( - resourceGroupName, vmScaleSetName, skipShutdown, instanceIds, context) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Power off (stop) one or more virtual machines in a VM scale set. Note that resources are still attached and you - * are getting charged for the resources. Instead, use deallocate to release resources and avoid charges. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param skipShutdown The parameter to request non-graceful VM shutdown. True value for this flag indicates - * non-graceful shutdown whereas false indicates otherwise. Default value for this flag is false if not - * specified. - * @param instanceIds The virtual machine scale set instance ids. Omitting the virtual machine scale set instance - * ids will result in the operation being performed on all virtual machines in the virtual machine scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void beginPowerOffWithoutPolling( - String resourceGroupName, String vmScaleSetName, Boolean skipShutdown, List instanceIds) { - beginPowerOffWithoutPollingAsync(resourceGroupName, vmScaleSetName, skipShutdown, instanceIds).block(); - } - - /** - * Power off (stop) one or more virtual machines in a VM scale set. Note that resources are still attached and you - * are getting charged for the resources. Instead, use deallocate to release resources and avoid charges. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param skipShutdown The parameter to request non-graceful VM shutdown. True value for this flag indicates - * non-graceful shutdown whereas false indicates otherwise. Default value for this flag is false if not - * specified. - * @param instanceIds The virtual machine scale set instance ids. Omitting the virtual machine scale set instance - * ids will result in the operation being performed on all virtual machines in the virtual machine scale set. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void beginPowerOffWithoutPolling( - String resourceGroupName, - String vmScaleSetName, - Boolean skipShutdown, - List instanceIds, - Context context) { - beginPowerOffWithoutPollingAsync(resourceGroupName, vmScaleSetName, skipShutdown, instanceIds, context).block(); - } - - /** - * Restarts one or more virtual machines in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceIds The virtual machine scale set instance ids. Omitting the virtual machine scale set instance - * ids will result in the operation being performed on all virtual machines in the virtual machine scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginRestartWithoutPollingWithResponseAsync( - String resourceGroupName, String vmScaleSetName, List instanceIds) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2019-12-01"; - VirtualMachineScaleSetVMInstanceIDs vmInstanceIDsInternal = null; - if (instanceIds != null) { - vmInstanceIDsInternal = new VirtualMachineScaleSetVMInstanceIDs(); - vmInstanceIDsInternal.withInstanceIds(instanceIds); - } - VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs = vmInstanceIDsInternal; - return FluxUtil - .withContext( - context -> - service - .beginRestartWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - apiVersion, - this.client.getSubscriptionId(), - vmInstanceIDs, - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Restarts one or more virtual machines in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceIds The virtual machine scale set instance ids. Omitting the virtual machine scale set instance - * ids will result in the operation being performed on all virtual machines in the virtual machine scale set. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginRestartWithoutPollingWithResponseAsync( - String resourceGroupName, String vmScaleSetName, List instanceIds, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2019-12-01"; - VirtualMachineScaleSetVMInstanceIDs vmInstanceIDsInternal = null; - if (instanceIds != null) { - vmInstanceIDsInternal = new VirtualMachineScaleSetVMInstanceIDs(); - vmInstanceIDsInternal.withInstanceIds(instanceIds); - } - VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs = vmInstanceIDsInternal; - return service - .beginRestartWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - apiVersion, - this.client.getSubscriptionId(), - vmInstanceIDs, - context); - } - - /** - * Restarts one or more virtual machines in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceIds The virtual machine scale set instance ids. Omitting the virtual machine scale set instance - * ids will result in the operation being performed on all virtual machines in the virtual machine scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginRestartWithoutPollingAsync( - String resourceGroupName, String vmScaleSetName, List instanceIds) { - return beginRestartWithoutPollingWithResponseAsync(resourceGroupName, vmScaleSetName, instanceIds) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Restarts one or more virtual machines in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceIds The virtual machine scale set instance ids. Omitting the virtual machine scale set instance - * ids will result in the operation being performed on all virtual machines in the virtual machine scale set. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginRestartWithoutPollingAsync( - String resourceGroupName, String vmScaleSetName, List instanceIds, Context context) { - return beginRestartWithoutPollingWithResponseAsync(resourceGroupName, vmScaleSetName, instanceIds, context) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Restarts one or more virtual machines in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceIds The virtual machine scale set instance ids. Omitting the virtual machine scale set instance - * ids will result in the operation being performed on all virtual machines in the virtual machine scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void beginRestartWithoutPolling(String resourceGroupName, String vmScaleSetName, List instanceIds) { - beginRestartWithoutPollingAsync(resourceGroupName, vmScaleSetName, instanceIds).block(); - } - - /** - * Restarts one or more virtual machines in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceIds The virtual machine scale set instance ids. Omitting the virtual machine scale set instance - * ids will result in the operation being performed on all virtual machines in the virtual machine scale set. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void beginRestartWithoutPolling( - String resourceGroupName, String vmScaleSetName, List instanceIds, Context context) { - beginRestartWithoutPollingAsync(resourceGroupName, vmScaleSetName, instanceIds, context).block(); - } - - /** - * Starts one or more virtual machines in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceIds The virtual machine scale set instance ids. Omitting the virtual machine scale set instance - * ids will result in the operation being performed on all virtual machines in the virtual machine scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginStartWithoutPollingWithResponseAsync( - String resourceGroupName, String vmScaleSetName, List instanceIds) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2019-12-01"; - VirtualMachineScaleSetVMInstanceIDs vmInstanceIDsInternal = null; - if (instanceIds != null) { - vmInstanceIDsInternal = new VirtualMachineScaleSetVMInstanceIDs(); - vmInstanceIDsInternal.withInstanceIds(instanceIds); - } - VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs = vmInstanceIDsInternal; - return FluxUtil - .withContext( - context -> - service - .beginStartWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - apiVersion, - this.client.getSubscriptionId(), - vmInstanceIDs, - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Starts one or more virtual machines in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceIds The virtual machine scale set instance ids. Omitting the virtual machine scale set instance - * ids will result in the operation being performed on all virtual machines in the virtual machine scale set. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginStartWithoutPollingWithResponseAsync( - String resourceGroupName, String vmScaleSetName, List instanceIds, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2019-12-01"; - VirtualMachineScaleSetVMInstanceIDs vmInstanceIDsInternal = null; - if (instanceIds != null) { - vmInstanceIDsInternal = new VirtualMachineScaleSetVMInstanceIDs(); - vmInstanceIDsInternal.withInstanceIds(instanceIds); - } - VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs = vmInstanceIDsInternal; - return service - .beginStartWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - apiVersion, - this.client.getSubscriptionId(), - vmInstanceIDs, - context); - } - - /** - * Starts one or more virtual machines in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceIds The virtual machine scale set instance ids. Omitting the virtual machine scale set instance - * ids will result in the operation being performed on all virtual machines in the virtual machine scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginStartWithoutPollingAsync( - String resourceGroupName, String vmScaleSetName, List instanceIds) { - return beginStartWithoutPollingWithResponseAsync(resourceGroupName, vmScaleSetName, instanceIds) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Starts one or more virtual machines in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceIds The virtual machine scale set instance ids. Omitting the virtual machine scale set instance - * ids will result in the operation being performed on all virtual machines in the virtual machine scale set. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginStartWithoutPollingAsync( - String resourceGroupName, String vmScaleSetName, List instanceIds, Context context) { - return beginStartWithoutPollingWithResponseAsync(resourceGroupName, vmScaleSetName, instanceIds, context) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Starts one or more virtual machines in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceIds The virtual machine scale set instance ids. Omitting the virtual machine scale set instance - * ids will result in the operation being performed on all virtual machines in the virtual machine scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void beginStartWithoutPolling(String resourceGroupName, String vmScaleSetName, List instanceIds) { - beginStartWithoutPollingAsync(resourceGroupName, vmScaleSetName, instanceIds).block(); - } - - /** - * Starts one or more virtual machines in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceIds The virtual machine scale set instance ids. Omitting the virtual machine scale set instance - * ids will result in the operation being performed on all virtual machines in the virtual machine scale set. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void beginStartWithoutPolling( - String resourceGroupName, String vmScaleSetName, List instanceIds, Context context) { - beginStartWithoutPollingAsync(resourceGroupName, vmScaleSetName, instanceIds, context).block(); - } - - /** - * Shuts down all the virtual machines in the virtual machine scale set, moves them to a new node, and powers them - * back on. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceIds The virtual machine scale set instance ids. Omitting the virtual machine scale set instance - * ids will result in the operation being performed on all virtual machines in the virtual machine scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginRedeployWithoutPollingWithResponseAsync( - String resourceGroupName, String vmScaleSetName, List instanceIds) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2019-12-01"; - VirtualMachineScaleSetVMInstanceIDs vmInstanceIDsInternal = null; - if (instanceIds != null) { - vmInstanceIDsInternal = new VirtualMachineScaleSetVMInstanceIDs(); - vmInstanceIDsInternal.withInstanceIds(instanceIds); - } - VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs = vmInstanceIDsInternal; - return FluxUtil - .withContext( - context -> - service - .beginRedeployWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - apiVersion, - this.client.getSubscriptionId(), - vmInstanceIDs, - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Shuts down all the virtual machines in the virtual machine scale set, moves them to a new node, and powers them - * back on. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceIds The virtual machine scale set instance ids. Omitting the virtual machine scale set instance - * ids will result in the operation being performed on all virtual machines in the virtual machine scale set. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginRedeployWithoutPollingWithResponseAsync( - String resourceGroupName, String vmScaleSetName, List instanceIds, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2019-12-01"; - VirtualMachineScaleSetVMInstanceIDs vmInstanceIDsInternal = null; - if (instanceIds != null) { - vmInstanceIDsInternal = new VirtualMachineScaleSetVMInstanceIDs(); - vmInstanceIDsInternal.withInstanceIds(instanceIds); - } - VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs = vmInstanceIDsInternal; - return service - .beginRedeployWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - apiVersion, - this.client.getSubscriptionId(), - vmInstanceIDs, - context); - } - - /** - * Shuts down all the virtual machines in the virtual machine scale set, moves them to a new node, and powers them - * back on. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceIds The virtual machine scale set instance ids. Omitting the virtual machine scale set instance - * ids will result in the operation being performed on all virtual machines in the virtual machine scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginRedeployWithoutPollingAsync( - String resourceGroupName, String vmScaleSetName, List instanceIds) { - return beginRedeployWithoutPollingWithResponseAsync(resourceGroupName, vmScaleSetName, instanceIds) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Shuts down all the virtual machines in the virtual machine scale set, moves them to a new node, and powers them - * back on. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceIds The virtual machine scale set instance ids. Omitting the virtual machine scale set instance - * ids will result in the operation being performed on all virtual machines in the virtual machine scale set. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginRedeployWithoutPollingAsync( - String resourceGroupName, String vmScaleSetName, List instanceIds, Context context) { - return beginRedeployWithoutPollingWithResponseAsync(resourceGroupName, vmScaleSetName, instanceIds, context) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Shuts down all the virtual machines in the virtual machine scale set, moves them to a new node, and powers them - * back on. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceIds The virtual machine scale set instance ids. Omitting the virtual machine scale set instance - * ids will result in the operation being performed on all virtual machines in the virtual machine scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void beginRedeployWithoutPolling(String resourceGroupName, String vmScaleSetName, List instanceIds) { - beginRedeployWithoutPollingAsync(resourceGroupName, vmScaleSetName, instanceIds).block(); - } - - /** - * Shuts down all the virtual machines in the virtual machine scale set, moves them to a new node, and powers them - * back on. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceIds The virtual machine scale set instance ids. Omitting the virtual machine scale set instance - * ids will result in the operation being performed on all virtual machines in the virtual machine scale set. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void beginRedeployWithoutPolling( - String resourceGroupName, String vmScaleSetName, List instanceIds, Context context) { - beginRedeployWithoutPollingAsync(resourceGroupName, vmScaleSetName, instanceIds, context).block(); - } - - /** - * Perform maintenance on one or more virtual machines in a VM scale set. Operation on instances which are not - * eligible for perform maintenance will be failed. Please refer to best practices for more details: - * https://docs.microsoft.com/en-us/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-maintenance-notifications. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceIds The virtual machine scale set instance ids. Omitting the virtual machine scale set instance - * ids will result in the operation being performed on all virtual machines in the virtual machine scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginPerformMaintenanceWithoutPollingWithResponseAsync( - String resourceGroupName, String vmScaleSetName, List instanceIds) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2019-12-01"; - VirtualMachineScaleSetVMInstanceIDs vmInstanceIDsInternal = null; - if (instanceIds != null) { - vmInstanceIDsInternal = new VirtualMachineScaleSetVMInstanceIDs(); - vmInstanceIDsInternal.withInstanceIds(instanceIds); - } - VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs = vmInstanceIDsInternal; - return FluxUtil - .withContext( - context -> - service - .beginPerformMaintenanceWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - apiVersion, - this.client.getSubscriptionId(), - vmInstanceIDs, - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Perform maintenance on one or more virtual machines in a VM scale set. Operation on instances which are not - * eligible for perform maintenance will be failed. Please refer to best practices for more details: - * https://docs.microsoft.com/en-us/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-maintenance-notifications. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceIds The virtual machine scale set instance ids. Omitting the virtual machine scale set instance - * ids will result in the operation being performed on all virtual machines in the virtual machine scale set. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginPerformMaintenanceWithoutPollingWithResponseAsync( - String resourceGroupName, String vmScaleSetName, List instanceIds, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2019-12-01"; - VirtualMachineScaleSetVMInstanceIDs vmInstanceIDsInternal = null; - if (instanceIds != null) { - vmInstanceIDsInternal = new VirtualMachineScaleSetVMInstanceIDs(); - vmInstanceIDsInternal.withInstanceIds(instanceIds); - } - VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs = vmInstanceIDsInternal; - return service - .beginPerformMaintenanceWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - apiVersion, - this.client.getSubscriptionId(), - vmInstanceIDs, - context); - } - - /** - * Perform maintenance on one or more virtual machines in a VM scale set. Operation on instances which are not - * eligible for perform maintenance will be failed. Please refer to best practices for more details: - * https://docs.microsoft.com/en-us/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-maintenance-notifications. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceIds The virtual machine scale set instance ids. Omitting the virtual machine scale set instance - * ids will result in the operation being performed on all virtual machines in the virtual machine scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginPerformMaintenanceWithoutPollingAsync( - String resourceGroupName, String vmScaleSetName, List instanceIds) { - return beginPerformMaintenanceWithoutPollingWithResponseAsync(resourceGroupName, vmScaleSetName, instanceIds) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Perform maintenance on one or more virtual machines in a VM scale set. Operation on instances which are not - * eligible for perform maintenance will be failed. Please refer to best practices for more details: - * https://docs.microsoft.com/en-us/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-maintenance-notifications. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceIds The virtual machine scale set instance ids. Omitting the virtual machine scale set instance - * ids will result in the operation being performed on all virtual machines in the virtual machine scale set. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginPerformMaintenanceWithoutPollingAsync( - String resourceGroupName, String vmScaleSetName, List instanceIds, Context context) { - return beginPerformMaintenanceWithoutPollingWithResponseAsync( - resourceGroupName, vmScaleSetName, instanceIds, context) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Perform maintenance on one or more virtual machines in a VM scale set. Operation on instances which are not - * eligible for perform maintenance will be failed. Please refer to best practices for more details: - * https://docs.microsoft.com/en-us/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-maintenance-notifications. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceIds The virtual machine scale set instance ids. Omitting the virtual machine scale set instance - * ids will result in the operation being performed on all virtual machines in the virtual machine scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void beginPerformMaintenanceWithoutPolling( - String resourceGroupName, String vmScaleSetName, List instanceIds) { - beginPerformMaintenanceWithoutPollingAsync(resourceGroupName, vmScaleSetName, instanceIds).block(); - } - - /** - * Perform maintenance on one or more virtual machines in a VM scale set. Operation on instances which are not - * eligible for perform maintenance will be failed. Please refer to best practices for more details: - * https://docs.microsoft.com/en-us/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-maintenance-notifications. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceIds The virtual machine scale set instance ids. Omitting the virtual machine scale set instance - * ids will result in the operation being performed on all virtual machines in the virtual machine scale set. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void beginPerformMaintenanceWithoutPolling( - String resourceGroupName, String vmScaleSetName, List instanceIds, Context context) { - beginPerformMaintenanceWithoutPollingAsync(resourceGroupName, vmScaleSetName, instanceIds, context).block(); - } - - /** - * Upgrades one or more virtual machines to the latest SKU set in the VM scale set model. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceIds The virtual machine scale set instance ids. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginUpdateInstancesWithoutPollingWithResponseAsync( - String resourceGroupName, String vmScaleSetName, List instanceIds) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (instanceIds == null) { - return Mono.error(new IllegalArgumentException("Parameter instanceIds is required and cannot be null.")); - } - final String apiVersion = "2019-12-01"; - VirtualMachineScaleSetVMInstanceRequiredIDs vmInstanceIDs = new VirtualMachineScaleSetVMInstanceRequiredIDs(); - vmInstanceIDs.withInstanceIds(instanceIds); - return FluxUtil - .withContext( - context -> - service - .beginUpdateInstancesWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - apiVersion, - this.client.getSubscriptionId(), - vmInstanceIDs, - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Upgrades one or more virtual machines to the latest SKU set in the VM scale set model. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceIds The virtual machine scale set instance ids. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginUpdateInstancesWithoutPollingWithResponseAsync( - String resourceGroupName, String vmScaleSetName, List instanceIds, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (instanceIds == null) { - return Mono.error(new IllegalArgumentException("Parameter instanceIds is required and cannot be null.")); - } - final String apiVersion = "2019-12-01"; - VirtualMachineScaleSetVMInstanceRequiredIDs vmInstanceIDs = new VirtualMachineScaleSetVMInstanceRequiredIDs(); - vmInstanceIDs.withInstanceIds(instanceIds); - return service - .beginUpdateInstancesWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - apiVersion, - this.client.getSubscriptionId(), - vmInstanceIDs, - context); - } - - /** - * Upgrades one or more virtual machines to the latest SKU set in the VM scale set model. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceIds The virtual machine scale set instance ids. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginUpdateInstancesWithoutPollingAsync( - String resourceGroupName, String vmScaleSetName, List instanceIds) { - return beginUpdateInstancesWithoutPollingWithResponseAsync(resourceGroupName, vmScaleSetName, instanceIds) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Upgrades one or more virtual machines to the latest SKU set in the VM scale set model. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceIds The virtual machine scale set instance ids. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginUpdateInstancesWithoutPollingAsync( - String resourceGroupName, String vmScaleSetName, List instanceIds, Context context) { - return beginUpdateInstancesWithoutPollingWithResponseAsync( - resourceGroupName, vmScaleSetName, instanceIds, context) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Upgrades one or more virtual machines to the latest SKU set in the VM scale set model. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceIds The virtual machine scale set instance ids. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void beginUpdateInstancesWithoutPolling( - String resourceGroupName, String vmScaleSetName, List instanceIds) { - beginUpdateInstancesWithoutPollingAsync(resourceGroupName, vmScaleSetName, instanceIds).block(); - } - - /** - * Upgrades one or more virtual machines to the latest SKU set in the VM scale set model. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceIds The virtual machine scale set instance ids. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void beginUpdateInstancesWithoutPolling( - String resourceGroupName, String vmScaleSetName, List instanceIds, Context context) { - beginUpdateInstancesWithoutPollingAsync(resourceGroupName, vmScaleSetName, instanceIds, context).block(); - } - - /** - * Reimages (upgrade the operating system) one or more virtual machines in a VM scale set which don't have a - * ephemeral OS disk, for virtual machines who have a ephemeral OS disk the virtual machine is reset to initial - * state. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param vmScaleSetReimageInput Describes a Virtual Machine Scale Set VM Reimage Parameters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginReimageWithoutPollingWithResponseAsync( - String resourceGroupName, - String vmScaleSetName, - VirtualMachineScaleSetReimageParameters vmScaleSetReimageInput) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (vmScaleSetReimageInput != null) { - vmScaleSetReimageInput.validate(); - } - final String apiVersion = "2019-12-01"; - return FluxUtil - .withContext( - context -> - service - .beginReimageWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - apiVersion, - this.client.getSubscriptionId(), - vmScaleSetReimageInput, - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Reimages (upgrade the operating system) one or more virtual machines in a VM scale set which don't have a - * ephemeral OS disk, for virtual machines who have a ephemeral OS disk the virtual machine is reset to initial - * state. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param vmScaleSetReimageInput Describes a Virtual Machine Scale Set VM Reimage Parameters. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginReimageWithoutPollingWithResponseAsync( - String resourceGroupName, - String vmScaleSetName, - VirtualMachineScaleSetReimageParameters vmScaleSetReimageInput, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (vmScaleSetReimageInput != null) { - vmScaleSetReimageInput.validate(); - } - final String apiVersion = "2019-12-01"; - return service - .beginReimageWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - apiVersion, - this.client.getSubscriptionId(), - vmScaleSetReimageInput, - context); - } - - /** - * Reimages (upgrade the operating system) one or more virtual machines in a VM scale set which don't have a - * ephemeral OS disk, for virtual machines who have a ephemeral OS disk the virtual machine is reset to initial - * state. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param vmScaleSetReimageInput Describes a Virtual Machine Scale Set VM Reimage Parameters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginReimageWithoutPollingAsync( - String resourceGroupName, - String vmScaleSetName, - VirtualMachineScaleSetReimageParameters vmScaleSetReimageInput) { - return beginReimageWithoutPollingWithResponseAsync(resourceGroupName, vmScaleSetName, vmScaleSetReimageInput) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Reimages (upgrade the operating system) one or more virtual machines in a VM scale set which don't have a - * ephemeral OS disk, for virtual machines who have a ephemeral OS disk the virtual machine is reset to initial - * state. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param vmScaleSetReimageInput Describes a Virtual Machine Scale Set VM Reimage Parameters. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginReimageWithoutPollingAsync( - String resourceGroupName, - String vmScaleSetName, - VirtualMachineScaleSetReimageParameters vmScaleSetReimageInput, - Context context) { - return beginReimageWithoutPollingWithResponseAsync( - resourceGroupName, vmScaleSetName, vmScaleSetReimageInput, context) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Reimages (upgrade the operating system) one or more virtual machines in a VM scale set which don't have a - * ephemeral OS disk, for virtual machines who have a ephemeral OS disk the virtual machine is reset to initial - * state. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginReimageWithoutPollingAsync(String resourceGroupName, String vmScaleSetName) { - final VirtualMachineScaleSetReimageParameters vmScaleSetReimageInput = null; - final Context context = null; - return beginReimageWithoutPollingWithResponseAsync(resourceGroupName, vmScaleSetName, vmScaleSetReimageInput) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Reimages (upgrade the operating system) one or more virtual machines in a VM scale set which don't have a - * ephemeral OS disk, for virtual machines who have a ephemeral OS disk the virtual machine is reset to initial - * state. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param vmScaleSetReimageInput Describes a Virtual Machine Scale Set VM Reimage Parameters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void beginReimageWithoutPolling( - String resourceGroupName, - String vmScaleSetName, - VirtualMachineScaleSetReimageParameters vmScaleSetReimageInput) { - beginReimageWithoutPollingAsync(resourceGroupName, vmScaleSetName, vmScaleSetReimageInput).block(); - } - - /** - * Reimages (upgrade the operating system) one or more virtual machines in a VM scale set which don't have a - * ephemeral OS disk, for virtual machines who have a ephemeral OS disk the virtual machine is reset to initial - * state. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param vmScaleSetReimageInput Describes a Virtual Machine Scale Set VM Reimage Parameters. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void beginReimageWithoutPolling( - String resourceGroupName, - String vmScaleSetName, - VirtualMachineScaleSetReimageParameters vmScaleSetReimageInput, - Context context) { - beginReimageWithoutPollingAsync(resourceGroupName, vmScaleSetName, vmScaleSetReimageInput, context).block(); - } - - /** - * Reimages (upgrade the operating system) one or more virtual machines in a VM scale set which don't have a - * ephemeral OS disk, for virtual machines who have a ephemeral OS disk the virtual machine is reset to initial - * state. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void beginReimageWithoutPolling(String resourceGroupName, String vmScaleSetName) { - final VirtualMachineScaleSetReimageParameters vmScaleSetReimageInput = null; - final Context context = null; - beginReimageWithoutPollingAsync(resourceGroupName, vmScaleSetName, vmScaleSetReimageInput).block(); - } - - /** - * Reimages all the disks ( including data disks ) in the virtual machines in a VM scale set. This operation is only - * supported for managed disks. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceIds The virtual machine scale set instance ids. Omitting the virtual machine scale set instance - * ids will result in the operation being performed on all virtual machines in the virtual machine scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginReimageAllWithoutPollingWithResponseAsync( - String resourceGroupName, String vmScaleSetName, List instanceIds) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2019-12-01"; - VirtualMachineScaleSetVMInstanceIDs vmInstanceIDsInternal = null; - if (instanceIds != null) { - vmInstanceIDsInternal = new VirtualMachineScaleSetVMInstanceIDs(); - vmInstanceIDsInternal.withInstanceIds(instanceIds); - } - VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs = vmInstanceIDsInternal; - return FluxUtil - .withContext( - context -> - service - .beginReimageAllWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - apiVersion, - this.client.getSubscriptionId(), - vmInstanceIDs, - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Reimages all the disks ( including data disks ) in the virtual machines in a VM scale set. This operation is only - * supported for managed disks. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceIds The virtual machine scale set instance ids. Omitting the virtual machine scale set instance - * ids will result in the operation being performed on all virtual machines in the virtual machine scale set. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginReimageAllWithoutPollingWithResponseAsync( - String resourceGroupName, String vmScaleSetName, List instanceIds, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2019-12-01"; - VirtualMachineScaleSetVMInstanceIDs vmInstanceIDsInternal = null; - if (instanceIds != null) { - vmInstanceIDsInternal = new VirtualMachineScaleSetVMInstanceIDs(); - vmInstanceIDsInternal.withInstanceIds(instanceIds); - } - VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs = vmInstanceIDsInternal; - return service - .beginReimageAllWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - apiVersion, - this.client.getSubscriptionId(), - vmInstanceIDs, - context); - } - - /** - * Reimages all the disks ( including data disks ) in the virtual machines in a VM scale set. This operation is only - * supported for managed disks. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceIds The virtual machine scale set instance ids. Omitting the virtual machine scale set instance - * ids will result in the operation being performed on all virtual machines in the virtual machine scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginReimageAllWithoutPollingAsync( - String resourceGroupName, String vmScaleSetName, List instanceIds) { - return beginReimageAllWithoutPollingWithResponseAsync(resourceGroupName, vmScaleSetName, instanceIds) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Reimages all the disks ( including data disks ) in the virtual machines in a VM scale set. This operation is only - * supported for managed disks. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceIds The virtual machine scale set instance ids. Omitting the virtual machine scale set instance - * ids will result in the operation being performed on all virtual machines in the virtual machine scale set. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginReimageAllWithoutPollingAsync( - String resourceGroupName, String vmScaleSetName, List instanceIds, Context context) { - return beginReimageAllWithoutPollingWithResponseAsync(resourceGroupName, vmScaleSetName, instanceIds, context) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Reimages all the disks ( including data disks ) in the virtual machines in a VM scale set. This operation is only - * supported for managed disks. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceIds The virtual machine scale set instance ids. Omitting the virtual machine scale set instance - * ids will result in the operation being performed on all virtual machines in the virtual machine scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void beginReimageAllWithoutPolling( - String resourceGroupName, String vmScaleSetName, List instanceIds) { - beginReimageAllWithoutPollingAsync(resourceGroupName, vmScaleSetName, instanceIds).block(); - } - - /** - * Reimages all the disks ( including data disks ) in the virtual machines in a VM scale set. This operation is only - * supported for managed disks. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceIds The virtual machine scale set instance ids. Omitting the virtual machine scale set instance - * ids will result in the operation being performed on all virtual machines in the virtual machine scale set. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void beginReimageAllWithoutPolling( - String resourceGroupName, String vmScaleSetName, List instanceIds, Context context) { - beginReimageAllWithoutPollingAsync(resourceGroupName, vmScaleSetName, instanceIds, context).block(); - } - - /** - * Changes ServiceState property for a given service. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the virtual machine scale set to create or update. - * @param action The action to be performed. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginSetOrchestrationServiceStateWithoutPollingWithResponseAsync( - String resourceGroupName, String vmScaleSetName, OrchestrationServiceStateAction action) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (action == null) { - return Mono.error(new IllegalArgumentException("Parameter action is required and cannot be null.")); - } - final String apiVersion = "2019-12-01"; - OrchestrationServiceStateInput parameters = new OrchestrationServiceStateInput(); - parameters.withAction(action); - return FluxUtil - .withContext( - context -> - service - .beginSetOrchestrationServiceStateWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Changes ServiceState property for a given service. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the virtual machine scale set to create or update. - * @param action The action to be performed. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginSetOrchestrationServiceStateWithoutPollingWithResponseAsync( - String resourceGroupName, String vmScaleSetName, OrchestrationServiceStateAction action, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (action == null) { - return Mono.error(new IllegalArgumentException("Parameter action is required and cannot be null.")); - } - final String apiVersion = "2019-12-01"; - OrchestrationServiceStateInput parameters = new OrchestrationServiceStateInput(); - parameters.withAction(action); - return service - .beginSetOrchestrationServiceStateWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - context); - } - - /** - * Changes ServiceState property for a given service. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the virtual machine scale set to create or update. - * @param action The action to be performed. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginSetOrchestrationServiceStateWithoutPollingAsync( - String resourceGroupName, String vmScaleSetName, OrchestrationServiceStateAction action) { - return beginSetOrchestrationServiceStateWithoutPollingWithResponseAsync( - resourceGroupName, vmScaleSetName, action) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Changes ServiceState property for a given service. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the virtual machine scale set to create or update. - * @param action The action to be performed. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginSetOrchestrationServiceStateWithoutPollingAsync( - String resourceGroupName, String vmScaleSetName, OrchestrationServiceStateAction action, Context context) { - return beginSetOrchestrationServiceStateWithoutPollingWithResponseAsync( - resourceGroupName, vmScaleSetName, action, context) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Changes ServiceState property for a given service. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the virtual machine scale set to create or update. - * @param action The action to be performed. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void beginSetOrchestrationServiceStateWithoutPolling( - String resourceGroupName, String vmScaleSetName, OrchestrationServiceStateAction action) { - beginSetOrchestrationServiceStateWithoutPollingAsync(resourceGroupName, vmScaleSetName, action).block(); - } - - /** - * Changes ServiceState property for a given service. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the virtual machine scale set to create or update. - * @param action The action to be performed. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void beginSetOrchestrationServiceStateWithoutPolling( - String resourceGroupName, String vmScaleSetName, OrchestrationServiceStateAction action, Context context) { - beginSetOrchestrationServiceStateWithoutPollingAsync(resourceGroupName, vmScaleSetName, action, context) - .block(); + String resourceGroupName, String vmScaleSetName, OrchestrationServiceStateInput parameters, Context context) { + setOrchestrationServiceStateAsync(resourceGroupName, vmScaleSetName, parameters, context).block(); } /** @@ -8485,6 +5646,7 @@ public Mono> listNextSinglePageAsync( if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listNext(nextLink, context) .map( @@ -8542,6 +5704,7 @@ public Mono> listAllNextSinglePageAsy if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listAllNext(nextLink, context) .map( @@ -8599,6 +5762,7 @@ public Mono> listSkusNextSinglePag if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listSkusNext(nextLink, context) .map( @@ -8657,6 +5821,7 @@ public Mono> getOSUpgra if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getOSUpgradeHistoryNext(nextLink, context) .map( diff --git a/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/VirtualMachineSizesClient.java b/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/VirtualMachineSizesClient.java index 22de999218774..97e76a35af88f 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/VirtualMachineSizesClient.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/VirtualMachineSizesClient.java @@ -140,6 +140,7 @@ public Mono> listSinglePageAsync(String l "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .list(this.client.getEndpoint(), location, apiVersion, this.client.getSubscriptionId(), context) .map( diff --git a/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/VirtualMachinesClient.java b/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/VirtualMachinesClient.java index 1f12644b7d6fe..0ae685fea879d 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/VirtualMachinesClient.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/VirtualMachinesClient.java @@ -393,208 +393,6 @@ Mono>> runCommand( @BodyParam("application/json") RunCommandInput parameters, Context context); - @Headers({"Accept: application/json", "Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" - + "/virtualMachines/{vmName}/capture") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> beginCaptureWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("vmName") String vmName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") VirtualMachineCaptureParameters parameters, - Context context); - - @Headers({"Accept: application/json", "Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" - + "/virtualMachines/{vmName}") - @ExpectedResponses({200, 201}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> beginCreateOrUpdateWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("vmName") String vmName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") VirtualMachineInner parameters, - Context context); - - @Headers({"Accept: application/json", "Content-Type: application/json"}) - @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" - + "/virtualMachines/{vmName}") - @ExpectedResponses({200, 201}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> beginUpdateWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("vmName") String vmName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") VirtualMachineUpdateInner parameters, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" - + "/virtualMachines/{vmName}") - @ExpectedResponses({200, 202, 204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> beginDeleteWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("vmName") String vmName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" - + "/virtualMachines/{vmName}/convertToManagedDisks") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> beginConvertToManagedDisksWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("vmName") String vmName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" - + "/virtualMachines/{vmName}/deallocate") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> beginDeallocateWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("vmName") String vmName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" - + "/virtualMachines/{vmName}/powerOff") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> beginPowerOffWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("vmName") String vmName, - @QueryParam("skipShutdown") Boolean skipShutdown, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" - + "/virtualMachines/{vmName}/reapply") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ApiErrorException.class) - Mono> beginReapplyWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("vmName") String vmName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" - + "/virtualMachines/{vmName}/restart") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> beginRestartWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("vmName") String vmName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" - + "/virtualMachines/{vmName}/start") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> beginStartWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("vmName") String vmName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" - + "/virtualMachines/{vmName}/redeploy") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> beginRedeployWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("vmName") String vmName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" - + "/virtualMachines/{vmName}/reimage") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> beginReimageWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("vmName") String vmName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") VirtualMachineReimageParameters parameters, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" - + "/virtualMachines/{vmName}/performMaintenance") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> beginPerformMaintenanceWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("vmName") String vmName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - Context context); - - @Headers({"Accept: application/json,text/json", "Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" - + "/virtualMachines/{vmName}/runCommand") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> beginRunCommandWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("vmName") String vmName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") RunCommandInput parameters, - Context context); - @Headers({"Accept: application/json", "Content-Type: application/json"}) @Get("{nextLink}") @ExpectedResponses({200}) @@ -690,6 +488,7 @@ public Mono> listByLocationSinglePageAsync(St "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .listByLocation(this.client.getEndpoint(), location, apiVersion, this.client.getSubscriptionId(), context) .map( @@ -860,6 +659,7 @@ public Mono>> captureWithResponseAsync( parameters.validate(); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .capture( this.client.getEndpoint(), @@ -977,7 +777,7 @@ public Mono captureAsync( String resourceGroupName, String vmName, VirtualMachineCaptureParameters parameters) { return beginCaptureAsync(resourceGroupName, vmName, parameters) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -998,7 +798,7 @@ public Mono captureAsync( String resourceGroupName, String vmName, VirtualMachineCaptureParameters parameters, Context context) { return beginCaptureAsync(resourceGroupName, vmName, parameters, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -1134,6 +934,7 @@ public Mono>> createOrUpdateWithResponseAsync( parameters.validate(); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .createOrUpdate( this.client.getEndpoint(), @@ -1245,7 +1046,7 @@ public Mono createOrUpdateAsync( String resourceGroupName, String vmName, VirtualMachineInner parameters) { return beginCreateOrUpdateAsync(resourceGroupName, vmName, parameters) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -1266,7 +1067,7 @@ public Mono createOrUpdateAsync( String resourceGroupName, String vmName, VirtualMachineInner parameters, Context context) { return beginCreateOrUpdateAsync(resourceGroupName, vmName, parameters, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -1399,6 +1200,7 @@ public Mono>> updateWithResponseAsync( parameters.validate(); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .update( this.client.getEndpoint(), @@ -1504,7 +1306,7 @@ public Mono updateAsync( String resourceGroupName, String vmName, VirtualMachineUpdateInner parameters) { return beginUpdateAsync(resourceGroupName, vmName, parameters) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -1524,7 +1326,7 @@ public Mono updateAsync( String resourceGroupName, String vmName, VirtualMachineUpdateInner parameters, Context context) { return beginUpdateAsync(resourceGroupName, vmName, parameters, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -1641,6 +1443,7 @@ public Mono>> deleteWithResponseAsync( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .delete( this.client.getEndpoint(), @@ -1728,7 +1531,7 @@ public SyncPoller, Void> beginDelete(String resourceGroupName, */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono deleteAsync(String resourceGroupName, String vmName) { - return beginDeleteAsync(resourceGroupName, vmName).last().flatMap(client::getLroFinalResultOrError); + return beginDeleteAsync(resourceGroupName, vmName).last().flatMap(this.client::getLroFinalResultOrError); } /** @@ -1744,7 +1547,9 @@ public Mono deleteAsync(String resourceGroupName, String vmName) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono deleteAsync(String resourceGroupName, String vmName, Context context) { - return beginDeleteAsync(resourceGroupName, vmName, context).last().flatMap(client::getLroFinalResultOrError); + return beginDeleteAsync(resourceGroupName, vmName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -1860,6 +1665,7 @@ public Mono> getByResourceGroupWithResponseAsync( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .getByResourceGroup( this.client.getEndpoint(), @@ -2079,6 +1885,7 @@ public Mono> instanceViewWithResponseA "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .instanceView( this.client.getEndpoint(), @@ -2251,6 +2058,7 @@ public Mono>> convertToManagedDisksWithResponseAsync( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .convertToManagedDisks( this.client.getEndpoint(), @@ -2347,7 +2155,7 @@ public SyncPoller, Void> beginConvertToManagedDisks( public Mono convertToManagedDisksAsync(String resourceGroupName, String vmName) { return beginConvertToManagedDisksAsync(resourceGroupName, vmName) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -2366,7 +2174,7 @@ public Mono convertToManagedDisksAsync(String resourceGroupName, String vm public Mono convertToManagedDisksAsync(String resourceGroupName, String vmName, Context context) { return beginConvertToManagedDisksAsync(resourceGroupName, vmName, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -2482,6 +2290,7 @@ public Mono>> deallocateWithResponseAsync( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .deallocate( this.client.getEndpoint(), @@ -2575,7 +2384,7 @@ public SyncPoller, Void> beginDeallocate( */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono deallocateAsync(String resourceGroupName, String vmName) { - return beginDeallocateAsync(resourceGroupName, vmName).last().flatMap(client::getLroFinalResultOrError); + return beginDeallocateAsync(resourceGroupName, vmName).last().flatMap(this.client::getLroFinalResultOrError); } /** @@ -2594,7 +2403,7 @@ public Mono deallocateAsync(String resourceGroupName, String vmName) { public Mono deallocateAsync(String resourceGroupName, String vmName, Context context) { return beginDeallocateAsync(resourceGroupName, vmName, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -2715,6 +2524,7 @@ public Mono> generalizeWithResponseAsync(String resourceGroupName "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .generalize( this.client.getEndpoint(), @@ -2884,6 +2694,7 @@ public Mono> listByResourceGroupSinglePageAsy "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .listByResourceGroup( this.client.getEndpoint(), resourceGroupName, apiVersion, this.client.getSubscriptionId(), context) @@ -3036,6 +2847,7 @@ public Mono> listSinglePageAsync(String statu "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), statusOnly, context) .map( @@ -3227,6 +3039,7 @@ public Mono> listAvailableSizesSinglePage "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .listAvailableSizes( this.client.getEndpoint(), @@ -3395,6 +3208,7 @@ public Mono>> powerOffWithResponseAsync( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .powerOff( this.client.getEndpoint(), @@ -3509,7 +3323,7 @@ public SyncPoller, Void> beginPowerOff( public Mono powerOffAsync(String resourceGroupName, String vmName, Boolean skipShutdown) { return beginPowerOffAsync(resourceGroupName, vmName, skipShutdown) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -3531,7 +3345,7 @@ public Mono powerOffAsync(String resourceGroupName, String vmName, Boolean public Mono powerOffAsync(String resourceGroupName, String vmName, Boolean skipShutdown, Context context) { return beginPowerOffAsync(resourceGroupName, vmName, skipShutdown, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -3551,7 +3365,7 @@ public Mono powerOffAsync(String resourceGroupName, String vmName) { final Context context = null; return beginPowerOffAsync(resourceGroupName, vmName, skipShutdown) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -3688,6 +3502,7 @@ public Mono>> reapplyWithResponseAsync( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .reapply( this.client.getEndpoint(), @@ -3775,7 +3590,7 @@ public SyncPoller, Void> beginReapply(String resourceGroupName, */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono reapplyAsync(String resourceGroupName, String vmName) { - return beginReapplyAsync(resourceGroupName, vmName).last().flatMap(client::getLroFinalResultOrError); + return beginReapplyAsync(resourceGroupName, vmName).last().flatMap(this.client::getLroFinalResultOrError); } /** @@ -3791,7 +3606,9 @@ public Mono reapplyAsync(String resourceGroupName, String vmName) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono reapplyAsync(String resourceGroupName, String vmName, Context context) { - return beginReapplyAsync(resourceGroupName, vmName, context).last().flatMap(client::getLroFinalResultOrError); + return beginReapplyAsync(resourceGroupName, vmName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -3903,6 +3720,7 @@ public Mono>> restartWithResponseAsync( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .restart( this.client.getEndpoint(), @@ -3990,7 +3808,7 @@ public SyncPoller, Void> beginRestart(String resourceGroupName, */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono restartAsync(String resourceGroupName, String vmName) { - return beginRestartAsync(resourceGroupName, vmName).last().flatMap(client::getLroFinalResultOrError); + return beginRestartAsync(resourceGroupName, vmName).last().flatMap(this.client::getLroFinalResultOrError); } /** @@ -4006,7 +3824,9 @@ public Mono restartAsync(String resourceGroupName, String vmName) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono restartAsync(String resourceGroupName, String vmName, Context context) { - return beginRestartAsync(resourceGroupName, vmName, context).last().flatMap(client::getLroFinalResultOrError); + return beginRestartAsync(resourceGroupName, vmName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -4118,6 +3938,7 @@ public Mono>> startWithResponseAsync( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .start( this.client.getEndpoint(), @@ -4205,7 +4026,7 @@ public SyncPoller, Void> beginStart(String resourceGroupName, S */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono startAsync(String resourceGroupName, String vmName) { - return beginStartAsync(resourceGroupName, vmName).last().flatMap(client::getLroFinalResultOrError); + return beginStartAsync(resourceGroupName, vmName).last().flatMap(this.client::getLroFinalResultOrError); } /** @@ -4221,7 +4042,9 @@ public Mono startAsync(String resourceGroupName, String vmName) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono startAsync(String resourceGroupName, String vmName, Context context) { - return beginStartAsync(resourceGroupName, vmName, context).last().flatMap(client::getLroFinalResultOrError); + return beginStartAsync(resourceGroupName, vmName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -4333,6 +4156,7 @@ public Mono>> redeployWithResponseAsync( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .redeploy( this.client.getEndpoint(), @@ -4420,7 +4244,7 @@ public SyncPoller, Void> beginRedeploy(String resourceGroupName */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono redeployAsync(String resourceGroupName, String vmName) { - return beginRedeployAsync(resourceGroupName, vmName).last().flatMap(client::getLroFinalResultOrError); + return beginRedeployAsync(resourceGroupName, vmName).last().flatMap(this.client::getLroFinalResultOrError); } /** @@ -4436,7 +4260,9 @@ public Mono redeployAsync(String resourceGroupName, String vmName) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono redeployAsync(String resourceGroupName, String vmName, Context context) { - return beginRedeployAsync(resourceGroupName, vmName, context).last().flatMap(client::getLroFinalResultOrError); + return beginRedeployAsync(resourceGroupName, vmName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -4566,6 +4392,7 @@ public Mono>> reimageWithResponseAsync( parametersInternal.withTempDisk(tempDisk); } VirtualMachineReimageParameters parameters = parametersInternal; + context = this.client.mergeContext(context); return service .reimage( this.client.getEndpoint(), @@ -4666,7 +4493,9 @@ public SyncPoller, Void> beginReimage( */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono reimageAsync(String resourceGroupName, String vmName, Boolean tempDisk) { - return beginReimageAsync(resourceGroupName, vmName, tempDisk).last().flatMap(client::getLroFinalResultOrError); + return beginReimageAsync(resourceGroupName, vmName, tempDisk) + .last() + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -4686,7 +4515,7 @@ public Mono reimageAsync(String resourceGroupName, String vmName, Boolean public Mono reimageAsync(String resourceGroupName, String vmName, Boolean tempDisk, Context context) { return beginReimageAsync(resourceGroupName, vmName, tempDisk, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -4803,6 +4632,7 @@ public Mono>> performMaintenanceWithResponseAsync( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .performMaintenance( this.client.getEndpoint(), @@ -4893,7 +4723,7 @@ public SyncPoller, Void> beginPerformMaintenance( public Mono performMaintenanceAsync(String resourceGroupName, String vmName) { return beginPerformMaintenanceAsync(resourceGroupName, vmName) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -4911,7 +4741,7 @@ public Mono performMaintenanceAsync(String resourceGroupName, String vmNam public Mono performMaintenanceAsync(String resourceGroupName, String vmName, Context context) { return beginPerformMaintenanceAsync(resourceGroupName, vmName, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -5025,6 +4855,7 @@ public Mono> simulateEvictionWithResponseAsync( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .simulateEviction( this.client.getEndpoint(), @@ -5195,6 +5026,7 @@ public Mono>> runCommandWithResponseAsync( parameters.validate(); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .runCommand( this.client.getEndpoint(), @@ -5301,7 +5133,7 @@ public Mono runCommandAsync( String resourceGroupName, String vmName, RunCommandInput parameters) { return beginRunCommandAsync(resourceGroupName, vmName, parameters) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -5321,7 +5153,7 @@ public Mono runCommandAsync( String resourceGroupName, String vmName, RunCommandInput parameters, Context context) { return beginRunCommandAsync(resourceGroupName, vmName, parameters, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -5358,2412 +5190,6 @@ public RunCommandResultInner runCommand( return runCommandAsync(resourceGroupName, vmName, parameters, context).block(); } - /** - * Captures the VM by copying virtual hard disks of the VM and outputs a template that can be used to create similar - * VMs. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param parameters Capture Virtual Machine parameters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return output of virtual machine capture operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginCaptureWithoutPollingWithResponseAsync( - String resourceGroupName, String vmName, VirtualMachineCaptureParameters parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2019-12-01"; - return FluxUtil - .withContext( - context -> - service - .beginCaptureWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - vmName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Captures the VM by copying virtual hard disks of the VM and outputs a template that can be used to create similar - * VMs. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param parameters Capture Virtual Machine parameters. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return output of virtual machine capture operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginCaptureWithoutPollingWithResponseAsync( - String resourceGroupName, String vmName, VirtualMachineCaptureParameters parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2019-12-01"; - return service - .beginCaptureWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - vmName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - context); - } - - /** - * Captures the VM by copying virtual hard disks of the VM and outputs a template that can be used to create similar - * VMs. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param parameters Capture Virtual Machine parameters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return output of virtual machine capture operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginCaptureWithoutPollingAsync( - String resourceGroupName, String vmName, VirtualMachineCaptureParameters parameters) { - return beginCaptureWithoutPollingWithResponseAsync(resourceGroupName, vmName, parameters) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Captures the VM by copying virtual hard disks of the VM and outputs a template that can be used to create similar - * VMs. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param parameters Capture Virtual Machine parameters. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return output of virtual machine capture operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginCaptureWithoutPollingAsync( - String resourceGroupName, String vmName, VirtualMachineCaptureParameters parameters, Context context) { - return beginCaptureWithoutPollingWithResponseAsync(resourceGroupName, vmName, parameters, context) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Captures the VM by copying virtual hard disks of the VM and outputs a template that can be used to create similar - * VMs. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param parameters Capture Virtual Machine parameters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return output of virtual machine capture operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public VirtualMachineCaptureResultInner beginCaptureWithoutPolling( - String resourceGroupName, String vmName, VirtualMachineCaptureParameters parameters) { - return beginCaptureWithoutPollingAsync(resourceGroupName, vmName, parameters).block(); - } - - /** - * Captures the VM by copying virtual hard disks of the VM and outputs a template that can be used to create similar - * VMs. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param parameters Capture Virtual Machine parameters. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return output of virtual machine capture operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public VirtualMachineCaptureResultInner beginCaptureWithoutPolling( - String resourceGroupName, String vmName, VirtualMachineCaptureParameters parameters, Context context) { - return beginCaptureWithoutPollingAsync(resourceGroupName, vmName, parameters, context).block(); - } - - /** - * The operation to create or update a virtual machine. Please note some properties can be set only during virtual - * machine creation. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param parameters Describes a Virtual Machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginCreateOrUpdateWithoutPollingWithResponseAsync( - String resourceGroupName, String vmName, VirtualMachineInner parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2019-12-01"; - return FluxUtil - .withContext( - context -> - service - .beginCreateOrUpdateWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - vmName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * The operation to create or update a virtual machine. Please note some properties can be set only during virtual - * machine creation. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param parameters Describes a Virtual Machine. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginCreateOrUpdateWithoutPollingWithResponseAsync( - String resourceGroupName, String vmName, VirtualMachineInner parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2019-12-01"; - return service - .beginCreateOrUpdateWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - vmName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - context); - } - - /** - * The operation to create or update a virtual machine. Please note some properties can be set only during virtual - * machine creation. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param parameters Describes a Virtual Machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginCreateOrUpdateWithoutPollingAsync( - String resourceGroupName, String vmName, VirtualMachineInner parameters) { - return beginCreateOrUpdateWithoutPollingWithResponseAsync(resourceGroupName, vmName, parameters) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * The operation to create or update a virtual machine. Please note some properties can be set only during virtual - * machine creation. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param parameters Describes a Virtual Machine. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginCreateOrUpdateWithoutPollingAsync( - String resourceGroupName, String vmName, VirtualMachineInner parameters, Context context) { - return beginCreateOrUpdateWithoutPollingWithResponseAsync(resourceGroupName, vmName, parameters, context) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * The operation to create or update a virtual machine. Please note some properties can be set only during virtual - * machine creation. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param parameters Describes a Virtual Machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public VirtualMachineInner beginCreateOrUpdateWithoutPolling( - String resourceGroupName, String vmName, VirtualMachineInner parameters) { - return beginCreateOrUpdateWithoutPollingAsync(resourceGroupName, vmName, parameters).block(); - } - - /** - * The operation to create or update a virtual machine. Please note some properties can be set only during virtual - * machine creation. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param parameters Describes a Virtual Machine. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public VirtualMachineInner beginCreateOrUpdateWithoutPolling( - String resourceGroupName, String vmName, VirtualMachineInner parameters, Context context) { - return beginCreateOrUpdateWithoutPollingAsync(resourceGroupName, vmName, parameters, context).block(); - } - - /** - * The operation to update a virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param parameters Describes a Virtual Machine Update. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginUpdateWithoutPollingWithResponseAsync( - String resourceGroupName, String vmName, VirtualMachineUpdateInner parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2019-12-01"; - return FluxUtil - .withContext( - context -> - service - .beginUpdateWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - vmName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * The operation to update a virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param parameters Describes a Virtual Machine Update. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginUpdateWithoutPollingWithResponseAsync( - String resourceGroupName, String vmName, VirtualMachineUpdateInner parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2019-12-01"; - return service - .beginUpdateWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - vmName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - context); - } - - /** - * The operation to update a virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param parameters Describes a Virtual Machine Update. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginUpdateWithoutPollingAsync( - String resourceGroupName, String vmName, VirtualMachineUpdateInner parameters) { - return beginUpdateWithoutPollingWithResponseAsync(resourceGroupName, vmName, parameters) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * The operation to update a virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param parameters Describes a Virtual Machine Update. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginUpdateWithoutPollingAsync( - String resourceGroupName, String vmName, VirtualMachineUpdateInner parameters, Context context) { - return beginUpdateWithoutPollingWithResponseAsync(resourceGroupName, vmName, parameters, context) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * The operation to update a virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param parameters Describes a Virtual Machine Update. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public VirtualMachineInner beginUpdateWithoutPolling( - String resourceGroupName, String vmName, VirtualMachineUpdateInner parameters) { - return beginUpdateWithoutPollingAsync(resourceGroupName, vmName, parameters).block(); - } - - /** - * The operation to update a virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param parameters Describes a Virtual Machine Update. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public VirtualMachineInner beginUpdateWithoutPolling( - String resourceGroupName, String vmName, VirtualMachineUpdateInner parameters, Context context) { - return beginUpdateWithoutPollingAsync(resourceGroupName, vmName, parameters, context).block(); - } - - /** - * The operation to delete a virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginDeleteWithoutPollingWithResponseAsync(String resourceGroupName, String vmName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2019-12-01"; - return FluxUtil - .withContext( - context -> - service - .beginDeleteWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - vmName, - apiVersion, - this.client.getSubscriptionId(), - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * The operation to delete a virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginDeleteWithoutPollingWithResponseAsync( - String resourceGroupName, String vmName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2019-12-01"; - return service - .beginDeleteWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - vmName, - apiVersion, - this.client.getSubscriptionId(), - context); - } - - /** - * The operation to delete a virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginDeleteWithoutPollingAsync(String resourceGroupName, String vmName) { - return beginDeleteWithoutPollingWithResponseAsync(resourceGroupName, vmName) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * The operation to delete a virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginDeleteWithoutPollingAsync(String resourceGroupName, String vmName, Context context) { - return beginDeleteWithoutPollingWithResponseAsync(resourceGroupName, vmName, context) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * The operation to delete a virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void beginDeleteWithoutPolling(String resourceGroupName, String vmName) { - beginDeleteWithoutPollingAsync(resourceGroupName, vmName).block(); - } - - /** - * The operation to delete a virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void beginDeleteWithoutPolling(String resourceGroupName, String vmName, Context context) { - beginDeleteWithoutPollingAsync(resourceGroupName, vmName, context).block(); - } - - /** - * Converts virtual machine disks from blob-based to managed disks. Virtual machine must be stop-deallocated before - * invoking this operation. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginConvertToManagedDisksWithoutPollingWithResponseAsync( - String resourceGroupName, String vmName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2019-12-01"; - return FluxUtil - .withContext( - context -> - service - .beginConvertToManagedDisksWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - vmName, - apiVersion, - this.client.getSubscriptionId(), - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Converts virtual machine disks from blob-based to managed disks. Virtual machine must be stop-deallocated before - * invoking this operation. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginConvertToManagedDisksWithoutPollingWithResponseAsync( - String resourceGroupName, String vmName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2019-12-01"; - return service - .beginConvertToManagedDisksWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - vmName, - apiVersion, - this.client.getSubscriptionId(), - context); - } - - /** - * Converts virtual machine disks from blob-based to managed disks. Virtual machine must be stop-deallocated before - * invoking this operation. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginConvertToManagedDisksWithoutPollingAsync(String resourceGroupName, String vmName) { - return beginConvertToManagedDisksWithoutPollingWithResponseAsync(resourceGroupName, vmName) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Converts virtual machine disks from blob-based to managed disks. Virtual machine must be stop-deallocated before - * invoking this operation. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginConvertToManagedDisksWithoutPollingAsync( - String resourceGroupName, String vmName, Context context) { - return beginConvertToManagedDisksWithoutPollingWithResponseAsync(resourceGroupName, vmName, context) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Converts virtual machine disks from blob-based to managed disks. Virtual machine must be stop-deallocated before - * invoking this operation. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void beginConvertToManagedDisksWithoutPolling(String resourceGroupName, String vmName) { - beginConvertToManagedDisksWithoutPollingAsync(resourceGroupName, vmName).block(); - } - - /** - * Converts virtual machine disks from blob-based to managed disks. Virtual machine must be stop-deallocated before - * invoking this operation. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void beginConvertToManagedDisksWithoutPolling(String resourceGroupName, String vmName, Context context) { - beginConvertToManagedDisksWithoutPollingAsync(resourceGroupName, vmName, context).block(); - } - - /** - * Shuts down the virtual machine and releases the compute resources. You are not billed for the compute resources - * that this virtual machine uses. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginDeallocateWithoutPollingWithResponseAsync( - String resourceGroupName, String vmName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2019-12-01"; - return FluxUtil - .withContext( - context -> - service - .beginDeallocateWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - vmName, - apiVersion, - this.client.getSubscriptionId(), - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Shuts down the virtual machine and releases the compute resources. You are not billed for the compute resources - * that this virtual machine uses. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginDeallocateWithoutPollingWithResponseAsync( - String resourceGroupName, String vmName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2019-12-01"; - return service - .beginDeallocateWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - vmName, - apiVersion, - this.client.getSubscriptionId(), - context); - } - - /** - * Shuts down the virtual machine and releases the compute resources. You are not billed for the compute resources - * that this virtual machine uses. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginDeallocateWithoutPollingAsync(String resourceGroupName, String vmName) { - return beginDeallocateWithoutPollingWithResponseAsync(resourceGroupName, vmName) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Shuts down the virtual machine and releases the compute resources. You are not billed for the compute resources - * that this virtual machine uses. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginDeallocateWithoutPollingAsync(String resourceGroupName, String vmName, Context context) { - return beginDeallocateWithoutPollingWithResponseAsync(resourceGroupName, vmName, context) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Shuts down the virtual machine and releases the compute resources. You are not billed for the compute resources - * that this virtual machine uses. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void beginDeallocateWithoutPolling(String resourceGroupName, String vmName) { - beginDeallocateWithoutPollingAsync(resourceGroupName, vmName).block(); - } - - /** - * Shuts down the virtual machine and releases the compute resources. You are not billed for the compute resources - * that this virtual machine uses. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void beginDeallocateWithoutPolling(String resourceGroupName, String vmName, Context context) { - beginDeallocateWithoutPollingAsync(resourceGroupName, vmName, context).block(); - } - - /** - * The operation to power off (stop) a virtual machine. The virtual machine can be restarted with the same - * provisioned resources. You are still charged for this virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param skipShutdown The parameter to request non-graceful VM shutdown. True value for this flag indicates - * non-graceful shutdown whereas false indicates otherwise. Default value for this flag is false if not - * specified. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginPowerOffWithoutPollingWithResponseAsync( - String resourceGroupName, String vmName, Boolean skipShutdown) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2019-12-01"; - return FluxUtil - .withContext( - context -> - service - .beginPowerOffWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - vmName, - skipShutdown, - apiVersion, - this.client.getSubscriptionId(), - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * The operation to power off (stop) a virtual machine. The virtual machine can be restarted with the same - * provisioned resources. You are still charged for this virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param skipShutdown The parameter to request non-graceful VM shutdown. True value for this flag indicates - * non-graceful shutdown whereas false indicates otherwise. Default value for this flag is false if not - * specified. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginPowerOffWithoutPollingWithResponseAsync( - String resourceGroupName, String vmName, Boolean skipShutdown, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2019-12-01"; - return service - .beginPowerOffWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - vmName, - skipShutdown, - apiVersion, - this.client.getSubscriptionId(), - context); - } - - /** - * The operation to power off (stop) a virtual machine. The virtual machine can be restarted with the same - * provisioned resources. You are still charged for this virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param skipShutdown The parameter to request non-graceful VM shutdown. True value for this flag indicates - * non-graceful shutdown whereas false indicates otherwise. Default value for this flag is false if not - * specified. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginPowerOffWithoutPollingAsync(String resourceGroupName, String vmName, Boolean skipShutdown) { - return beginPowerOffWithoutPollingWithResponseAsync(resourceGroupName, vmName, skipShutdown) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * The operation to power off (stop) a virtual machine. The virtual machine can be restarted with the same - * provisioned resources. You are still charged for this virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param skipShutdown The parameter to request non-graceful VM shutdown. True value for this flag indicates - * non-graceful shutdown whereas false indicates otherwise. Default value for this flag is false if not - * specified. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginPowerOffWithoutPollingAsync( - String resourceGroupName, String vmName, Boolean skipShutdown, Context context) { - return beginPowerOffWithoutPollingWithResponseAsync(resourceGroupName, vmName, skipShutdown, context) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * The operation to power off (stop) a virtual machine. The virtual machine can be restarted with the same - * provisioned resources. You are still charged for this virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginPowerOffWithoutPollingAsync(String resourceGroupName, String vmName) { - final Boolean skipShutdown = null; - final Context context = null; - return beginPowerOffWithoutPollingWithResponseAsync(resourceGroupName, vmName, skipShutdown) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * The operation to power off (stop) a virtual machine. The virtual machine can be restarted with the same - * provisioned resources. You are still charged for this virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param skipShutdown The parameter to request non-graceful VM shutdown. True value for this flag indicates - * non-graceful shutdown whereas false indicates otherwise. Default value for this flag is false if not - * specified. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void beginPowerOffWithoutPolling(String resourceGroupName, String vmName, Boolean skipShutdown) { - beginPowerOffWithoutPollingAsync(resourceGroupName, vmName, skipShutdown).block(); - } - - /** - * The operation to power off (stop) a virtual machine. The virtual machine can be restarted with the same - * provisioned resources. You are still charged for this virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param skipShutdown The parameter to request non-graceful VM shutdown. True value for this flag indicates - * non-graceful shutdown whereas false indicates otherwise. Default value for this flag is false if not - * specified. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void beginPowerOffWithoutPolling( - String resourceGroupName, String vmName, Boolean skipShutdown, Context context) { - beginPowerOffWithoutPollingAsync(resourceGroupName, vmName, skipShutdown, context).block(); - } - - /** - * The operation to power off (stop) a virtual machine. The virtual machine can be restarted with the same - * provisioned resources. You are still charged for this virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void beginPowerOffWithoutPolling(String resourceGroupName, String vmName) { - final Boolean skipShutdown = null; - final Context context = null; - beginPowerOffWithoutPollingAsync(resourceGroupName, vmName, skipShutdown).block(); - } - - /** - * The operation to reapply a virtual machine's state. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginReapplyWithoutPollingWithResponseAsync(String resourceGroupName, String vmName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2019-12-01"; - return FluxUtil - .withContext( - context -> - service - .beginReapplyWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - vmName, - apiVersion, - this.client.getSubscriptionId(), - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * The operation to reapply a virtual machine's state. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param context The context to associate with this 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 completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginReapplyWithoutPollingWithResponseAsync( - String resourceGroupName, String vmName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2019-12-01"; - return service - .beginReapplyWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - vmName, - apiVersion, - this.client.getSubscriptionId(), - context); - } - - /** - * The operation to reapply a virtual machine's state. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginReapplyWithoutPollingAsync(String resourceGroupName, String vmName) { - return beginReapplyWithoutPollingWithResponseAsync(resourceGroupName, vmName) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * The operation to reapply a virtual machine's state. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param context The context to associate with this 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 completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginReapplyWithoutPollingAsync(String resourceGroupName, String vmName, Context context) { - return beginReapplyWithoutPollingWithResponseAsync(resourceGroupName, vmName, context) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * The operation to reapply a virtual machine's state. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void beginReapplyWithoutPolling(String resourceGroupName, String vmName) { - beginReapplyWithoutPollingAsync(resourceGroupName, vmName).block(); - } - - /** - * The operation to reapply a virtual machine's state. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param context The context to associate with this 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. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void beginReapplyWithoutPolling(String resourceGroupName, String vmName, Context context) { - beginReapplyWithoutPollingAsync(resourceGroupName, vmName, context).block(); - } - - /** - * The operation to restart a virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginRestartWithoutPollingWithResponseAsync(String resourceGroupName, String vmName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2019-12-01"; - return FluxUtil - .withContext( - context -> - service - .beginRestartWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - vmName, - apiVersion, - this.client.getSubscriptionId(), - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * The operation to restart a virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginRestartWithoutPollingWithResponseAsync( - String resourceGroupName, String vmName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2019-12-01"; - return service - .beginRestartWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - vmName, - apiVersion, - this.client.getSubscriptionId(), - context); - } - - /** - * The operation to restart a virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginRestartWithoutPollingAsync(String resourceGroupName, String vmName) { - return beginRestartWithoutPollingWithResponseAsync(resourceGroupName, vmName) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * The operation to restart a virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginRestartWithoutPollingAsync(String resourceGroupName, String vmName, Context context) { - return beginRestartWithoutPollingWithResponseAsync(resourceGroupName, vmName, context) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * The operation to restart a virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void beginRestartWithoutPolling(String resourceGroupName, String vmName) { - beginRestartWithoutPollingAsync(resourceGroupName, vmName).block(); - } - - /** - * The operation to restart a virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void beginRestartWithoutPolling(String resourceGroupName, String vmName, Context context) { - beginRestartWithoutPollingAsync(resourceGroupName, vmName, context).block(); - } - - /** - * The operation to start a virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginStartWithoutPollingWithResponseAsync(String resourceGroupName, String vmName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2019-12-01"; - return FluxUtil - .withContext( - context -> - service - .beginStartWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - vmName, - apiVersion, - this.client.getSubscriptionId(), - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * The operation to start a virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginStartWithoutPollingWithResponseAsync( - String resourceGroupName, String vmName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2019-12-01"; - return service - .beginStartWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - vmName, - apiVersion, - this.client.getSubscriptionId(), - context); - } - - /** - * The operation to start a virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginStartWithoutPollingAsync(String resourceGroupName, String vmName) { - return beginStartWithoutPollingWithResponseAsync(resourceGroupName, vmName) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * The operation to start a virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginStartWithoutPollingAsync(String resourceGroupName, String vmName, Context context) { - return beginStartWithoutPollingWithResponseAsync(resourceGroupName, vmName, context) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * The operation to start a virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void beginStartWithoutPolling(String resourceGroupName, String vmName) { - beginStartWithoutPollingAsync(resourceGroupName, vmName).block(); - } - - /** - * The operation to start a virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void beginStartWithoutPolling(String resourceGroupName, String vmName, Context context) { - beginStartWithoutPollingAsync(resourceGroupName, vmName, context).block(); - } - - /** - * Shuts down the virtual machine, moves it to a new node, and powers it back on. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginRedeployWithoutPollingWithResponseAsync(String resourceGroupName, String vmName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2019-12-01"; - return FluxUtil - .withContext( - context -> - service - .beginRedeployWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - vmName, - apiVersion, - this.client.getSubscriptionId(), - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Shuts down the virtual machine, moves it to a new node, and powers it back on. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginRedeployWithoutPollingWithResponseAsync( - String resourceGroupName, String vmName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2019-12-01"; - return service - .beginRedeployWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - vmName, - apiVersion, - this.client.getSubscriptionId(), - context); - } - - /** - * Shuts down the virtual machine, moves it to a new node, and powers it back on. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginRedeployWithoutPollingAsync(String resourceGroupName, String vmName) { - return beginRedeployWithoutPollingWithResponseAsync(resourceGroupName, vmName) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Shuts down the virtual machine, moves it to a new node, and powers it back on. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginRedeployWithoutPollingAsync(String resourceGroupName, String vmName, Context context) { - return beginRedeployWithoutPollingWithResponseAsync(resourceGroupName, vmName, context) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Shuts down the virtual machine, moves it to a new node, and powers it back on. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void beginRedeployWithoutPolling(String resourceGroupName, String vmName) { - beginRedeployWithoutPollingAsync(resourceGroupName, vmName).block(); - } - - /** - * Shuts down the virtual machine, moves it to a new node, and powers it back on. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void beginRedeployWithoutPolling(String resourceGroupName, String vmName, Context context) { - beginRedeployWithoutPollingAsync(resourceGroupName, vmName, context).block(); - } - - /** - * Reimages the virtual machine which has an ephemeral OS disk back to its initial state. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param tempDisk Specifies whether to reimage temp disk. Default value: false. Note: This temp disk reimage - * parameter is only supported for VM/VMSS with Ephemeral OS disk. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginReimageWithoutPollingWithResponseAsync( - String resourceGroupName, String vmName, Boolean tempDisk) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2019-12-01"; - VirtualMachineReimageParameters parametersInternal = null; - if (tempDisk != null) { - parametersInternal = new VirtualMachineReimageParameters(); - parametersInternal.withTempDisk(tempDisk); - } - VirtualMachineReimageParameters parameters = parametersInternal; - return FluxUtil - .withContext( - context -> - service - .beginReimageWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - vmName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Reimages the virtual machine which has an ephemeral OS disk back to its initial state. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param tempDisk Specifies whether to reimage temp disk. Default value: false. Note: This temp disk reimage - * parameter is only supported for VM/VMSS with Ephemeral OS disk. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginReimageWithoutPollingWithResponseAsync( - String resourceGroupName, String vmName, Boolean tempDisk, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2019-12-01"; - VirtualMachineReimageParameters parametersInternal = null; - if (tempDisk != null) { - parametersInternal = new VirtualMachineReimageParameters(); - parametersInternal.withTempDisk(tempDisk); - } - VirtualMachineReimageParameters parameters = parametersInternal; - return service - .beginReimageWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - vmName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - context); - } - - /** - * Reimages the virtual machine which has an ephemeral OS disk back to its initial state. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param tempDisk Specifies whether to reimage temp disk. Default value: false. Note: This temp disk reimage - * parameter is only supported for VM/VMSS with Ephemeral OS disk. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginReimageWithoutPollingAsync(String resourceGroupName, String vmName, Boolean tempDisk) { - return beginReimageWithoutPollingWithResponseAsync(resourceGroupName, vmName, tempDisk) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Reimages the virtual machine which has an ephemeral OS disk back to its initial state. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param tempDisk Specifies whether to reimage temp disk. Default value: false. Note: This temp disk reimage - * parameter is only supported for VM/VMSS with Ephemeral OS disk. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginReimageWithoutPollingAsync( - String resourceGroupName, String vmName, Boolean tempDisk, Context context) { - return beginReimageWithoutPollingWithResponseAsync(resourceGroupName, vmName, tempDisk, context) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Reimages the virtual machine which has an ephemeral OS disk back to its initial state. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param tempDisk Specifies whether to reimage temp disk. Default value: false. Note: This temp disk reimage - * parameter is only supported for VM/VMSS with Ephemeral OS disk. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void beginReimageWithoutPolling(String resourceGroupName, String vmName, Boolean tempDisk) { - beginReimageWithoutPollingAsync(resourceGroupName, vmName, tempDisk).block(); - } - - /** - * Reimages the virtual machine which has an ephemeral OS disk back to its initial state. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param tempDisk Specifies whether to reimage temp disk. Default value: false. Note: This temp disk reimage - * parameter is only supported for VM/VMSS with Ephemeral OS disk. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void beginReimageWithoutPolling(String resourceGroupName, String vmName, Boolean tempDisk, Context context) { - beginReimageWithoutPollingAsync(resourceGroupName, vmName, tempDisk, context).block(); - } - - /** - * The operation to perform maintenance on a virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginPerformMaintenanceWithoutPollingWithResponseAsync( - String resourceGroupName, String vmName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2019-12-01"; - return FluxUtil - .withContext( - context -> - service - .beginPerformMaintenanceWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - vmName, - apiVersion, - this.client.getSubscriptionId(), - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * The operation to perform maintenance on a virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginPerformMaintenanceWithoutPollingWithResponseAsync( - String resourceGroupName, String vmName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2019-12-01"; - return service - .beginPerformMaintenanceWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - vmName, - apiVersion, - this.client.getSubscriptionId(), - context); - } - - /** - * The operation to perform maintenance on a virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginPerformMaintenanceWithoutPollingAsync(String resourceGroupName, String vmName) { - return beginPerformMaintenanceWithoutPollingWithResponseAsync(resourceGroupName, vmName) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * The operation to perform maintenance on a virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginPerformMaintenanceWithoutPollingAsync( - String resourceGroupName, String vmName, Context context) { - return beginPerformMaintenanceWithoutPollingWithResponseAsync(resourceGroupName, vmName, context) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * The operation to perform maintenance on a virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void beginPerformMaintenanceWithoutPolling(String resourceGroupName, String vmName) { - beginPerformMaintenanceWithoutPollingAsync(resourceGroupName, vmName).block(); - } - - /** - * The operation to perform maintenance on a virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void beginPerformMaintenanceWithoutPolling(String resourceGroupName, String vmName, Context context) { - beginPerformMaintenanceWithoutPollingAsync(resourceGroupName, vmName, context).block(); - } - - /** - * Run command on the VM. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param parameters Capture Virtual Machine parameters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginRunCommandWithoutPollingWithResponseAsync( - String resourceGroupName, String vmName, RunCommandInput parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2019-12-01"; - return FluxUtil - .withContext( - context -> - service - .beginRunCommandWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - vmName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Run command on the VM. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param parameters Capture Virtual Machine parameters. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginRunCommandWithoutPollingWithResponseAsync( - String resourceGroupName, String vmName, RunCommandInput parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (vmName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2019-12-01"; - return service - .beginRunCommandWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - vmName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - context); - } - - /** - * Run command on the VM. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param parameters Capture Virtual Machine parameters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginRunCommandWithoutPollingAsync( - String resourceGroupName, String vmName, RunCommandInput parameters) { - return beginRunCommandWithoutPollingWithResponseAsync(resourceGroupName, vmName, parameters) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Run command on the VM. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param parameters Capture Virtual Machine parameters. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginRunCommandWithoutPollingAsync( - String resourceGroupName, String vmName, RunCommandInput parameters, Context context) { - return beginRunCommandWithoutPollingWithResponseAsync(resourceGroupName, vmName, parameters, context) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Run command on the VM. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param parameters Capture Virtual Machine parameters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public RunCommandResultInner beginRunCommandWithoutPolling( - String resourceGroupName, String vmName, RunCommandInput parameters) { - return beginRunCommandWithoutPollingAsync(resourceGroupName, vmName, parameters).block(); - } - - /** - * Run command on the VM. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param parameters Capture Virtual Machine parameters. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public RunCommandResultInner beginRunCommandWithoutPolling( - String resourceGroupName, String vmName, RunCommandInput parameters, Context context) { - return beginRunCommandWithoutPollingAsync(resourceGroupName, vmName, parameters, context).block(); - } - /** * Get the next page of items. * @@ -7808,6 +5234,7 @@ public Mono> listByLocationNextSinglePageAsyn if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listByLocationNext(nextLink, context) .map( @@ -7864,6 +5291,7 @@ public Mono> listNextSinglePageAsync(String n if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listNext(nextLink, context) .map( @@ -7920,6 +5348,7 @@ public Mono> listAllNextSinglePageAsync(Strin if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listAllNext(nextLink, context) .map( diff --git a/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/inner/VirtualMachineExtensionInner.java b/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/inner/VirtualMachineExtensionInner.java index bf453696b5465..cbb3732b6fd0e 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/inner/VirtualMachineExtensionInner.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/inner/VirtualMachineExtensionInner.java @@ -121,8 +121,8 @@ public VirtualMachineExtensionInner withPublisher(String publisher) { } /** - * Get the virtualMachineExtensionType property: Specifies the type of the extension; an example is - * "CustomScriptExtension". + * Get the virtualMachineExtensionType property: + * Specifies the type of the extension; an example is "CustomScriptExtension". * * @return the virtualMachineExtensionType value. */ @@ -131,8 +131,8 @@ public String virtualMachineExtensionType() { } /** - * Set the virtualMachineExtensionType property: Specifies the type of the extension; an example is - * "CustomScriptExtension". + * Set the virtualMachineExtensionType property: + * Specifies the type of the extension; an example is "CustomScriptExtension". * * @param virtualMachineExtensionType the virtualMachineExtensionType value to set. * @return the VirtualMachineExtensionInner object itself. diff --git a/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/inner/VirtualMachineScaleSetExtensionInner.java b/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/inner/VirtualMachineScaleSetExtensionInner.java index 973a0a9948d95..14894df3dc4c1 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/inner/VirtualMachineScaleSetExtensionInner.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/inner/VirtualMachineScaleSetExtensionInner.java @@ -24,6 +24,12 @@ public class VirtualMachineScaleSetExtensionInner extends SubResourceReadOnly { @JsonProperty(value = "name") private String name; +// /* +// * Resource type +// */ +// @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) +// private String type; + /* * If a value is provided and is different from the previous value, the * extension handler will be forced to update even if the extension @@ -106,6 +112,15 @@ public VirtualMachineScaleSetExtensionInner withName(String name) { return this; } +// /** +// * Get the type property: Resource type. +// * +// * @return the type value. +// */ +// public String type() { +// return this.type; +// } + /** * Get the forceUpdateTag property: If a value is provided and is different from the previous value, the extension * handler will be forced to update even if the extension configuration has not changed. diff --git a/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/models/ApiError.java b/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/models/ApiError.java index c608fd9302f3e..0c468859d0f2e 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/models/ApiError.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/models/ApiError.java @@ -36,8 +36,5 @@ public InnerError getInnererror() { * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (innererror != null) { - innererror.validate(); - } } } diff --git a/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/models/DiffDiskOptions.java b/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/models/DiffDiskOptions.java index fb29c6580f571..0548c706432f3 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/models/DiffDiskOptions.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/models/DiffDiskOptions.java @@ -4,41 +4,28 @@ package com.azure.resourcemanager.compute.models; +import com.azure.core.util.ExpandableStringEnum; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Collection; /** Defines values for DiffDiskOptions. */ -public enum DiffDiskOptions { - /** Enum value Local. */ - LOCAL("Local"); - - /** The actual serialized value for a DiffDiskOptions instance. */ - private final String value; - - DiffDiskOptions(String value) { - this.value = value; - } +public final class DiffDiskOptions extends ExpandableStringEnum { + /** Static value Local for DiffDiskOptions. */ + public static final DiffDiskOptions LOCAL = fromString("Local"); /** - * Parses a serialized value to a DiffDiskOptions instance. + * Creates or finds a DiffDiskOptions from its string representation. * - * @param value the serialized value to parse. - * @return the parsed DiffDiskOptions object, or null if unable to parse. + * @param name a name to look for. + * @return the corresponding DiffDiskOptions. */ @JsonCreator - public static DiffDiskOptions fromString(String value) { - DiffDiskOptions[] items = DiffDiskOptions.values(); - for (DiffDiskOptions item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; + public static DiffDiskOptions fromString(String name) { + return fromString(name, DiffDiskOptions.class); } - @JsonValue - @Override - public String toString() { - return this.value; + /** @return known DiffDiskOptions values. */ + public static Collection values() { + return values(DiffDiskOptions.class); } } diff --git a/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/models/DiskEncryptionSetIdentityType.java b/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/models/DiskEncryptionSetIdentityType.java index 76ab87d2b1df4..d298d05950ccd 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/models/DiskEncryptionSetIdentityType.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/models/DiskEncryptionSetIdentityType.java @@ -4,41 +4,28 @@ package com.azure.resourcemanager.compute.models; +import com.azure.core.util.ExpandableStringEnum; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Collection; /** Defines values for DiskEncryptionSetIdentityType. */ -public enum DiskEncryptionSetIdentityType { - /** Enum value SystemAssigned. */ - SYSTEM_ASSIGNED("SystemAssigned"); - - /** The actual serialized value for a DiskEncryptionSetIdentityType instance. */ - private final String value; - - DiskEncryptionSetIdentityType(String value) { - this.value = value; - } +public final class DiskEncryptionSetIdentityType extends ExpandableStringEnum { + /** Static value SystemAssigned for DiskEncryptionSetIdentityType. */ + public static final DiskEncryptionSetIdentityType SYSTEM_ASSIGNED = fromString("SystemAssigned"); /** - * Parses a serialized value to a DiskEncryptionSetIdentityType instance. + * Creates or finds a DiskEncryptionSetIdentityType from its string representation. * - * @param value the serialized value to parse. - * @return the parsed DiskEncryptionSetIdentityType object, or null if unable to parse. + * @param name a name to look for. + * @return the corresponding DiskEncryptionSetIdentityType. */ @JsonCreator - public static DiskEncryptionSetIdentityType fromString(String value) { - DiskEncryptionSetIdentityType[] items = DiskEncryptionSetIdentityType.values(); - for (DiskEncryptionSetIdentityType item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; + public static DiskEncryptionSetIdentityType fromString(String name) { + return fromString(name, DiskEncryptionSetIdentityType.class); } - @JsonValue - @Override - public String toString() { - return this.value; + /** @return known DiskEncryptionSetIdentityType values. */ + public static Collection values() { + return values(DiskEncryptionSetIdentityType.class); } } diff --git a/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/models/OrchestrationServiceNames.java b/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/models/OrchestrationServiceNames.java index 0fc0f8b8babd9..c730074517558 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/models/OrchestrationServiceNames.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/models/OrchestrationServiceNames.java @@ -4,41 +4,28 @@ package com.azure.resourcemanager.compute.models; +import com.azure.core.util.ExpandableStringEnum; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Collection; /** Defines values for OrchestrationServiceNames. */ -public enum OrchestrationServiceNames { - /** Enum value AutomaticRepairs. */ - AUTOMATIC_REPAIRS("AutomaticRepairs"); - - /** The actual serialized value for a OrchestrationServiceNames instance. */ - private final String value; - - OrchestrationServiceNames(String value) { - this.value = value; - } +public final class OrchestrationServiceNames extends ExpandableStringEnum { + /** Static value AutomaticRepairs for OrchestrationServiceNames. */ + public static final OrchestrationServiceNames AUTOMATIC_REPAIRS = fromString("AutomaticRepairs"); /** - * Parses a serialized value to a OrchestrationServiceNames instance. + * Creates or finds a OrchestrationServiceNames from its string representation. * - * @param value the serialized value to parse. - * @return the parsed OrchestrationServiceNames object, or null if unable to parse. + * @param name a name to look for. + * @return the corresponding OrchestrationServiceNames. */ @JsonCreator - public static OrchestrationServiceNames fromString(String value) { - OrchestrationServiceNames[] items = OrchestrationServiceNames.values(); - for (OrchestrationServiceNames item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; + public static OrchestrationServiceNames fromString(String name) { + return fromString(name, OrchestrationServiceNames.class); } - @JsonValue - @Override - public String toString() { - return this.value; + /** @return known OrchestrationServiceNames values. */ + public static Collection values() { + return values(OrchestrationServiceNames.class); } } diff --git a/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/models/OrchestrationServiceStateInput.java b/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/models/OrchestrationServiceStateInput.java index 048beb2f72fc0..f07747103629a 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/models/OrchestrationServiceStateInput.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/models/OrchestrationServiceStateInput.java @@ -18,7 +18,7 @@ public final class OrchestrationServiceStateInput { * The name of the service. */ @JsonProperty(value = "serviceName", required = true) - private String serviceName; + private OrchestrationServiceNames serviceName; /* * The action to be performed. @@ -26,17 +26,12 @@ public final class OrchestrationServiceStateInput { @JsonProperty(value = "action", required = true) private OrchestrationServiceStateAction action; - /** Creates an instance of OrchestrationServiceStateInput class. */ - public OrchestrationServiceStateInput() { - serviceName = "AutomaticRepairs"; - } - /** * Get the serviceName property: The name of the service. * * @return the serviceName value. */ - public String serviceName() { + public OrchestrationServiceNames serviceName() { return this.serviceName; } @@ -46,7 +41,7 @@ public String serviceName() { * @param serviceName the serviceName value to set. * @return the OrchestrationServiceStateInput object itself. */ - public OrchestrationServiceStateInput withServiceName(String serviceName) { + public OrchestrationServiceStateInput withServiceName(OrchestrationServiceNames serviceName) { this.serviceName = serviceName; return this; } @@ -77,6 +72,12 @@ public OrchestrationServiceStateInput withAction(OrchestrationServiceStateAction * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { + if (serviceName() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property serviceName in model OrchestrationServiceStateInput")); + } if (action() == null) { throw logger .logExceptionAsError( diff --git a/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/models/ReplicationStatusTypes.java b/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/models/ReplicationStatusTypes.java index 6adaaf9ea66c1..19f17e12b6be3 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/models/ReplicationStatusTypes.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/models/ReplicationStatusTypes.java @@ -4,41 +4,28 @@ package com.azure.resourcemanager.compute.models; +import com.azure.core.util.ExpandableStringEnum; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Collection; /** Defines values for ReplicationStatusTypes. */ -public enum ReplicationStatusTypes { - /** Enum value ReplicationStatus. */ - REPLICATION_STATUS("ReplicationStatus"); - - /** The actual serialized value for a ReplicationStatusTypes instance. */ - private final String value; - - ReplicationStatusTypes(String value) { - this.value = value; - } +public final class ReplicationStatusTypes extends ExpandableStringEnum { + /** Static value ReplicationStatus for ReplicationStatusTypes. */ + public static final ReplicationStatusTypes REPLICATION_STATUS = fromString("ReplicationStatus"); /** - * Parses a serialized value to a ReplicationStatusTypes instance. + * Creates or finds a ReplicationStatusTypes from its string representation. * - * @param value the serialized value to parse. - * @return the parsed ReplicationStatusTypes object, or null if unable to parse. + * @param name a name to look for. + * @return the corresponding ReplicationStatusTypes. */ @JsonCreator - public static ReplicationStatusTypes fromString(String value) { - ReplicationStatusTypes[] items = ReplicationStatusTypes.values(); - for (ReplicationStatusTypes item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; + public static ReplicationStatusTypes fromString(String name) { + return fromString(name, ReplicationStatusTypes.class); } - @JsonValue - @Override - public String toString() { - return this.value; + /** @return known ReplicationStatusTypes values. */ + public static Collection values() { + return values(ReplicationStatusTypes.class); } } diff --git a/sdk/resources/mgmt/src/main/java/com/azure/resourcemanager/resources/fluentcore/AzureServiceClient.java b/sdk/resources/mgmt/src/main/java/com/azure/resourcemanager/resources/fluentcore/AzureServiceClient.java index 9ec1a0f8ac038..35c6193d74c46 100644 --- a/sdk/resources/mgmt/src/main/java/com/azure/resourcemanager/resources/fluentcore/AzureServiceClient.java +++ b/sdk/resources/mgmt/src/main/java/com/azure/resourcemanager/resources/fluentcore/AzureServiceClient.java @@ -37,6 +37,7 @@ import java.time.format.DateTimeFormatter; import java.time.temporal.TemporalAccessor; import java.time.temporal.TemporalQueries; +import java.util.Map; /** * ServiceClient is the abstraction for accessing REST operations and their payload data types. @@ -102,6 +103,19 @@ public Context getContext() { return context; } + /** + * Merges default client context with provided context. + * + * @param context the context to be merged with default client context. + * @return the merged context. + */ + public Context mergeContext(Context context) { + for (Map.Entry entry : this.getContext().getValues().entrySet()) { + context = context.addData(entry.getKey(), entry.getValue()); + } + return context; + } + /** * Gets long running operation result. * From b26c0dadfd7554d47dcecf2fd462e86f89ef4fe1 Mon Sep 17 00:00:00 2001 From: Rujun Chen Date: Mon, 13 Jul 2020 13:48:14 +0800 Subject: [PATCH 099/129] add correlation id back when use msal (#13070) Co-authored-by: Xiaolu Dai --- .../spring/autoconfigure/aad/AzureADGraphClient.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/sdk/spring/azure-spring-boot/src/main/java/com/microsoft/azure/spring/autoconfigure/aad/AzureADGraphClient.java b/sdk/spring/azure-spring-boot/src/main/java/com/microsoft/azure/spring/autoconfigure/aad/AzureADGraphClient.java index 500d96d3aa29f..abd5cbf428f06 100644 --- a/sdk/spring/azure-spring-boot/src/main/java/com/microsoft/azure/spring/autoconfigure/aad/AzureADGraphClient.java +++ b/sdk/spring/azure-spring-boot/src/main/java/com/microsoft/azure/spring/autoconfigure/aad/AzureADGraphClient.java @@ -34,6 +34,7 @@ import java.util.LinkedHashSet; import java.util.List; import java.util.Set; +import java.util.UUID; import java.util.concurrent.CompletableFuture; import java.util.concurrent.ExecutionException; import java.util.concurrent.ExecutorService; @@ -51,6 +52,8 @@ public class AzureADGraphClient { private static final String DEFAULT_ROLE_PREFIX = "ROLE_"; private static final String MICROSOFT_GRAPH_SCOPE = "https://graph.microsoft.com/user.read"; private static final String AAD_GRAPH_API_SCOPE = "https://graph.windows.net/user.read"; + // We use "aadfeed5" as suffix when client library is ADAL, upgrade to "aadfeed6" for MSAL + private static final String REQUEST_ID_SUFFIX = "aadfeed6"; private final String clientId; private final String clientSecret; @@ -206,6 +209,7 @@ public IAuthenticationResult acquireTokenForGraphApi(String idToken, String tena final ConfidentialClientApplication application = ConfidentialClientApplication .builder(clientId, clientCredential) .authority(serviceEndpoints.getAadSigninUri() + tenantId + "/") + .correlationId(getCorrelationId()) .build(); final Set scopes = new HashSet<>(); @@ -238,4 +242,9 @@ public IAuthenticationResult acquireTokenForGraphApi(String idToken, String tena } return result; } + + private static String getCorrelationId() { + final String uuid = UUID.randomUUID().toString(); + return uuid.substring(0, uuid.length() - REQUEST_ID_SUFFIX.length()) + REQUEST_ID_SUFFIX; + } } From 90d84ab34d15a16e28e7f446578fc797550182e7 Mon Sep 17 00:00:00 2001 From: Chuang <54572251+xccc-msft@users.noreply.github.com> Date: Mon, 13 Jul 2020 14:55:03 +0800 Subject: [PATCH 100/129] Kusto: generate package-2020-06-14 (#13071) * update kusto module * generate package-2020-06-14 * fix compile errors --- eng/mgmt/api-specs.json | 8 +- sdk/kusto/mgmt-v2020_06_14/pom.xml | 135 + .../AttachedDatabaseConfiguration.java | 179 ++ .../AttachedDatabaseConfigurations.java | 53 + .../kusto/v2020_06_14/AzureCapacity.java | 121 + .../v2020_06_14/AzureEntityResource.java | 34 + .../kusto/v2020_06_14/AzureResourceSku.java | 35 + .../kusto/v2020_06_14/AzureScaleType.java | 44 + .../kusto/v2020_06_14/AzureSku.java | 103 + .../kusto/v2020_06_14/AzureSkuName.java | 98 + .../kusto/v2020_06_14/AzureSkuTier.java | 41 + .../v2020_06_14/BlobStorageEventType.java | 41 + .../kusto/v2020_06_14/CheckNameRequest.java | 71 + .../kusto/v2020_06_14/CheckNameResult.java | 40 + .../management/kusto/v2020_06_14/Cluster.java | 406 +++ .../v2020_06_14/ClusterCheckNameRequest.java | 77 + .../ClusterPrincipalAssignment.java | 183 ++ ...erPrincipalAssignmentCheckNameRequest.java | 77 + .../ClusterPrincipalAssignments.java | 64 + .../v2020_06_14/ClusterPrincipalRole.java | 41 + .../kusto/v2020_06_14/ClusterUpdate.java | 427 +++ .../kusto/v2020_06_14/Clusters.java | 137 + .../kusto/v2020_06_14/Compression.java | 41 + .../kusto/v2020_06_14/DataConnection.java | 118 + .../DataConnectionCheckNameRequest.java | 78 + .../v2020_06_14/DataConnectionValidation.java | 70 + .../DataConnectionValidationListResult.java | 26 + .../DataConnectionValidationResult.java | 43 + .../kusto/v2020_06_14/DataConnections.java | 80 + .../kusto/v2020_06_14/Database.java | 117 + .../kusto/v2020_06_14/DatabasePrincipal.java | 55 + .../DatabasePrincipalAssignment.java | 184 ++ ...sePrincipalAssignmentCheckNameRequest.java | 78 + .../DatabasePrincipalAssignments.java | 68 + .../DatabasePrincipalListRequest.java | 45 + .../DatabasePrincipalListResult.java | 27 + .../v2020_06_14/DatabasePrincipalRole.java | 53 + .../v2020_06_14/DatabasePrincipalType.java | 44 + .../kusto/v2020_06_14/DatabaseStatistics.java | 44 + .../kusto/v2020_06_14/Databases.java | 97 + .../DefaultPrincipalsModificationKind.java | 44 + .../DiagnoseVirtualNetworkResult.java | 26 + .../v2020_06_14/EventGridDataConnection.java | 239 ++ .../v2020_06_14/EventGridDataFormat.java | 83 + .../v2020_06_14/EventHubDataConnection.java | 213 ++ .../kusto/v2020_06_14/EventHubDataFormat.java | 83 + .../FollowerDatabaseDefinition.java | 35 + .../kusto/v2020_06_14/Identity.java | 102 + .../kusto/v2020_06_14/IdentityType.java | 53 + .../IdentityUserAssignedIdentitiesValue.java | 47 + .../v2020_06_14/IotHubDataConnection.java | 212 ++ .../kusto/v2020_06_14/IotHubDataFormat.java | 83 + .../kusto/v2020_06_14/KeyVaultProperties.java | 95 + .../kusto/v2020_06_14/LanguageExtension.java | 25 + .../v2020_06_14/LanguageExtensionName.java | 41 + .../v2020_06_14/LanguageExtensionsList.java | 45 + .../kusto/v2020_06_14/Operation.java | 40 + .../kusto/v2020_06_14/OperationDisplay.java | 122 + .../kusto/v2020_06_14/Operations.java | 27 + .../kusto/v2020_06_14/OptimizedAutoscale.java | 122 + .../kusto/v2020_06_14/PrincipalType.java | 44 + .../PrincipalsModificationKind.java | 44 + .../kusto/v2020_06_14/ProvisioningState.java | 53 + .../ReadOnlyFollowingDatabase.java | 155 + .../kusto/v2020_06_14/ReadWriteDatabase.java | 135 + .../management/kusto/v2020_06_14/Reason.java | 41 + .../kusto/v2020_06_14/SkuDescription.java | 51 + .../v2020_06_14/SkuLocationInfoItem.java | 70 + .../management/kusto/v2020_06_14/State.java | 62 + .../v2020_06_14/TrustedExternalTenant.java | 43 + .../management/kusto/v2020_06_14/Type.java | 53 + .../VirtualNetworkConfiguration.java | 95 + .../AttachedDatabaseConfigurationImpl.java | 151 + .../AttachedDatabaseConfigurationInner.java | 162 + .../AttachedDatabaseConfigurationsImpl.java | 85 + .../AttachedDatabaseConfigurationsInner.java | 625 ++++ .../implementation/AzureResourceSkuImpl.java | 47 + .../implementation/AzureResourceSkuInner.java | 97 + .../implementation/CheckNameResultImpl.java | 47 + .../implementation/CheckNameResultInner.java | 124 + .../implementation/ClusterImpl.java | 268 ++ .../implementation/ClusterInner.java | 409 +++ .../ClusterPrincipalAssignmentImpl.java | 156 + .../ClusterPrincipalAssignmentInner.java | 175 ++ .../ClusterPrincipalAssignmentsImpl.java | 98 + .../ClusterPrincipalAssignmentsInner.java | 725 +++++ .../implementation/ClustersImpl.java | 275 ++ .../implementation/ClustersInner.java | 2647 +++++++++++++++++ .../implementation/DataConnectionImpl.java | 108 + .../implementation/DataConnectionInner.java | 57 + ...ataConnectionValidationListResultImpl.java | 33 + ...taConnectionValidationListResultInner.java | 45 + .../implementation/DataConnectionsImpl.java | 112 + .../implementation/DataConnectionsInner.java | 1182 ++++++++ .../implementation/DatabaseImpl.java | 105 + .../implementation/DatabaseInner.java | 55 + .../DatabasePrincipalAssignmentImpl.java | 159 + .../DatabasePrincipalAssignmentInner.java | 175 ++ .../DatabasePrincipalAssignmentsImpl.java | 98 + .../DatabasePrincipalAssignmentsInner.java | 774 +++++ .../implementation/DatabasePrincipalImpl.java | 63 + .../DatabasePrincipalInner.java | 192 ++ .../DatabasePrincipalListResultImpl.java | 32 + .../DatabasePrincipalListResultInner.java | 44 + .../implementation/DatabasesImpl.java | 143 + .../implementation/DatabasesInner.java | 1410 +++++++++ .../DiagnoseVirtualNetworkResultImpl.java | 32 + .../DiagnoseVirtualNetworkResultInner.java | 44 + .../FollowerDatabaseDefinitionImpl.java | 41 + .../FollowerDatabaseDefinitionInner.java | 87 + .../implementation/IdParsingUtils.java | 57 + .../KustoManagementClientImpl.java | 282 ++ .../implementation/KustoManager.java | 171 ++ .../implementation/LanguageExtensionImpl.java | 32 + .../LanguageExtensionInner.java | 44 + .../implementation/OperationImpl.java | 47 + .../implementation/OperationInner.java | 123 + .../implementation/OperationsImpl.java | 49 + .../implementation/OperationsInner.java | 283 ++ .../v2020_06_14/implementation/PageImpl.java | 75 + .../v2020_06_14/implementation/PageImpl1.java | 75 + .../implementation/SkuDescriptionImpl.java | 58 + .../implementation/SkuDescriptionInner.java | 109 + .../implementation/package-info.java | 11 + .../kusto/v2020_06_14/package-info.java | 11 + sdk/kusto/pom.mgmt.xml | 1 + 126 files changed, 18772 insertions(+), 4 deletions(-) create mode 100644 sdk/kusto/mgmt-v2020_06_14/pom.xml create mode 100644 sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/AttachedDatabaseConfiguration.java create mode 100644 sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/AttachedDatabaseConfigurations.java create mode 100644 sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/AzureCapacity.java create mode 100644 sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/AzureEntityResource.java create mode 100644 sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/AzureResourceSku.java create mode 100644 sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/AzureScaleType.java create mode 100644 sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/AzureSku.java create mode 100644 sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/AzureSkuName.java create mode 100644 sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/AzureSkuTier.java create mode 100644 sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/BlobStorageEventType.java create mode 100644 sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/CheckNameRequest.java create mode 100644 sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/CheckNameResult.java create mode 100644 sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/Cluster.java create mode 100644 sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/ClusterCheckNameRequest.java create mode 100644 sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/ClusterPrincipalAssignment.java create mode 100644 sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/ClusterPrincipalAssignmentCheckNameRequest.java create mode 100644 sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/ClusterPrincipalAssignments.java create mode 100644 sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/ClusterPrincipalRole.java create mode 100644 sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/ClusterUpdate.java create mode 100644 sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/Clusters.java create mode 100644 sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/Compression.java create mode 100644 sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/DataConnection.java create mode 100644 sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/DataConnectionCheckNameRequest.java create mode 100644 sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/DataConnectionValidation.java create mode 100644 sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/DataConnectionValidationListResult.java create mode 100644 sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/DataConnectionValidationResult.java create mode 100644 sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/DataConnections.java create mode 100644 sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/Database.java create mode 100644 sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/DatabasePrincipal.java create mode 100644 sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/DatabasePrincipalAssignment.java create mode 100644 sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/DatabasePrincipalAssignmentCheckNameRequest.java create mode 100644 sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/DatabasePrincipalAssignments.java create mode 100644 sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/DatabasePrincipalListRequest.java create mode 100644 sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/DatabasePrincipalListResult.java create mode 100644 sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/DatabasePrincipalRole.java create mode 100644 sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/DatabasePrincipalType.java create mode 100644 sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/DatabaseStatistics.java create mode 100644 sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/Databases.java create mode 100644 sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/DefaultPrincipalsModificationKind.java create mode 100644 sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/DiagnoseVirtualNetworkResult.java create mode 100644 sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/EventGridDataConnection.java create mode 100644 sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/EventGridDataFormat.java create mode 100644 sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/EventHubDataConnection.java create mode 100644 sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/EventHubDataFormat.java create mode 100644 sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/FollowerDatabaseDefinition.java create mode 100644 sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/Identity.java create mode 100644 sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/IdentityType.java create mode 100644 sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/IdentityUserAssignedIdentitiesValue.java create mode 100644 sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/IotHubDataConnection.java create mode 100644 sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/IotHubDataFormat.java create mode 100644 sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/KeyVaultProperties.java create mode 100644 sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/LanguageExtension.java create mode 100644 sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/LanguageExtensionName.java create mode 100644 sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/LanguageExtensionsList.java create mode 100644 sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/Operation.java create mode 100644 sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/OperationDisplay.java create mode 100644 sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/Operations.java create mode 100644 sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/OptimizedAutoscale.java create mode 100644 sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/PrincipalType.java create mode 100644 sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/PrincipalsModificationKind.java create mode 100644 sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/ProvisioningState.java create mode 100644 sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/ReadOnlyFollowingDatabase.java create mode 100644 sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/ReadWriteDatabase.java create mode 100644 sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/Reason.java create mode 100644 sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/SkuDescription.java create mode 100644 sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/SkuLocationInfoItem.java create mode 100644 sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/State.java create mode 100644 sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/TrustedExternalTenant.java create mode 100644 sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/Type.java create mode 100644 sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/VirtualNetworkConfiguration.java create mode 100644 sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/implementation/AttachedDatabaseConfigurationImpl.java create mode 100644 sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/implementation/AttachedDatabaseConfigurationInner.java create mode 100644 sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/implementation/AttachedDatabaseConfigurationsImpl.java create mode 100644 sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/implementation/AttachedDatabaseConfigurationsInner.java create mode 100644 sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/implementation/AzureResourceSkuImpl.java create mode 100644 sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/implementation/AzureResourceSkuInner.java create mode 100644 sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/implementation/CheckNameResultImpl.java create mode 100644 sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/implementation/CheckNameResultInner.java create mode 100644 sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/implementation/ClusterImpl.java create mode 100644 sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/implementation/ClusterInner.java create mode 100644 sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/implementation/ClusterPrincipalAssignmentImpl.java create mode 100644 sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/implementation/ClusterPrincipalAssignmentInner.java create mode 100644 sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/implementation/ClusterPrincipalAssignmentsImpl.java create mode 100644 sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/implementation/ClusterPrincipalAssignmentsInner.java create mode 100644 sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/implementation/ClustersImpl.java create mode 100644 sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/implementation/ClustersInner.java create mode 100644 sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/implementation/DataConnectionImpl.java create mode 100644 sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/implementation/DataConnectionInner.java create mode 100644 sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/implementation/DataConnectionValidationListResultImpl.java create mode 100644 sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/implementation/DataConnectionValidationListResultInner.java create mode 100644 sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/implementation/DataConnectionsImpl.java create mode 100644 sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/implementation/DataConnectionsInner.java create mode 100644 sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/implementation/DatabaseImpl.java create mode 100644 sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/implementation/DatabaseInner.java create mode 100644 sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/implementation/DatabasePrincipalAssignmentImpl.java create mode 100644 sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/implementation/DatabasePrincipalAssignmentInner.java create mode 100644 sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/implementation/DatabasePrincipalAssignmentsImpl.java create mode 100644 sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/implementation/DatabasePrincipalAssignmentsInner.java create mode 100644 sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/implementation/DatabasePrincipalImpl.java create mode 100644 sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/implementation/DatabasePrincipalInner.java create mode 100644 sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/implementation/DatabasePrincipalListResultImpl.java create mode 100644 sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/implementation/DatabasePrincipalListResultInner.java create mode 100644 sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/implementation/DatabasesImpl.java create mode 100644 sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/implementation/DatabasesInner.java create mode 100644 sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/implementation/DiagnoseVirtualNetworkResultImpl.java create mode 100644 sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/implementation/DiagnoseVirtualNetworkResultInner.java create mode 100644 sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/implementation/FollowerDatabaseDefinitionImpl.java create mode 100644 sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/implementation/FollowerDatabaseDefinitionInner.java create mode 100644 sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/implementation/IdParsingUtils.java create mode 100644 sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/implementation/KustoManagementClientImpl.java create mode 100644 sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/implementation/KustoManager.java create mode 100644 sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/implementation/LanguageExtensionImpl.java create mode 100644 sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/implementation/LanguageExtensionInner.java create mode 100644 sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/implementation/OperationImpl.java create mode 100644 sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/implementation/OperationInner.java create mode 100644 sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/implementation/OperationsImpl.java create mode 100644 sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/implementation/OperationsInner.java create mode 100644 sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/implementation/PageImpl.java create mode 100644 sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/implementation/PageImpl1.java create mode 100644 sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/implementation/SkuDescriptionImpl.java create mode 100644 sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/implementation/SkuDescriptionInner.java create mode 100644 sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/implementation/package-info.java create mode 100644 sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/package-info.java diff --git a/eng/mgmt/api-specs.json b/eng/mgmt/api-specs.json index a6ef3826a7923..51ef794352846 100644 --- a/eng/mgmt/api-specs.json +++ b/eng/mgmt/api-specs.json @@ -42,10 +42,6 @@ "source": "specification/vmware/resource-manager/readme.md", "args": "--multiapi --fluent" }, - "azure-kusto/resource-manager": { - "source": "specification/azure-kusto/resource-manager/readme.md", - "args": "--multiapi --fluent" - }, "azurestack/resource-manager": { "source": "specification/azurestack/resource-manager/readme.md", "args": "--multiapi --fluent" @@ -176,6 +172,10 @@ "source": "specification/kubernetesconfiguration/resource-manager/readme.md", "args": "--multiapi --fluent" }, + "kusto/resource-manager": { + "source": "specification/azure-kusto/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" diff --git a/sdk/kusto/mgmt-v2020_06_14/pom.xml b/sdk/kusto/mgmt-v2020_06_14/pom.xml new file mode 100644 index 0000000000000..959138e7e0767 --- /dev/null +++ b/sdk/kusto/mgmt-v2020_06_14/pom.xml @@ -0,0 +1,135 @@ + + + 4.0.0 + com.microsoft.azure.kusto.v2020_06_14 + + com.microsoft.azure + azure-arm-parent + 1.3.2 + ../../parents/azure-arm-parent/pom.xml + + azure-mgmt-kusto + 1.0.0-beta + jar + Microsoft Azure SDK for Kusto Management + This package contains Microsoft Kusto 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 + + 1.6.5 + + + + + + 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/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/AttachedDatabaseConfiguration.java b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/AttachedDatabaseConfiguration.java new file mode 100644 index 0000000000000..0f575b8b1d728 --- /dev/null +++ b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/AttachedDatabaseConfiguration.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.kusto.v2020_06_14; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.kusto.v2020_06_14.implementation.AttachedDatabaseConfigurationInner; +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.kusto.v2020_06_14.implementation.KustoManager; +import java.util.List; + +/** + * Type representing AttachedDatabaseConfiguration. + */ +public interface AttachedDatabaseConfiguration extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the attachedDatabaseNames value. + */ + List attachedDatabaseNames(); + + /** + * @return the clusterResourceId value. + */ + String clusterResourceId(); + + /** + * @return the databaseName value. + */ + String databaseName(); + + /** + * @return the defaultPrincipalsModificationKind value. + */ + DefaultPrincipalsModificationKind defaultPrincipalsModificationKind(); + + /** + * @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 type value. + */ + String type(); + + /** + * The entirety of the AttachedDatabaseConfiguration definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithCluster, DefinitionStages.WithClusterResourceId, DefinitionStages.WithDatabaseName, DefinitionStages.WithDefaultPrincipalsModificationKind, DefinitionStages.WithCreate { + } + + /** + * Grouping of AttachedDatabaseConfiguration definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a AttachedDatabaseConfiguration definition. + */ + interface Blank extends WithCluster { + } + + /** + * The stage of the attacheddatabaseconfiguration definition allowing to specify Cluster. + */ + interface WithCluster { + /** + * Specifies resourceGroupName, clusterName. + * @param resourceGroupName The name of the resource group containing the Kusto cluster + * @param clusterName The name of the Kusto cluster + * @return the next definition stage + */ + WithClusterResourceId withExistingCluster(String resourceGroupName, String clusterName); + } + + /** + * The stage of the attacheddatabaseconfiguration definition allowing to specify ClusterResourceId. + */ + interface WithClusterResourceId { + /** + * Specifies clusterResourceId. + * @param clusterResourceId The resource id of the cluster where the databases you would like to attach reside + * @return the next definition stage + */ + WithDatabaseName withClusterResourceId(String clusterResourceId); + } + + /** + * The stage of the attacheddatabaseconfiguration definition allowing to specify DatabaseName. + */ + interface WithDatabaseName { + /** + * Specifies databaseName. + * @param databaseName The name of the database which you would like to attach, use * if you want to follow all current and future databases + * @return the next definition stage + */ + WithDefaultPrincipalsModificationKind withDatabaseName(String databaseName); + } + + /** + * The stage of the attacheddatabaseconfiguration definition allowing to specify DefaultPrincipalsModificationKind. + */ + interface WithDefaultPrincipalsModificationKind { + /** + * Specifies defaultPrincipalsModificationKind. + * @param defaultPrincipalsModificationKind The default principals modification kind. Possible values include: 'Union', 'Replace', 'None' + * @return the next definition stage + */ + WithCreate withDefaultPrincipalsModificationKind(DefaultPrincipalsModificationKind defaultPrincipalsModificationKind); + } + + /** + * The stage of the attacheddatabaseconfiguration 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 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 { + } + } + /** + * The template for a AttachedDatabaseConfiguration update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithLocation { + } + + /** + * Grouping of AttachedDatabaseConfiguration update stages. + */ + interface UpdateStages { + /** + * The stage of the attacheddatabaseconfiguration update allowing to specify Location. + */ + interface WithLocation { + /** + * Specifies location. + * @param location Resource location + * @return the next update stage + */ + Update withLocation(String location); + } + + } +} diff --git a/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/AttachedDatabaseConfigurations.java b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/AttachedDatabaseConfigurations.java new file mode 100644 index 0000000000000..d23e3709362b0 --- /dev/null +++ b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/AttachedDatabaseConfigurations.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.kusto.v2020_06_14; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.kusto.v2020_06_14.implementation.AttachedDatabaseConfigurationsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing AttachedDatabaseConfigurations. + */ +public interface AttachedDatabaseConfigurations extends SupportsCreating, HasInner { + /** + * Returns an attached database configuration. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param attachedDatabaseConfigurationName The name of the attached database configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String clusterName, String attachedDatabaseConfigurationName); + + /** + * Returns the list of attached database configurations of the given Kusto cluster. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listByClusterAsync(String resourceGroupName, String clusterName); + + /** + * Deletes the attached database configuration with the given name. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param attachedDatabaseConfigurationName The name of the attached database configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String clusterName, String attachedDatabaseConfigurationName); + +} diff --git a/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/AzureCapacity.java b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/AzureCapacity.java new file mode 100644 index 0000000000000..f043f0f465af6 --- /dev/null +++ b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/AzureCapacity.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.kusto.v2020_06_14; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Azure capacity definition. + */ +public class AzureCapacity { + /** + * Scale type. Possible values include: 'automatic', 'manual', 'none'. + */ + @JsonProperty(value = "scaleType", required = true) + private AzureScaleType scaleType; + + /** + * Minimum allowed capacity. + */ + @JsonProperty(value = "minimum", required = true) + private int minimum; + + /** + * Maximum allowed capacity. + */ + @JsonProperty(value = "maximum", required = true) + private int maximum; + + /** + * The default capacity that would be used. + */ + @JsonProperty(value = "default", required = true) + private int defaultProperty; + + /** + * Get scale type. Possible values include: 'automatic', 'manual', 'none'. + * + * @return the scaleType value + */ + public AzureScaleType scaleType() { + return this.scaleType; + } + + /** + * Set scale type. Possible values include: 'automatic', 'manual', 'none'. + * + * @param scaleType the scaleType value to set + * @return the AzureCapacity object itself. + */ + public AzureCapacity withScaleType(AzureScaleType scaleType) { + this.scaleType = scaleType; + return this; + } + + /** + * Get minimum allowed capacity. + * + * @return the minimum value + */ + public int minimum() { + return this.minimum; + } + + /** + * Set minimum allowed capacity. + * + * @param minimum the minimum value to set + * @return the AzureCapacity object itself. + */ + public AzureCapacity withMinimum(int minimum) { + this.minimum = minimum; + return this; + } + + /** + * Get maximum allowed capacity. + * + * @return the maximum value + */ + public int maximum() { + return this.maximum; + } + + /** + * Set maximum allowed capacity. + * + * @param maximum the maximum value to set + * @return the AzureCapacity object itself. + */ + public AzureCapacity withMaximum(int maximum) { + this.maximum = maximum; + return this; + } + + /** + * Get the default capacity that would be used. + * + * @return the defaultProperty value + */ + public int defaultProperty() { + return this.defaultProperty; + } + + /** + * Set the default capacity that would be used. + * + * @param defaultProperty the defaultProperty value to set + * @return the AzureCapacity object itself. + */ + public AzureCapacity withDefaultProperty(int defaultProperty) { + this.defaultProperty = defaultProperty; + return this; + } + +} diff --git a/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/AzureEntityResource.java b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/AzureEntityResource.java new file mode 100644 index 0000000000000..6f9ba076afb51 --- /dev/null +++ b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/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.kusto.v2020_06_14; + +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/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/AzureResourceSku.java b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/AzureResourceSku.java new file mode 100644 index 0000000000000..69767fe377e43 --- /dev/null +++ b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/AzureResourceSku.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.kusto.v2020_06_14; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.kusto.v2020_06_14.implementation.AzureResourceSkuInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.kusto.v2020_06_14.implementation.KustoManager; + +/** + * Type representing AzureResourceSku. + */ +public interface AzureResourceSku extends HasInner, HasManager { + /** + * @return the capacity value. + */ + AzureCapacity capacity(); + + /** + * @return the resourceType value. + */ + String resourceType(); + + /** + * @return the sku value. + */ + AzureSku sku(); + +} diff --git a/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/AzureScaleType.java b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/AzureScaleType.java new file mode 100644 index 0000000000000..e05479f58c8c4 --- /dev/null +++ b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/AzureScaleType.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.kusto.v2020_06_14; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for AzureScaleType. + */ +public final class AzureScaleType extends ExpandableStringEnum { + /** Static value automatic for AzureScaleType. */ + public static final AzureScaleType AUTOMATIC = fromString("automatic"); + + /** Static value manual for AzureScaleType. */ + public static final AzureScaleType MANUAL = fromString("manual"); + + /** Static value none for AzureScaleType. */ + public static final AzureScaleType NONE = fromString("none"); + + /** + * Creates or finds a AzureScaleType from its string representation. + * @param name a name to look for + * @return the corresponding AzureScaleType + */ + @JsonCreator + public static AzureScaleType fromString(String name) { + return fromString(name, AzureScaleType.class); + } + + /** + * @return known AzureScaleType values + */ + public static Collection values() { + return values(AzureScaleType.class); + } +} diff --git a/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/AzureSku.java b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/AzureSku.java new file mode 100644 index 0000000000000..ee01e2ed1b4ac --- /dev/null +++ b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/AzureSku.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.kusto.v2020_06_14; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Azure SKU definition. + */ +public class AzureSku { + /** + * SKU name. Possible values include: 'Standard_DS13_v2+1TB_PS', + * 'Standard_DS13_v2+2TB_PS', 'Standard_DS14_v2+3TB_PS', + * 'Standard_DS14_v2+4TB_PS', 'Standard_D13_v2', 'Standard_D14_v2', + * 'Standard_L8s', 'Standard_L16s', 'Standard_D11_v2', 'Standard_D12_v2', + * 'Standard_L4s', 'Dev(No SLA)_Standard_D11_v2', 'Standard_E2a_v4', + * 'Standard_E4a_v4', 'Standard_E8a_v4', 'Standard_E16a_v4', + * 'Standard_E8as_v4+1TB_PS', 'Standard_E8as_v4+2TB_PS', + * 'Standard_E16as_v4+3TB_PS', 'Standard_E16as_v4+4TB_PS', 'Dev(No + * SLA)_Standard_E2a_v4'. + */ + @JsonProperty(value = "name", required = true) + private AzureSkuName name; + + /** + * The number of instances of the cluster. + */ + @JsonProperty(value = "capacity") + private Integer capacity; + + /** + * SKU tier. Possible values include: 'Basic', 'Standard'. + */ + @JsonProperty(value = "tier", required = true) + private AzureSkuTier tier; + + /** + * Get sKU name. Possible values include: 'Standard_DS13_v2+1TB_PS', 'Standard_DS13_v2+2TB_PS', 'Standard_DS14_v2+3TB_PS', 'Standard_DS14_v2+4TB_PS', 'Standard_D13_v2', 'Standard_D14_v2', 'Standard_L8s', 'Standard_L16s', 'Standard_D11_v2', 'Standard_D12_v2', 'Standard_L4s', 'Dev(No SLA)_Standard_D11_v2', 'Standard_E2a_v4', 'Standard_E4a_v4', 'Standard_E8a_v4', 'Standard_E16a_v4', 'Standard_E8as_v4+1TB_PS', 'Standard_E8as_v4+2TB_PS', 'Standard_E16as_v4+3TB_PS', 'Standard_E16as_v4+4TB_PS', 'Dev(No SLA)_Standard_E2a_v4'. + * + * @return the name value + */ + public AzureSkuName name() { + return this.name; + } + + /** + * Set sKU name. Possible values include: 'Standard_DS13_v2+1TB_PS', 'Standard_DS13_v2+2TB_PS', 'Standard_DS14_v2+3TB_PS', 'Standard_DS14_v2+4TB_PS', 'Standard_D13_v2', 'Standard_D14_v2', 'Standard_L8s', 'Standard_L16s', 'Standard_D11_v2', 'Standard_D12_v2', 'Standard_L4s', 'Dev(No SLA)_Standard_D11_v2', 'Standard_E2a_v4', 'Standard_E4a_v4', 'Standard_E8a_v4', 'Standard_E16a_v4', 'Standard_E8as_v4+1TB_PS', 'Standard_E8as_v4+2TB_PS', 'Standard_E16as_v4+3TB_PS', 'Standard_E16as_v4+4TB_PS', 'Dev(No SLA)_Standard_E2a_v4'. + * + * @param name the name value to set + * @return the AzureSku object itself. + */ + public AzureSku withName(AzureSkuName name) { + this.name = name; + return this; + } + + /** + * Get the number of instances of the cluster. + * + * @return the capacity value + */ + public Integer capacity() { + return this.capacity; + } + + /** + * Set the number of instances of the cluster. + * + * @param capacity the capacity value to set + * @return the AzureSku object itself. + */ + public AzureSku withCapacity(Integer capacity) { + this.capacity = capacity; + return this; + } + + /** + * Get sKU tier. Possible values include: 'Basic', 'Standard'. + * + * @return the tier value + */ + public AzureSkuTier tier() { + return this.tier; + } + + /** + * Set sKU tier. Possible values include: 'Basic', 'Standard'. + * + * @param tier the tier value to set + * @return the AzureSku object itself. + */ + public AzureSku withTier(AzureSkuTier tier) { + this.tier = tier; + return this; + } + +} diff --git a/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/AzureSkuName.java b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/AzureSkuName.java new file mode 100644 index 0000000000000..3c8b059512e0d --- /dev/null +++ b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/AzureSkuName.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.kusto.v2020_06_14; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for AzureSkuName. + */ +public final class AzureSkuName extends ExpandableStringEnum { + /** Static value Standard_DS13_v2+1TB_PS for AzureSkuName. */ + public static final AzureSkuName STANDARD_DS13_V21TB_PS = fromString("Standard_DS13_v2+1TB_PS"); + + /** Static value Standard_DS13_v2+2TB_PS for AzureSkuName. */ + public static final AzureSkuName STANDARD_DS13_V22TB_PS = fromString("Standard_DS13_v2+2TB_PS"); + + /** Static value Standard_DS14_v2+3TB_PS for AzureSkuName. */ + public static final AzureSkuName STANDARD_DS14_V23TB_PS = fromString("Standard_DS14_v2+3TB_PS"); + + /** Static value Standard_DS14_v2+4TB_PS for AzureSkuName. */ + public static final AzureSkuName STANDARD_DS14_V24TB_PS = fromString("Standard_DS14_v2+4TB_PS"); + + /** Static value Standard_D13_v2 for AzureSkuName. */ + public static final AzureSkuName STANDARD_D13_V2 = fromString("Standard_D13_v2"); + + /** Static value Standard_D14_v2 for AzureSkuName. */ + public static final AzureSkuName STANDARD_D14_V2 = fromString("Standard_D14_v2"); + + /** Static value Standard_L8s for AzureSkuName. */ + public static final AzureSkuName STANDARD_L8S = fromString("Standard_L8s"); + + /** Static value Standard_L16s for AzureSkuName. */ + public static final AzureSkuName STANDARD_L16S = fromString("Standard_L16s"); + + /** Static value Standard_D11_v2 for AzureSkuName. */ + public static final AzureSkuName STANDARD_D11_V2 = fromString("Standard_D11_v2"); + + /** Static value Standard_D12_v2 for AzureSkuName. */ + public static final AzureSkuName STANDARD_D12_V2 = fromString("Standard_D12_v2"); + + /** Static value Standard_L4s for AzureSkuName. */ + public static final AzureSkuName STANDARD_L4S = fromString("Standard_L4s"); + + /** Static value Dev(No SLA)_Standard_D11_v2 for AzureSkuName. */ + public static final AzureSkuName DEV_NO_SLA_STANDARD_D11_V2 = fromString("Dev(No SLA)_Standard_D11_v2"); + + /** Static value Standard_E2a_v4 for AzureSkuName. */ + public static final AzureSkuName STANDARD_E2A_V4 = fromString("Standard_E2a_v4"); + + /** Static value Standard_E4a_v4 for AzureSkuName. */ + public static final AzureSkuName STANDARD_E4A_V4 = fromString("Standard_E4a_v4"); + + /** Static value Standard_E8a_v4 for AzureSkuName. */ + public static final AzureSkuName STANDARD_E8A_V4 = fromString("Standard_E8a_v4"); + + /** Static value Standard_E16a_v4 for AzureSkuName. */ + public static final AzureSkuName STANDARD_E16A_V4 = fromString("Standard_E16a_v4"); + + /** Static value Standard_E8as_v4+1TB_PS for AzureSkuName. */ + public static final AzureSkuName STANDARD_E8AS_V41TB_PS = fromString("Standard_E8as_v4+1TB_PS"); + + /** Static value Standard_E8as_v4+2TB_PS for AzureSkuName. */ + public static final AzureSkuName STANDARD_E8AS_V42TB_PS = fromString("Standard_E8as_v4+2TB_PS"); + + /** Static value Standard_E16as_v4+3TB_PS for AzureSkuName. */ + public static final AzureSkuName STANDARD_E16AS_V43TB_PS = fromString("Standard_E16as_v4+3TB_PS"); + + /** Static value Standard_E16as_v4+4TB_PS for AzureSkuName. */ + public static final AzureSkuName STANDARD_E16AS_V44TB_PS = fromString("Standard_E16as_v4+4TB_PS"); + + /** Static value Dev(No SLA)_Standard_E2a_v4 for AzureSkuName. */ + public static final AzureSkuName DEV_NO_SLA_STANDARD_E2A_V4 = fromString("Dev(No SLA)_Standard_E2a_v4"); + + /** + * Creates or finds a AzureSkuName from its string representation. + * @param name a name to look for + * @return the corresponding AzureSkuName + */ + @JsonCreator + public static AzureSkuName fromString(String name) { + return fromString(name, AzureSkuName.class); + } + + /** + * @return known AzureSkuName values + */ + public static Collection values() { + return values(AzureSkuName.class); + } +} diff --git a/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/AzureSkuTier.java b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/AzureSkuTier.java new file mode 100644 index 0000000000000..a9a1e6b0b9fef --- /dev/null +++ b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/AzureSkuTier.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.kusto.v2020_06_14; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for AzureSkuTier. + */ +public final class AzureSkuTier extends ExpandableStringEnum { + /** Static value Basic for AzureSkuTier. */ + public static final AzureSkuTier BASIC = fromString("Basic"); + + /** Static value Standard for AzureSkuTier. */ + public static final AzureSkuTier STANDARD = fromString("Standard"); + + /** + * Creates or finds a AzureSkuTier from its string representation. + * @param name a name to look for + * @return the corresponding AzureSkuTier + */ + @JsonCreator + public static AzureSkuTier fromString(String name) { + return fromString(name, AzureSkuTier.class); + } + + /** + * @return known AzureSkuTier values + */ + public static Collection values() { + return values(AzureSkuTier.class); + } +} diff --git a/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/BlobStorageEventType.java b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/BlobStorageEventType.java new file mode 100644 index 0000000000000..afdfed8d3a8a1 --- /dev/null +++ b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/BlobStorageEventType.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.kusto.v2020_06_14; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for BlobStorageEventType. + */ +public final class BlobStorageEventType extends ExpandableStringEnum { + /** Static value Microsoft.Storage.BlobCreated for BlobStorageEventType. */ + public static final BlobStorageEventType MICROSOFT_STORAGE_BLOB_CREATED = fromString("Microsoft.Storage.BlobCreated"); + + /** Static value Microsoft.Storage.BlobRenamed for BlobStorageEventType. */ + public static final BlobStorageEventType MICROSOFT_STORAGE_BLOB_RENAMED = fromString("Microsoft.Storage.BlobRenamed"); + + /** + * Creates or finds a BlobStorageEventType from its string representation. + * @param name a name to look for + * @return the corresponding BlobStorageEventType + */ + @JsonCreator + public static BlobStorageEventType fromString(String name) { + return fromString(name, BlobStorageEventType.class); + } + + /** + * @return known BlobStorageEventType values + */ + public static Collection values() { + return values(BlobStorageEventType.class); + } +} diff --git a/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/CheckNameRequest.java b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/CheckNameRequest.java new file mode 100644 index 0000000000000..56ad230e7d2f0 --- /dev/null +++ b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/CheckNameRequest.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.kusto.v2020_06_14; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The result returned from a database check name availability request. + */ +public class CheckNameRequest { + /** + * Resource name. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * The type of resource, for instance Microsoft.Kusto/clusters/databases. + * Possible values include: 'Microsoft.Kusto/clusters/databases', + * 'Microsoft.Kusto/clusters/attachedDatabaseConfigurations'. + */ + @JsonProperty(value = "type", required = true) + private Type type; + + /** + * 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 CheckNameRequest object itself. + */ + public CheckNameRequest withName(String name) { + this.name = name; + return this; + } + + /** + * Get the type of resource, for instance Microsoft.Kusto/clusters/databases. Possible values include: 'Microsoft.Kusto/clusters/databases', 'Microsoft.Kusto/clusters/attachedDatabaseConfigurations'. + * + * @return the type value + */ + public Type type() { + return this.type; + } + + /** + * Set the type of resource, for instance Microsoft.Kusto/clusters/databases. Possible values include: 'Microsoft.Kusto/clusters/databases', 'Microsoft.Kusto/clusters/attachedDatabaseConfigurations'. + * + * @param type the type value to set + * @return the CheckNameRequest object itself. + */ + public CheckNameRequest withType(Type type) { + this.type = type; + return this; + } + +} diff --git a/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/CheckNameResult.java b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/CheckNameResult.java new file mode 100644 index 0000000000000..8b8fb14fd9c2c --- /dev/null +++ b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/CheckNameResult.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.kusto.v2020_06_14; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.kusto.v2020_06_14.implementation.KustoManager; +import com.microsoft.azure.management.kusto.v2020_06_14.implementation.CheckNameResultInner; + +/** + * Type representing CheckNameResult. + */ +public interface CheckNameResult extends HasInner, HasManager { + /** + * @return the message value. + */ + String message(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the nameAvailable value. + */ + Boolean nameAvailable(); + + /** + * @return the reason value. + */ + Reason reason(); + +} diff --git a/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/Cluster.java b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/Cluster.java new file mode 100644 index 0000000000000..6600fa27bfcdc --- /dev/null +++ b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/Cluster.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.kusto.v2020_06_14; + +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.kusto.v2020_06_14.implementation.KustoManager; +import java.util.List; +import com.microsoft.azure.management.kusto.v2020_06_14.implementation.ClusterInner; + +/** + * Type representing Cluster. + */ +public interface Cluster extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, Refreshable, Updatable, HasManager { + /** + * @return the dataIngestionUri value. + */ + String dataIngestionUri(); + + /** + * @return the enableDiskEncryption value. + */ + Boolean enableDiskEncryption(); + + /** + * @return the enableDoubleEncryption value. + */ + Boolean enableDoubleEncryption(); + + /** + * @return the enablePurge value. + */ + Boolean enablePurge(); + + /** + * @return the enableStreamingIngest value. + */ + Boolean enableStreamingIngest(); + + /** + * @return the identity value. + */ + Identity identity(); + + /** + * @return the keyVaultProperties value. + */ + KeyVaultProperties keyVaultProperties(); + + /** + * @return the languageExtensions value. + */ + LanguageExtensionsList languageExtensions(); + + /** + * @return the optimizedAutoscale value. + */ + OptimizedAutoscale optimizedAutoscale(); + + /** + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * @return the sku value. + */ + AzureSku sku(); + + /** + * @return the state value. + */ + State state(); + + /** + * @return the stateReason value. + */ + String stateReason(); + + /** + * @return the trustedExternalTenants value. + */ + List trustedExternalTenants(); + + /** + * @return the uri value. + */ + String uri(); + + /** + * @return the virtualNetworkConfiguration value. + */ + VirtualNetworkConfiguration virtualNetworkConfiguration(); + + /** + * @return the zones value. + */ + List zones(); + + /** + * The entirety of the Cluster definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithGroup, DefinitionStages.WithSku, 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 Sku. + */ + interface WithSku { + /** + * Specifies sku. + * @param sku The SKU of the cluster + * @return the next definition stage +*/ + WithCreate withSku(AzureSku sku); + } + + /** + * The stage of the cluster definition allowing to specify EnableDiskEncryption. + */ + interface WithEnableDiskEncryption { + /** + * Specifies enableDiskEncryption. + * @param enableDiskEncryption A boolean value that indicates if the cluster's disks are encrypted + * @return the next definition stage + */ + WithCreate withEnableDiskEncryption(Boolean enableDiskEncryption); + } + + /** + * The stage of the cluster definition allowing to specify EnableDoubleEncryption. + */ + interface WithEnableDoubleEncryption { + /** + * Specifies enableDoubleEncryption. + * @param enableDoubleEncryption A boolean value that indicates if double encryption is enabled + * @return the next definition stage + */ + WithCreate withEnableDoubleEncryption(Boolean enableDoubleEncryption); + } + + /** + * The stage of the cluster definition allowing to specify EnablePurge. + */ + interface WithEnablePurge { + /** + * Specifies enablePurge. + * @param enablePurge A boolean value that indicates if the purge operations are enabled + * @return the next definition stage + */ + WithCreate withEnablePurge(Boolean enablePurge); + } + + /** + * The stage of the cluster definition allowing to specify EnableStreamingIngest. + */ + interface WithEnableStreamingIngest { + /** + * Specifies enableStreamingIngest. + * @param enableStreamingIngest A boolean value that indicates if the streaming ingest is enabled + * @return the next definition stage + */ + WithCreate withEnableStreamingIngest(Boolean enableStreamingIngest); + } + + /** + * The stage of the cluster definition allowing to specify Identity. + */ + interface WithIdentity { + /** + * Specifies identity. + * @param identity The identity of the cluster, if configured + * @return the next definition stage + */ + WithCreate withIdentity(Identity identity); + } + + /** + * The stage of the cluster definition allowing to specify KeyVaultProperties. + */ + interface WithKeyVaultProperties { + /** + * Specifies keyVaultProperties. + * @param keyVaultProperties KeyVault properties for the cluster encryption + * @return the next definition stage + */ + WithCreate withKeyVaultProperties(KeyVaultProperties keyVaultProperties); + } + + /** + * The stage of the cluster definition allowing to specify OptimizedAutoscale. + */ + interface WithOptimizedAutoscale { + /** + * Specifies optimizedAutoscale. + * @param optimizedAutoscale Optimized auto scale definition + * @return the next definition stage + */ + WithCreate withOptimizedAutoscale(OptimizedAutoscale optimizedAutoscale); + } + + /** + * The stage of the cluster definition allowing to specify TrustedExternalTenants. + */ + interface WithTrustedExternalTenants { + /** + * Specifies trustedExternalTenants. + * @param trustedExternalTenants The cluster's external tenants + * @return the next definition stage + */ + WithCreate withTrustedExternalTenants(List trustedExternalTenants); + } + + /** + * The stage of the cluster definition allowing to specify VirtualNetworkConfiguration. + */ + interface WithVirtualNetworkConfiguration { + /** + * Specifies virtualNetworkConfiguration. + * @param virtualNetworkConfiguration Virtual network definition + * @return the next definition stage + */ + WithCreate withVirtualNetworkConfiguration(VirtualNetworkConfiguration virtualNetworkConfiguration); + } + + /** + * The stage of the cluster definition allowing to specify Zones. + */ + interface WithZones { + /** + * Specifies zones. + * @param zones The availability zones of the cluster + * @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.WithEnableDiskEncryption, DefinitionStages.WithEnableDoubleEncryption, DefinitionStages.WithEnablePurge, DefinitionStages.WithEnableStreamingIngest, DefinitionStages.WithIdentity, DefinitionStages.WithKeyVaultProperties, DefinitionStages.WithOptimizedAutoscale, DefinitionStages.WithTrustedExternalTenants, DefinitionStages.WithVirtualNetworkConfiguration, DefinitionStages.WithZones { + } + } + /** + * The template for a Cluster update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, Resource.UpdateWithTags, UpdateStages.WithEnableDiskEncryption, UpdateStages.WithEnableDoubleEncryption, UpdateStages.WithEnablePurge, UpdateStages.WithEnableStreamingIngest, UpdateStages.WithIdentity, UpdateStages.WithKeyVaultProperties, UpdateStages.WithOptimizedAutoscale, UpdateStages.WithSku, UpdateStages.WithTrustedExternalTenants, UpdateStages.WithVirtualNetworkConfiguration { + } + + /** + * Grouping of Cluster update stages. + */ + interface UpdateStages { + /** + * The stage of the cluster update allowing to specify EnableDiskEncryption. + */ + interface WithEnableDiskEncryption { + /** + * Specifies enableDiskEncryption. + * @param enableDiskEncryption A boolean value that indicates if the cluster's disks are encrypted + * @return the next update stage + */ + Update withEnableDiskEncryption(Boolean enableDiskEncryption); + } + + /** + * The stage of the cluster update allowing to specify EnableDoubleEncryption. + */ + interface WithEnableDoubleEncryption { + /** + * Specifies enableDoubleEncryption. + * @param enableDoubleEncryption A boolean value that indicates if double encryption is enabled + * @return the next update stage + */ + Update withEnableDoubleEncryption(Boolean enableDoubleEncryption); + } + + /** + * The stage of the cluster update allowing to specify EnablePurge. + */ + interface WithEnablePurge { + /** + * Specifies enablePurge. + * @param enablePurge A boolean value that indicates if the purge operations are enabled + * @return the next update stage + */ + Update withEnablePurge(Boolean enablePurge); + } + + /** + * The stage of the cluster update allowing to specify EnableStreamingIngest. + */ + interface WithEnableStreamingIngest { + /** + * Specifies enableStreamingIngest. + * @param enableStreamingIngest A boolean value that indicates if the streaming ingest is enabled + * @return the next update stage + */ + Update withEnableStreamingIngest(Boolean enableStreamingIngest); + } + + /** + * The stage of the cluster update allowing to specify Identity. + */ + interface WithIdentity { + /** + * Specifies identity. + * @param identity The identity of the cluster, if configured + * @return the next update stage + */ + Update withIdentity(Identity identity); + } + + /** + * The stage of the cluster update allowing to specify KeyVaultProperties. + */ + interface WithKeyVaultProperties { + /** + * Specifies keyVaultProperties. + * @param keyVaultProperties KeyVault properties for the cluster encryption + * @return the next update stage + */ + Update withKeyVaultProperties(KeyVaultProperties keyVaultProperties); + } + + /** + * The stage of the cluster update allowing to specify OptimizedAutoscale. + */ + interface WithOptimizedAutoscale { + /** + * Specifies optimizedAutoscale. + * @param optimizedAutoscale Optimized auto scale definition + * @return the next update stage + */ + Update withOptimizedAutoscale(OptimizedAutoscale optimizedAutoscale); + } + + /** + * The stage of the cluster update allowing to specify Sku. + */ + interface WithSku { + /** + * Specifies sku. + * @param sku The SKU of the cluster + * @return the next update stage + */ + Update withSku(AzureSku sku); + } + + /** + * The stage of the cluster update allowing to specify TrustedExternalTenants. + */ + interface WithTrustedExternalTenants { + /** + * Specifies trustedExternalTenants. + * @param trustedExternalTenants The cluster's external tenants + * @return the next update stage + */ + Update withTrustedExternalTenants(List trustedExternalTenants); + } + + /** + * The stage of the cluster update allowing to specify VirtualNetworkConfiguration. + */ + interface WithVirtualNetworkConfiguration { + /** + * Specifies virtualNetworkConfiguration. + * @param virtualNetworkConfiguration Virtual network definition + * @return the next update stage + */ + Update withVirtualNetworkConfiguration(VirtualNetworkConfiguration virtualNetworkConfiguration); + } + + } +} diff --git a/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/ClusterCheckNameRequest.java b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/ClusterCheckNameRequest.java new file mode 100644 index 0000000000000..52f25961bf63c --- /dev/null +++ b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/ClusterCheckNameRequest.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.kusto.v2020_06_14; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The result returned from a cluster check name availability request. + */ +public class ClusterCheckNameRequest { + /** + * Cluster name. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * The type of resource, Microsoft.Kusto/clusters. + */ + @JsonProperty(value = "type", required = true) + private String type; + + /** + * Creates an instance of ClusterCheckNameRequest class. + * @param name cluster name. + */ + public ClusterCheckNameRequest() { + type = "Microsoft.Kusto/clusters"; + } + + /** + * Get cluster name. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set cluster name. + * + * @param name the name value to set + * @return the ClusterCheckNameRequest object itself. + */ + public ClusterCheckNameRequest withName(String name) { + this.name = name; + return this; + } + + /** + * Get the type of resource, Microsoft.Kusto/clusters. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Set the type of resource, Microsoft.Kusto/clusters. + * + * @param type the type value to set + * @return the ClusterCheckNameRequest object itself. + */ + public ClusterCheckNameRequest withType(String type) { + this.type = type; + return this; + } + +} diff --git a/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/ClusterPrincipalAssignment.java b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/ClusterPrincipalAssignment.java new file mode 100644 index 0000000000000..9dcba241ec556 --- /dev/null +++ b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/ClusterPrincipalAssignment.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.kusto.v2020_06_14; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.kusto.v2020_06_14.implementation.ClusterPrincipalAssignmentInner; +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.kusto.v2020_06_14.implementation.KustoManager; + +/** + * Type representing ClusterPrincipalAssignment. + */ +public interface ClusterPrincipalAssignment extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the id value. + */ + String id(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the principalId value. + */ + String principalId(); + + /** + * @return the principalName value. + */ + String principalName(); + + /** + * @return the principalType value. + */ + PrincipalType principalType(); + + /** + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * @return the role value. + */ + ClusterPrincipalRole role(); + + /** + * @return the tenantId value. + */ + String tenantId(); + + /** + * @return the tenantName value. + */ + String tenantName(); + + /** + * @return the type value. + */ + String type(); + + /** + * The entirety of the ClusterPrincipalAssignment definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithCluster, DefinitionStages.WithPrincipalId, DefinitionStages.WithPrincipalType, DefinitionStages.WithRole, DefinitionStages.WithCreate { + } + + /** + * Grouping of ClusterPrincipalAssignment definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a ClusterPrincipalAssignment definition. + */ + interface Blank extends WithCluster { + } + + /** + * The stage of the clusterprincipalassignment definition allowing to specify Cluster. + */ + interface WithCluster { + /** + * Specifies resourceGroupName, clusterName. + * @param resourceGroupName The name of the resource group containing the Kusto cluster + * @param clusterName The name of the Kusto cluster + * @return the next definition stage + */ + WithPrincipalId withExistingCluster(String resourceGroupName, String clusterName); + } + + /** + * The stage of the clusterprincipalassignment definition allowing to specify PrincipalId. + */ + interface WithPrincipalId { + /** + * Specifies principalId. + * @param principalId The principal ID assigned to the cluster principal. It can be a user email, application ID, or security group name + * @return the next definition stage + */ + WithPrincipalType withPrincipalId(String principalId); + } + + /** + * The stage of the clusterprincipalassignment definition allowing to specify PrincipalType. + */ + interface WithPrincipalType { + /** + * Specifies principalType. + * @param principalType Principal type. Possible values include: 'App', 'Group', 'User' + * @return the next definition stage + */ + WithRole withPrincipalType(PrincipalType principalType); + } + + /** + * The stage of the clusterprincipalassignment definition allowing to specify Role. + */ + interface WithRole { + /** + * Specifies role. + * @param role Cluster principal role. Possible values include: 'AllDatabasesAdmin', 'AllDatabasesViewer' + * @return the next definition stage + */ + WithCreate withRole(ClusterPrincipalRole role); + } + + /** + * The stage of the clusterprincipalassignment definition allowing to specify TenantId. + */ + interface WithTenantId { + /** + * Specifies tenantId. + * @param tenantId The tenant id of the principal + * @return the next definition stage + */ + WithCreate withTenantId(String tenantId); + } + + /** + * 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.WithTenantId { + } + } + /** + * The template for a ClusterPrincipalAssignment update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithTenantId { + } + + /** + * Grouping of ClusterPrincipalAssignment update stages. + */ + interface UpdateStages { + /** + * The stage of the clusterprincipalassignment update allowing to specify TenantId. + */ + interface WithTenantId { + /** + * Specifies tenantId. + * @param tenantId The tenant id of the principal + * @return the next update stage + */ + Update withTenantId(String tenantId); + } + + } +} diff --git a/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/ClusterPrincipalAssignmentCheckNameRequest.java b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/ClusterPrincipalAssignmentCheckNameRequest.java new file mode 100644 index 0000000000000..fdb66877c57bb --- /dev/null +++ b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/ClusterPrincipalAssignmentCheckNameRequest.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.kusto.v2020_06_14; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * A principal assignment check name availability request. + */ +public class ClusterPrincipalAssignmentCheckNameRequest { + /** + * Principal Assignment resource name. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * The type of resource, Microsoft.Kusto/clusters/principalAssignments. + */ + @JsonProperty(value = "type", required = true) + private String type; + + /** + * Creates an instance of ClusterPrincipalAssignmentCheckNameRequest class. + * @param name principal Assignment resource name. + */ + public ClusterPrincipalAssignmentCheckNameRequest() { + type = "Microsoft.Kusto/clusters/principalAssignments"; + } + + /** + * Get principal Assignment resource name. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set principal Assignment resource name. + * + * @param name the name value to set + * @return the ClusterPrincipalAssignmentCheckNameRequest object itself. + */ + public ClusterPrincipalAssignmentCheckNameRequest withName(String name) { + this.name = name; + return this; + } + + /** + * Get the type of resource, Microsoft.Kusto/clusters/principalAssignments. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Set the type of resource, Microsoft.Kusto/clusters/principalAssignments. + * + * @param type the type value to set + * @return the ClusterPrincipalAssignmentCheckNameRequest object itself. + */ + public ClusterPrincipalAssignmentCheckNameRequest withType(String type) { + this.type = type; + return this; + } + +} diff --git a/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/ClusterPrincipalAssignments.java b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/ClusterPrincipalAssignments.java new file mode 100644 index 0000000000000..898e6c2365175 --- /dev/null +++ b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/ClusterPrincipalAssignments.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.kusto.v2020_06_14; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.kusto.v2020_06_14.implementation.ClusterPrincipalAssignmentsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing ClusterPrincipalAssignments. + */ +public interface ClusterPrincipalAssignments extends SupportsCreating, HasInner { + /** + * Gets a Kusto cluster principalAssignment. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param principalAssignmentName The name of the Kusto principalAssignment. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String clusterName, String principalAssignmentName); + + /** + * Lists all Kusto cluster principalAssignments. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(String resourceGroupName, String clusterName); + + /** + * Deletes a Kusto cluster principalAssignment. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param principalAssignmentName The name of the Kusto principalAssignment. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String clusterName, String principalAssignmentName); + + /** + * Checks that the principal assignment name is valid and is not already in use. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param name Principal Assignment resource name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable checkNameAvailabilityAsync(String resourceGroupName, String clusterName, String name); + +} diff --git a/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/ClusterPrincipalRole.java b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/ClusterPrincipalRole.java new file mode 100644 index 0000000000000..9f7210ec9a587 --- /dev/null +++ b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/ClusterPrincipalRole.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.kusto.v2020_06_14; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ClusterPrincipalRole. + */ +public final class ClusterPrincipalRole extends ExpandableStringEnum { + /** Static value AllDatabasesAdmin for ClusterPrincipalRole. */ + public static final ClusterPrincipalRole ALL_DATABASES_ADMIN = fromString("AllDatabasesAdmin"); + + /** Static value AllDatabasesViewer for ClusterPrincipalRole. */ + public static final ClusterPrincipalRole ALL_DATABASES_VIEWER = fromString("AllDatabasesViewer"); + + /** + * Creates or finds a ClusterPrincipalRole from its string representation. + * @param name a name to look for + * @return the corresponding ClusterPrincipalRole + */ + @JsonCreator + public static ClusterPrincipalRole fromString(String name) { + return fromString(name, ClusterPrincipalRole.class); + } + + /** + * @return known ClusterPrincipalRole values + */ + public static Collection values() { + return values(ClusterPrincipalRole.class); + } +} diff --git a/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/ClusterUpdate.java b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/ClusterUpdate.java new file mode 100644 index 0000000000000..cda56a705f052 --- /dev/null +++ b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/ClusterUpdate.java @@ -0,0 +1,427 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.kusto.v2020_06_14; + +import java.util.Map; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.ProxyResource; + +/** + * Class representing an update to a Kusto cluster. + */ +@JsonFlatten +public class ClusterUpdate extends ProxyResource { + /** + * Resource tags. + */ + @JsonProperty(value = "tags") + private Map tags; + + /** + * Resource location. + */ + @JsonProperty(value = "location") + private String location; + + /** + * The SKU of the cluster. + */ + @JsonProperty(value = "sku") + private AzureSku sku; + + /** + * The identity of the cluster, if configured. + */ + @JsonProperty(value = "identity") + private Identity identity; + + /** + * The state of the resource. Possible values include: 'Creating', + * 'Unavailable', 'Running', 'Deleting', 'Deleted', 'Stopping', 'Stopped', + * 'Starting', 'Updating'. + */ + @JsonProperty(value = "properties.state", access = JsonProperty.Access.WRITE_ONLY) + private State state; + + /** + * The provisioned state of the resource. Possible values include: + * 'Running', 'Creating', 'Deleting', 'Succeeded', 'Failed', 'Moving'. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /** + * The cluster URI. + */ + @JsonProperty(value = "properties.uri", access = JsonProperty.Access.WRITE_ONLY) + private String uri; + + /** + * The cluster data ingestion URI. + */ + @JsonProperty(value = "properties.dataIngestionUri", access = JsonProperty.Access.WRITE_ONLY) + private String dataIngestionUri; + + /** + * The reason for the cluster's current state. + */ + @JsonProperty(value = "properties.stateReason", access = JsonProperty.Access.WRITE_ONLY) + private String stateReason; + + /** + * The cluster's external tenants. + */ + @JsonProperty(value = "properties.trustedExternalTenants") + private List trustedExternalTenants; + + /** + * Optimized auto scale definition. + */ + @JsonProperty(value = "properties.optimizedAutoscale") + private OptimizedAutoscale optimizedAutoscale; + + /** + * A boolean value that indicates if the cluster's disks are encrypted. + */ + @JsonProperty(value = "properties.enableDiskEncryption") + private Boolean enableDiskEncryption; + + /** + * A boolean value that indicates if the streaming ingest is enabled. + */ + @JsonProperty(value = "properties.enableStreamingIngest") + private Boolean enableStreamingIngest; + + /** + * Virtual network definition. + */ + @JsonProperty(value = "properties.virtualNetworkConfiguration") + private VirtualNetworkConfiguration virtualNetworkConfiguration; + + /** + * KeyVault properties for the cluster encryption. + */ + @JsonProperty(value = "properties.keyVaultProperties") + private KeyVaultProperties keyVaultProperties; + + /** + * A boolean value that indicates if the purge operations are enabled. + */ + @JsonProperty(value = "properties.enablePurge") + private Boolean enablePurge; + + /** + * List of the cluster's language extensions. + */ + @JsonProperty(value = "properties.languageExtensions", access = JsonProperty.Access.WRITE_ONLY) + private LanguageExtensionsList languageExtensions; + + /** + * A boolean value that indicates if double encryption is enabled. + */ + @JsonProperty(value = "properties.enableDoubleEncryption") + private Boolean enableDoubleEncryption; + + /** + * 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 ClusterUpdate object itself. + */ + public ClusterUpdate withTags(Map tags) { + this.tags = tags; + 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 ClusterUpdate object itself. + */ + public ClusterUpdate withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the SKU of the cluster. + * + * @return the sku value + */ + public AzureSku sku() { + return this.sku; + } + + /** + * Set the SKU of the cluster. + * + * @param sku the sku value to set + * @return the ClusterUpdate object itself. + */ + public ClusterUpdate withSku(AzureSku sku) { + this.sku = sku; + return this; + } + + /** + * Get the identity of the cluster, if configured. + * + * @return the identity value + */ + public Identity identity() { + return this.identity; + } + + /** + * Set the identity of the cluster, if configured. + * + * @param identity the identity value to set + * @return the ClusterUpdate object itself. + */ + public ClusterUpdate withIdentity(Identity identity) { + this.identity = identity; + return this; + } + + /** + * Get the state of the resource. Possible values include: 'Creating', 'Unavailable', 'Running', 'Deleting', 'Deleted', 'Stopping', 'Stopped', 'Starting', 'Updating'. + * + * @return the state value + */ + public State state() { + return this.state; + } + + /** + * Get the provisioned state of the resource. Possible values include: 'Running', 'Creating', 'Deleting', 'Succeeded', 'Failed', 'Moving'. + * + * @return the provisioningState value + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the cluster URI. + * + * @return the uri value + */ + public String uri() { + return this.uri; + } + + /** + * Get the cluster data ingestion URI. + * + * @return the dataIngestionUri value + */ + public String dataIngestionUri() { + return this.dataIngestionUri; + } + + /** + * Get the reason for the cluster's current state. + * + * @return the stateReason value + */ + public String stateReason() { + return this.stateReason; + } + + /** + * Get the cluster's external tenants. + * + * @return the trustedExternalTenants value + */ + public List trustedExternalTenants() { + return this.trustedExternalTenants; + } + + /** + * Set the cluster's external tenants. + * + * @param trustedExternalTenants the trustedExternalTenants value to set + * @return the ClusterUpdate object itself. + */ + public ClusterUpdate withTrustedExternalTenants(List trustedExternalTenants) { + this.trustedExternalTenants = trustedExternalTenants; + return this; + } + + /** + * Get optimized auto scale definition. + * + * @return the optimizedAutoscale value + */ + public OptimizedAutoscale optimizedAutoscale() { + return this.optimizedAutoscale; + } + + /** + * Set optimized auto scale definition. + * + * @param optimizedAutoscale the optimizedAutoscale value to set + * @return the ClusterUpdate object itself. + */ + public ClusterUpdate withOptimizedAutoscale(OptimizedAutoscale optimizedAutoscale) { + this.optimizedAutoscale = optimizedAutoscale; + return this; + } + + /** + * Get a boolean value that indicates if the cluster's disks are encrypted. + * + * @return the enableDiskEncryption value + */ + public Boolean enableDiskEncryption() { + return this.enableDiskEncryption; + } + + /** + * Set a boolean value that indicates if the cluster's disks are encrypted. + * + * @param enableDiskEncryption the enableDiskEncryption value to set + * @return the ClusterUpdate object itself. + */ + public ClusterUpdate withEnableDiskEncryption(Boolean enableDiskEncryption) { + this.enableDiskEncryption = enableDiskEncryption; + return this; + } + + /** + * Get a boolean value that indicates if the streaming ingest is enabled. + * + * @return the enableStreamingIngest value + */ + public Boolean enableStreamingIngest() { + return this.enableStreamingIngest; + } + + /** + * Set a boolean value that indicates if the streaming ingest is enabled. + * + * @param enableStreamingIngest the enableStreamingIngest value to set + * @return the ClusterUpdate object itself. + */ + public ClusterUpdate withEnableStreamingIngest(Boolean enableStreamingIngest) { + this.enableStreamingIngest = enableStreamingIngest; + return this; + } + + /** + * Get virtual network definition. + * + * @return the virtualNetworkConfiguration value + */ + public VirtualNetworkConfiguration virtualNetworkConfiguration() { + return this.virtualNetworkConfiguration; + } + + /** + * Set virtual network definition. + * + * @param virtualNetworkConfiguration the virtualNetworkConfiguration value to set + * @return the ClusterUpdate object itself. + */ + public ClusterUpdate withVirtualNetworkConfiguration(VirtualNetworkConfiguration virtualNetworkConfiguration) { + this.virtualNetworkConfiguration = virtualNetworkConfiguration; + return this; + } + + /** + * Get keyVault properties for the cluster encryption. + * + * @return the keyVaultProperties value + */ + public KeyVaultProperties keyVaultProperties() { + return this.keyVaultProperties; + } + + /** + * Set keyVault properties for the cluster encryption. + * + * @param keyVaultProperties the keyVaultProperties value to set + * @return the ClusterUpdate object itself. + */ + public ClusterUpdate withKeyVaultProperties(KeyVaultProperties keyVaultProperties) { + this.keyVaultProperties = keyVaultProperties; + return this; + } + + /** + * Get a boolean value that indicates if the purge operations are enabled. + * + * @return the enablePurge value + */ + public Boolean enablePurge() { + return this.enablePurge; + } + + /** + * Set a boolean value that indicates if the purge operations are enabled. + * + * @param enablePurge the enablePurge value to set + * @return the ClusterUpdate object itself. + */ + public ClusterUpdate withEnablePurge(Boolean enablePurge) { + this.enablePurge = enablePurge; + return this; + } + + /** + * Get list of the cluster's language extensions. + * + * @return the languageExtensions value + */ + public LanguageExtensionsList languageExtensions() { + return this.languageExtensions; + } + + /** + * Get a boolean value that indicates if double encryption is enabled. + * + * @return the enableDoubleEncryption value + */ + public Boolean enableDoubleEncryption() { + return this.enableDoubleEncryption; + } + + /** + * Set a boolean value that indicates if double encryption is enabled. + * + * @param enableDoubleEncryption the enableDoubleEncryption value to set + * @return the ClusterUpdate object itself. + */ + public ClusterUpdate withEnableDoubleEncryption(Boolean enableDoubleEncryption) { + this.enableDoubleEncryption = enableDoubleEncryption; + return this; + } + +} diff --git a/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/Clusters.java b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/Clusters.java new file mode 100644 index 0000000000000..fd866ec1d9550 --- /dev/null +++ b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/Clusters.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.kusto.v2020_06_14; + +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.kusto.v2020_06_14.implementation.FollowerDatabaseDefinitionInner; +import com.microsoft.azure.management.kusto.v2020_06_14.implementation.ClustersInner; +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.kusto.v2020_06_14.AzureResourceSku; + +/** + * Type representing Clusters. + */ +public interface Clusters extends SupportsCreating, SupportsDeletingByResourceGroup, SupportsBatchDeletion, SupportsGettingByResourceGroup, SupportsListingByResourceGroup, SupportsListing, HasInner { + /** + * Stops a Kusto cluster. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable stopAsync(String resourceGroupName, String clusterName); + + /** + * Starts a Kusto cluster. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable startAsync(String resourceGroupName, String clusterName); + + /** + * Returns a list of databases that are owned by this cluster and were followed by another cluster. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listFollowerDatabasesAsync(String resourceGroupName, String clusterName); + + /** + * Detaches all followers of a database owned by this cluster. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param followerDatabaseToRemove The follower databases properties to remove. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable detachFollowerDatabasesAsync(String resourceGroupName, String clusterName, FollowerDatabaseDefinitionInner followerDatabaseToRemove); + + /** + * Diagnoses network connectivity status for external resources on which the service is dependent on. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable diagnoseVirtualNetworkAsync(String resourceGroupName, String clusterName); + + /** + * Returns a list of language extensions that can run within KQL queries. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listLanguageExtensionsAsync(String resourceGroupName, String clusterName); + + /** + * Add a list of language extensions that can run within KQL queries. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable addLanguageExtensionsAsync(String resourceGroupName, String clusterName); + + /** + * Remove a list of language extensions that can run within KQL queries. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable removeLanguageExtensionsAsync(String resourceGroupName, String clusterName); + + /** + * Checks that the cluster name is valid and is not already in use. + * + * @param location Azure location. + * @param name Cluster name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable checkNameAvailabilityAsync(String location, String name); + + /** + * Returns the SKUs available for the provided resource. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listSkusByResourceAsync(String resourceGroupName, String clusterName); + + /** + * Lists eligible SKUs for Kusto resource provider. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listSkusAsync(); + +} diff --git a/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/Compression.java b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/Compression.java new file mode 100644 index 0000000000000..9ee2a4c3b985b --- /dev/null +++ b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/Compression.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.kusto.v2020_06_14; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for Compression. + */ +public final class Compression extends ExpandableStringEnum { + /** Static value None for Compression. */ + public static final Compression NONE = fromString("None"); + + /** Static value GZip for Compression. */ + public static final Compression GZIP = fromString("GZip"); + + /** + * Creates or finds a Compression from its string representation. + * @param name a name to look for + * @return the corresponding Compression + */ + @JsonCreator + public static Compression fromString(String name) { + return fromString(name, Compression.class); + } + + /** + * @return known Compression values + */ + public static Collection values() { + return values(Compression.class); + } +} diff --git a/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/DataConnection.java b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/DataConnection.java new file mode 100644 index 0000000000000..8031a20650700 --- /dev/null +++ b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/DataConnection.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.kusto.v2020_06_14; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.kusto.v2020_06_14.implementation.DataConnectionInner; +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.kusto.v2020_06_14.implementation.KustoManager; + +/** + * Type representing DataConnection. + */ +public interface DataConnection 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 type value. + */ + String type(); + + /** + * The entirety of the DataConnection definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithDatabasis, DefinitionStages.WithCreate { + } + + /** + * Grouping of DataConnection definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a DataConnection definition. + */ + interface Blank extends WithDatabasis { + } + + /** + * The stage of the dataconnection definition allowing to specify Databasis. + */ + interface WithDatabasis { + /** + * Specifies resourceGroupName, clusterName, databaseName. + * @param resourceGroupName The name of the resource group containing the Kusto cluster + * @param clusterName The name of the Kusto cluster + * @param databaseName The name of the database in the Kusto cluster + * @return the next definition stage + */ + WithCreate withExistingDatabasis(String resourceGroupName, String clusterName, String databaseName); + } + + /** + * The stage of the dataconnection 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 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 { + } + } + /** + * The template for a DataConnection update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithLocation { + } + + /** + * Grouping of DataConnection update stages. + */ + interface UpdateStages { + /** + * The stage of the dataconnection update allowing to specify Location. + */ + interface WithLocation { + /** + * Specifies location. + * @param location Resource location + * @return the next update stage + */ + Update withLocation(String location); + } + + } +} diff --git a/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/DataConnectionCheckNameRequest.java b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/DataConnectionCheckNameRequest.java new file mode 100644 index 0000000000000..4fc2f95b54be3 --- /dev/null +++ b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/DataConnectionCheckNameRequest.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.kusto.v2020_06_14; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * A data connection check name availability request. + */ +public class DataConnectionCheckNameRequest { + /** + * Data Connection name. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * The type of resource, + * Microsoft.Kusto/clusters/databases/dataConnections. + */ + @JsonProperty(value = "type", required = true) + private String type; + + /** + * Creates an instance of DataConnectionCheckNameRequest class. + * @param name data Connection name. + */ + public DataConnectionCheckNameRequest() { + type = "Microsoft.Kusto/clusters/databases/dataConnections"; + } + + /** + * Get data Connection name. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set data Connection name. + * + * @param name the name value to set + * @return the DataConnectionCheckNameRequest object itself. + */ + public DataConnectionCheckNameRequest withName(String name) { + this.name = name; + return this; + } + + /** + * Get the type of resource, Microsoft.Kusto/clusters/databases/dataConnections. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Set the type of resource, Microsoft.Kusto/clusters/databases/dataConnections. + * + * @param type the type value to set + * @return the DataConnectionCheckNameRequest object itself. + */ + public DataConnectionCheckNameRequest withType(String type) { + this.type = type; + return this; + } + +} diff --git a/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/DataConnectionValidation.java b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/DataConnectionValidation.java new file mode 100644 index 0000000000000..57a28223d23c7 --- /dev/null +++ b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/DataConnectionValidation.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.kusto.v2020_06_14; + +import com.microsoft.azure.management.kusto.v2020_06_14.implementation.DataConnectionInner; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Class representing an data connection validation. + */ +public class DataConnectionValidation { + /** + * The name of the data connection. + */ + @JsonProperty(value = "dataConnectionName") + private String dataConnectionName; + + /** + * The data connection properties to validate. + */ + @JsonProperty(value = "properties") + private DataConnectionInner properties; + + /** + * Get the name of the data connection. + * + * @return the dataConnectionName value + */ + public String dataConnectionName() { + return this.dataConnectionName; + } + + /** + * Set the name of the data connection. + * + * @param dataConnectionName the dataConnectionName value to set + * @return the DataConnectionValidation object itself. + */ + public DataConnectionValidation withDataConnectionName(String dataConnectionName) { + this.dataConnectionName = dataConnectionName; + return this; + } + + /** + * Get the data connection properties to validate. + * + * @return the properties value + */ + public DataConnectionInner properties() { + return this.properties; + } + + /** + * Set the data connection properties to validate. + * + * @param properties the properties value to set + * @return the DataConnectionValidation object itself. + */ + public DataConnectionValidation withProperties(DataConnectionInner properties) { + this.properties = properties; + return this; + } + +} diff --git a/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/DataConnectionValidationListResult.java b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/DataConnectionValidationListResult.java new file mode 100644 index 0000000000000..b50a861eb7177 --- /dev/null +++ b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/DataConnectionValidationListResult.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.kusto.v2020_06_14; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.kusto.v2020_06_14.implementation.KustoManager; +import com.microsoft.azure.management.kusto.v2020_06_14.implementation.DataConnectionValidationListResultInner; +import java.util.List; + +/** + * Type representing DataConnectionValidationListResult. + */ +public interface DataConnectionValidationListResult extends HasInner, HasManager { + /** + * @return the value value. + */ + List value(); + +} diff --git a/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/DataConnectionValidationResult.java b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/DataConnectionValidationResult.java new file mode 100644 index 0000000000000..b8307efdeef65 --- /dev/null +++ b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/DataConnectionValidationResult.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.kusto.v2020_06_14; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The result returned from a data connection validation request. + */ +public class DataConnectionValidationResult { + /** + * A message which indicates a problem in data connection validation. + */ + @JsonProperty(value = "errorMessage") + private String errorMessage; + + /** + * Get a message which indicates a problem in data connection validation. + * + * @return the errorMessage value + */ + public String errorMessage() { + return this.errorMessage; + } + + /** + * Set a message which indicates a problem in data connection validation. + * + * @param errorMessage the errorMessage value to set + * @return the DataConnectionValidationResult object itself. + */ + public DataConnectionValidationResult withErrorMessage(String errorMessage) { + this.errorMessage = errorMessage; + return this; + } + +} diff --git a/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/DataConnections.java b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/DataConnections.java new file mode 100644 index 0000000000000..351fddbe17a68 --- /dev/null +++ b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/DataConnections.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.kusto.v2020_06_14; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.kusto.v2020_06_14.implementation.DataConnectionsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing DataConnections. + */ +public interface DataConnections extends SupportsCreating, HasInner { + /** + * Returns a data connection. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param dataConnectionName The name of the data connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String clusterName, String databaseName, String dataConnectionName); + + /** + * Returns the list of data connections of the given Kusto database. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listByDatabaseAsync(String resourceGroupName, String clusterName, String databaseName); + + /** + * Deletes the data connection with the given name. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param dataConnectionName The name of the data connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String clusterName, String databaseName, String dataConnectionName); + + /** + * Checks that the data connection parameters are valid. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param parameters The data connection parameters supplied to the CreateOrUpdate operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable dataConnectionValidationMethodAsync(String resourceGroupName, String clusterName, String databaseName, DataConnectionValidation parameters); + + /** + * Checks that the data connection name is valid and is not already in use. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param name Data Connection name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable checkNameAvailabilityAsync(String resourceGroupName, String clusterName, String databaseName, String name); + +} diff --git a/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/Database.java b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/Database.java new file mode 100644 index 0000000000000..11c436c7ac6ef --- /dev/null +++ b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/Database.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.kusto.v2020_06_14; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.kusto.v2020_06_14.implementation.DatabaseInner; +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.kusto.v2020_06_14.implementation.KustoManager; + +/** + * Type representing Database. + */ +public interface Database 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 type value. + */ + String type(); + + /** + * The entirety of the Database definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithCluster, DefinitionStages.WithCreate { + } + + /** + * Grouping of Database definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a Database definition. + */ + interface Blank extends WithCluster { + } + + /** + * The stage of the database definition allowing to specify Cluster. + */ + interface WithCluster { + /** + * Specifies resourceGroupName, clusterName. + * @param resourceGroupName The name of the resource group containing the Kusto cluster + * @param clusterName The name of the Kusto cluster + * @return the next definition stage + */ + WithCreate withExistingCluster(String resourceGroupName, String clusterName); + } + + /** + * The stage of the database 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 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 { + } + } + /** + * The template for a Database update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithLocation { + } + + /** + * Grouping of Database update stages. + */ + interface UpdateStages { + /** + * The stage of the database update allowing to specify Location. + */ + interface WithLocation { + /** + * Specifies location. + * @param location Resource location + * @return the next update stage + */ + Update withLocation(String location); + } + + } +} diff --git a/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/DatabasePrincipal.java b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/DatabasePrincipal.java new file mode 100644 index 0000000000000..74eb31ec38acf --- /dev/null +++ b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/DatabasePrincipal.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.kusto.v2020_06_14; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.kusto.v2020_06_14.implementation.KustoManager; +import com.microsoft.azure.management.kusto.v2020_06_14.implementation.DatabasePrincipalInner; + +/** + * Type representing DatabasePrincipal. + */ +public interface DatabasePrincipal extends HasInner, HasManager { + /** + * @return the appId value. + */ + String appId(); + + /** + * @return the email value. + */ + String email(); + + /** + * @return the fqn value. + */ + String fqn(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the role value. + */ + DatabasePrincipalRole role(); + + /** + * @return the tenantName value. + */ + String tenantName(); + + /** + * @return the type value. + */ + DatabasePrincipalType type(); + +} diff --git a/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/DatabasePrincipalAssignment.java b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/DatabasePrincipalAssignment.java new file mode 100644 index 0000000000000..da1d1cf8fa2ad --- /dev/null +++ b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/DatabasePrincipalAssignment.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.kusto.v2020_06_14; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.kusto.v2020_06_14.implementation.DatabasePrincipalAssignmentInner; +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.kusto.v2020_06_14.implementation.KustoManager; + +/** + * Type representing DatabasePrincipalAssignment. + */ +public interface DatabasePrincipalAssignment extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the id value. + */ + String id(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the principalId value. + */ + String principalId(); + + /** + * @return the principalName value. + */ + String principalName(); + + /** + * @return the principalType value. + */ + PrincipalType principalType(); + + /** + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * @return the role value. + */ + DatabasePrincipalRole role(); + + /** + * @return the tenantId value. + */ + String tenantId(); + + /** + * @return the tenantName value. + */ + String tenantName(); + + /** + * @return the type value. + */ + String type(); + + /** + * The entirety of the DatabasePrincipalAssignment definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithDatabasis, DefinitionStages.WithPrincipalId, DefinitionStages.WithPrincipalType, DefinitionStages.WithRole, DefinitionStages.WithCreate { + } + + /** + * Grouping of DatabasePrincipalAssignment definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a DatabasePrincipalAssignment definition. + */ + interface Blank extends WithDatabasis { + } + + /** + * The stage of the databaseprincipalassignment definition allowing to specify Databasis. + */ + interface WithDatabasis { + /** + * Specifies resourceGroupName, clusterName, databaseName. + * @param resourceGroupName The name of the resource group containing the Kusto cluster + * @param clusterName The name of the Kusto cluster + * @param databaseName The name of the database in the Kusto cluster + * @return the next definition stage + */ + WithPrincipalId withExistingDatabasis(String resourceGroupName, String clusterName, String databaseName); + } + + /** + * The stage of the databaseprincipalassignment definition allowing to specify PrincipalId. + */ + interface WithPrincipalId { + /** + * Specifies principalId. + * @param principalId The principal ID assigned to the database principal. It can be a user email, application ID, or security group name + * @return the next definition stage + */ + WithPrincipalType withPrincipalId(String principalId); + } + + /** + * The stage of the databaseprincipalassignment definition allowing to specify PrincipalType. + */ + interface WithPrincipalType { + /** + * Specifies principalType. + * @param principalType Principal type. Possible values include: 'App', 'Group', 'User' + * @return the next definition stage + */ + WithRole withPrincipalType(PrincipalType principalType); + } + + /** + * The stage of the databaseprincipalassignment definition allowing to specify Role. + */ + interface WithRole { + /** + * Specifies role. + * @param role Database principal role. Possible values include: 'Admin', 'Ingestor', 'Monitor', 'User', 'UnrestrictedViewers', 'Viewer' + * @return the next definition stage + */ + WithCreate withRole(DatabasePrincipalRole role); + } + + /** + * The stage of the databaseprincipalassignment definition allowing to specify TenantId. + */ + interface WithTenantId { + /** + * Specifies tenantId. + * @param tenantId The tenant id of the principal + * @return the next definition stage + */ + WithCreate withTenantId(String tenantId); + } + + /** + * 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.WithTenantId { + } + } + /** + * The template for a DatabasePrincipalAssignment update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithTenantId { + } + + /** + * Grouping of DatabasePrincipalAssignment update stages. + */ + interface UpdateStages { + /** + * The stage of the databaseprincipalassignment update allowing to specify TenantId. + */ + interface WithTenantId { + /** + * Specifies tenantId. + * @param tenantId The tenant id of the principal + * @return the next update stage + */ + Update withTenantId(String tenantId); + } + + } +} diff --git a/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/DatabasePrincipalAssignmentCheckNameRequest.java b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/DatabasePrincipalAssignmentCheckNameRequest.java new file mode 100644 index 0000000000000..bf4fd82fe7591 --- /dev/null +++ b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/DatabasePrincipalAssignmentCheckNameRequest.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.kusto.v2020_06_14; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * A principal assignment check name availability request. + */ +public class DatabasePrincipalAssignmentCheckNameRequest { + /** + * Principal Assignment resource name. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * The type of resource, + * Microsoft.Kusto/clusters/databases/principalAssignments. + */ + @JsonProperty(value = "type", required = true) + private String type; + + /** + * Creates an instance of DatabasePrincipalAssignmentCheckNameRequest class. + * @param name principal Assignment resource name. + */ + public DatabasePrincipalAssignmentCheckNameRequest() { + type = "Microsoft.Kusto/clusters/databases/principalAssignments"; + } + + /** + * Get principal Assignment resource name. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set principal Assignment resource name. + * + * @param name the name value to set + * @return the DatabasePrincipalAssignmentCheckNameRequest object itself. + */ + public DatabasePrincipalAssignmentCheckNameRequest withName(String name) { + this.name = name; + return this; + } + + /** + * Get the type of resource, Microsoft.Kusto/clusters/databases/principalAssignments. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Set the type of resource, Microsoft.Kusto/clusters/databases/principalAssignments. + * + * @param type the type value to set + * @return the DatabasePrincipalAssignmentCheckNameRequest object itself. + */ + public DatabasePrincipalAssignmentCheckNameRequest withType(String type) { + this.type = type; + return this; + } + +} diff --git a/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/DatabasePrincipalAssignments.java b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/DatabasePrincipalAssignments.java new file mode 100644 index 0000000000000..da138244439d4 --- /dev/null +++ b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/DatabasePrincipalAssignments.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.kusto.v2020_06_14; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.kusto.v2020_06_14.implementation.DatabasePrincipalAssignmentsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing DatabasePrincipalAssignments. + */ +public interface DatabasePrincipalAssignments extends SupportsCreating, HasInner { + /** + * Gets a Kusto cluster database principalAssignment. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param principalAssignmentName The name of the Kusto principalAssignment. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String clusterName, String databaseName, String principalAssignmentName); + + /** + * Lists all Kusto cluster database principalAssignments. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(String resourceGroupName, String clusterName, String databaseName); + + /** + * Deletes a Kusto principalAssignment. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param principalAssignmentName The name of the Kusto principalAssignment. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String clusterName, String databaseName, String principalAssignmentName); + + /** + * Checks that the database principal assignment is valid and is not already in use. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param name Principal Assignment resource name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable checkNameAvailabilityAsync(String resourceGroupName, String clusterName, String databaseName, String name); + +} diff --git a/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/DatabasePrincipalListRequest.java b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/DatabasePrincipalListRequest.java new file mode 100644 index 0000000000000..696ef032f05a0 --- /dev/null +++ b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/DatabasePrincipalListRequest.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.kusto.v2020_06_14; + +import java.util.List; +import com.microsoft.azure.management.kusto.v2020_06_14.implementation.DatabasePrincipalInner; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The list Kusto database principals operation request. + */ +public class DatabasePrincipalListRequest { + /** + * The list of Kusto database principals. + */ + @JsonProperty(value = "value") + private List value; + + /** + * Get the list of Kusto database principals. + * + * @return the value value + */ + public List value() { + return this.value; + } + + /** + * Set the list of Kusto database principals. + * + * @param value the value value to set + * @return the DatabasePrincipalListRequest object itself. + */ + public DatabasePrincipalListRequest withValue(List value) { + this.value = value; + return this; + } + +} diff --git a/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/DatabasePrincipalListResult.java b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/DatabasePrincipalListResult.java new file mode 100644 index 0000000000000..47bb56f9fdae0 --- /dev/null +++ b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/DatabasePrincipalListResult.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.kusto.v2020_06_14; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.kusto.v2020_06_14.implementation.KustoManager; +import com.microsoft.azure.management.kusto.v2020_06_14.implementation.DatabasePrincipalListResultInner; +import com.microsoft.azure.management.kusto.v2020_06_14.implementation.DatabasePrincipalInner; +import java.util.List; + +/** + * Type representing DatabasePrincipalListResult. + */ +public interface DatabasePrincipalListResult extends HasInner, HasManager { + /** + * @return the value value. + */ + List value(); + +} diff --git a/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/DatabasePrincipalRole.java b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/DatabasePrincipalRole.java new file mode 100644 index 0000000000000..2e0a35e584cce --- /dev/null +++ b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/DatabasePrincipalRole.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.kusto.v2020_06_14; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for DatabasePrincipalRole. + */ +public final class DatabasePrincipalRole extends ExpandableStringEnum { + /** Static value Admin for DatabasePrincipalRole. */ + public static final DatabasePrincipalRole ADMIN = fromString("Admin"); + + /** Static value Ingestor for DatabasePrincipalRole. */ + public static final DatabasePrincipalRole INGESTOR = fromString("Ingestor"); + + /** Static value Monitor for DatabasePrincipalRole. */ + public static final DatabasePrincipalRole MONITOR = fromString("Monitor"); + + /** Static value User for DatabasePrincipalRole. */ + public static final DatabasePrincipalRole USER = fromString("User"); + + /** Static value UnrestrictedViewers for DatabasePrincipalRole. */ + public static final DatabasePrincipalRole UNRESTRICTED_VIEWERS = fromString("UnrestrictedViewers"); + + /** Static value Viewer for DatabasePrincipalRole. */ + public static final DatabasePrincipalRole VIEWER = fromString("Viewer"); + + /** + * Creates or finds a DatabasePrincipalRole from its string representation. + * @param name a name to look for + * @return the corresponding DatabasePrincipalRole + */ + @JsonCreator + public static DatabasePrincipalRole fromString(String name) { + return fromString(name, DatabasePrincipalRole.class); + } + + /** + * @return known DatabasePrincipalRole values + */ + public static Collection values() { + return values(DatabasePrincipalRole.class); + } +} diff --git a/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/DatabasePrincipalType.java b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/DatabasePrincipalType.java new file mode 100644 index 0000000000000..02377c014e052 --- /dev/null +++ b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/DatabasePrincipalType.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.kusto.v2020_06_14; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for DatabasePrincipalType. + */ +public final class DatabasePrincipalType extends ExpandableStringEnum { + /** Static value App for DatabasePrincipalType. */ + public static final DatabasePrincipalType APP = fromString("App"); + + /** Static value Group for DatabasePrincipalType. */ + public static final DatabasePrincipalType GROUP = fromString("Group"); + + /** Static value User for DatabasePrincipalType. */ + public static final DatabasePrincipalType USER = fromString("User"); + + /** + * Creates or finds a DatabasePrincipalType from its string representation. + * @param name a name to look for + * @return the corresponding DatabasePrincipalType + */ + @JsonCreator + public static DatabasePrincipalType fromString(String name) { + return fromString(name, DatabasePrincipalType.class); + } + + /** + * @return known DatabasePrincipalType values + */ + public static Collection values() { + return values(DatabasePrincipalType.class); + } +} diff --git a/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/DatabaseStatistics.java b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/DatabaseStatistics.java new file mode 100644 index 0000000000000..2a94139fbe7e9 --- /dev/null +++ b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/DatabaseStatistics.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.kusto.v2020_06_14; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * A class that contains database statistics information. + */ +public class DatabaseStatistics { + /** + * The database size - the total size of compressed data and index in + * bytes. + */ + @JsonProperty(value = "size") + private Double size; + + /** + * Get the database size - the total size of compressed data and index in bytes. + * + * @return the size value + */ + public Double size() { + return this.size; + } + + /** + * Set the database size - the total size of compressed data and index in bytes. + * + * @param size the size value to set + * @return the DatabaseStatistics object itself. + */ + public DatabaseStatistics withSize(Double size) { + this.size = size; + return this; + } + +} diff --git a/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/Databases.java b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/Databases.java new file mode 100644 index 0000000000000..4ab5c4e84045d --- /dev/null +++ b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/Databases.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.kusto.v2020_06_14; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.kusto.v2020_06_14.implementation.DatabasesInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Databases. + */ +public interface Databases extends SupportsCreating, HasInner { + /** + * Returns a list of database principals of the given Kusto cluster and database. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listPrincipalsAsync(String resourceGroupName, String clusterName, String databaseName); + + /** + * Add Database principals permissions. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable addPrincipalsAsync(String resourceGroupName, String clusterName, String databaseName); + + /** + * Remove Database principals permissions. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable removePrincipalsAsync(String resourceGroupName, String clusterName, String databaseName); + + /** + * Returns a database. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String clusterName, String databaseName); + + /** + * Returns the list of databases of the given Kusto cluster. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listByClusterAsync(String resourceGroupName, String clusterName); + + /** + * Deletes the database with the given name. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String clusterName, String databaseName); + + /** + * Checks that the database name is valid and is not already in use. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param resourceName The name of the resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable checkNameAvailabilityAsync(String resourceGroupName, String clusterName, CheckNameRequest resourceName); + +} diff --git a/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/DefaultPrincipalsModificationKind.java b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/DefaultPrincipalsModificationKind.java new file mode 100644 index 0000000000000..5fdbb8cd5cc30 --- /dev/null +++ b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/DefaultPrincipalsModificationKind.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.kusto.v2020_06_14; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for DefaultPrincipalsModificationKind. + */ +public final class DefaultPrincipalsModificationKind extends ExpandableStringEnum { + /** Static value Union for DefaultPrincipalsModificationKind. */ + public static final DefaultPrincipalsModificationKind UNION = fromString("Union"); + + /** Static value Replace for DefaultPrincipalsModificationKind. */ + public static final DefaultPrincipalsModificationKind REPLACE = fromString("Replace"); + + /** Static value None for DefaultPrincipalsModificationKind. */ + public static final DefaultPrincipalsModificationKind NONE = fromString("None"); + + /** + * Creates or finds a DefaultPrincipalsModificationKind from its string representation. + * @param name a name to look for + * @return the corresponding DefaultPrincipalsModificationKind + */ + @JsonCreator + public static DefaultPrincipalsModificationKind fromString(String name) { + return fromString(name, DefaultPrincipalsModificationKind.class); + } + + /** + * @return known DefaultPrincipalsModificationKind values + */ + public static Collection values() { + return values(DefaultPrincipalsModificationKind.class); + } +} diff --git a/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/DiagnoseVirtualNetworkResult.java b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/DiagnoseVirtualNetworkResult.java new file mode 100644 index 0000000000000..873dab2fa2f2c --- /dev/null +++ b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/DiagnoseVirtualNetworkResult.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.kusto.v2020_06_14; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.kusto.v2020_06_14.implementation.KustoManager; +import com.microsoft.azure.management.kusto.v2020_06_14.implementation.DiagnoseVirtualNetworkResultInner; +import java.util.List; + +/** + * Type representing DiagnoseVirtualNetworkResult. + */ +public interface DiagnoseVirtualNetworkResult extends HasInner, HasManager { + /** + * @return the findings value. + */ + List findings(); + +} diff --git a/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/EventGridDataConnection.java b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/EventGridDataConnection.java new file mode 100644 index 0000000000000..2b72659d6624d --- /dev/null +++ b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/EventGridDataConnection.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.kusto.v2020_06_14; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.management.kusto.v2020_06_14.implementation.DataConnectionInner; + +/** + * Class representing an Event Grid data connection. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind", defaultImpl = EventGridDataConnection.class) +@JsonTypeName("EventGrid") +@JsonFlatten +public class EventGridDataConnection extends DataConnectionInner { + /** + * The resource ID of the storage account where the data resides. + */ + @JsonProperty(value = "properties.storageAccountResourceId", required = true) + private String storageAccountResourceId; + + /** + * The resource ID where the event grid is configured to send events. + */ + @JsonProperty(value = "properties.eventHubResourceId", required = true) + private String eventHubResourceId; + + /** + * The event hub consumer group. + */ + @JsonProperty(value = "properties.consumerGroup", required = true) + private String consumerGroup; + + /** + * The table where the data should be ingested. Optionally the table + * information can be added to each message. + */ + @JsonProperty(value = "properties.tableName") + private String tableName; + + /** + * The mapping rule to be used to ingest the data. Optionally the mapping + * information can be added to each message. + */ + @JsonProperty(value = "properties.mappingRuleName") + private String mappingRuleName; + + /** + * The data format of the message. Optionally the data format can be added + * to each message. Possible values include: 'MULTIJSON', 'JSON', 'CSV', + * 'TSV', 'SCSV', 'SOHSV', 'PSV', 'TXT', 'RAW', 'SINGLEJSON', 'AVRO', + * 'TSVE', 'PARQUET', 'ORC', 'APACHEAVRO', 'W3CLOGFILE'. + */ + @JsonProperty(value = "properties.dataFormat") + private EventGridDataFormat dataFormat; + + /** + * A Boolean value that, if set to true, indicates that ingestion should + * ignore the first record of every file. + */ + @JsonProperty(value = "properties.ignoreFirstRecord") + private Boolean ignoreFirstRecord; + + /** + * The name of blob storage event type to process. Possible values include: + * 'Microsoft.Storage.BlobCreated', 'Microsoft.Storage.BlobRenamed'. + */ + @JsonProperty(value = "properties.blobStorageEventType") + private BlobStorageEventType blobStorageEventType; + + /** + * Get the resource ID of the storage account where the data resides. + * + * @return the storageAccountResourceId value + */ + public String storageAccountResourceId() { + return this.storageAccountResourceId; + } + + /** + * Set the resource ID of the storage account where the data resides. + * + * @param storageAccountResourceId the storageAccountResourceId value to set + * @return the EventGridDataConnection object itself. + */ + public EventGridDataConnection withStorageAccountResourceId(String storageAccountResourceId) { + this.storageAccountResourceId = storageAccountResourceId; + return this; + } + + /** + * Get the resource ID where the event grid is configured to send events. + * + * @return the eventHubResourceId value + */ + public String eventHubResourceId() { + return this.eventHubResourceId; + } + + /** + * Set the resource ID where the event grid is configured to send events. + * + * @param eventHubResourceId the eventHubResourceId value to set + * @return the EventGridDataConnection object itself. + */ + public EventGridDataConnection withEventHubResourceId(String eventHubResourceId) { + this.eventHubResourceId = eventHubResourceId; + return this; + } + + /** + * Get the event hub consumer group. + * + * @return the consumerGroup value + */ + public String consumerGroup() { + return this.consumerGroup; + } + + /** + * Set the event hub consumer group. + * + * @param consumerGroup the consumerGroup value to set + * @return the EventGridDataConnection object itself. + */ + public EventGridDataConnection withConsumerGroup(String consumerGroup) { + this.consumerGroup = consumerGroup; + return this; + } + + /** + * Get the table where the data should be ingested. Optionally the table information can be added to each message. + * + * @return the tableName value + */ + public String tableName() { + return this.tableName; + } + + /** + * Set the table where the data should be ingested. Optionally the table information can be added to each message. + * + * @param tableName the tableName value to set + * @return the EventGridDataConnection object itself. + */ + public EventGridDataConnection withTableName(String tableName) { + this.tableName = tableName; + return this; + } + + /** + * Get the mapping rule to be used to ingest the data. Optionally the mapping information can be added to each message. + * + * @return the mappingRuleName value + */ + public String mappingRuleName() { + return this.mappingRuleName; + } + + /** + * Set the mapping rule to be used to ingest the data. Optionally the mapping information can be added to each message. + * + * @param mappingRuleName the mappingRuleName value to set + * @return the EventGridDataConnection object itself. + */ + public EventGridDataConnection withMappingRuleName(String mappingRuleName) { + this.mappingRuleName = mappingRuleName; + return this; + } + + /** + * Get the data format of the message. Optionally the data format can be added to each message. Possible values include: 'MULTIJSON', 'JSON', 'CSV', 'TSV', 'SCSV', 'SOHSV', 'PSV', 'TXT', 'RAW', 'SINGLEJSON', 'AVRO', 'TSVE', 'PARQUET', 'ORC', 'APACHEAVRO', 'W3CLOGFILE'. + * + * @return the dataFormat value + */ + public EventGridDataFormat dataFormat() { + return this.dataFormat; + } + + /** + * Set the data format of the message. Optionally the data format can be added to each message. Possible values include: 'MULTIJSON', 'JSON', 'CSV', 'TSV', 'SCSV', 'SOHSV', 'PSV', 'TXT', 'RAW', 'SINGLEJSON', 'AVRO', 'TSVE', 'PARQUET', 'ORC', 'APACHEAVRO', 'W3CLOGFILE'. + * + * @param dataFormat the dataFormat value to set + * @return the EventGridDataConnection object itself. + */ + public EventGridDataConnection withDataFormat(EventGridDataFormat dataFormat) { + this.dataFormat = dataFormat; + return this; + } + + /** + * Get a Boolean value that, if set to true, indicates that ingestion should ignore the first record of every file. + * + * @return the ignoreFirstRecord value + */ + public Boolean ignoreFirstRecord() { + return this.ignoreFirstRecord; + } + + /** + * Set a Boolean value that, if set to true, indicates that ingestion should ignore the first record of every file. + * + * @param ignoreFirstRecord the ignoreFirstRecord value to set + * @return the EventGridDataConnection object itself. + */ + public EventGridDataConnection withIgnoreFirstRecord(Boolean ignoreFirstRecord) { + this.ignoreFirstRecord = ignoreFirstRecord; + return this; + } + + /** + * Get the name of blob storage event type to process. Possible values include: 'Microsoft.Storage.BlobCreated', 'Microsoft.Storage.BlobRenamed'. + * + * @return the blobStorageEventType value + */ + public BlobStorageEventType blobStorageEventType() { + return this.blobStorageEventType; + } + + /** + * Set the name of blob storage event type to process. Possible values include: 'Microsoft.Storage.BlobCreated', 'Microsoft.Storage.BlobRenamed'. + * + * @param blobStorageEventType the blobStorageEventType value to set + * @return the EventGridDataConnection object itself. + */ + public EventGridDataConnection withBlobStorageEventType(BlobStorageEventType blobStorageEventType) { + this.blobStorageEventType = blobStorageEventType; + return this; + } + +} diff --git a/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/EventGridDataFormat.java b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/EventGridDataFormat.java new file mode 100644 index 0000000000000..1c165addff4be --- /dev/null +++ b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/EventGridDataFormat.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.kusto.v2020_06_14; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for EventGridDataFormat. + */ +public final class EventGridDataFormat extends ExpandableStringEnum { + /** Static value MULTIJSON for EventGridDataFormat. */ + public static final EventGridDataFormat MULTIJSON = fromString("MULTIJSON"); + + /** Static value JSON for EventGridDataFormat. */ + public static final EventGridDataFormat JSON = fromString("JSON"); + + /** Static value CSV for EventGridDataFormat. */ + public static final EventGridDataFormat CSV = fromString("CSV"); + + /** Static value TSV for EventGridDataFormat. */ + public static final EventGridDataFormat TSV = fromString("TSV"); + + /** Static value SCSV for EventGridDataFormat. */ + public static final EventGridDataFormat SCSV = fromString("SCSV"); + + /** Static value SOHSV for EventGridDataFormat. */ + public static final EventGridDataFormat SOHSV = fromString("SOHSV"); + + /** Static value PSV for EventGridDataFormat. */ + public static final EventGridDataFormat PSV = fromString("PSV"); + + /** Static value TXT for EventGridDataFormat. */ + public static final EventGridDataFormat TXT = fromString("TXT"); + + /** Static value RAW for EventGridDataFormat. */ + public static final EventGridDataFormat RAW = fromString("RAW"); + + /** Static value SINGLEJSON for EventGridDataFormat. */ + public static final EventGridDataFormat SINGLEJSON = fromString("SINGLEJSON"); + + /** Static value AVRO for EventGridDataFormat. */ + public static final EventGridDataFormat AVRO = fromString("AVRO"); + + /** Static value TSVE for EventGridDataFormat. */ + public static final EventGridDataFormat TSVE = fromString("TSVE"); + + /** Static value PARQUET for EventGridDataFormat. */ + public static final EventGridDataFormat PARQUET = fromString("PARQUET"); + + /** Static value ORC for EventGridDataFormat. */ + public static final EventGridDataFormat ORC = fromString("ORC"); + + /** Static value APACHEAVRO for EventGridDataFormat. */ + public static final EventGridDataFormat APACHEAVRO = fromString("APACHEAVRO"); + + /** Static value W3CLOGFILE for EventGridDataFormat. */ + public static final EventGridDataFormat W3CLOGFILE = fromString("W3CLOGFILE"); + + /** + * Creates or finds a EventGridDataFormat from its string representation. + * @param name a name to look for + * @return the corresponding EventGridDataFormat + */ + @JsonCreator + public static EventGridDataFormat fromString(String name) { + return fromString(name, EventGridDataFormat.class); + } + + /** + * @return known EventGridDataFormat values + */ + public static Collection values() { + return values(EventGridDataFormat.class); + } +} diff --git a/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/EventHubDataConnection.java b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/EventHubDataConnection.java new file mode 100644 index 0000000000000..256477992bea6 --- /dev/null +++ b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/EventHubDataConnection.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.kusto.v2020_06_14; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.management.kusto.v2020_06_14.implementation.DataConnectionInner; + +/** + * Class representing an event hub data connection. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind", defaultImpl = EventHubDataConnection.class) +@JsonTypeName("EventHub") +@JsonFlatten +public class EventHubDataConnection extends DataConnectionInner { + /** + * The resource ID of the event hub to be used to create a data connection. + */ + @JsonProperty(value = "properties.eventHubResourceId", required = true) + private String eventHubResourceId; + + /** + * The event hub consumer group. + */ + @JsonProperty(value = "properties.consumerGroup", required = true) + private String consumerGroup; + + /** + * The table where the data should be ingested. Optionally the table + * information can be added to each message. + */ + @JsonProperty(value = "properties.tableName") + private String tableName; + + /** + * The mapping rule to be used to ingest the data. Optionally the mapping + * information can be added to each message. + */ + @JsonProperty(value = "properties.mappingRuleName") + private String mappingRuleName; + + /** + * The data format of the message. Optionally the data format can be added + * to each message. Possible values include: 'MULTIJSON', 'JSON', 'CSV', + * 'TSV', 'SCSV', 'SOHSV', 'PSV', 'TXT', 'RAW', 'SINGLEJSON', 'AVRO', + * 'TSVE', 'PARQUET', 'ORC', 'APACHEAVRO', 'W3CLOGFILE'. + */ + @JsonProperty(value = "properties.dataFormat") + private EventHubDataFormat dataFormat; + + /** + * System properties of the event hub. + */ + @JsonProperty(value = "properties.eventSystemProperties") + private List eventSystemProperties; + + /** + * The event hub messages compression type. Possible values include: + * 'None', 'GZip'. + */ + @JsonProperty(value = "properties.compression") + private Compression compression; + + /** + * Get the resource ID of the event hub to be used to create a data connection. + * + * @return the eventHubResourceId value + */ + public String eventHubResourceId() { + return this.eventHubResourceId; + } + + /** + * Set the resource ID of the event hub to be used to create a data connection. + * + * @param eventHubResourceId the eventHubResourceId value to set + * @return the EventHubDataConnection object itself. + */ + public EventHubDataConnection withEventHubResourceId(String eventHubResourceId) { + this.eventHubResourceId = eventHubResourceId; + return this; + } + + /** + * Get the event hub consumer group. + * + * @return the consumerGroup value + */ + public String consumerGroup() { + return this.consumerGroup; + } + + /** + * Set the event hub consumer group. + * + * @param consumerGroup the consumerGroup value to set + * @return the EventHubDataConnection object itself. + */ + public EventHubDataConnection withConsumerGroup(String consumerGroup) { + this.consumerGroup = consumerGroup; + return this; + } + + /** + * Get the table where the data should be ingested. Optionally the table information can be added to each message. + * + * @return the tableName value + */ + public String tableName() { + return this.tableName; + } + + /** + * Set the table where the data should be ingested. Optionally the table information can be added to each message. + * + * @param tableName the tableName value to set + * @return the EventHubDataConnection object itself. + */ + public EventHubDataConnection withTableName(String tableName) { + this.tableName = tableName; + return this; + } + + /** + * Get the mapping rule to be used to ingest the data. Optionally the mapping information can be added to each message. + * + * @return the mappingRuleName value + */ + public String mappingRuleName() { + return this.mappingRuleName; + } + + /** + * Set the mapping rule to be used to ingest the data. Optionally the mapping information can be added to each message. + * + * @param mappingRuleName the mappingRuleName value to set + * @return the EventHubDataConnection object itself. + */ + public EventHubDataConnection withMappingRuleName(String mappingRuleName) { + this.mappingRuleName = mappingRuleName; + return this; + } + + /** + * Get the data format of the message. Optionally the data format can be added to each message. Possible values include: 'MULTIJSON', 'JSON', 'CSV', 'TSV', 'SCSV', 'SOHSV', 'PSV', 'TXT', 'RAW', 'SINGLEJSON', 'AVRO', 'TSVE', 'PARQUET', 'ORC', 'APACHEAVRO', 'W3CLOGFILE'. + * + * @return the dataFormat value + */ + public EventHubDataFormat dataFormat() { + return this.dataFormat; + } + + /** + * Set the data format of the message. Optionally the data format can be added to each message. Possible values include: 'MULTIJSON', 'JSON', 'CSV', 'TSV', 'SCSV', 'SOHSV', 'PSV', 'TXT', 'RAW', 'SINGLEJSON', 'AVRO', 'TSVE', 'PARQUET', 'ORC', 'APACHEAVRO', 'W3CLOGFILE'. + * + * @param dataFormat the dataFormat value to set + * @return the EventHubDataConnection object itself. + */ + public EventHubDataConnection withDataFormat(EventHubDataFormat dataFormat) { + this.dataFormat = dataFormat; + return this; + } + + /** + * Get system properties of the event hub. + * + * @return the eventSystemProperties value + */ + public List eventSystemProperties() { + return this.eventSystemProperties; + } + + /** + * Set system properties of the event hub. + * + * @param eventSystemProperties the eventSystemProperties value to set + * @return the EventHubDataConnection object itself. + */ + public EventHubDataConnection withEventSystemProperties(List eventSystemProperties) { + this.eventSystemProperties = eventSystemProperties; + return this; + } + + /** + * Get the event hub messages compression type. Possible values include: 'None', 'GZip'. + * + * @return the compression value + */ + public Compression compression() { + return this.compression; + } + + /** + * Set the event hub messages compression type. Possible values include: 'None', 'GZip'. + * + * @param compression the compression value to set + * @return the EventHubDataConnection object itself. + */ + public EventHubDataConnection withCompression(Compression compression) { + this.compression = compression; + return this; + } + +} diff --git a/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/EventHubDataFormat.java b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/EventHubDataFormat.java new file mode 100644 index 0000000000000..eec8f6fbd2e22 --- /dev/null +++ b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/EventHubDataFormat.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.kusto.v2020_06_14; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for EventHubDataFormat. + */ +public final class EventHubDataFormat extends ExpandableStringEnum { + /** Static value MULTIJSON for EventHubDataFormat. */ + public static final EventHubDataFormat MULTIJSON = fromString("MULTIJSON"); + + /** Static value JSON for EventHubDataFormat. */ + public static final EventHubDataFormat JSON = fromString("JSON"); + + /** Static value CSV for EventHubDataFormat. */ + public static final EventHubDataFormat CSV = fromString("CSV"); + + /** Static value TSV for EventHubDataFormat. */ + public static final EventHubDataFormat TSV = fromString("TSV"); + + /** Static value SCSV for EventHubDataFormat. */ + public static final EventHubDataFormat SCSV = fromString("SCSV"); + + /** Static value SOHSV for EventHubDataFormat. */ + public static final EventHubDataFormat SOHSV = fromString("SOHSV"); + + /** Static value PSV for EventHubDataFormat. */ + public static final EventHubDataFormat PSV = fromString("PSV"); + + /** Static value TXT for EventHubDataFormat. */ + public static final EventHubDataFormat TXT = fromString("TXT"); + + /** Static value RAW for EventHubDataFormat. */ + public static final EventHubDataFormat RAW = fromString("RAW"); + + /** Static value SINGLEJSON for EventHubDataFormat. */ + public static final EventHubDataFormat SINGLEJSON = fromString("SINGLEJSON"); + + /** Static value AVRO for EventHubDataFormat. */ + public static final EventHubDataFormat AVRO = fromString("AVRO"); + + /** Static value TSVE for EventHubDataFormat. */ + public static final EventHubDataFormat TSVE = fromString("TSVE"); + + /** Static value PARQUET for EventHubDataFormat. */ + public static final EventHubDataFormat PARQUET = fromString("PARQUET"); + + /** Static value ORC for EventHubDataFormat. */ + public static final EventHubDataFormat ORC = fromString("ORC"); + + /** Static value APACHEAVRO for EventHubDataFormat. */ + public static final EventHubDataFormat APACHEAVRO = fromString("APACHEAVRO"); + + /** Static value W3CLOGFILE for EventHubDataFormat. */ + public static final EventHubDataFormat W3CLOGFILE = fromString("W3CLOGFILE"); + + /** + * Creates or finds a EventHubDataFormat from its string representation. + * @param name a name to look for + * @return the corresponding EventHubDataFormat + */ + @JsonCreator + public static EventHubDataFormat fromString(String name) { + return fromString(name, EventHubDataFormat.class); + } + + /** + * @return known EventHubDataFormat values + */ + public static Collection values() { + return values(EventHubDataFormat.class); + } +} diff --git a/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/FollowerDatabaseDefinition.java b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/FollowerDatabaseDefinition.java new file mode 100644 index 0000000000000..c7f7c1597fb49 --- /dev/null +++ b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/FollowerDatabaseDefinition.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.kusto.v2020_06_14; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.kusto.v2020_06_14.implementation.KustoManager; +import com.microsoft.azure.management.kusto.v2020_06_14.implementation.FollowerDatabaseDefinitionInner; + +/** + * Type representing FollowerDatabaseDefinition. + */ +public interface FollowerDatabaseDefinition extends HasInner, HasManager { + /** + * @return the attachedDatabaseConfigurationName value. + */ + String attachedDatabaseConfigurationName(); + + /** + * @return the clusterResourceId value. + */ + String clusterResourceId(); + + /** + * @return the databaseName value. + */ + String databaseName(); + +} diff --git a/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/Identity.java b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/Identity.java new file mode 100644 index 0000000000000..8e79abbfe5d5d --- /dev/null +++ b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/Identity.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.kusto.v2020_06_14; + +import java.util.Map; +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. Possible values include: 'None', 'SystemAssigned'. + */ + @JsonProperty(value = "type", required = true) + private IdentityType type; + + /** + * The list of user identities associated with the Kusto cluster. 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 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. Possible values include: 'None', 'SystemAssigned'. + * + * @return the type value + */ + public IdentityType type() { + return this.type; + } + + /** + * Set the identity type. Possible values include: 'None', 'SystemAssigned'. + * + * @param type the type value to set + * @return the Identity object itself. + */ + public Identity withType(IdentityType type) { + this.type = type; + return this; + } + + /** + * Get the list of user identities associated with the Kusto cluster. 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 Kusto cluster. 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 Identity object itself. + */ + public Identity withUserAssignedIdentities(Map userAssignedIdentities) { + this.userAssignedIdentities = userAssignedIdentities; + return this; + } + +} diff --git a/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/IdentityType.java b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/IdentityType.java new file mode 100644 index 0000000000000..338dbbe8c287a --- /dev/null +++ b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/IdentityType.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.kusto.v2020_06_14; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for IdentityType. + */ +public enum IdentityType { + /** Enum value None. */ + NONE("None"), + + /** Enum value SystemAssigned. */ + SYSTEM_ASSIGNED("SystemAssigned"); + + /** The actual serialized value for a IdentityType instance. */ + private String value; + + IdentityType(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a IdentityType instance. + * + * @param value the serialized value to parse. + * @return the parsed IdentityType object, or null if unable to parse. + */ + @JsonCreator + public static IdentityType fromString(String value) { + IdentityType[] items = IdentityType.values(); + for (IdentityType item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/IdentityUserAssignedIdentitiesValue.java b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/IdentityUserAssignedIdentitiesValue.java new file mode 100644 index 0000000000000..bf126e2849b90 --- /dev/null +++ b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/IdentityUserAssignedIdentitiesValue.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.kusto.v2020_06_14; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The IdentityUserAssignedIdentitiesValue model. + */ +public class IdentityUserAssignedIdentitiesValue { + /** + * 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/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/IotHubDataConnection.java b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/IotHubDataConnection.java new file mode 100644 index 0000000000000..30e371304d548 --- /dev/null +++ b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/IotHubDataConnection.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. + */ + +package com.microsoft.azure.management.kusto.v2020_06_14; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.management.kusto.v2020_06_14.implementation.DataConnectionInner; + +/** + * Class representing an iot hub data connection. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind", defaultImpl = IotHubDataConnection.class) +@JsonTypeName("IotHub") +@JsonFlatten +public class IotHubDataConnection extends DataConnectionInner { + /** + * The resource ID of the Iot hub to be used to create a data connection. + */ + @JsonProperty(value = "properties.iotHubResourceId", required = true) + private String iotHubResourceId; + + /** + * The iot hub consumer group. + */ + @JsonProperty(value = "properties.consumerGroup", required = true) + private String consumerGroup; + + /** + * The table where the data should be ingested. Optionally the table + * information can be added to each message. + */ + @JsonProperty(value = "properties.tableName") + private String tableName; + + /** + * The mapping rule to be used to ingest the data. Optionally the mapping + * information can be added to each message. + */ + @JsonProperty(value = "properties.mappingRuleName") + private String mappingRuleName; + + /** + * The data format of the message. Optionally the data format can be added + * to each message. Possible values include: 'MULTIJSON', 'JSON', 'CSV', + * 'TSV', 'SCSV', 'SOHSV', 'PSV', 'TXT', 'RAW', 'SINGLEJSON', 'AVRO', + * 'TSVE', 'PARQUET', 'ORC', 'APACHEAVRO', 'W3CLOGFILE'. + */ + @JsonProperty(value = "properties.dataFormat") + private IotHubDataFormat dataFormat; + + /** + * System properties of the iot hub. + */ + @JsonProperty(value = "properties.eventSystemProperties") + private List eventSystemProperties; + + /** + * The name of the share access policy. + */ + @JsonProperty(value = "properties.sharedAccessPolicyName", required = true) + private String sharedAccessPolicyName; + + /** + * Get the resource ID of the Iot hub to be used to create a data connection. + * + * @return the iotHubResourceId value + */ + public String iotHubResourceId() { + return this.iotHubResourceId; + } + + /** + * Set the resource ID of the Iot hub to be used to create a data connection. + * + * @param iotHubResourceId the iotHubResourceId value to set + * @return the IotHubDataConnection object itself. + */ + public IotHubDataConnection withIotHubResourceId(String iotHubResourceId) { + this.iotHubResourceId = iotHubResourceId; + return this; + } + + /** + * Get the iot hub consumer group. + * + * @return the consumerGroup value + */ + public String consumerGroup() { + return this.consumerGroup; + } + + /** + * Set the iot hub consumer group. + * + * @param consumerGroup the consumerGroup value to set + * @return the IotHubDataConnection object itself. + */ + public IotHubDataConnection withConsumerGroup(String consumerGroup) { + this.consumerGroup = consumerGroup; + return this; + } + + /** + * Get the table where the data should be ingested. Optionally the table information can be added to each message. + * + * @return the tableName value + */ + public String tableName() { + return this.tableName; + } + + /** + * Set the table where the data should be ingested. Optionally the table information can be added to each message. + * + * @param tableName the tableName value to set + * @return the IotHubDataConnection object itself. + */ + public IotHubDataConnection withTableName(String tableName) { + this.tableName = tableName; + return this; + } + + /** + * Get the mapping rule to be used to ingest the data. Optionally the mapping information can be added to each message. + * + * @return the mappingRuleName value + */ + public String mappingRuleName() { + return this.mappingRuleName; + } + + /** + * Set the mapping rule to be used to ingest the data. Optionally the mapping information can be added to each message. + * + * @param mappingRuleName the mappingRuleName value to set + * @return the IotHubDataConnection object itself. + */ + public IotHubDataConnection withMappingRuleName(String mappingRuleName) { + this.mappingRuleName = mappingRuleName; + return this; + } + + /** + * Get the data format of the message. Optionally the data format can be added to each message. Possible values include: 'MULTIJSON', 'JSON', 'CSV', 'TSV', 'SCSV', 'SOHSV', 'PSV', 'TXT', 'RAW', 'SINGLEJSON', 'AVRO', 'TSVE', 'PARQUET', 'ORC', 'APACHEAVRO', 'W3CLOGFILE'. + * + * @return the dataFormat value + */ + public IotHubDataFormat dataFormat() { + return this.dataFormat; + } + + /** + * Set the data format of the message. Optionally the data format can be added to each message. Possible values include: 'MULTIJSON', 'JSON', 'CSV', 'TSV', 'SCSV', 'SOHSV', 'PSV', 'TXT', 'RAW', 'SINGLEJSON', 'AVRO', 'TSVE', 'PARQUET', 'ORC', 'APACHEAVRO', 'W3CLOGFILE'. + * + * @param dataFormat the dataFormat value to set + * @return the IotHubDataConnection object itself. + */ + public IotHubDataConnection withDataFormat(IotHubDataFormat dataFormat) { + this.dataFormat = dataFormat; + return this; + } + + /** + * Get system properties of the iot hub. + * + * @return the eventSystemProperties value + */ + public List eventSystemProperties() { + return this.eventSystemProperties; + } + + /** + * Set system properties of the iot hub. + * + * @param eventSystemProperties the eventSystemProperties value to set + * @return the IotHubDataConnection object itself. + */ + public IotHubDataConnection withEventSystemProperties(List eventSystemProperties) { + this.eventSystemProperties = eventSystemProperties; + return this; + } + + /** + * Get the name of the share access policy. + * + * @return the sharedAccessPolicyName value + */ + public String sharedAccessPolicyName() { + return this.sharedAccessPolicyName; + } + + /** + * Set the name of the share access policy. + * + * @param sharedAccessPolicyName the sharedAccessPolicyName value to set + * @return the IotHubDataConnection object itself. + */ + public IotHubDataConnection withSharedAccessPolicyName(String sharedAccessPolicyName) { + this.sharedAccessPolicyName = sharedAccessPolicyName; + return this; + } + +} diff --git a/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/IotHubDataFormat.java b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/IotHubDataFormat.java new file mode 100644 index 0000000000000..2ff2ba9ce5aba --- /dev/null +++ b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/IotHubDataFormat.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.kusto.v2020_06_14; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for IotHubDataFormat. + */ +public final class IotHubDataFormat extends ExpandableStringEnum { + /** Static value MULTIJSON for IotHubDataFormat. */ + public static final IotHubDataFormat MULTIJSON = fromString("MULTIJSON"); + + /** Static value JSON for IotHubDataFormat. */ + public static final IotHubDataFormat JSON = fromString("JSON"); + + /** Static value CSV for IotHubDataFormat. */ + public static final IotHubDataFormat CSV = fromString("CSV"); + + /** Static value TSV for IotHubDataFormat. */ + public static final IotHubDataFormat TSV = fromString("TSV"); + + /** Static value SCSV for IotHubDataFormat. */ + public static final IotHubDataFormat SCSV = fromString("SCSV"); + + /** Static value SOHSV for IotHubDataFormat. */ + public static final IotHubDataFormat SOHSV = fromString("SOHSV"); + + /** Static value PSV for IotHubDataFormat. */ + public static final IotHubDataFormat PSV = fromString("PSV"); + + /** Static value TXT for IotHubDataFormat. */ + public static final IotHubDataFormat TXT = fromString("TXT"); + + /** Static value RAW for IotHubDataFormat. */ + public static final IotHubDataFormat RAW = fromString("RAW"); + + /** Static value SINGLEJSON for IotHubDataFormat. */ + public static final IotHubDataFormat SINGLEJSON = fromString("SINGLEJSON"); + + /** Static value AVRO for IotHubDataFormat. */ + public static final IotHubDataFormat AVRO = fromString("AVRO"); + + /** Static value TSVE for IotHubDataFormat. */ + public static final IotHubDataFormat TSVE = fromString("TSVE"); + + /** Static value PARQUET for IotHubDataFormat. */ + public static final IotHubDataFormat PARQUET = fromString("PARQUET"); + + /** Static value ORC for IotHubDataFormat. */ + public static final IotHubDataFormat ORC = fromString("ORC"); + + /** Static value APACHEAVRO for IotHubDataFormat. */ + public static final IotHubDataFormat APACHEAVRO = fromString("APACHEAVRO"); + + /** Static value W3CLOGFILE for IotHubDataFormat. */ + public static final IotHubDataFormat W3CLOGFILE = fromString("W3CLOGFILE"); + + /** + * Creates or finds a IotHubDataFormat from its string representation. + * @param name a name to look for + * @return the corresponding IotHubDataFormat + */ + @JsonCreator + public static IotHubDataFormat fromString(String name) { + return fromString(name, IotHubDataFormat.class); + } + + /** + * @return known IotHubDataFormat values + */ + public static Collection values() { + return values(IotHubDataFormat.class); + } +} diff --git a/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/KeyVaultProperties.java b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/KeyVaultProperties.java new file mode 100644 index 0000000000000..e9f28a844aa47 --- /dev/null +++ b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/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.kusto.v2020_06_14; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Properties of the key vault. + */ +public class KeyVaultProperties { + /** + * The name of the key vault key. + */ + @JsonProperty(value = "keyName", required = true) + private String keyName; + + /** + * The version of the key vault key. + */ + @JsonProperty(value = "keyVersion", required = true) + private String keyVersion; + + /** + * The Uri of the key vault. + */ + @JsonProperty(value = "keyVaultUri", required = true) + private String keyVaultUri; + + /** + * Get the name of the key vault key. + * + * @return the keyName value + */ + public String keyName() { + return this.keyName; + } + + /** + * Set the name of the key vault 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 the key vault key. + * + * @return the keyVersion value + */ + public String keyVersion() { + return this.keyVersion; + } + + /** + * Set the version of the key vault 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 the key vault. + * + * @return the keyVaultUri value + */ + public String keyVaultUri() { + return this.keyVaultUri; + } + + /** + * Set the Uri of the key vault. + * + * @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/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/LanguageExtension.java b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/LanguageExtension.java new file mode 100644 index 0000000000000..991f31dc35f03 --- /dev/null +++ b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/LanguageExtension.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.kusto.v2020_06_14; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.kusto.v2020_06_14.implementation.KustoManager; +import com.microsoft.azure.management.kusto.v2020_06_14.implementation.LanguageExtensionInner; + +/** + * Type representing LanguageExtension. + */ +public interface LanguageExtension extends HasInner, HasManager { + /** + * @return the languageExtensionName value. + */ + LanguageExtensionName languageExtensionName(); + +} diff --git a/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/LanguageExtensionName.java b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/LanguageExtensionName.java new file mode 100644 index 0000000000000..9f861a5700540 --- /dev/null +++ b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/LanguageExtensionName.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.kusto.v2020_06_14; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for LanguageExtensionName. + */ +public final class LanguageExtensionName extends ExpandableStringEnum { + /** Static value PYTHON for LanguageExtensionName. */ + public static final LanguageExtensionName PYTHON = fromString("PYTHON"); + + /** Static value R for LanguageExtensionName. */ + public static final LanguageExtensionName R = fromString("R"); + + /** + * Creates or finds a LanguageExtensionName from its string representation. + * @param name a name to look for + * @return the corresponding LanguageExtensionName + */ + @JsonCreator + public static LanguageExtensionName fromString(String name) { + return fromString(name, LanguageExtensionName.class); + } + + /** + * @return known LanguageExtensionName values + */ + public static Collection values() { + return values(LanguageExtensionName.class); + } +} diff --git a/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/LanguageExtensionsList.java b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/LanguageExtensionsList.java new file mode 100644 index 0000000000000..0a2c4cfd933a2 --- /dev/null +++ b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/LanguageExtensionsList.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.kusto.v2020_06_14; + +import java.util.List; +import com.microsoft.azure.management.kusto.v2020_06_14.implementation.LanguageExtensionInner; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The list of language extension objects. + */ +public class LanguageExtensionsList { + /** + * The list of language extensions. + */ + @JsonProperty(value = "value") + private List value; + + /** + * Get the list of language extensions. + * + * @return the value value + */ + public List value() { + return this.value; + } + + /** + * Set the list of language extensions. + * + * @param value the value value to set + * @return the LanguageExtensionsList object itself. + */ + public LanguageExtensionsList withValue(List value) { + this.value = value; + return this; + } + +} diff --git a/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/Operation.java b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/Operation.java new file mode 100644 index 0000000000000..6c5fe50fd7b00 --- /dev/null +++ b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/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.kusto.v2020_06_14; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.kusto.v2020_06_14.implementation.KustoManager; +import com.microsoft.azure.management.kusto.v2020_06_14.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. + */ + Object properties(); + +} diff --git a/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/OperationDisplay.java b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/OperationDisplay.java new file mode 100644 index 0000000000000..a480668e1f495 --- /dev/null +++ b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/OperationDisplay.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.kusto.v2020_06_14; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The object that describes the operation. + */ +public class OperationDisplay { + /** + * Friendly name of the resource provider. + */ + @JsonProperty(value = "provider") + private String provider; + + /** + * The operation type. + * For example: read, write, delete. + */ + @JsonProperty(value = "operation") + private String operation; + + /** + * The resource type on which the operation is performed. + */ + @JsonProperty(value = "resource") + private String resource; + + /** + * The friendly name of the operation. + */ + @JsonProperty(value = "description") + private String description; + + /** + * 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 OperationDisplay object itself. + */ + public OperationDisplay withProvider(String provider) { + this.provider = provider; + return this; + } + + /** + * Get for example: read, write, delete. + * + * @return the operation value + */ + public String operation() { + return this.operation; + } + + /** + * Set for example: read, write, delete. + * + * @param operation the operation value to set + * @return the OperationDisplay object itself. + */ + public OperationDisplay withOperation(String operation) { + this.operation = operation; + return this; + } + + /** + * Get the resource value. + * + * @return the resource value + */ + public String resource() { + return this.resource; + } + + /** + * Set the resource value. + * + * @param resource the resource value to set + * @return the OperationDisplay object itself. + */ + public OperationDisplay withResource(String resource) { + this.resource = resource; + return this; + } + + /** + * Get the description value. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Set the description value. + * + * @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/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/Operations.java b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/Operations.java new file mode 100644 index 0000000000000..fdabab3720192 --- /dev/null +++ b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/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.kusto.v2020_06_14; + +import rx.Observable; +import com.microsoft.azure.management.kusto.v2020_06_14.implementation.OperationsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Operations. + */ +public interface Operations extends HasInner { + /** + * Lists available operations for the Microsoft.Kusto provider. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(); + +} diff --git a/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/OptimizedAutoscale.java b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/OptimizedAutoscale.java new file mode 100644 index 0000000000000..31f71de5a1a4c --- /dev/null +++ b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/OptimizedAutoscale.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.kusto.v2020_06_14; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * A class that contains the optimized auto scale definition. + */ +public class OptimizedAutoscale { + /** + * The version of the template defined, for instance 1. + */ + @JsonProperty(value = "version", required = true) + private int version; + + /** + * A boolean value that indicate if the optimized autoscale feature is + * enabled or not. + */ + @JsonProperty(value = "isEnabled", required = true) + private boolean isEnabled; + + /** + * Minimum allowed instances count. + */ + @JsonProperty(value = "minimum", required = true) + private int minimum; + + /** + * Maximum allowed instances count. + */ + @JsonProperty(value = "maximum", required = true) + private int maximum; + + /** + * Get the version of the template defined, for instance 1. + * + * @return the version value + */ + public int version() { + return this.version; + } + + /** + * Set the version of the template defined, for instance 1. + * + * @param version the version value to set + * @return the OptimizedAutoscale object itself. + */ + public OptimizedAutoscale withVersion(int version) { + this.version = version; + return this; + } + + /** + * Get a boolean value that indicate if the optimized autoscale feature is enabled or not. + * + * @return the isEnabled value + */ + public boolean isEnabled() { + return this.isEnabled; + } + + /** + * Set a boolean value that indicate if the optimized autoscale feature is enabled or not. + * + * @param isEnabled the isEnabled value to set + * @return the OptimizedAutoscale object itself. + */ + public OptimizedAutoscale withIsEnabled(boolean isEnabled) { + this.isEnabled = isEnabled; + return this; + } + + /** + * Get minimum allowed instances count. + * + * @return the minimum value + */ + public int minimum() { + return this.minimum; + } + + /** + * Set minimum allowed instances count. + * + * @param minimum the minimum value to set + * @return the OptimizedAutoscale object itself. + */ + public OptimizedAutoscale withMinimum(int minimum) { + this.minimum = minimum; + return this; + } + + /** + * Get maximum allowed instances count. + * + * @return the maximum value + */ + public int maximum() { + return this.maximum; + } + + /** + * Set maximum allowed instances count. + * + * @param maximum the maximum value to set + * @return the OptimizedAutoscale object itself. + */ + public OptimizedAutoscale withMaximum(int maximum) { + this.maximum = maximum; + return this; + } + +} diff --git a/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/PrincipalType.java b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/PrincipalType.java new file mode 100644 index 0000000000000..0d5a80f47f406 --- /dev/null +++ b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/PrincipalType.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.kusto.v2020_06_14; + +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 App for PrincipalType. */ + public static final PrincipalType APP = fromString("App"); + + /** Static value Group for PrincipalType. */ + public static final PrincipalType GROUP = fromString("Group"); + + /** Static value User for PrincipalType. */ + public static final PrincipalType USER = fromString("User"); + + /** + * 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/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/PrincipalsModificationKind.java b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/PrincipalsModificationKind.java new file mode 100644 index 0000000000000..ba0283aafcf4f --- /dev/null +++ b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/PrincipalsModificationKind.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.kusto.v2020_06_14; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for PrincipalsModificationKind. + */ +public final class PrincipalsModificationKind extends ExpandableStringEnum { + /** Static value Union for PrincipalsModificationKind. */ + public static final PrincipalsModificationKind UNION = fromString("Union"); + + /** Static value Replace for PrincipalsModificationKind. */ + public static final PrincipalsModificationKind REPLACE = fromString("Replace"); + + /** Static value None for PrincipalsModificationKind. */ + public static final PrincipalsModificationKind NONE = fromString("None"); + + /** + * Creates or finds a PrincipalsModificationKind from its string representation. + * @param name a name to look for + * @return the corresponding PrincipalsModificationKind + */ + @JsonCreator + public static PrincipalsModificationKind fromString(String name) { + return fromString(name, PrincipalsModificationKind.class); + } + + /** + * @return known PrincipalsModificationKind values + */ + public static Collection values() { + return values(PrincipalsModificationKind.class); + } +} diff --git a/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/ProvisioningState.java b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/ProvisioningState.java new file mode 100644 index 0000000000000..856911f0f83b3 --- /dev/null +++ b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/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.kusto.v2020_06_14; + +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 Running for ProvisioningState. */ + public static final ProvisioningState RUNNING = fromString("Running"); + + /** Static value Creating for ProvisioningState. */ + public static final ProvisioningState CREATING = fromString("Creating"); + + /** Static value Deleting for ProvisioningState. */ + public static final ProvisioningState DELETING = fromString("Deleting"); + + /** Static value Succeeded for ProvisioningState. */ + public static final ProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** Static value Failed for ProvisioningState. */ + public static final ProvisioningState FAILED = fromString("Failed"); + + /** Static value Moving for ProvisioningState. */ + public static final ProvisioningState MOVING = fromString("Moving"); + + /** + * 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/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/ReadOnlyFollowingDatabase.java b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/ReadOnlyFollowingDatabase.java new file mode 100644 index 0000000000000..f8a99e6aaaf0a --- /dev/null +++ b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/ReadOnlyFollowingDatabase.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.kusto.v2020_06_14; + +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.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.management.kusto.v2020_06_14.implementation.DatabaseInner; + +/** + * Class representing a read only following database. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind", defaultImpl = ReadOnlyFollowingDatabase.class) +@JsonTypeName("ReadOnlyFollowing") +@JsonFlatten +public class ReadOnlyFollowingDatabase extends DatabaseInner { + /** + * The provisioned state of the resource. Possible values include: + * 'Running', 'Creating', 'Deleting', 'Succeeded', 'Failed', 'Moving'. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /** + * The time the data should be kept before it stops being accessible to + * queries in TimeSpan. + */ + @JsonProperty(value = "properties.softDeletePeriod", access = JsonProperty.Access.WRITE_ONLY) + private Period softDeletePeriod; + + /** + * The time the data should be kept in cache for fast queries in TimeSpan. + */ + @JsonProperty(value = "properties.hotCachePeriod") + private Period hotCachePeriod; + + /** + * The statistics of the database. + */ + @JsonProperty(value = "properties.statistics") + private DatabaseStatistics statistics; + + /** + * The name of the leader cluster. + */ + @JsonProperty(value = "properties.leaderClusterResourceId", access = JsonProperty.Access.WRITE_ONLY) + private String leaderClusterResourceId; + + /** + * The name of the attached database configuration cluster. + */ + @JsonProperty(value = "properties.attachedDatabaseConfigurationName", access = JsonProperty.Access.WRITE_ONLY) + private String attachedDatabaseConfigurationName; + + /** + * The principals modification kind of the database. Possible values + * include: 'Union', 'Replace', 'None'. + */ + @JsonProperty(value = "properties.principalsModificationKind", access = JsonProperty.Access.WRITE_ONLY) + private PrincipalsModificationKind principalsModificationKind; + + /** + * Get the provisioned state of the resource. Possible values include: 'Running', 'Creating', 'Deleting', 'Succeeded', 'Failed', 'Moving'. + * + * @return the provisioningState value + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the time the data should be kept before it stops being accessible to queries in TimeSpan. + * + * @return the softDeletePeriod value + */ + public Period softDeletePeriod() { + return this.softDeletePeriod; + } + + /** + * Get the time the data should be kept in cache for fast queries in TimeSpan. + * + * @return the hotCachePeriod value + */ + public Period hotCachePeriod() { + return this.hotCachePeriod; + } + + /** + * Set the time the data should be kept in cache for fast queries in TimeSpan. + * + * @param hotCachePeriod the hotCachePeriod value to set + * @return the ReadOnlyFollowingDatabase object itself. + */ + public ReadOnlyFollowingDatabase withHotCachePeriod(Period hotCachePeriod) { + this.hotCachePeriod = hotCachePeriod; + return this; + } + + /** + * Get the statistics of the database. + * + * @return the statistics value + */ + public DatabaseStatistics statistics() { + return this.statistics; + } + + /** + * Set the statistics of the database. + * + * @param statistics the statistics value to set + * @return the ReadOnlyFollowingDatabase object itself. + */ + public ReadOnlyFollowingDatabase withStatistics(DatabaseStatistics statistics) { + this.statistics = statistics; + return this; + } + + /** + * Get the name of the leader cluster. + * + * @return the leaderClusterResourceId value + */ + public String leaderClusterResourceId() { + return this.leaderClusterResourceId; + } + + /** + * Get the name of the attached database configuration cluster. + * + * @return the attachedDatabaseConfigurationName value + */ + public String attachedDatabaseConfigurationName() { + return this.attachedDatabaseConfigurationName; + } + + /** + * Get the principals modification kind of the database. Possible values include: 'Union', 'Replace', 'None'. + * + * @return the principalsModificationKind value + */ + public PrincipalsModificationKind principalsModificationKind() { + return this.principalsModificationKind; + } + +} diff --git a/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/ReadWriteDatabase.java b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/ReadWriteDatabase.java new file mode 100644 index 0000000000000..b93716d982faf --- /dev/null +++ b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/ReadWriteDatabase.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.kusto.v2020_06_14; + +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.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.management.kusto.v2020_06_14.implementation.DatabaseInner; + +/** + * Class representing a read write database. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind", defaultImpl = ReadWriteDatabase.class) +@JsonTypeName("ReadWrite") +@JsonFlatten +public class ReadWriteDatabase extends DatabaseInner { + /** + * The provisioned state of the resource. Possible values include: + * 'Running', 'Creating', 'Deleting', 'Succeeded', 'Failed', 'Moving'. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /** + * The time the data should be kept before it stops being accessible to + * queries in TimeSpan. + */ + @JsonProperty(value = "properties.softDeletePeriod") + private Period softDeletePeriod; + + /** + * The time the data should be kept in cache for fast queries in TimeSpan. + */ + @JsonProperty(value = "properties.hotCachePeriod") + private Period hotCachePeriod; + + /** + * The statistics of the database. + */ + @JsonProperty(value = "properties.statistics") + private DatabaseStatistics statistics; + + /** + * Indicates whether the database is followed. + */ + @JsonProperty(value = "properties.isFollowed", access = JsonProperty.Access.WRITE_ONLY) + private Boolean isFollowed; + + /** + * Get the provisioned state of the resource. Possible values include: 'Running', 'Creating', 'Deleting', 'Succeeded', 'Failed', 'Moving'. + * + * @return the provisioningState value + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the time the data should be kept before it stops being accessible to queries in TimeSpan. + * + * @return the softDeletePeriod value + */ + public Period softDeletePeriod() { + return this.softDeletePeriod; + } + + /** + * Set the time the data should be kept before it stops being accessible to queries in TimeSpan. + * + * @param softDeletePeriod the softDeletePeriod value to set + * @return the ReadWriteDatabase object itself. + */ + public ReadWriteDatabase withSoftDeletePeriod(Period softDeletePeriod) { + this.softDeletePeriod = softDeletePeriod; + return this; + } + + /** + * Get the time the data should be kept in cache for fast queries in TimeSpan. + * + * @return the hotCachePeriod value + */ + public Period hotCachePeriod() { + return this.hotCachePeriod; + } + + /** + * Set the time the data should be kept in cache for fast queries in TimeSpan. + * + * @param hotCachePeriod the hotCachePeriod value to set + * @return the ReadWriteDatabase object itself. + */ + public ReadWriteDatabase withHotCachePeriod(Period hotCachePeriod) { + this.hotCachePeriod = hotCachePeriod; + return this; + } + + /** + * Get the statistics of the database. + * + * @return the statistics value + */ + public DatabaseStatistics statistics() { + return this.statistics; + } + + /** + * Set the statistics of the database. + * + * @param statistics the statistics value to set + * @return the ReadWriteDatabase object itself. + */ + public ReadWriteDatabase withStatistics(DatabaseStatistics statistics) { + this.statistics = statistics; + return this; + } + + /** + * Get indicates whether the database is followed. + * + * @return the isFollowed value + */ + public Boolean isFollowed() { + return this.isFollowed; + } + +} diff --git a/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/Reason.java b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/Reason.java new file mode 100644 index 0000000000000..6e554eab95c51 --- /dev/null +++ b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/Reason.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.kusto.v2020_06_14; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for Reason. + */ +public final class Reason extends ExpandableStringEnum { + /** Static value Invalid for Reason. */ + public static final Reason INVALID = fromString("Invalid"); + + /** Static value AlreadyExists for Reason. */ + public static final Reason ALREADY_EXISTS = fromString("AlreadyExists"); + + /** + * Creates or finds a Reason from its string representation. + * @param name a name to look for + * @return the corresponding Reason + */ + @JsonCreator + public static Reason fromString(String name) { + return fromString(name, Reason.class); + } + + /** + * @return known Reason values + */ + public static Collection values() { + return values(Reason.class); + } +} diff --git a/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/SkuDescription.java b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/SkuDescription.java new file mode 100644 index 0000000000000..43f539d5676ad --- /dev/null +++ b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/SkuDescription.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.kusto.v2020_06_14; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.kusto.v2020_06_14.implementation.KustoManager; +import com.microsoft.azure.management.kusto.v2020_06_14.implementation.SkuDescriptionInner; +import java.util.List; + +/** + * Type representing SkuDescription. + */ +public interface SkuDescription extends HasInner, HasManager { + /** + * @return the locationInfo value. + */ + List locationInfo(); + + /** + * @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 tier value. + */ + String tier(); + +} diff --git a/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/SkuLocationInfoItem.java b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/SkuLocationInfoItem.java new file mode 100644 index 0000000000000..9a23bbe88cfbe --- /dev/null +++ b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/SkuLocationInfoItem.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.kusto.v2020_06_14; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The locations and zones info for SKU. + */ +public class SkuLocationInfoItem { + /** + * The available location of the SKU. + */ + @JsonProperty(value = "location", required = true) + private String location; + + /** + * The available zone of the SKU. + */ + @JsonProperty(value = "zones") + private List zones; + + /** + * Get the available location of the SKU. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set the available location of the SKU. + * + * @param location the location value to set + * @return the SkuLocationInfoItem object itself. + */ + public SkuLocationInfoItem withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the available zone of the SKU. + * + * @return the zones value + */ + public List zones() { + return this.zones; + } + + /** + * Set the available zone of the SKU. + * + * @param zones the zones value to set + * @return the SkuLocationInfoItem object itself. + */ + public SkuLocationInfoItem withZones(List zones) { + this.zones = zones; + return this; + } + +} diff --git a/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/State.java b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/State.java new file mode 100644 index 0000000000000..5e9bf38b1e291 --- /dev/null +++ b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/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.kusto.v2020_06_14; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for State. + */ +public final class State extends ExpandableStringEnum { + /** Static value Creating for State. */ + public static final State CREATING = fromString("Creating"); + + /** Static value Unavailable for State. */ + public static final State UNAVAILABLE = fromString("Unavailable"); + + /** Static value Running for State. */ + public static final State RUNNING = fromString("Running"); + + /** Static value Deleting for State. */ + public static final State DELETING = fromString("Deleting"); + + /** Static value Deleted for State. */ + public static final State DELETED = fromString("Deleted"); + + /** Static value Stopping for State. */ + public static final State STOPPING = fromString("Stopping"); + + /** Static value Stopped for State. */ + public static final State STOPPED = fromString("Stopped"); + + /** Static value Starting for State. */ + public static final State STARTING = fromString("Starting"); + + /** Static value Updating for State. */ + public static final State UPDATING = fromString("Updating"); + + /** + * Creates or finds a State from its string representation. + * @param name a name to look for + * @return the corresponding State + */ + @JsonCreator + public static State fromString(String name) { + return fromString(name, State.class); + } + + /** + * @return known State values + */ + public static Collection values() { + return values(State.class); + } +} diff --git a/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/TrustedExternalTenant.java b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/TrustedExternalTenant.java new file mode 100644 index 0000000000000..e532b4d677af7 --- /dev/null +++ b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/TrustedExternalTenant.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.kusto.v2020_06_14; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Represents a tenant ID that is trusted by the cluster. + */ +public class TrustedExternalTenant { + /** + * GUID representing an external tenant. + */ + @JsonProperty(value = "value") + private String value; + + /** + * Get gUID representing an external tenant. + * + * @return the value value + */ + public String value() { + return this.value; + } + + /** + * Set gUID representing an external tenant. + * + * @param value the value value to set + * @return the TrustedExternalTenant object itself. + */ + public TrustedExternalTenant withValue(String value) { + this.value = value; + return this; + } + +} diff --git a/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/Type.java b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/Type.java new file mode 100644 index 0000000000000..ad7ce2a719711 --- /dev/null +++ b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/Type.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.kusto.v2020_06_14; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for Type. + */ +public enum Type { + /** Enum value Microsoft.Kusto/clusters/databases. */ + MICROSOFT_KUSTOCLUSTERSDATABASES("Microsoft.Kusto/clusters/databases"), + + /** Enum value Microsoft.Kusto/clusters/attachedDatabaseConfigurations. */ + MICROSOFT_KUSTOCLUSTERSATTACHED_DATABASE_CONFIGURATIONS("Microsoft.Kusto/clusters/attachedDatabaseConfigurations"); + + /** The actual serialized value for a Type instance. */ + private String value; + + Type(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a Type instance. + * + * @param value the serialized value to parse. + * @return the parsed Type object, or null if unable to parse. + */ + @JsonCreator + public static Type fromString(String value) { + Type[] items = Type.values(); + for (Type item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/VirtualNetworkConfiguration.java b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/VirtualNetworkConfiguration.java new file mode 100644 index 0000000000000..ec3e91d568663 --- /dev/null +++ b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/VirtualNetworkConfiguration.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.kusto.v2020_06_14; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * A class that contains virtual network definition. + */ +public class VirtualNetworkConfiguration { + /** + * The subnet resource id. + */ + @JsonProperty(value = "subnetId", required = true) + private String subnetId; + + /** + * Engine service's public IP address resource id. + */ + @JsonProperty(value = "enginePublicIpId", required = true) + private String enginePublicIpId; + + /** + * Data management's service public IP address resource id. + */ + @JsonProperty(value = "dataManagementPublicIpId", required = true) + private String dataManagementPublicIpId; + + /** + * Get the subnet resource id. + * + * @return the subnetId value + */ + public String subnetId() { + return this.subnetId; + } + + /** + * Set the subnet resource id. + * + * @param subnetId the subnetId value to set + * @return the VirtualNetworkConfiguration object itself. + */ + public VirtualNetworkConfiguration withSubnetId(String subnetId) { + this.subnetId = subnetId; + return this; + } + + /** + * Get engine service's public IP address resource id. + * + * @return the enginePublicIpId value + */ + public String enginePublicIpId() { + return this.enginePublicIpId; + } + + /** + * Set engine service's public IP address resource id. + * + * @param enginePublicIpId the enginePublicIpId value to set + * @return the VirtualNetworkConfiguration object itself. + */ + public VirtualNetworkConfiguration withEnginePublicIpId(String enginePublicIpId) { + this.enginePublicIpId = enginePublicIpId; + return this; + } + + /** + * Get data management's service public IP address resource id. + * + * @return the dataManagementPublicIpId value + */ + public String dataManagementPublicIpId() { + return this.dataManagementPublicIpId; + } + + /** + * Set data management's service public IP address resource id. + * + * @param dataManagementPublicIpId the dataManagementPublicIpId value to set + * @return the VirtualNetworkConfiguration object itself. + */ + public VirtualNetworkConfiguration withDataManagementPublicIpId(String dataManagementPublicIpId) { + this.dataManagementPublicIpId = dataManagementPublicIpId; + return this; + } + +} diff --git a/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/implementation/AttachedDatabaseConfigurationImpl.java b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/implementation/AttachedDatabaseConfigurationImpl.java new file mode 100644 index 0000000000000..6abe191722482 --- /dev/null +++ b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/implementation/AttachedDatabaseConfigurationImpl.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.kusto.v2020_06_14.implementation; + +import com.microsoft.azure.management.kusto.v2020_06_14.AttachedDatabaseConfiguration; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import com.microsoft.azure.management.kusto.v2020_06_14.ProvisioningState; +import java.util.List; +import com.microsoft.azure.management.kusto.v2020_06_14.DefaultPrincipalsModificationKind; + +class AttachedDatabaseConfigurationImpl extends CreatableUpdatableImpl implements AttachedDatabaseConfiguration, AttachedDatabaseConfiguration.Definition, AttachedDatabaseConfiguration.Update { + private final KustoManager manager; + private String resourceGroupName; + private String clusterName; + private String attachedDatabaseConfigurationName; + + AttachedDatabaseConfigurationImpl(String name, KustoManager manager) { + super(name, new AttachedDatabaseConfigurationInner()); + this.manager = manager; + // Set resource name + this.attachedDatabaseConfigurationName = name; + // + } + + AttachedDatabaseConfigurationImpl(AttachedDatabaseConfigurationInner inner, KustoManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.attachedDatabaseConfigurationName = inner.name(); + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.clusterName = IdParsingUtils.getValueFromIdByName(inner.id(), "clusters"); + this.attachedDatabaseConfigurationName = IdParsingUtils.getValueFromIdByName(inner.id(), "attachedDatabaseConfigurations"); + // + } + + @Override + public KustoManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + AttachedDatabaseConfigurationsInner client = this.manager().inner().attachedDatabaseConfigurations(); + return client.createOrUpdateAsync(this.resourceGroupName, this.clusterName, this.attachedDatabaseConfigurationName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + AttachedDatabaseConfigurationsInner client = this.manager().inner().attachedDatabaseConfigurations(); + return client.createOrUpdateAsync(this.resourceGroupName, this.clusterName, this.attachedDatabaseConfigurationName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + AttachedDatabaseConfigurationsInner client = this.manager().inner().attachedDatabaseConfigurations(); + return client.getAsync(this.resourceGroupName, this.clusterName, this.attachedDatabaseConfigurationName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public List attachedDatabaseNames() { + return this.inner().attachedDatabaseNames(); + } + + @Override + public String clusterResourceId() { + return this.inner().clusterResourceId(); + } + + @Override + public String databaseName() { + return this.inner().databaseName(); + } + + @Override + public DefaultPrincipalsModificationKind defaultPrincipalsModificationKind() { + return this.inner().defaultPrincipalsModificationKind(); + } + + @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 type() { + return this.inner().type(); + } + + @Override + public AttachedDatabaseConfigurationImpl withExistingCluster(String resourceGroupName, String clusterName) { + this.resourceGroupName = resourceGroupName; + this.clusterName = clusterName; + return this; + } + + @Override + public AttachedDatabaseConfigurationImpl withClusterResourceId(String clusterResourceId) { + this.inner().withClusterResourceId(clusterResourceId); + return this; + } + + @Override + public AttachedDatabaseConfigurationImpl withDatabaseName(String databaseName) { + this.inner().withDatabaseName(databaseName); + return this; + } + + @Override + public AttachedDatabaseConfigurationImpl withDefaultPrincipalsModificationKind(DefaultPrincipalsModificationKind defaultPrincipalsModificationKind) { + this.inner().withDefaultPrincipalsModificationKind(defaultPrincipalsModificationKind); + return this; + } + + @Override + public AttachedDatabaseConfigurationImpl withLocation(String location) { + this.inner().withLocation(location); + return this; + } + +} diff --git a/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/implementation/AttachedDatabaseConfigurationInner.java b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/implementation/AttachedDatabaseConfigurationInner.java new file mode 100644 index 0000000000000..47c519a9c0af9 --- /dev/null +++ b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/implementation/AttachedDatabaseConfigurationInner.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.kusto.v2020_06_14.implementation; + +import com.microsoft.azure.management.kusto.v2020_06_14.ProvisioningState; +import java.util.List; +import com.microsoft.azure.management.kusto.v2020_06_14.DefaultPrincipalsModificationKind; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.ProxyResource; + +/** + * Class representing an attached database configuration. + */ +@JsonFlatten +public class AttachedDatabaseConfigurationInner extends ProxyResource { + /** + * Resource location. + */ + @JsonProperty(value = "location") + private String location; + + /** + * The provisioned state of the resource. Possible values include: + * 'Running', 'Creating', 'Deleting', 'Succeeded', 'Failed', 'Moving'. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /** + * The name of the database which you would like to attach, use * if you + * want to follow all current and future databases. + */ + @JsonProperty(value = "properties.databaseName", required = true) + private String databaseName; + + /** + * The resource id of the cluster where the databases you would like to + * attach reside. + */ + @JsonProperty(value = "properties.clusterResourceId", required = true) + private String clusterResourceId; + + /** + * The list of databases from the clusterResourceId which are currently + * attached to the cluster. + */ + @JsonProperty(value = "properties.attachedDatabaseNames", access = JsonProperty.Access.WRITE_ONLY) + private List attachedDatabaseNames; + + /** + * The default principals modification kind. Possible values include: + * 'Union', 'Replace', 'None'. + */ + @JsonProperty(value = "properties.defaultPrincipalsModificationKind", required = true) + private DefaultPrincipalsModificationKind defaultPrincipalsModificationKind; + + /** + * 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 AttachedDatabaseConfigurationInner object itself. + */ + public AttachedDatabaseConfigurationInner withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the provisioned state of the resource. Possible values include: 'Running', 'Creating', 'Deleting', 'Succeeded', 'Failed', 'Moving'. + * + * @return the provisioningState value + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the name of the database which you would like to attach, use * if you want to follow all current and future databases. + * + * @return the databaseName value + */ + public String databaseName() { + return this.databaseName; + } + + /** + * Set the name of the database which you would like to attach, use * if you want to follow all current and future databases. + * + * @param databaseName the databaseName value to set + * @return the AttachedDatabaseConfigurationInner object itself. + */ + public AttachedDatabaseConfigurationInner withDatabaseName(String databaseName) { + this.databaseName = databaseName; + return this; + } + + /** + * Get the resource id of the cluster where the databases you would like to attach reside. + * + * @return the clusterResourceId value + */ + public String clusterResourceId() { + return this.clusterResourceId; + } + + /** + * Set the resource id of the cluster where the databases you would like to attach reside. + * + * @param clusterResourceId the clusterResourceId value to set + * @return the AttachedDatabaseConfigurationInner object itself. + */ + public AttachedDatabaseConfigurationInner withClusterResourceId(String clusterResourceId) { + this.clusterResourceId = clusterResourceId; + return this; + } + + /** + * Get the list of databases from the clusterResourceId which are currently attached to the cluster. + * + * @return the attachedDatabaseNames value + */ + public List attachedDatabaseNames() { + return this.attachedDatabaseNames; + } + + /** + * Get the default principals modification kind. Possible values include: 'Union', 'Replace', 'None'. + * + * @return the defaultPrincipalsModificationKind value + */ + public DefaultPrincipalsModificationKind defaultPrincipalsModificationKind() { + return this.defaultPrincipalsModificationKind; + } + + /** + * Set the default principals modification kind. Possible values include: 'Union', 'Replace', 'None'. + * + * @param defaultPrincipalsModificationKind the defaultPrincipalsModificationKind value to set + * @return the AttachedDatabaseConfigurationInner object itself. + */ + public AttachedDatabaseConfigurationInner withDefaultPrincipalsModificationKind(DefaultPrincipalsModificationKind defaultPrincipalsModificationKind) { + this.defaultPrincipalsModificationKind = defaultPrincipalsModificationKind; + return this; + } + +} diff --git a/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/implementation/AttachedDatabaseConfigurationsImpl.java b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/implementation/AttachedDatabaseConfigurationsImpl.java new file mode 100644 index 0000000000000..829c0142416a8 --- /dev/null +++ b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/implementation/AttachedDatabaseConfigurationsImpl.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.kusto.v2020_06_14.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.kusto.v2020_06_14.AttachedDatabaseConfigurations; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import java.util.List; +import com.microsoft.azure.management.kusto.v2020_06_14.AttachedDatabaseConfiguration; + +class AttachedDatabaseConfigurationsImpl extends WrapperImpl implements AttachedDatabaseConfigurations { + private final KustoManager manager; + + AttachedDatabaseConfigurationsImpl(KustoManager manager) { + super(manager.inner().attachedDatabaseConfigurations()); + this.manager = manager; + } + + public KustoManager manager() { + return this.manager; + } + + @Override + public AttachedDatabaseConfigurationImpl define(String name) { + return wrapModel(name); + } + + private AttachedDatabaseConfigurationImpl wrapModel(AttachedDatabaseConfigurationInner inner) { + return new AttachedDatabaseConfigurationImpl(inner, manager()); + } + + private AttachedDatabaseConfigurationImpl wrapModel(String name) { + return new AttachedDatabaseConfigurationImpl(name, this.manager()); + } + + @Override + public Observable listByClusterAsync(String resourceGroupName, String clusterName) { + AttachedDatabaseConfigurationsInner client = this.inner(); + return client.listByClusterAsync(resourceGroupName, clusterName) + .flatMap(new Func1, Observable>() { + @Override + public Observable call(List innerList) { + return Observable.from(innerList); + } + }) + .map(new Func1() { + @Override + public AttachedDatabaseConfiguration call(AttachedDatabaseConfigurationInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String clusterName, String attachedDatabaseConfigurationName) { + AttachedDatabaseConfigurationsInner client = this.inner(); + return client.getAsync(resourceGroupName, clusterName, attachedDatabaseConfigurationName) + .flatMap(new Func1>() { + @Override + public Observable call(AttachedDatabaseConfigurationInner inner) { + if (inner == null) { + return Observable.empty(); + } else { + return Observable.just((AttachedDatabaseConfiguration)wrapModel(inner)); + } + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String clusterName, String attachedDatabaseConfigurationName) { + AttachedDatabaseConfigurationsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, clusterName, attachedDatabaseConfigurationName).toCompletable(); + } + +} diff --git a/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/implementation/AttachedDatabaseConfigurationsInner.java b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/implementation/AttachedDatabaseConfigurationsInner.java new file mode 100644 index 0000000000000..75f5c9975c912 --- /dev/null +++ b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/implementation/AttachedDatabaseConfigurationsInner.java @@ -0,0 +1,625 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.kusto.v2020_06_14.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 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 AttachedDatabaseConfigurations. + */ +public class AttachedDatabaseConfigurationsInner { + /** The Retrofit service to perform REST calls. */ + private AttachedDatabaseConfigurationsService service; + /** The service client containing this operation class. */ + private KustoManagementClientImpl client; + + /** + * Initializes an instance of AttachedDatabaseConfigurationsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public AttachedDatabaseConfigurationsInner(Retrofit retrofit, KustoManagementClientImpl client) { + this.service = retrofit.create(AttachedDatabaseConfigurationsService.class); + this.client = client; + } + + /** + * The interface defining all the services for AttachedDatabaseConfigurations to be + * used by Retrofit to perform actually REST calls. + */ + interface AttachedDatabaseConfigurationsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.kusto.v2020_06_14.AttachedDatabaseConfigurations listByCluster" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/attachedDatabaseConfigurations") + Observable> listByCluster(@Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.kusto.v2020_06_14.AttachedDatabaseConfigurations get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/attachedDatabaseConfigurations/{attachedDatabaseConfigurationName}") + Observable> get(@Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("attachedDatabaseConfigurationName") String attachedDatabaseConfigurationName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.kusto.v2020_06_14.AttachedDatabaseConfigurations createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/attachedDatabaseConfigurations/{attachedDatabaseConfigurationName}") + Observable> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("attachedDatabaseConfigurationName") String attachedDatabaseConfigurationName, @Path("subscriptionId") String subscriptionId, @Body AttachedDatabaseConfigurationInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.kusto.v2020_06_14.AttachedDatabaseConfigurations beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/attachedDatabaseConfigurations/{attachedDatabaseConfigurationName}") + Observable> beginCreateOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("attachedDatabaseConfigurationName") String attachedDatabaseConfigurationName, @Path("subscriptionId") String subscriptionId, @Body AttachedDatabaseConfigurationInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.kusto.v2020_06_14.AttachedDatabaseConfigurations delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/attachedDatabaseConfigurations/{attachedDatabaseConfigurationName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("attachedDatabaseConfigurationName") String attachedDatabaseConfigurationName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.kusto.v2020_06_14.AttachedDatabaseConfigurations beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/attachedDatabaseConfigurations/{attachedDatabaseConfigurationName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("attachedDatabaseConfigurationName") String attachedDatabaseConfigurationName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Returns the list of attached database configurations of the given Kusto cluster. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException 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<AttachedDatabaseConfigurationInner> object if successful. + */ + public List listByCluster(String resourceGroupName, String clusterName) { + return listByClusterWithServiceResponseAsync(resourceGroupName, clusterName).toBlocking().single().body(); + } + + /** + * Returns the list of attached database configurations of the given Kusto cluster. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto 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(String resourceGroupName, String clusterName, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listByClusterWithServiceResponseAsync(resourceGroupName, clusterName), serviceCallback); + } + + /** + * Returns the list of attached database configurations of the given Kusto cluster. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<AttachedDatabaseConfigurationInner> object + */ + public Observable> listByClusterAsync(String resourceGroupName, String clusterName) { + return listByClusterWithServiceResponseAsync(resourceGroupName, clusterName).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Returns the list of attached database configurations of the given Kusto cluster. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<AttachedDatabaseConfigurationInner> object + */ + public Observable>> listByClusterWithServiceResponseAsync(String resourceGroupName, String clusterName) { + 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.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.listByCluster(resourceGroupName, clusterName, 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 = listByClusterDelegate(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> listByClusterDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Returns an attached database configuration. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param attachedDatabaseConfigurationName The name of the attached database 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 AttachedDatabaseConfigurationInner object if successful. + */ + public AttachedDatabaseConfigurationInner get(String resourceGroupName, String clusterName, String attachedDatabaseConfigurationName) { + return getWithServiceResponseAsync(resourceGroupName, clusterName, attachedDatabaseConfigurationName).toBlocking().single().body(); + } + + /** + * Returns an attached database configuration. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param attachedDatabaseConfigurationName The name of the attached database 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 attachedDatabaseConfigurationName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, clusterName, attachedDatabaseConfigurationName), serviceCallback); + } + + /** + * Returns an attached database configuration. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param attachedDatabaseConfigurationName The name of the attached database configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the AttachedDatabaseConfigurationInner object + */ + public Observable getAsync(String resourceGroupName, String clusterName, String attachedDatabaseConfigurationName) { + return getWithServiceResponseAsync(resourceGroupName, clusterName, attachedDatabaseConfigurationName).map(new Func1, AttachedDatabaseConfigurationInner>() { + @Override + public AttachedDatabaseConfigurationInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Returns an attached database configuration. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param attachedDatabaseConfigurationName The name of the attached database configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the AttachedDatabaseConfigurationInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String clusterName, String attachedDatabaseConfigurationName) { + 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 (attachedDatabaseConfigurationName == null) { + throw new IllegalArgumentException("Parameter attachedDatabaseConfigurationName is 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, clusterName, attachedDatabaseConfigurationName, 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 or updates an attached database configuration. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param attachedDatabaseConfigurationName The name of the attached database configuration. + * @param parameters The database parameters supplied to the CreateOrUpdate operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the AttachedDatabaseConfigurationInner object if successful. + */ + public AttachedDatabaseConfigurationInner createOrUpdate(String resourceGroupName, String clusterName, String attachedDatabaseConfigurationName, AttachedDatabaseConfigurationInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, clusterName, attachedDatabaseConfigurationName, parameters).toBlocking().last().body(); + } + + /** + * Creates or updates an attached database configuration. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param attachedDatabaseConfigurationName The name of the attached database configuration. + * @param parameters The database parameters supplied to the CreateOrUpdate 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 clusterName, String attachedDatabaseConfigurationName, AttachedDatabaseConfigurationInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, clusterName, attachedDatabaseConfigurationName, parameters), serviceCallback); + } + + /** + * Creates or updates an attached database configuration. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param attachedDatabaseConfigurationName The name of the attached database configuration. + * @param parameters The database parameters supplied to the CreateOrUpdate operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String clusterName, String attachedDatabaseConfigurationName, AttachedDatabaseConfigurationInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, clusterName, attachedDatabaseConfigurationName, parameters).map(new Func1, AttachedDatabaseConfigurationInner>() { + @Override + public AttachedDatabaseConfigurationInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates an attached database configuration. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param attachedDatabaseConfigurationName The name of the attached database configuration. + * @param parameters The database parameters supplied to the CreateOrUpdate operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String clusterName, String attachedDatabaseConfigurationName, AttachedDatabaseConfigurationInner parameters) { + 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 (attachedDatabaseConfigurationName == null) { + throw new IllegalArgumentException("Parameter attachedDatabaseConfigurationName is 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.createOrUpdate(resourceGroupName, clusterName, attachedDatabaseConfigurationName, this.client.subscriptionId(), parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Creates or updates an attached database configuration. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param attachedDatabaseConfigurationName The name of the attached database configuration. + * @param parameters The database parameters supplied to the CreateOrUpdate operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the AttachedDatabaseConfigurationInner object if successful. + */ + public AttachedDatabaseConfigurationInner beginCreateOrUpdate(String resourceGroupName, String clusterName, String attachedDatabaseConfigurationName, AttachedDatabaseConfigurationInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, clusterName, attachedDatabaseConfigurationName, parameters).toBlocking().single().body(); + } + + /** + * Creates or updates an attached database configuration. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param attachedDatabaseConfigurationName The name of the attached database configuration. + * @param parameters The database parameters supplied to the CreateOrUpdate 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 clusterName, String attachedDatabaseConfigurationName, AttachedDatabaseConfigurationInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, clusterName, attachedDatabaseConfigurationName, parameters), serviceCallback); + } + + /** + * Creates or updates an attached database configuration. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param attachedDatabaseConfigurationName The name of the attached database configuration. + * @param parameters The database parameters supplied to the CreateOrUpdate operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the AttachedDatabaseConfigurationInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String clusterName, String attachedDatabaseConfigurationName, AttachedDatabaseConfigurationInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, clusterName, attachedDatabaseConfigurationName, parameters).map(new Func1, AttachedDatabaseConfigurationInner>() { + @Override + public AttachedDatabaseConfigurationInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates an attached database configuration. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param attachedDatabaseConfigurationName The name of the attached database configuration. + * @param parameters The database parameters supplied to the CreateOrUpdate operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the AttachedDatabaseConfigurationInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String clusterName, String attachedDatabaseConfigurationName, AttachedDatabaseConfigurationInner parameters) { + 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 (attachedDatabaseConfigurationName == null) { + throw new IllegalArgumentException("Parameter attachedDatabaseConfigurationName is 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.beginCreateOrUpdate(resourceGroupName, clusterName, attachedDatabaseConfigurationName, 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 = 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()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Deletes the attached database configuration with the given name. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param attachedDatabaseConfigurationName The name of the attached database 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 clusterName, String attachedDatabaseConfigurationName) { + deleteWithServiceResponseAsync(resourceGroupName, clusterName, attachedDatabaseConfigurationName).toBlocking().last().body(); + } + + /** + * Deletes the attached database configuration with the given name. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param attachedDatabaseConfigurationName The name of the attached database 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 clusterName, String attachedDatabaseConfigurationName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, clusterName, attachedDatabaseConfigurationName), serviceCallback); + } + + /** + * Deletes the attached database configuration with the given name. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param attachedDatabaseConfigurationName The name of the attached database configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String clusterName, String attachedDatabaseConfigurationName) { + return deleteWithServiceResponseAsync(resourceGroupName, clusterName, attachedDatabaseConfigurationName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the attached database configuration with the given name. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param attachedDatabaseConfigurationName The name of the attached database configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String clusterName, String attachedDatabaseConfigurationName) { + 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 (attachedDatabaseConfigurationName == null) { + throw new IllegalArgumentException("Parameter attachedDatabaseConfigurationName is 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, clusterName, attachedDatabaseConfigurationName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Deletes the attached database configuration with the given name. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param attachedDatabaseConfigurationName The name of the attached database 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 clusterName, String attachedDatabaseConfigurationName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, clusterName, attachedDatabaseConfigurationName).toBlocking().single().body(); + } + + /** + * Deletes the attached database configuration with the given name. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param attachedDatabaseConfigurationName The name of the attached database 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 clusterName, String attachedDatabaseConfigurationName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, clusterName, attachedDatabaseConfigurationName), serviceCallback); + } + + /** + * Deletes the attached database configuration with the given name. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param attachedDatabaseConfigurationName The name of the attached database configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String clusterName, String attachedDatabaseConfigurationName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, clusterName, attachedDatabaseConfigurationName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the attached database configuration with the given name. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param attachedDatabaseConfigurationName The name of the attached database configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String clusterName, String attachedDatabaseConfigurationName) { + 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 (attachedDatabaseConfigurationName == null) { + throw new IllegalArgumentException("Parameter attachedDatabaseConfigurationName is 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, clusterName, attachedDatabaseConfigurationName, 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); + } + +} diff --git a/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/implementation/AzureResourceSkuImpl.java b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/implementation/AzureResourceSkuImpl.java new file mode 100644 index 0000000000000..da2358e5def5d --- /dev/null +++ b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/implementation/AzureResourceSkuImpl.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.kusto.v2020_06_14.implementation; + +import com.microsoft.azure.management.kusto.v2020_06_14.AzureResourceSku; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import rx.Observable; +import com.microsoft.azure.management.kusto.v2020_06_14.AzureCapacity; +import com.microsoft.azure.management.kusto.v2020_06_14.AzureSku; + +class AzureResourceSkuImpl extends WrapperImpl implements AzureResourceSku { + private final KustoManager manager; + + AzureResourceSkuImpl(AzureResourceSkuInner inner, KustoManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public KustoManager manager() { + return this.manager; + } + + + + @Override + public AzureCapacity capacity() { + return this.inner().capacity(); + } + + @Override + public String resourceType() { + return this.inner().resourceType(); + } + + @Override + public AzureSku sku() { + return this.inner().sku(); + } + +} diff --git a/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/implementation/AzureResourceSkuInner.java b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/implementation/AzureResourceSkuInner.java new file mode 100644 index 0000000000000..d06bd64fb7caf --- /dev/null +++ b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/implementation/AzureResourceSkuInner.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.kusto.v2020_06_14.implementation; + +import com.microsoft.azure.management.kusto.v2020_06_14.AzureSku; +import com.microsoft.azure.management.kusto.v2020_06_14.AzureCapacity; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Azure resource SKU definition. + */ +public class AzureResourceSkuInner { + /** + * Resource Namespace and Type. + */ + @JsonProperty(value = "resourceType") + private String resourceType; + + /** + * The SKU details. + */ + @JsonProperty(value = "sku") + private AzureSku sku; + + /** + * The number of instances of the cluster. + */ + @JsonProperty(value = "capacity") + private AzureCapacity capacity; + + /** + * Get resource Namespace and Type. + * + * @return the resourceType value + */ + public String resourceType() { + return this.resourceType; + } + + /** + * Set resource Namespace and Type. + * + * @param resourceType the resourceType value to set + * @return the AzureResourceSkuInner object itself. + */ + public AzureResourceSkuInner withResourceType(String resourceType) { + this.resourceType = resourceType; + return this; + } + + /** + * Get the SKU details. + * + * @return the sku value + */ + public AzureSku sku() { + return this.sku; + } + + /** + * Set the SKU details. + * + * @param sku the sku value to set + * @return the AzureResourceSkuInner object itself. + */ + public AzureResourceSkuInner withSku(AzureSku sku) { + this.sku = sku; + return this; + } + + /** + * Get the number of instances of the cluster. + * + * @return the capacity value + */ + public AzureCapacity capacity() { + return this.capacity; + } + + /** + * Set the number of instances of the cluster. + * + * @param capacity the capacity value to set + * @return the AzureResourceSkuInner object itself. + */ + public AzureResourceSkuInner withCapacity(AzureCapacity capacity) { + this.capacity = capacity; + return this; + } + +} diff --git a/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/implementation/CheckNameResultImpl.java b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/implementation/CheckNameResultImpl.java new file mode 100644 index 0000000000000..3d37b59e52749 --- /dev/null +++ b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/implementation/CheckNameResultImpl.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.kusto.v2020_06_14.implementation; + +import com.microsoft.azure.management.kusto.v2020_06_14.CheckNameResult; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.kusto.v2020_06_14.Reason; + +class CheckNameResultImpl extends WrapperImpl implements CheckNameResult { + private final KustoManager manager; + CheckNameResultImpl(CheckNameResultInner inner, KustoManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public KustoManager manager() { + return this.manager; + } + + @Override + public String message() { + return this.inner().message(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public Boolean nameAvailable() { + return this.inner().nameAvailable(); + } + + @Override + public Reason reason() { + return this.inner().reason(); + } + +} diff --git a/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/implementation/CheckNameResultInner.java b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/implementation/CheckNameResultInner.java new file mode 100644 index 0000000000000..b29c499f8d7aa --- /dev/null +++ b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/implementation/CheckNameResultInner.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.kusto.v2020_06_14.implementation; + +import com.microsoft.azure.management.kusto.v2020_06_14.Reason; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The result returned from a check name availability request. + */ +public class CheckNameResultInner { + /** + * Specifies a Boolean value that indicates if the name is available. + */ + @JsonProperty(value = "nameAvailable") + private Boolean nameAvailable; + + /** + * The name that was checked. + */ + @JsonProperty(value = "name") + private String name; + + /** + * Message indicating an unavailable name due to a conflict, or a + * description of the naming rules that are violated. + */ + @JsonProperty(value = "message") + private String message; + + /** + * Message providing the reason why the given name is invalid. Possible + * values include: 'Invalid', 'AlreadyExists'. + */ + @JsonProperty(value = "reason") + private Reason reason; + + /** + * Get specifies a Boolean value that indicates if the name is available. + * + * @return the nameAvailable value + */ + public Boolean nameAvailable() { + return this.nameAvailable; + } + + /** + * Set specifies a Boolean value that indicates if the name is available. + * + * @param nameAvailable the nameAvailable value to set + * @return the CheckNameResultInner object itself. + */ + public CheckNameResultInner withNameAvailable(Boolean nameAvailable) { + this.nameAvailable = nameAvailable; + return this; + } + + /** + * Get the name that was checked. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name that was checked. + * + * @param name the name value to set + * @return the CheckNameResultInner object itself. + */ + public CheckNameResultInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get message indicating an unavailable name due to a conflict, or a description of the naming rules that are violated. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Set message indicating an unavailable name due to a conflict, or a description of the naming rules that are violated. + * + * @param message the message value to set + * @return the CheckNameResultInner object itself. + */ + public CheckNameResultInner withMessage(String message) { + this.message = message; + return this; + } + + /** + * Get message providing the reason why the given name is invalid. Possible values include: 'Invalid', 'AlreadyExists'. + * + * @return the reason value + */ + public Reason reason() { + return this.reason; + } + + /** + * Set message providing the reason why the given name is invalid. Possible values include: 'Invalid', 'AlreadyExists'. + * + * @param reason the reason value to set + * @return the CheckNameResultInner object itself. + */ + public CheckNameResultInner withReason(Reason reason) { + this.reason = reason; + return this; + } + +} diff --git a/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/implementation/ClusterImpl.java b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/implementation/ClusterImpl.java new file mode 100644 index 0000000000000..97d8a7aeb676c --- /dev/null +++ b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/implementation/ClusterImpl.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.kusto.v2020_06_14.implementation; + +import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; +import com.microsoft.azure.management.kusto.v2020_06_14.Cluster; +import rx.Observable; +import com.microsoft.azure.management.kusto.v2020_06_14.ClusterUpdate; +import java.util.List; +import com.microsoft.azure.management.kusto.v2020_06_14.AzureSku; +import com.microsoft.azure.management.kusto.v2020_06_14.Identity; +import com.microsoft.azure.management.kusto.v2020_06_14.State; +import com.microsoft.azure.management.kusto.v2020_06_14.ProvisioningState; +import com.microsoft.azure.management.kusto.v2020_06_14.TrustedExternalTenant; +import com.microsoft.azure.management.kusto.v2020_06_14.OptimizedAutoscale; +import com.microsoft.azure.management.kusto.v2020_06_14.VirtualNetworkConfiguration; +import com.microsoft.azure.management.kusto.v2020_06_14.KeyVaultProperties; +import com.microsoft.azure.management.kusto.v2020_06_14.LanguageExtensionsList; +import rx.functions.Func1; + +class ClusterImpl extends GroupableResourceCoreImpl implements Cluster, Cluster.Definition, Cluster.Update { + private ClusterUpdate updateParameter; + ClusterImpl(String name, ClusterInner inner, KustoManager manager) { + super(name, inner, manager); + this.updateParameter = new ClusterUpdate(); + } + + @Override + public Observable createResourceAsync() { + ClustersInner client = this.manager().inner().clusters(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .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.updateAsync(this.resourceGroupName(), this.name(), this.updateParameter) + .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.updateParameter = new ClusterUpdate(); + } + + @Override + public String dataIngestionUri() { + return this.inner().dataIngestionUri(); + } + + @Override + public Boolean enableDiskEncryption() { + return this.inner().enableDiskEncryption(); + } + + @Override + public Boolean enableDoubleEncryption() { + return this.inner().enableDoubleEncryption(); + } + + @Override + public Boolean enablePurge() { + return this.inner().enablePurge(); + } + + @Override + public Boolean enableStreamingIngest() { + return this.inner().enableStreamingIngest(); + } + + @Override + public Identity identity() { + return this.inner().identity(); + } + + @Override + public KeyVaultProperties keyVaultProperties() { + return this.inner().keyVaultProperties(); + } + + @Override + public LanguageExtensionsList languageExtensions() { + return this.inner().languageExtensions(); + } + + @Override + public OptimizedAutoscale optimizedAutoscale() { + return this.inner().optimizedAutoscale(); + } + + @Override + public ProvisioningState provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public AzureSku sku() { + return this.inner().sku(); + } + + @Override + public State state() { + return this.inner().state(); + } + + @Override + public String stateReason() { + return this.inner().stateReason(); + } + + @Override + public List trustedExternalTenants() { + return this.inner().trustedExternalTenants(); + } + + @Override + public String uri() { + return this.inner().uri(); + } + + @Override + public VirtualNetworkConfiguration virtualNetworkConfiguration() { + return this.inner().virtualNetworkConfiguration(); + } + + @Override + public List zones() { + return this.inner().zones(); + } + + @Override + public ClusterImpl withZones(List zones) { + this.inner().withZones(zones); + return this; + } + + @Override + public ClusterImpl withSku(AzureSku sku) { + if (isInCreateMode()) { + this.inner().withSku(sku); + } else { + this.updateParameter.withSku(sku); + } + return this; + } + + @Override + public ClusterImpl withEnableDiskEncryption(Boolean enableDiskEncryption) { + if (isInCreateMode()) { + this.inner().withEnableDiskEncryption(enableDiskEncryption); + } else { + this.updateParameter.withEnableDiskEncryption(enableDiskEncryption); + } + return this; + } + + @Override + public ClusterImpl withEnableDoubleEncryption(Boolean enableDoubleEncryption) { + if (isInCreateMode()) { + this.inner().withEnableDoubleEncryption(enableDoubleEncryption); + } else { + this.updateParameter.withEnableDoubleEncryption(enableDoubleEncryption); + } + return this; + } + + @Override + public ClusterImpl withEnablePurge(Boolean enablePurge) { + if (isInCreateMode()) { + this.inner().withEnablePurge(enablePurge); + } else { + this.updateParameter.withEnablePurge(enablePurge); + } + return this; + } + + @Override + public ClusterImpl withEnableStreamingIngest(Boolean enableStreamingIngest) { + if (isInCreateMode()) { + this.inner().withEnableStreamingIngest(enableStreamingIngest); + } else { + this.updateParameter.withEnableStreamingIngest(enableStreamingIngest); + } + return this; + } + + @Override + public ClusterImpl withIdentity(Identity identity) { + if (isInCreateMode()) { + this.inner().withIdentity(identity); + } else { + this.updateParameter.withIdentity(identity); + } + return this; + } + + @Override + public ClusterImpl withKeyVaultProperties(KeyVaultProperties keyVaultProperties) { + if (isInCreateMode()) { + this.inner().withKeyVaultProperties(keyVaultProperties); + } else { + this.updateParameter.withKeyVaultProperties(keyVaultProperties); + } + return this; + } + + @Override + public ClusterImpl withOptimizedAutoscale(OptimizedAutoscale optimizedAutoscale) { + if (isInCreateMode()) { + this.inner().withOptimizedAutoscale(optimizedAutoscale); + } else { + this.updateParameter.withOptimizedAutoscale(optimizedAutoscale); + } + return this; + } + + @Override + public ClusterImpl withTrustedExternalTenants(List trustedExternalTenants) { + if (isInCreateMode()) { + this.inner().withTrustedExternalTenants(trustedExternalTenants); + } else { + this.updateParameter.withTrustedExternalTenants(trustedExternalTenants); + } + return this; + } + + @Override + public ClusterImpl withVirtualNetworkConfiguration(VirtualNetworkConfiguration virtualNetworkConfiguration) { + if (isInCreateMode()) { + this.inner().withVirtualNetworkConfiguration(virtualNetworkConfiguration); + } else { + this.updateParameter.withVirtualNetworkConfiguration(virtualNetworkConfiguration); + } + return this; + } + +} diff --git a/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/implementation/ClusterInner.java b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/implementation/ClusterInner.java new file mode 100644 index 0000000000000..0ff5aa26128ff --- /dev/null +++ b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/implementation/ClusterInner.java @@ -0,0 +1,409 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.kusto.v2020_06_14.implementation; + +import com.microsoft.azure.management.kusto.v2020_06_14.AzureSku; +import java.util.List; +import com.microsoft.azure.management.kusto.v2020_06_14.Identity; +import com.microsoft.azure.management.kusto.v2020_06_14.State; +import com.microsoft.azure.management.kusto.v2020_06_14.ProvisioningState; +import com.microsoft.azure.management.kusto.v2020_06_14.TrustedExternalTenant; +import com.microsoft.azure.management.kusto.v2020_06_14.OptimizedAutoscale; +import com.microsoft.azure.management.kusto.v2020_06_14.VirtualNetworkConfiguration; +import com.microsoft.azure.management.kusto.v2020_06_14.KeyVaultProperties; +import com.microsoft.azure.management.kusto.v2020_06_14.LanguageExtensionsList; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.Resource; + +/** + * Class representing a Kusto cluster. + */ +@JsonFlatten +public class ClusterInner extends Resource { + /** + * The SKU of the cluster. + */ + @JsonProperty(value = "sku", required = true) + private AzureSku sku; + + /** + * The availability zones of the cluster. + */ + @JsonProperty(value = "zones") + private List zones; + + /** + * The identity of the cluster, if configured. + */ + @JsonProperty(value = "identity") + private Identity identity; + + /** + * The state of the resource. Possible values include: 'Creating', + * 'Unavailable', 'Running', 'Deleting', 'Deleted', 'Stopping', 'Stopped', + * 'Starting', 'Updating'. + */ + @JsonProperty(value = "properties.state", access = JsonProperty.Access.WRITE_ONLY) + private State state; + + /** + * The provisioned state of the resource. Possible values include: + * 'Running', 'Creating', 'Deleting', 'Succeeded', 'Failed', 'Moving'. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /** + * The cluster URI. + */ + @JsonProperty(value = "properties.uri", access = JsonProperty.Access.WRITE_ONLY) + private String uri; + + /** + * The cluster data ingestion URI. + */ + @JsonProperty(value = "properties.dataIngestionUri", access = JsonProperty.Access.WRITE_ONLY) + private String dataIngestionUri; + + /** + * The reason for the cluster's current state. + */ + @JsonProperty(value = "properties.stateReason", access = JsonProperty.Access.WRITE_ONLY) + private String stateReason; + + /** + * The cluster's external tenants. + */ + @JsonProperty(value = "properties.trustedExternalTenants") + private List trustedExternalTenants; + + /** + * Optimized auto scale definition. + */ + @JsonProperty(value = "properties.optimizedAutoscale") + private OptimizedAutoscale optimizedAutoscale; + + /** + * A boolean value that indicates if the cluster's disks are encrypted. + */ + @JsonProperty(value = "properties.enableDiskEncryption") + private Boolean enableDiskEncryption; + + /** + * A boolean value that indicates if the streaming ingest is enabled. + */ + @JsonProperty(value = "properties.enableStreamingIngest") + private Boolean enableStreamingIngest; + + /** + * Virtual network definition. + */ + @JsonProperty(value = "properties.virtualNetworkConfiguration") + private VirtualNetworkConfiguration virtualNetworkConfiguration; + + /** + * KeyVault properties for the cluster encryption. + */ + @JsonProperty(value = "properties.keyVaultProperties") + private KeyVaultProperties keyVaultProperties; + + /** + * A boolean value that indicates if the purge operations are enabled. + */ + @JsonProperty(value = "properties.enablePurge") + private Boolean enablePurge; + + /** + * List of the cluster's language extensions. + */ + @JsonProperty(value = "properties.languageExtensions", access = JsonProperty.Access.WRITE_ONLY) + private LanguageExtensionsList languageExtensions; + + /** + * A boolean value that indicates if double encryption is enabled. + */ + @JsonProperty(value = "properties.enableDoubleEncryption") + private Boolean enableDoubleEncryption; + + /** + * Get the SKU of the cluster. + * + * @return the sku value + */ + public AzureSku sku() { + return this.sku; + } + + /** + * Set the SKU of the cluster. + * + * @param sku the sku value to set + * @return the ClusterInner object itself. + */ + public ClusterInner withSku(AzureSku sku) { + this.sku = sku; + return this; + } + + /** + * Get the availability zones of the cluster. + * + * @return the zones value + */ + public List zones() { + return this.zones; + } + + /** + * Set the availability zones of the cluster. + * + * @param zones the zones value to set + * @return the ClusterInner object itself. + */ + public ClusterInner withZones(List zones) { + this.zones = zones; + return this; + } + + /** + * Get the identity of the cluster, if configured. + * + * @return the identity value + */ + public Identity identity() { + return this.identity; + } + + /** + * Set the identity of the cluster, if configured. + * + * @param identity the identity value to set + * @return the ClusterInner object itself. + */ + public ClusterInner withIdentity(Identity identity) { + this.identity = identity; + return this; + } + + /** + * Get the state of the resource. Possible values include: 'Creating', 'Unavailable', 'Running', 'Deleting', 'Deleted', 'Stopping', 'Stopped', 'Starting', 'Updating'. + * + * @return the state value + */ + public State state() { + return this.state; + } + + /** + * Get the provisioned state of the resource. Possible values include: 'Running', 'Creating', 'Deleting', 'Succeeded', 'Failed', 'Moving'. + * + * @return the provisioningState value + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the cluster URI. + * + * @return the uri value + */ + public String uri() { + return this.uri; + } + + /** + * Get the cluster data ingestion URI. + * + * @return the dataIngestionUri value + */ + public String dataIngestionUri() { + return this.dataIngestionUri; + } + + /** + * Get the reason for the cluster's current state. + * + * @return the stateReason value + */ + public String stateReason() { + return this.stateReason; + } + + /** + * Get the cluster's external tenants. + * + * @return the trustedExternalTenants value + */ + public List trustedExternalTenants() { + return this.trustedExternalTenants; + } + + /** + * Set the cluster's external tenants. + * + * @param trustedExternalTenants the trustedExternalTenants value to set + * @return the ClusterInner object itself. + */ + public ClusterInner withTrustedExternalTenants(List trustedExternalTenants) { + this.trustedExternalTenants = trustedExternalTenants; + return this; + } + + /** + * Get optimized auto scale definition. + * + * @return the optimizedAutoscale value + */ + public OptimizedAutoscale optimizedAutoscale() { + return this.optimizedAutoscale; + } + + /** + * Set optimized auto scale definition. + * + * @param optimizedAutoscale the optimizedAutoscale value to set + * @return the ClusterInner object itself. + */ + public ClusterInner withOptimizedAutoscale(OptimizedAutoscale optimizedAutoscale) { + this.optimizedAutoscale = optimizedAutoscale; + return this; + } + + /** + * Get a boolean value that indicates if the cluster's disks are encrypted. + * + * @return the enableDiskEncryption value + */ + public Boolean enableDiskEncryption() { + return this.enableDiskEncryption; + } + + /** + * Set a boolean value that indicates if the cluster's disks are encrypted. + * + * @param enableDiskEncryption the enableDiskEncryption value to set + * @return the ClusterInner object itself. + */ + public ClusterInner withEnableDiskEncryption(Boolean enableDiskEncryption) { + this.enableDiskEncryption = enableDiskEncryption; + return this; + } + + /** + * Get a boolean value that indicates if the streaming ingest is enabled. + * + * @return the enableStreamingIngest value + */ + public Boolean enableStreamingIngest() { + return this.enableStreamingIngest; + } + + /** + * Set a boolean value that indicates if the streaming ingest is enabled. + * + * @param enableStreamingIngest the enableStreamingIngest value to set + * @return the ClusterInner object itself. + */ + public ClusterInner withEnableStreamingIngest(Boolean enableStreamingIngest) { + this.enableStreamingIngest = enableStreamingIngest; + return this; + } + + /** + * Get virtual network definition. + * + * @return the virtualNetworkConfiguration value + */ + public VirtualNetworkConfiguration virtualNetworkConfiguration() { + return this.virtualNetworkConfiguration; + } + + /** + * Set virtual network definition. + * + * @param virtualNetworkConfiguration the virtualNetworkConfiguration value to set + * @return the ClusterInner object itself. + */ + public ClusterInner withVirtualNetworkConfiguration(VirtualNetworkConfiguration virtualNetworkConfiguration) { + this.virtualNetworkConfiguration = virtualNetworkConfiguration; + return this; + } + + /** + * Get keyVault properties for the cluster encryption. + * + * @return the keyVaultProperties value + */ + public KeyVaultProperties keyVaultProperties() { + return this.keyVaultProperties; + } + + /** + * Set keyVault properties for the cluster encryption. + * + * @param keyVaultProperties the keyVaultProperties value to set + * @return the ClusterInner object itself. + */ + public ClusterInner withKeyVaultProperties(KeyVaultProperties keyVaultProperties) { + this.keyVaultProperties = keyVaultProperties; + return this; + } + + /** + * Get a boolean value that indicates if the purge operations are enabled. + * + * @return the enablePurge value + */ + public Boolean enablePurge() { + return this.enablePurge; + } + + /** + * Set a boolean value that indicates if the purge operations are enabled. + * + * @param enablePurge the enablePurge value to set + * @return the ClusterInner object itself. + */ + public ClusterInner withEnablePurge(Boolean enablePurge) { + this.enablePurge = enablePurge; + return this; + } + + /** + * Get list of the cluster's language extensions. + * + * @return the languageExtensions value + */ + public LanguageExtensionsList languageExtensions() { + return this.languageExtensions; + } + + /** + * Get a boolean value that indicates if double encryption is enabled. + * + * @return the enableDoubleEncryption value + */ + public Boolean enableDoubleEncryption() { + return this.enableDoubleEncryption; + } + + /** + * Set a boolean value that indicates if double encryption is enabled. + * + * @param enableDoubleEncryption the enableDoubleEncryption value to set + * @return the ClusterInner object itself. + */ + public ClusterInner withEnableDoubleEncryption(Boolean enableDoubleEncryption) { + this.enableDoubleEncryption = enableDoubleEncryption; + return this; + } + +} diff --git a/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/implementation/ClusterPrincipalAssignmentImpl.java b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/implementation/ClusterPrincipalAssignmentImpl.java new file mode 100644 index 0000000000000..5726435d84eed --- /dev/null +++ b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/implementation/ClusterPrincipalAssignmentImpl.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.kusto.v2020_06_14.implementation; + +import com.microsoft.azure.management.kusto.v2020_06_14.ClusterPrincipalAssignment; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import com.microsoft.azure.management.kusto.v2020_06_14.ClusterPrincipalRole; +import com.microsoft.azure.management.kusto.v2020_06_14.PrincipalType; +import com.microsoft.azure.management.kusto.v2020_06_14.ProvisioningState; + +class ClusterPrincipalAssignmentImpl extends CreatableUpdatableImpl implements ClusterPrincipalAssignment, ClusterPrincipalAssignment.Definition, ClusterPrincipalAssignment.Update { + private final KustoManager manager; + private String resourceGroupName; + private String clusterName; + private String principalAssignmentName; + + ClusterPrincipalAssignmentImpl(String name, KustoManager manager) { + super(name, new ClusterPrincipalAssignmentInner()); + this.manager = manager; + // Set resource name + this.principalAssignmentName = name; + // + } + + ClusterPrincipalAssignmentImpl(ClusterPrincipalAssignmentInner inner, KustoManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.principalAssignmentName = inner.name(); + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.clusterName = IdParsingUtils.getValueFromIdByName(inner.id(), "clusters"); + this.principalAssignmentName = IdParsingUtils.getValueFromIdByName(inner.id(), "principalAssignments"); + // + } + + @Override + public KustoManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + ClusterPrincipalAssignmentsInner client = this.manager().inner().clusterPrincipalAssignments(); + return client.createOrUpdateAsync(this.resourceGroupName, this.clusterName, this.principalAssignmentName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + ClusterPrincipalAssignmentsInner client = this.manager().inner().clusterPrincipalAssignments(); + return client.createOrUpdateAsync(this.resourceGroupName, this.clusterName, this.principalAssignmentName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + ClusterPrincipalAssignmentsInner client = this.manager().inner().clusterPrincipalAssignments(); + return client.getAsync(this.resourceGroupName, this.clusterName, this.principalAssignmentName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @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 principalName() { + return this.inner().principalName(); + } + + @Override + public PrincipalType principalType() { + return this.inner().principalType(); + } + + @Override + public ProvisioningState provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public ClusterPrincipalRole role() { + return this.inner().role(); + } + + @Override + public String tenantId() { + return this.inner().tenantId(); + } + + @Override + public String tenantName() { + return this.inner().tenantName(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public ClusterPrincipalAssignmentImpl withExistingCluster(String resourceGroupName, String clusterName) { + this.resourceGroupName = resourceGroupName; + this.clusterName = clusterName; + return this; + } + + @Override + public ClusterPrincipalAssignmentImpl withPrincipalId(String principalId) { + this.inner().withPrincipalId(principalId); + return this; + } + + @Override + public ClusterPrincipalAssignmentImpl withPrincipalType(PrincipalType principalType) { + this.inner().withPrincipalType(principalType); + return this; + } + + @Override + public ClusterPrincipalAssignmentImpl withRole(ClusterPrincipalRole role) { + this.inner().withRole(role); + return this; + } + + @Override + public ClusterPrincipalAssignmentImpl withTenantId(String tenantId) { + this.inner().withTenantId(tenantId); + return this; + } + +} diff --git a/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/implementation/ClusterPrincipalAssignmentInner.java b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/implementation/ClusterPrincipalAssignmentInner.java new file mode 100644 index 0000000000000..b117b5c7ad682 --- /dev/null +++ b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/implementation/ClusterPrincipalAssignmentInner.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.kusto.v2020_06_14.implementation; + +import com.microsoft.azure.management.kusto.v2020_06_14.ClusterPrincipalRole; +import com.microsoft.azure.management.kusto.v2020_06_14.PrincipalType; +import com.microsoft.azure.management.kusto.v2020_06_14.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.ProxyResource; + +/** + * Class representing a cluster principal assignment. + */ +@JsonFlatten +public class ClusterPrincipalAssignmentInner extends ProxyResource { + /** + * The principal ID assigned to the cluster principal. It can be a user + * email, application ID, or security group name. + */ + @JsonProperty(value = "properties.principalId", required = true) + private String principalId; + + /** + * Cluster principal role. Possible values include: 'AllDatabasesAdmin', + * 'AllDatabasesViewer'. + */ + @JsonProperty(value = "properties.role", required = true) + private ClusterPrincipalRole role; + + /** + * The tenant id of the principal. + */ + @JsonProperty(value = "properties.tenantId") + private String tenantId; + + /** + * Principal type. Possible values include: 'App', 'Group', 'User'. + */ + @JsonProperty(value = "properties.principalType", required = true) + private PrincipalType principalType; + + /** + * The tenant name of the principal. + */ + @JsonProperty(value = "properties.tenantName", access = JsonProperty.Access.WRITE_ONLY) + private String tenantName; + + /** + * The principal name. + */ + @JsonProperty(value = "properties.principalName", access = JsonProperty.Access.WRITE_ONLY) + private String principalName; + + /** + * The provisioned state of the resource. Possible values include: + * 'Running', 'Creating', 'Deleting', 'Succeeded', 'Failed', 'Moving'. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /** + * Get the principal ID assigned to the cluster principal. It can be a user email, application ID, or security group name. + * + * @return the principalId value + */ + public String principalId() { + return this.principalId; + } + + /** + * Set the principal ID assigned to the cluster principal. It can be a user email, application ID, or security group name. + * + * @param principalId the principalId value to set + * @return the ClusterPrincipalAssignmentInner object itself. + */ + public ClusterPrincipalAssignmentInner withPrincipalId(String principalId) { + this.principalId = principalId; + return this; + } + + /** + * Get cluster principal role. Possible values include: 'AllDatabasesAdmin', 'AllDatabasesViewer'. + * + * @return the role value + */ + public ClusterPrincipalRole role() { + return this.role; + } + + /** + * Set cluster principal role. Possible values include: 'AllDatabasesAdmin', 'AllDatabasesViewer'. + * + * @param role the role value to set + * @return the ClusterPrincipalAssignmentInner object itself. + */ + public ClusterPrincipalAssignmentInner withRole(ClusterPrincipalRole role) { + this.role = role; + return this; + } + + /** + * Get the tenant id of the principal. + * + * @return the tenantId value + */ + public String tenantId() { + return this.tenantId; + } + + /** + * Set the tenant id of the principal. + * + * @param tenantId the tenantId value to set + * @return the ClusterPrincipalAssignmentInner object itself. + */ + public ClusterPrincipalAssignmentInner withTenantId(String tenantId) { + this.tenantId = tenantId; + return this; + } + + /** + * Get principal type. Possible values include: 'App', 'Group', 'User'. + * + * @return the principalType value + */ + public PrincipalType principalType() { + return this.principalType; + } + + /** + * Set principal type. Possible values include: 'App', 'Group', 'User'. + * + * @param principalType the principalType value to set + * @return the ClusterPrincipalAssignmentInner object itself. + */ + public ClusterPrincipalAssignmentInner withPrincipalType(PrincipalType principalType) { + this.principalType = principalType; + return this; + } + + /** + * Get the tenant name of the principal. + * + * @return the tenantName value + */ + public String tenantName() { + return this.tenantName; + } + + /** + * Get the principal name. + * + * @return the principalName value + */ + public String principalName() { + return this.principalName; + } + + /** + * Get the provisioned state of the resource. Possible values include: 'Running', 'Creating', 'Deleting', 'Succeeded', 'Failed', 'Moving'. + * + * @return the provisioningState value + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + +} diff --git a/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/implementation/ClusterPrincipalAssignmentsImpl.java b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/implementation/ClusterPrincipalAssignmentsImpl.java new file mode 100644 index 0000000000000..8630a1bad8405 --- /dev/null +++ b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/implementation/ClusterPrincipalAssignmentsImpl.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.kusto.v2020_06_14.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.kusto.v2020_06_14.ClusterPrincipalAssignments; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import java.util.List; +import com.microsoft.azure.management.kusto.v2020_06_14.ClusterPrincipalAssignment; +import com.microsoft.azure.management.kusto.v2020_06_14.CheckNameResult; + +class ClusterPrincipalAssignmentsImpl extends WrapperImpl implements ClusterPrincipalAssignments { + private final KustoManager manager; + + ClusterPrincipalAssignmentsImpl(KustoManager manager) { + super(manager.inner().clusterPrincipalAssignments()); + this.manager = manager; + } + + public KustoManager manager() { + return this.manager; + } + + @Override + public ClusterPrincipalAssignmentImpl define(String name) { + return wrapModel(name); + } + + private ClusterPrincipalAssignmentImpl wrapModel(ClusterPrincipalAssignmentInner inner) { + return new ClusterPrincipalAssignmentImpl(inner, manager()); + } + + private ClusterPrincipalAssignmentImpl wrapModel(String name) { + return new ClusterPrincipalAssignmentImpl(name, this.manager()); + } + + @Override + public Observable listAsync(String resourceGroupName, String clusterName) { + ClusterPrincipalAssignmentsInner client = this.inner(); + return client.listAsync(resourceGroupName, clusterName) + .flatMap(new Func1, Observable>() { + @Override + public Observable call(List innerList) { + return Observable.from(innerList); + } + }) + .map(new Func1() { + @Override + public ClusterPrincipalAssignment call(ClusterPrincipalAssignmentInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String clusterName, String principalAssignmentName) { + ClusterPrincipalAssignmentsInner client = this.inner(); + return client.getAsync(resourceGroupName, clusterName, principalAssignmentName) + .flatMap(new Func1>() { + @Override + public Observable call(ClusterPrincipalAssignmentInner inner) { + if (inner == null) { + return Observable.empty(); + } else { + return Observable.just((ClusterPrincipalAssignment)wrapModel(inner)); + } + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String clusterName, String principalAssignmentName) { + ClusterPrincipalAssignmentsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, clusterName, principalAssignmentName).toCompletable(); + } + + @Override + public Observable checkNameAvailabilityAsync(String resourceGroupName, String clusterName, String name) { + ClusterPrincipalAssignmentsInner client = this.inner(); + return client.checkNameAvailabilityAsync(resourceGroupName, clusterName, name) + .map(new Func1() { + @Override + public CheckNameResult call(CheckNameResultInner inner) { + return new CheckNameResultImpl(inner, manager()); + } + }); + } + +} diff --git a/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/implementation/ClusterPrincipalAssignmentsInner.java b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/implementation/ClusterPrincipalAssignmentsInner.java new file mode 100644 index 0000000000000..f73a58e5f3ab9 --- /dev/null +++ b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/implementation/ClusterPrincipalAssignmentsInner.java @@ -0,0 +1,725 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.kusto.v2020_06_14.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.management.kusto.v2020_06_14.ClusterPrincipalAssignmentCheckNameRequest; +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 ClusterPrincipalAssignments. + */ +public class ClusterPrincipalAssignmentsInner { + /** The Retrofit service to perform REST calls. */ + private ClusterPrincipalAssignmentsService service; + /** The service client containing this operation class. */ + private KustoManagementClientImpl client; + + /** + * Initializes an instance of ClusterPrincipalAssignmentsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ClusterPrincipalAssignmentsInner(Retrofit retrofit, KustoManagementClientImpl client) { + this.service = retrofit.create(ClusterPrincipalAssignmentsService.class); + this.client = client; + } + + /** + * The interface defining all the services for ClusterPrincipalAssignments to be + * used by Retrofit to perform actually REST calls. + */ + interface ClusterPrincipalAssignmentsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.kusto.v2020_06_14.ClusterPrincipalAssignments checkNameAvailability" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/checkPrincipalAssignmentNameAvailability") + Observable> checkNameAvailability(@Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body ClusterPrincipalAssignmentCheckNameRequest principalAssignmentName, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.kusto.v2020_06_14.ClusterPrincipalAssignments get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/principalAssignments/{principalAssignmentName}") + Observable> get(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("principalAssignmentName") String principalAssignmentName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.kusto.v2020_06_14.ClusterPrincipalAssignments createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/principalAssignments/{principalAssignmentName}") + Observable> createOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("principalAssignmentName") String principalAssignmentName, @Query("api-version") String apiVersion, @Body ClusterPrincipalAssignmentInner 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.kusto.v2020_06_14.ClusterPrincipalAssignments beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/principalAssignments/{principalAssignmentName}") + Observable> beginCreateOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("principalAssignmentName") String principalAssignmentName, @Query("api-version") String apiVersion, @Body ClusterPrincipalAssignmentInner 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.kusto.v2020_06_14.ClusterPrincipalAssignments delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/principalAssignments/{principalAssignmentName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("principalAssignmentName") String principalAssignmentName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.kusto.v2020_06_14.ClusterPrincipalAssignments beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/principalAssignments/{principalAssignmentName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("principalAssignmentName") String principalAssignmentName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.kusto.v2020_06_14.ClusterPrincipalAssignments list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/principalAssignments") + 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); + + } + + /** + * Checks that the principal assignment name is valid and is not already in use. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param name Principal Assignment resource 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 CheckNameResultInner object if successful. + */ + public CheckNameResultInner checkNameAvailability(String resourceGroupName, String clusterName, String name) { + return checkNameAvailabilityWithServiceResponseAsync(resourceGroupName, clusterName, name).toBlocking().single().body(); + } + + /** + * Checks that the principal assignment name is valid and is not already in use. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param name Principal Assignment resource 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 resourceGroupName, String clusterName, String name, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(checkNameAvailabilityWithServiceResponseAsync(resourceGroupName, clusterName, name), serviceCallback); + } + + /** + * Checks that the principal assignment name is valid and is not already in use. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param name Principal Assignment resource name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CheckNameResultInner object + */ + public Observable checkNameAvailabilityAsync(String resourceGroupName, String clusterName, String name) { + return checkNameAvailabilityWithServiceResponseAsync(resourceGroupName, clusterName, name).map(new Func1, CheckNameResultInner>() { + @Override + public CheckNameResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Checks that the principal assignment name is valid and is not already in use. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param name Principal Assignment resource name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CheckNameResultInner object + */ + public Observable> checkNameAvailabilityWithServiceResponseAsync(String resourceGroupName, String clusterName, String name) { + 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.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."); + } + ClusterPrincipalAssignmentCheckNameRequest principalAssignmentName = new ClusterPrincipalAssignmentCheckNameRequest(); + principalAssignmentName.withName(name); + return service.checkNameAvailability(resourceGroupName, clusterName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), principalAssignmentName, 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 a Kusto cluster principalAssignment. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param principalAssignmentName The name of the Kusto principalAssignment. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ClusterPrincipalAssignmentInner object if successful. + */ + public ClusterPrincipalAssignmentInner get(String resourceGroupName, String clusterName, String principalAssignmentName) { + return getWithServiceResponseAsync(resourceGroupName, clusterName, principalAssignmentName).toBlocking().single().body(); + } + + /** + * Gets a Kusto cluster principalAssignment. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param principalAssignmentName The name of the Kusto principalAssignment. + * @param serviceCallback 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 principalAssignmentName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, clusterName, principalAssignmentName), serviceCallback); + } + + /** + * Gets a Kusto cluster principalAssignment. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param principalAssignmentName The name of the Kusto principalAssignment. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ClusterPrincipalAssignmentInner object + */ + public Observable getAsync(String resourceGroupName, String clusterName, String principalAssignmentName) { + return getWithServiceResponseAsync(resourceGroupName, clusterName, principalAssignmentName).map(new Func1, ClusterPrincipalAssignmentInner>() { + @Override + public ClusterPrincipalAssignmentInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets a Kusto cluster principalAssignment. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param principalAssignmentName The name of the Kusto principalAssignment. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ClusterPrincipalAssignmentInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String clusterName, String principalAssignmentName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter 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 (principalAssignmentName == null) { + throw new IllegalArgumentException("Parameter principalAssignmentName is required 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, principalAssignmentName, 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); + } + + /** + * Create a Kusto cluster principalAssignment. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param principalAssignmentName The name of the Kusto principalAssignment. + * @param parameters The Kusto cluster principalAssignment's parameters supplied for the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ClusterPrincipalAssignmentInner object if successful. + */ + public ClusterPrincipalAssignmentInner createOrUpdate(String resourceGroupName, String clusterName, String principalAssignmentName, ClusterPrincipalAssignmentInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, clusterName, principalAssignmentName, parameters).toBlocking().last().body(); + } + + /** + * Create a Kusto cluster principalAssignment. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param principalAssignmentName The name of the Kusto principalAssignment. + * @param parameters The Kusto cluster principalAssignment's parameters supplied 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 createOrUpdateAsync(String resourceGroupName, String clusterName, String principalAssignmentName, ClusterPrincipalAssignmentInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, clusterName, principalAssignmentName, parameters), serviceCallback); + } + + /** + * Create a Kusto cluster principalAssignment. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param principalAssignmentName The name of the Kusto principalAssignment. + * @param parameters The Kusto cluster principalAssignment's parameters supplied for the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String clusterName, String principalAssignmentName, ClusterPrincipalAssignmentInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, clusterName, principalAssignmentName, parameters).map(new Func1, ClusterPrincipalAssignmentInner>() { + @Override + public ClusterPrincipalAssignmentInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create a Kusto cluster principalAssignment. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param principalAssignmentName The name of the Kusto principalAssignment. + * @param parameters The Kusto cluster principalAssignment's parameters supplied for the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String clusterName, String principalAssignmentName, ClusterPrincipalAssignmentInner 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 (principalAssignmentName == null) { + throw new IllegalArgumentException("Parameter principalAssignmentName 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.createOrUpdate(this.client.subscriptionId(), resourceGroupName, clusterName, principalAssignmentName, this.client.apiVersion(), parameters, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Create a Kusto cluster principalAssignment. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param principalAssignmentName The name of the Kusto principalAssignment. + * @param parameters The Kusto cluster principalAssignment's parameters supplied for the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ClusterPrincipalAssignmentInner object if successful. + */ + public ClusterPrincipalAssignmentInner beginCreateOrUpdate(String resourceGroupName, String clusterName, String principalAssignmentName, ClusterPrincipalAssignmentInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, clusterName, principalAssignmentName, parameters).toBlocking().single().body(); + } + + /** + * Create a Kusto cluster principalAssignment. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param principalAssignmentName The name of the Kusto principalAssignment. + * @param parameters The Kusto cluster principalAssignment's parameters supplied 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 beginCreateOrUpdateAsync(String resourceGroupName, String clusterName, String principalAssignmentName, ClusterPrincipalAssignmentInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, clusterName, principalAssignmentName, parameters), serviceCallback); + } + + /** + * Create a Kusto cluster principalAssignment. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param principalAssignmentName The name of the Kusto principalAssignment. + * @param parameters The Kusto cluster principalAssignment's parameters supplied for the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ClusterPrincipalAssignmentInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String clusterName, String principalAssignmentName, ClusterPrincipalAssignmentInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, clusterName, principalAssignmentName, parameters).map(new Func1, ClusterPrincipalAssignmentInner>() { + @Override + public ClusterPrincipalAssignmentInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create a Kusto cluster principalAssignment. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param principalAssignmentName The name of the Kusto principalAssignment. + * @param parameters The Kusto cluster principalAssignment's parameters supplied for the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ClusterPrincipalAssignmentInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String clusterName, String principalAssignmentName, ClusterPrincipalAssignmentInner 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 (principalAssignmentName == null) { + throw new IllegalArgumentException("Parameter principalAssignmentName 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.beginCreateOrUpdate(this.client.subscriptionId(), resourceGroupName, clusterName, principalAssignmentName, this.client.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); + } + + /** + * Deletes a Kusto cluster principalAssignment. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param principalAssignmentName The name of the Kusto principalAssignment. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @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 clusterName, String principalAssignmentName) { + deleteWithServiceResponseAsync(resourceGroupName, clusterName, principalAssignmentName).toBlocking().last().body(); + } + + /** + * Deletes a Kusto cluster principalAssignment. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param principalAssignmentName The name of the Kusto principalAssignment. + * @param serviceCallback 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 principalAssignmentName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, clusterName, principalAssignmentName), serviceCallback); + } + + /** + * Deletes a Kusto cluster principalAssignment. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param principalAssignmentName The name of the Kusto principalAssignment. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String clusterName, String principalAssignmentName) { + return deleteWithServiceResponseAsync(resourceGroupName, clusterName, principalAssignmentName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes a Kusto cluster principalAssignment. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param principalAssignmentName The name of the Kusto principalAssignment. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String clusterName, String principalAssignmentName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter 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 (principalAssignmentName == null) { + throw new IllegalArgumentException("Parameter principalAssignmentName 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, principalAssignmentName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Deletes a Kusto cluster principalAssignment. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param principalAssignmentName The name of the Kusto principalAssignment. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @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 clusterName, String principalAssignmentName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, clusterName, principalAssignmentName).toBlocking().single().body(); + } + + /** + * Deletes a Kusto cluster principalAssignment. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param principalAssignmentName The name of the Kusto principalAssignment. + * @param serviceCallback 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 principalAssignmentName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, clusterName, principalAssignmentName), serviceCallback); + } + + /** + * Deletes a Kusto cluster principalAssignment. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param principalAssignmentName The name of the Kusto principalAssignment. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String clusterName, String principalAssignmentName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, clusterName, principalAssignmentName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes a Kusto cluster principalAssignment. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param principalAssignmentName The name of the Kusto principalAssignment. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String clusterName, String principalAssignmentName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter 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 (principalAssignmentName == null) { + throw new IllegalArgumentException("Parameter principalAssignmentName is required 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, principalAssignmentName, 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); + } + + /** + * Lists all Kusto cluster principalAssignments. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException 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<ClusterPrincipalAssignmentInner> object if successful. + */ + public List list(String resourceGroupName, String clusterName) { + return listWithServiceResponseAsync(resourceGroupName, clusterName).toBlocking().single().body(); + } + + /** + * Lists all Kusto cluster principalAssignments. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto 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(String resourceGroupName, String clusterName, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listWithServiceResponseAsync(resourceGroupName, clusterName), serviceCallback); + } + + /** + * Lists all Kusto cluster principalAssignments. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<ClusterPrincipalAssignmentInner> object + */ + public Observable> listAsync(String resourceGroupName, String clusterName) { + return listWithServiceResponseAsync(resourceGroupName, clusterName).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all Kusto cluster principalAssignments. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<ClusterPrincipalAssignmentInner> object + */ + public Observable>> listWithServiceResponseAsync(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.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); + 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/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/implementation/ClustersImpl.java b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/implementation/ClustersImpl.java new file mode 100644 index 0000000000000..356232ace4f76 --- /dev/null +++ b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/implementation/ClustersImpl.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. + * def + */ + +package com.microsoft.azure.management.kusto.v2020_06_14.implementation; + +import com.microsoft.azure.arm.resources.collection.implementation.GroupableResourcesCoreImpl; +import com.microsoft.azure.management.kusto.v2020_06_14.Clusters; +import com.microsoft.azure.management.kusto.v2020_06_14.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 java.util.List; +import com.microsoft.azure.management.kusto.v2020_06_14.FollowerDatabaseDefinition; +import com.microsoft.azure.management.kusto.v2020_06_14.DiagnoseVirtualNetworkResult; +import com.microsoft.azure.management.kusto.v2020_06_14.LanguageExtension; +import com.microsoft.azure.management.kusto.v2020_06_14.CheckNameResult; +import com.microsoft.azure.management.kusto.v2020_06_14.AzureResourceSku; +import com.microsoft.azure.management.kusto.v2020_06_14.SkuDescription; + +class ClustersImpl extends GroupableResourcesCoreImpl implements Clusters { + protected ClustersImpl(KustoManager 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) + .flatMap(new Func1, Observable>() { + @Override + public Observable call(Page innerPage) { + return Observable.from(innerPage.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() + .flatMap(new Func1, Observable>() { + @Override + public Observable call(Page innerList) { + return Observable.from(innerList.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 stopAsync(String resourceGroupName, String clusterName) { + ClustersInner client = this.inner(); + return client.stopAsync(resourceGroupName, clusterName).toCompletable(); + } + + @Override + public Completable startAsync(String resourceGroupName, String clusterName) { + ClustersInner client = this.inner(); + return client.startAsync(resourceGroupName, clusterName).toCompletable(); + } + + @Override + public Observable listFollowerDatabasesAsync(String resourceGroupName, String clusterName) { + ClustersInner client = this.inner(); + return client.listFollowerDatabasesAsync(resourceGroupName, clusterName) + .flatMap(new Func1, Observable>() { + @Override + public Observable call(List innerList) { + return Observable.from(innerList); + } + }) + .map(new Func1() { + @Override + public FollowerDatabaseDefinition call(FollowerDatabaseDefinitionInner inner) { + return new FollowerDatabaseDefinitionImpl(inner, manager()); + } + }); + } + + @Override + public Completable detachFollowerDatabasesAsync(String resourceGroupName, String clusterName, FollowerDatabaseDefinitionInner followerDatabaseToRemove) { + ClustersInner client = this.inner(); + return client.detachFollowerDatabasesAsync(resourceGroupName, clusterName, followerDatabaseToRemove).toCompletable(); + } + + @Override + public Observable diagnoseVirtualNetworkAsync(String resourceGroupName, String clusterName) { + ClustersInner client = this.inner(); + return client.diagnoseVirtualNetworkAsync(resourceGroupName, clusterName) + .map(new Func1() { + @Override + public DiagnoseVirtualNetworkResult call(DiagnoseVirtualNetworkResultInner inner) { + return new DiagnoseVirtualNetworkResultImpl(inner, manager()); + } + }); + } + + @Override + public Observable listLanguageExtensionsAsync(String resourceGroupName, String clusterName) { + ClustersInner client = this.inner(); + return client.listLanguageExtensionsAsync(resourceGroupName, clusterName) + .flatMap(new Func1, Observable>() { + @Override + public Observable call(List innerList) { + return Observable.from(innerList); + } + }) + .map(new Func1() { + @Override + public LanguageExtension call(LanguageExtensionInner inner) { + return new LanguageExtensionImpl(inner, manager()); + } + }); + } + + @Override + public Completable addLanguageExtensionsAsync(String resourceGroupName, String clusterName) { + ClustersInner client = this.inner(); + return client.addLanguageExtensionsAsync(resourceGroupName, clusterName).toCompletable(); + } + + @Override + public Completable removeLanguageExtensionsAsync(String resourceGroupName, String clusterName) { + ClustersInner client = this.inner(); + return client.removeLanguageExtensionsAsync(resourceGroupName, clusterName).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()); + } + + private AzureResourceSkuImpl wrapAzureResourceSkuModel(AzureResourceSkuInner inner) { + return new AzureResourceSkuImpl(inner, manager()); + } + + @Override + public Observable checkNameAvailabilityAsync(String location, String name) { + ClustersInner client = this.inner(); + return client.checkNameAvailabilityAsync(location, name) + .map(new Func1() { + @Override + public CheckNameResult call(CheckNameResultInner inner) { + return new CheckNameResultImpl(inner, manager()); + } + }); + } + + @Override + public Observable listSkusByResourceAsync(String resourceGroupName, String clusterName) { + ClustersInner client = this.inner(); + return client.listSkusByResourceAsync(resourceGroupName, clusterName) + .flatMap(new Func1, Observable>() { + @Override + public Observable call(List innerList) { + return Observable.from(innerList); + } + }) + .map(new Func1() { + @Override + public AzureResourceSku call(AzureResourceSkuInner inner) { + return wrapAzureResourceSkuModel(inner); + } + }); + } + + @Override + public Observable listSkusAsync() { + ClustersInner client = this.inner(); + return client.listSkusAsync() + .flatMap(new Func1, Observable>() { + @Override + public Observable call(List innerList) { + return Observable.from(innerList); + } + }) + .map(new Func1() { + @Override + public SkuDescription call(SkuDescriptionInner inner) { + return new SkuDescriptionImpl(inner, manager()); + } + }); + } + +} diff --git a/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/implementation/ClustersInner.java b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/implementation/ClustersInner.java new file mode 100644 index 0000000000000..879aa11f51ce1 --- /dev/null +++ b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/implementation/ClustersInner.java @@ -0,0 +1,2647 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.kusto.v2020_06_14.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.kusto.v2020_06_14.ClusterCheckNameRequest; +import com.microsoft.azure.management.kusto.v2020_06_14.ClusterUpdate; +import com.microsoft.azure.management.kusto.v2020_06_14.LanguageExtensionsList; +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; +import com.microsoft.azure.LongRunningFinalState; +import com.microsoft.azure.LongRunningOperationOptions; + +/** + * 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 KustoManagementClientImpl 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, KustoManagementClientImpl 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.kusto.v2020_06_14.Clusters getByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}") + Observable> getByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.kusto.v2020_06_14.Clusters createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}") + Observable> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("subscriptionId") String subscriptionId, @Body ClusterInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.kusto.v2020_06_14.Clusters beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}") + Observable> beginCreateOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("subscriptionId") String subscriptionId, @Body ClusterInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.kusto.v2020_06_14.Clusters update" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}") + Observable> update(@Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("subscriptionId") String subscriptionId, @Body ClusterUpdate parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.kusto.v2020_06_14.Clusters beginUpdate" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}") + Observable> beginUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("subscriptionId") String subscriptionId, @Body ClusterUpdate parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.kusto.v2020_06_14.Clusters delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.kusto.v2020_06_14.Clusters beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.kusto.v2020_06_14.Clusters stop" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/stop") + Observable> stop(@Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.kusto.v2020_06_14.Clusters beginStop" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/stop") + Observable> beginStop(@Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.kusto.v2020_06_14.Clusters start" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/start") + Observable> start(@Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.kusto.v2020_06_14.Clusters beginStart" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/start") + Observable> beginStart(@Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.kusto.v2020_06_14.Clusters listFollowerDatabases" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/listFollowerDatabases") + Observable> listFollowerDatabases(@Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.kusto.v2020_06_14.Clusters detachFollowerDatabases" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/detachFollowerDatabases") + Observable> detachFollowerDatabases(@Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Body FollowerDatabaseDefinitionInner followerDatabaseToRemove, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.kusto.v2020_06_14.Clusters beginDetachFollowerDatabases" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/detachFollowerDatabases") + Observable> beginDetachFollowerDatabases(@Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Body FollowerDatabaseDefinitionInner followerDatabaseToRemove, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.kusto.v2020_06_14.Clusters diagnoseVirtualNetwork" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/diagnoseVirtualNetwork") + Observable> diagnoseVirtualNetwork(@Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.kusto.v2020_06_14.Clusters beginDiagnoseVirtualNetwork" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/diagnoseVirtualNetwork") + Observable> beginDiagnoseVirtualNetwork(@Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.kusto.v2020_06_14.Clusters listByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters") + 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.kusto.v2020_06_14.Clusters list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.Kusto/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.kusto.v2020_06_14.Clusters listSkus" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.Kusto/skus") + Observable> listSkus(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.kusto.v2020_06_14.Clusters checkNameAvailability" }) + @POST("subscriptions/{subscriptionId}/providers/Microsoft.Kusto/locations/{location}/checkNameAvailability") + Observable> checkNameAvailability(@Path("subscriptionId") String subscriptionId, @Path("location") String location, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body ClusterCheckNameRequest clusterName, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.kusto.v2020_06_14.Clusters listSkusByResource" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/skus") + Observable> listSkusByResource(@Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.kusto.v2020_06_14.Clusters listLanguageExtensions" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/listLanguageExtensions") + Observable> listLanguageExtensions(@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.kusto.v2020_06_14.Clusters addLanguageExtensions" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/addLanguageExtensions") + Observable> addLanguageExtensions(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body LanguageExtensionsList languageExtensionsToAdd, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.kusto.v2020_06_14.Clusters beginAddLanguageExtensions" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/addLanguageExtensions") + Observable> beginAddLanguageExtensions(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body LanguageExtensionsList languageExtensionsToAdd, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.kusto.v2020_06_14.Clusters removeLanguageExtensions" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/removeLanguageExtensions") + Observable> removeLanguageExtensions(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body LanguageExtensionsList languageExtensionsToRemove, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.kusto.v2020_06_14.Clusters beginRemoveLanguageExtensions" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/removeLanguageExtensions") + Observable> beginRemoveLanguageExtensions(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body LanguageExtensionsList languageExtensionsToRemove, @Header("User-Agent") String userAgent); + + } + + /** + * Gets a Kusto cluster. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException 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 a Kusto cluster. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto 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 a Kusto cluster. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto 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 a Kusto cluster. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ClusterInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String clusterName) { + 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.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, clusterName, 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); + } + + /** + * Create or update a Kusto cluster. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param parameters The Kusto cluster parameters supplied to the CreateOrUpdate operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException 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 createOrUpdate(String resourceGroupName, String clusterName, ClusterInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, clusterName, parameters).toBlocking().last().body(); + } + + /** + * Create or update a Kusto cluster. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param parameters The Kusto cluster parameters supplied to the CreateOrUpdate 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 clusterName, ClusterInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, clusterName, parameters), serviceCallback); + } + + /** + * Create or update a Kusto cluster. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param parameters The Kusto cluster parameters supplied to the CreateOrUpdate operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String clusterName, ClusterInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, clusterName, parameters).map(new Func1, ClusterInner>() { + @Override + public ClusterInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create or update a Kusto cluster. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param parameters The Kusto cluster parameters supplied to the CreateOrUpdate operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String clusterName, ClusterInner parameters) { + 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.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.createOrUpdate(resourceGroupName, clusterName, this.client.subscriptionId(), parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Create or update a Kusto cluster. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param parameters The Kusto cluster parameters supplied to the CreateOrUpdate operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException 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 beginCreateOrUpdate(String resourceGroupName, String clusterName, ClusterInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, clusterName, parameters).toBlocking().single().body(); + } + + /** + * Create or update a Kusto cluster. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param parameters The Kusto cluster parameters supplied to the CreateOrUpdate 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 clusterName, ClusterInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, clusterName, parameters), serviceCallback); + } + + /** + * Create or update a Kusto cluster. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param parameters The Kusto cluster parameters supplied to the CreateOrUpdate operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ClusterInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String clusterName, ClusterInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, clusterName, parameters).map(new Func1, ClusterInner>() { + @Override + public ClusterInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create or update a Kusto cluster. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param parameters The Kusto cluster parameters supplied to the CreateOrUpdate operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ClusterInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String clusterName, ClusterInner parameters) { + 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.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.beginCreateOrUpdate(resourceGroupName, clusterName, 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 = 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 a Kusto cluster. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param parameters The Kusto cluster parameters supplied to the 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 ClusterInner object if successful. + */ + public ClusterInner update(String resourceGroupName, String clusterName, ClusterUpdate parameters) { + return updateWithServiceResponseAsync(resourceGroupName, clusterName, parameters).toBlocking().last().body(); + } + + /** + * Update a Kusto cluster. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param parameters The Kusto cluster parameters supplied to the 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 updateAsync(String resourceGroupName, String clusterName, ClusterUpdate parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, clusterName, parameters), serviceCallback); + } + + /** + * Update a Kusto cluster. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param parameters The Kusto cluster parameters supplied to the Update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateAsync(String resourceGroupName, String clusterName, ClusterUpdate parameters) { + return updateWithServiceResponseAsync(resourceGroupName, clusterName, parameters).map(new Func1, ClusterInner>() { + @Override + public ClusterInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Update a Kusto cluster. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param parameters The Kusto cluster parameters supplied to the Update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String clusterName, ClusterUpdate parameters) { + 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.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, clusterName, this.client.subscriptionId(), parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Update a Kusto cluster. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param parameters The Kusto cluster parameters supplied to the 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 ClusterInner object if successful. + */ + public ClusterInner beginUpdate(String resourceGroupName, String clusterName, ClusterUpdate parameters) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, clusterName, parameters).toBlocking().single().body(); + } + + /** + * Update a Kusto cluster. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param parameters The Kusto cluster parameters supplied to the 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 beginUpdateAsync(String resourceGroupName, String clusterName, ClusterUpdate parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateWithServiceResponseAsync(resourceGroupName, clusterName, parameters), serviceCallback); + } + + /** + * Update a Kusto cluster. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param parameters The Kusto cluster parameters supplied to the Update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ClusterInner object + */ + public Observable beginUpdateAsync(String resourceGroupName, String clusterName, ClusterUpdate parameters) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, clusterName, parameters).map(new Func1, ClusterInner>() { + @Override + public ClusterInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Update a Kusto cluster. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param parameters The Kusto cluster parameters supplied to the Update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ClusterInner object + */ + public Observable> beginUpdateWithServiceResponseAsync(String resourceGroupName, String clusterName, ClusterUpdate parameters) { + 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.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, clusterName, 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()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Deletes a Kusto cluster. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @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 clusterName) { + deleteWithServiceResponseAsync(resourceGroupName, clusterName).toBlocking().last().body(); + } + + /** + * Deletes a Kusto cluster. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto 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 a Kusto cluster. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto 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 a Kusto cluster. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String clusterName) { + 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.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, clusterName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Deletes a Kusto cluster. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @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 clusterName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, clusterName).toBlocking().single().body(); + } + + /** + * Deletes a Kusto cluster. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto 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 a Kusto cluster. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto 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 a Kusto cluster. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String clusterName) { + 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.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, clusterName, 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); + } + + /** + * Stops a Kusto cluster. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @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 clusterName) { + stopWithServiceResponseAsync(resourceGroupName, clusterName).toBlocking().last().body(); + } + + /** + * Stops a Kusto cluster. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto 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 stopAsync(String resourceGroupName, String clusterName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(stopWithServiceResponseAsync(resourceGroupName, clusterName), serviceCallback); + } + + /** + * Stops a Kusto cluster. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable stopAsync(String resourceGroupName, String clusterName) { + return stopWithServiceResponseAsync(resourceGroupName, clusterName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Stops a Kusto cluster. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> stopWithServiceResponseAsync(String resourceGroupName, String clusterName) { + 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.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.stop(resourceGroupName, clusterName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Stops a Kusto cluster. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @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 clusterName) { + beginStopWithServiceResponseAsync(resourceGroupName, clusterName).toBlocking().single().body(); + } + + /** + * Stops a Kusto cluster. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto 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 beginStopAsync(String resourceGroupName, String clusterName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginStopWithServiceResponseAsync(resourceGroupName, clusterName), serviceCallback); + } + + /** + * Stops a Kusto cluster. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginStopAsync(String resourceGroupName, String clusterName) { + return beginStopWithServiceResponseAsync(resourceGroupName, clusterName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Stops a Kusto cluster. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginStopWithServiceResponseAsync(String resourceGroupName, String clusterName) { + 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.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.beginStop(resourceGroupName, clusterName, 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 = 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); + } + + /** + * Starts a Kusto cluster. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @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 clusterName) { + startWithServiceResponseAsync(resourceGroupName, clusterName).toBlocking().last().body(); + } + + /** + * Starts a Kusto cluster. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto 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 startAsync(String resourceGroupName, String clusterName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(startWithServiceResponseAsync(resourceGroupName, clusterName), serviceCallback); + } + + /** + * Starts a Kusto cluster. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable startAsync(String resourceGroupName, String clusterName) { + return startWithServiceResponseAsync(resourceGroupName, clusterName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Starts a Kusto cluster. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> startWithServiceResponseAsync(String resourceGroupName, String clusterName) { + 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.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.start(resourceGroupName, clusterName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Starts a Kusto cluster. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @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 clusterName) { + beginStartWithServiceResponseAsync(resourceGroupName, clusterName).toBlocking().single().body(); + } + + /** + * Starts a Kusto cluster. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto 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 beginStartAsync(String resourceGroupName, String clusterName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginStartWithServiceResponseAsync(resourceGroupName, clusterName), serviceCallback); + } + + /** + * Starts a Kusto cluster. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginStartAsync(String resourceGroupName, String clusterName) { + return beginStartWithServiceResponseAsync(resourceGroupName, clusterName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Starts a Kusto cluster. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginStartWithServiceResponseAsync(String resourceGroupName, String clusterName) { + 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.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.beginStart(resourceGroupName, clusterName, 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 = 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); + } + + /** + * Returns a list of databases that are owned by this cluster and were followed by another cluster. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException 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<FollowerDatabaseDefinitionInner> object if successful. + */ + public List listFollowerDatabases(String resourceGroupName, String clusterName) { + return listFollowerDatabasesWithServiceResponseAsync(resourceGroupName, clusterName).toBlocking().single().body(); + } + + /** + * Returns a list of databases that are owned by this cluster and were followed by another cluster. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto 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> listFollowerDatabasesAsync(String resourceGroupName, String clusterName, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listFollowerDatabasesWithServiceResponseAsync(resourceGroupName, clusterName), serviceCallback); + } + + /** + * Returns a list of databases that are owned by this cluster and were followed by another cluster. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<FollowerDatabaseDefinitionInner> object + */ + public Observable> listFollowerDatabasesAsync(String resourceGroupName, String clusterName) { + return listFollowerDatabasesWithServiceResponseAsync(resourceGroupName, clusterName).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Returns a list of databases that are owned by this cluster and were followed by another cluster. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<FollowerDatabaseDefinitionInner> object + */ + public Observable>> listFollowerDatabasesWithServiceResponseAsync(String resourceGroupName, String clusterName) { + 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.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.listFollowerDatabases(resourceGroupName, clusterName, 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 = listFollowerDatabasesDelegate(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> listFollowerDatabasesDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Detaches all followers of a database owned by this cluster. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param followerDatabaseToRemove The follower databases properties 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 detachFollowerDatabases(String resourceGroupName, String clusterName, FollowerDatabaseDefinitionInner followerDatabaseToRemove) { + detachFollowerDatabasesWithServiceResponseAsync(resourceGroupName, clusterName, followerDatabaseToRemove).toBlocking().last().body(); + } + + /** + * Detaches all followers of a database owned by this cluster. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param followerDatabaseToRemove The follower databases properties 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 detachFollowerDatabasesAsync(String resourceGroupName, String clusterName, FollowerDatabaseDefinitionInner followerDatabaseToRemove, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(detachFollowerDatabasesWithServiceResponseAsync(resourceGroupName, clusterName, followerDatabaseToRemove), serviceCallback); + } + + /** + * Detaches all followers of a database owned by this cluster. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param followerDatabaseToRemove The follower databases properties to remove. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable detachFollowerDatabasesAsync(String resourceGroupName, String clusterName, FollowerDatabaseDefinitionInner followerDatabaseToRemove) { + return detachFollowerDatabasesWithServiceResponseAsync(resourceGroupName, clusterName, followerDatabaseToRemove).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Detaches all followers of a database owned by this cluster. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param followerDatabaseToRemove The follower databases properties to remove. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> detachFollowerDatabasesWithServiceResponseAsync(String resourceGroupName, String clusterName, FollowerDatabaseDefinitionInner followerDatabaseToRemove) { + 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.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 (followerDatabaseToRemove == null) { + throw new IllegalArgumentException("Parameter followerDatabaseToRemove is required and cannot be null."); + } + Validator.validate(followerDatabaseToRemove); + Observable> observable = service.detachFollowerDatabases(resourceGroupName, clusterName, this.client.subscriptionId(), this.client.apiVersion(), followerDatabaseToRemove, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Detaches all followers of a database owned by this cluster. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param followerDatabaseToRemove The follower databases properties 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 beginDetachFollowerDatabases(String resourceGroupName, String clusterName, FollowerDatabaseDefinitionInner followerDatabaseToRemove) { + beginDetachFollowerDatabasesWithServiceResponseAsync(resourceGroupName, clusterName, followerDatabaseToRemove).toBlocking().single().body(); + } + + /** + * Detaches all followers of a database owned by this cluster. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param followerDatabaseToRemove The follower databases properties 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 beginDetachFollowerDatabasesAsync(String resourceGroupName, String clusterName, FollowerDatabaseDefinitionInner followerDatabaseToRemove, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDetachFollowerDatabasesWithServiceResponseAsync(resourceGroupName, clusterName, followerDatabaseToRemove), serviceCallback); + } + + /** + * Detaches all followers of a database owned by this cluster. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param followerDatabaseToRemove The follower databases properties to remove. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDetachFollowerDatabasesAsync(String resourceGroupName, String clusterName, FollowerDatabaseDefinitionInner followerDatabaseToRemove) { + return beginDetachFollowerDatabasesWithServiceResponseAsync(resourceGroupName, clusterName, followerDatabaseToRemove).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Detaches all followers of a database owned by this cluster. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param followerDatabaseToRemove The follower databases properties to remove. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDetachFollowerDatabasesWithServiceResponseAsync(String resourceGroupName, String clusterName, FollowerDatabaseDefinitionInner followerDatabaseToRemove) { + 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.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 (followerDatabaseToRemove == null) { + throw new IllegalArgumentException("Parameter followerDatabaseToRemove is required and cannot be null."); + } + Validator.validate(followerDatabaseToRemove); + return service.beginDetachFollowerDatabases(resourceGroupName, clusterName, this.client.subscriptionId(), this.client.apiVersion(), followerDatabaseToRemove, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDetachFollowerDatabasesDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDetachFollowerDatabasesDelegate(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); + } + + /** + * Diagnoses network connectivity status for external resources on which the service is dependent on. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DiagnoseVirtualNetworkResultInner object if successful. + */ + public DiagnoseVirtualNetworkResultInner diagnoseVirtualNetwork(String resourceGroupName, String clusterName) { + return diagnoseVirtualNetworkWithServiceResponseAsync(resourceGroupName, clusterName).toBlocking().last().body(); + } + + /** + * Diagnoses network connectivity status for external resources on which the service is dependent on. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto 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 diagnoseVirtualNetworkAsync(String resourceGroupName, String clusterName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(diagnoseVirtualNetworkWithServiceResponseAsync(resourceGroupName, clusterName), serviceCallback); + } + + /** + * Diagnoses network connectivity status for external resources on which the service is dependent on. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable diagnoseVirtualNetworkAsync(String resourceGroupName, String clusterName) { + return diagnoseVirtualNetworkWithServiceResponseAsync(resourceGroupName, clusterName).map(new Func1, DiagnoseVirtualNetworkResultInner>() { + @Override + public DiagnoseVirtualNetworkResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Diagnoses network connectivity status for external resources on which the service is dependent on. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> diagnoseVirtualNetworkWithServiceResponseAsync(String resourceGroupName, String clusterName) { + 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.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.diagnoseVirtualNetwork(resourceGroupName, clusterName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new LongRunningOperationOptions().withFinalStateVia(LongRunningFinalState.LOCATION), new TypeToken() { }.getType()); + } + + /** + * Diagnoses network connectivity status for external resources on which the service is dependent on. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DiagnoseVirtualNetworkResultInner object if successful. + */ + public DiagnoseVirtualNetworkResultInner beginDiagnoseVirtualNetwork(String resourceGroupName, String clusterName) { + return beginDiagnoseVirtualNetworkWithServiceResponseAsync(resourceGroupName, clusterName).toBlocking().single().body(); + } + + /** + * Diagnoses network connectivity status for external resources on which the service is dependent on. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto 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 beginDiagnoseVirtualNetworkAsync(String resourceGroupName, String clusterName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDiagnoseVirtualNetworkWithServiceResponseAsync(resourceGroupName, clusterName), serviceCallback); + } + + /** + * Diagnoses network connectivity status for external resources on which the service is dependent on. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DiagnoseVirtualNetworkResultInner object + */ + public Observable beginDiagnoseVirtualNetworkAsync(String resourceGroupName, String clusterName) { + return beginDiagnoseVirtualNetworkWithServiceResponseAsync(resourceGroupName, clusterName).map(new Func1, DiagnoseVirtualNetworkResultInner>() { + @Override + public DiagnoseVirtualNetworkResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Diagnoses network connectivity status for external resources on which the service is dependent on. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DiagnoseVirtualNetworkResultInner object + */ + public Observable> beginDiagnoseVirtualNetworkWithServiceResponseAsync(String resourceGroupName, String clusterName) { + 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.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.beginDiagnoseVirtualNetwork(resourceGroupName, clusterName, 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 = beginDiagnoseVirtualNetworkDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDiagnoseVirtualNetworkDelegate(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 Kusto clusters within a resource group. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @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 Kusto clusters within a resource group. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @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 Kusto clusters within a resource group. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @return the observable to the List<ClusterInner> 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 Kusto clusters within a resource group. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @return the observable to the List<ClusterInner> 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 all Kusto clusters within 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 List<ClusterInner> 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 Kusto clusters within 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 ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listWithServiceResponseAsync(), serviceCallback); + } + + /** + * Lists all Kusto clusters within a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<ClusterInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync().map(new Func1>, Page>() { + public Page call(ServiceResponse> response) { + PageImpl page = new PageImpl<>(); + page.setItems(response.body()); + return page; + } + }); + } + + /** + * Lists all Kusto clusters within a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<ClusterInner> 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 eligible SKUs for Kusto 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 List<SkuDescriptionInner> object if successful. + */ + public List listSkus() { + return listSkusWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Lists eligible SKUs for Kusto 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> listSkusAsync(final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listSkusWithServiceResponseAsync(), serviceCallback); + } + + /** + * Lists eligible SKUs for Kusto resource provider. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<SkuDescriptionInner> object + */ + public Observable> listSkusAsync() { + return listSkusWithServiceResponseAsync().map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists eligible SKUs for Kusto resource provider. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<SkuDescriptionInner> object + */ + public Observable>> listSkusWithServiceResponseAsync() { + 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.listSkus(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 = listSkusDelegate(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> listSkusDelegate(Response response) 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 that the cluster name is valid and is not already in use. + * + * @param location Azure location. + * @param name Cluster 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 CheckNameResultInner object if successful. + */ + public CheckNameResultInner checkNameAvailability(String location, String name) { + return checkNameAvailabilityWithServiceResponseAsync(location, name).toBlocking().single().body(); + } + + /** + * Checks that the cluster name is valid and is not already in use. + * + * @param location Azure location. + * @param name Cluster 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 location, String name, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(checkNameAvailabilityWithServiceResponseAsync(location, name), serviceCallback); + } + + /** + * Checks that the cluster name is valid and is not already in use. + * + * @param location Azure location. + * @param name Cluster name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CheckNameResultInner object + */ + public Observable checkNameAvailabilityAsync(String location, String name) { + return checkNameAvailabilityWithServiceResponseAsync(location, name).map(new Func1, CheckNameResultInner>() { + @Override + public CheckNameResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Checks that the cluster name is valid and is not already in use. + * + * @param location Azure location. + * @param name Cluster name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CheckNameResultInner object + */ + public Observable> checkNameAvailabilityWithServiceResponseAsync(String location, String name) { + 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 (name == null) { + throw new IllegalArgumentException("Parameter name is required and cannot be null."); + } + ClusterCheckNameRequest clusterName = new ClusterCheckNameRequest(); + clusterName.withName(name); + return service.checkNameAvailability(this.client.subscriptionId(), location, this.client.apiVersion(), this.client.acceptLanguage(), clusterName, 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); + } + + /** + * Returns the SKUs available for the provided resource. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException 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<AzureResourceSkuInner> object if successful. + */ + public List listSkusByResource(String resourceGroupName, String clusterName) { + return listSkusByResourceWithServiceResponseAsync(resourceGroupName, clusterName).toBlocking().single().body(); + } + + /** + * Returns the SKUs available for the provided resource. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto 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> listSkusByResourceAsync(String resourceGroupName, String clusterName, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listSkusByResourceWithServiceResponseAsync(resourceGroupName, clusterName), serviceCallback); + } + + /** + * Returns the SKUs available for the provided resource. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<AzureResourceSkuInner> object + */ + public Observable> listSkusByResourceAsync(String resourceGroupName, String clusterName) { + return listSkusByResourceWithServiceResponseAsync(resourceGroupName, clusterName).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Returns the SKUs available for the provided resource. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<AzureResourceSkuInner> object + */ + public Observable>> listSkusByResourceWithServiceResponseAsync(String resourceGroupName, String clusterName) { + 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.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.listSkusByResource(resourceGroupName, clusterName, 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 = listSkusByResourceDelegate(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> listSkusByResourceDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Returns a list of language extensions that can run within KQL queries. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException 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<LanguageExtensionInner> object if successful. + */ + public List listLanguageExtensions(String resourceGroupName, String clusterName) { + return listLanguageExtensionsWithServiceResponseAsync(resourceGroupName, clusterName).toBlocking().single().body(); + } + + /** + * Returns a list of language extensions that can run within KQL queries. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto 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> listLanguageExtensionsAsync(String resourceGroupName, String clusterName, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listLanguageExtensionsWithServiceResponseAsync(resourceGroupName, clusterName), serviceCallback); + } + + /** + * Returns a list of language extensions that can run within KQL queries. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<LanguageExtensionInner> object + */ + public Observable> listLanguageExtensionsAsync(String resourceGroupName, String clusterName) { + return listLanguageExtensionsWithServiceResponseAsync(resourceGroupName, clusterName).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Returns a list of language extensions that can run within KQL queries. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<LanguageExtensionInner> object + */ + public Observable>> listLanguageExtensionsWithServiceResponseAsync(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.listLanguageExtensions(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 = listLanguageExtensionsDelegate(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> listLanguageExtensionsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Add a list of language extensions that can run within KQL queries. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @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 addLanguageExtensions(String resourceGroupName, String clusterName) { + addLanguageExtensionsWithServiceResponseAsync(resourceGroupName, clusterName).toBlocking().last().body(); + } + + /** + * Add a list of language extensions that can run within KQL queries. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto 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 addLanguageExtensionsAsync(String resourceGroupName, String clusterName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(addLanguageExtensionsWithServiceResponseAsync(resourceGroupName, clusterName), serviceCallback); + } + + /** + * Add a list of language extensions that can run within KQL queries. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable addLanguageExtensionsAsync(String resourceGroupName, String clusterName) { + return addLanguageExtensionsWithServiceResponseAsync(resourceGroupName, clusterName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Add a list of language extensions that can run within KQL queries. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> addLanguageExtensionsWithServiceResponseAsync(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 valueConverted = null; + LanguageExtensionsList languageExtensionsToAdd = new LanguageExtensionsList(); + languageExtensionsToAdd.withValue(null); + Observable> observable = service.addLanguageExtensions(this.client.subscriptionId(), resourceGroupName, clusterName, this.client.apiVersion(), this.client.acceptLanguage(), languageExtensionsToAdd, this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + /** + * Add a list of language extensions that can run within KQL queries. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param value The list of language extensions. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @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 addLanguageExtensions(String resourceGroupName, String clusterName, List value) { + addLanguageExtensionsWithServiceResponseAsync(resourceGroupName, clusterName, value).toBlocking().last().body(); + } + + /** + * Add a list of language extensions that can run within KQL queries. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param value The list of language extensions. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture addLanguageExtensionsAsync(String resourceGroupName, String clusterName, List value, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(addLanguageExtensionsWithServiceResponseAsync(resourceGroupName, clusterName, value), serviceCallback); + } + + /** + * Add a list of language extensions that can run within KQL queries. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param value The list of language extensions. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable addLanguageExtensionsAsync(String resourceGroupName, String clusterName, List value) { + return addLanguageExtensionsWithServiceResponseAsync(resourceGroupName, clusterName, value).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Add a list of language extensions that can run within KQL queries. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param value The list of language extensions. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> addLanguageExtensionsWithServiceResponseAsync(String resourceGroupName, String clusterName, List value) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter 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(value); + LanguageExtensionsList languageExtensionsToAdd = new LanguageExtensionsList(); + languageExtensionsToAdd.withValue(value); + Observable> observable = service.addLanguageExtensions(this.client.subscriptionId(), resourceGroupName, clusterName, this.client.apiVersion(), this.client.acceptLanguage(), languageExtensionsToAdd, this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Add a list of language extensions that can run within KQL queries. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @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 beginAddLanguageExtensions(String resourceGroupName, String clusterName) { + beginAddLanguageExtensionsWithServiceResponseAsync(resourceGroupName, clusterName).toBlocking().single().body(); + } + + /** + * Add a list of language extensions that can run within KQL queries. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto 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 beginAddLanguageExtensionsAsync(String resourceGroupName, String clusterName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginAddLanguageExtensionsWithServiceResponseAsync(resourceGroupName, clusterName), serviceCallback); + } + + /** + * Add a list of language extensions that can run within KQL queries. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginAddLanguageExtensionsAsync(String resourceGroupName, String clusterName) { + return beginAddLanguageExtensionsWithServiceResponseAsync(resourceGroupName, clusterName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Add a list of language extensions that can run within KQL queries. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginAddLanguageExtensionsWithServiceResponseAsync(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 List value = null; + LanguageExtensionsList languageExtensionsToAdd = new LanguageExtensionsList(); + languageExtensionsToAdd.withValue(null); + return service.beginAddLanguageExtensions(this.client.subscriptionId(), resourceGroupName, clusterName, this.client.apiVersion(), this.client.acceptLanguage(), languageExtensionsToAdd, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginAddLanguageExtensionsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Add a list of language extensions that can run within KQL queries. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param value The list of language extensions. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @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 beginAddLanguageExtensions(String resourceGroupName, String clusterName, List value) { + beginAddLanguageExtensionsWithServiceResponseAsync(resourceGroupName, clusterName, value).toBlocking().single().body(); + } + + /** + * Add a list of language extensions that can run within KQL queries. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param value The list of language extensions. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginAddLanguageExtensionsAsync(String resourceGroupName, String clusterName, List value, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginAddLanguageExtensionsWithServiceResponseAsync(resourceGroupName, clusterName, value), serviceCallback); + } + + /** + * Add a list of language extensions that can run within KQL queries. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param value The list of language extensions. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginAddLanguageExtensionsAsync(String resourceGroupName, String clusterName, List value) { + return beginAddLanguageExtensionsWithServiceResponseAsync(resourceGroupName, clusterName, value).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Add a list of language extensions that can run within KQL queries. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param value The list of language extensions. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginAddLanguageExtensionsWithServiceResponseAsync(String resourceGroupName, String clusterName, List value) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter 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(value); + LanguageExtensionsList languageExtensionsToAdd = new LanguageExtensionsList(); + languageExtensionsToAdd.withValue(value); + return service.beginAddLanguageExtensions(this.client.subscriptionId(), resourceGroupName, clusterName, this.client.apiVersion(), this.client.acceptLanguage(), languageExtensionsToAdd, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginAddLanguageExtensionsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginAddLanguageExtensionsDelegate(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); + } + + /** + * Remove a list of language extensions that can run within KQL queries. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @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 removeLanguageExtensions(String resourceGroupName, String clusterName) { + removeLanguageExtensionsWithServiceResponseAsync(resourceGroupName, clusterName).toBlocking().last().body(); + } + + /** + * Remove a list of language extensions that can run within KQL queries. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto 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 removeLanguageExtensionsAsync(String resourceGroupName, String clusterName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(removeLanguageExtensionsWithServiceResponseAsync(resourceGroupName, clusterName), serviceCallback); + } + + /** + * Remove a list of language extensions that can run within KQL queries. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable removeLanguageExtensionsAsync(String resourceGroupName, String clusterName) { + return removeLanguageExtensionsWithServiceResponseAsync(resourceGroupName, clusterName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Remove a list of language extensions that can run within KQL queries. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> removeLanguageExtensionsWithServiceResponseAsync(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 valueConverted = null; + LanguageExtensionsList languageExtensionsToRemove = new LanguageExtensionsList(); + languageExtensionsToRemove.withValue(null); + Observable> observable = service.removeLanguageExtensions(this.client.subscriptionId(), resourceGroupName, clusterName, this.client.apiVersion(), this.client.acceptLanguage(), languageExtensionsToRemove, this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + /** + * Remove a list of language extensions that can run within KQL queries. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param value The list of language extensions. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @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 removeLanguageExtensions(String resourceGroupName, String clusterName, List value) { + removeLanguageExtensionsWithServiceResponseAsync(resourceGroupName, clusterName, value).toBlocking().last().body(); + } + + /** + * Remove a list of language extensions that can run within KQL queries. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param value The list of language extensions. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture removeLanguageExtensionsAsync(String resourceGroupName, String clusterName, List value, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(removeLanguageExtensionsWithServiceResponseAsync(resourceGroupName, clusterName, value), serviceCallback); + } + + /** + * Remove a list of language extensions that can run within KQL queries. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param value The list of language extensions. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable removeLanguageExtensionsAsync(String resourceGroupName, String clusterName, List value) { + return removeLanguageExtensionsWithServiceResponseAsync(resourceGroupName, clusterName, value).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Remove a list of language extensions that can run within KQL queries. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param value The list of language extensions. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> removeLanguageExtensionsWithServiceResponseAsync(String resourceGroupName, String clusterName, List value) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter 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(value); + LanguageExtensionsList languageExtensionsToRemove = new LanguageExtensionsList(); + languageExtensionsToRemove.withValue(value); + Observable> observable = service.removeLanguageExtensions(this.client.subscriptionId(), resourceGroupName, clusterName, this.client.apiVersion(), this.client.acceptLanguage(), languageExtensionsToRemove, this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Remove a list of language extensions that can run within KQL queries. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @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 beginRemoveLanguageExtensions(String resourceGroupName, String clusterName) { + beginRemoveLanguageExtensionsWithServiceResponseAsync(resourceGroupName, clusterName).toBlocking().single().body(); + } + + /** + * Remove a list of language extensions that can run within KQL queries. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto 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 beginRemoveLanguageExtensionsAsync(String resourceGroupName, String clusterName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginRemoveLanguageExtensionsWithServiceResponseAsync(resourceGroupName, clusterName), serviceCallback); + } + + /** + * Remove a list of language extensions that can run within KQL queries. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginRemoveLanguageExtensionsAsync(String resourceGroupName, String clusterName) { + return beginRemoveLanguageExtensionsWithServiceResponseAsync(resourceGroupName, clusterName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Remove a list of language extensions that can run within KQL queries. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginRemoveLanguageExtensionsWithServiceResponseAsync(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 List value = null; + LanguageExtensionsList languageExtensionsToRemove = new LanguageExtensionsList(); + languageExtensionsToRemove.withValue(null); + return service.beginRemoveLanguageExtensions(this.client.subscriptionId(), resourceGroupName, clusterName, this.client.apiVersion(), this.client.acceptLanguage(), languageExtensionsToRemove, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginRemoveLanguageExtensionsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Remove a list of language extensions that can run within KQL queries. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param value The list of language extensions. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @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 beginRemoveLanguageExtensions(String resourceGroupName, String clusterName, List value) { + beginRemoveLanguageExtensionsWithServiceResponseAsync(resourceGroupName, clusterName, value).toBlocking().single().body(); + } + + /** + * Remove a list of language extensions that can run within KQL queries. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param value The list of language extensions. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginRemoveLanguageExtensionsAsync(String resourceGroupName, String clusterName, List value, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginRemoveLanguageExtensionsWithServiceResponseAsync(resourceGroupName, clusterName, value), serviceCallback); + } + + /** + * Remove a list of language extensions that can run within KQL queries. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param value The list of language extensions. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginRemoveLanguageExtensionsAsync(String resourceGroupName, String clusterName, List value) { + return beginRemoveLanguageExtensionsWithServiceResponseAsync(resourceGroupName, clusterName, value).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Remove a list of language extensions that can run within KQL queries. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param value The list of language extensions. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginRemoveLanguageExtensionsWithServiceResponseAsync(String resourceGroupName, String clusterName, List value) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter 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(value); + LanguageExtensionsList languageExtensionsToRemove = new LanguageExtensionsList(); + languageExtensionsToRemove.withValue(value); + return service.beginRemoveLanguageExtensions(this.client.subscriptionId(), resourceGroupName, clusterName, this.client.apiVersion(), this.client.acceptLanguage(), languageExtensionsToRemove, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginRemoveLanguageExtensionsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginRemoveLanguageExtensionsDelegate(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); + } + +} diff --git a/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/implementation/DataConnectionImpl.java b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/implementation/DataConnectionImpl.java new file mode 100644 index 0000000000000..d67a1a646251e --- /dev/null +++ b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/implementation/DataConnectionImpl.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.kusto.v2020_06_14.implementation; + +import com.microsoft.azure.management.kusto.v2020_06_14.DataConnection; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; + +class DataConnectionImpl extends CreatableUpdatableImpl implements DataConnection, DataConnection.Definition, DataConnection.Update { + private final KustoManager manager; + private String resourceGroupName; + private String clusterName; + private String databaseName; + private String dataConnectionName; + + DataConnectionImpl(String name, KustoManager manager) { + super(name, new DataConnectionInner()); + this.manager = manager; + // Set resource name + this.dataConnectionName = name; + // + } + + DataConnectionImpl(DataConnectionInner inner, KustoManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.dataConnectionName = inner.name(); + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.clusterName = IdParsingUtils.getValueFromIdByName(inner.id(), "clusters"); + this.databaseName = IdParsingUtils.getValueFromIdByName(inner.id(), "databases"); + this.dataConnectionName = IdParsingUtils.getValueFromIdByName(inner.id(), "dataConnections"); + // + } + + @Override + public KustoManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + DataConnectionsInner client = this.manager().inner().dataConnections(); + return client.createOrUpdateAsync(this.resourceGroupName, this.clusterName, this.databaseName, this.dataConnectionName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + DataConnectionsInner client = this.manager().inner().dataConnections(); + return client.updateAsync(this.resourceGroupName, this.clusterName, this.databaseName, this.dataConnectionName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + DataConnectionsInner client = this.manager().inner().dataConnections(); + return client.getAsync(this.resourceGroupName, this.clusterName, this.databaseName, this.dataConnectionName); + } + + @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 String type() { + return this.inner().type(); + } + + @Override + public DataConnectionImpl withExistingDatabasis(String resourceGroupName, String clusterName, String databaseName) { + this.resourceGroupName = resourceGroupName; + this.clusterName = clusterName; + this.databaseName = databaseName; + return this; + } + + @Override + public DataConnectionImpl withLocation(String location) { + this.inner().withLocation(location); + return this; + } + +} diff --git a/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/implementation/DataConnectionInner.java b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/implementation/DataConnectionInner.java new file mode 100644 index 0000000000000..28078531be343 --- /dev/null +++ b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/implementation/DataConnectionInner.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.kusto.v2020_06_14.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.microsoft.azure.ProxyResource; +import com.microsoft.azure.management.kusto.v2020_06_14.EventGridDataConnection; +import com.microsoft.azure.management.kusto.v2020_06_14.EventHubDataConnection; +import com.microsoft.azure.management.kusto.v2020_06_14.IotHubDataConnection; + +/** + * Class representing an data connection. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind", defaultImpl = DataConnectionInner.class) +@JsonTypeName("DataConnection") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "EventHub", value = EventHubDataConnection.class), + @JsonSubTypes.Type(name = "IotHub", value = IotHubDataConnection.class), + @JsonSubTypes.Type(name = "EventGrid", value = EventGridDataConnection.class) +}) +public class DataConnectionInner extends ProxyResource { + /** + * Resource location. + */ + @JsonProperty(value = "location") + private String location; + + /** + * 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 DataConnectionInner object itself. + */ + public DataConnectionInner withLocation(String location) { + this.location = location; + return this; + } + +} diff --git a/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/implementation/DataConnectionValidationListResultImpl.java b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/implementation/DataConnectionValidationListResultImpl.java new file mode 100644 index 0000000000000..c5747c0bc890d --- /dev/null +++ b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/implementation/DataConnectionValidationListResultImpl.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.kusto.v2020_06_14.implementation; + +import com.microsoft.azure.management.kusto.v2020_06_14.DataConnectionValidationListResult; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.List; +import com.microsoft.azure.management.kusto.v2020_06_14.DataConnectionValidationResult; + +class DataConnectionValidationListResultImpl extends WrapperImpl implements DataConnectionValidationListResult { + private final KustoManager manager; + DataConnectionValidationListResultImpl(DataConnectionValidationListResultInner inner, KustoManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public KustoManager manager() { + return this.manager; + } + + @Override + public List value() { + return this.inner().value(); + } + +} diff --git a/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/implementation/DataConnectionValidationListResultInner.java b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/implementation/DataConnectionValidationListResultInner.java new file mode 100644 index 0000000000000..d524d3cb533f5 --- /dev/null +++ b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/implementation/DataConnectionValidationListResultInner.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.kusto.v2020_06_14.implementation; + +import java.util.List; +import com.microsoft.azure.management.kusto.v2020_06_14.DataConnectionValidationResult; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The list Kusto data connection validation result. + */ +public class DataConnectionValidationListResultInner { + /** + * The list of Kusto data connection validation errors. + */ + @JsonProperty(value = "value") + private List value; + + /** + * Get the list of Kusto data connection validation errors. + * + * @return the value value + */ + public List value() { + return this.value; + } + + /** + * Set the list of Kusto data connection validation errors. + * + * @param value the value value to set + * @return the DataConnectionValidationListResultInner object itself. + */ + public DataConnectionValidationListResultInner withValue(List value) { + this.value = value; + return this; + } + +} diff --git a/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/implementation/DataConnectionsImpl.java b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/implementation/DataConnectionsImpl.java new file mode 100644 index 0000000000000..ccab7b81ef3be --- /dev/null +++ b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/implementation/DataConnectionsImpl.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.kusto.v2020_06_14.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.kusto.v2020_06_14.DataConnections; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import java.util.List; +import com.microsoft.azure.management.kusto.v2020_06_14.DataConnection; +import com.microsoft.azure.management.kusto.v2020_06_14.DataConnectionValidationListResult; +import com.microsoft.azure.management.kusto.v2020_06_14.CheckNameResult; +import com.microsoft.azure.management.kusto.v2020_06_14.DataConnectionValidation; + +class DataConnectionsImpl extends WrapperImpl implements DataConnections { + private final KustoManager manager; + + DataConnectionsImpl(KustoManager manager) { + super(manager.inner().dataConnections()); + this.manager = manager; + } + + public KustoManager manager() { + return this.manager; + } + + @Override + public DataConnectionImpl define(String name) { + return wrapModel(name); + } + + private DataConnectionImpl wrapModel(DataConnectionInner inner) { + return new DataConnectionImpl(inner, manager()); + } + + private DataConnectionImpl wrapModel(String name) { + return new DataConnectionImpl(name, this.manager()); + } + + @Override + public Observable listByDatabaseAsync(String resourceGroupName, String clusterName, String databaseName) { + DataConnectionsInner client = this.inner(); + return client.listByDatabaseAsync(resourceGroupName, clusterName, databaseName) + .flatMap(new Func1, Observable>() { + @Override + public Observable call(List innerList) { + return Observable.from(innerList); + } + }) + .map(new Func1() { + @Override + public DataConnection call(DataConnectionInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String clusterName, String databaseName, String dataConnectionName) { + DataConnectionsInner client = this.inner(); + return client.getAsync(resourceGroupName, clusterName, databaseName, dataConnectionName) + .flatMap(new Func1>() { + @Override + public Observable call(DataConnectionInner inner) { + if (inner == null) { + return Observable.empty(); + } else { + return Observable.just((DataConnection)wrapModel(inner)); + } + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String clusterName, String databaseName, String dataConnectionName) { + DataConnectionsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, clusterName, databaseName, dataConnectionName).toCompletable(); + } + + @Override + public Observable dataConnectionValidationMethodAsync(String resourceGroupName, String clusterName, String databaseName, DataConnectionValidation parameters) { + DataConnectionsInner client = this.inner(); + return client.dataConnectionValidationMethodAsync(resourceGroupName, clusterName, databaseName, parameters) + .map(new Func1() { + @Override + public DataConnectionValidationListResult call(DataConnectionValidationListResultInner inner) { + return new DataConnectionValidationListResultImpl(inner, manager()); + } + }); + } + + @Override + public Observable checkNameAvailabilityAsync(String resourceGroupName, String clusterName, String databaseName, String name) { + DataConnectionsInner client = this.inner(); + return client.checkNameAvailabilityAsync(resourceGroupName, clusterName, databaseName, name) + .map(new Func1() { + @Override + public CheckNameResult call(CheckNameResultInner inner) { + return new CheckNameResultImpl(inner, manager()); + } + }); + } + +} diff --git a/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/implementation/DataConnectionsInner.java b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/implementation/DataConnectionsInner.java new file mode 100644 index 0000000000000..4b2dd6b4a3a50 --- /dev/null +++ b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/implementation/DataConnectionsInner.java @@ -0,0 +1,1182 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.kusto.v2020_06_14.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.management.kusto.v2020_06_14.DataConnectionCheckNameRequest; +import com.microsoft.azure.management.kusto.v2020_06_14.DataConnectionValidation; +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; +import com.microsoft.azure.LongRunningFinalState; +import com.microsoft.azure.LongRunningOperationOptions; + +/** + * An instance of this class provides access to all the operations defined + * in DataConnections. + */ +public class DataConnectionsInner { + /** The Retrofit service to perform REST calls. */ + private DataConnectionsService service; + /** The service client containing this operation class. */ + private KustoManagementClientImpl client; + + /** + * Initializes an instance of DataConnectionsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public DataConnectionsInner(Retrofit retrofit, KustoManagementClientImpl client) { + this.service = retrofit.create(DataConnectionsService.class); + this.client = client; + } + + /** + * The interface defining all the services for DataConnections to be + * used by Retrofit to perform actually REST calls. + */ + interface DataConnectionsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.kusto.v2020_06_14.DataConnections listByDatabase" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/dataConnections") + Observable> listByDatabase(@Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("databaseName") String databaseName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.kusto.v2020_06_14.DataConnections dataConnectionValidationMethod" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/dataConnectionValidation") + Observable> dataConnectionValidationMethod(@Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("databaseName") String databaseName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Body DataConnectionValidation 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.kusto.v2020_06_14.DataConnections beginDataConnectionValidationMethod" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/dataConnectionValidation") + Observable> beginDataConnectionValidationMethod(@Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("databaseName") String databaseName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Body DataConnectionValidation 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.kusto.v2020_06_14.DataConnections checkNameAvailability" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/checkNameAvailability") + Observable> checkNameAvailability(@Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("databaseName") String databaseName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body DataConnectionCheckNameRequest dataConnectionName, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.kusto.v2020_06_14.DataConnections get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/dataConnections/{dataConnectionName}") + Observable> get(@Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("databaseName") String databaseName, @Path("dataConnectionName") String dataConnectionName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.kusto.v2020_06_14.DataConnections createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/dataConnections/{dataConnectionName}") + Observable> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("databaseName") String databaseName, @Path("dataConnectionName") String dataConnectionName, @Path("subscriptionId") String subscriptionId, @Body DataConnectionInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.kusto.v2020_06_14.DataConnections beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/dataConnections/{dataConnectionName}") + Observable> beginCreateOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("databaseName") String databaseName, @Path("dataConnectionName") String dataConnectionName, @Path("subscriptionId") String subscriptionId, @Body DataConnectionInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.kusto.v2020_06_14.DataConnections update" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/dataConnections/{dataConnectionName}") + Observable> update(@Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("databaseName") String databaseName, @Path("dataConnectionName") String dataConnectionName, @Path("subscriptionId") String subscriptionId, @Body DataConnectionInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.kusto.v2020_06_14.DataConnections beginUpdate" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/dataConnections/{dataConnectionName}") + Observable> beginUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("databaseName") String databaseName, @Path("dataConnectionName") String dataConnectionName, @Path("subscriptionId") String subscriptionId, @Body DataConnectionInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.kusto.v2020_06_14.DataConnections delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/dataConnections/{dataConnectionName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("databaseName") String databaseName, @Path("dataConnectionName") String dataConnectionName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.kusto.v2020_06_14.DataConnections beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/dataConnections/{dataConnectionName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("databaseName") String databaseName, @Path("dataConnectionName") String dataConnectionName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Returns the list of data connections of the given Kusto database. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException 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<DataConnectionInner> object if successful. + */ + public List listByDatabase(String resourceGroupName, String clusterName, String databaseName) { + return listByDatabaseWithServiceResponseAsync(resourceGroupName, clusterName, databaseName).toBlocking().single().body(); + } + + /** + * Returns the list of data connections of the given Kusto database. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto 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> listByDatabaseAsync(String resourceGroupName, String clusterName, String databaseName, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listByDatabaseWithServiceResponseAsync(resourceGroupName, clusterName, databaseName), serviceCallback); + } + + /** + * Returns the list of data connections of the given Kusto database. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<DataConnectionInner> object + */ + public Observable> listByDatabaseAsync(String resourceGroupName, String clusterName, String databaseName) { + return listByDatabaseWithServiceResponseAsync(resourceGroupName, clusterName, databaseName).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Returns the list of data connections of the given Kusto database. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<DataConnectionInner> object + */ + public Observable>> listByDatabaseWithServiceResponseAsync(String resourceGroupName, String clusterName, String databaseName) { + 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 (databaseName == null) { + throw new IllegalArgumentException("Parameter databaseName is 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.listByDatabase(resourceGroupName, clusterName, databaseName, 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 = listByDatabaseDelegate(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> listByDatabaseDelegate(Response response) 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 that the data connection parameters are valid. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param parameters The data connection parameters supplied to the CreateOrUpdate operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DataConnectionValidationListResultInner object if successful. + */ + public DataConnectionValidationListResultInner dataConnectionValidationMethod(String resourceGroupName, String clusterName, String databaseName, DataConnectionValidation parameters) { + return dataConnectionValidationMethodWithServiceResponseAsync(resourceGroupName, clusterName, databaseName, parameters).toBlocking().last().body(); + } + + /** + * Checks that the data connection parameters are valid. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param parameters The data connection parameters supplied to the CreateOrUpdate 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 dataConnectionValidationMethodAsync(String resourceGroupName, String clusterName, String databaseName, DataConnectionValidation parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(dataConnectionValidationMethodWithServiceResponseAsync(resourceGroupName, clusterName, databaseName, parameters), serviceCallback); + } + + /** + * Checks that the data connection parameters are valid. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param parameters The data connection parameters supplied to the CreateOrUpdate operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable dataConnectionValidationMethodAsync(String resourceGroupName, String clusterName, String databaseName, DataConnectionValidation parameters) { + return dataConnectionValidationMethodWithServiceResponseAsync(resourceGroupName, clusterName, databaseName, parameters).map(new Func1, DataConnectionValidationListResultInner>() { + @Override + public DataConnectionValidationListResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Checks that the data connection parameters are valid. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param parameters The data connection parameters supplied to the CreateOrUpdate operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> dataConnectionValidationMethodWithServiceResponseAsync(String resourceGroupName, String clusterName, String databaseName, DataConnectionValidation parameters) { + 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 (databaseName == null) { + throw new IllegalArgumentException("Parameter databaseName is 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 (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + Observable> observable = service.dataConnectionValidationMethod(resourceGroupName, clusterName, databaseName, this.client.subscriptionId(), this.client.apiVersion(), parameters, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new LongRunningOperationOptions().withFinalStateVia(LongRunningFinalState.LOCATION), new TypeToken() { }.getType()); + } + + /** + * Checks that the data connection parameters are valid. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param parameters The data connection parameters supplied to the CreateOrUpdate operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DataConnectionValidationListResultInner object if successful. + */ + public DataConnectionValidationListResultInner beginDataConnectionValidationMethod(String resourceGroupName, String clusterName, String databaseName, DataConnectionValidation parameters) { + return beginDataConnectionValidationMethodWithServiceResponseAsync(resourceGroupName, clusterName, databaseName, parameters).toBlocking().single().body(); + } + + /** + * Checks that the data connection parameters are valid. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param parameters The data connection parameters supplied to the CreateOrUpdate 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 beginDataConnectionValidationMethodAsync(String resourceGroupName, String clusterName, String databaseName, DataConnectionValidation parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDataConnectionValidationMethodWithServiceResponseAsync(resourceGroupName, clusterName, databaseName, parameters), serviceCallback); + } + + /** + * Checks that the data connection parameters are valid. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param parameters The data connection parameters supplied to the CreateOrUpdate operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DataConnectionValidationListResultInner object + */ + public Observable beginDataConnectionValidationMethodAsync(String resourceGroupName, String clusterName, String databaseName, DataConnectionValidation parameters) { + return beginDataConnectionValidationMethodWithServiceResponseAsync(resourceGroupName, clusterName, databaseName, parameters).map(new Func1, DataConnectionValidationListResultInner>() { + @Override + public DataConnectionValidationListResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Checks that the data connection parameters are valid. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param parameters The data connection parameters supplied to the CreateOrUpdate operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DataConnectionValidationListResultInner object + */ + public Observable> beginDataConnectionValidationMethodWithServiceResponseAsync(String resourceGroupName, String clusterName, String databaseName, DataConnectionValidation parameters) { + 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 (databaseName == null) { + throw new IllegalArgumentException("Parameter databaseName is 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 (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + return service.beginDataConnectionValidationMethod(resourceGroupName, clusterName, databaseName, this.client.subscriptionId(), this.client.apiVersion(), parameters, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDataConnectionValidationMethodDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDataConnectionValidationMethodDelegate(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 that the data connection name is valid and is not already in use. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param name Data Connection 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 CheckNameResultInner object if successful. + */ + public CheckNameResultInner checkNameAvailability(String resourceGroupName, String clusterName, String databaseName, String name) { + return checkNameAvailabilityWithServiceResponseAsync(resourceGroupName, clusterName, databaseName, name).toBlocking().single().body(); + } + + /** + * Checks that the data connection name is valid and is not already in use. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param name Data Connection 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 resourceGroupName, String clusterName, String databaseName, String name, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(checkNameAvailabilityWithServiceResponseAsync(resourceGroupName, clusterName, databaseName, name), serviceCallback); + } + + /** + * Checks that the data connection name is valid and is not already in use. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param name Data Connection name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CheckNameResultInner object + */ + public Observable checkNameAvailabilityAsync(String resourceGroupName, String clusterName, String databaseName, String name) { + return checkNameAvailabilityWithServiceResponseAsync(resourceGroupName, clusterName, databaseName, name).map(new Func1, CheckNameResultInner>() { + @Override + public CheckNameResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Checks that the data connection name is valid and is not already in use. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param name Data Connection name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CheckNameResultInner object + */ + public Observable> checkNameAvailabilityWithServiceResponseAsync(String resourceGroupName, String clusterName, String databaseName, String name) { + 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 (databaseName == null) { + throw new IllegalArgumentException("Parameter databaseName is 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 (name == null) { + throw new IllegalArgumentException("Parameter name is required and cannot be null."); + } + DataConnectionCheckNameRequest dataConnectionName = new DataConnectionCheckNameRequest(); + dataConnectionName.withName(name); + return service.checkNameAvailability(resourceGroupName, clusterName, databaseName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), dataConnectionName, 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); + } + + /** + * Returns a data connection. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param dataConnectionName The name of the data 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 DataConnectionInner object if successful. + */ + public DataConnectionInner get(String resourceGroupName, String clusterName, String databaseName, String dataConnectionName) { + return getWithServiceResponseAsync(resourceGroupName, clusterName, databaseName, dataConnectionName).toBlocking().single().body(); + } + + /** + * Returns a data connection. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param dataConnectionName The name of the data 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 clusterName, String databaseName, String dataConnectionName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, clusterName, databaseName, dataConnectionName), serviceCallback); + } + + /** + * Returns a data connection. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param dataConnectionName The name of the data connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DataConnectionInner object + */ + public Observable getAsync(String resourceGroupName, String clusterName, String databaseName, String dataConnectionName) { + return getWithServiceResponseAsync(resourceGroupName, clusterName, databaseName, dataConnectionName).map(new Func1, DataConnectionInner>() { + @Override + public DataConnectionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Returns a data connection. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param dataConnectionName The name of the data connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DataConnectionInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String clusterName, String databaseName, String dataConnectionName) { + 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 (databaseName == null) { + throw new IllegalArgumentException("Parameter databaseName is required and cannot be null."); + } + if (dataConnectionName == null) { + throw new IllegalArgumentException("Parameter dataConnectionName is 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, clusterName, databaseName, dataConnectionName, 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 or updates a data connection. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param dataConnectionName The name of the data connection. + * @param parameters The data connection parameters supplied to the CreateOrUpdate operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DataConnectionInner object if successful. + */ + public DataConnectionInner createOrUpdate(String resourceGroupName, String clusterName, String databaseName, String dataConnectionName, DataConnectionInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, clusterName, databaseName, dataConnectionName, parameters).toBlocking().last().body(); + } + + /** + * Creates or updates a data connection. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param dataConnectionName The name of the data connection. + * @param parameters The data connection parameters supplied to the CreateOrUpdate 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 clusterName, String databaseName, String dataConnectionName, DataConnectionInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, clusterName, databaseName, dataConnectionName, parameters), serviceCallback); + } + + /** + * Creates or updates a data connection. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param dataConnectionName The name of the data connection. + * @param parameters The data connection parameters supplied to the CreateOrUpdate operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String clusterName, String databaseName, String dataConnectionName, DataConnectionInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, clusterName, databaseName, dataConnectionName, parameters).map(new Func1, DataConnectionInner>() { + @Override + public DataConnectionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates a data connection. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param dataConnectionName The name of the data connection. + * @param parameters The data connection parameters supplied to the CreateOrUpdate operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String clusterName, String databaseName, String dataConnectionName, DataConnectionInner parameters) { + 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 (databaseName == null) { + throw new IllegalArgumentException("Parameter databaseName is required and cannot be null."); + } + if (dataConnectionName == null) { + throw new IllegalArgumentException("Parameter dataConnectionName is 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.createOrUpdate(resourceGroupName, clusterName, databaseName, dataConnectionName, this.client.subscriptionId(), parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Creates or updates a data connection. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param dataConnectionName The name of the data connection. + * @param parameters The data connection parameters supplied to the CreateOrUpdate operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DataConnectionInner object if successful. + */ + public DataConnectionInner beginCreateOrUpdate(String resourceGroupName, String clusterName, String databaseName, String dataConnectionName, DataConnectionInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, clusterName, databaseName, dataConnectionName, parameters).toBlocking().single().body(); + } + + /** + * Creates or updates a data connection. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param dataConnectionName The name of the data connection. + * @param parameters The data connection parameters supplied to the CreateOrUpdate 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 clusterName, String databaseName, String dataConnectionName, DataConnectionInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, clusterName, databaseName, dataConnectionName, parameters), serviceCallback); + } + + /** + * Creates or updates a data connection. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param dataConnectionName The name of the data connection. + * @param parameters The data connection parameters supplied to the CreateOrUpdate operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DataConnectionInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String clusterName, String databaseName, String dataConnectionName, DataConnectionInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, clusterName, databaseName, dataConnectionName, parameters).map(new Func1, DataConnectionInner>() { + @Override + public DataConnectionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates a data connection. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param dataConnectionName The name of the data connection. + * @param parameters The data connection parameters supplied to the CreateOrUpdate operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DataConnectionInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String clusterName, String databaseName, String dataConnectionName, DataConnectionInner parameters) { + 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 (databaseName == null) { + throw new IllegalArgumentException("Parameter databaseName is required and cannot be null."); + } + if (dataConnectionName == null) { + throw new IllegalArgumentException("Parameter dataConnectionName is 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.beginCreateOrUpdate(resourceGroupName, clusterName, databaseName, dataConnectionName, 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 = 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()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Updates a data connection. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param dataConnectionName The name of the data connection. + * @param parameters The data connection parameters supplied to the 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 DataConnectionInner object if successful. + */ + public DataConnectionInner update(String resourceGroupName, String clusterName, String databaseName, String dataConnectionName, DataConnectionInner parameters) { + return updateWithServiceResponseAsync(resourceGroupName, clusterName, databaseName, dataConnectionName, parameters).toBlocking().last().body(); + } + + /** + * Updates a data connection. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param dataConnectionName The name of the data connection. + * @param parameters The data connection parameters supplied to the 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 updateAsync(String resourceGroupName, String clusterName, String databaseName, String dataConnectionName, DataConnectionInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, clusterName, databaseName, dataConnectionName, parameters), serviceCallback); + } + + /** + * Updates a data connection. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param dataConnectionName The name of the data connection. + * @param parameters The data connection parameters supplied to the Update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateAsync(String resourceGroupName, String clusterName, String databaseName, String dataConnectionName, DataConnectionInner parameters) { + return updateWithServiceResponseAsync(resourceGroupName, clusterName, databaseName, dataConnectionName, parameters).map(new Func1, DataConnectionInner>() { + @Override + public DataConnectionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a data connection. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param dataConnectionName The name of the data connection. + * @param parameters The data connection parameters supplied to the Update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String clusterName, String databaseName, String dataConnectionName, DataConnectionInner parameters) { + 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 (databaseName == null) { + throw new IllegalArgumentException("Parameter databaseName is required and cannot be null."); + } + if (dataConnectionName == null) { + throw new IllegalArgumentException("Parameter dataConnectionName is 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, clusterName, databaseName, dataConnectionName, this.client.subscriptionId(), parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Updates a data connection. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param dataConnectionName The name of the data connection. + * @param parameters The data connection parameters supplied to the 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 DataConnectionInner object if successful. + */ + public DataConnectionInner beginUpdate(String resourceGroupName, String clusterName, String databaseName, String dataConnectionName, DataConnectionInner parameters) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, clusterName, databaseName, dataConnectionName, parameters).toBlocking().single().body(); + } + + /** + * Updates a data connection. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param dataConnectionName The name of the data connection. + * @param parameters The data connection parameters supplied to the 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 beginUpdateAsync(String resourceGroupName, String clusterName, String databaseName, String dataConnectionName, DataConnectionInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateWithServiceResponseAsync(resourceGroupName, clusterName, databaseName, dataConnectionName, parameters), serviceCallback); + } + + /** + * Updates a data connection. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param dataConnectionName The name of the data connection. + * @param parameters The data connection parameters supplied to the Update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DataConnectionInner object + */ + public Observable beginUpdateAsync(String resourceGroupName, String clusterName, String databaseName, String dataConnectionName, DataConnectionInner parameters) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, clusterName, databaseName, dataConnectionName, parameters).map(new Func1, DataConnectionInner>() { + @Override + public DataConnectionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a data connection. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param dataConnectionName The name of the data connection. + * @param parameters The data connection parameters supplied to the Update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DataConnectionInner object + */ + public Observable> beginUpdateWithServiceResponseAsync(String resourceGroupName, String clusterName, String databaseName, String dataConnectionName, DataConnectionInner parameters) { + 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 (databaseName == null) { + throw new IllegalArgumentException("Parameter databaseName is required and cannot be null."); + } + if (dataConnectionName == null) { + throw new IllegalArgumentException("Parameter dataConnectionName is 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, clusterName, databaseName, dataConnectionName, 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()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Deletes the data connection with the given name. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param dataConnectionName The name of the data 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 clusterName, String databaseName, String dataConnectionName) { + deleteWithServiceResponseAsync(resourceGroupName, clusterName, databaseName, dataConnectionName).toBlocking().last().body(); + } + + /** + * Deletes the data connection with the given name. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param dataConnectionName The name of the data 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 clusterName, String databaseName, String dataConnectionName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, clusterName, databaseName, dataConnectionName), serviceCallback); + } + + /** + * Deletes the data connection with the given name. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param dataConnectionName The name of the data connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String clusterName, String databaseName, String dataConnectionName) { + return deleteWithServiceResponseAsync(resourceGroupName, clusterName, databaseName, dataConnectionName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the data connection with the given name. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param dataConnectionName The name of the data connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String clusterName, String databaseName, String dataConnectionName) { + 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 (databaseName == null) { + throw new IllegalArgumentException("Parameter databaseName is required and cannot be null."); + } + if (dataConnectionName == null) { + throw new IllegalArgumentException("Parameter dataConnectionName is 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, clusterName, databaseName, dataConnectionName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Deletes the data connection with the given name. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param dataConnectionName The name of the data 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 clusterName, String databaseName, String dataConnectionName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, clusterName, databaseName, dataConnectionName).toBlocking().single().body(); + } + + /** + * Deletes the data connection with the given name. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param dataConnectionName The name of the data 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 clusterName, String databaseName, String dataConnectionName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, clusterName, databaseName, dataConnectionName), serviceCallback); + } + + /** + * Deletes the data connection with the given name. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param dataConnectionName The name of the data connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String clusterName, String databaseName, String dataConnectionName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, clusterName, databaseName, dataConnectionName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the data connection with the given name. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param dataConnectionName The name of the data connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String clusterName, String databaseName, String dataConnectionName) { + 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 (databaseName == null) { + throw new IllegalArgumentException("Parameter databaseName is required and cannot be null."); + } + if (dataConnectionName == null) { + throw new IllegalArgumentException("Parameter dataConnectionName is 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, clusterName, databaseName, dataConnectionName, 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); + } + +} diff --git a/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/implementation/DatabaseImpl.java b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/implementation/DatabaseImpl.java new file mode 100644 index 0000000000000..625b85f294713 --- /dev/null +++ b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/implementation/DatabaseImpl.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.kusto.v2020_06_14.implementation; + +import com.microsoft.azure.management.kusto.v2020_06_14.Database; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; + +class DatabaseImpl extends CreatableUpdatableImpl implements Database, Database.Definition, Database.Update { + private final KustoManager manager; + private String resourceGroupName; + private String clusterName; + private String databaseName; + + DatabaseImpl(String name, KustoManager manager) { + super(name, new DatabaseInner()); + this.manager = manager; + // Set resource name + this.databaseName = name; + // + } + + DatabaseImpl(DatabaseInner inner, KustoManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.databaseName = inner.name(); + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.clusterName = IdParsingUtils.getValueFromIdByName(inner.id(), "clusters"); + this.databaseName = IdParsingUtils.getValueFromIdByName(inner.id(), "databases"); + // + } + + @Override + public KustoManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + DatabasesInner client = this.manager().inner().databases(); + return client.createOrUpdateAsync(this.resourceGroupName, this.clusterName, this.databaseName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + DatabasesInner client = this.manager().inner().databases(); + return client.updateAsync(this.resourceGroupName, this.clusterName, this.databaseName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + DatabasesInner client = this.manager().inner().databases(); + return client.getAsync(this.resourceGroupName, this.clusterName, this.databaseName); + } + + @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 String type() { + return this.inner().type(); + } + + @Override + public DatabaseImpl withExistingCluster(String resourceGroupName, String clusterName) { + this.resourceGroupName = resourceGroupName; + this.clusterName = clusterName; + return this; + } + + @Override + public DatabaseImpl withLocation(String location) { + this.inner().withLocation(location); + return this; + } + +} diff --git a/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/implementation/DatabaseInner.java b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/implementation/DatabaseInner.java new file mode 100644 index 0000000000000..f596cc35f7c23 --- /dev/null +++ b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/implementation/DatabaseInner.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.kusto.v2020_06_14.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.microsoft.azure.ProxyResource; +import com.microsoft.azure.management.kusto.v2020_06_14.ReadOnlyFollowingDatabase; +import com.microsoft.azure.management.kusto.v2020_06_14.ReadWriteDatabase; + +/** + * Class representing a Kusto database. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind", defaultImpl = DatabaseInner.class) +@JsonTypeName("Database") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "ReadWrite", value = ReadWriteDatabase.class), + @JsonSubTypes.Type(name = "ReadOnlyFollowing", value = ReadOnlyFollowingDatabase.class) +}) +public class DatabaseInner extends ProxyResource { + /** + * Resource location. + */ + @JsonProperty(value = "location") + private String location; + + /** + * 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 DatabaseInner object itself. + */ + public DatabaseInner withLocation(String location) { + this.location = location; + return this; + } + +} diff --git a/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/implementation/DatabasePrincipalAssignmentImpl.java b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/implementation/DatabasePrincipalAssignmentImpl.java new file mode 100644 index 0000000000000..020b2a0210eb0 --- /dev/null +++ b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/implementation/DatabasePrincipalAssignmentImpl.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.kusto.v2020_06_14.implementation; + +import com.microsoft.azure.management.kusto.v2020_06_14.DatabasePrincipalAssignment; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import com.microsoft.azure.management.kusto.v2020_06_14.DatabasePrincipalRole; +import com.microsoft.azure.management.kusto.v2020_06_14.PrincipalType; +import com.microsoft.azure.management.kusto.v2020_06_14.ProvisioningState; + +class DatabasePrincipalAssignmentImpl extends CreatableUpdatableImpl implements DatabasePrincipalAssignment, DatabasePrincipalAssignment.Definition, DatabasePrincipalAssignment.Update { + private final KustoManager manager; + private String resourceGroupName; + private String clusterName; + private String databaseName; + private String principalAssignmentName; + + DatabasePrincipalAssignmentImpl(String name, KustoManager manager) { + super(name, new DatabasePrincipalAssignmentInner()); + this.manager = manager; + // Set resource name + this.principalAssignmentName = name; + // + } + + DatabasePrincipalAssignmentImpl(DatabasePrincipalAssignmentInner inner, KustoManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.principalAssignmentName = inner.name(); + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.clusterName = IdParsingUtils.getValueFromIdByName(inner.id(), "clusters"); + this.databaseName = IdParsingUtils.getValueFromIdByName(inner.id(), "databases"); + this.principalAssignmentName = IdParsingUtils.getValueFromIdByName(inner.id(), "principalAssignments"); + // + } + + @Override + public KustoManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + DatabasePrincipalAssignmentsInner client = this.manager().inner().databasePrincipalAssignments(); + return client.createOrUpdateAsync(this.resourceGroupName, this.clusterName, this.databaseName, this.principalAssignmentName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + DatabasePrincipalAssignmentsInner client = this.manager().inner().databasePrincipalAssignments(); + return client.createOrUpdateAsync(this.resourceGroupName, this.clusterName, this.databaseName, this.principalAssignmentName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + DatabasePrincipalAssignmentsInner client = this.manager().inner().databasePrincipalAssignments(); + return client.getAsync(this.resourceGroupName, this.clusterName, this.databaseName, this.principalAssignmentName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @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 principalName() { + return this.inner().principalName(); + } + + @Override + public PrincipalType principalType() { + return this.inner().principalType(); + } + + @Override + public ProvisioningState provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public DatabasePrincipalRole role() { + return this.inner().role(); + } + + @Override + public String tenantId() { + return this.inner().tenantId(); + } + + @Override + public String tenantName() { + return this.inner().tenantName(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public DatabasePrincipalAssignmentImpl withExistingDatabasis(String resourceGroupName, String clusterName, String databaseName) { + this.resourceGroupName = resourceGroupName; + this.clusterName = clusterName; + this.databaseName = databaseName; + return this; + } + + @Override + public DatabasePrincipalAssignmentImpl withPrincipalId(String principalId) { + this.inner().withPrincipalId(principalId); + return this; + } + + @Override + public DatabasePrincipalAssignmentImpl withPrincipalType(PrincipalType principalType) { + this.inner().withPrincipalType(principalType); + return this; + } + + @Override + public DatabasePrincipalAssignmentImpl withRole(DatabasePrincipalRole role) { + this.inner().withRole(role); + return this; + } + + @Override + public DatabasePrincipalAssignmentImpl withTenantId(String tenantId) { + this.inner().withTenantId(tenantId); + return this; + } + +} diff --git a/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/implementation/DatabasePrincipalAssignmentInner.java b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/implementation/DatabasePrincipalAssignmentInner.java new file mode 100644 index 0000000000000..31f7d59cd1a57 --- /dev/null +++ b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/implementation/DatabasePrincipalAssignmentInner.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.kusto.v2020_06_14.implementation; + +import com.microsoft.azure.management.kusto.v2020_06_14.DatabasePrincipalRole; +import com.microsoft.azure.management.kusto.v2020_06_14.PrincipalType; +import com.microsoft.azure.management.kusto.v2020_06_14.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.ProxyResource; + +/** + * Class representing a database principal assignment. + */ +@JsonFlatten +public class DatabasePrincipalAssignmentInner extends ProxyResource { + /** + * The principal ID assigned to the database principal. It can be a user + * email, application ID, or security group name. + */ + @JsonProperty(value = "properties.principalId", required = true) + private String principalId; + + /** + * Database principal role. Possible values include: 'Admin', 'Ingestor', + * 'Monitor', 'User', 'UnrestrictedViewers', 'Viewer'. + */ + @JsonProperty(value = "properties.role", required = true) + private DatabasePrincipalRole role; + + /** + * The tenant id of the principal. + */ + @JsonProperty(value = "properties.tenantId") + private String tenantId; + + /** + * Principal type. Possible values include: 'App', 'Group', 'User'. + */ + @JsonProperty(value = "properties.principalType", required = true) + private PrincipalType principalType; + + /** + * The tenant name of the principal. + */ + @JsonProperty(value = "properties.tenantName", access = JsonProperty.Access.WRITE_ONLY) + private String tenantName; + + /** + * The principal name. + */ + @JsonProperty(value = "properties.principalName", access = JsonProperty.Access.WRITE_ONLY) + private String principalName; + + /** + * The provisioned state of the resource. Possible values include: + * 'Running', 'Creating', 'Deleting', 'Succeeded', 'Failed', 'Moving'. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /** + * Get the principal ID assigned to the database principal. It can be a user email, application ID, or security group name. + * + * @return the principalId value + */ + public String principalId() { + return this.principalId; + } + + /** + * Set the principal ID assigned to the database principal. It can be a user email, application ID, or security group name. + * + * @param principalId the principalId value to set + * @return the DatabasePrincipalAssignmentInner object itself. + */ + public DatabasePrincipalAssignmentInner withPrincipalId(String principalId) { + this.principalId = principalId; + return this; + } + + /** + * Get database principal role. Possible values include: 'Admin', 'Ingestor', 'Monitor', 'User', 'UnrestrictedViewers', 'Viewer'. + * + * @return the role value + */ + public DatabasePrincipalRole role() { + return this.role; + } + + /** + * Set database principal role. Possible values include: 'Admin', 'Ingestor', 'Monitor', 'User', 'UnrestrictedViewers', 'Viewer'. + * + * @param role the role value to set + * @return the DatabasePrincipalAssignmentInner object itself. + */ + public DatabasePrincipalAssignmentInner withRole(DatabasePrincipalRole role) { + this.role = role; + return this; + } + + /** + * Get the tenant id of the principal. + * + * @return the tenantId value + */ + public String tenantId() { + return this.tenantId; + } + + /** + * Set the tenant id of the principal. + * + * @param tenantId the tenantId value to set + * @return the DatabasePrincipalAssignmentInner object itself. + */ + public DatabasePrincipalAssignmentInner withTenantId(String tenantId) { + this.tenantId = tenantId; + return this; + } + + /** + * Get principal type. Possible values include: 'App', 'Group', 'User'. + * + * @return the principalType value + */ + public PrincipalType principalType() { + return this.principalType; + } + + /** + * Set principal type. Possible values include: 'App', 'Group', 'User'. + * + * @param principalType the principalType value to set + * @return the DatabasePrincipalAssignmentInner object itself. + */ + public DatabasePrincipalAssignmentInner withPrincipalType(PrincipalType principalType) { + this.principalType = principalType; + return this; + } + + /** + * Get the tenant name of the principal. + * + * @return the tenantName value + */ + public String tenantName() { + return this.tenantName; + } + + /** + * Get the principal name. + * + * @return the principalName value + */ + public String principalName() { + return this.principalName; + } + + /** + * Get the provisioned state of the resource. Possible values include: 'Running', 'Creating', 'Deleting', 'Succeeded', 'Failed', 'Moving'. + * + * @return the provisioningState value + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + +} diff --git a/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/implementation/DatabasePrincipalAssignmentsImpl.java b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/implementation/DatabasePrincipalAssignmentsImpl.java new file mode 100644 index 0000000000000..7332b063189a2 --- /dev/null +++ b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/implementation/DatabasePrincipalAssignmentsImpl.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.kusto.v2020_06_14.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.kusto.v2020_06_14.DatabasePrincipalAssignments; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import java.util.List; +import com.microsoft.azure.management.kusto.v2020_06_14.DatabasePrincipalAssignment; +import com.microsoft.azure.management.kusto.v2020_06_14.CheckNameResult; + +class DatabasePrincipalAssignmentsImpl extends WrapperImpl implements DatabasePrincipalAssignments { + private final KustoManager manager; + + DatabasePrincipalAssignmentsImpl(KustoManager manager) { + super(manager.inner().databasePrincipalAssignments()); + this.manager = manager; + } + + public KustoManager manager() { + return this.manager; + } + + @Override + public DatabasePrincipalAssignmentImpl define(String name) { + return wrapModel(name); + } + + private DatabasePrincipalAssignmentImpl wrapModel(DatabasePrincipalAssignmentInner inner) { + return new DatabasePrincipalAssignmentImpl(inner, manager()); + } + + private DatabasePrincipalAssignmentImpl wrapModel(String name) { + return new DatabasePrincipalAssignmentImpl(name, this.manager()); + } + + @Override + public Observable listAsync(String resourceGroupName, String clusterName, String databaseName) { + DatabasePrincipalAssignmentsInner client = this.inner(); + return client.listAsync(resourceGroupName, clusterName, databaseName) + .flatMap(new Func1, Observable>() { + @Override + public Observable call(List innerList) { + return Observable.from(innerList); + } + }) + .map(new Func1() { + @Override + public DatabasePrincipalAssignment call(DatabasePrincipalAssignmentInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String clusterName, String databaseName, String principalAssignmentName) { + DatabasePrincipalAssignmentsInner client = this.inner(); + return client.getAsync(resourceGroupName, clusterName, databaseName, principalAssignmentName) + .flatMap(new Func1>() { + @Override + public Observable call(DatabasePrincipalAssignmentInner inner) { + if (inner == null) { + return Observable.empty(); + } else { + return Observable.just((DatabasePrincipalAssignment)wrapModel(inner)); + } + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String clusterName, String databaseName, String principalAssignmentName) { + DatabasePrincipalAssignmentsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, clusterName, databaseName, principalAssignmentName).toCompletable(); + } + + @Override + public Observable checkNameAvailabilityAsync(String resourceGroupName, String clusterName, String databaseName, String name) { + DatabasePrincipalAssignmentsInner client = this.inner(); + return client.checkNameAvailabilityAsync(resourceGroupName, clusterName, databaseName, name) + .map(new Func1() { + @Override + public CheckNameResult call(CheckNameResultInner inner) { + return new CheckNameResultImpl(inner, manager()); + } + }); + } + +} diff --git a/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/implementation/DatabasePrincipalAssignmentsInner.java b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/implementation/DatabasePrincipalAssignmentsInner.java new file mode 100644 index 0000000000000..6e14e9d646ef5 --- /dev/null +++ b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/implementation/DatabasePrincipalAssignmentsInner.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.kusto.v2020_06_14.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.management.kusto.v2020_06_14.DatabasePrincipalAssignmentCheckNameRequest; +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 DatabasePrincipalAssignments. + */ +public class DatabasePrincipalAssignmentsInner { + /** The Retrofit service to perform REST calls. */ + private DatabasePrincipalAssignmentsService service; + /** The service client containing this operation class. */ + private KustoManagementClientImpl client; + + /** + * Initializes an instance of DatabasePrincipalAssignmentsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public DatabasePrincipalAssignmentsInner(Retrofit retrofit, KustoManagementClientImpl client) { + this.service = retrofit.create(DatabasePrincipalAssignmentsService.class); + this.client = client; + } + + /** + * The interface defining all the services for DatabasePrincipalAssignments to be + * used by Retrofit to perform actually REST calls. + */ + interface DatabasePrincipalAssignmentsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.kusto.v2020_06_14.DatabasePrincipalAssignments checkNameAvailability" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/checkPrincipalAssignmentNameAvailability") + Observable> checkNameAvailability(@Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("databaseName") String databaseName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body DatabasePrincipalAssignmentCheckNameRequest principalAssignmentName, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.kusto.v2020_06_14.DatabasePrincipalAssignments get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/principalAssignments/{principalAssignmentName}") + Observable> get(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("databaseName") String databaseName, @Path("principalAssignmentName") String principalAssignmentName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.kusto.v2020_06_14.DatabasePrincipalAssignments createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/principalAssignments/{principalAssignmentName}") + Observable> createOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("databaseName") String databaseName, @Path("principalAssignmentName") String principalAssignmentName, @Query("api-version") String apiVersion, @Body DatabasePrincipalAssignmentInner 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.kusto.v2020_06_14.DatabasePrincipalAssignments beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/principalAssignments/{principalAssignmentName}") + Observable> beginCreateOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("databaseName") String databaseName, @Path("principalAssignmentName") String principalAssignmentName, @Query("api-version") String apiVersion, @Body DatabasePrincipalAssignmentInner 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.kusto.v2020_06_14.DatabasePrincipalAssignments delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/principalAssignments/{principalAssignmentName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("databaseName") String databaseName, @Path("principalAssignmentName") String principalAssignmentName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.kusto.v2020_06_14.DatabasePrincipalAssignments beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/principalAssignments/{principalAssignmentName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("databaseName") String databaseName, @Path("principalAssignmentName") String principalAssignmentName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.kusto.v2020_06_14.DatabasePrincipalAssignments list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/principalAssignments") + Observable> list(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("databaseName") String databaseName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Checks that the database principal assignment is valid and is not already in use. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param name Principal Assignment resource 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 CheckNameResultInner object if successful. + */ + public CheckNameResultInner checkNameAvailability(String resourceGroupName, String clusterName, String databaseName, String name) { + return checkNameAvailabilityWithServiceResponseAsync(resourceGroupName, clusterName, databaseName, name).toBlocking().single().body(); + } + + /** + * Checks that the database principal assignment is valid and is not already in use. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param name Principal Assignment resource 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 resourceGroupName, String clusterName, String databaseName, String name, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(checkNameAvailabilityWithServiceResponseAsync(resourceGroupName, clusterName, databaseName, name), serviceCallback); + } + + /** + * Checks that the database principal assignment is valid and is not already in use. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param name Principal Assignment resource name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CheckNameResultInner object + */ + public Observable checkNameAvailabilityAsync(String resourceGroupName, String clusterName, String databaseName, String name) { + return checkNameAvailabilityWithServiceResponseAsync(resourceGroupName, clusterName, databaseName, name).map(new Func1, CheckNameResultInner>() { + @Override + public CheckNameResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Checks that the database principal assignment is valid and is not already in use. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param name Principal Assignment resource name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CheckNameResultInner object + */ + public Observable> checkNameAvailabilityWithServiceResponseAsync(String resourceGroupName, String clusterName, String databaseName, String name) { + 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 (databaseName == null) { + throw new IllegalArgumentException("Parameter databaseName is 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 (name == null) { + throw new IllegalArgumentException("Parameter name is required and cannot be null."); + } + DatabasePrincipalAssignmentCheckNameRequest principalAssignmentName = new DatabasePrincipalAssignmentCheckNameRequest(); + principalAssignmentName.withName(name); + return service.checkNameAvailability(resourceGroupName, clusterName, databaseName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), principalAssignmentName, 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 a Kusto cluster database principalAssignment. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param principalAssignmentName The name of the Kusto principalAssignment. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DatabasePrincipalAssignmentInner object if successful. + */ + public DatabasePrincipalAssignmentInner get(String resourceGroupName, String clusterName, String databaseName, String principalAssignmentName) { + return getWithServiceResponseAsync(resourceGroupName, clusterName, databaseName, principalAssignmentName).toBlocking().single().body(); + } + + /** + * Gets a Kusto cluster database principalAssignment. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param principalAssignmentName The name of the Kusto principalAssignment. + * @param serviceCallback 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 databaseName, String principalAssignmentName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, clusterName, databaseName, principalAssignmentName), serviceCallback); + } + + /** + * Gets a Kusto cluster database principalAssignment. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param principalAssignmentName The name of the Kusto principalAssignment. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DatabasePrincipalAssignmentInner object + */ + public Observable getAsync(String resourceGroupName, String clusterName, String databaseName, String principalAssignmentName) { + return getWithServiceResponseAsync(resourceGroupName, clusterName, databaseName, principalAssignmentName).map(new Func1, DatabasePrincipalAssignmentInner>() { + @Override + public DatabasePrincipalAssignmentInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets a Kusto cluster database principalAssignment. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param principalAssignmentName The name of the Kusto principalAssignment. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DatabasePrincipalAssignmentInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String clusterName, String databaseName, String principalAssignmentName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter 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 (databaseName == null) { + throw new IllegalArgumentException("Parameter databaseName is required and cannot be null."); + } + if (principalAssignmentName == null) { + throw new IllegalArgumentException("Parameter principalAssignmentName is required 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, databaseName, principalAssignmentName, 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 a Kusto cluster database principalAssignment. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param principalAssignmentName The name of the Kusto principalAssignment. + * @param parameters The Kusto principalAssignments parameters supplied for the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DatabasePrincipalAssignmentInner object if successful. + */ + public DatabasePrincipalAssignmentInner createOrUpdate(String resourceGroupName, String clusterName, String databaseName, String principalAssignmentName, DatabasePrincipalAssignmentInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, clusterName, databaseName, principalAssignmentName, parameters).toBlocking().last().body(); + } + + /** + * Creates a Kusto cluster database principalAssignment. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param principalAssignmentName The name of the Kusto principalAssignment. + * @param parameters The Kusto principalAssignments parameters supplied 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 createOrUpdateAsync(String resourceGroupName, String clusterName, String databaseName, String principalAssignmentName, DatabasePrincipalAssignmentInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, clusterName, databaseName, principalAssignmentName, parameters), serviceCallback); + } + + /** + * Creates a Kusto cluster database principalAssignment. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param principalAssignmentName The name of the Kusto principalAssignment. + * @param parameters The Kusto principalAssignments parameters supplied for the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String clusterName, String databaseName, String principalAssignmentName, DatabasePrincipalAssignmentInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, clusterName, databaseName, principalAssignmentName, parameters).map(new Func1, DatabasePrincipalAssignmentInner>() { + @Override + public DatabasePrincipalAssignmentInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates a Kusto cluster database principalAssignment. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param principalAssignmentName The name of the Kusto principalAssignment. + * @param parameters The Kusto principalAssignments parameters supplied for the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String clusterName, String databaseName, String principalAssignmentName, DatabasePrincipalAssignmentInner 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 (databaseName == null) { + throw new IllegalArgumentException("Parameter databaseName is required and cannot be null."); + } + if (principalAssignmentName == null) { + throw new IllegalArgumentException("Parameter principalAssignmentName 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.createOrUpdate(this.client.subscriptionId(), resourceGroupName, clusterName, databaseName, principalAssignmentName, this.client.apiVersion(), parameters, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Creates a Kusto cluster database principalAssignment. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param principalAssignmentName The name of the Kusto principalAssignment. + * @param parameters The Kusto principalAssignments parameters supplied for the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DatabasePrincipalAssignmentInner object if successful. + */ + public DatabasePrincipalAssignmentInner beginCreateOrUpdate(String resourceGroupName, String clusterName, String databaseName, String principalAssignmentName, DatabasePrincipalAssignmentInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, clusterName, databaseName, principalAssignmentName, parameters).toBlocking().single().body(); + } + + /** + * Creates a Kusto cluster database principalAssignment. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param principalAssignmentName The name of the Kusto principalAssignment. + * @param parameters The Kusto principalAssignments parameters supplied 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 beginCreateOrUpdateAsync(String resourceGroupName, String clusterName, String databaseName, String principalAssignmentName, DatabasePrincipalAssignmentInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, clusterName, databaseName, principalAssignmentName, parameters), serviceCallback); + } + + /** + * Creates a Kusto cluster database principalAssignment. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param principalAssignmentName The name of the Kusto principalAssignment. + * @param parameters The Kusto principalAssignments parameters supplied for the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DatabasePrincipalAssignmentInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String clusterName, String databaseName, String principalAssignmentName, DatabasePrincipalAssignmentInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, clusterName, databaseName, principalAssignmentName, parameters).map(new Func1, DatabasePrincipalAssignmentInner>() { + @Override + public DatabasePrincipalAssignmentInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates a Kusto cluster database principalAssignment. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param principalAssignmentName The name of the Kusto principalAssignment. + * @param parameters The Kusto principalAssignments parameters supplied for the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DatabasePrincipalAssignmentInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String clusterName, String databaseName, String principalAssignmentName, DatabasePrincipalAssignmentInner 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 (databaseName == null) { + throw new IllegalArgumentException("Parameter databaseName is required and cannot be null."); + } + if (principalAssignmentName == null) { + throw new IllegalArgumentException("Parameter principalAssignmentName 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.beginCreateOrUpdate(this.client.subscriptionId(), resourceGroupName, clusterName, databaseName, principalAssignmentName, this.client.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); + } + + /** + * Deletes a Kusto principalAssignment. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param principalAssignmentName The name of the Kusto principalAssignment. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @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 clusterName, String databaseName, String principalAssignmentName) { + deleteWithServiceResponseAsync(resourceGroupName, clusterName, databaseName, principalAssignmentName).toBlocking().last().body(); + } + + /** + * Deletes a Kusto principalAssignment. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param principalAssignmentName The name of the Kusto principalAssignment. + * @param serviceCallback 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 databaseName, String principalAssignmentName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, clusterName, databaseName, principalAssignmentName), serviceCallback); + } + + /** + * Deletes a Kusto principalAssignment. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param principalAssignmentName The name of the Kusto principalAssignment. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String clusterName, String databaseName, String principalAssignmentName) { + return deleteWithServiceResponseAsync(resourceGroupName, clusterName, databaseName, principalAssignmentName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes a Kusto principalAssignment. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param principalAssignmentName The name of the Kusto principalAssignment. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String clusterName, String databaseName, String principalAssignmentName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter 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 (databaseName == null) { + throw new IllegalArgumentException("Parameter databaseName is required and cannot be null."); + } + if (principalAssignmentName == null) { + throw new IllegalArgumentException("Parameter principalAssignmentName 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, databaseName, principalAssignmentName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Deletes a Kusto principalAssignment. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param principalAssignmentName The name of the Kusto principalAssignment. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @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 clusterName, String databaseName, String principalAssignmentName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, clusterName, databaseName, principalAssignmentName).toBlocking().single().body(); + } + + /** + * Deletes a Kusto principalAssignment. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param principalAssignmentName The name of the Kusto principalAssignment. + * @param serviceCallback 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 databaseName, String principalAssignmentName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, clusterName, databaseName, principalAssignmentName), serviceCallback); + } + + /** + * Deletes a Kusto principalAssignment. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param principalAssignmentName The name of the Kusto principalAssignment. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String clusterName, String databaseName, String principalAssignmentName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, clusterName, databaseName, principalAssignmentName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes a Kusto principalAssignment. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param principalAssignmentName The name of the Kusto principalAssignment. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String clusterName, String databaseName, String principalAssignmentName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter 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 (databaseName == null) { + throw new IllegalArgumentException("Parameter databaseName is required and cannot be null."); + } + if (principalAssignmentName == null) { + throw new IllegalArgumentException("Parameter principalAssignmentName is required 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, databaseName, principalAssignmentName, 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); + } + + /** + * Lists all Kusto cluster database principalAssignments. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException 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<DatabasePrincipalAssignmentInner> object if successful. + */ + public List list(String resourceGroupName, String clusterName, String databaseName) { + return listWithServiceResponseAsync(resourceGroupName, clusterName, databaseName).toBlocking().single().body(); + } + + /** + * Lists all Kusto cluster database principalAssignments. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto 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(String resourceGroupName, String clusterName, String databaseName, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listWithServiceResponseAsync(resourceGroupName, clusterName, databaseName), serviceCallback); + } + + /** + * Lists all Kusto cluster database principalAssignments. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<DatabasePrincipalAssignmentInner> object + */ + public Observable> listAsync(String resourceGroupName, String clusterName, String databaseName) { + return listWithServiceResponseAsync(resourceGroupName, clusterName, databaseName).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all Kusto cluster database principalAssignments. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<DatabasePrincipalAssignmentInner> object + */ + public Observable>> listWithServiceResponseAsync(String resourceGroupName, String clusterName, String databaseName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter 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 (databaseName == null) { + throw new IllegalArgumentException("Parameter databaseName is required 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, databaseName, 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/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/implementation/DatabasePrincipalImpl.java b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/implementation/DatabasePrincipalImpl.java new file mode 100644 index 0000000000000..0cfa330d9bd17 --- /dev/null +++ b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/implementation/DatabasePrincipalImpl.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.kusto.v2020_06_14.implementation; + +import com.microsoft.azure.management.kusto.v2020_06_14.DatabasePrincipal; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.kusto.v2020_06_14.DatabasePrincipalRole; +import com.microsoft.azure.management.kusto.v2020_06_14.DatabasePrincipalType; + +class DatabasePrincipalImpl extends WrapperImpl implements DatabasePrincipal { + private final KustoManager manager; + DatabasePrincipalImpl(DatabasePrincipalInner inner, KustoManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public KustoManager manager() { + return this.manager; + } + + @Override + public String appId() { + return this.inner().appId(); + } + + @Override + public String email() { + return this.inner().email(); + } + + @Override + public String fqn() { + return this.inner().fqn(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public DatabasePrincipalRole role() { + return this.inner().role(); + } + + @Override + public String tenantName() { + return this.inner().tenantName(); + } + + @Override + public DatabasePrincipalType type() { + return this.inner().type(); + } + +} diff --git a/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/implementation/DatabasePrincipalInner.java b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/implementation/DatabasePrincipalInner.java new file mode 100644 index 0000000000000..0afcdbf8c35c4 --- /dev/null +++ b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/implementation/DatabasePrincipalInner.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.kusto.v2020_06_14.implementation; + +import com.microsoft.azure.management.kusto.v2020_06_14.DatabasePrincipalRole; +import com.microsoft.azure.management.kusto.v2020_06_14.DatabasePrincipalType; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * A class representing database principal entity. + */ +public class DatabasePrincipalInner { + /** + * Database principal role. Possible values include: 'Admin', 'Ingestor', + * 'Monitor', 'User', 'UnrestrictedViewers', 'Viewer'. + */ + @JsonProperty(value = "role", required = true) + private DatabasePrincipalRole role; + + /** + * Database principal name. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * Database principal type. Possible values include: 'App', 'Group', + * 'User'. + */ + @JsonProperty(value = "type", required = true) + private DatabasePrincipalType type; + + /** + * Database principal fully qualified name. + */ + @JsonProperty(value = "fqn") + private String fqn; + + /** + * Database principal email if exists. + */ + @JsonProperty(value = "email") + private String email; + + /** + * Application id - relevant only for application principal type. + */ + @JsonProperty(value = "appId") + private String appId; + + /** + * The tenant name of the principal. + */ + @JsonProperty(value = "tenantName", access = JsonProperty.Access.WRITE_ONLY) + private String tenantName; + + /** + * Get database principal role. Possible values include: 'Admin', 'Ingestor', 'Monitor', 'User', 'UnrestrictedViewers', 'Viewer'. + * + * @return the role value + */ + public DatabasePrincipalRole role() { + return this.role; + } + + /** + * Set database principal role. Possible values include: 'Admin', 'Ingestor', 'Monitor', 'User', 'UnrestrictedViewers', 'Viewer'. + * + * @param role the role value to set + * @return the DatabasePrincipalInner object itself. + */ + public DatabasePrincipalInner withRole(DatabasePrincipalRole role) { + this.role = role; + return this; + } + + /** + * Get database principal name. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set database principal name. + * + * @param name the name value to set + * @return the DatabasePrincipalInner object itself. + */ + public DatabasePrincipalInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get database principal type. Possible values include: 'App', 'Group', 'User'. + * + * @return the type value + */ + public DatabasePrincipalType type() { + return this.type; + } + + /** + * Set database principal type. Possible values include: 'App', 'Group', 'User'. + * + * @param type the type value to set + * @return the DatabasePrincipalInner object itself. + */ + public DatabasePrincipalInner withType(DatabasePrincipalType type) { + this.type = type; + return this; + } + + /** + * Get database principal fully qualified name. + * + * @return the fqn value + */ + public String fqn() { + return this.fqn; + } + + /** + * Set database principal fully qualified name. + * + * @param fqn the fqn value to set + * @return the DatabasePrincipalInner object itself. + */ + public DatabasePrincipalInner withFqn(String fqn) { + this.fqn = fqn; + return this; + } + + /** + * Get database principal email if exists. + * + * @return the email value + */ + public String email() { + return this.email; + } + + /** + * Set database principal email if exists. + * + * @param email the email value to set + * @return the DatabasePrincipalInner object itself. + */ + public DatabasePrincipalInner withEmail(String email) { + this.email = email; + return this; + } + + /** + * Get application id - relevant only for application principal type. + * + * @return the appId value + */ + public String appId() { + return this.appId; + } + + /** + * Set application id - relevant only for application principal type. + * + * @param appId the appId value to set + * @return the DatabasePrincipalInner object itself. + */ + public DatabasePrincipalInner withAppId(String appId) { + this.appId = appId; + return this; + } + + /** + * Get the tenant name of the principal. + * + * @return the tenantName value + */ + public String tenantName() { + return this.tenantName; + } + +} diff --git a/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/implementation/DatabasePrincipalListResultImpl.java b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/implementation/DatabasePrincipalListResultImpl.java new file mode 100644 index 0000000000000..db6ff62517966 --- /dev/null +++ b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/implementation/DatabasePrincipalListResultImpl.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.kusto.v2020_06_14.implementation; + +import com.microsoft.azure.management.kusto.v2020_06_14.DatabasePrincipalListResult; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.List; + +class DatabasePrincipalListResultImpl extends WrapperImpl implements DatabasePrincipalListResult { + private final KustoManager manager; + DatabasePrincipalListResultImpl(DatabasePrincipalListResultInner inner, KustoManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public KustoManager manager() { + return this.manager; + } + + @Override + public List value() { + return this.inner().value(); + } + +} diff --git a/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/implementation/DatabasePrincipalListResultInner.java b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/implementation/DatabasePrincipalListResultInner.java new file mode 100644 index 0000000000000..941ad01821884 --- /dev/null +++ b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/implementation/DatabasePrincipalListResultInner.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.kusto.v2020_06_14.implementation; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The list Kusto database principals operation response. + */ +public class DatabasePrincipalListResultInner { + /** + * The list of Kusto database principals. + */ + @JsonProperty(value = "value") + private List value; + + /** + * Get the list of Kusto database principals. + * + * @return the value value + */ + public List value() { + return this.value; + } + + /** + * Set the list of Kusto database principals. + * + * @param value the value value to set + * @return the DatabasePrincipalListResultInner object itself. + */ + public DatabasePrincipalListResultInner withValue(List value) { + this.value = value; + return this; + } + +} diff --git a/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/implementation/DatabasesImpl.java b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/implementation/DatabasesImpl.java new file mode 100644 index 0000000000000..52179ddbee019 --- /dev/null +++ b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/implementation/DatabasesImpl.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.kusto.v2020_06_14.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.kusto.v2020_06_14.Databases; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import java.util.List; +import com.microsoft.azure.management.kusto.v2020_06_14.DatabasePrincipal; +import com.microsoft.azure.management.kusto.v2020_06_14.DatabasePrincipalListResult; +import com.microsoft.azure.management.kusto.v2020_06_14.Database; +import com.microsoft.azure.management.kusto.v2020_06_14.CheckNameResult; +import com.microsoft.azure.management.kusto.v2020_06_14.CheckNameRequest; + +class DatabasesImpl extends WrapperImpl implements Databases { + private final KustoManager manager; + + DatabasesImpl(KustoManager manager) { + super(manager.inner().databases()); + this.manager = manager; + } + + public KustoManager manager() { + return this.manager; + } + + @Override + public DatabaseImpl define(String name) { + return wrapModel(name); + } + + private DatabaseImpl wrapModel(DatabaseInner inner) { + return new DatabaseImpl(inner, manager()); + } + + private DatabaseImpl wrapModel(String name) { + return new DatabaseImpl(name, this.manager()); + } + + @Override + public Observable listPrincipalsAsync(String resourceGroupName, String clusterName, String databaseName) { + DatabasesInner client = this.inner(); + return client.listPrincipalsAsync(resourceGroupName, clusterName, databaseName) + .flatMap(new Func1, Observable>() { + @Override + public Observable call(List innerList) { + return Observable.from(innerList); + } + }) + .map(new Func1() { + @Override + public DatabasePrincipal call(DatabasePrincipalInner inner) { + return new DatabasePrincipalImpl(inner, manager()); + } + }); + } + + @Override + public Observable addPrincipalsAsync(String resourceGroupName, String clusterName, String databaseName) { + DatabasesInner client = this.inner(); + return client.addPrincipalsAsync(resourceGroupName, clusterName, databaseName) + .map(new Func1() { + @Override + public DatabasePrincipalListResult call(DatabasePrincipalListResultInner inner) { + return new DatabasePrincipalListResultImpl(inner, manager()); + } + }); + } + + @Override + public Observable removePrincipalsAsync(String resourceGroupName, String clusterName, String databaseName) { + DatabasesInner client = this.inner(); + return client.removePrincipalsAsync(resourceGroupName, clusterName, databaseName) + .map(new Func1() { + @Override + public DatabasePrincipalListResult call(DatabasePrincipalListResultInner inner) { + return new DatabasePrincipalListResultImpl(inner, manager()); + } + }); + } + + @Override + public Observable listByClusterAsync(String resourceGroupName, String clusterName) { + DatabasesInner client = this.inner(); + return client.listByClusterAsync(resourceGroupName, clusterName) + .flatMap(new Func1, Observable>() { + @Override + public Observable call(List innerList) { + return Observable.from(innerList); + } + }) + .map(new Func1() { + @Override + public Database call(DatabaseInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String clusterName, String databaseName) { + DatabasesInner client = this.inner(); + return client.getAsync(resourceGroupName, clusterName, databaseName) + .flatMap(new Func1>() { + @Override + public Observable call(DatabaseInner inner) { + if (inner == null) { + return Observable.empty(); + } else { + return Observable.just((Database)wrapModel(inner)); + } + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String clusterName, String databaseName) { + DatabasesInner client = this.inner(); + return client.deleteAsync(resourceGroupName, clusterName, databaseName).toCompletable(); + } + + @Override + public Observable checkNameAvailabilityAsync(String resourceGroupName, String clusterName, CheckNameRequest resourceName) { + DatabasesInner client = this.inner(); + return client.checkNameAvailabilityAsync(resourceGroupName, clusterName, resourceName) + .map(new Func1() { + @Override + public CheckNameResult call(CheckNameResultInner inner) { + return new CheckNameResultImpl(inner, manager()); + } + }); + } + +} diff --git a/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/implementation/DatabasesInner.java b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/implementation/DatabasesInner.java new file mode 100644 index 0000000000000..7e2220161ca80 --- /dev/null +++ b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/implementation/DatabasesInner.java @@ -0,0 +1,1410 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.kusto.v2020_06_14.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.management.kusto.v2020_06_14.CheckNameRequest; +import com.microsoft.azure.management.kusto.v2020_06_14.DatabasePrincipalListRequest; +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 Databases. + */ +public class DatabasesInner { + /** The Retrofit service to perform REST calls. */ + private DatabasesService service; + /** The service client containing this operation class. */ + private KustoManagementClientImpl client; + + /** + * Initializes an instance of DatabasesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public DatabasesInner(Retrofit retrofit, KustoManagementClientImpl client) { + this.service = retrofit.create(DatabasesService.class); + this.client = client; + } + + /** + * The interface defining all the services for Databases to be + * used by Retrofit to perform actually REST calls. + */ + interface DatabasesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.kusto.v2020_06_14.Databases checkNameAvailability" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/checkNameAvailability") + Observable> checkNameAvailability(@Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Body CheckNameRequest resourceName, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.kusto.v2020_06_14.Databases listByCluster" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases") + Observable> listByCluster(@Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.kusto.v2020_06_14.Databases get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}") + Observable> get(@Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("databaseName") String databaseName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.kusto.v2020_06_14.Databases createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}") + Observable> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("databaseName") String databaseName, @Path("subscriptionId") String subscriptionId, @Body DatabaseInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.kusto.v2020_06_14.Databases beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}") + Observable> beginCreateOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("databaseName") String databaseName, @Path("subscriptionId") String subscriptionId, @Body DatabaseInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.kusto.v2020_06_14.Databases update" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}") + Observable> update(@Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("databaseName") String databaseName, @Path("subscriptionId") String subscriptionId, @Body DatabaseInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.kusto.v2020_06_14.Databases beginUpdate" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}") + Observable> beginUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("databaseName") String databaseName, @Path("subscriptionId") String subscriptionId, @Body DatabaseInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.kusto.v2020_06_14.Databases delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("databaseName") String databaseName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.kusto.v2020_06_14.Databases beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("databaseName") String databaseName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.kusto.v2020_06_14.Databases listPrincipals" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/listPrincipals") + Observable> listPrincipals(@Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("databaseName") String databaseName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.kusto.v2020_06_14.Databases addPrincipals" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/addPrincipals") + Observable> addPrincipals(@Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("databaseName") String databaseName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body DatabasePrincipalListRequest databasePrincipalsToAdd, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.kusto.v2020_06_14.Databases removePrincipals" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/removePrincipals") + Observable> removePrincipals(@Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("databaseName") String databaseName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body DatabasePrincipalListRequest databasePrincipalsToRemove, @Header("User-Agent") String userAgent); + + } + + /** + * Checks that the database name is valid and is not already in use. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param resourceName The name of the 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 CheckNameResultInner object if successful. + */ + public CheckNameResultInner checkNameAvailability(String resourceGroupName, String clusterName, CheckNameRequest resourceName) { + return checkNameAvailabilityWithServiceResponseAsync(resourceGroupName, clusterName, resourceName).toBlocking().single().body(); + } + + /** + * Checks that the database name is valid and is not already in use. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param resourceName The name of the 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 checkNameAvailabilityAsync(String resourceGroupName, String clusterName, CheckNameRequest resourceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(checkNameAvailabilityWithServiceResponseAsync(resourceGroupName, clusterName, resourceName), serviceCallback); + } + + /** + * Checks that the database name is valid and is not already in use. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param resourceName The name of the resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CheckNameResultInner object + */ + public Observable checkNameAvailabilityAsync(String resourceGroupName, String clusterName, CheckNameRequest resourceName) { + return checkNameAvailabilityWithServiceResponseAsync(resourceGroupName, clusterName, resourceName).map(new Func1, CheckNameResultInner>() { + @Override + public CheckNameResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Checks that the database name is valid and is not already in use. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param resourceName The name of the resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CheckNameResultInner object + */ + public Observable> checkNameAvailabilityWithServiceResponseAsync(String resourceGroupName, String clusterName, CheckNameRequest resourceName) { + 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.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 (resourceName == null) { + throw new IllegalArgumentException("Parameter resourceName is required and cannot be null."); + } + Validator.validate(resourceName); + return service.checkNameAvailability(resourceGroupName, clusterName, this.client.subscriptionId(), this.client.apiVersion(), resourceName, 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); + } + + /** + * Returns the list of databases of the given Kusto cluster. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException 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<DatabaseInner> object if successful. + */ + public List listByCluster(String resourceGroupName, String clusterName) { + return listByClusterWithServiceResponseAsync(resourceGroupName, clusterName).toBlocking().single().body(); + } + + /** + * Returns the list of databases of the given Kusto cluster. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto 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(String resourceGroupName, String clusterName, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listByClusterWithServiceResponseAsync(resourceGroupName, clusterName), serviceCallback); + } + + /** + * Returns the list of databases of the given Kusto cluster. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<DatabaseInner> object + */ + public Observable> listByClusterAsync(String resourceGroupName, String clusterName) { + return listByClusterWithServiceResponseAsync(resourceGroupName, clusterName).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Returns the list of databases of the given Kusto cluster. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<DatabaseInner> object + */ + public Observable>> listByClusterWithServiceResponseAsync(String resourceGroupName, String clusterName) { + 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.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.listByCluster(resourceGroupName, clusterName, 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 = listByClusterDelegate(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> listByClusterDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Returns a database. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DatabaseInner object if successful. + */ + public DatabaseInner get(String resourceGroupName, String clusterName, String databaseName) { + return getWithServiceResponseAsync(resourceGroupName, clusterName, databaseName).toBlocking().single().body(); + } + + /** + * Returns a database. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto 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 getAsync(String resourceGroupName, String clusterName, String databaseName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, clusterName, databaseName), serviceCallback); + } + + /** + * Returns a database. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DatabaseInner object + */ + public Observable getAsync(String resourceGroupName, String clusterName, String databaseName) { + return getWithServiceResponseAsync(resourceGroupName, clusterName, databaseName).map(new Func1, DatabaseInner>() { + @Override + public DatabaseInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Returns a database. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DatabaseInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String clusterName, String databaseName) { + 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 (databaseName == null) { + throw new IllegalArgumentException("Parameter databaseName is 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, clusterName, databaseName, 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 or updates a database. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param parameters The database parameters supplied to the CreateOrUpdate operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DatabaseInner object if successful. + */ + public DatabaseInner createOrUpdate(String resourceGroupName, String clusterName, String databaseName, DatabaseInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, clusterName, databaseName, parameters).toBlocking().last().body(); + } + + /** + * Creates or updates a database. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param parameters The database parameters supplied to the CreateOrUpdate 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 clusterName, String databaseName, DatabaseInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, clusterName, databaseName, parameters), serviceCallback); + } + + /** + * Creates or updates a database. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param parameters The database parameters supplied to the CreateOrUpdate operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String clusterName, String databaseName, DatabaseInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, clusterName, databaseName, parameters).map(new Func1, DatabaseInner>() { + @Override + public DatabaseInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates a database. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param parameters The database parameters supplied to the CreateOrUpdate operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String clusterName, String databaseName, DatabaseInner parameters) { + 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 (databaseName == null) { + throw new IllegalArgumentException("Parameter databaseName is 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.createOrUpdate(resourceGroupName, clusterName, databaseName, this.client.subscriptionId(), parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Creates or updates a database. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param parameters The database parameters supplied to the CreateOrUpdate operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DatabaseInner object if successful. + */ + public DatabaseInner beginCreateOrUpdate(String resourceGroupName, String clusterName, String databaseName, DatabaseInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, clusterName, databaseName, parameters).toBlocking().single().body(); + } + + /** + * Creates or updates a database. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param parameters The database parameters supplied to the CreateOrUpdate 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 clusterName, String databaseName, DatabaseInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, clusterName, databaseName, parameters), serviceCallback); + } + + /** + * Creates or updates a database. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param parameters The database parameters supplied to the CreateOrUpdate operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DatabaseInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String clusterName, String databaseName, DatabaseInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, clusterName, databaseName, parameters).map(new Func1, DatabaseInner>() { + @Override + public DatabaseInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates a database. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param parameters The database parameters supplied to the CreateOrUpdate operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DatabaseInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String clusterName, String databaseName, DatabaseInner parameters) { + 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 (databaseName == null) { + throw new IllegalArgumentException("Parameter databaseName is 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.beginCreateOrUpdate(resourceGroupName, clusterName, databaseName, 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 = 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()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Updates a database. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param parameters The database parameters supplied to the 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 DatabaseInner object if successful. + */ + public DatabaseInner update(String resourceGroupName, String clusterName, String databaseName, DatabaseInner parameters) { + return updateWithServiceResponseAsync(resourceGroupName, clusterName, databaseName, parameters).toBlocking().last().body(); + } + + /** + * Updates a database. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param parameters The database parameters supplied to the 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 updateAsync(String resourceGroupName, String clusterName, String databaseName, DatabaseInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, clusterName, databaseName, parameters), serviceCallback); + } + + /** + * Updates a database. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param parameters The database parameters supplied to the Update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateAsync(String resourceGroupName, String clusterName, String databaseName, DatabaseInner parameters) { + return updateWithServiceResponseAsync(resourceGroupName, clusterName, databaseName, parameters).map(new Func1, DatabaseInner>() { + @Override + public DatabaseInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a database. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param parameters The database parameters supplied to the Update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String clusterName, String databaseName, DatabaseInner parameters) { + 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 (databaseName == null) { + throw new IllegalArgumentException("Parameter databaseName is 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, clusterName, databaseName, this.client.subscriptionId(), parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Updates a database. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param parameters The database parameters supplied to the 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 DatabaseInner object if successful. + */ + public DatabaseInner beginUpdate(String resourceGroupName, String clusterName, String databaseName, DatabaseInner parameters) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, clusterName, databaseName, parameters).toBlocking().single().body(); + } + + /** + * Updates a database. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param parameters The database parameters supplied to the 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 beginUpdateAsync(String resourceGroupName, String clusterName, String databaseName, DatabaseInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateWithServiceResponseAsync(resourceGroupName, clusterName, databaseName, parameters), serviceCallback); + } + + /** + * Updates a database. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param parameters The database parameters supplied to the Update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DatabaseInner object + */ + public Observable beginUpdateAsync(String resourceGroupName, String clusterName, String databaseName, DatabaseInner parameters) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, clusterName, databaseName, parameters).map(new Func1, DatabaseInner>() { + @Override + public DatabaseInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a database. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param parameters The database parameters supplied to the Update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DatabaseInner object + */ + public Observable> beginUpdateWithServiceResponseAsync(String resourceGroupName, String clusterName, String databaseName, DatabaseInner parameters) { + 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 (databaseName == null) { + throw new IllegalArgumentException("Parameter databaseName is 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, clusterName, databaseName, 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()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Deletes the database with the given name. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @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 clusterName, String databaseName) { + deleteWithServiceResponseAsync(resourceGroupName, clusterName, databaseName).toBlocking().last().body(); + } + + /** + * Deletes the database with the given name. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto 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, String databaseName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, clusterName, databaseName), serviceCallback); + } + + /** + * Deletes the database with the given name. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String clusterName, String databaseName) { + return deleteWithServiceResponseAsync(resourceGroupName, clusterName, databaseName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the database with the given name. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String clusterName, String databaseName) { + 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 (databaseName == null) { + throw new IllegalArgumentException("Parameter databaseName is 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, clusterName, databaseName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Deletes the database with the given name. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @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 clusterName, String databaseName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, clusterName, databaseName).toBlocking().single().body(); + } + + /** + * Deletes the database with the given name. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto 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, String databaseName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, clusterName, databaseName), serviceCallback); + } + + /** + * Deletes the database with the given name. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String clusterName, String databaseName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, clusterName, databaseName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the database with the given name. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String clusterName, String databaseName) { + 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 (databaseName == null) { + throw new IllegalArgumentException("Parameter databaseName is 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, clusterName, databaseName, 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 a list of database principals of the given Kusto cluster and database. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException 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<DatabasePrincipalInner> object if successful. + */ + public List listPrincipals(String resourceGroupName, String clusterName, String databaseName) { + return listPrincipalsWithServiceResponseAsync(resourceGroupName, clusterName, databaseName).toBlocking().single().body(); + } + + /** + * Returns a list of database principals of the given Kusto cluster and database. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto 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> listPrincipalsAsync(String resourceGroupName, String clusterName, String databaseName, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listPrincipalsWithServiceResponseAsync(resourceGroupName, clusterName, databaseName), serviceCallback); + } + + /** + * Returns a list of database principals of the given Kusto cluster and database. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<DatabasePrincipalInner> object + */ + public Observable> listPrincipalsAsync(String resourceGroupName, String clusterName, String databaseName) { + return listPrincipalsWithServiceResponseAsync(resourceGroupName, clusterName, databaseName).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Returns a list of database principals of the given Kusto cluster and database. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<DatabasePrincipalInner> object + */ + public Observable>> listPrincipalsWithServiceResponseAsync(String resourceGroupName, String clusterName, String databaseName) { + 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 (databaseName == null) { + throw new IllegalArgumentException("Parameter databaseName is 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.listPrincipals(resourceGroupName, clusterName, databaseName, 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 = listPrincipalsDelegate(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> listPrincipalsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Add Database principals permissions. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DatabasePrincipalListResultInner object if successful. + */ + public DatabasePrincipalListResultInner addPrincipals(String resourceGroupName, String clusterName, String databaseName) { + return addPrincipalsWithServiceResponseAsync(resourceGroupName, clusterName, databaseName).toBlocking().single().body(); + } + + /** + * Add Database principals permissions. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto 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 addPrincipalsAsync(String resourceGroupName, String clusterName, String databaseName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(addPrincipalsWithServiceResponseAsync(resourceGroupName, clusterName, databaseName), serviceCallback); + } + + /** + * Add Database principals permissions. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DatabasePrincipalListResultInner object + */ + public Observable addPrincipalsAsync(String resourceGroupName, String clusterName, String databaseName) { + return addPrincipalsWithServiceResponseAsync(resourceGroupName, clusterName, databaseName).map(new Func1, DatabasePrincipalListResultInner>() { + @Override + public DatabasePrincipalListResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Add Database principals permissions. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DatabasePrincipalListResultInner object + */ + public Observable> addPrincipalsWithServiceResponseAsync(String resourceGroupName, String clusterName, String databaseName) { + 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 (databaseName == null) { + throw new IllegalArgumentException("Parameter databaseName is 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 List value = null; + DatabasePrincipalListRequest databasePrincipalsToAdd = new DatabasePrincipalListRequest(); + databasePrincipalsToAdd.withValue(null); + return service.addPrincipals(resourceGroupName, clusterName, databaseName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), databasePrincipalsToAdd, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = addPrincipalsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Add Database principals permissions. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param value The list of Kusto database principals. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DatabasePrincipalListResultInner object if successful. + */ + public DatabasePrincipalListResultInner addPrincipals(String resourceGroupName, String clusterName, String databaseName, List value) { + return addPrincipalsWithServiceResponseAsync(resourceGroupName, clusterName, databaseName, value).toBlocking().single().body(); + } + + /** + * Add Database principals permissions. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param value The list of Kusto database principals. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture addPrincipalsAsync(String resourceGroupName, String clusterName, String databaseName, List value, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(addPrincipalsWithServiceResponseAsync(resourceGroupName, clusterName, databaseName, value), serviceCallback); + } + + /** + * Add Database principals permissions. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param value The list of Kusto database principals. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DatabasePrincipalListResultInner object + */ + public Observable addPrincipalsAsync(String resourceGroupName, String clusterName, String databaseName, List value) { + return addPrincipalsWithServiceResponseAsync(resourceGroupName, clusterName, databaseName, value).map(new Func1, DatabasePrincipalListResultInner>() { + @Override + public DatabasePrincipalListResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Add Database principals permissions. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param value The list of Kusto database principals. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DatabasePrincipalListResultInner object + */ + public Observable> addPrincipalsWithServiceResponseAsync(String resourceGroupName, String clusterName, String databaseName, List value) { + 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 (databaseName == null) { + throw new IllegalArgumentException("Parameter databaseName is 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(value); + DatabasePrincipalListRequest databasePrincipalsToAdd = new DatabasePrincipalListRequest(); + databasePrincipalsToAdd.withValue(value); + return service.addPrincipals(resourceGroupName, clusterName, databaseName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), databasePrincipalsToAdd, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = addPrincipalsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse addPrincipalsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Remove Database principals permissions. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DatabasePrincipalListResultInner object if successful. + */ + public DatabasePrincipalListResultInner removePrincipals(String resourceGroupName, String clusterName, String databaseName) { + return removePrincipalsWithServiceResponseAsync(resourceGroupName, clusterName, databaseName).toBlocking().single().body(); + } + + /** + * Remove Database principals permissions. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto 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 removePrincipalsAsync(String resourceGroupName, String clusterName, String databaseName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(removePrincipalsWithServiceResponseAsync(resourceGroupName, clusterName, databaseName), serviceCallback); + } + + /** + * Remove Database principals permissions. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DatabasePrincipalListResultInner object + */ + public Observable removePrincipalsAsync(String resourceGroupName, String clusterName, String databaseName) { + return removePrincipalsWithServiceResponseAsync(resourceGroupName, clusterName, databaseName).map(new Func1, DatabasePrincipalListResultInner>() { + @Override + public DatabasePrincipalListResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Remove Database principals permissions. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DatabasePrincipalListResultInner object + */ + public Observable> removePrincipalsWithServiceResponseAsync(String resourceGroupName, String clusterName, String databaseName) { + 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 (databaseName == null) { + throw new IllegalArgumentException("Parameter databaseName is 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 List value = null; + DatabasePrincipalListRequest databasePrincipalsToRemove = new DatabasePrincipalListRequest(); + databasePrincipalsToRemove.withValue(null); + return service.removePrincipals(resourceGroupName, clusterName, databaseName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), databasePrincipalsToRemove, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = removePrincipalsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Remove Database principals permissions. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param value The list of Kusto database principals. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DatabasePrincipalListResultInner object if successful. + */ + public DatabasePrincipalListResultInner removePrincipals(String resourceGroupName, String clusterName, String databaseName, List value) { + return removePrincipalsWithServiceResponseAsync(resourceGroupName, clusterName, databaseName, value).toBlocking().single().body(); + } + + /** + * Remove Database principals permissions. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param value The list of Kusto database principals. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture removePrincipalsAsync(String resourceGroupName, String clusterName, String databaseName, List value, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(removePrincipalsWithServiceResponseAsync(resourceGroupName, clusterName, databaseName, value), serviceCallback); + } + + /** + * Remove Database principals permissions. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param value The list of Kusto database principals. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DatabasePrincipalListResultInner object + */ + public Observable removePrincipalsAsync(String resourceGroupName, String clusterName, String databaseName, List value) { + return removePrincipalsWithServiceResponseAsync(resourceGroupName, clusterName, databaseName, value).map(new Func1, DatabasePrincipalListResultInner>() { + @Override + public DatabasePrincipalListResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Remove Database principals permissions. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param databaseName The name of the database in the Kusto cluster. + * @param value The list of Kusto database principals. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DatabasePrincipalListResultInner object + */ + public Observable> removePrincipalsWithServiceResponseAsync(String resourceGroupName, String clusterName, String databaseName, List value) { + 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 (databaseName == null) { + throw new IllegalArgumentException("Parameter databaseName is 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(value); + DatabasePrincipalListRequest databasePrincipalsToRemove = new DatabasePrincipalListRequest(); + databasePrincipalsToRemove.withValue(value); + return service.removePrincipals(resourceGroupName, clusterName, databaseName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), databasePrincipalsToRemove, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = removePrincipalsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse removePrincipalsDelegate(Response 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/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/implementation/DiagnoseVirtualNetworkResultImpl.java b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/implementation/DiagnoseVirtualNetworkResultImpl.java new file mode 100644 index 0000000000000..111683ad2226f --- /dev/null +++ b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/implementation/DiagnoseVirtualNetworkResultImpl.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.kusto.v2020_06_14.implementation; + +import com.microsoft.azure.management.kusto.v2020_06_14.DiagnoseVirtualNetworkResult; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.List; + +class DiagnoseVirtualNetworkResultImpl extends WrapperImpl implements DiagnoseVirtualNetworkResult { + private final KustoManager manager; + DiagnoseVirtualNetworkResultImpl(DiagnoseVirtualNetworkResultInner inner, KustoManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public KustoManager manager() { + return this.manager; + } + + @Override + public List findings() { + return this.inner().findings(); + } + +} diff --git a/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/implementation/DiagnoseVirtualNetworkResultInner.java b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/implementation/DiagnoseVirtualNetworkResultInner.java new file mode 100644 index 0000000000000..58ebb7a667bf6 --- /dev/null +++ b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/implementation/DiagnoseVirtualNetworkResultInner.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.kusto.v2020_06_14.implementation; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The DiagnoseVirtualNetworkResultInner model. + */ +public class DiagnoseVirtualNetworkResultInner { + /** + * The list of network connectivity diagnostic finding. + */ + @JsonProperty(value = "findings") + private List findings; + + /** + * Get the list of network connectivity diagnostic finding. + * + * @return the findings value + */ + public List findings() { + return this.findings; + } + + /** + * Set the list of network connectivity diagnostic finding. + * + * @param findings the findings value to set + * @return the DiagnoseVirtualNetworkResultInner object itself. + */ + public DiagnoseVirtualNetworkResultInner withFindings(List findings) { + this.findings = findings; + return this; + } + +} diff --git a/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/implementation/FollowerDatabaseDefinitionImpl.java b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/implementation/FollowerDatabaseDefinitionImpl.java new file mode 100644 index 0000000000000..8f60901cb6822 --- /dev/null +++ b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/implementation/FollowerDatabaseDefinitionImpl.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.kusto.v2020_06_14.implementation; + +import com.microsoft.azure.management.kusto.v2020_06_14.FollowerDatabaseDefinition; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; + +class FollowerDatabaseDefinitionImpl extends WrapperImpl implements FollowerDatabaseDefinition { + private final KustoManager manager; + FollowerDatabaseDefinitionImpl(FollowerDatabaseDefinitionInner inner, KustoManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public KustoManager manager() { + return this.manager; + } + + @Override + public String attachedDatabaseConfigurationName() { + return this.inner().attachedDatabaseConfigurationName(); + } + + @Override + public String clusterResourceId() { + return this.inner().clusterResourceId(); + } + + @Override + public String databaseName() { + return this.inner().databaseName(); + } + +} diff --git a/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/implementation/FollowerDatabaseDefinitionInner.java b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/implementation/FollowerDatabaseDefinitionInner.java new file mode 100644 index 0000000000000..c26a65c7b4c67 --- /dev/null +++ b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/implementation/FollowerDatabaseDefinitionInner.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.kusto.v2020_06_14.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * A class representing follower database request. + */ +public class FollowerDatabaseDefinitionInner { + /** + * Resource id of the cluster that follows a database owned by this + * cluster. + */ + @JsonProperty(value = "clusterResourceId", required = true) + private String clusterResourceId; + + /** + * Resource name of the attached database configuration in the follower + * cluster. + */ + @JsonProperty(value = "attachedDatabaseConfigurationName", required = true) + private String attachedDatabaseConfigurationName; + + /** + * The database name owned by this cluster that was followed. * in case + * following all databases. + */ + @JsonProperty(value = "databaseName", access = JsonProperty.Access.WRITE_ONLY) + private String databaseName; + + /** + * Get resource id of the cluster that follows a database owned by this cluster. + * + * @return the clusterResourceId value + */ + public String clusterResourceId() { + return this.clusterResourceId; + } + + /** + * Set resource id of the cluster that follows a database owned by this cluster. + * + * @param clusterResourceId the clusterResourceId value to set + * @return the FollowerDatabaseDefinitionInner object itself. + */ + public FollowerDatabaseDefinitionInner withClusterResourceId(String clusterResourceId) { + this.clusterResourceId = clusterResourceId; + return this; + } + + /** + * Get resource name of the attached database configuration in the follower cluster. + * + * @return the attachedDatabaseConfigurationName value + */ + public String attachedDatabaseConfigurationName() { + return this.attachedDatabaseConfigurationName; + } + + /** + * Set resource name of the attached database configuration in the follower cluster. + * + * @param attachedDatabaseConfigurationName the attachedDatabaseConfigurationName value to set + * @return the FollowerDatabaseDefinitionInner object itself. + */ + public FollowerDatabaseDefinitionInner withAttachedDatabaseConfigurationName(String attachedDatabaseConfigurationName) { + this.attachedDatabaseConfigurationName = attachedDatabaseConfigurationName; + return this; + } + + /** + * Get the database name owned by this cluster that was followed. * in case following all databases. + * + * @return the databaseName value + */ + public String databaseName() { + return this.databaseName; + } + +} diff --git a/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/implementation/IdParsingUtils.java b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/implementation/IdParsingUtils.java new file mode 100644 index 0000000000000..e417bd9bf497a --- /dev/null +++ b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/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.kusto.v2020_06_14.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/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/implementation/KustoManagementClientImpl.java b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/implementation/KustoManagementClientImpl.java new file mode 100644 index 0000000000000..437e0c19d2016 --- /dev/null +++ b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/implementation/KustoManagementClientImpl.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.kusto.v2020_06_14.implementation; + +import com.microsoft.azure.AzureClient; +import com.microsoft.azure.AzureServiceClient; +import com.microsoft.azure.LongRunningFinalState; +import com.microsoft.azure.LongRunningOperationOptions; +import com.microsoft.rest.credentials.ServiceClientCredentials; +import com.microsoft.rest.RestClient; + +/** + * Initializes a new instance of the KustoManagementClientImpl class. + */ +public class KustoManagementClientImpl 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 KustoManagementClientImpl 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 KustoManagementClientImpl 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 KustoManagementClientImpl 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 KustoManagementClientImpl 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 ClusterPrincipalAssignmentsInner object to access its operations. + */ + private ClusterPrincipalAssignmentsInner clusterPrincipalAssignments; + + /** + * Gets the ClusterPrincipalAssignmentsInner object to access its operations. + * @return the ClusterPrincipalAssignmentsInner object. + */ + public ClusterPrincipalAssignmentsInner clusterPrincipalAssignments() { + return this.clusterPrincipalAssignments; + } + + /** + * The DatabasesInner object to access its operations. + */ + private DatabasesInner databases; + + /** + * Gets the DatabasesInner object to access its operations. + * @return the DatabasesInner object. + */ + public DatabasesInner databases() { + return this.databases; + } + + /** + * The DatabasePrincipalAssignmentsInner object to access its operations. + */ + private DatabasePrincipalAssignmentsInner databasePrincipalAssignments; + + /** + * Gets the DatabasePrincipalAssignmentsInner object to access its operations. + * @return the DatabasePrincipalAssignmentsInner object. + */ + public DatabasePrincipalAssignmentsInner databasePrincipalAssignments() { + return this.databasePrincipalAssignments; + } + + /** + * The AttachedDatabaseConfigurationsInner object to access its operations. + */ + private AttachedDatabaseConfigurationsInner attachedDatabaseConfigurations; + + /** + * Gets the AttachedDatabaseConfigurationsInner object to access its operations. + * @return the AttachedDatabaseConfigurationsInner object. + */ + public AttachedDatabaseConfigurationsInner attachedDatabaseConfigurations() { + return this.attachedDatabaseConfigurations; + } + + /** + * The DataConnectionsInner object to access its operations. + */ + private DataConnectionsInner dataConnections; + + /** + * Gets the DataConnectionsInner object to access its operations. + * @return the DataConnectionsInner object. + */ + public DataConnectionsInner dataConnections() { + return this.dataConnections; + } + + /** + * 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 KustoManagementClient client. + * + * @param credentials the management credentials for Azure + */ + public KustoManagementClientImpl(ServiceClientCredentials credentials) { + this("https://management.azure.com", credentials); + } + + /** + * Initializes an instance of KustoManagementClient client. + * + * @param baseUrl the base URL of the host + * @param credentials the management credentials for Azure + */ + public KustoManagementClientImpl(String baseUrl, ServiceClientCredentials credentials) { + super(baseUrl, credentials); + initialize(); + } + + /** + * Initializes an instance of KustoManagementClient client. + * + * @param restClient the REST client to connect to Azure. + */ + public KustoManagementClientImpl(RestClient restClient) { + super(restClient); + initialize(); + } + + protected void initialize() { + this.apiVersion = "2020-06-14"; + this.acceptLanguage = "en-US"; + this.longRunningOperationRetryTimeout = 30; + this.generateClientRequestId = true; + this.clusters = new ClustersInner(restClient().retrofit(), this); + this.clusterPrincipalAssignments = new ClusterPrincipalAssignmentsInner(restClient().retrofit(), this); + this.databases = new DatabasesInner(restClient().retrofit(), this); + this.databasePrincipalAssignments = new DatabasePrincipalAssignmentsInner(restClient().retrofit(), this); + this.attachedDatabaseConfigurations = new AttachedDatabaseConfigurationsInner(restClient().retrofit(), this); + this.dataConnections = new DataConnectionsInner(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(), "KustoManagementClient", "2020-06-14"); + } +} diff --git a/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/implementation/KustoManager.java b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/implementation/KustoManager.java new file mode 100644 index 0000000000000..a9167a0fadb3b --- /dev/null +++ b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/implementation/KustoManager.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.kusto.v2020_06_14.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.kusto.v2020_06_14.Clusters; +import com.microsoft.azure.management.kusto.v2020_06_14.ClusterPrincipalAssignments; +import com.microsoft.azure.management.kusto.v2020_06_14.Databases; +import com.microsoft.azure.management.kusto.v2020_06_14.DatabasePrincipalAssignments; +import com.microsoft.azure.management.kusto.v2020_06_14.AttachedDatabaseConfigurations; +import com.microsoft.azure.management.kusto.v2020_06_14.DataConnections; +import com.microsoft.azure.management.kusto.v2020_06_14.Operations; +import com.microsoft.azure.arm.resources.implementation.AzureConfigurableCoreImpl; +import com.microsoft.azure.arm.resources.implementation.ManagerCore; + +/** + * Entry point to Azure Kusto resource management. + */ +public final class KustoManager extends ManagerCore { + private Clusters clusters; + private ClusterPrincipalAssignments clusterPrincipalAssignments; + private Databases databases; + private DatabasePrincipalAssignments databasePrincipalAssignments; + private AttachedDatabaseConfigurations attachedDatabaseConfigurations; + private DataConnections dataConnections; + private Operations operations; + /** + * Get a Configurable instance that can be used to create KustoManager with optional configuration. + * + * @return the instance allowing configurations + */ + public static Configurable configure() { + return new KustoManager.ConfigurableImpl(); + } + /** + * Creates an instance of KustoManager that exposes Kusto resource management API entry points. + * + * @param credentials the credentials to use + * @param subscriptionId the subscription UUID + * @return the KustoManager + */ + public static KustoManager authenticate(AzureTokenCredentials credentials, String subscriptionId) { + return new KustoManager(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 KustoManager that exposes Kusto resource management API entry points. + * + * @param restClient the RestClient to be used for API calls. + * @param subscriptionId the subscription UUID + * @return the KustoManager + */ + public static KustoManager authenticate(RestClient restClient, String subscriptionId) { + return new KustoManager(restClient, subscriptionId); + } + /** + * The interface allowing configurations to be set. + */ + public interface Configurable extends AzureConfigurable { + /** + * Creates an instance of KustoManager that exposes Kusto management API entry points. + * + * @param credentials the credentials to use + * @param subscriptionId the subscription UUID + * @return the interface exposing Kusto management API entry points that work across subscriptions + */ + KustoManager 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 ClusterPrincipalAssignments. + */ + public ClusterPrincipalAssignments clusterPrincipalAssignments() { + if (this.clusterPrincipalAssignments == null) { + this.clusterPrincipalAssignments = new ClusterPrincipalAssignmentsImpl(this); + } + return this.clusterPrincipalAssignments; + } + + /** + * @return Entry point to manage Databases. + */ + public Databases databases() { + if (this.databases == null) { + this.databases = new DatabasesImpl(this); + } + return this.databases; + } + + /** + * @return Entry point to manage DatabasePrincipalAssignments. + */ + public DatabasePrincipalAssignments databasePrincipalAssignments() { + if (this.databasePrincipalAssignments == null) { + this.databasePrincipalAssignments = new DatabasePrincipalAssignmentsImpl(this); + } + return this.databasePrincipalAssignments; + } + + /** + * @return Entry point to manage AttachedDatabaseConfigurations. + */ + public AttachedDatabaseConfigurations attachedDatabaseConfigurations() { + if (this.attachedDatabaseConfigurations == null) { + this.attachedDatabaseConfigurations = new AttachedDatabaseConfigurationsImpl(this); + } + return this.attachedDatabaseConfigurations; + } + + /** + * @return Entry point to manage DataConnections. + */ + public DataConnections dataConnections() { + if (this.dataConnections == null) { + this.dataConnections = new DataConnectionsImpl(this); + } + return this.dataConnections; + } + + /** + * @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 KustoManager authenticate(AzureTokenCredentials credentials, String subscriptionId) { + return KustoManager.authenticate(buildRestClient(credentials), subscriptionId); + } + } + private KustoManager(RestClient restClient, String subscriptionId) { + super( + restClient, + subscriptionId, + new KustoManagementClientImpl(restClient).withSubscriptionId(subscriptionId)); + } +} diff --git a/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/implementation/LanguageExtensionImpl.java b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/implementation/LanguageExtensionImpl.java new file mode 100644 index 0000000000000..841b9cab627bd --- /dev/null +++ b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/implementation/LanguageExtensionImpl.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.kusto.v2020_06_14.implementation; + +import com.microsoft.azure.management.kusto.v2020_06_14.LanguageExtension; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.kusto.v2020_06_14.LanguageExtensionName; + +class LanguageExtensionImpl extends WrapperImpl implements LanguageExtension { + private final KustoManager manager; + LanguageExtensionImpl(LanguageExtensionInner inner, KustoManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public KustoManager manager() { + return this.manager; + } + + @Override + public LanguageExtensionName languageExtensionName() { + return this.inner().languageExtensionName(); + } + +} diff --git a/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/implementation/LanguageExtensionInner.java b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/implementation/LanguageExtensionInner.java new file mode 100644 index 0000000000000..1c66a8db75f0a --- /dev/null +++ b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/implementation/LanguageExtensionInner.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.kusto.v2020_06_14.implementation; + +import com.microsoft.azure.management.kusto.v2020_06_14.LanguageExtensionName; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The language extension object. + */ +public class LanguageExtensionInner { + /** + * The language extension name. Possible values include: 'PYTHON', 'R'. + */ + @JsonProperty(value = "languageExtensionName") + private LanguageExtensionName languageExtensionName; + + /** + * Get the language extension name. Possible values include: 'PYTHON', 'R'. + * + * @return the languageExtensionName value + */ + public LanguageExtensionName languageExtensionName() { + return this.languageExtensionName; + } + + /** + * Set the language extension name. Possible values include: 'PYTHON', 'R'. + * + * @param languageExtensionName the languageExtensionName value to set + * @return the LanguageExtensionInner object itself. + */ + public LanguageExtensionInner withLanguageExtensionName(LanguageExtensionName languageExtensionName) { + this.languageExtensionName = languageExtensionName; + return this; + } + +} diff --git a/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/implementation/OperationImpl.java b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/implementation/OperationImpl.java new file mode 100644 index 0000000000000..b13563eaca650 --- /dev/null +++ b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/implementation/OperationImpl.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.kusto.v2020_06_14.implementation; + +import com.microsoft.azure.management.kusto.v2020_06_14.Operation; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.kusto.v2020_06_14.OperationDisplay; + +class OperationImpl extends WrapperImpl implements Operation { + private final KustoManager manager; + OperationImpl(OperationInner inner, KustoManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public KustoManager 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 Object properties() { + return this.inner().properties(); + } + +} diff --git a/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/implementation/OperationInner.java b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/implementation/OperationInner.java new file mode 100644 index 0000000000000..6c14ff777a01b --- /dev/null +++ b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/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.kusto.v2020_06_14.implementation; + +import com.microsoft.azure.management.kusto.v2020_06_14.OperationDisplay; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * A REST API operation. + */ +public class OperationInner { + /** + * The operation name. + * This is of the format {provider}/{resource}/{operation}. + */ + @JsonProperty(value = "name") + private String name; + + /** + * The object that describes the operation. + */ + @JsonProperty(value = "display") + private OperationDisplay display; + + /** + * The intended executor of the operation. + */ + @JsonProperty(value = "origin") + private String origin; + + /** + * Properties of the operation. + */ + @JsonProperty(value = "properties") + private Object properties; + + /** + * Get this is of the format {provider}/{resource}/{operation}. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set this is of the format {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 display value. + * + * @return the display value + */ + public OperationDisplay display() { + return this.display; + } + + /** + * Set the display value. + * + * @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 value. + * + * @return the origin value + */ + public String origin() { + return this.origin; + } + + /** + * Set the origin value. + * + * @param origin the origin value to set + * @return the OperationInner object itself. + */ + public OperationInner withOrigin(String origin) { + this.origin = origin; + return this; + } + + /** + * Get the properties value. + * + * @return the properties value + */ + public Object properties() { + return this.properties; + } + + /** + * Set the properties value. + * + * @param properties the properties value to set + * @return the OperationInner object itself. + */ + public OperationInner withProperties(Object properties) { + this.properties = properties; + return this; + } + +} diff --git a/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/implementation/OperationsImpl.java b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/implementation/OperationsImpl.java new file mode 100644 index 0000000000000..8280098013807 --- /dev/null +++ b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/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.kusto.v2020_06_14.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.kusto.v2020_06_14.Operations; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.kusto.v2020_06_14.Operation; + +class OperationsImpl extends WrapperImpl implements Operations { + private final KustoManager manager; + + OperationsImpl(KustoManager manager) { + super(manager.inner().operations()); + this.manager = manager; + } + + public KustoManager 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/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/implementation/OperationsInner.java b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/implementation/OperationsInner.java new file mode 100644 index 0000000000000..0b10fd4dd4d42 --- /dev/null +++ b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/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.kusto.v2020_06_14.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 KustoManagementClientImpl 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, KustoManagementClientImpl 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.kusto.v2020_06_14.Operations list" }) + @GET("providers/Microsoft.Kusto/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.kusto.v2020_06_14.Operations listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Lists available operations for the Microsoft.Kusto 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 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 available operations for the Microsoft.Kusto 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); + } + + /** + * Lists available operations for the Microsoft.Kusto provider. + * + * @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 available operations for the Microsoft.Kusto provider. + * + * @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 available operations for the Microsoft.Kusto provider. + * + * @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 CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists available operations for the Microsoft.Kusto provider. + * + * @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 available operations for the Microsoft.Kusto 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); + } + + /** + * Lists available operations for the Microsoft.Kusto 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<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 available operations for the Microsoft.Kusto 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<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 available operations for the Microsoft.Kusto 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<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/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/implementation/PageImpl.java b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/implementation/PageImpl.java new file mode 100644 index 0000000000000..b67de3e5437cb --- /dev/null +++ b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/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.kusto.v2020_06_14.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/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/implementation/PageImpl1.java b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/implementation/PageImpl1.java new file mode 100644 index 0000000000000..ca4fe0d945c21 --- /dev/null +++ b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/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.kusto.v2020_06_14.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("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 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/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/implementation/SkuDescriptionImpl.java b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/implementation/SkuDescriptionImpl.java new file mode 100644 index 0000000000000..08b36046a1fd4 --- /dev/null +++ b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/implementation/SkuDescriptionImpl.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.kusto.v2020_06_14.implementation; + +import com.microsoft.azure.management.kusto.v2020_06_14.SkuDescription; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.List; +import com.microsoft.azure.management.kusto.v2020_06_14.SkuLocationInfoItem; + +class SkuDescriptionImpl extends WrapperImpl implements SkuDescription { + private final KustoManager manager; + SkuDescriptionImpl(SkuDescriptionInner inner, KustoManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public KustoManager manager() { + return this.manager; + } + + @Override + public List locationInfo() { + return this.inner().locationInfo(); + } + + @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 tier() { + return this.inner().tier(); + } + +} diff --git a/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/implementation/SkuDescriptionInner.java b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/implementation/SkuDescriptionInner.java new file mode 100644 index 0000000000000..5d24b8196e3d1 --- /dev/null +++ b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/implementation/SkuDescriptionInner.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.kusto.v2020_06_14.implementation; + +import java.util.List; +import com.microsoft.azure.management.kusto.v2020_06_14.SkuLocationInfoItem; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The Kusto SKU description of given resource type. + */ +public class SkuDescriptionInner { + /** + * The resource type. + */ + @JsonProperty(value = "resourceType", access = JsonProperty.Access.WRITE_ONLY) + private String resourceType; + + /** + * The name of the SKU. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /** + * The tier of the SKU. + */ + @JsonProperty(value = "tier", access = JsonProperty.Access.WRITE_ONLY) + private String tier; + + /** + * The set of locations that the SKU is available. + */ + @JsonProperty(value = "locations", access = JsonProperty.Access.WRITE_ONLY) + private List locations; + + /** + * Locations and zones. + */ + @JsonProperty(value = "locationInfo", access = JsonProperty.Access.WRITE_ONLY) + private List locationInfo; + + /** + * The restrictions because of which SKU cannot be used. + */ + @JsonProperty(value = "restrictions", access = JsonProperty.Access.WRITE_ONLY) + private List restrictions; + + /** + * Get the resource type. + * + * @return the resourceType value + */ + public String resourceType() { + return this.resourceType; + } + + /** + * Get the name of the SKU. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Get the tier of the SKU. + * + * @return the tier value + */ + public String tier() { + return this.tier; + } + + /** + * Get the set of locations that the SKU is available. + * + * @return the locations value + */ + public List locations() { + return this.locations; + } + + /** + * Get locations and zones. + * + * @return the locationInfo value + */ + public List locationInfo() { + return this.locationInfo; + } + + /** + * Get the restrictions because of which SKU cannot be used. + * + * @return the restrictions value + */ + public List restrictions() { + return this.restrictions; + } + +} diff --git a/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/implementation/package-info.java b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/implementation/package-info.java new file mode 100644 index 0000000000000..1eab620a0fc31 --- /dev/null +++ b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/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 KustoManagementClient. + * The Azure Kusto management API provides a RESTful set of web services that interact with Azure Kusto services to manage your clusters and databases. The API enables you to create, update, and delete clusters and databases. + */ +package com.microsoft.azure.management.kusto.v2020_06_14.implementation; diff --git a/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/package-info.java b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/package-info.java new file mode 100644 index 0000000000000..b65f3fd6974c2 --- /dev/null +++ b/sdk/kusto/mgmt-v2020_06_14/src/main/java/com/microsoft/azure/management/kusto/v2020_06_14/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 KustoManagementClient. + * The Azure Kusto management API provides a RESTful set of web services that interact with Azure Kusto services to manage your clusters and databases. The API enables you to create, update, and delete clusters and databases. + */ +package com.microsoft.azure.management.kusto.v2020_06_14; diff --git a/sdk/kusto/pom.mgmt.xml b/sdk/kusto/pom.mgmt.xml index 6036052b5861d..11cb8dce534c2 100644 --- a/sdk/kusto/pom.mgmt.xml +++ b/sdk/kusto/pom.mgmt.xml @@ -14,5 +14,6 @@ mgmt-v2019_09_07 mgmt-v2019_11_09 mgmt-v2020_02_15 + mgmt-v2020_06_14 From d7797eaaaa5c4d8273f614beeb65959df70c6dd4 Mon Sep 17 00:00:00 2001 From: Xiaolu Dai <31124698+saragluna@users.noreply.github.com> Date: Mon, 13 Jul 2020 21:02:10 +0800 Subject: [PATCH 101/129] remove duplicate plugin definitions (#13086) Co-authored-by: Xiaolu Dai --- .../pom.xml | 49 ++++++++++++- .../pom.xml | 49 ++++++++++++- .../pom.xml | 49 ++++++++++++- .../pom.xml | 49 ++++++++++++- .../pom.xml | 68 ++++++++----------- .../azure-spring-boot-starter-metrics/pom.xml | 49 ++++++++++++- .../pom.xml | 49 ++++++++++++- 7 files changed, 310 insertions(+), 52 deletions(-) diff --git a/sdk/spring/azure-spring-boot-starter-active-directory-b2c/pom.xml b/sdk/spring/azure-spring-boot-starter-active-directory-b2c/pom.xml index e3c29d91fa49a..619eaf437442d 100644 --- a/sdk/spring/azure-spring-boot-starter-active-directory-b2c/pom.xml +++ b/sdk/spring/azure-spring-boot-starter-active-directory-b2c/pom.xml @@ -114,7 +114,7 @@ - + + empty-javadoc-jar-with-readme package @@ -155,6 +156,20 @@ ${project.basedir}/javadocTemp + + + + empty-sources-jar-with-readme + package + + jar + + + sources + ${project.basedir}/sourceTemp + + + @@ -181,9 +196,39 @@ run + + copy-readme-to-sourceTemp + prepare-package + + + Deleting existing ${project.basedir}/sourceTemp + + + + Copying ${project.basedir}/README.md to + ${project.basedir}/sourceTemp/README.md + + + + + + run + + + + + + org.apache.maven.plugins + maven-source-plugin + 3.0.1 + + + attach-sources + none + - + diff --git a/sdk/spring/azure-spring-boot-starter-active-directory/pom.xml b/sdk/spring/azure-spring-boot-starter-active-directory/pom.xml index 4a7746e1303c1..d085abe63501f 100644 --- a/sdk/spring/azure-spring-boot-starter-active-directory/pom.xml +++ b/sdk/spring/azure-spring-boot-starter-active-directory/pom.xml @@ -97,7 +97,7 @@ - + + empty-javadoc-jar-with-readme package @@ -138,6 +139,20 @@ ${project.basedir}/javadocTemp + + + + empty-sources-jar-with-readme + package + + jar + + + sources + ${project.basedir}/sourceTemp + + + @@ -164,9 +179,39 @@ run + + copy-readme-to-sourceTemp + prepare-package + + + Deleting existing ${project.basedir}/sourceTemp + + + + Copying ${project.basedir}/README.md to + ${project.basedir}/sourceTemp/README.md + + + + + + run + + + + + + org.apache.maven.plugins + maven-source-plugin + 3.0.1 + + + attach-sources + none + - + diff --git a/sdk/spring/azure-spring-boot-starter-cosmosdb/pom.xml b/sdk/spring/azure-spring-boot-starter-cosmosdb/pom.xml index c4c36f84f876c..1ae3acb700d3b 100644 --- a/sdk/spring/azure-spring-boot-starter-cosmosdb/pom.xml +++ b/sdk/spring/azure-spring-boot-starter-cosmosdb/pom.xml @@ -61,7 +61,7 @@ - + + empty-javadoc-jar-with-readme package @@ -102,6 +103,20 @@ ${project.basedir}/javadocTemp + + + + empty-sources-jar-with-readme + package + + jar + + + sources + ${project.basedir}/sourceTemp + + + @@ -128,9 +143,39 @@ run + + copy-readme-to-sourceTemp + prepare-package + + + Deleting existing ${project.basedir}/sourceTemp + + + + Copying ${project.basedir}/README.md to + ${project.basedir}/sourceTemp/README.md + + + + + + run + + + + + + org.apache.maven.plugins + maven-source-plugin + 3.0.1 + + + attach-sources + none + - + diff --git a/sdk/spring/azure-spring-boot-starter-data-gremlin/pom.xml b/sdk/spring/azure-spring-boot-starter-data-gremlin/pom.xml index ec9a83c551180..ea7b662333186 100644 --- a/sdk/spring/azure-spring-boot-starter-data-gremlin/pom.xml +++ b/sdk/spring/azure-spring-boot-starter-data-gremlin/pom.xml @@ -66,7 +66,7 @@ - + + empty-javadoc-jar-with-readme package @@ -107,6 +108,20 @@ ${project.basedir}/javadocTemp + + + + empty-sources-jar-with-readme + package + + jar + + + sources + ${project.basedir}/sourceTemp + + + @@ -133,9 +148,39 @@ run + + copy-readme-to-sourceTemp + prepare-package + + + Deleting existing ${project.basedir}/sourceTemp + + + + Copying ${project.basedir}/README.md to + ${project.basedir}/sourceTemp/README.md + + + + + + run + + + + + + org.apache.maven.plugins + maven-source-plugin + 3.0.1 + + + attach-sources + none + - + diff --git a/sdk/spring/azure-spring-boot-starter-keyvault-secrets/pom.xml b/sdk/spring/azure-spring-boot-starter-keyvault-secrets/pom.xml index f0286a675c3d4..cd77b00042bae 100644 --- a/sdk/spring/azure-spring-boot-starter-keyvault-secrets/pom.xml +++ b/sdk/spring/azure-spring-boot-starter-keyvault-secrets/pom.xml @@ -60,7 +60,7 @@ - + + empty-javadoc-jar-with-readme package @@ -101,6 +102,20 @@ ${project.basedir}/javadocTemp + + + + empty-sources-jar-with-readme + package + + jar + + + sources + ${project.basedir}/sourceTemp + + + @@ -127,44 +142,6 @@ run - - - - - - org.apache.maven.plugins - maven-source-plugin - 3.0.1 - - - attach-sources - none - - - - - org.apache.maven.plugins - maven-jar-plugin - 3.1.2 - - - empty-sources-jar-with-readme - package - - jar - - - sources - ${project.basedir}/sourceTemp - - - - - - org.apache.maven.plugins - maven-antrun-plugin - 1.8 - copy-readme-to-sourceTemp prepare-package @@ -186,7 +163,18 @@ - + + org.apache.maven.plugins + maven-source-plugin + 3.0.1 + + + attach-sources + none + + + + diff --git a/sdk/spring/azure-spring-boot-starter-metrics/pom.xml b/sdk/spring/azure-spring-boot-starter-metrics/pom.xml index 325298cb01630..d1403b8fb3370 100644 --- a/sdk/spring/azure-spring-boot-starter-metrics/pom.xml +++ b/sdk/spring/azure-spring-boot-starter-metrics/pom.xml @@ -68,7 +68,7 @@ - + + empty-javadoc-jar-with-readme package @@ -109,6 +110,20 @@ ${project.basedir}/javadocTemp + + + + empty-sources-jar-with-readme + package + + jar + + + sources + ${project.basedir}/sourceTemp + + + @@ -135,9 +150,39 @@ run + + copy-readme-to-sourceTemp + prepare-package + + + Deleting existing ${project.basedir}/sourceTemp + + + + Copying ${project.basedir}/README.md to + ${project.basedir}/sourceTemp/README.md + + + + + + run + + + + + + org.apache.maven.plugins + maven-source-plugin + 3.0.1 + + + attach-sources + none + - + diff --git a/sdk/spring/azure-spring-boot-starter-servicebus-jms/pom.xml b/sdk/spring/azure-spring-boot-starter-servicebus-jms/pom.xml index 984c7399811e3..c298114745ab3 100644 --- a/sdk/spring/azure-spring-boot-starter-servicebus-jms/pom.xml +++ b/sdk/spring/azure-spring-boot-starter-servicebus-jms/pom.xml @@ -64,7 +64,7 @@ - + + empty-javadoc-jar-with-readme package @@ -105,6 +106,20 @@ ${project.basedir}/javadocTemp + + + + empty-sources-jar-with-readme + package + + jar + + + sources + ${project.basedir}/sourceTemp + + + @@ -131,9 +146,39 @@ run + + copy-readme-to-sourceTemp + prepare-package + + + Deleting existing ${project.basedir}/sourceTemp + + + + Copying ${project.basedir}/README.md to + ${project.basedir}/sourceTemp/README.md + + + + + + run + + + + + + org.apache.maven.plugins + maven-source-plugin + 3.0.1 + + + attach-sources + none + - + From 65a33d301338183567004682deb2aa0918fd163b Mon Sep 17 00:00:00 2001 From: Sima Zhu <48036328+sima-zhu@users.noreply.github.com> Date: Mon, 13 Jul 2020 09:47:53 -0700 Subject: [PATCH 102/129] Fixed release date (#13087) --- sdk/search/azure-search-documents/CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/search/azure-search-documents/CHANGELOG.md b/sdk/search/azure-search-documents/CHANGELOG.md index 70b572b66079f..c4eebb16392bf 100644 --- a/sdk/search/azure-search-documents/CHANGELOG.md +++ b/sdk/search/azure-search-documents/CHANGELOG.md @@ -1,6 +1,6 @@ # Release History -## 11.0.0 (2020-07-10) +## 11.0.0 (2020-07-13) - Changed version to 11.0.0. - Removed preview version `SearchClientOptions.ServiceVersion.V2019_05_06_Preview` and added version `SearchClientOptions.ServiceVersion.V2020_06_30`. From acb8f131ce5acd48454585d3b751a8b099350579 Mon Sep 17 00:00:00 2001 From: Gauri Prasad <51212198+gapra-msft@users.noreply.github.com> Date: Mon, 13 Jul 2020 11:44:17 -0700 Subject: [PATCH 103/129] Fixed block issue and tier issue (#12978) --- .../azure-storage-blob-cryptography/pom.xml | 6 + .../EncryptedBlobAsyncClient.java | 78 +++---- .../specialized/cryptography/APISpec.groovy | 9 +- .../EncyptedBlockBlobAPITest.groovy | 6 +- .../cryptography/KeyvaultKeyTest.groovy | 144 ++++++++++++ .../cryptography/LocalKeyTest.groovy | 70 ++++++ .../KeyvaultKeyTestencryptionnotanoop.json | 192 +++++++++++++++ .../KeyvaultKeyTestuploaddownload.json | 219 ++++++++++++++++++ .../LocalKeyTestencryptionnotanoop.json | 84 +++++++ .../LocalKeyTestuploaddownload.json | 84 +++++++ sdk/storage/test-resources.json | 86 ++++++- 11 files changed, 931 insertions(+), 47 deletions(-) create mode 100644 sdk/storage/azure-storage-blob-cryptography/src/test/java/com/azure/storage/blob/specialized/cryptography/KeyvaultKeyTest.groovy create mode 100644 sdk/storage/azure-storage-blob-cryptography/src/test/java/com/azure/storage/blob/specialized/cryptography/LocalKeyTest.groovy create mode 100644 sdk/storage/azure-storage-blob-cryptography/src/test/resources/session-records/KeyvaultKeyTestencryptionnotanoop.json create mode 100644 sdk/storage/azure-storage-blob-cryptography/src/test/resources/session-records/KeyvaultKeyTestuploaddownload.json create mode 100644 sdk/storage/azure-storage-blob-cryptography/src/test/resources/session-records/LocalKeyTestencryptionnotanoop.json create mode 100644 sdk/storage/azure-storage-blob-cryptography/src/test/resources/session-records/LocalKeyTestuploaddownload.json diff --git a/sdk/storage/azure-storage-blob-cryptography/pom.xml b/sdk/storage/azure-storage-blob-cryptography/pom.xml index b2e855c8a33b9..cf1be11a813c5 100644 --- a/sdk/storage/azure-storage-blob-cryptography/pom.xml +++ b/sdk/storage/azure-storage-blob-cryptography/pom.xml @@ -98,6 +98,12 @@ 1.0.8 test + + com.azure + azure-security-keyvault-keys + 4.2.0-beta.5 + test + diff --git a/sdk/storage/azure-storage-blob-cryptography/src/main/java/com/azure/storage/blob/specialized/cryptography/EncryptedBlobAsyncClient.java b/sdk/storage/azure-storage-blob-cryptography/src/main/java/com/azure/storage/blob/specialized/cryptography/EncryptedBlobAsyncClient.java index f611c6c64caf9..e19ac54fc828b 100644 --- a/sdk/storage/azure-storage-blob-cryptography/src/main/java/com/azure/storage/blob/specialized/cryptography/EncryptedBlobAsyncClient.java +++ b/sdk/storage/azure-storage-blob-cryptography/src/main/java/com/azure/storage/blob/specialized/cryptography/EncryptedBlobAsyncClient.java @@ -252,7 +252,7 @@ public Mono> uploadWithResponse(Flux data, AccessTier tier, BlobRequestConditions requestConditions) { return this.uploadWithResponse(new BlobParallelUploadOptions(data) .setParallelTransferOptions(parallelTransferOptions).setHeaders(headers).setMetadata(metadata) - .setTier(AccessTier.HOT).setRequestConditions(requestConditions)); + .setTier(tier).setRequestConditions(requestConditions)); } /** @@ -443,24 +443,24 @@ Mono encryptBlob(Flux plainTextFlux) throws InvalidKe keyWrappingMetadata.put(CryptographyConstants.AGENT_METADATA_KEY, CryptographyConstants.AGENT_METADATA_VALUE); - return this.keyWrapper.wrapKey(keyWrapAlgorithm, aesKey.getEncoded()) - .map(encryptedKey -> { - WrappedKey wrappedKey = new WrappedKey( - this.keyWrapper.getKeyId().block(), encryptedKey, keyWrapAlgorithm); - - // Build EncryptionData - EncryptionData encryptionData = new EncryptionData() - .setEncryptionMode(CryptographyConstants.ENCRYPTION_MODE) - .setEncryptionAgent( - new EncryptionAgent(CryptographyConstants.ENCRYPTION_PROTOCOL_V1, - EncryptionAlgorithm.AES_CBC_256)) - .setKeyWrappingMetadata(keyWrappingMetadata) - .setContentEncryptionIV(cipher.getIV()) - .setWrappedContentKey(wrappedKey); - - // Encrypt plain text with content encryption key - Flux encryptedTextFlux = plainTextFlux.map(plainTextBuffer -> { - int outputSize = cipher.getOutputSize(plainTextBuffer.remaining()); + return this.keyWrapper.getKeyId().flatMap(keyId -> + this.keyWrapper.wrapKey(keyWrapAlgorithm, aesKey.getEncoded()) + .map(encryptedKey -> { + WrappedKey wrappedKey = new WrappedKey(keyId, encryptedKey, keyWrapAlgorithm); + + // Build EncryptionData + EncryptionData encryptionData = new EncryptionData() + .setEncryptionMode(CryptographyConstants.ENCRYPTION_MODE) + .setEncryptionAgent( + new EncryptionAgent(CryptographyConstants.ENCRYPTION_PROTOCOL_V1, + EncryptionAlgorithm.AES_CBC_256)) + .setKeyWrappingMetadata(keyWrappingMetadata) + .setContentEncryptionIV(cipher.getIV()) + .setWrappedContentKey(wrappedKey); + + // Encrypt plain text with content encryption key + Flux encryptedTextFlux = plainTextFlux.map(plainTextBuffer -> { + int outputSize = cipher.getOutputSize(plainTextBuffer.remaining()); /* This should be the only place we allocate memory in encryptBlob(). Although there is an @@ -468,33 +468,33 @@ This should be the only place we allocate memory in encryptBlob(). Although ther customer's memory, so we must allocate our own memory. If memory usage becomes unreasonable, we should implement pooling. */ - ByteBuffer encryptedTextBuffer = ByteBuffer.allocate(outputSize); - - int encryptedBytes; - try { - encryptedBytes = cipher.update(plainTextBuffer, encryptedTextBuffer); - } catch (ShortBufferException e) { - throw logger.logExceptionAsError(Exceptions.propagate(e)); - } - encryptedTextBuffer.position(0); - encryptedTextBuffer.limit(encryptedBytes); - return encryptedTextBuffer; - }); + ByteBuffer encryptedTextBuffer = ByteBuffer.allocate(outputSize); + + int encryptedBytes; + try { + encryptedBytes = cipher.update(plainTextBuffer, encryptedTextBuffer); + } catch (ShortBufferException e) { + throw logger.logExceptionAsError(Exceptions.propagate(e)); + } + encryptedTextBuffer.position(0); + encryptedTextBuffer.limit(encryptedBytes); + return encryptedTextBuffer; + }); /* Defer() ensures the contained code is not executed until the Flux is subscribed to, in other words, cipher.doFinal() will not be called until the plainTextFlux has completed and therefore all other data has been encrypted. */ - encryptedTextFlux = Flux.concat(encryptedTextFlux, Flux.defer(() -> { - try { - return Flux.just(ByteBuffer.wrap(cipher.doFinal())); - } catch (GeneralSecurityException e) { - throw logger.logExceptionAsError(Exceptions.propagate(e)); - } + encryptedTextFlux = Flux.concat(encryptedTextFlux, Flux.defer(() -> { + try { + return Flux.just(ByteBuffer.wrap(cipher.doFinal())); + } catch (GeneralSecurityException e) { + throw logger.logExceptionAsError(Exceptions.propagate(e)); + } + })); + return new EncryptedBlob(encryptionData, encryptedTextFlux); })); - return new EncryptedBlob(encryptionData, encryptedTextFlux); - }); } catch (NoSuchAlgorithmException | NoSuchPaddingException e) { // These are hardcoded and guaranteed to work. There is no reason to propogate a checked exception. throw logger.logExceptionAsError(new RuntimeException(e)); diff --git a/sdk/storage/azure-storage-blob-cryptography/src/test/java/com/azure/storage/blob/specialized/cryptography/APISpec.groovy b/sdk/storage/azure-storage-blob-cryptography/src/test/java/com/azure/storage/blob/specialized/cryptography/APISpec.groovy index de3aeaa590520..02055a4599968 100644 --- a/sdk/storage/azure-storage-blob-cryptography/src/test/java/com/azure/storage/blob/specialized/cryptography/APISpec.groovy +++ b/sdk/storage/azure-storage-blob-cryptography/src/test/java/com/azure/storage/blob/specialized/cryptography/APISpec.groovy @@ -19,6 +19,7 @@ import com.azure.core.test.utils.TestResourceNamer import com.azure.core.util.Configuration import com.azure.core.util.FluxUtil import com.azure.core.util.logging.ClientLogger +import com.azure.security.keyvault.keys.cryptography.models.KeyWrapAlgorithm import com.azure.storage.blob.BlobAsyncClient import com.azure.storage.blob.BlobClient import com.azure.storage.blob.BlobServiceClientBuilder @@ -88,7 +89,7 @@ class APISpec extends Specification { static def PREMIUM_STORAGE = "PREMIUM_STORAGE_" TestResourceNamer resourceNamer - private InterceptorManager interceptorManager + def InterceptorManager interceptorManager protected String testName // Fields used for conveniently creating blobs with data. @@ -229,8 +230,10 @@ class APISpec extends Specification { AsyncKeyEncryptionKeyResolver keyResolver, StorageSharedKeyCredential credential, String endpoint, HttpPipelinePolicy... policies) { + + KeyWrapAlgorithm algorithm = key != null && key.getKeyId().block() == "local" ? KeyWrapAlgorithm.A256KW : KeyWrapAlgorithm.RSA_OAEP_256 EncryptedBlobClientBuilder builder = new EncryptedBlobClientBuilder() - .key(key, "keyWrapAlgorithm") + .key(key, algorithm.toString()) .keyResolver(keyResolver) .endpoint(endpoint) .httpClient(getHttpClient()) @@ -277,7 +280,7 @@ class APISpec extends Specification { generateResourceName(containerPrefix, entityNo++) } - private String generateResourceName(String prefix, int entityNo) { + def String generateResourceName(String prefix, int entityNo) { return resourceNamer.randomName(prefix + testName + entityNo, 63) } diff --git a/sdk/storage/azure-storage-blob-cryptography/src/test/java/com/azure/storage/blob/specialized/cryptography/EncyptedBlockBlobAPITest.groovy b/sdk/storage/azure-storage-blob-cryptography/src/test/java/com/azure/storage/blob/specialized/cryptography/EncyptedBlockBlobAPITest.groovy index fbf00e8544060..27505b53e4de0 100644 --- a/sdk/storage/azure-storage-blob-cryptography/src/test/java/com/azure/storage/blob/specialized/cryptography/EncyptedBlockBlobAPITest.groovy +++ b/sdk/storage/azure-storage-blob-cryptography/src/test/java/com/azure/storage/blob/specialized/cryptography/EncyptedBlockBlobAPITest.groovy @@ -1201,10 +1201,8 @@ class EncyptedBlockBlobAPITest extends APISpec { Files.deleteIfExists(file.toPath()) expect: - def bac = new EncryptedBlobClientBuilder() - .key(fakeKey, "keyWrapAlgorithm") - .pipeline(ebc.getHttpPipeline()) - .endpoint(ebc.getBlobUrl()) + def bac = getEncryptedClientBuilder(fakeKey, null, primaryCredential, + ebc.getBlobUrl().toString()) .buildEncryptedBlobAsyncClient() /* diff --git a/sdk/storage/azure-storage-blob-cryptography/src/test/java/com/azure/storage/blob/specialized/cryptography/KeyvaultKeyTest.groovy b/sdk/storage/azure-storage-blob-cryptography/src/test/java/com/azure/storage/blob/specialized/cryptography/KeyvaultKeyTest.groovy new file mode 100644 index 0000000000000..76ed12e999dca --- /dev/null +++ b/sdk/storage/azure-storage-blob-cryptography/src/test/java/com/azure/storage/blob/specialized/cryptography/KeyvaultKeyTest.groovy @@ -0,0 +1,144 @@ +package com.azure.storage.blob.specialized.cryptography + + +import com.azure.core.credential.TokenCredential +import com.azure.core.cryptography.AsyncKeyEncryptionKey +import com.azure.core.http.HttpClient +import com.azure.core.http.HttpPipeline +import com.azure.core.http.HttpPipelineBuilder +import com.azure.core.http.policy.* +import com.azure.core.test.TestMode +import com.azure.core.util.Configuration +import com.azure.identity.ClientSecretCredentialBuilder +import com.azure.security.keyvault.keys.KeyClient +import com.azure.security.keyvault.keys.KeyClientBuilder +import com.azure.security.keyvault.keys.KeyServiceVersion +import com.azure.security.keyvault.keys.cryptography.KeyEncryptionKeyClientBuilder +import com.azure.security.keyvault.keys.models.CreateRsaKeyOptions +import com.azure.security.keyvault.keys.models.KeyVaultKey +import com.azure.storage.blob.BlobContainerClient +import com.azure.storage.common.implementation.Constants + +import java.time.Duration +import java.time.OffsetDateTime + +class KeyvaultKeyTest extends APISpec { + + BlobContainerClient cc + EncryptedBlobClient bec // encrypted client for download + KeyClient keyClient + String keyId + + def setup() { + def keyVaultUrl = "https://azstoragesdkvault.vault.azure.net/" + if (testMode != TestMode.PLAYBACK) { + keyVaultUrl = Configuration.getGlobalConfiguration().get("KEYVAULT_URL") + } + + keyClient = new KeyClientBuilder() + .pipeline(getHttpPipeline(getHttpClient(), KeyServiceVersion.V7_0)) + .httpClient(getHttpClient()) + .vaultUrl(keyVaultUrl) + .buildClient() + + keyId = generateResourceName("keyId", entityNo++) + + KeyVaultKey keyVaultKey = keyClient.createRsaKey(new CreateRsaKeyOptions(keyId) + .setExpiresOn(OffsetDateTime.now().plusYears(1)) + .setKeySize(2048)) + + AsyncKeyEncryptionKey akek = new KeyEncryptionKeyClientBuilder() + .pipeline(getHttpPipeline(getHttpClient(), KeyServiceVersion.V7_0)) + .httpClient(getHttpClient()) + .buildAsyncKeyEncryptionKey(keyVaultKey.getId()) + .block() + + cc = getServiceClientBuilder(primaryCredential, + String.format(defaultEndpointTemplate, primaryCredential.getAccountName())) + .buildClient() + .getBlobContainerClient(generateContainerName()) + cc.create() + + bec = getEncryptedClientBuilder(akek, null, primaryCredential, + cc.getBlobContainerUrl().toString()) + .blobName(generateBlobName()) + .buildEncryptedBlobClient() + } + + def cleanup() { + keyClient.beginDeleteKey(keyId) + } + + def "upload download"() { + setup: + def inputArray = getRandomByteArray(Constants.KB) + InputStream stream = new ByteArrayInputStream(inputArray) + def os = new ByteArrayOutputStream() + + when: + bec.upload(stream, Constants.KB) + bec.download(os) + + then: + inputArray == os.toByteArray() + } + + + def "encryption not a noop"() { + setup: + def inputArray = getRandomByteArray(Constants.KB) + InputStream stream = new ByteArrayInputStream(inputArray) + def os = new ByteArrayOutputStream() + + when: + bec.upload(stream, Constants.KB) + cc.getBlobClient(bec.getBlobName()).download(os) + + then: + inputArray != os.toByteArray() + } + + HttpPipeline getHttpPipeline(HttpClient httpClient, KeyServiceVersion serviceVersion) { + TokenCredential credential = null; + + if (!interceptorManager.isPlaybackMode()) { + String clientId = System.getenv("AZURE_CLIENT_ID"); + String clientKey = System.getenv("AZURE_CLIENT_SECRET"); + String tenantId = System.getenv("AZURE_TENANT_ID"); + Objects.requireNonNull(clientId, "The client id cannot be null"); + Objects.requireNonNull(clientKey, "The client key cannot be null"); + Objects.requireNonNull(tenantId, "The tenant id cannot be null"); + credential = new ClientSecretCredentialBuilder() + .clientSecret(clientKey) + .clientId(clientId) + .tenantId(tenantId) + .build(); + } + + // Closest to API goes first, closest to wire goes last. + final List policies = new ArrayList<>(); + policies.add(new UserAgentPolicy("client_name", "client_version", Configuration.getGlobalConfiguration().clone(), serviceVersion)); + HttpPolicyProviders.addBeforeRetryPolicies(policies); + RetryStrategy strategy = new ExponentialBackoff(5, Duration.ofSeconds(2), Duration.ofSeconds(16)); + policies.add(new RetryPolicy(strategy)); + if (credential != null) { + policies.add(new BearerTokenAuthenticationPolicy(credential, "https://vault.azure.net/.default")); + } + HttpPolicyProviders.addAfterRetryPolicies(policies); + policies.add(new HttpLoggingPolicy(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BODY_AND_HEADERS))); + + if (!interceptorManager.isPlaybackMode()) { + if (testMode == TestMode.RECORD) { + policies.add(interceptorManager.getRecordPolicy()); + } + } + + HttpPipeline pipeline = new HttpPipelineBuilder() + .policies(policies.toArray(new HttpPipelinePolicy[0])) + .httpClient(httpClient == null ? interceptorManager.getPlaybackClient() : httpClient) + .build() + + return pipeline; + } + +} diff --git a/sdk/storage/azure-storage-blob-cryptography/src/test/java/com/azure/storage/blob/specialized/cryptography/LocalKeyTest.groovy b/sdk/storage/azure-storage-blob-cryptography/src/test/java/com/azure/storage/blob/specialized/cryptography/LocalKeyTest.groovy new file mode 100644 index 0000000000000..51ceff2b77320 --- /dev/null +++ b/sdk/storage/azure-storage-blob-cryptography/src/test/java/com/azure/storage/blob/specialized/cryptography/LocalKeyTest.groovy @@ -0,0 +1,70 @@ +package com.azure.storage.blob.specialized.cryptography + +import com.azure.core.cryptography.AsyncKeyEncryptionKey +import com.azure.security.keyvault.keys.cryptography.LocalKeyEncryptionKeyClientBuilder +import com.azure.security.keyvault.keys.models.JsonWebKey +import com.azure.security.keyvault.keys.models.KeyOperation +import com.azure.storage.blob.BlobContainerClient +import com.azure.storage.common.implementation.Constants + +import javax.crypto.spec.SecretKeySpec + +class LocalKeyTest extends APISpec { + + BlobContainerClient cc + EncryptedBlobClient bec // encrypted client for download + + def setup() { + + /* Insecurely generate a local key*/ + def byteKey = getRandomByteArray(256) + + JsonWebKey localKey = JsonWebKey.fromAes(new SecretKeySpec(byteKey, "AES"), + Arrays.asList(KeyOperation.WRAP_KEY, KeyOperation.UNWRAP_KEY)) + .setId("local") + AsyncKeyEncryptionKey akek = new LocalKeyEncryptionKeyClientBuilder() + .buildAsyncKeyEncryptionKey(localKey) + .block(); + + cc = getServiceClientBuilder(primaryCredential, + String.format(defaultEndpointTemplate, primaryCredential.getAccountName())) + .buildClient() + .getBlobContainerClient(generateContainerName()) + cc.create() + + bec = getEncryptedClientBuilder(akek, null, primaryCredential, + cc.getBlobContainerUrl().toString()) + .blobName(generateBlobName()) + .buildEncryptedBlobClient() + } + + def "upload download"() { + setup: + def inputArray = getRandomByteArray(Constants.KB) + InputStream stream = new ByteArrayInputStream(inputArray) + def os = new ByteArrayOutputStream() + + when: + bec.upload(stream, Constants.KB) + bec.download(os) + + then: + inputArray == os.toByteArray() + } + + + def "encryption not a noop"() { + setup: + def inputArray = getRandomByteArray(Constants.KB) + InputStream stream = new ByteArrayInputStream(inputArray) + def os = new ByteArrayOutputStream() + + when: + bec.upload(stream, Constants.KB) + cc.getBlobClient(bec.getBlobName()).download(os) + + then: + inputArray != os.toByteArray() + } + +} diff --git a/sdk/storage/azure-storage-blob-cryptography/src/test/resources/session-records/KeyvaultKeyTestencryptionnotanoop.json b/sdk/storage/azure-storage-blob-cryptography/src/test/resources/session-records/KeyvaultKeyTestencryptionnotanoop.json new file mode 100644 index 0000000000000..04c35a9bcbda6 --- /dev/null +++ b/sdk/storage/azure-storage-blob-cryptography/src/test/resources/session-records/KeyvaultKeyTestencryptionnotanoop.json @@ -0,0 +1,192 @@ +{ + "networkCallRecords" : [ { + "Method" : "POST", + "Uri" : "https://REDACTED.vault.azure.net/keys/keyidencryptionnotanoop047803044603746e214892b/create?api-version=7.1-preview", + "Headers" : { + "User-Agent" : "azsdk-java-client_name/client_version (11.0.7; Windows 10; 10.0)", + "Content-Type" : "application/json" + }, + "Response" : { + "X-Content-Type-Options" : "nosniff", + "Pragma" : "no-cache", + "retry-after" : "0", + "StatusCode" : "200", + "Date" : "Mon, 13 Jul 2020 18:00:18 GMT", + "Strict-Transport-Security" : "max-age=31536000;includeSubDomains", + "Cache-Control" : "no-cache", + "X-AspNet-Version" : "4.0.30319", + "x-ms-keyvault-region" : "eastus", + "x-ms-keyvault-network-info" : "conn_type=Ipv4;addr=174.127.246.93;act_addr_fam=InterNetwork;", + "Expires" : "-1", + "Content-Length" : "720", + "x-ms-request-id" : "7d6548b5-0e3a-4c13-80e0-352c9cbf2a0b", + "x-ms-keyvault-service-version" : "1.1.8.0", + "Body" : "{\"key\":{\"kid\":\"https://ceciliakeys.vault.azure.net/keys/keyidencryptionnotanoop047803044603746e214892b/e0a5c2e4308f484cbe46e7ec8bbf2f52\",\"kty\":\"RSA\",\"key_ops\":[\"encrypt\",\"decrypt\",\"sign\",\"verify\",\"wrapKey\",\"unwrapKey\"],\"n\":\"uBnP5BN7G2udE55UQBHutohk7mT_ew5uvvN7tmpyrJzPulJp4zyF6ir9VRekLLPGIIslU_t85CQ4Ci3M_ED001yW7F_VMIOf9y3S6GmRwFZdq7mEN1LemQGcnIfRCt2_WwbyEYkBGbWCJ-jHYka3e-Vi_eDh6o8Df0PgS_xpMBq-0XHwJkH6mqNQ33fq1qL25WkU8SrXLMI43v4brvi-hIjkc2WbQ-_6NKvo2QCahz334Z0g2us2RYuU7X5hya17_z352qAc2yhFE5dM3h5-oDFo6nrzA0kmeI7IZDl2Lhsxfn-XMSr9Yj_tLoinEYNmcOD94RUq7Z9tvsjdemkTAQ\",\"e\":\"AQAB\"},\"attributes\":{\"enabled\":true,\"exp\":1626199217,\"created\":1594663219,\"updated\":1594663219,\"recoveryLevel\":\"Recoverable\",\"recoverableDays\":90}}", + "X-Powered-By" : "ASP.NET", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcencryptionnotanoop171244ed5268a26698440d99?restype=container", + "Headers" : { + "x-ms-version" : "2019-12-12", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.2 (11.0.7; Windows 10; 10.0)", + "x-ms-client-request-id" : "653dc3b9-d785-4b51-bb69-252618de76b3" + }, + "Response" : { + "x-ms-version" : "2019-12-12", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "ETag" : "0x8D827569B29F86C", + "Last-Modified" : "Mon, 13 Jul 2020 18:00:19 GMT", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "27296606-e01e-0036-023f-591cf2000000", + "Date" : "Mon, 13 Jul 2020 18:00:19 GMT", + "x-ms-client-request-id" : "653dc3b9-d785-4b51-bb69-252618de76b3" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.vault.azure.net/keys/keyidencryptionnotanoop047803044603746e214892b/e0a5c2e4308f484cbe46e7ec8bbf2f52?api-version=7.1-preview", + "Headers" : { + "User-Agent" : "azsdk-java-client_name/client_version (11.0.7; Windows 10; 10.0)", + "Content-Type" : "application/json" + }, + "Response" : { + "X-Content-Type-Options" : "nosniff", + "Pragma" : "no-cache", + "retry-after" : "0", + "StatusCode" : "200", + "Date" : "Mon, 13 Jul 2020 18:00:20 GMT", + "Strict-Transport-Security" : "max-age=31536000;includeSubDomains", + "Cache-Control" : "no-cache", + "X-AspNet-Version" : "4.0.30319", + "x-ms-keyvault-region" : "eastus", + "x-ms-keyvault-network-info" : "conn_type=Ipv4;addr=174.127.246.93;act_addr_fam=InterNetwork;", + "Expires" : "-1", + "Content-Length" : "720", + "x-ms-request-id" : "67c51823-d43d-461e-93f6-e4501887dceb", + "x-ms-keyvault-service-version" : "1.1.8.0", + "Body" : "{\"key\":{\"kid\":\"https://ceciliakeys.vault.azure.net/keys/keyidencryptionnotanoop047803044603746e214892b/e0a5c2e4308f484cbe46e7ec8bbf2f52\",\"kty\":\"RSA\",\"key_ops\":[\"encrypt\",\"decrypt\",\"sign\",\"verify\",\"wrapKey\",\"unwrapKey\"],\"n\":\"uBnP5BN7G2udE55UQBHutohk7mT_ew5uvvN7tmpyrJzPulJp4zyF6ir9VRekLLPGIIslU_t85CQ4Ci3M_ED001yW7F_VMIOf9y3S6GmRwFZdq7mEN1LemQGcnIfRCt2_WwbyEYkBGbWCJ-jHYka3e-Vi_eDh6o8Df0PgS_xpMBq-0XHwJkH6mqNQ33fq1qL25WkU8SrXLMI43v4brvi-hIjkc2WbQ-_6NKvo2QCahz334Z0g2us2RYuU7X5hya17_z352qAc2yhFE5dM3h5-oDFo6nrzA0kmeI7IZDl2Lhsxfn-XMSr9Yj_tLoinEYNmcOD94RUq7Z9tvsjdemkTAQ\",\"e\":\"AQAB\"},\"attributes\":{\"enabled\":true,\"exp\":1626199217,\"created\":1594663219,\"updated\":1594663219,\"recoveryLevel\":\"Recoverable\",\"recoverableDays\":90}}", + "X-Powered-By" : "ASP.NET", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "POST", + "Uri" : "https://REDACTED.vault.azure.net/keys/keyidencryptionnotanoop047803044603746e214892b/e0a5c2e4308f484cbe46e7ec8bbf2f52/wrapkey?api-version=7.1-preview", + "Headers" : { + "User-Agent" : "azsdk-java-client_name/client_version (11.0.7; Windows 10; 10.0)", + "Content-Type" : "application/json" + }, + "Response" : { + "X-Content-Type-Options" : "nosniff", + "Pragma" : "no-cache", + "retry-after" : "0", + "StatusCode" : "200", + "Date" : "Mon, 13 Jul 2020 18:00:20 GMT", + "Strict-Transport-Security" : "max-age=31536000;includeSubDomains", + "Cache-Control" : "no-cache", + "X-AspNet-Version" : "4.0.30319", + "x-ms-keyvault-region" : "eastus", + "x-ms-keyvault-network-info" : "conn_type=Ipv4;addr=174.127.246.93;act_addr_fam=InterNetwork;", + "Expires" : "-1", + "Content-Length" : "483", + "x-ms-request-id" : "1b5f886f-761b-47ef-b1e0-0ad07f40147c", + "x-ms-keyvault-service-version" : "1.1.8.0", + "Body" : "{\"kid\":\"https://ceciliakeys.vault.azure.net/keys/keyidencryptionnotanoop047803044603746e214892b/e0a5c2e4308f484cbe46e7ec8bbf2f52\",\"value\":\"TnHszga0jtMgVrILwAfD7RHkCSVob7dBbjzbIYBzBZENjRZpK8pg6RdTMOQjjGjeJ7vQa4a6sMzi6QZAXEqCaZBxAmCI9Gki9kzyhDB7iQsezgxVXFXwgbP5l0losyloC-LZ8oj2R4q3_piwn2TzOp5_aSFZEXJg2RKk1uChTs5Z1wJKzvFzU9kFm6TamkZV8nugUdXyKCWnEdr9SC-8K4Enzd12-x-y6dDhvIAfBtxMhHogRzjs_nFkVOH-51d0XoWOzT5RECuAC31qM2_r7jO3fEc5nkuj2d1CccLidRw_t9xE8C_Q3hH4A3Dr9Jgj_ssm-F6-OL6z_H2aP3DeMQ\"}", + "X-Powered-By" : "ASP.NET", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcencryptionnotanoop171244ed5268a26698440d99/javablobencryptionnotanoop27156640b9d246514c436", + "Headers" : { + "x-ms-version" : "2019-12-12", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.2 (11.0.7; Windows 10; 10.0)", + "x-ms-client-request-id" : "62c86199-fe16-4e78-bbca-9393439c2424", + "Content-Type" : "application/octet-stream" + }, + "Response" : { + "x-ms-version" : "2019-12-12", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-content-crc64" : "3Ov9JQRxFMU=", + "x-ms-version-id" : "2020-07-13T18:00:21.3119819Z", + "Last-Modified" : "Mon, 13 Jul 2020 18:00:21 GMT", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-server-encrypted" : "true", + "Date" : "Mon, 13 Jul 2020 18:00:21 GMT", + "Content-MD5" : "Vd6Vxx1qJiYdOrMi/Gd+Yw==", + "ETag" : "0x8D827569C22C34B", + "Content-Length" : "0", + "x-ms-request-id" : "47f93a42-601e-0017-403f-593889000000", + "x-ms-client-request-id" : "62c86199-fe16-4e78-bbca-9393439c2424" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcencryptionnotanoop171244ed5268a26698440d99/javablobencryptionnotanoop27156640b9d246514c436", + "Headers" : { + "x-ms-version" : "2019-12-12", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.2 (11.0.7; Windows 10; 10.0)", + "x-ms-client-request-id" : "a74bd53c-9dc2-4a62-85fc-c645266cd672" + }, + "Response" : { + "x-ms-is-current-version" : "true", + "x-ms-version" : "2019-12-12", + "x-ms-lease-status" : "unlocked", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-lease-state" : "available", + "x-ms-version-id" : "2020-07-13T18:00:21.3119819Z", + "Last-Modified" : "Mon, 13 Jul 2020 18:00:21 GMT", + "retry-after" : "0", + "StatusCode" : "200", + "Date" : "Mon, 13 Jul 2020 18:00:21 GMT", + "x-ms-blob-type" : "BlockBlob", + "Content-MD5" : "Vd6Vxx1qJiYdOrMi/Gd+Yw==", + "Accept-Ranges" : "bytes", + "x-ms-meta-encryptiondata" : "{\"EncryptionMode\":\"FullBlob\",\"WrappedContentKey\":{\"KeyId\":\"https://ceciliakeys.vault.azure.net/keys/keyidencryptionnotanoop047803044603746e214892b/e0a5c2e4308f484cbe46e7ec8bbf2f52\",\"EncryptedKey\":\"TnHszga0jtMgVrILwAfD7RHkCSVob7dBbjzbIYBzBZENjRZpK8pg6RdTMOQjjGjeJ7vQa4a6sMzi6QZAXEqCaZBxAmCI9Gki9kzyhDB7iQsezgxVXFXwgbP5l0losyloC+LZ8oj2R4q3/piwn2TzOp5/aSFZEXJg2RKk1uChTs5Z1wJKzvFzU9kFm6TamkZV8nugUdXyKCWnEdr9SC+8K4Enzd12+x+y6dDhvIAfBtxMhHogRzjs/nFkVOH+51d0XoWOzT5RECuAC31qM2/r7jO3fEc5nkuj2d1CccLidRw/t9xE8C/Q3hH4A3Dr9Jgj/ssm+F6+OL6z/H2aP3DeMQ==\",\"Algorithm\":\"RSA-OAEP-256\"},\"EncryptionAgent\":{\"Protocol\":\"1.0\",\"EncryptionAlgorithm\":\"AES_CBC_256\"},\"ContentEncryptionIV\":\"8/VZpyje4/1Dk3wyopvv/w==\",\"KeyWrappingMetadata\":{\"EncryptionLibrary\":\"JavaTrack212.8.0-beta.2\"}}", + "x-ms-server-encrypted" : "true", + "ETag" : "0x8D827569C22C34B", + "x-ms-creation-time" : "Mon, 13 Jul 2020 18:00:21 GMT", + "Content-Length" : "1040", + "x-ms-request-id" : "fb82267b-501e-001c-403f-59c3e2000000", + "Body" : "[-65, 116, 7, -122, -101, -92, -29, 17, 86, 26, 118, -91, 108, 57, -6, 77, 93, -70, -17, 1, -75, -103, -123, -105, 51, 59, 44, 51, 43, 10, -3, 52, 124, 63, -26, -3, 35, -54, 127, 33, -115, 94, -101, -92, 10, -113, -38, -121, -117, -6, -67, 69, -41, 19, 28, 92, -14, -125, 114, 13, -73, -106, -121, 110, 118, 32, -61, -65, -89, 18, -98, 102, -128, -41, -34, 127, -16, -14, -97, 75, -79, 18, -1, 119, 3, 124, 29, -10, -36, 36, 97, -61, -106, -54, 39, -123, -127, -56, 30, 61, 88, 108, -36, 57, -14, 76, 110, 99, -14, -18, 109, -76, -28, -42, -18, -54, -94, 29, 28, 93, 6, 46, -86, -76, 104, -58, -12, 63, -121, -26, -2, -82, -68, 117, 125, 126, 87, -26, -70, 83, -116, -105, -32, 39, -52, -50, 29, 44, 41, 68, -107, 105, 36, 98, -115, -46, 13, 19, -60, 104, 108, 57, 120, -117, -38, 54, 24, 120, -52, -7, 23, 78, -1, 126, 122, -32, -90, 23, -67, -17, 124, -64, 35, 122, 105, 102, -47, -127, 79, -54, 103, 109, 45, -21, 124, 73, -1, 53, 94, -71, -31, 58, -13, 110, 91, 53, 112, -112, 89, -65, -63, -95, -13, -35, -114, -52, -27, -87, 56, -3, -76, 104, -81, -74, 35, -19, 6, 108, 107, -83, -28, 76, -79, 32, 57, 12, 37, -25, -64, -122, -96, 60, -4, 0, -65, -117, 114, -106, 91, 57, 37, 73, -14, -37, 55, -43, 87, 103, -59, -126, -26, -17, 107, 102, 96, -94, -60, -124, -103, -96, 91, -104, 74, 10, 43, 92, -107, -113, -57, 41, 120, -28, 118, 9, 123, -3, 44, 26, -65, -40, -114, 81, -98, -89, -117, 102, -104, -31, 51, 13, -13, -35, 48, -88, -37, -122, -63, 47, 102, 118, -79, 103, 127, 42, 117, 125, -91, -32, 33, -96, -5, 57, -103, -4, -87, -51, 115, -75, -114, 60, -116, -21, -116, -62, -98, 127, 115, 10, -40, -119, 20, -47, -35, 44, -63, 4, 15, 83, -78, 56, -76, -8, 2, -92, -77, -56, 117, 46, -29, -103, 19, -122, 123, 105, 104, 107, -95, -61, 100, 29, -75, 125, 36, -103, -14, -36, 34, 113, -9, -76, -14, -41, -52, 126, 99, 74, -31, 7, 100, -63, 35, -57, -59, -121, -70, -72, -97, -61, 58, 99, 44, 58, 24, 42, -47, -58, 56, 88, 94, 58, 34, -26, -32, -20, -43, -13, -76, 26, 79, -106, -1, 72, 42, 55, 97, -104, 112, -113, 70, -112, 90, -53, 57, -111, -120, -117, -103, 13, 49, 63, -116, -80, -61, -82, 124, 103, -16, 104, -68, 45, -50, -75, 16, 113, 10, 80, 79, -44, -40, -92, 28, 5, 53, -128, 114, -69, 7, 15, -6, 111, 5, 62, 123, 52, 124, 68, -54, 65, 76, 13, -76, -21, -96, 68, 73, -14, -107, 79, -3, 112, 67, -63, -27, 74, 49, -107, -63, -18, 81, 30, 109, -70, -125, 26, 107, -117, -46, 57, -44, -52, 123, -34, 121, 34, -117, -61, -8, -69, 26, -112, -14, -107, -37, -108, -16, -118, 17, -109, -78, -123, -63, -58, 31, 22, 12, 103, 105, 114, -30, 34, -100, -110, -49, -69, -57, -120, -63, -119, 117, -45, -88, 122, 3, -6, 66, 1, -110, -99, 115, 87, 58, -47, -19, 39, -119, -32, -38, 36, 64, 41, -87, 59, -62, 37, -93, 125, -19, 89, -66, -37, -70, -21, -18, -4, 79, -56, 21, 63, 124, 24, 71, -68, 98, 2, -41, -3, 30, 109, 64, 83, -4, 51, -2, 16, 30, -1, -57, -107, 21, 30, 12, -10, 60, 76, -69, 116, -82, -46, 2, 115, 69, -10, 110, 104, 9, 57, -75, -78, 114, 93, 4, 104, -4, 109, -104, -126, -123, 124, 67, 97, -28, -61, 39, -117, -18, 26, 112, -6, -74, -86, -18, -94, 57, 105, 56, -68, -118, -110, 123, -72, -23, -27, -63, 112, -46, -23, 124, 2, 62, 79, -50, -79, -26, 116, -111, 94, 98, 69, -88, 78, 87, 104, -24, -76, -109, -101, -116, -128, 75, -25, -115, 2, -45, 100, 48, -118, 113, 6, 3, -52, 124, 68, -26, 96, 13, 29, -48, 59, 7, -37, -51, 90, -66, 3, -117, -2, 126, -50, -83, -58, 1, 122, 40, -79, 16, 1, -42, -8, -29, 51, -37, 89, -92, 24, 91, 91, 76, -10, 10, -81, -63, -122, 124, -104, 76, -128, 19, -68, 124, -113, -83, -100, 98, 123, -14, 120, 10, -95, -2, 86, 36, 33, -124, -39, 26, -19, 123, -65, -46, -101, -27, -113, -42, -46, 73, 34, -28, 4, 23, -12, -49, 110, 103, 77, 6, 19, -11, -26, 94, 93, 101, 109, 66, -6, 93, 23, 6, -50, 24, -69, 38, 79, -78, -47, 68, 64, -117, -107, -23, -33, -52, 100, -104, -55, -45, -93, -87, 2, -103, -12, 49, -77, 69, 29, -18, 89, -100, 62, -92, -44, -113, 53, -91, -108, 68, -109, -34, -64, 102, 125, -4, -11, 6, -126, 42, -82, 31, 77, -69, 10, -72, 117, 53, 3, -54, -4, -9, 41, 48, -23, -19, -14, -32, 8, 92, -120, -81, -88, 79, 47, 5, 110, -48, 109, 84, -51, -11, 102, 15, 76, 38, 121, 31, 45, -118, -38, 58, -99, 123, -69, 56, -116, 4, 126, -67, 8, 120, -124, 68, 8, -120, -18, 92, 124, 44, 15, 73, -87, -76, -72, 17, 29, 104, 87, 38, -26, -71, 94, -88, -68, 20, -127, 26, 64, -51, 98, 97, 37, 121, 83, -36, -107, 122, -106, -15, 35, -88, 107, -93, -3, -100, -43, -83, -20, -63, 121, 24, -75, 58, -12, 91, 91, -120, -116, 19, -107, -41, -71, 75, -18, -28, -110, -80, -95, -32, 122, 127, -83, 43, 5, 115, 104, 101, 45, -99, 7, -63, 85, -124, -99, 45, -124, -90, 97, 120, 11, 12, 92, -6, 75, 125, -33, 119, 100, -96, 112, -103, -29, -51, 78, -40, 58, -3, 104, 10, -38, 1, 120, 46, 48, -28, 77, -117, 90, -29, 81, -58, -28, -38, -18, -26, -3, -48, -55, -105, 37, -105, -80, 94, 51, 75, -85, 79, -82, -101, 52, -63, -18, 13, -99]", + "x-ms-client-request-id" : "a74bd53c-9dc2-4a62-85fc-c645266cd672", + "Content-Type" : "application/octet-stream" + }, + "Exception" : null + }, { + "Method" : "DELETE", + "Uri" : "https://REDACTED.vault.azure.net/keys/keyidencryptionnotanoop047803044603746e214892b?api-version=7.1-preview", + "Headers" : { + "User-Agent" : "azsdk-java-client_name/client_version (11.0.7; Windows 10; 10.0)", + "Content-Type" : "application/json" + }, + "Response" : { + "X-Content-Type-Options" : "nosniff", + "Pragma" : "no-cache", + "retry-after" : "0", + "StatusCode" : "200", + "Date" : "Mon, 13 Jul 2020 18:00:21 GMT", + "Strict-Transport-Security" : "max-age=31536000;includeSubDomains", + "Cache-Control" : "no-cache", + "X-AspNet-Version" : "4.0.30319", + "x-ms-keyvault-region" : "eastus", + "x-ms-keyvault-network-info" : "conn_type=Ipv4;addr=174.127.246.93;act_addr_fam=InterNetwork;", + "Expires" : "-1", + "Content-Length" : "887", + "x-ms-request-id" : "ee80c090-3316-4f40-ab28-8cc687adcdcf", + "x-ms-keyvault-service-version" : "1.1.8.0", + "Body" : "{\"recoveryId\":\"https://ceciliakeys.vault.azure.net/deletedkeys/keyidencryptionnotanoop047803044603746e214892b\",\"deletedDate\":1594663222,\"scheduledPurgeDate\":1602439222,\"key\":{\"kid\":\"https://ceciliakeys.vault.azure.net/keys/keyidencryptionnotanoop047803044603746e214892b/e0a5c2e4308f484cbe46e7ec8bbf2f52\",\"kty\":\"RSA\",\"key_ops\":[\"encrypt\",\"decrypt\",\"sign\",\"verify\",\"wrapKey\",\"unwrapKey\"],\"n\":\"uBnP5BN7G2udE55UQBHutohk7mT_ew5uvvN7tmpyrJzPulJp4zyF6ir9VRekLLPGIIslU_t85CQ4Ci3M_ED001yW7F_VMIOf9y3S6GmRwFZdq7mEN1LemQGcnIfRCt2_WwbyEYkBGbWCJ-jHYka3e-Vi_eDh6o8Df0PgS_xpMBq-0XHwJkH6mqNQ33fq1qL25WkU8SrXLMI43v4brvi-hIjkc2WbQ-_6NKvo2QCahz334Z0g2us2RYuU7X5hya17_z352qAc2yhFE5dM3h5-oDFo6nrzA0kmeI7IZDl2Lhsxfn-XMSr9Yj_tLoinEYNmcOD94RUq7Z9tvsjdemkTAQ\",\"e\":\"AQAB\"},\"attributes\":{\"enabled\":true,\"exp\":1626199217,\"created\":1594663219,\"updated\":1594663219,\"recoveryLevel\":\"Recoverable\",\"recoverableDays\":90}}", + "X-Powered-By" : "ASP.NET", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + } ], + "variables" : [ "keyidencryptionnotanoop047803044603746e214892b", "jtcencryptionnotanoop171244ed5268a26698440d99", "javablobencryptionnotanoop27156640b9d246514c436", "a656206c-3f99-48c1-a2b5-b6e3f25e8d8a" ] +} \ No newline at end of file diff --git a/sdk/storage/azure-storage-blob-cryptography/src/test/resources/session-records/KeyvaultKeyTestuploaddownload.json b/sdk/storage/azure-storage-blob-cryptography/src/test/resources/session-records/KeyvaultKeyTestuploaddownload.json new file mode 100644 index 0000000000000..9714d7e10d45a --- /dev/null +++ b/sdk/storage/azure-storage-blob-cryptography/src/test/resources/session-records/KeyvaultKeyTestuploaddownload.json @@ -0,0 +1,219 @@ +{ + "networkCallRecords" : [ { + "Method" : "POST", + "Uri" : "https://REDACTED.vault.azure.net/keys/keyiduploaddownload0keyvaultkeytestuploaddownload45979073192/create?api-version=7.1-preview", + "Headers" : { + "User-Agent" : "azsdk-java-client_name/client_version (11.0.7; Windows 10; 10.0)", + "Content-Type" : "application/json" + }, + "Response" : { + "X-Content-Type-Options" : "nosniff", + "Pragma" : "no-cache", + "retry-after" : "0", + "StatusCode" : "200", + "Date" : "Mon, 13 Jul 2020 18:00:13 GMT", + "Strict-Transport-Security" : "max-age=31536000;includeSubDomains", + "Cache-Control" : "no-cache", + "X-AspNet-Version" : "4.0.30319", + "x-ms-keyvault-region" : "eastus", + "x-ms-keyvault-network-info" : "conn_type=Ipv4;addr=174.127.246.93;act_addr_fam=InterNetwork;", + "Expires" : "-1", + "Content-Length" : "734", + "x-ms-request-id" : "9d8404d7-bd9e-47e6-bd01-d198122d503d", + "x-ms-keyvault-service-version" : "1.1.8.0", + "Body" : "{\"key\":{\"kid\":\"https://ceciliakeys.vault.azure.net/keys/keyiduploaddownload0keyvaultkeytestuploaddownload45979073192/67ed197f3f394b86a0c679ff27a1df06\",\"kty\":\"RSA\",\"key_ops\":[\"encrypt\",\"decrypt\",\"sign\",\"verify\",\"wrapKey\",\"unwrapKey\"],\"n\":\"tyu4Kv7CHRuYk_6IaEj-q-8wI4ck3b57WnvJlYYSiPoTUPFkW4Z7hdKNocG0qCN5s9_ULpcx6biyc25hIR5tq1fBhJdSptGZ1xqiBBxvleXg4F4a4pm56FP5XqJThfJtdHbyf7nkDDUat65xouV6BQrWSFWg53wBh1hWemUXzBvMEdAcV-Py0aqp_SrQTf1ie6cAV_0w27uU5Mmryq6aluvOSaDY9WBdwVFDlihugkGODNm7Kcfhb88LWVptvFduQvHYxnzOryGQ99ek63Uy1h3Bikaa40vO2xsRb8NcowLW8X8am38h_0pfhubcvldl00ueBmjvGJ_Rac7_nfNalw\",\"e\":\"AQAB\"},\"attributes\":{\"enabled\":true,\"exp\":1626199210,\"created\":1594663214,\"updated\":1594663214,\"recoveryLevel\":\"Recoverable\",\"recoverableDays\":90}}", + "X-Powered-By" : "ASP.NET", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcuploaddownload1keyvaultkeytestuploaddownload459787768474?restype=container", + "Headers" : { + "x-ms-version" : "2019-12-12", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.2 (11.0.7; Windows 10; 10.0)", + "x-ms-client-request-id" : "93f048e3-2827-4399-a1c5-55be8fd8cc1b" + }, + "Response" : { + "x-ms-version" : "2019-12-12", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "ETag" : "0x8D82756986EBB46", + "Last-Modified" : "Mon, 13 Jul 2020 18:00:15 GMT", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "40f612d2-e01e-0026-6f3f-59d99a000000", + "Date" : "Mon, 13 Jul 2020 18:00:14 GMT", + "x-ms-client-request-id" : "93f048e3-2827-4399-a1c5-55be8fd8cc1b" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.vault.azure.net/keys/keyiduploaddownload0keyvaultkeytestuploaddownload45979073192/67ed197f3f394b86a0c679ff27a1df06?api-version=7.1-preview", + "Headers" : { + "User-Agent" : "azsdk-java-client_name/client_version (11.0.7; Windows 10; 10.0)", + "Content-Type" : "application/json" + }, + "Response" : { + "X-Content-Type-Options" : "nosniff", + "Pragma" : "no-cache", + "retry-after" : "0", + "StatusCode" : "200", + "Date" : "Mon, 13 Jul 2020 18:00:15 GMT", + "Strict-Transport-Security" : "max-age=31536000;includeSubDomains", + "Cache-Control" : "no-cache", + "X-AspNet-Version" : "4.0.30319", + "x-ms-keyvault-region" : "eastus", + "x-ms-keyvault-network-info" : "conn_type=Ipv4;addr=174.127.246.93;act_addr_fam=InterNetwork;", + "Expires" : "-1", + "Content-Length" : "734", + "x-ms-request-id" : "4fb6e3b4-28c1-4563-9a07-ebafbe1372d9", + "x-ms-keyvault-service-version" : "1.1.8.0", + "Body" : "{\"key\":{\"kid\":\"https://ceciliakeys.vault.azure.net/keys/keyiduploaddownload0keyvaultkeytestuploaddownload45979073192/67ed197f3f394b86a0c679ff27a1df06\",\"kty\":\"RSA\",\"key_ops\":[\"encrypt\",\"decrypt\",\"sign\",\"verify\",\"wrapKey\",\"unwrapKey\"],\"n\":\"tyu4Kv7CHRuYk_6IaEj-q-8wI4ck3b57WnvJlYYSiPoTUPFkW4Z7hdKNocG0qCN5s9_ULpcx6biyc25hIR5tq1fBhJdSptGZ1xqiBBxvleXg4F4a4pm56FP5XqJThfJtdHbyf7nkDDUat65xouV6BQrWSFWg53wBh1hWemUXzBvMEdAcV-Py0aqp_SrQTf1ie6cAV_0w27uU5Mmryq6aluvOSaDY9WBdwVFDlihugkGODNm7Kcfhb88LWVptvFduQvHYxnzOryGQ99ek63Uy1h3Bikaa40vO2xsRb8NcowLW8X8am38h_0pfhubcvldl00ueBmjvGJ_Rac7_nfNalw\",\"e\":\"AQAB\"},\"attributes\":{\"enabled\":true,\"exp\":1626199210,\"created\":1594663214,\"updated\":1594663214,\"recoveryLevel\":\"Recoverable\",\"recoverableDays\":90}}", + "X-Powered-By" : "ASP.NET", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "POST", + "Uri" : "https://REDACTED.vault.azure.net/keys/keyiduploaddownload0keyvaultkeytestuploaddownload45979073192/67ed197f3f394b86a0c679ff27a1df06/wrapkey?api-version=7.1-preview", + "Headers" : { + "User-Agent" : "azsdk-java-client_name/client_version (11.0.7; Windows 10; 10.0)", + "Content-Type" : "application/json" + }, + "Response" : { + "X-Content-Type-Options" : "nosniff", + "Pragma" : "no-cache", + "retry-after" : "0", + "StatusCode" : "200", + "Date" : "Mon, 13 Jul 2020 18:00:16 GMT", + "Strict-Transport-Security" : "max-age=31536000;includeSubDomains", + "Cache-Control" : "no-cache", + "X-AspNet-Version" : "4.0.30319", + "x-ms-keyvault-region" : "eastus", + "x-ms-keyvault-network-info" : "conn_type=Ipv4;addr=174.127.246.93;act_addr_fam=InterNetwork;", + "Expires" : "-1", + "Content-Length" : "497", + "x-ms-request-id" : "478204ba-9d5a-4485-8b6c-e25cb068c72c", + "x-ms-keyvault-service-version" : "1.1.8.0", + "Body" : "{\"kid\":\"https://ceciliakeys.vault.azure.net/keys/keyiduploaddownload0keyvaultkeytestuploaddownload45979073192/67ed197f3f394b86a0c679ff27a1df06\",\"value\":\"M8kBNLKvlbvPVWFw0T7kktnOmpLFUUWsHRi9TpfZpSfWj9-ZR2-rCF68nXTjuFOC_CuaCdvpD-3TlG6Ho5-fePtXVOx2DF764uCGNwbmBgVSpalVeLDmetKiaYv2KsFksoUNjaHzuEM4xIzQ0DOFUe6NlZOj-8mKOLRTWofsQoQ1GZB-sz7Gs7Ha8YaSZSOXX-hMVklNo9uIausCMhvvmXcaC4vKon3OaGYGXNuo1qayO9a9dfpTFe4GficRw_73YsPTqU-7q1mN_tG1aNTOnoYkw8OErx395_hPNc-3g49xumJFjp2m2i8UTbkuYb5a9BHIRkB9IaTB3ByHnjG3Fw\"}", + "X-Powered-By" : "ASP.NET", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcuploaddownload1keyvaultkeytestuploaddownload459787768474/javablobuploaddownload2keyvaultkeytestuploaddownload459877433", + "Headers" : { + "x-ms-version" : "2019-12-12", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.2 (11.0.7; Windows 10; 10.0)", + "x-ms-client-request-id" : "e0dd75f7-c1ed-44f5-9491-b995a61ac34c", + "Content-Type" : "application/octet-stream" + }, + "Response" : { + "x-ms-version" : "2019-12-12", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-content-crc64" : "wHFJUjOnMMI=", + "x-ms-version-id" : "2020-07-13T18:00:16.7847574Z", + "Last-Modified" : "Mon, 13 Jul 2020 18:00:16 GMT", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-server-encrypted" : "true", + "Date" : "Mon, 13 Jul 2020 18:00:15 GMT", + "Content-MD5" : "VbM8HcNSn56AgffJ1qC07w==", + "ETag" : "0x8D82756996FF696", + "Content-Length" : "0", + "x-ms-request-id" : "ebe90ccc-f01e-0048-3f3f-598cb5000000", + "x-ms-client-request-id" : "e0dd75f7-c1ed-44f5-9491-b995a61ac34c" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcuploaddownload1keyvaultkeytestuploaddownload459787768474/javablobuploaddownload2keyvaultkeytestuploaddownload459877433", + "Headers" : { + "x-ms-version" : "2019-12-12", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.2 (11.0.7; Windows 10; 10.0)", + "x-ms-client-request-id" : "7c129d65-939f-452d-8829-e5a49395d536" + }, + "Response" : { + "x-ms-is-current-version" : "true", + "x-ms-version" : "2019-12-12", + "x-ms-lease-status" : "unlocked", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-lease-state" : "available", + "x-ms-version-id" : "2020-07-13T18:00:16.7847574Z", + "Last-Modified" : "Mon, 13 Jul 2020 18:00:16 GMT", + "retry-after" : "0", + "StatusCode" : "200", + "Date" : "Mon, 13 Jul 2020 18:00:16 GMT", + "x-ms-blob-type" : "BlockBlob", + "Content-MD5" : "VbM8HcNSn56AgffJ1qC07w==", + "Accept-Ranges" : "bytes", + "x-ms-meta-encryptiondata" : "{\"EncryptionMode\":\"FullBlob\",\"WrappedContentKey\":{\"KeyId\":\"https://ceciliakeys.vault.azure.net/keys/keyiduploaddownload0keyvaultkeytestuploaddownload45979073192/67ed197f3f394b86a0c679ff27a1df06\",\"EncryptedKey\":\"M8kBNLKvlbvPVWFw0T7kktnOmpLFUUWsHRi9TpfZpSfWj9+ZR2+rCF68nXTjuFOC/CuaCdvpD+3TlG6Ho5+fePtXVOx2DF764uCGNwbmBgVSpalVeLDmetKiaYv2KsFksoUNjaHzuEM4xIzQ0DOFUe6NlZOj+8mKOLRTWofsQoQ1GZB+sz7Gs7Ha8YaSZSOXX+hMVklNo9uIausCMhvvmXcaC4vKon3OaGYGXNuo1qayO9a9dfpTFe4GficRw/73YsPTqU+7q1mN/tG1aNTOnoYkw8OErx395/hPNc+3g49xumJFjp2m2i8UTbkuYb5a9BHIRkB9IaTB3ByHnjG3Fw==\",\"Algorithm\":\"RSA-OAEP-256\"},\"EncryptionAgent\":{\"Protocol\":\"1.0\",\"EncryptionAlgorithm\":\"AES_CBC_256\"},\"ContentEncryptionIV\":\"DINtkrRXlqGDXfjaOYhgnw==\",\"KeyWrappingMetadata\":{\"EncryptionLibrary\":\"JavaTrack212.8.0-beta.2\"}}", + "x-ms-server-encrypted" : "true", + "ETag" : "0x8D82756996FF696", + "x-ms-creation-time" : "Mon, 13 Jul 2020 18:00:16 GMT", + "Content-Length" : "1040", + "x-ms-request-id" : "5e0c33a7-501e-00a5-403f-59c7f8000000", + "Body" : "[-50, 33, -103, 106, -116, 67, 43, -23, 10, 97, 111, 20, 37, -67, 109, 99, -38, 92, -45, 48, 21, -118, 118, -81, -118, 36, -82, -101, 97, 69, -38, -110, 110, -123, 51, -24, 104, -46, -121, -110, 58, 105, 26, -78, -17, -95, -39, 18, 90, -32, -80, -20, -60, -7, -47, -65, 93, 18, 60, 19, 44, -62, 16, -33, 97, -48, -100, 47, -81, 86, 92, 101, -124, -34, 20, -86, -109, 45, -57, -126, -46, -126, -64, 46, -37, 73, -83, 71, -116, -125, 13, 12, 54, -87, -33, -86, 9, -47, -55, -87, -61, -5, -9, -34, -119, -67, -54, 56, 2, 82, 108, -110, -126, -18, -58, -37, -76, -81, 66, 93, -51, -28, -71, 81, -68, -108, -28, 117, -120, 92, -100, 105, 1, 21, 5, -70, -117, -15, 111, 56, 10, 46, -97, -108, -65, 11, 58, -69, 25, -86, 2, 69, 49, -102, 117, -56, -57, -12, -96, -83, -55, -28, 43, -124, 3, 92, -22, -71, -76, -107, 66, 27, -47, -7, -60, 87, 52, -53, -70, -126, -47, -9, -87, -113, 109, -81, 51, -8, -23, -100, -43, 103, -89, 77, 13, 109, 48, 119, 27, -112, -32, 45, -108, 23, -38, 118, -42, 14, -4, -28, 103, -22, 96, -25, 127, 38, -89, -111, -3, -120, 94, -3, 46, -113, -39, 77, -63, 25, -82, -46, -35, -64, -125, 121, 52, -51, -19, 97, 83, -56, -95, -44, -101, -53, -115, 29, -41, -118, -6, 37, 52, 10, -32, -99, 112, -38, -53, -85, -33, -51, 57, -73, -119, -93, -18, -99, 118, 114, -97, 114, -85, -126, 119, -63, -2, 19, 11, -75, -28, 85, -26, 73, -79, 37, -127, 40, 23, -23, -114, -111, 64, -109, -124, -71, -62, -44, 109, -71, 46, 83, -101, -106, 54, -9, -78, -91, 96, -46, 125, -51, 69, 29, -79, -37, 29, 98, 75, 44, -113, -120, 40, -37, -97, 105, 120, 7, -29, -55, 112, -49, 48, -103, -70, -92, 3, 85, -43, -44, -119, -77, -24, 57, 5, 75, 126, 7, -47, 101, 67, -48, -120, 1, 5, -60, -14, -71, 113, 82, -69, -79, 42, -101, 76, -111, -104, 88, -123, -66, 119, -32, 57, -14, 102, 2, -69, 122, 126, 27, 42, 106, -4, -89, 69, 68, 110, -27, -43, -102, 37, 105, -46, -101, 38, 70, -103, -3, 68, -66, -23, 48, 98, -24, -26, 118, 82, -110, 36, -7, -34, 1, -55, 60, 116, -39, 34, 111, -121, -23, 18, -87, -123, -33, -26, -10, -1, 31, -122, 60, 118, 127, -124, -20, 41, 66, -74, -91, -27, 44, 47, 7, 45, -25, -55, -11, 33, 62, 106, -15, -10, 43, -51, 111, -76, -46, -72, -53, 13, 100, 35, 42, 120, -22, -100, 123, -32, 31, 27, -56, -91, -6, -128, 29, -59, -127, -86, -126, 32, -37, -97, 127, 34, -117, 47, 15, -128, 8, -24, -64, 114, -109, 49, 23, 41, -11, -76, 84, 32, -43, 45, 111, -58, -75, 118, -41, 5, 61, -53, -46, -60, -120, 107, -122, 55, 126, 94, 95, -110, -101, -67, 100, -20, 93, 87, 125, -88, -127, 31, -83, 84, -121, -85, 6, 7, -11, 13, -117, -8, 91, 100, 91, 105, 102, 52, 6, -115, -24, -31, -3, -57, -28, 40, -87, -40, 102, 96, 55, 57, -61, 71, 73, 67, -55, 18, -49, 59, -112, 2, 7, -124, -126, -43, -108, -28, 74, -6, -125, 21, 1, -23, -44, -54, -89, 90, 30, 114, 126, -102, -101, -38, 54, -61, 0, -109, 100, 101, -53, -13, -24, -20, 3, 48, 26, 43, -51, -29, -71, -2, 52, -121, -6, -99, 125, -84, 56, -117, -5, -47, 125, -101, -115, 15, -66, -34, 48, 113, 16, -94, -49, -60, 29, 64, 92, -89, -111, 58, -30, -78, 58, 79, -69, 6, -128, -59, -127, -38, 11, -10, 0, 80, 67, -85, 86, 105, 5, -4, 25, -7, -11, 113, -22, 123, 95, 113, -71, 54, -3, -62, -119, 14, 6, 122, -35, 98, 42, 93, 80, -5, 98, 119, 9, 125, -80, -13, -25, 89, -61, -65, -79, -119, -78, -31, -13, 84, -56, 24, 42, -119, -41, 75, -94, -69, 47, 23, 5, 25, -60, -70, -44, 26, -54, -87, 11, 40, -114, 100, -55, -128, 47, -10, -75, 24, -22, 86, 6, 29, 118, 79, -67, 10, 9, -128, -54, -77, -69, -126, -5, 23, -40, -1, 100, 43, 74, -74, -77, 89, -71, -75, -75, -94, 109, -72, -61, -90, 83, -96, 97, -68, 17, 20, 44, 9, 74, -120, -2, 125, -29, 77, -96, 45, 18, 80, 85, 2, -65, -81, -28, -4, -105, -103, 39, -4, 109, 43, -64, 89, 55, -13, -45, -64, 127, 49, -15, -93, -45, -21, -66, 125, -112, 76, 1, 105, -69, -112, 11, 75, -122, 57, -54, -30, -41, -62, -99, 58, -36, 43, -56, 43, -68, 27, 54, -121, -106, 88, -93, 63, 100, -62, 20, -4, -23, 69, -97, 40, 40, -124, 97, -71, 42, -96, -97, 30, 53, 48, -73, 60, -94, 75, -91, 53, -110, 81, -81, -42, -45, 49, 122, 14, 87, -23, -7, -38, -92, 8, 126, 115, 101, -85, -27, 14, -7, 107, -23, -99, 6, 35, -21, -46, 17, -121, 105, -15, 69, 89, -93, 49, -117, 67, 74, -68, 57, -91, -107, -9, 0, -68, -79, 59, -39, -46, 90, -45, -87, 55, 25, -61, -17, 103, 31, -109, 79, -29, 72, -107, -59, 87, 97, -77, 83, 111, -78, -56, -5, -25, -19, -72, 59, 11, -31, 121, 88, 75, 88, 53, 93, 97, 75, -4, 82, -102, -23, -54, -13, -120, 113, -25, 98, -4, -120, 6, -105, -21, 15, 12, -52, -17, 54, 108, -103, 122, -37, 69, -48, -29, 102, 3, 99, -106, -29, -57, -32, -47, 127, -73, 70, -49, -43, 107, -24, -5, -111, -84, -18, 56, 121, -45, 38, -34, 104, -77, -55, -71, 115, -20, 19, 75, -113, 73, -55, -9, -110, 77, -97, 34, -3, 12, 68, -100, 97, 82, 65, 53, -107, -99, -127, -39, 33, -107, -74, -24, -89, 91, 102, -115, 114, 41, -117, -36, -83, -28, -117, -81, -23, -67, -73, 81, -119, -108, 24, 91, 99]", + "x-ms-client-request-id" : "7c129d65-939f-452d-8829-e5a49395d536", + "Content-Type" : "application/octet-stream" + }, + "Exception" : null + }, { + "Method" : "POST", + "Uri" : "https://REDACTED.vault.azure.net/keys/keyiduploaddownload0keyvaultkeytestuploaddownload45979073192/67ed197f3f394b86a0c679ff27a1df06/unwrapkey?api-version=7.1-preview", + "Headers" : { + "User-Agent" : "azsdk-java-client_name/client_version (11.0.7; Windows 10; 10.0)", + "Content-Type" : "application/json" + }, + "Response" : { + "X-Content-Type-Options" : "nosniff", + "Pragma" : "no-cache", + "retry-after" : "0", + "StatusCode" : "200", + "Date" : "Mon, 13 Jul 2020 18:00:17 GMT", + "Strict-Transport-Security" : "max-age=31536000;includeSubDomains", + "Cache-Control" : "no-cache", + "X-AspNet-Version" : "4.0.30319", + "x-ms-keyvault-region" : "eastus", + "x-ms-keyvault-network-info" : "conn_type=Ipv4;addr=174.127.246.93;act_addr_fam=InterNetwork;", + "Expires" : "-1", + "Content-Length" : "198", + "x-ms-request-id" : "bf6b6756-5d81-474d-a109-6426224a60e4", + "x-ms-keyvault-service-version" : "1.1.8.0", + "Body" : "{\"kid\":\"https://ceciliakeys.vault.azure.net/keys/keyiduploaddownload0keyvaultkeytestuploaddownload45979073192/67ed197f3f394b86a0c679ff27a1df06\",\"value\":\"T6mK_G9zSuAGykH-usvr3X5ZdNnEriBiT0VLZkEV_xs\"}", + "X-Powered-By" : "ASP.NET", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + }, { + "Method" : "DELETE", + "Uri" : "https://REDACTED.vault.azure.net/keys/keyiduploaddownload0keyvaultkeytestuploaddownload45979073192?api-version=7.1-preview", + "Headers" : { + "User-Agent" : "azsdk-java-client_name/client_version (11.0.7; Windows 10; 10.0)", + "Content-Type" : "application/json" + }, + "Response" : { + "X-Content-Type-Options" : "nosniff", + "Pragma" : "no-cache", + "retry-after" : "0", + "StatusCode" : "200", + "Date" : "Mon, 13 Jul 2020 18:00:18 GMT", + "Strict-Transport-Security" : "max-age=31536000;includeSubDomains", + "Cache-Control" : "no-cache", + "X-AspNet-Version" : "4.0.30319", + "x-ms-keyvault-region" : "eastus", + "x-ms-keyvault-network-info" : "conn_type=Ipv4;addr=174.127.246.93;act_addr_fam=InterNetwork;", + "Expires" : "-1", + "Content-Length" : "915", + "x-ms-request-id" : "b7761dd4-f5ee-4297-97a7-cd6e4df47fd3", + "x-ms-keyvault-service-version" : "1.1.8.0", + "Body" : "{\"recoveryId\":\"https://ceciliakeys.vault.azure.net/deletedkeys/keyiduploaddownload0keyvaultkeytestuploaddownload45979073192\",\"deletedDate\":1594663218,\"scheduledPurgeDate\":1602439218,\"key\":{\"kid\":\"https://ceciliakeys.vault.azure.net/keys/keyiduploaddownload0keyvaultkeytestuploaddownload45979073192/67ed197f3f394b86a0c679ff27a1df06\",\"kty\":\"RSA\",\"key_ops\":[\"encrypt\",\"decrypt\",\"sign\",\"verify\",\"wrapKey\",\"unwrapKey\"],\"n\":\"tyu4Kv7CHRuYk_6IaEj-q-8wI4ck3b57WnvJlYYSiPoTUPFkW4Z7hdKNocG0qCN5s9_ULpcx6biyc25hIR5tq1fBhJdSptGZ1xqiBBxvleXg4F4a4pm56FP5XqJThfJtdHbyf7nkDDUat65xouV6BQrWSFWg53wBh1hWemUXzBvMEdAcV-Py0aqp_SrQTf1ie6cAV_0w27uU5Mmryq6aluvOSaDY9WBdwVFDlihugkGODNm7Kcfhb88LWVptvFduQvHYxnzOryGQ99ek63Uy1h3Bikaa40vO2xsRb8NcowLW8X8am38h_0pfhubcvldl00ueBmjvGJ_Rac7_nfNalw\",\"e\":\"AQAB\"},\"attributes\":{\"enabled\":true,\"exp\":1626199210,\"created\":1594663214,\"updated\":1594663214,\"recoveryLevel\":\"Recoverable\",\"recoverableDays\":90}}", + "X-Powered-By" : "ASP.NET", + "Content-Type" : "application/json; charset=utf-8" + }, + "Exception" : null + } ], + "variables" : [ "keyiduploaddownload0keyvaultkeytestuploaddownload45979073192", "jtcuploaddownload1keyvaultkeytestuploaddownload459787768474", "javablobuploaddownload2keyvaultkeytestuploaddownload459877433", "24fe4abf-51c0-4a60-8c5c-a517487e0cac" ] +} \ No newline at end of file diff --git a/sdk/storage/azure-storage-blob-cryptography/src/test/resources/session-records/LocalKeyTestencryptionnotanoop.json b/sdk/storage/azure-storage-blob-cryptography/src/test/resources/session-records/LocalKeyTestencryptionnotanoop.json new file mode 100644 index 0000000000000..592c97926f966 --- /dev/null +++ b/sdk/storage/azure-storage-blob-cryptography/src/test/resources/session-records/LocalKeyTestencryptionnotanoop.json @@ -0,0 +1,84 @@ +{ + "networkCallRecords" : [ { + "Method" : "PUT", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcencryptionnotanoop0localkeytestencryptionnotanoopae411638f?restype=container", + "Headers" : { + "x-ms-version" : "2019-12-12", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.2 (11.0.7; Windows 10; 10.0)", + "x-ms-client-request-id" : "0f8796a7-952e-476e-9cb9-9fe2819f5660" + }, + "Response" : { + "x-ms-version" : "2019-12-12", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "ETag" : "0x8D8244D522D523D", + "Last-Modified" : "Thu, 09 Jul 2020 21:16:18 GMT", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "614d3769-a01e-009e-7836-56825c000000", + "Date" : "Thu, 09 Jul 2020 21:16:17 GMT", + "x-ms-client-request-id" : "0f8796a7-952e-476e-9cb9-9fe2819f5660" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcencryptionnotanoop0localkeytestencryptionnotanoopae411638f/javablobencryptionnotanoop10042171a4ef7978584e0", + "Headers" : { + "x-ms-version" : "2019-12-12", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.2 (11.0.7; Windows 10; 10.0)", + "x-ms-client-request-id" : "2d1665da-30dd-4205-94cb-db14143c845f", + "Content-Type" : "application/octet-stream" + }, + "Response" : { + "x-ms-version" : "2019-12-12", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-content-crc64" : "cTNLCcS4yTQ=", + "x-ms-version-id" : "2020-07-09T21:16:18.7228980Z", + "Last-Modified" : "Thu, 09 Jul 2020 21:16:18 GMT", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-server-encrypted" : "true", + "Date" : "Thu, 09 Jul 2020 21:16:18 GMT", + "Content-MD5" : "9Dw+NKoPq8zZu90oy6UXbg==", + "ETag" : "0x8D8244D5272241F", + "Content-Length" : "0", + "x-ms-request-id" : "7e2af355-201e-0074-6f36-56a572000000", + "x-ms-client-request-id" : "2d1665da-30dd-4205-94cb-db14143c845f" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcencryptionnotanoop0localkeytestencryptionnotanoopae411638f/javablobencryptionnotanoop10042171a4ef7978584e0", + "Headers" : { + "x-ms-version" : "2019-12-12", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.2 (11.0.7; Windows 10; 10.0)", + "x-ms-client-request-id" : "c7927604-38e6-40ca-b3b2-87cd85f5c021" + }, + "Response" : { + "x-ms-is-current-version" : "true", + "x-ms-version" : "2019-12-12", + "x-ms-lease-status" : "unlocked", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-lease-state" : "available", + "x-ms-version-id" : "2020-07-09T21:16:18.7228980Z", + "Last-Modified" : "Thu, 09 Jul 2020 21:16:18 GMT", + "retry-after" : "0", + "StatusCode" : "200", + "Date" : "Thu, 09 Jul 2020 21:16:19 GMT", + "x-ms-blob-type" : "BlockBlob", + "Content-MD5" : "9Dw+NKoPq8zZu90oy6UXbg==", + "Accept-Ranges" : "bytes", + "x-ms-meta-encryptiondata" : "{\"EncryptionMode\":\"FullBlob\",\"WrappedContentKey\":{\"KeyId\":\"local\",\"EncryptedKey\":\"z4Aw5jYIa7HF5P3Cunl7FCT+DltAzIKR93Ss6PxbBYps/KKNYuvdNQ==\",\"Algorithm\":\"A256KW\"},\"EncryptionAgent\":{\"Protocol\":\"1.0\",\"EncryptionAlgorithm\":\"AES_CBC_256\"},\"ContentEncryptionIV\":\"f9e2HPtNEE5V9Uno5oGLVw==\",\"KeyWrappingMetadata\":{\"EncryptionLibrary\":\"JavaTrack212.8.0-beta.2\"}}", + "x-ms-server-encrypted" : "true", + "ETag" : "0x8D8244D5272241F", + "x-ms-creation-time" : "Thu, 09 Jul 2020 21:16:18 GMT", + "Content-Length" : "1040", + "x-ms-request-id" : "c68e75e4-101e-009b-1836-565087000000", + "Body" : "[101, 113, -9, -114, -103, -101, -51, 94, -25, 65, -39, -1, -20, -29, 41, 46, 35, 9, 91, -71, -96, 36, 91, 78, -69, -93, -13, 126, 89, -14, -63, -27, -67, -22, 102, 125, 35, -16, 27, 34, -26, -81, 95, 91, -40, -100, 84, -83, -55, 84, 36, 49, -128, 61, 47, -113, -67, -47, 0, 68, 0, 79, -49, -36, -10, -107, 1, -80, -65, -95, -4, -91, 74, 90, 5, 98, 21, 7, 31, -41, -53, 112, -62, 62, -58, 114, 117, 44, -103, -38, -118, 39, -97, -58, 80, 115, -80, 84, 109, 105, -41, 37, 10, 33, 107, -73, 110, -14, -26, -50, -4, -79, 65, -24, -61, 59, -73, -90, -100, -42, 127, 75, 87, 106, -106, 73, -94, -85, 68, 0, -14, 27, -73, 123, 42, 81, 63, 25, -124, 100, 121, -8, 29, -16, 77, 29, -59, -52, -47, -104, -48, 121, -81, 70, 14, -103, 32, 91, 15, -60, 110, -52, 125, -12, 76, -10, -88, 69, -88, 60, 103, 65, 15, -51, -17, 11, -87, 63, 12, 121, -9, -65, -72, -110, 17, 36, -36, -17, 122, 75, 8, -91, 29, -121, -38, 7, 51, -79, -107, -61, -110, 49, -114, 88, 126, 29, -36, 70, 64, -121, -90, -48, -106, -125, 40, -108, 122, -84, 7, -31, -46, 85, -61, 1, 76, 90, 106, -21, 65, -128, 9, -13, 6, -43, -49, 4, -79, 104, 75, -9, 33, 5, 13, 109, 124, 76, 63, 104, -31, 54, 90, 46, -18, 1, 38, 81, -3, -111, -3, -30, 2, 8, 53, -83, -33, -14, -53, -78, -111, -69, -31, -53, -18, -25, -99, 88, -45, 32, -42, -118, 43, -66, 111, 126, 89, 107, -83, 66, 36, -50, 36, 113, -76, -14, -119, 81, -26, -67, 88, -7, -44, 37, -88, 66, 59, -118, -92, 63, -98, -81, 95, -55, -51, -33, -64, -3, -6, 117, 109, -120, 62, -86, 9, 30, -26, -31, 11, -46, 66, -86, -15, -116, -74, -107, 120, -20, -80, -93, 83, -59, -126, 92, -128, -101, -68, 124, -60, -118, -112, -120, -15, 92, -4, -72, -86, -37, -110, -108, -14, -76, -30, -12, -95, 53, 119, 39, 7, -24, 25, -22, 101, 88, -50, -95, 19, 91, -4, 95, 61, 98, -41, 123, 49, -39, 120, 112, -51, 39, 123, -61, 7, -103, 118, 85, -73, -102, 84, -75, 16, -25, 32, 3, -119, -19, 0, 114, -31, -6, -104, 39, 33, -83, 106, 97, -70, -124, -73, -88, 35, 98, 51, 35, -120, 120, 123, -84, -128, -31, -12, -107, 66, 52, -70, -17, 11, -94, 6, 26, 94, -1, 48, -44, -64, -51, -91, -104, -58, -9, -92, -31, -83, -1, 4, 101, -77, -90, 52, -85, -59, 78, -77, 53, -63, -26, -36, 55, 30, -4, 124, 127, -25, -98, 17, 58, 56, 58, -23, 38, -112, 109, 113, 81, 85, -31, 31, 33, 100, 5, 80, 49, 18, -116, 60, 54, 79, 121, -125, 35, 116, 113, 68, -62, -1, 14, -27, 51, -79, 89, -8, 3, 1, -69, -47, -87, 64, 114, -63, -120, -34, -116, 109, 38, 108, 5, 119, 28, -1, -106, 91, 85, 18, -120, -102, -20, -91, 36, 126, 38, 26, -128, 116, 108, 72, -87, -127, -96, -72, -63, 20, 18, 45, -54, 10, 122, -65, -15, 75, 103, 46, -55, 102, -42, 4, -48, 55, -94, -34, 43, -7, 91, 30, -26, 76, -5, -127, -60, -8, 88, 4, -110, -67, -56, -63, 126, -98, -88, 114, 112, 22, 92, -95, 112, -32, -98, 66, -98, 19, -69, -82, 108, -62, 46, -59, 108, 121, 110, -21, -42, -31, 48, -118, -51, -60, -18, -101, -53, -81, -81, -111, -120, -109, -115, -113, -81, 127, 34, -6, -30, 42, -45, -17, -121, -67, 118, 31, -91, 39, -7, -55, 111, 58, 90, 23, -71, 116, -95, -28, 100, -36, 30, 56, 77, -71, -35, -91, 76, -58, 59, -35, 46, -106, 57, 112, 19, 77, -33, 116, 90, 102, -94, 96, -16, -53, -110, 105, -122, 42, 37, 21, -5, 62, 91, 79, -22, 24, -117, 66, 55, 53, -49, -114, 86, -16, 52, -103, 104, 101, -7, 17, 3, 32, 95, 79, -44, 79, -17, 65, -46, -108, 3, 48, -16, 64, -10, -85, -101, -45, 75, -15, 97, 116, -96, -18, -94, 96, -97, 104, -21, -97, -53, 78, -73, 55, 105, -75, -87, -72, 51, 57, 109, 123, -19, 122, -87, 11, -100, 69, 19, 122, 31, 24, -40, 83, -21, 71, -89, 108, 103, 88, -56, -75, 125, -70, 93, -16, -45, 26, -96, 24, -10, -119, 107, -72, 114, 77, -53, 56, -115, -57, -64, 27, 4, 86, 126, -98, 1, -47, 108, -116, 66, -11, 10, 54, -35, -23, 126, 36, -53, 60, -41, -76, 28, -91, -62, -102, -67, -11, -120, -119, 111, -93, -42, 90, 116, -23, -69, 54, 91, 86, 63, -40, 73, 125, -40, 58, 62, 109, 86, -2, -5, -67, -2, 36, -74, 69, 106, 53, -12, -17, 96, 31, -72, -67, -7, 112, -122, -4, -43, 51, 9, 55, 112, 28, -94, 64, -72, 69, 12, 48, -31, -10, 122, -73, 31, -13, 4, -44, 30, 67, -85, -84, 126, 45, 3, -14, 101, 63, 63, -14, 69, 49, -103, -57, -101, -31, 28, 40, -18, -89, -94, -29, 71, 77, 22, -46, -127, 67, 26, -13, -46, 88, -54, -82, 32, 115, 54, -50, 104, -86, -8, -50, 91, 58, -32, -103, -98, -17, 95, -69, 112, 114, 84, -16, -103, 64, -45, -106, 120, -29, -11, 43, -94, -127, 57, 56, -17, -121, 22, -77, 61, 8, -83, -51, -5, 102, 71, 101, -108, -116, -97, 121, -119, 6, -74, -47, 109, 4, 22, 28, -3, 38, 29, -60, -37, -27, 66, 85, -125, 12, -84, -83, -63, 53, -128, 27, -32, 53, 52, -102, 91, -26, 37, -60, 79, 124, 23, -128, -106, -8, -92, -114, 123, -30, 119, -86, -94, -29, -57, 63, -107, 45, -78, -38, -31, -116, -109, -112, 36, 85, 87, -93, 67, 17, 74, 76, 89, -43, -82, 54, 90, 119, -103, 51, 73, -80, -87, 59, 55, 53, 20, 78, 3, -28, -110, -99, 58, -118, 85, -105, 7]", + "x-ms-client-request-id" : "c7927604-38e6-40ca-b3b2-87cd85f5c021", + "Content-Type" : "application/octet-stream" + }, + "Exception" : null + } ], + "variables" : [ "81bc8ced-c924-47ab-80ca-89f64da1cd82", "jtcencryptionnotanoop0localkeytestencryptionnotanoopae411638f", "javablobencryptionnotanoop10042171a4ef7978584e0", "a6d7f882-6d70-498f-a8ae-725082f6d033" ] +} \ No newline at end of file diff --git a/sdk/storage/azure-storage-blob-cryptography/src/test/resources/session-records/LocalKeyTestuploaddownload.json b/sdk/storage/azure-storage-blob-cryptography/src/test/resources/session-records/LocalKeyTestuploaddownload.json new file mode 100644 index 0000000000000..8e9f981275472 --- /dev/null +++ b/sdk/storage/azure-storage-blob-cryptography/src/test/resources/session-records/LocalKeyTestuploaddownload.json @@ -0,0 +1,84 @@ +{ + "networkCallRecords" : [ { + "Method" : "PUT", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcuploaddownload0localkeytestuploaddownloada06506847931b?restype=container", + "Headers" : { + "x-ms-version" : "2019-12-12", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.2 (11.0.7; Windows 10; 10.0)", + "x-ms-client-request-id" : "0f204b9a-1a10-42ce-a3ec-da9c6a99d7d0" + }, + "Response" : { + "x-ms-version" : "2019-12-12", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "ETag" : "0x8D8244D5111E535", + "Last-Modified" : "Thu, 09 Jul 2020 21:16:16 GMT", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "f350c15b-201e-0039-3536-566a9e000000", + "Date" : "Thu, 09 Jul 2020 21:16:16 GMT", + "x-ms-client-request-id" : "0f204b9a-1a10-42ce-a3ec-da9c6a99d7d0" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcuploaddownload0localkeytestuploaddownloada06506847931b/javablobuploaddownload1localkeytestuploaddownloada0619788733", + "Headers" : { + "x-ms-version" : "2019-12-12", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.2 (11.0.7; Windows 10; 10.0)", + "x-ms-client-request-id" : "d152e5fd-97f3-4d2f-abed-d530922aa965", + "Content-Type" : "application/octet-stream" + }, + "Response" : { + "x-ms-version" : "2019-12-12", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-content-crc64" : "vyhIPpTd9Cg=", + "x-ms-version-id" : "2020-07-09T21:16:17.2828707Z", + "Last-Modified" : "Thu, 09 Jul 2020 21:16:17 GMT", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-server-encrypted" : "true", + "Date" : "Thu, 09 Jul 2020 21:16:16 GMT", + "Content-MD5" : "u7nVX1ppqTXUHg5LT0EjQg==", + "ETag" : "0x8D8244D51969023", + "Content-Length" : "0", + "x-ms-request-id" : "30425ed1-f01e-002a-1736-564e92000000", + "x-ms-client-request-id" : "d152e5fd-97f3-4d2f-abed-d530922aa965" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcuploaddownload0localkeytestuploaddownloada06506847931b/javablobuploaddownload1localkeytestuploaddownloada0619788733", + "Headers" : { + "x-ms-version" : "2019-12-12", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.2 (11.0.7; Windows 10; 10.0)", + "x-ms-client-request-id" : "e3852821-f908-4508-9104-66993c5dced3" + }, + "Response" : { + "x-ms-is-current-version" : "true", + "x-ms-version" : "2019-12-12", + "x-ms-lease-status" : "unlocked", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-lease-state" : "available", + "x-ms-version-id" : "2020-07-09T21:16:17.2828707Z", + "Last-Modified" : "Thu, 09 Jul 2020 21:16:17 GMT", + "retry-after" : "0", + "StatusCode" : "200", + "Date" : "Thu, 09 Jul 2020 21:16:16 GMT", + "x-ms-blob-type" : "BlockBlob", + "Content-MD5" : "u7nVX1ppqTXUHg5LT0EjQg==", + "Accept-Ranges" : "bytes", + "x-ms-meta-encryptiondata" : "{\"EncryptionMode\":\"FullBlob\",\"WrappedContentKey\":{\"KeyId\":\"local\",\"EncryptedKey\":\"NpbUzDfNi9AYnWd/pgNTtGCBV6lovvJAleXpd/pc0wBer7RtGQeNRA==\",\"Algorithm\":\"A256KW\"},\"EncryptionAgent\":{\"Protocol\":\"1.0\",\"EncryptionAlgorithm\":\"AES_CBC_256\"},\"ContentEncryptionIV\":\"UzOe1NjUynTxeHzIYgxG5w==\",\"KeyWrappingMetadata\":{\"EncryptionLibrary\":\"JavaTrack212.8.0-beta.2\"}}", + "x-ms-server-encrypted" : "true", + "ETag" : "0x8D8244D51969023", + "x-ms-creation-time" : "Thu, 09 Jul 2020 21:16:17 GMT", + "Content-Length" : "1040", + "x-ms-request-id" : "b68f125b-b01e-0014-3a36-56d9ed000000", + "Body" : "[98, 41, 27, 84, -33, 22, 8, -100, -106, -119, -52, 110, 4, 29, 27, 15, 65, -28, -65, -112, -111, -46, -22, 105, -73, -6, 15, -52, -49, 121, -23, -43, -36, -94, -65, -1, -101, 83, 37, -109, 50, 119, -28, 84, -64, -30, 122, 9, -30, -8, 22, -30, 125, 0, 113, 73, -107, 77, -117, 77, -124, -67, -41, 71, 68, 74, 23, 49, -73, -57, -71, -118, -21, -60, -37, -95, 74, -14, 84, 24, 21, 24, -74, 1, -113, -22, 73, 8, 107, 92, 125, 15, -1, -47, -75, 36, -18, 94, 95, -19, -47, -2, 42, -32, -52, 108, 52, -68, 48, -25, 17, -71, -35, 7, 91, -32, 45, 73, 20, -71, -52, -24, -77, 47, -110, 54, 21, -22, 30, -11, -48, -65, -37, -58, 18, -103, -65, 95, 37, -85, 86, -117, -33, 109, -28, -6, 111, -65, -31, -107, -64, 85, -27, 36, -109, -20, -60, 39, 124, 49, 83, 84, 60, 114, 33, -64, -83, 126, 26, -75, -76, -82, 97, -15, 97, -32, -73, -2, -26, -83, -90, 79, -38, 62, 7, 70, -80, -63, 10, -52, 13, 63, 44, -76, 27, 12, 69, 96, -40, -57, 94, -87, -107, 125, -23, -73, -109, 102, -58, -17, -110, -12, 34, 43, -12, -76, -70, 30, -1, -107, 39, -106, -81, -31, 9, 12, -9, -87, -111, -103, 120, 61, -70, 54, -91, -7, 81, -101, -114, 42, -117, 110, -44, 27, -44, -89, 21, -49, -35, 10, 55, 28, -39, 83, 29, -15, 63, 51, 10, -84, 55, 24, 104, -41, -36, 46, -13, -83, -38, 35, -60, -81, 51, -8, -20, 48, -108, 45, -9, -4, -110, -1, 16, 11, -34, -89, -115, 68, -109, -23, 69, 94, 104, 8, 95, -23, -66, 123, 115, 47, 86, -26, 80, -3, 119, -63, -94, 115, -25, 26, 23, 98, 125, -14, -110, -4, -100, 69, 111, 8, -59, -8, -114, -128, 79, -65, -35, -7, 115, -81, -3, -55, 81, 108, -64, -107, -107, 122, -110, -112, -48, 75, 39, 11, 124, 29, -15, 85, 76, -82, -115, -66, -71, -51, 35, 58, 13, 72, 90, -70, -4, 53, 15, -43, 66, -30, -16, 61, -23, 74, -21, -102, 95, -76, 123, 98, 56, -7, 89, -30, -14, -4, -114, -120, -128, 74, 108, 3, 35, -7, -56, 82, -122, -93, 22, 23, -43, -122, -84, 8, -44, 122, 15, 39, -70, 14, -42, 102, 100, 127, 122, -13, -97, -18, 125, 28, 74, -54, 30, 40, -21, -38, 108, 26, -110, -120, -32, -94, 23, 5, -76, 122, 38, -123, -25, -63, 117, 63, -73, -120, -84, 89, -88, -7, -69, -16, -43, -40, -19, -28, 51, 101, 122, -40, -7, 64, 47, 98, -77, -87, 123, 103, 78, 105, -14, -96, -46, -68, -9, -41, -30, 100, 64, 10, 44, -50, -114, 107, -57, 94, 24, 117, -4, 65, 122, 74, -34, -87, -19, 65, -55, 68, -89, 111, -107, -83, -41, 75, 103, 38, 14, 89, 89, 69, -46, -95, 81, -128, 72, 82, 30, -110, -125, -36, 80, 21, 70, 38, 60, 46, 88, -40, 9, -9, 9, -94, 42, 14, 95, 90, -126, -68, -82, -122, -98, 83, 37, -16, -36, -128, -40, -113, 87, -94, -12, 58, 44, -29, 4, -80, -30, 109, -73, 126, 3, -43, -41, -20, 19, -52, -5, -123, 94, -90, -1, 24, -117, 40, 42, -101, -107, 35, 5, -27, -84, 29, -124, -9, 45, -14, -100, -66, -23, -93, -108, 41, 30, 44, 112, 115, -54, -117, -121, 18, -51, -121, -70, -57, 67, 52, 43, -121, -115, 12, -35, 10, -15, 69, 70, 37, -39, -36, 73, 61, -5, 61, 92, -84, -96, 19, 21, 28, 93, 35, -71, -27, 27, -84, 124, -121, 86, -100, 45, -58, -111, -18, -1, -70, -125, -112, -53, 30, 91, -109, 64, 69, -26, 41, -30, 66, -72, -43, 99, 69, -103, 49, -27, 107, 37, -17, 98, -75, 8, -73, 127, 55, -1, -115, 71, -89, 66, 90, 112, 22, 74, 63, -107, 65, 87, -10, 58, -82, -86, 124, 0, -48, 4, 3, -113, 7, -26, 49, 32, -112, 122, -92, -78, -29, -94, -123, 1, 85, 54, 29, -119, -34, 53, 79, -93, -107, -121, -123, 72, 72, -61, -92, -95, 100, 113, -27, -90, 35, 14, 16, -9, -111, -44, -112, -12, -97, -15, -64, 58, 80, -109, 27, -128, -24, -22, 28, -20, 7, -70, 3, 30, -77, -61, 67, -126, -71, -61, 9, 115, -31, 11, 4, -14, -120, -112, 87, -13, -85, -52, 33, -75, 91, -75, 64, -71, 57, 61, -53, 88, 87, -35, -22, -117, -71, -9, 66, 64, 102, 68, -26, 51, -120, 104, 94, 106, 29, 127, -37, 25, 14, -64, -99, 26, -118, 6, -56, -79, -16, 98, -93, -106, 93, -39, 26, 29, -80, 67, -60, 76, 41, -63, 69, -2, 125, 117, 35, -106, 84, 39, -55, 108, 103, -38, 66, -121, -18, 58, 106, 42, -23, -12, 37, -68, 8, 20, 100, -113, 21, 12, 35, -41, -80, 8, 67, -101, -31, 125, -125, -17, 122, -6, 57, -68, 40, 13, 88, 47, -82, -44, -119, -98, 20, 17, 15, -82, 60, 32, 40, -91, -75, -50, -35, -35, -127, -74, 119, -36, 59, 62, 62, -42, 22, -14, -7, 8, 106, -15, 42, 118, 116, 125, 109, -58, 99, 96, 111, -94, -99, 0, -58, 13, 114, -7, 49, -126, 93, -108, 116, 30, -42, 37, 78, 126, 98, 120, -28, -53, 73, -21, -29, -97, 62, 39, 62, -57, 43, -71, 28, 27, 99, 10, 64, 121, 122, -9, 3, 119, 97, -75, 2, 126, -24, -62, 90, 68, 89, 77, -37, 47, 31, 80, 36, -126, 5, -64, -10, -9, -5, 6, -120, -18, -72, 119, -114, -13, 57, 82, 103, 29, -43, -25, -41, 110, -48, -83, -15, -32, 18, -8, 7, 37, 16, -74, 75, -120, -119, 28, -53, -72, -8, -118, -98, 112, 5, 117, -6, -88, -28, -117, 41, 123, -15, -21, 71, -71, -40, -11, 86, -30, 41, -38, 13, -6, -59, 63, -24, -80, -38, -128, -38, 58, 103, 102, -106, -107, 73, -83, -127, 40, -43, 36, -32, 23, -22, -65, -32]", + "x-ms-client-request-id" : "e3852821-f908-4508-9104-66993c5dced3", + "Content-Type" : "application/octet-stream" + }, + "Exception" : null + } ], + "variables" : [ "70e98d95-cf02-4a49-b2c2-5fbeaa4d5a8d", "jtcuploaddownload0localkeytestuploaddownloada06506847931b", "javablobuploaddownload1localkeytestuploaddownloada0619788733", "8531ac28-5e2a-4896-8eeb-906b2fae24bb" ] +} \ No newline at end of file diff --git a/sdk/storage/test-resources.json b/sdk/storage/test-resources.json index d60bc654fa19a..3c07180ccf245 100644 --- a/sdk/storage/test-resources.json +++ b/sdk/storage/test-resources.json @@ -9,6 +9,13 @@ "type": "string", "defaultValue": "core.windows.net" }, + "tenantId": { + "type": "string", + "defaultValue": "72f988bf-86f1-41af-91ab-2d7cd011db47", + "metadata": { + "description": "The tenant ID to which the application and resources belong." + } + }, "testApplicationOid": { "type": "string", "metadata": { @@ -18,6 +25,7 @@ }, "variables": { "storageApiVersion": "2019-06-01", + "keyVaultApiVersion": "2016-10-01", "authorizationApiVersion": "2018-09-01-preview", "blobDataContributorRoleId": "[concat('/subscriptions/', subscription().subscriptionId, '/providers/Microsoft.Authorization/roleDefinitions/ba92f5b4-2d11-453d-a403-e96b0029c9fe')]", "contributorRoleId": "[concat('/subscriptions/', subscription().subscriptionId, '/providers/Microsoft.Authorization/roleDefinitions/b24988ac-6180-42a0-ab88-20f7382dd24c')]", @@ -26,6 +34,8 @@ "premiumAccountName": "[concat('prem', parameters('baseName'))]", "dataLakeAccountName": "[concat('dtlk', parameters('baseName'))]", "premiumFileAccountName": "[concat('premf', parameters('baseName'))]", + "keyvaultName": "[concat(parameters('baseName'), 'kvlt')]", + "azureKeyVaultUrl": "[format('https://{0}.vault.azure.net', variables('keyvaultName'))]", "location": "[resourceGroup().location]" }, "resources": [ @@ -239,6 +249,77 @@ "keySource": "Microsoft.Storage" } } + }, + { + "type": "Microsoft.KeyVault/vaults", + "apiVersion": "[variables('keyvaultApiVersion')]", + "name": "[variables('keyvaultName')]", + "location": "[variables('location')]", + "properties": { + "sku": { + "family": "A", + "name": "premium" + }, + "tenantId": "[parameters('tenantId')]", + "accessPolicies": [ + { + "tenantId": "[parameters('tenantId')]", + "objectId": "[parameters('testApplicationOid')]", + "permissions": { + "keys": [ + "get", + "list", + "update", + "create", + "import", + "delete", + "recover", + "backup", + "restore", + "decrypt", + "encrypt", + "unwrapKey", + "wrapKey", + "verify", + "sign", + "purge" + ], + "secrets": [ + "get", + "list", + "set", + "delete", + "recover", + "backup", + "restore", + "purge" + ], + "certificates": [ + "get", + "list", + "update", + "create", + "import", + "delete", + "recover", + "backup", + "restore", + "managecontacts", + "manageissuers", + "getissuers", + "listissuers", + "setissuers", + "deleteissuers", + "purge" + ] + } + } + ], + "enabledForDeployment": false, + "enabledForDiskEncryption": false, + "enabledForTemplateDeployment": false, + "enableSoftDelete": false + } } ], "outputs": { @@ -326,7 +407,10 @@ "AZURE_STORAGE_QUEUE_CONNECTION_STRING": { "type": "string", "value": "[concat('DefaultEndpointsProtocol=https;AccountName=', variables('primaryAccountName'), ';AccountKey=', listKeys(resourceId('Microsoft.Storage/storageAccounts', variables('primaryAccountName')), variables('storageApiVersion')).keys[0].value, ';EndpointSuffix=', parameters('endpointSuffix'))]" + }, + "KEYVAULT_URL":{ + "type": "string", + "value": "[variables('azureKeyVaultUrl')]" } - } } From 2ff45e1f353927c1eabd233fb0aedfb46a62d1a2 Mon Sep 17 00:00:00 2001 From: eboyd23 <65251944+eboyd23@users.noreply.github.com> Date: Mon, 13 Jul 2020 17:21:09 -0400 Subject: [PATCH 104/129] Azure Tables Sync and Async Code Snippets (#12169) * Azure Tables Sync and Async Code Snippets --- sdk/tables/azure-data-tables/pom.xml | 24 ++- .../com/azure/data/tables/AzureTable.java | 31 +++ .../com/azure/data/tables/QueryOptions.java | 79 ++++++++ .../azure/data/tables/TableAsyncClient.java | 106 ++++++++++ .../com/azure/data/tables/TableClient.java | 99 +++++++++ .../azure/data/tables/TableClientBuilder.java | 80 ++++++++ .../com/azure/data/tables/TableEntity.java | 45 +++++ .../data/tables/TableServiceAsyncClient.java | 70 +++++++ .../azure/data/tables/TableServiceClient.java | 74 +++++++ .../tables/TableServiceClientBuilder.java | 164 +++++++++++++++ .../data/tables/TablesServiceVersion.java | 35 ++++ .../com/azure/data/tables/UpdateMode.java | 11 + .../com/azure/data/tables/package-info.java | 4 +- .../TableServiceAsyncClientCodeSnippets.java | 183 +++++++++++++++++ .../java/TableServiceClientCodeSnippets.java | 191 ++++++++++++++++++ 15 files changed, 1192 insertions(+), 4 deletions(-) create mode 100644 sdk/tables/azure-data-tables/src/main/java/com/azure/data/tables/AzureTable.java create mode 100644 sdk/tables/azure-data-tables/src/main/java/com/azure/data/tables/QueryOptions.java create mode 100644 sdk/tables/azure-data-tables/src/main/java/com/azure/data/tables/TableAsyncClient.java create mode 100644 sdk/tables/azure-data-tables/src/main/java/com/azure/data/tables/TableClient.java create mode 100644 sdk/tables/azure-data-tables/src/main/java/com/azure/data/tables/TableClientBuilder.java create mode 100644 sdk/tables/azure-data-tables/src/main/java/com/azure/data/tables/TableEntity.java create mode 100644 sdk/tables/azure-data-tables/src/main/java/com/azure/data/tables/TableServiceAsyncClient.java create mode 100644 sdk/tables/azure-data-tables/src/main/java/com/azure/data/tables/TableServiceClient.java create mode 100644 sdk/tables/azure-data-tables/src/main/java/com/azure/data/tables/TableServiceClientBuilder.java create mode 100644 sdk/tables/azure-data-tables/src/main/java/com/azure/data/tables/TablesServiceVersion.java create mode 100644 sdk/tables/azure-data-tables/src/main/java/com/azure/data/tables/UpdateMode.java create mode 100644 sdk/tables/azure-data-tables/src/samples/java/TableServiceAsyncClientCodeSnippets.java create mode 100644 sdk/tables/azure-data-tables/src/samples/java/TableServiceClientCodeSnippets.java diff --git a/sdk/tables/azure-data-tables/pom.xml b/sdk/tables/azure-data-tables/pom.xml index f8569c52af8fa..79c42cfcdfd26 100644 --- a/sdk/tables/azure-data-tables/pom.xml +++ b/sdk/tables/azure-data-tables/pom.xml @@ -49,14 +49,26 @@ Licensed under the MIT License. org.junit.jupiter - junit-jupiter - 5.6.2 + junit-jupiter-api + 5.6.2 + test + + + org.junit.jupiter + junit-jupiter-engine + 5.6.2 + test + + + org.junit.jupiter + junit-jupiter-params + 5.6.2 test io.projectreactor reactor-test - 3.3.5.RELEASE + 3.3.5.RELEASE test @@ -65,6 +77,12 @@ Licensed under the MIT License. 1.3.1 test + + org.mockito + mockito-core + 3.0.0 + test + diff --git a/sdk/tables/azure-data-tables/src/main/java/com/azure/data/tables/AzureTable.java b/sdk/tables/azure-data-tables/src/main/java/com/azure/data/tables/AzureTable.java new file mode 100644 index 0000000000000..98cbc85982034 --- /dev/null +++ b/sdk/tables/azure-data-tables/src/main/java/com/azure/data/tables/AzureTable.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +package com.azure.data.tables; + +/** + * class for a table object + */ +public class AzureTable { + private final String name; + + AzureTable(String name) { + this.name = name; + } + + /** + * returns the name of this table + * + * @return table name + */ + public String getName() { + return name; + } + + /** + * returns the associated table client or null if it doesn't exist + * @return the associated table client + */ + public TableClient getClient() { + return null; + } +} diff --git a/sdk/tables/azure-data-tables/src/main/java/com/azure/data/tables/QueryOptions.java b/sdk/tables/azure-data-tables/src/main/java/com/azure/data/tables/QueryOptions.java new file mode 100644 index 0000000000000..bd10b72ae4b0c --- /dev/null +++ b/sdk/tables/azure-data-tables/src/main/java/com/azure/data/tables/QueryOptions.java @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.data.tables; + +import com.azure.core.annotation.Fluent; + +/** + * helps construct a query + */ +@Fluent +public final class QueryOptions { + private Integer top; + private String select; + private String filter; + + /** + * Get the top property: Maximum number of records to return. + * + * @return the top value. + */ + public Integer getTop() { + return this.top; + } + + /** + * Set the top property: Maximum number of records to return. + * + * @param top the top value to set. + * @return the QueryOptions object itself. + */ + public QueryOptions setTop(Integer top) { + this.top = top; + return this; + } + + /** + * Get the select property: Select expression using OData notation. Limits the columns on each record to just those + * requested, e.g. "$select=PolicyAssignmentId, ResourceId". + * + * @return the select value. + */ + public String getSelect() { + return this.select; + } + + /** + * Set the select property: Select expression using OData notation. Limits the columns on each record to just those + * requested, e.g. "$select=PolicyAssignmentId, ResourceId". + * + * @param select the select value to set. + * @return the QueryOptions object itself. + */ + public QueryOptions setSelect(String select) { + this.select = select; + return this; + } + + /** + * Get the filter property: OData filter expression. + * + * @return the filter value. + */ + public String getFilter() { + return this.filter; + } + + /** + * Set the filter property: OData filter expression. + * + * @param filter the filter value to set. + * @return the QueryOptions object itself. + */ + public QueryOptions setFilter(String filter) { + this.filter = filter; + return this; + } +} + diff --git a/sdk/tables/azure-data-tables/src/main/java/com/azure/data/tables/TableAsyncClient.java b/sdk/tables/azure-data-tables/src/main/java/com/azure/data/tables/TableAsyncClient.java new file mode 100644 index 0000000000000..a1f5d555f399c --- /dev/null +++ b/sdk/tables/azure-data-tables/src/main/java/com/azure/data/tables/TableAsyncClient.java @@ -0,0 +1,106 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +package com.azure.data.tables; + +import com.azure.core.annotation.ServiceClient; +import com.azure.core.http.rest.PagedFlux; +import java.util.Map; +import reactor.core.publisher.Mono; + +/** + * class for the table async client + */ +@ServiceClient( + builder = TableClientBuilder.class, + isAsync = true) +public class TableAsyncClient { + private final String tableName; + + TableAsyncClient(String tableName) { + this.tableName = tableName; + } + + /** + * Queries and returns entities in the given table using the select and filter strings + * + * @param queryOptions the odata query object + * @return a paged flux of all the entity which fit this criteria + */ + public PagedFlux queryEntities(QueryOptions queryOptions) { + return null; + } + + /** + * returns the entity with the given rowKey and ParitionKey + * + * @param rowKey the given row key + * @param partitionKey the given partition key + * @return an entity that fits the criteria + */ + public Mono get(String rowKey, String partitionKey) { + return null; + } + + /** + * insert a TableEntity with the given properties and return that TableEntity. Property map must include + * rowKey and partitionKey + * + * @param tableEntityProperties a map of properties for the TableEntity + * @return the created TableEntity + */ + public Mono createEntity(Map tableEntityProperties) { + return Mono.empty(); + } + + /** + * based on Mode it either inserts or merges if exists or inserts or merges if exists + * + * @param updateMode type of upsert + * @param tableEntity entity to upsert + * @return void + */ + public Mono upsertEntity(UpdateMode updateMode, TableEntity tableEntity) { + return Mono.empty(); + } + + /** + * based on Mode it either updates or fails if it does exists or replaces or fails if it does exists + * + * @param updateMode type of update + * @param tableEntity entity to update + * @return void + */ + public Mono updateEntity(UpdateMode updateMode, TableEntity tableEntity) { + return Mono.empty(); + } + + /** + * deletes the given entity + * + * @param tableEntity entity to delete + * @return void + */ + public Mono deleteEntity(TableEntity tableEntity) { + return Mono.empty(); + } + + /** + * deletes the given entity + * + * @param partitionKey the partition key + * @param rowKey the row key + * @return void + */ + public Mono deleteEntity(String partitionKey, String rowKey) { + return Mono.empty(); + } + + /** + * returns the table name associated with the client + * + * @return table name + */ + public String getTableName() { + return tableName; + } +} diff --git a/sdk/tables/azure-data-tables/src/main/java/com/azure/data/tables/TableClient.java b/sdk/tables/azure-data-tables/src/main/java/com/azure/data/tables/TableClient.java new file mode 100644 index 0000000000000..6eabb5e67b87b --- /dev/null +++ b/sdk/tables/azure-data-tables/src/main/java/com/azure/data/tables/TableClient.java @@ -0,0 +1,99 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +package com.azure.data.tables; + +import com.azure.core.annotation.ServiceClient; +import java.util.List; +import java.util.Map; + +/** + * sync client for table operations + */ +@ServiceClient( + builder = TableClientBuilder.class) +public class TableClient { + final String tableName; + + TableClient(String tableName) { + this.tableName = tableName; + } + + /** + * Queries and returns entities in the given table using the select and filter strings + * + * @param queryOptions the odata query object + * @return a list of the tables that fit the query + */ + public List queryEntities(QueryOptions queryOptions) { + return null; + } + + /** + * returns the entity with the given rowKey and ParitionKey + * + * @param rowKey the given row key + * @param partitionKey the given partition key + * @return an entity that fits the criteria + */ + public TableEntity get(String rowKey, String partitionKey) { + return null; + } + + + /** + * insert a TableEntity with the given properties and return that TableEntity. Property map must include + * rowKey and partitionKey + * + * @param tableEntityProperties a map of properties for the TableEntity + * @return the created TableEntity + */ + public TableEntity createEntity(Map tableEntityProperties) { + return null; + } + + /** + * based on Mode it either inserts or merges if exists or inserts or merges if exists + * + * @param updateMode type of upsert + * @param tableEntity entity to upsert + */ + public void upsertEntity(UpdateMode updateMode, TableEntity tableEntity) { + } + + /** + * based on Mode it either updates or fails if it does exists or replaces or fails if it does exists + * + * @param updateMode type of update + * @param tableEntity entity to update + */ + public void updateEntity(UpdateMode updateMode, TableEntity tableEntity) { + } + + /** + * deletes the given entity + * + * @param tableEntity entity to delete + */ + public void deleteEntity(TableEntity tableEntity) { + } + + /** + * deletes the given entity + * + * @param partitionKey the partition key + * @param rowKey the row key + */ + public void deleteEntity(String partitionKey, String rowKey) { + } + + /** + * returns the table name associated with the client + * + * @return table name + */ + public String getTableName() { + return this.tableName; + } + + +} diff --git a/sdk/tables/azure-data-tables/src/main/java/com/azure/data/tables/TableClientBuilder.java b/sdk/tables/azure-data-tables/src/main/java/com/azure/data/tables/TableClientBuilder.java new file mode 100644 index 0000000000000..fa1e59dec0407 --- /dev/null +++ b/sdk/tables/azure-data-tables/src/main/java/com/azure/data/tables/TableClientBuilder.java @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +package com.azure.data.tables; + +import com.azure.core.annotation.ServiceClientBuilder; +import com.azure.core.credential.TokenCredential; + +/** + * builds table client + */ +@ServiceClientBuilder(serviceClients = {TableClient.class, TableAsyncClient.class}) +public class TableClientBuilder { + private String connectionString; + private String tableName; + + /** + * Sets the connection string to help build the client + * + * @param connectionString the connection string to the storage account + * @return the TableClientBuilder + */ + public TableClientBuilder connectionString(String connectionString) { + this.connectionString = connectionString; + return this; + } + + /** + * Sets the tokenCredential to help build the client + * + * @param tokenCredential the tokenCredential to the storage account + * @return the TableClientBuilder + */ + public TableClientBuilder connectionString(TokenCredential tokenCredential) { + return this; + } + + /** + * Sets the table name to help build the client + * + * @param tableName name of the table for which the client is created for + * @return the TableClientBuilder + */ + public TableClientBuilder tableName(String tableName) { + this.tableName = tableName; + return this; + } + + /** + * builds a sync tableClient + * + * @return a sync tableClient + */ + public TableClient buildClient() { + return new TableClient(tableName); + } + + /** + * builds an async tableClient + * + * @return an aysnc tableClient + */ + public TableAsyncClient buildAsyncClient() { + return new TableAsyncClient(tableName); + } + + /** + * table client builder constructor + */ + public TableClientBuilder() { + } + + /** + * gets the connection string + * @return the connection string + */ + public String getConnectionString() { + return this.connectionString; + } + +} diff --git a/sdk/tables/azure-data-tables/src/main/java/com/azure/data/tables/TableEntity.java b/sdk/tables/azure-data-tables/src/main/java/com/azure/data/tables/TableEntity.java new file mode 100644 index 0000000000000..26a8cdf99e093 --- /dev/null +++ b/sdk/tables/azure-data-tables/src/main/java/com/azure/data/tables/TableEntity.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +package com.azure.data.tables; + +import com.azure.core.annotation.Fluent; +import java.util.Map; + +/** + * table entity class + */ +@Fluent +public class TableEntity { + private final Map properties; + //tableName + //etag + + /** + * creates a new TableEntity + * + * @param properties map of properties of the entity + */ + public TableEntity(Map properties) { + this.properties = properties; + } + + /** + * returns a map of properties + * + * @return map of properties of thsi entity + */ + public Map getProperties() { + return properties; + } + + /** + * adds a new property to this entity's property map + * + * @param key the key of the property + * @param value the value of the property + * @return the updated entity + */ + public TableEntity addProperty(String key, Object value) { + return this; + } +} diff --git a/sdk/tables/azure-data-tables/src/main/java/com/azure/data/tables/TableServiceAsyncClient.java b/sdk/tables/azure-data-tables/src/main/java/com/azure/data/tables/TableServiceAsyncClient.java new file mode 100644 index 0000000000000..bc4dac36d2c9b --- /dev/null +++ b/sdk/tables/azure-data-tables/src/main/java/com/azure/data/tables/TableServiceAsyncClient.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +package com.azure.data.tables; + +import com.azure.core.annotation.ServiceClient; +import com.azure.core.http.rest.PagedFlux; +import reactor.core.publisher.Mono; + +/** + * async client for account operations + */ +@ServiceClient( + builder = TableServiceClientBuilder.class, + isAsync = true) +public class TableServiceAsyncClient { + + TableServiceAsyncClient() { + } + + /** + * creates the table with the given name. If a table with the same name already exists, the operation fails. + * + * @param name the name of the table to create + * @return a table client connected to the given table + */ + public Mono createTable(String name) { + return null; + } + + /** + * deletes the given table. Will error if the table doesn't exists or cannot be found with the given name. + * + * @param name the name of the table to delete + * @return mono void + */ + public Mono deleteTable(String name) { + return Mono.empty(); + } + + /** + * deletes the given table. Will error if the table doesn't exists or cannot be found with the given name. + * + * @param azureTable the table to delete + * @return mono void + */ + public Mono deleteTable(AzureTable azureTable) { + return Mono.empty(); + } + + /** + * retrieves the async table client for the provided table or creates one if it doesn't exist + * + * @param name the name of the table + * @return associated TableAsyncClient + */ + public TableAsyncClient getTableAsyncClient(String name) { + return null; + } + + /** + * query all the tables under the storage account and return them + * + * @param queryOptions the odata query object + * @return a flux of the tables that met this criteria + */ + public PagedFlux queryTables(QueryOptions queryOptions) { + return null; + } + +} diff --git a/sdk/tables/azure-data-tables/src/main/java/com/azure/data/tables/TableServiceClient.java b/sdk/tables/azure-data-tables/src/main/java/com/azure/data/tables/TableServiceClient.java new file mode 100644 index 0000000000000..8bca972d91564 --- /dev/null +++ b/sdk/tables/azure-data-tables/src/main/java/com/azure/data/tables/TableServiceClient.java @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +package com.azure.data.tables; + +import com.azure.core.annotation.ServiceClient; + +import java.util.List; + +/** + * client for table service + */ +@ServiceClient( + builder = TableServiceClientBuilder.class) +public class TableServiceClient { + + TableServiceClient() { + } + + /** + * creates the table with the given name. If a table with the same name already exists, the operation fails. + * + * @param name the name of the table to create + * @return AzureTable of the created table + */ + public AzureTable createTable(String name) { + return null; + } + + /** + * deletes the given table. Will error if the table doesn't exists or cannot be found with the given name. + * + * @param name the name of the table to be deleted + */ + public void deleteTable(String name) { + } + + /** + * deletes the given table. Will error if the table doesn't exists or cannot be found with the given name. + * + * @param azureTable the table to be deleted + */ + public void deleteTable(AzureTable azureTable) { + } + + /** + * gets a given table by name + * + * @param name the name of the table + * @return associated azure table object + */ + public AzureTable getTable(String name) { + return null; + } + + /** + * gets the Table Client for the given table + * @param name the name of the table + * @return the Table Client for the table + */ + public TableClient getTableClient(String name) { + return null; + } + + /** + * query all the tables under the storage account and return them + * + * @param queryOptions the odata query object + * @return a list of tables that meet the query + */ + public List queryTables(QueryOptions queryOptions) { + return null; + } + +} diff --git a/sdk/tables/azure-data-tables/src/main/java/com/azure/data/tables/TableServiceClientBuilder.java b/sdk/tables/azure-data-tables/src/main/java/com/azure/data/tables/TableServiceClientBuilder.java new file mode 100644 index 0000000000000..4eefce10a47f9 --- /dev/null +++ b/sdk/tables/azure-data-tables/src/main/java/com/azure/data/tables/TableServiceClientBuilder.java @@ -0,0 +1,164 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +package com.azure.data.tables; + +import com.azure.core.annotation.ServiceClientBuilder; +import com.azure.core.http.HttpClient; +import com.azure.core.http.policy.HttpLogOptions; +import com.azure.core.http.policy.HttpPipelinePolicy; +import com.azure.core.util.logging.ClientLogger; +import java.util.ArrayList; +import java.util.List; +import com.azure.core.util.Configuration; +import java.util.Objects; + +/** + * builds the table service clients + */ +@ServiceClientBuilder(serviceClients = {TableServiceClient.class, TableServiceAsyncClient.class}) +public class TableServiceClientBuilder { + private final ClientLogger logger = new ClientLogger(TableServiceClientBuilder.class); + private final List additionalPolicies = new ArrayList<>(); + private String connectionString; + private Configuration configuration; + private TablesSharedKeyCredential tablesSharedKeyCredential; + private String endpoint; + private HttpClient httpClient; + private HttpLogOptions logOptions; + private TablesServiceVersion version; + + /** + * Sets the connection string to help build the client + * + * @param connectionString the connection string to the storage account + * @return the TableServiceClientBuilder + */ + public TableServiceClientBuilder connectionString(String connectionString) { + this.connectionString = connectionString; + return this; + } + + /** + * builds a sync TableServiceClient + * + * @return a sync TableServiceClient + */ + public TableServiceClient buildClient() { + return new TableServiceClient(); + } + + /** + * builds an async TableServiceAsyncClient + * + * @return TableServiceAsyncClient an aysnc TableServiceAsyncClient + */ + public TableServiceAsyncClient buildAsyncClient() { + return new TableServiceAsyncClient(); + } + + /** + * constructor + */ + public TableServiceClientBuilder() { + + } + + /** + * gets the connection string + * @return the connection string + */ + public String getConnectionString() { + return this.connectionString; + } + + /** + * Sets the configuration object used to retrieve environment configuration values during building of the client. + * + * @param configuration Configuration store used to retrieve environment configurations. + * @return the updated TableServiceClientBuilder object + */ + public TableServiceClientBuilder configuration(Configuration configuration) { + this.configuration = configuration; + return this; + } + + /** + * update credential + * @param credential the tables shared key credential + * @return the updated TableServiceClient builder + * @throws NullPointerException If {@code credential} is {@code null}. + */ + public TableServiceClientBuilder credential(TablesSharedKeyCredential credential) { + this.tablesSharedKeyCredential = Objects.requireNonNull(tablesSharedKeyCredential, "credential cannot" + + "be null"); + return this; + } + + /** + * Sets the table service endpoint + * + * @param endpoint URL of the service + * @return the updated TableServiceClientBuilder object + */ + public TableServiceClientBuilder endpoint(String endpoint) { + this.endpoint = endpoint; + return this; + } + + /** + * Sets the {@link HttpClient} to use for sending a receiving requests to and from the service. + * + * @param httpClient HttpClient to use for requests. + * @return the updated TableServiceClientBuilder object + */ + public TableServiceClientBuilder httpClient(HttpClient httpClient) { + if (this.httpClient != null && httpClient == null) { + logger.error("'httpClient' is being set to 'null' when it was previously configured."); + } + this.httpClient = httpClient; + return this; + } + + /** + * Sets the {@link HttpLogOptions} for service requests. + * + * @param logOptions The logging configuration to use when sending and receiving HTTP requests/responses. + * @return the updated TableServiceClientBuilder object + * @throws NullPointerException If {@code logOptions} is {@code null}. + */ + public TableServiceClientBuilder httpLogOptions(HttpLogOptions logOptions) { + this.logOptions = Objects.requireNonNull(logOptions, "'logOptions' cannot be null."); + return this; + } + + /** + * Adds a pipeline policy to apply on each request sent. The policy will be added after the retry policy. If + * the method is called multiple times, all policies will be added and their order preserved. + * + * @param pipelinePolicy a pipeline policy + * @return the updated TableServiceClientBuilder object + * @throws NullPointerException If {@code pipelinePolicy} is {@code null}. + */ + public TableServiceClientBuilder addPolicy(HttpPipelinePolicy pipelinePolicy) { + this.additionalPolicies.add(Objects.requireNonNull(pipelinePolicy, "'pipelinePolicy' cannot be null")); + return this; + } + + /** + * Sets the TablesServiceVersion that is used when making API requests. + *

+ * If a service version is not provided, the service version that will be used will be the latest known service + * version based on the version of the client library being used. If no service version is specified, updating to a + * newer version of the client library will have the result of potentially moving to a newer service version. + *

+ * Targeting a specific service version may also mean that the service will return an error for newer APIs. + * + * @param version {@link TablesServiceVersion} of the service to be used when making requests. + * @return the updated TableServiceClientBuilder object + */ + public TableServiceClientBuilder serviceVersion(TablesServiceVersion version) { + this.version = version; + return this; + } + +} diff --git a/sdk/tables/azure-data-tables/src/main/java/com/azure/data/tables/TablesServiceVersion.java b/sdk/tables/azure-data-tables/src/main/java/com/azure/data/tables/TablesServiceVersion.java new file mode 100644 index 0000000000000..6deb608f8cc43 --- /dev/null +++ b/sdk/tables/azure-data-tables/src/main/java/com/azure/data/tables/TablesServiceVersion.java @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +package com.azure.data.tables; + +import com.azure.core.util.ServiceVersion; + +/** + * The versions of Azure Storage Tables supported by this client library. + */ +public enum TablesServiceVersion implements ServiceVersion { + V2019_02_02("no yet implemented"); + private final String version; + + TablesServiceVersion(String version) { + this.version = version; + } + + /** + * {@inheritDoc} + */ + @Override + public String getVersion() { + return this.version; + } + + /** + * Gets the latest service version supported by this client library + * + * @return the latest TablesServiceVersion + */ + public static TablesServiceVersion getLatest() { + return V2019_02_02; + } + +} diff --git a/sdk/tables/azure-data-tables/src/main/java/com/azure/data/tables/UpdateMode.java b/sdk/tables/azure-data-tables/src/main/java/com/azure/data/tables/UpdateMode.java new file mode 100644 index 0000000000000..8e990483add07 --- /dev/null +++ b/sdk/tables/azure-data-tables/src/main/java/com/azure/data/tables/UpdateMode.java @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +package com.azure.data.tables; + +/** + * update type for update and upsert methods + */ +public enum UpdateMode { + MERGE, + REPLACE +} diff --git a/sdk/tables/azure-data-tables/src/main/java/com/azure/data/tables/package-info.java b/sdk/tables/azure-data-tables/src/main/java/com/azure/data/tables/package-info.java index 22fcc4bc3349a..42528acca50a7 100644 --- a/sdk/tables/azure-data-tables/src/main/java/com/azure/data/tables/package-info.java +++ b/sdk/tables/azure-data-tables/src/main/java/com/azure/data/tables/package-info.java @@ -1,5 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -/** Package containing the inner classes for Azure Tables SDK. */ +/** + * Package containing the classes for Tables Clients. + */ package com.azure.data.tables; diff --git a/sdk/tables/azure-data-tables/src/samples/java/TableServiceAsyncClientCodeSnippets.java b/sdk/tables/azure-data-tables/src/samples/java/TableServiceAsyncClientCodeSnippets.java new file mode 100644 index 0000000000000..6f2eadec86981 --- /dev/null +++ b/sdk/tables/azure-data-tables/src/samples/java/TableServiceAsyncClientCodeSnippets.java @@ -0,0 +1,183 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +package com.azure.data.tables; + +import java.util.HashMap; +import java.util.Map; +import reactor.core.publisher.Mono; + +/** + * async code snippets for the table service + */ +public class TableServiceAsyncClientCodeSnippets { + + + /** + * create table code snippet + */ + public void createTable() { + TableServiceAsyncClient tableServiceAsyncClient = new TableServiceClientBuilder() + .connectionString("connectionString") + .buildAsyncClient(); + + tableServiceAsyncClient.createTable("OfficeSupplies").subscribe( + Void -> { }, + error -> System.err.println("There was an error creating the table. Error: " + error), + () -> System.out.println("Table creation successful.")); + } + + /** + * delete table code snippet + */ + public void deleteTable() { + TableServiceAsyncClient tableServiceAsyncClient = new TableServiceClientBuilder() + .connectionString("connectionString") + .buildAsyncClient(); + + tableServiceAsyncClient.deleteTable("OfficeSupplies").subscribe( + Void -> { }, + error -> System.err.println("There was an error deleting the table. Error: " + error), + () -> System.out.println("Table deletion successful.")); + } + + /** + * query tables code snippet + */ + public void queryTable() { + TableServiceAsyncClient tableServiceAsyncClient = new TableServiceClientBuilder() + .connectionString("connectionString") + .buildAsyncClient(); + QueryOptions queryOptions = new QueryOptions().setFilter("TableName eq OfficeSupplies"); + + tableServiceAsyncClient.queryTables(queryOptions).subscribe(azureTable -> { + System.out.println(azureTable.getName()); + }, error -> { + System.err.println("There was an error querying the service. Error: " + error); + }); + } + + /** + * insert entity code snippet + */ + private void insertEntity() { + TableServiceAsyncClient tableServiceAsyncClient = new TableServiceClientBuilder() + .connectionString("connectionString") + .buildAsyncClient(); + + TableAsyncClient tableAsyncClient = tableServiceAsyncClient.getTableAsyncClient("OfficeSupplies"); + Map properties = new HashMap<>(); + properties.put("RowKey", "crayolaMarkers"); + properties.put("PartitionKey", "markers"); + + tableAsyncClient.createEntity(properties).subscribe(tableEntity -> { + System.out.println("Insert Entity Successful. Entity: " + tableEntity); + }, error -> { + System.err.println("There was an error inserting the Entity. Error: " + error); + }); + } + + /** + * delete entity code snippet + */ + private void deleteEntity() { + TableServiceAsyncClient tableServiceAsyncClient = new TableServiceClientBuilder() + .connectionString("connectionString") + .buildAsyncClient(); + + TableAsyncClient tableAsyncClient = tableServiceAsyncClient.getTableAsyncClient("OfficeSupplies"); + String rowKey = "crayolaMarkers"; + String partitionKey = "markers"; + + tableAsyncClient.get(rowKey, partitionKey).flatMap(tableEntity -> { + System.out.println("Table Entity: " + tableEntity); + return tableAsyncClient.deleteEntity(tableEntity); + }).subscribe( + Void -> { }, + error -> System.err.println("There was an error deleting the Entity. Error: " + error), + () -> System.out.println("Delete Entity Successful.")); + } + + /** + * upsert entity code snippet + */ + private void upsert() { + TableServiceAsyncClient tableServiceAsyncClient = new TableServiceClientBuilder() + .connectionString("connectionString") + .buildAsyncClient(); + + TableAsyncClient tableAsyncClient = tableServiceAsyncClient.getTableAsyncClient("OfficeSupplies"); + String rowKey = "crayolaMarkers"; + String partitionKey = "markers"; + + tableAsyncClient.get(rowKey, partitionKey).flatMap(tableEntity -> { + System.out.println("Table Entity: " + tableEntity); + tableEntity.addProperty("Price", "5"); + Mono updateEntityMono = tableAsyncClient.upsertEntity(UpdateMode.MERGE, tableEntity); + return updateEntityMono; + }).subscribe( + Void -> { }, + error -> System.err.println("There was an error upserting the Entity. Error: " + error), + () -> System.out.println("Upsert Entity Successful.")); + } + + /** + * update entity code snippet + */ + private void update() { + TableServiceAsyncClient tableServiceAsyncClient = new TableServiceClientBuilder() + .connectionString("connectionString") + .buildAsyncClient(); + + TableAsyncClient tableAsyncClient = tableServiceAsyncClient.getTableAsyncClient("OfficeSupplies"); + String rowKey = "crayolaMarkers"; + String partitionKey = "markers"; + + tableAsyncClient.get(rowKey, partitionKey).flatMap(tableEntity -> { + System.out.println("Table Entity: " + tableEntity); + tableEntity.addProperty("Price", "5"); + Mono updateEntityMono = tableAsyncClient.updateEntity(UpdateMode.REPLACE, tableEntity); + return updateEntityMono; + }).subscribe( + Void -> { }, + error -> System.err.println("There was an error updating the Entity. Error: " + error), + () -> System.out.println("Update Entity Successful.")); + } + + /** + * query entity code snippet + */ + private void queryEntities() { + TableServiceAsyncClient tableServiceAsyncClient = new TableServiceClientBuilder() + .connectionString("connectionString") + .buildAsyncClient(); + + TableAsyncClient tableAsyncClient = tableServiceAsyncClient.getTableAsyncClient("OfficeSupplies"); + QueryOptions queryOptions = new QueryOptions() + .setFilter("Product eq markers") + .setSelect("Seller, Price"); + + tableAsyncClient.queryEntities(queryOptions).subscribe(tableEntity -> { + System.out.println("Table Entity: " + tableEntity); + }, error -> { + System.err.println("There was an error querying the table. Error: " + error); + }); + } + + /** + * checks to see if an entity exists code snippet + */ + private void existsEntity() { + TableServiceAsyncClient tableServiceAsyncClient = new TableServiceClientBuilder() + .connectionString("connectionString") + .buildAsyncClient(); + + TableAsyncClient tableAsyncClient = tableServiceAsyncClient.getTableAsyncClient("OfficeSupplies"); + + tableAsyncClient.get("crayolaMarkers", "markers") + .subscribe(tableEntity -> { + System.out.println("Table Entity exists: " + tableEntity); + }, error -> { + System.err.println("There was an error getting the entity. Error: " + error); + }); + } +} diff --git a/sdk/tables/azure-data-tables/src/samples/java/TableServiceClientCodeSnippets.java b/sdk/tables/azure-data-tables/src/samples/java/TableServiceClientCodeSnippets.java new file mode 100644 index 0000000000000..797df52758cf2 --- /dev/null +++ b/sdk/tables/azure-data-tables/src/samples/java/TableServiceClientCodeSnippets.java @@ -0,0 +1,191 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +package com.azure.data.tables; + +import com.azure.core.exception.HttpResponseException; +import com.azure.core.util.logging.ClientLogger; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * sync code snippets for the table service + */ +public class TableServiceClientCodeSnippets { + private final ClientLogger logger = new ClientLogger("TableServiceClientCodeSnippets"); + + /** + * create table code snippet + */ + public void createTable() { + TableServiceClient tableServiceClient = new TableServiceClientBuilder() + .connectionString("connectionString") + .buildClient(); + + try { + AzureTable officeSuppliesTable = tableServiceClient.createTable("OfficeSupplies"); + } catch (Exception e) { + System.err.println("Create Table Unsuccessful. Error: " + e); + } + } + + /** + * delete table code snippet + */ + public void deleteTable() { + TableServiceClient tableServiceClient = new TableServiceClientBuilder() + .connectionString("connectionString") + .buildClient(); + + try { + tableServiceClient.deleteTable("OfficeSupplies"); + } catch (Exception e) { + System.err.println("Delete Table Unsuccessful. Error: " + e); + } + } + + /** + * query table code snippet + */ + public void queryTables() { + TableServiceClient tableServiceClient = new TableServiceClientBuilder() + .connectionString("connectionString") + .buildClient(); + + QueryOptions queryOptions = new QueryOptions().setFilter("TableName eq OfficeSupplies"); + + try { + List responseTables = tableServiceClient.queryTables(queryOptions); + } catch (HttpResponseException e) { + System.err.println("Table Query Unsuccessful. Error: " + e); + } + } + + /** + * insert entity code snippet + */ + private void insertEntity() { + TableClient tableClient = new TableClientBuilder() + .connectionString("connectionString") + .tableName("OfficeSupplies") + .buildClient(); + + Map properties = new HashMap<>(); + properties.put("RowKey", "crayolaMarkers"); + properties.put("PartitionKey", "markers"); + try { + TableEntity tableEntity = tableClient.createEntity(properties); + } catch (HttpResponseException e) { + System.err.println("Insert Entity Unsuccessful. Error: " + e); + } + } + + /** + * update entity code snippet + */ + private void updateEntity() { + TableClient tableClient = new TableClientBuilder() + .connectionString("connectionString") + .tableName("OfficeSupplies") + .buildClient(); + + String rowKey = "crayolaMarkers"; + String partitionKey = "markers"; + TableEntity tableEntity = null; + try { + tableEntity = tableClient.get(rowKey, partitionKey); + } catch (HttpResponseException e) { + System.err.println("Get Entity Unsuccessful: " + e); + } + try { + tableClient.updateEntity(UpdateMode.REPLACE, tableEntity); + } catch (HttpResponseException e) { + System.err.println("Update Entity Unsuccessful. Error: " + e); + } + } + + /** + * upsert entity code snippet + */ + private void upsertEntity() { + TableClient tableClient = new TableClientBuilder() + .connectionString("connectionString") + .tableName("OfficeSupplies") + .buildClient(); + + String rowKey = "crayolaMarkers"; + String partitionKey = "markers"; + TableEntity tableEntity = null; + try { + tableEntity = tableClient.get(rowKey, partitionKey); + } catch (HttpResponseException e) { + System.err.println("Get Entity Unsuccessful: " + e); + } + try { + tableClient.upsertEntity(UpdateMode.REPLACE, tableEntity); + } catch (HttpResponseException e) { + System.err.println("Upsert Entity Unsuccessful. Error: " + e); + } + } + + /** + * delete entity code snippet + */ + private void deleteEntity() { + TableClient tableClient = new TableClientBuilder() + .connectionString("connectionString") + .tableName("OfficeSupplies") + .buildClient(); + + String rowKey = "crayolaMarkers"; + String partitionKey = "markers"; + TableEntity tableEntity = null; + try { + tableEntity = tableClient.get(rowKey, partitionKey); + } catch (HttpResponseException e) { + System.err.println("Get Entity Unsuccessful: " + e); + } + try { + tableClient.deleteEntity(tableEntity); + } catch (HttpResponseException e) { + System.err.println("Delete Entity Unsuccessful. Error: " + e); + } + } + + /** + * query entity code snippet + */ + private void queryEntity() { + TableClient tableClient = new TableClientBuilder() + .connectionString("connectionString") + .tableName("OfficeSupplies") + .buildClient(); + + QueryOptions queryOptions = new QueryOptions() + .setFilter("Product eq markers") + .setSelect("Seller, Price"); + try { + List tableEntities = tableClient.queryEntities(queryOptions); + } catch (HttpResponseException e) { + System.err.println("Query Table Entities Unsuccessful. Error: " + e); + } + } + + /** + * check to see if a table entity exists + */ + public void entityExists() { + TableClient tableClient = new TableClientBuilder() + .connectionString("connectionString") + .tableName("OfficeSupplies") + .buildClient(); + + String rowKey = "crayolaMarkers"; + String partitionKey = "markers"; + try { + TableEntity tableEntity = tableClient.get(rowKey, partitionKey); + } catch (HttpResponseException e) { + System.err.println("Get Entity Unsuccessful. Entity may not exist: " + e); + } + } +} From fedcd535ad2b919f27b254e46141af08590282f4 Mon Sep 17 00:00:00 2001 From: vcolin7 Date: Mon, 13 Jul 2020 14:56:01 -0700 Subject: [PATCH 105/129] Updated CHANGELOG and README files. (#13041) --- .../azure-security-keyvault-certificates/CHANGELOG.md | 4 ++-- sdk/keyvault/azure-security-keyvault-certificates/README.md | 2 +- sdk/keyvault/azure-security-keyvault-keys/CHANGELOG.md | 4 ++-- sdk/keyvault/azure-security-keyvault-keys/README.md | 2 +- sdk/keyvault/azure-security-keyvault-secrets/CHANGELOG.md | 4 ++-- sdk/keyvault/azure-security-keyvault-secrets/README.md | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/sdk/keyvault/azure-security-keyvault-certificates/CHANGELOG.md b/sdk/keyvault/azure-security-keyvault-certificates/CHANGELOG.md index 7acb8f1116a38..032f4a6189e7a 100644 --- a/sdk/keyvault/azure-security-keyvault-certificates/CHANGELOG.md +++ b/sdk/keyvault/azure-security-keyvault-certificates/CHANGELOG.md @@ -1,7 +1,7 @@ # Release History -## 4.1.0-beta.4 (Unreleased) - +## 4.1.0-beta.4 (2020-07-08) +- Updated versions for azure-core, azure-identity. ## 4.1.0-beta.3 (2020-06-10) - Updated version for azure-core, azure-identity and external dependencies. diff --git a/sdk/keyvault/azure-security-keyvault-certificates/README.md b/sdk/keyvault/azure-security-keyvault-certificates/README.md index 9f03fe41d6ddd..7d022c00304c8 100644 --- a/sdk/keyvault/azure-security-keyvault-certificates/README.md +++ b/sdk/keyvault/azure-security-keyvault-certificates/README.md @@ -14,7 +14,7 @@ Maven dependency for the Azure Key Vault Certificate client library. Add it to y com.azure azure-security-keyvault-certificates - 4.0.4 + 4.0.5 ``` [//]: # ({x-version-update-end}) diff --git a/sdk/keyvault/azure-security-keyvault-keys/CHANGELOG.md b/sdk/keyvault/azure-security-keyvault-keys/CHANGELOG.md index fdf6f07507164..67d9ea89c0a90 100644 --- a/sdk/keyvault/azure-security-keyvault-keys/CHANGELOG.md +++ b/sdk/keyvault/azure-security-keyvault-keys/CHANGELOG.md @@ -1,7 +1,7 @@ # Release History -## 4.2.0-beta.5 (Unreleased) - +## 4.2.0-beta.5 (2020-07-08) +- Updated versions for azure-core, azure-identity. ## 4.2.0-beta.4 (2020-06-10) - Updated version for azure-core, azure-identity and external dependencies. diff --git a/sdk/keyvault/azure-security-keyvault-keys/README.md b/sdk/keyvault/azure-security-keyvault-keys/README.md index e8f8db367e75c..43189ca7f2329 100644 --- a/sdk/keyvault/azure-security-keyvault-keys/README.md +++ b/sdk/keyvault/azure-security-keyvault-keys/README.md @@ -14,7 +14,7 @@ Maven dependency for the Azure Key Vault Key client library. Add it to your proj com.azure azure-security-keyvault-keys - 4.1.4 + 4.1.5 ``` [//]: # ({x-version-update-end}) diff --git a/sdk/keyvault/azure-security-keyvault-secrets/CHANGELOG.md b/sdk/keyvault/azure-security-keyvault-secrets/CHANGELOG.md index c156c114f55fe..5e5b041bffa95 100644 --- a/sdk/keyvault/azure-security-keyvault-secrets/CHANGELOG.md +++ b/sdk/keyvault/azure-security-keyvault-secrets/CHANGELOG.md @@ -1,7 +1,7 @@ # Release History -## 4.2.0-beta.4 (Unreleased) - +## 4.2.0-beta.4 (2020-07-08) +- Updated versions for azure-core, azure-identity. ## 4.2.0-beta.3 (2020-06-10) - Updated version for azure-core, azure-identity and external dependencies. diff --git a/sdk/keyvault/azure-security-keyvault-secrets/README.md b/sdk/keyvault/azure-security-keyvault-secrets/README.md index 5db0ab17b4017..b67f216d0cb10 100644 --- a/sdk/keyvault/azure-security-keyvault-secrets/README.md +++ b/sdk/keyvault/azure-security-keyvault-secrets/README.md @@ -16,7 +16,7 @@ Maven dependency for the Azure Key Vault Secrets client library. Add it to your com.azure azure-security-keyvault-secrets - 4.1.4 + 4.1.5 ``` [//]: # ({x-version-update-end}) From 0d1a718c03f3ca780ba66785023410b1ae1c0ed3 Mon Sep 17 00:00:00 2001 From: Jack Lu Date: Tue, 14 Jul 2020 12:53:53 +0800 Subject: [PATCH 106/129] Remove Container throughput default value from SDK (#13125) Signed-off-by: Jack Lu --- .../com/azure/spring/data/cosmos/Constants.java | 1 - .../spring/data/cosmos/core/CosmosTemplate.java | 15 ++++++++++++--- .../data/cosmos/core/ReactiveCosmosTemplate.java | 15 ++++++++++++--- .../spring/data/cosmos/core/mapping/Document.java | 4 ++-- .../support/CosmosEntityInformation.java | 2 +- .../spring/data/cosmos/common/TestConstants.java | 2 -- .../repository/CosmosAnnotationUnitTest.java | 4 ---- 7 files changed, 27 insertions(+), 16 deletions(-) diff --git a/sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/Constants.java b/sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/Constants.java index 58b945d2d507f..47548ad5b229d 100644 --- a/sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/Constants.java +++ b/sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/Constants.java @@ -10,7 +10,6 @@ public final class Constants { public static final String DEFAULT_COLLECTION_NAME = ""; - public static final String DEFAULT_REQUEST_UNIT = "4000"; public static final boolean DEFAULT_INDEXINGPOLICY_AUTOMATIC = true; public static final IndexingMode DEFAULT_INDEXINGPOLICY_MODE = IndexingMode.CONSISTENT; public static final String DEFAULT_REPOSITORY_IMPLEMENT_POSTFIX = "Impl"; diff --git a/sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/core/CosmosTemplate.java b/sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/core/CosmosTemplate.java index 2fbe470dc45af..7b0043ca791b7 100644 --- a/sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/core/CosmosTemplate.java +++ b/sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/core/CosmosTemplate.java @@ -14,6 +14,7 @@ import com.azure.data.cosmos.CosmosClient; import com.azure.data.cosmos.CosmosContainerProperties; import com.azure.data.cosmos.CosmosContainerResponse; +import com.azure.data.cosmos.CosmosDatabase; import com.azure.data.cosmos.PartitionKey; import com.azure.spring.data.cosmos.common.CosmosdbUtils; import com.azure.spring.data.cosmos.common.Memoizer; @@ -402,9 +403,17 @@ public CosmosContainerProperties createContainerIfNotExists(CosmosEntityInformat + information.getPartitionKeyFieldName()); cosmosContainerProperties.defaultTimeToLive(information.getTimeToLive()); cosmosContainerProperties.indexingPolicy(information.getIndexingPolicy()); - return cosmosDatabaseResponse - .database() - .createContainerIfNotExists(cosmosContainerProperties, information.getRequestUnit()) + + CosmosDatabase database = cosmosDatabaseResponse.database(); + Mono mono = null; + + if (information.getRequestUnit() == null) { + mono = database.createContainerIfNotExists(cosmosContainerProperties); + } else { + mono = database.createContainerIfNotExists(cosmosContainerProperties, information.getRequestUnit()); + } + + return mono .onErrorResume(throwable -> CosmosDBExceptionUtils.exceptionHandler("Failed to create container", throwable)) .doOnNext(cosmosContainerResponse -> diff --git a/sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/core/ReactiveCosmosTemplate.java b/sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/core/ReactiveCosmosTemplate.java index d7f5528d8c056..b2e0204aed119 100644 --- a/sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/core/ReactiveCosmosTemplate.java +++ b/sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/core/ReactiveCosmosTemplate.java @@ -13,6 +13,7 @@ import com.azure.data.cosmos.CosmosClient; import com.azure.data.cosmos.CosmosContainerProperties; import com.azure.data.cosmos.CosmosContainerResponse; +import com.azure.data.cosmos.CosmosDatabase; import com.azure.data.cosmos.PartitionKey; import com.azure.spring.data.cosmos.common.CosmosdbUtils; import com.azure.spring.data.cosmos.common.Memoizer; @@ -120,9 +121,17 @@ public Mono createContainerIfNotExists(CosmosEntityInfo "/" + information.getPartitionKeyFieldName()); cosmosContainerProperties.defaultTimeToLive(information.getTimeToLive()); cosmosContainerProperties.indexingPolicy(information.getIndexingPolicy()); - return cosmosDatabaseResponse - .database() - .createContainerIfNotExists(cosmosContainerProperties, information.getRequestUnit()) + + CosmosDatabase database = cosmosDatabaseResponse.database(); + Mono mono = null; + + if (information.getRequestUnit() == null) { + mono = database.createContainerIfNotExists(cosmosContainerProperties); + } else { + mono = database.createContainerIfNotExists(cosmosContainerProperties, information.getRequestUnit()); + } + + return mono .map(cosmosContainerResponse -> { CosmosdbUtils.fillAndProcessResponseDiagnostics(responseDiagnosticsProcessor, cosmosContainerResponse, null); diff --git a/sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/core/mapping/Document.java b/sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/core/mapping/Document.java index 3a1740610df5d..511cea4d7fa35 100644 --- a/sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/core/mapping/Document.java +++ b/sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/core/mapping/Document.java @@ -27,9 +27,9 @@ /** * To set request unit - * @return default as 4000 + * @return default as "" */ - String ru() default Constants.DEFAULT_REQUEST_UNIT; + String ru() default ""; /** * To set the ttl of container level diff --git a/sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/repository/support/CosmosEntityInformation.java b/sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/repository/support/CosmosEntityInformation.java index 940e9e91b7515..268a2c6914d8e 100644 --- a/sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/repository/support/CosmosEntityInformation.java +++ b/sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/repository/support/CosmosEntityInformation.java @@ -266,7 +266,7 @@ private Field getPartitionKeyField(Class domainType) { } private Integer getRequestUnit(Class domainType) { - Integer ru = Integer.parseInt(Constants.DEFAULT_REQUEST_UNIT); + Integer ru = null; final Document annotation = domainType.getAnnotation(Document.class); if (annotation != null diff --git a/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/common/TestConstants.java b/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/common/TestConstants.java index 477e0a75fa644..f05aef2174c10 100644 --- a/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/common/TestConstants.java +++ b/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/common/TestConstants.java @@ -19,7 +19,6 @@ public final class TestConstants { public static final int DEFAULT_TIME_TO_LIVE = -1; public static final String DEFAULT_COLLECTION_NAME = "Person"; - public static final int DEFAULT_REQUEST_UNIT = 4000; public static final boolean DEFAULT_INDEXINGPOLICY_AUTOMATIC = true; public static final IndexingMode DEFAULT_INDEXINGPOLICY_MODE = IndexingMode.CONSISTENT; public static final String[] DEFAULT_EXCLUDEDPATHS = {}; @@ -31,7 +30,6 @@ public final class TestConstants { }; public static final String ROLE_COLLECTION_NAME = "RoleCollectionName"; - public static final int REQUEST_UNIT = 4000; public static final int TIME_TO_LIVE = 5; public static final boolean INDEXINGPOLICY_AUTOMATIC = false; public static final IndexingMode INDEXINGPOLICY_MODE = IndexingMode.LAZY; diff --git a/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/repository/CosmosAnnotationUnitTest.java b/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/repository/CosmosAnnotationUnitTest.java index 0ffa19fb7a739..2488069f1d140 100644 --- a/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/repository/CosmosAnnotationUnitTest.java +++ b/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/repository/CosmosAnnotationUnitTest.java @@ -40,8 +40,6 @@ public void testDefaultIndexingPolicyAnnotation() { // ContainerName, RequestUnit, Automatic and IndexingMode Assert.isTrue(personInfo.getContainerName().equals(NoDBAnnotationPerson.class.getSimpleName()), "should be default collection name"); - Assert.isTrue(personInfo.getRequestUnit() == TestConstants.DEFAULT_REQUEST_UNIT, - "should be default request unit"); Assert.isTrue(policy.automatic() == TestConstants.DEFAULT_INDEXINGPOLICY_AUTOMATIC, "should be default indexing policy automatic"); Assert.isTrue(policy.indexingMode() == TestConstants.DEFAULT_INDEXINGPOLICY_MODE, @@ -69,8 +67,6 @@ public void testIndexingPolicyAnnotation() { Assert.isTrue(roleInfo.getContainerName().equals(TestConstants.ROLE_COLLECTION_NAME), "should be Role(class) collection name"); - Assert.isTrue(roleInfo.getRequestUnit() == TestConstants.REQUEST_UNIT, - "should be Role(class) request unit"); Assert.isTrue(policy.automatic() == TestConstants.INDEXINGPOLICY_AUTOMATIC, "should be Role(class) indexing policy automatic"); Assert.isTrue(policy.indexingMode() == TestConstants.INDEXINGPOLICY_MODE, From b0e44ba80c89d7eb686a62991c0864f702530ca6 Mon Sep 17 00:00:00 2001 From: Yi Liu Date: Tue, 14 Jul 2020 14:28:44 +0800 Subject: [PATCH 107/129] modify package name from btoc to b2c (#13126) --- .../main/resources/checkstyle/checkstyle-suppressions.xml | 3 +++ .../aad/{btoc => b2c}/AzureADB2COIDCSampleApplication.java | 2 +- .../azure/aad/{btoc => b2c}/controller/WebController.java | 2 +- .../{btoc => b2c}/security/WebSecurityConfiguration.java | 4 ++-- .../{btoc => b2c}/AADB2CAuthorizationRequestResolver.java | 2 +- .../{btoc => b2c}/AADB2CAutoConfiguration.java | 6 +++--- .../{btoc => b2c}/AADB2CConfigurationException.java | 2 +- .../{btoc => b2c}/AADB2CLogoutSuccessHandler.java | 2 +- .../{btoc => b2c}/AADB2COidcLoginConfigurer.java | 2 +- .../autoconfigure/{btoc => b2c}/AADB2CProperties.java | 2 +- .../azure/spring/autoconfigure/{btoc => b2c}/AADB2CURL.java | 2 +- .../src/main/resources/META-INF/spring.factories | 2 +- .../spring/{btoc => b2c}/AADB2COidcLoginConfigSample.java | 4 ++-- .../com/azure/spring/{btoc => b2c}/AADB2CWebController.java | 2 +- .../AADB2CAuthorizationRequestResolverTest.java | 4 ++-- .../{btoc => b2c}/AADB2CAutoConfigurationTest.java | 4 ++-- .../spring/autoconfigure/{btoc => b2c}/AADB2CConstants.java | 6 +++--- .../{btoc => b2c}/AADB2CLogoutSuccessHandlerTest.java | 2 +- .../spring/autoconfigure/{btoc => b2c}/AADB2CURLTest.java | 2 +- 19 files changed, 29 insertions(+), 26 deletions(-) rename sdk/spring/azure-spring-boot-samples/azure-spring-boot-sample-active-directory-b2c-oidc/src/main/java/com/microsoft/azure/aad/{btoc => b2c}/AzureADB2COIDCSampleApplication.java (91%) rename sdk/spring/azure-spring-boot-samples/azure-spring-boot-sample-active-directory-b2c-oidc/src/main/java/com/microsoft/azure/aad/{btoc => b2c}/controller/WebController.java (96%) rename sdk/spring/azure-spring-boot-samples/azure-spring-boot-sample-active-directory-b2c-oidc/src/main/java/com/microsoft/azure/aad/{btoc => b2c}/security/WebSecurityConfiguration.java (87%) rename sdk/spring/azure-spring-boot/src/main/java/com/microsoft/azure/spring/autoconfigure/{btoc => b2c}/AADB2CAuthorizationRequestResolver.java (98%) rename sdk/spring/azure-spring-boot/src/main/java/com/microsoft/azure/spring/autoconfigure/{btoc => b2c}/AADB2CAutoConfiguration.java (96%) rename sdk/spring/azure-spring-boot/src/main/java/com/microsoft/azure/spring/autoconfigure/{btoc => b2c}/AADB2CConfigurationException.java (88%) rename sdk/spring/azure-spring-boot/src/main/java/com/microsoft/azure/spring/autoconfigure/{btoc => b2c}/AADB2CLogoutSuccessHandler.java (96%) rename sdk/spring/azure-spring-boot/src/main/java/com/microsoft/azure/spring/autoconfigure/{btoc => b2c}/AADB2COidcLoginConfigurer.java (95%) rename sdk/spring/azure-spring-boot/src/main/java/com/microsoft/azure/spring/autoconfigure/{btoc => b2c}/AADB2CProperties.java (99%) rename sdk/spring/azure-spring-boot/src/main/java/com/microsoft/azure/spring/autoconfigure/{btoc => b2c}/AADB2CURL.java (97%) rename sdk/spring/azure-spring-boot/src/samples/java/com/azure/spring/{btoc => b2c}/AADB2COidcLoginConfigSample.java (91%) rename sdk/spring/azure-spring-boot/src/samples/java/com/azure/spring/{btoc => b2c}/AADB2CWebController.java (98%) rename sdk/spring/azure-spring-boot/src/test/java/com/microsoft/azure/spring/autoconfigure/{btoc => b2c}/AADB2CAuthorizationRequestResolverTest.java (95%) rename sdk/spring/azure-spring-boot/src/test/java/com/microsoft/azure/spring/autoconfigure/{btoc => b2c}/AADB2CAutoConfigurationTest.java (95%) rename sdk/spring/azure-spring-boot/src/test/java/com/microsoft/azure/spring/autoconfigure/{btoc => b2c}/AADB2CConstants.java (82%) rename sdk/spring/azure-spring-boot/src/test/java/com/microsoft/azure/spring/autoconfigure/{btoc => b2c}/AADB2CLogoutSuccessHandlerTest.java (96%) rename sdk/spring/azure-spring-boot/src/test/java/com/microsoft/azure/spring/autoconfigure/{btoc => b2c}/AADB2CURLTest.java (97%) diff --git a/eng/code-quality-reports/src/main/resources/checkstyle/checkstyle-suppressions.xml b/eng/code-quality-reports/src/main/resources/checkstyle/checkstyle-suppressions.xml index 1a88861759f3f..e5bbe9ac1a686 100755 --- a/eng/code-quality-reports/src/main/resources/checkstyle/checkstyle-suppressions.xml +++ b/eng/code-quality-reports/src/main/resources/checkstyle/checkstyle-suppressions.xml @@ -485,6 +485,9 @@ + + + diff --git a/sdk/spring/azure-spring-boot-samples/azure-spring-boot-sample-active-directory-b2c-oidc/src/main/java/com/microsoft/azure/aad/btoc/AzureADB2COIDCSampleApplication.java b/sdk/spring/azure-spring-boot-samples/azure-spring-boot-sample-active-directory-b2c-oidc/src/main/java/com/microsoft/azure/aad/b2c/AzureADB2COIDCSampleApplication.java similarity index 91% rename from sdk/spring/azure-spring-boot-samples/azure-spring-boot-sample-active-directory-b2c-oidc/src/main/java/com/microsoft/azure/aad/btoc/AzureADB2COIDCSampleApplication.java rename to sdk/spring/azure-spring-boot-samples/azure-spring-boot-sample-active-directory-b2c-oidc/src/main/java/com/microsoft/azure/aad/b2c/AzureADB2COIDCSampleApplication.java index 2a9ba33644b1c..15d40cddcbd8e 100644 --- a/sdk/spring/azure-spring-boot-samples/azure-spring-boot-sample-active-directory-b2c-oidc/src/main/java/com/microsoft/azure/aad/btoc/AzureADB2COIDCSampleApplication.java +++ b/sdk/spring/azure-spring-boot-samples/azure-spring-boot-sample-active-directory-b2c-oidc/src/main/java/com/microsoft/azure/aad/b2c/AzureADB2COIDCSampleApplication.java @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.microsoft.azure.aad.btoc; +package com.microsoft.azure.aad.b2c; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; diff --git a/sdk/spring/azure-spring-boot-samples/azure-spring-boot-sample-active-directory-b2c-oidc/src/main/java/com/microsoft/azure/aad/btoc/controller/WebController.java b/sdk/spring/azure-spring-boot-samples/azure-spring-boot-sample-active-directory-b2c-oidc/src/main/java/com/microsoft/azure/aad/b2c/controller/WebController.java similarity index 96% rename from sdk/spring/azure-spring-boot-samples/azure-spring-boot-sample-active-directory-b2c-oidc/src/main/java/com/microsoft/azure/aad/btoc/controller/WebController.java rename to sdk/spring/azure-spring-boot-samples/azure-spring-boot-sample-active-directory-b2c-oidc/src/main/java/com/microsoft/azure/aad/b2c/controller/WebController.java index dcd7810e546dc..ad38e4965aef8 100644 --- a/sdk/spring/azure-spring-boot-samples/azure-spring-boot-sample-active-directory-b2c-oidc/src/main/java/com/microsoft/azure/aad/btoc/controller/WebController.java +++ b/sdk/spring/azure-spring-boot-samples/azure-spring-boot-sample-active-directory-b2c-oidc/src/main/java/com/microsoft/azure/aad/b2c/controller/WebController.java @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.microsoft.azure.aad.btoc.controller; +package com.microsoft.azure.aad.b2c.controller; import org.springframework.security.oauth2.client.authentication.OAuth2AuthenticationToken; import org.springframework.security.oauth2.core.user.OAuth2User; diff --git a/sdk/spring/azure-spring-boot-samples/azure-spring-boot-sample-active-directory-b2c-oidc/src/main/java/com/microsoft/azure/aad/btoc/security/WebSecurityConfiguration.java b/sdk/spring/azure-spring-boot-samples/azure-spring-boot-sample-active-directory-b2c-oidc/src/main/java/com/microsoft/azure/aad/b2c/security/WebSecurityConfiguration.java similarity index 87% rename from sdk/spring/azure-spring-boot-samples/azure-spring-boot-sample-active-directory-b2c-oidc/src/main/java/com/microsoft/azure/aad/btoc/security/WebSecurityConfiguration.java rename to sdk/spring/azure-spring-boot-samples/azure-spring-boot-sample-active-directory-b2c-oidc/src/main/java/com/microsoft/azure/aad/b2c/security/WebSecurityConfiguration.java index 4c1fd4ae3d409..c2096ee6420cc 100644 --- a/sdk/spring/azure-spring-boot-samples/azure-spring-boot-sample-active-directory-b2c-oidc/src/main/java/com/microsoft/azure/aad/btoc/security/WebSecurityConfiguration.java +++ b/sdk/spring/azure-spring-boot-samples/azure-spring-boot-sample-active-directory-b2c-oidc/src/main/java/com/microsoft/azure/aad/b2c/security/WebSecurityConfiguration.java @@ -1,9 +1,9 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.microsoft.azure.aad.btoc.security; +package com.microsoft.azure.aad.b2c.security; -import com.microsoft.azure.spring.autoconfigure.btoc.AADB2COidcLoginConfigurer; +import com.microsoft.azure.spring.autoconfigure.b2c.AADB2COidcLoginConfigurer; import org.springframework.security.config.annotation.web.builders.HttpSecurity; import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter; diff --git a/sdk/spring/azure-spring-boot/src/main/java/com/microsoft/azure/spring/autoconfigure/btoc/AADB2CAuthorizationRequestResolver.java b/sdk/spring/azure-spring-boot/src/main/java/com/microsoft/azure/spring/autoconfigure/b2c/AADB2CAuthorizationRequestResolver.java similarity index 98% rename from sdk/spring/azure-spring-boot/src/main/java/com/microsoft/azure/spring/autoconfigure/btoc/AADB2CAuthorizationRequestResolver.java rename to sdk/spring/azure-spring-boot/src/main/java/com/microsoft/azure/spring/autoconfigure/b2c/AADB2CAuthorizationRequestResolver.java index c7e10953e45db..9ab1f38de8829 100644 --- a/sdk/spring/azure-spring-boot/src/main/java/com/microsoft/azure/spring/autoconfigure/btoc/AADB2CAuthorizationRequestResolver.java +++ b/sdk/spring/azure-spring-boot/src/main/java/com/microsoft/azure/spring/autoconfigure/b2c/AADB2CAuthorizationRequestResolver.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.microsoft.azure.spring.autoconfigure.btoc; +package com.microsoft.azure.spring.autoconfigure.b2c; import org.springframework.lang.NonNull; import org.springframework.lang.Nullable; diff --git a/sdk/spring/azure-spring-boot/src/main/java/com/microsoft/azure/spring/autoconfigure/btoc/AADB2CAutoConfiguration.java b/sdk/spring/azure-spring-boot/src/main/java/com/microsoft/azure/spring/autoconfigure/b2c/AADB2CAutoConfiguration.java similarity index 96% rename from sdk/spring/azure-spring-boot/src/main/java/com/microsoft/azure/spring/autoconfigure/btoc/AADB2CAutoConfiguration.java rename to sdk/spring/azure-spring-boot/src/main/java/com/microsoft/azure/spring/autoconfigure/b2c/AADB2CAutoConfiguration.java index 37ad3ec63e4bb..abd1556951089 100644 --- a/sdk/spring/azure-spring-boot/src/main/java/com/microsoft/azure/spring/autoconfigure/btoc/AADB2CAutoConfiguration.java +++ b/sdk/spring/azure-spring-boot/src/main/java/com/microsoft/azure/spring/autoconfigure/b2c/AADB2CAutoConfiguration.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.microsoft.azure.spring.autoconfigure.btoc; +package com.microsoft.azure.spring.autoconfigure.b2c; import com.microsoft.azure.telemetry.TelemetrySender; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; @@ -27,8 +27,8 @@ import java.util.List; import java.util.Map; -import static com.microsoft.azure.spring.autoconfigure.btoc.AADB2CProperties.PREFIX; -import static com.microsoft.azure.spring.autoconfigure.btoc.AADB2CProperties.USER_FLOW_SIGN_UP_OR_SIGN_IN; +import static com.microsoft.azure.spring.autoconfigure.b2c.AADB2CProperties.PREFIX; +import static com.microsoft.azure.spring.autoconfigure.b2c.AADB2CProperties.USER_FLOW_SIGN_UP_OR_SIGN_IN; import static com.microsoft.azure.telemetry.TelemetryData.SERVICE_NAME; import static com.microsoft.azure.telemetry.TelemetryData.TENANT_NAME; import static com.microsoft.azure.telemetry.TelemetryData.getClassPackageSimpleName; diff --git a/sdk/spring/azure-spring-boot/src/main/java/com/microsoft/azure/spring/autoconfigure/btoc/AADB2CConfigurationException.java b/sdk/spring/azure-spring-boot/src/main/java/com/microsoft/azure/spring/autoconfigure/b2c/AADB2CConfigurationException.java similarity index 88% rename from sdk/spring/azure-spring-boot/src/main/java/com/microsoft/azure/spring/autoconfigure/btoc/AADB2CConfigurationException.java rename to sdk/spring/azure-spring-boot/src/main/java/com/microsoft/azure/spring/autoconfigure/b2c/AADB2CConfigurationException.java index 274d83843b258..df2e2f035fbd1 100644 --- a/sdk/spring/azure-spring-boot/src/main/java/com/microsoft/azure/spring/autoconfigure/btoc/AADB2CConfigurationException.java +++ b/sdk/spring/azure-spring-boot/src/main/java/com/microsoft/azure/spring/autoconfigure/b2c/AADB2CConfigurationException.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.microsoft.azure.spring.autoconfigure.btoc; +package com.microsoft.azure.spring.autoconfigure.b2c; /** * Throw runtime exception for configuration. diff --git a/sdk/spring/azure-spring-boot/src/main/java/com/microsoft/azure/spring/autoconfigure/btoc/AADB2CLogoutSuccessHandler.java b/sdk/spring/azure-spring-boot/src/main/java/com/microsoft/azure/spring/autoconfigure/b2c/AADB2CLogoutSuccessHandler.java similarity index 96% rename from sdk/spring/azure-spring-boot/src/main/java/com/microsoft/azure/spring/autoconfigure/btoc/AADB2CLogoutSuccessHandler.java rename to sdk/spring/azure-spring-boot/src/main/java/com/microsoft/azure/spring/autoconfigure/b2c/AADB2CLogoutSuccessHandler.java index c2ded434692af..4b5a811b5b701 100644 --- a/sdk/spring/azure-spring-boot/src/main/java/com/microsoft/azure/spring/autoconfigure/btoc/AADB2CLogoutSuccessHandler.java +++ b/sdk/spring/azure-spring-boot/src/main/java/com/microsoft/azure/spring/autoconfigure/b2c/AADB2CLogoutSuccessHandler.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.microsoft.azure.spring.autoconfigure.btoc; +package com.microsoft.azure.spring.autoconfigure.b2c; import org.springframework.lang.NonNull; import org.springframework.security.core.Authentication; diff --git a/sdk/spring/azure-spring-boot/src/main/java/com/microsoft/azure/spring/autoconfigure/btoc/AADB2COidcLoginConfigurer.java b/sdk/spring/azure-spring-boot/src/main/java/com/microsoft/azure/spring/autoconfigure/b2c/AADB2COidcLoginConfigurer.java similarity index 95% rename from sdk/spring/azure-spring-boot/src/main/java/com/microsoft/azure/spring/autoconfigure/btoc/AADB2COidcLoginConfigurer.java rename to sdk/spring/azure-spring-boot/src/main/java/com/microsoft/azure/spring/autoconfigure/b2c/AADB2COidcLoginConfigurer.java index d07bebfba0a6e..3053474c8f571 100644 --- a/sdk/spring/azure-spring-boot/src/main/java/com/microsoft/azure/spring/autoconfigure/btoc/AADB2COidcLoginConfigurer.java +++ b/sdk/spring/azure-spring-boot/src/main/java/com/microsoft/azure/spring/autoconfigure/b2c/AADB2COidcLoginConfigurer.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.microsoft.azure.spring.autoconfigure.btoc; +package com.microsoft.azure.spring.autoconfigure.b2c; import org.springframework.security.config.annotation.web.builders.HttpSecurity; import org.springframework.security.config.annotation.web.configurers.AbstractHttpConfigurer; diff --git a/sdk/spring/azure-spring-boot/src/main/java/com/microsoft/azure/spring/autoconfigure/btoc/AADB2CProperties.java b/sdk/spring/azure-spring-boot/src/main/java/com/microsoft/azure/spring/autoconfigure/b2c/AADB2CProperties.java similarity index 99% rename from sdk/spring/azure-spring-boot/src/main/java/com/microsoft/azure/spring/autoconfigure/btoc/AADB2CProperties.java rename to sdk/spring/azure-spring-boot/src/main/java/com/microsoft/azure/spring/autoconfigure/b2c/AADB2CProperties.java index ba51aa078570e..730ecbf71dd2b 100644 --- a/sdk/spring/azure-spring-boot/src/main/java/com/microsoft/azure/spring/autoconfigure/btoc/AADB2CProperties.java +++ b/sdk/spring/azure-spring-boot/src/main/java/com/microsoft/azure/spring/autoconfigure/b2c/AADB2CProperties.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.microsoft.azure.spring.autoconfigure.btoc; +package com.microsoft.azure.spring.autoconfigure.b2c; import org.hibernate.validator.constraints.URL; import org.springframework.boot.context.properties.ConfigurationProperties; diff --git a/sdk/spring/azure-spring-boot/src/main/java/com/microsoft/azure/spring/autoconfigure/btoc/AADB2CURL.java b/sdk/spring/azure-spring-boot/src/main/java/com/microsoft/azure/spring/autoconfigure/b2c/AADB2CURL.java similarity index 97% rename from sdk/spring/azure-spring-boot/src/main/java/com/microsoft/azure/spring/autoconfigure/btoc/AADB2CURL.java rename to sdk/spring/azure-spring-boot/src/main/java/com/microsoft/azure/spring/autoconfigure/b2c/AADB2CURL.java index 84b075de97d80..f98c8fc375af7 100644 --- a/sdk/spring/azure-spring-boot/src/main/java/com/microsoft/azure/spring/autoconfigure/btoc/AADB2CURL.java +++ b/sdk/spring/azure-spring-boot/src/main/java/com/microsoft/azure/spring/autoconfigure/b2c/AADB2CURL.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.microsoft.azure.spring.autoconfigure.btoc; +package com.microsoft.azure.spring.autoconfigure.b2c; import org.springframework.util.Assert; diff --git a/sdk/spring/azure-spring-boot/src/main/resources/META-INF/spring.factories b/sdk/spring/azure-spring-boot/src/main/resources/META-INF/spring.factories index 77ad8951f70a1..5f88a537624a7 100644 --- a/sdk/spring/azure-spring-boot/src/main/resources/META-INF/spring.factories +++ b/sdk/spring/azure-spring-boot/src/main/resources/META-INF/spring.factories @@ -7,6 +7,6 @@ com.microsoft.azure.spring.autoconfigure.gremlin.GremlinAutoConfiguration,\ com.microsoft.azure.spring.autoconfigure.gremlin.GremlinRepositoriesAutoConfiguration,\ com.microsoft.azure.spring.autoconfigure.aad.AADAuthenticationFilterAutoConfiguration,\ com.microsoft.azure.spring.autoconfigure.aad.AADOAuth2AutoConfiguration,\ -com.microsoft.azure.spring.autoconfigure.btoc.AADB2CAutoConfiguration,\ +com.microsoft.azure.spring.autoconfigure.b2c.AADB2CAutoConfiguration,\ com.microsoft.azure.spring.autoconfigure.metrics.AzureMonitorMetricsExportAutoConfiguration,\ com.microsoft.azure.spring.autoconfigure.jms.ServiceBusJMSAutoConfiguration diff --git a/sdk/spring/azure-spring-boot/src/samples/java/com/azure/spring/btoc/AADB2COidcLoginConfigSample.java b/sdk/spring/azure-spring-boot/src/samples/java/com/azure/spring/b2c/AADB2COidcLoginConfigSample.java similarity index 91% rename from sdk/spring/azure-spring-boot/src/samples/java/com/azure/spring/btoc/AADB2COidcLoginConfigSample.java rename to sdk/spring/azure-spring-boot/src/samples/java/com/azure/spring/b2c/AADB2COidcLoginConfigSample.java index 23ed8f070cfb7..115830b108091 100644 --- a/sdk/spring/azure-spring-boot/src/samples/java/com/azure/spring/btoc/AADB2COidcLoginConfigSample.java +++ b/sdk/spring/azure-spring-boot/src/samples/java/com/azure/spring/b2c/AADB2COidcLoginConfigSample.java @@ -1,8 +1,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.azure.spring.btoc; +package com.azure.spring.b2c; -import com.microsoft.azure.spring.autoconfigure.btoc.AADB2COidcLoginConfigurer; +import com.microsoft.azure.spring.autoconfigure.b2c.AADB2COidcLoginConfigurer; import org.springframework.security.config.annotation.web.builders.HttpSecurity; import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter; diff --git a/sdk/spring/azure-spring-boot/src/samples/java/com/azure/spring/btoc/AADB2CWebController.java b/sdk/spring/azure-spring-boot/src/samples/java/com/azure/spring/b2c/AADB2CWebController.java similarity index 98% rename from sdk/spring/azure-spring-boot/src/samples/java/com/azure/spring/btoc/AADB2CWebController.java rename to sdk/spring/azure-spring-boot/src/samples/java/com/azure/spring/b2c/AADB2CWebController.java index c06ee37b0da8f..b3864861c0d7c 100644 --- a/sdk/spring/azure-spring-boot/src/samples/java/com/azure/spring/btoc/AADB2CWebController.java +++ b/sdk/spring/azure-spring-boot/src/samples/java/com/azure/spring/b2c/AADB2CWebController.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.azure.spring.btoc; +package com.azure.spring.b2c; import org.springframework.security.oauth2.client.authentication.OAuth2AuthenticationToken; import org.springframework.security.oauth2.core.user.OAuth2User; diff --git a/sdk/spring/azure-spring-boot/src/test/java/com/microsoft/azure/spring/autoconfigure/btoc/AADB2CAuthorizationRequestResolverTest.java b/sdk/spring/azure-spring-boot/src/test/java/com/microsoft/azure/spring/autoconfigure/b2c/AADB2CAuthorizationRequestResolverTest.java similarity index 95% rename from sdk/spring/azure-spring-boot/src/test/java/com/microsoft/azure/spring/autoconfigure/btoc/AADB2CAuthorizationRequestResolverTest.java rename to sdk/spring/azure-spring-boot/src/test/java/com/microsoft/azure/spring/autoconfigure/b2c/AADB2CAuthorizationRequestResolverTest.java index 367c69e719caf..3a11618adc9d1 100644 --- a/sdk/spring/azure-spring-boot/src/test/java/com/microsoft/azure/spring/autoconfigure/btoc/AADB2CAuthorizationRequestResolverTest.java +++ b/sdk/spring/azure-spring-boot/src/test/java/com/microsoft/azure/spring/autoconfigure/b2c/AADB2CAuthorizationRequestResolverTest.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.microsoft.azure.spring.autoconfigure.btoc; +package com.microsoft.azure.spring.autoconfigure.b2c; import org.junit.Test; import org.springframework.boot.autoconfigure.AutoConfigurations; @@ -12,7 +12,7 @@ import javax.servlet.http.HttpServletRequest; -import static com.microsoft.azure.spring.autoconfigure.btoc.AADB2CConstants.*; +import static com.microsoft.azure.spring.autoconfigure.b2c.AADB2CConstants.*; import static org.assertj.core.api.Java6Assertions.assertThat; public class AADB2CAuthorizationRequestResolverTest { diff --git a/sdk/spring/azure-spring-boot/src/test/java/com/microsoft/azure/spring/autoconfigure/btoc/AADB2CAutoConfigurationTest.java b/sdk/spring/azure-spring-boot/src/test/java/com/microsoft/azure/spring/autoconfigure/b2c/AADB2CAutoConfigurationTest.java similarity index 95% rename from sdk/spring/azure-spring-boot/src/test/java/com/microsoft/azure/spring/autoconfigure/btoc/AADB2CAutoConfigurationTest.java rename to sdk/spring/azure-spring-boot/src/test/java/com/microsoft/azure/spring/autoconfigure/b2c/AADB2CAutoConfigurationTest.java index 60114aad61bfe..386cf665c56e2 100644 --- a/sdk/spring/azure-spring-boot/src/test/java/com/microsoft/azure/spring/autoconfigure/btoc/AADB2CAutoConfigurationTest.java +++ b/sdk/spring/azure-spring-boot/src/test/java/com/microsoft/azure/spring/autoconfigure/b2c/AADB2CAutoConfigurationTest.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.microsoft.azure.spring.autoconfigure.btoc; +package com.microsoft.azure.spring.autoconfigure.b2c; import org.junit.Test; import org.springframework.boot.autoconfigure.AutoConfigurations; import org.springframework.boot.test.context.runner.WebApplicationContextRunner; import org.springframework.security.oauth2.client.registration.ClientRegistrationRepository; -import static com.microsoft.azure.spring.autoconfigure.btoc.AADB2CConstants.*; +import static com.microsoft.azure.spring.autoconfigure.b2c.AADB2CConstants.*; import static org.assertj.core.api.Java6Assertions.assertThat; public class AADB2CAutoConfigurationTest { diff --git a/sdk/spring/azure-spring-boot/src/test/java/com/microsoft/azure/spring/autoconfigure/btoc/AADB2CConstants.java b/sdk/spring/azure-spring-boot/src/test/java/com/microsoft/azure/spring/autoconfigure/b2c/AADB2CConstants.java similarity index 82% rename from sdk/spring/azure-spring-boot/src/test/java/com/microsoft/azure/spring/autoconfigure/btoc/AADB2CConstants.java rename to sdk/spring/azure-spring-boot/src/test/java/com/microsoft/azure/spring/autoconfigure/b2c/AADB2CConstants.java index c68f2449aaa0d..8a296c767fe01 100644 --- a/sdk/spring/azure-spring-boot/src/test/java/com/microsoft/azure/spring/autoconfigure/btoc/AADB2CConstants.java +++ b/sdk/spring/azure-spring-boot/src/test/java/com/microsoft/azure/spring/autoconfigure/b2c/AADB2CConstants.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.microsoft.azure.spring.autoconfigure.btoc; +package com.microsoft.azure.spring.autoconfigure.b2c; -import static com.microsoft.azure.spring.autoconfigure.btoc.AADB2CProperties.PREFIX; -import static com.microsoft.azure.spring.autoconfigure.btoc.AADB2CProperties.USER_FLOW_SIGN_UP_OR_SIGN_IN; +import static com.microsoft.azure.spring.autoconfigure.b2c.AADB2CProperties.PREFIX; +import static com.microsoft.azure.spring.autoconfigure.b2c.AADB2CProperties.USER_FLOW_SIGN_UP_OR_SIGN_IN; public class AADB2CConstants { diff --git a/sdk/spring/azure-spring-boot/src/test/java/com/microsoft/azure/spring/autoconfigure/btoc/AADB2CLogoutSuccessHandlerTest.java b/sdk/spring/azure-spring-boot/src/test/java/com/microsoft/azure/spring/autoconfigure/b2c/AADB2CLogoutSuccessHandlerTest.java similarity index 96% rename from sdk/spring/azure-spring-boot/src/test/java/com/microsoft/azure/spring/autoconfigure/btoc/AADB2CLogoutSuccessHandlerTest.java rename to sdk/spring/azure-spring-boot/src/test/java/com/microsoft/azure/spring/autoconfigure/b2c/AADB2CLogoutSuccessHandlerTest.java index 0262f0ced51ef..3901d098cf3c7 100644 --- a/sdk/spring/azure-spring-boot/src/test/java/com/microsoft/azure/spring/autoconfigure/btoc/AADB2CLogoutSuccessHandlerTest.java +++ b/sdk/spring/azure-spring-boot/src/test/java/com/microsoft/azure/spring/autoconfigure/b2c/AADB2CLogoutSuccessHandlerTest.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.microsoft.azure.spring.autoconfigure.btoc; +package com.microsoft.azure.spring.autoconfigure.b2c; import org.junit.Before; import org.junit.Test; diff --git a/sdk/spring/azure-spring-boot/src/test/java/com/microsoft/azure/spring/autoconfigure/btoc/AADB2CURLTest.java b/sdk/spring/azure-spring-boot/src/test/java/com/microsoft/azure/spring/autoconfigure/b2c/AADB2CURLTest.java similarity index 97% rename from sdk/spring/azure-spring-boot/src/test/java/com/microsoft/azure/spring/autoconfigure/btoc/AADB2CURLTest.java rename to sdk/spring/azure-spring-boot/src/test/java/com/microsoft/azure/spring/autoconfigure/b2c/AADB2CURLTest.java index 7d55ffa859c37..17180eb7e7a6e 100644 --- a/sdk/spring/azure-spring-boot/src/test/java/com/microsoft/azure/spring/autoconfigure/btoc/AADB2CURLTest.java +++ b/sdk/spring/azure-spring-boot/src/test/java/com/microsoft/azure/spring/autoconfigure/b2c/AADB2CURLTest.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package com.microsoft.azure.spring.autoconfigure.btoc; +package com.microsoft.azure.spring.autoconfigure.b2c; import org.junit.Test; From ec51223968a8e5b27ce9b5bc7eff84be7cfde611 Mon Sep 17 00:00:00 2001 From: Azure SDK Bot <53356347+azure-sdk@users.noreply.github.com> Date: Tue, 14 Jul 2020 09:18:49 -0700 Subject: [PATCH 108/129] Increment package version after release of com.azure azure-search-documents (#13129) --- eng/jacoco-test-coverage/pom.xml | 2 +- eng/versioning/version_client.txt | 2 +- sdk/search/azure-search-documents/CHANGELOG.md | 3 +++ sdk/search/azure-search-documents/pom.xml | 2 +- 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/eng/jacoco-test-coverage/pom.xml b/eng/jacoco-test-coverage/pom.xml index 63e664f3d819c..c6cf18e8b4a7d 100644 --- a/eng/jacoco-test-coverage/pom.xml +++ b/eng/jacoco-test-coverage/pom.xml @@ -154,7 +154,7 @@ com.azure azure-search-documents - 11.0.0 + 11.1.0-beta.1 com.azure diff --git a/eng/versioning/version_client.txt b/eng/versioning/version_client.txt index d9332004bbf1b..8edfb99d62d69 100644 --- a/eng/versioning/version_client.txt +++ b/eng/versioning/version_client.txt @@ -31,7 +31,7 @@ com.azure:azure-identity-perf;1.0.0-beta.1;1.0.0-beta.1 com.azure:azure-messaging-eventhubs;5.1.2;5.2.0-beta.1 com.azure:azure-messaging-eventhubs-checkpointstore-blob;1.1.2;1.2.0-beta.1 com.azure:azure-messaging-servicebus;7.0.0-beta.3;7.0.0-beta.4 -com.azure:azure-search-documents;1.0.0-beta.4;11.0.0 +com.azure:azure-search-documents;11.0.0;11.1.0-beta.1 com.azure:azure-security-keyvault-certificates;4.0.4;4.1.0-beta.4 com.azure:azure-security-keyvault-keys;4.1.4;4.2.0-beta.5 com.azure:azure-security-keyvault-secrets;4.1.4;4.2.0-beta.4 diff --git a/sdk/search/azure-search-documents/CHANGELOG.md b/sdk/search/azure-search-documents/CHANGELOG.md index c4eebb16392bf..a0fdd1a21cff9 100644 --- a/sdk/search/azure-search-documents/CHANGELOG.md +++ b/sdk/search/azure-search-documents/CHANGELOG.md @@ -1,5 +1,8 @@ # Release History +## 11.1.0-beta.1 (Unreleased) + + ## 11.0.0 (2020-07-13) - Changed version to 11.0.0. diff --git a/sdk/search/azure-search-documents/pom.xml b/sdk/search/azure-search-documents/pom.xml index b82c30ad3bd65..9f8f1fd8add81 100644 --- a/sdk/search/azure-search-documents/pom.xml +++ b/sdk/search/azure-search-documents/pom.xml @@ -16,7 +16,7 @@ com.azure azure-search-documents - 11.0.0 + 11.1.0-beta.1 jar From ba157356657843c068254c91633e0bc39aa1a54d Mon Sep 17 00:00:00 2001 From: Sameeksha Vaity Date: Tue, 14 Jul 2020 11:14:06 -0700 Subject: [PATCH 109/129] Refactor Formrecognizer samples (#12987) --- .../azure-ai-formrecognizer/README.md | 59 +-- .../AdvancedDiffLabeledUnlabeledData.java | 15 +- ...AdvancedDiffLabeledUnlabeledDataAsync.java | 28 +- .../ai/formrecognizer/Authentication.java | 56 ++- .../ai/formrecognizer/CopyModelAsync.java | 6 +- ...ognizerAsyncClientJavaDocCodeSnippets.java | 438 +++++++++--------- ...rmRecognizerClientJavaDocCodeSnippets.java | 337 +++++++------- ...rainingAsyncClientJavaDocCodeSnippets.java | 151 +++--- ...FormTrainingClientJavaDocCodeSnippets.java | 68 +-- .../ai/formrecognizer/GetBoundingBoxes.java | 47 +- .../formrecognizer/GetBoundingBoxesAsync.java | 49 +- .../ai/formrecognizer/ManageCustomModels.java | 3 +- .../ManageCustomModelsAsync.java | 4 +- .../ai/formrecognizer/ReadmeSamples.java | 30 +- .../ai/formrecognizer/RecognizeContent.java | 7 +- ...java => RecognizeContentFromUrlAsync.java} | 14 +- .../RecognizeCustomFormsAsync.java | 24 +- ....java => RecognizeCustomFormsFromUrl.java} | 19 +- .../ai/formrecognizer/RecognizeReceipts.java | 73 ++- .../RecognizeReceiptsAsync.java | 92 ++-- .../RecognizeReceiptsFromUrl.java | 73 ++- .../RecognizeReceiptsFromUrlAsync.java | 83 ++-- .../StronglyTypedRecognizedForm.java | 8 +- .../formrecognizer/TrainModelWithLabels.java | 13 +- .../TrainModelWithLabelsAsync.java | 23 +- .../TrainModelWithoutLabels.java | 13 +- .../TrainModelWithoutLabelsAsync.java | 23 +- .../FormRecognizerAsyncClientTest.java | 2 +- 28 files changed, 879 insertions(+), 879 deletions(-) rename sdk/formrecognizer/azure-ai-formrecognizer/src/samples/java/com/azure/ai/formrecognizer/{RecognizeContentAsync.java => RecognizeContentFromUrlAsync.java} (87%) rename sdk/formrecognizer/azure-ai-formrecognizer/src/samples/java/com/azure/ai/formrecognizer/{RecognizeCustomForms.java => RecognizeCustomFormsFromUrl.java} (67%) diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/README.md b/sdk/formrecognizer/azure-ai-formrecognizer/README.md index 48541a47825db..1f7d725595f89 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/README.md +++ b/sdk/formrecognizer/azure-ai-formrecognizer/README.md @@ -81,14 +81,14 @@ resource, or by running the following Azure CLI command to get the key from the az cognitiveservices account keys list --resource-group --name ``` Use the API key as the credential parameter to authenticate the client: - + ```java FormRecognizerClient formRecognizerClient = new FormRecognizerClientBuilder() .credential(new AzureKeyCredential("{key}")) .endpoint("{endpoint}") .buildClient(); ``` - + ```java FormTrainingClient formTrainingClient = new FormTrainingClientBuilder() .credential(new AzureKeyCredential("{key}")) @@ -98,7 +98,7 @@ FormTrainingClient formTrainingClient = new FormTrainingClientBuilder() The Azure Form Recognizer client library provides a way to **rotate the existing key**. - + ```java AzureKeyCredential credential = new AzureKeyCredential("{key}"); FormRecognizerClient formRecognizerClient = new FormRecognizerClientBuilder() @@ -137,7 +137,7 @@ Authorization is easiest using [DefaultAzureCredential][wiki_identity]. It finds running environment. For more information about using Azure Active Directory authorization with Form Recognizer, please refer to [the associated documentation][aad_authorization]. - + ```java TokenCredential credential = new DefaultAzureCredentialBuilder().build(); FormRecognizerClient formRecognizerClient = new FormRecognizerClientBuilder() @@ -195,7 +195,7 @@ The following section provides several code snippets covering some of the most c ### Recognize Forms Using a Custom Model Recognize name/value pairs and table data from forms. These models are trained with your own data, so they're tailored to your forms. You should only recognize forms of the same form type that the custom model was trained on. - + ```java String formUrl = "{form_url}"; String modelId = "{custom_trained_model_id}"; @@ -206,7 +206,7 @@ List recognizedForms = recognizeFormPoller.getFinalResult(); for (int i = 0; i < recognizedForms.size(); i++) { RecognizedForm form = recognizedForms.get(i); - System.out.printf("----------- Recognized Form %d -----------%n", i); + System.out.printf("----------- Recognized custom form info for page %d -----------%n", i); System.out.printf("Form type: %s%n", form.getFormType()); form.getFields().forEach((label, formField) -> System.out.printf("Field %s has value %s with confidence score of %f.%n", label, @@ -218,7 +218,7 @@ for (int i = 0; i < recognizedForms.size(); i++) { ### Recognize Content Recognize text and table structures, along with their bounding box coordinates, from documents. - + ```java // recognize form content using file input stream File form = new File("local/file_path/filename.png"); @@ -232,7 +232,7 @@ List contentPageResults = recognizeContentPoller.getFinalResult(); for (int i = 0; i < contentPageResults.size(); i++) { FormPage formPage = contentPageResults.get(i); - System.out.printf("----Recognizing content for page %d ----%n", i); + System.out.printf("----Recognizing content info for page %d ----%n", i); // Table information System.out.printf("Has width: %f and height: %f, measured with unit: %s.%n", formPage.getWidth(), formPage.getHeight(), @@ -247,10 +247,12 @@ for (int i = 0; i < contentPageResults.size(); i++) { ``` ### Recognize receipts -Recognize data from a USA sales receipts using a prebuilt model. [Here][service_recognize_receipt] are the fields the service returns for a recognized receipt. See [StronglyTypedRecognizedForm.java][strongly_typed_sample] for a suggested approach to extract +Recognize data from a USA sales receipts using a prebuilt model. [Here][service_recognize_receipt] are the fields +the service returns for a recognized receipt. +See [StronglyTypedRecognizedForm.java][strongly_typed_sample] for a suggested approach to extract information from receipts. - + ```java String receiptUrl = "https://docs.microsoft.com/en-us/azure/cognitive-services/form-recognizer/media" + "/contoso-allinone.jpg"; @@ -261,10 +263,10 @@ List receiptPageResults = syncPoller.getFinalResult(); for (int i = 0; i < receiptPageResults.size(); i++) { RecognizedForm recognizedForm = receiptPageResults.get(i); Map> recognizedFields = recognizedForm.getFields(); - System.out.printf("----------- Recognized Receipt page %d -----------%n", i); + System.out.printf("----------- Recognizing receipt info for page %d -----------%n", i); FormField merchantNameField = recognizedFields.get("MerchantName"); if (merchantNameField != null) { - if (FieldValueType.STRING.equals(merchantNameField.getValueType())) { + if (FieldValueType.STRING == merchantNameField.getValueType()) { String merchantName = FieldValueType.STRING.cast(merchantNameField); System.out.printf("Merchant Name: %s, confidence: %.2f%n", merchantName, merchantNameField.getConfidence()); @@ -273,7 +275,7 @@ for (int i = 0; i < receiptPageResults.size(); i++) { FormField merchantPhoneNumberField = recognizedFields.get("MerchantPhoneNumber"); if (merchantPhoneNumberField != null) { - if (FieldValueType.PHONE_NUMBER.equals(merchantNameField.getValueType())) { + if (FieldValueType.PHONE_NUMBER == merchantPhoneNumberField.getValueType()) { String merchantAddress = FieldValueType.PHONE_NUMBER.cast(merchantPhoneNumberField); System.out.printf("Merchant Phone number: %s, confidence: %.2f%n", merchantAddress, merchantPhoneNumberField.getConfidence()); @@ -282,7 +284,7 @@ for (int i = 0; i < receiptPageResults.size(); i++) { FormField transactionDateField = recognizedFields.get("TransactionDate"); if (transactionDateField != null) { - if (FieldValueType.DATE.equals(transactionDateField.getValueType())) { + if (FieldValueType.DATE == transactionDateField.getValueType()) { LocalDate transactionDate = FieldValueType.DATE.cast(transactionDateField); System.out.printf("Transaction Date: %s, confidence: %.2f%n", transactionDate, transactionDateField.getConfidence()); @@ -292,14 +294,14 @@ for (int i = 0; i < receiptPageResults.size(); i++) { FormField receiptItemsField = recognizedFields.get("Items"); if (receiptItemsField != null) { System.out.printf("Receipt Items: %n"); - if (FieldValueType.LIST.equals(receiptItemsField.getValueType())) { + if (FieldValueType.LIST == receiptItemsField.getValueType()) { List> receiptItems = FieldValueType.LIST.cast(receiptItemsField); receiptItems.forEach(receiptItem -> { - if (FieldValueType.MAP.equals(receiptItem.getValueType())) { + if (FieldValueType.MAP == receiptItem.getValueType()) { Map> formFieldMap = FieldValueType.MAP.cast(receiptItem); formFieldMap.forEach((key, formField) -> { if ("Quantity".equals(key)) { - if (FieldValueType.DOUBLE.equals(formField.getValueType())) { + if (FieldValueType.DOUBLE == formField.getValueType()) { Float quantity = FieldValueType.DOUBLE.cast(formField); System.out.printf("Quantity: %f, confidence: %.2f%n", quantity, formField.getConfidence()); @@ -317,9 +319,9 @@ for (int i = 0; i < receiptPageResults.size(); i++) { Train a machine-learned model on your own form type. The resulting model will be able to recognize values from the types of forms it was trained on. Provide a container SAS url to your Azure Storage Blob container where you're storing the training documents. See details on setting this up in the [service quickstart documentation][quickstart_training]. - + ```java -String trainingFilesUrl = "{SAS-URL-of-your-container-in-blob-storage}"; +String trainingFilesUrl = "{SAS_URL_of_your_container_in_blob_storage}"; SyncPoller trainingPoller = formTrainingClient.beginTraining(trainingFilesUrl, false); @@ -332,7 +334,7 @@ System.out.printf("Training started on: %s%n", customFormModel.getTrainingStarte System.out.printf("Training completed on: %s%n%n", customFormModel.getTrainingCompletedOn()); System.out.println("Recognized Fields:"); -// looping through the sub-models, which contains the fields they were trained on +// looping through the subModels, which contains the fields they were trained on // Since the given training documents are unlabeled, we still group them but they do not have a label. customFormModel.getSubmodels().forEach(customFormSubmodel -> { // Since the training data is unlabeled, we are unable to return the accuracy of this model @@ -344,9 +346,8 @@ customFormModel.getSubmodels().forEach(customFormSubmodel -> { ### Manage your models Manage the custom models attached to your account. - + ```java -AtomicReference modelId = new AtomicReference<>(); // First, we see how many custom models we have, and what our limit is AccountProperties accountProperties = formTrainingClient.getAccountProperties(); System.out.printf("The account has %d custom models, and we can have at most %d custom models", @@ -357,8 +358,7 @@ PagedIterable customModels = formTrainingClient.listCustomM System.out.println("We have following models in the account:"); customModels.forEach(customFormModelInfo -> { System.out.printf("Model Id: %s%n", customFormModelInfo.getModelId()); - // get custom model info - modelId.set(customFormModelInfo.getModelId()); + // get specific custom model info CustomFormModel customModel = formTrainingClient.getCustomModel(customFormModelInfo.getModelId()); System.out.printf("Model Status: %s%n", customModel.getModelStatus()); System.out.printf("Training started on: %s%n", customModel.getTrainingStartedOn()); @@ -374,8 +374,9 @@ customModels.forEach(customFormModelInfo -> { } }); }); + // Delete Custom Model -formTrainingClient.deleteModel(modelId.get()); +formTrainingClient.deleteModel("{modelId}"); ``` For more detailed examples, refer to [samples][sample_readme]. @@ -386,7 +387,7 @@ to provide an invalid file source URL an `HttpResponseException` would be raised In the following code snippet, the error is handled gracefully by catching the exception and display the additional information about the error. - + ```java try { formRecognizerClient.beginRecognizeContentFromUrl("invalidSourceUrl"); @@ -424,7 +425,7 @@ These code samples show common scenario operations with the Azure Form Recognize #### Async APIs All the examples shown so far have been using synchronous APIs, but we provide full support for async APIs as well. You'll need to use `FormRecognizerAsyncClient` - + ```java FormRecognizerAsyncClient formRecognizerAsyncClient = new FormRecognizerClientBuilder() .credential(new AzureKeyCredential("{key}")) @@ -491,12 +492,12 @@ This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For m [manage_custom_models]: https://github.com/Azure/azure-sdk-for-java/blob/master/sdk/formrecognizer/azure-ai-formrecognizer/src/samples/java/com/azure/ai/formrecognizer/ManageCustomModels.java [manage_custom_models_async]: https://github.com/Azure/azure-sdk-for-java/blob/master/sdk/formrecognizer/azure-ai-formrecognizer/src/samples/java/com/azure/ai/formrecognizer/ManageCustomModelsAsync.java [recognize_content]: https://github.com/Azure/azure-sdk-for-java/blob/master/sdk/formrecognizer/azure-ai-formrecognizer/src/samples/java/com/azure/ai/formrecognizer/RecognizeContent.java -[recognize_content_async]: https://github.com/Azure/azure-sdk-for-java/blob/master/sdk/formrecognizer/azure-ai-formrecognizer/src/samples/java/com/azure/ai/formrecognizer/RecognizeContentAsync.java +[recognize_content_async]: https://github.com/Azure/azure-sdk-for-java/blob/master/sdk/formrecognizer/azure-ai-formrecognizer/src/samples/java/com/azure/ai/formrecognizer/RecognizeContentFromUrlAsync.java [recognize_receipts]: https://github.com/Azure/azure-sdk-for-java/blob/master/sdk/formrecognizer/azure-ai-formrecognizer/src/samples/java/com/azure/ai/formrecognizer/RecognizeReceipts.java [recognize_receipts_async]: https://github.com/Azure/azure-sdk-for-java/blob/master/sdk/formrecognizer/azure-ai-formrecognizer/src/samples/java/com/azure/ai/formrecognizer/RecognizeReceiptsAsync.java [recognize_receipts_from_url]: https://github.com/Azure/azure-sdk-for-java/blob/master/sdk/formrecognizer/azure-ai-formrecognizer/src/samples/java/com/azure/ai/formrecognizer/RecognizeReceiptsFromUrl.java [recognize_receipts_from_url_async]: https://github.com/Azure/azure-sdk-for-java/blob/master/sdk/formrecognizer/azure-ai-formrecognizer/src/samples/java/com/azure/ai/formrecognizer/RecognizeReceiptsFromUrlAsync.java -[recognize_custom_forms]: https://github.com/Azure/azure-sdk-for-java/blob/master/sdk/formrecognizer/azure-ai-formrecognizer/src/samples/java/com/azure/ai/formrecognizer/RecognizeCustomForms.java +[recognize_custom_forms]: https://github.com/Azure/azure-sdk-for-java/blob/master/sdk/formrecognizer/azure-ai-formrecognizer/src/samples/java/com/azure/ai/formrecognizer/RecognizeCustomFormsFromUrl.java [recognize_custom_forms_async]: https://github.com/Azure/azure-sdk-for-java/blob/master/sdk/formrecognizer/azure-ai-formrecognizer/src/samples/java/com/azure/ai/formrecognizer/RecognizeCustomFormsAsync.java [register_AAD_application]: https://docs.microsoft.com/azure/cognitive-services/authentication#assign-a-role-to-a-service-principal [train_unlabeled_model]: https://github.com/Azure/azure-sdk-for-java/blob/master/sdk/formrecognizer/azure-ai-formrecognizer/src/samples/java/com/azure/ai/formrecognizer/TrainModelWithoutLabels.java diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/src/samples/java/com/azure/ai/formrecognizer/AdvancedDiffLabeledUnlabeledData.java b/sdk/formrecognizer/azure-ai-formrecognizer/src/samples/java/com/azure/ai/formrecognizer/AdvancedDiffLabeledUnlabeledData.java index b3a96dd6c8955..972394c3a2884 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/src/samples/java/com/azure/ai/formrecognizer/AdvancedDiffLabeledUnlabeledData.java +++ b/sdk/formrecognizer/azure-ai-formrecognizer/src/samples/java/com/azure/ai/formrecognizer/AdvancedDiffLabeledUnlabeledData.java @@ -49,7 +49,8 @@ public static void main(String[] args) throws IOException { List formsWithLabeledModel = client.beginRecognizeCustomForms( new FileInputStream(analyzeFile), analyzeFile.length(), - "{labeled_model_Id}", new RecognizeOptions() + "{labeled_model_Id}", + new RecognizeOptions() .setContentType(FormContentType.APPLICATION_PDF) .setIncludeFieldElements(true) .setPollInterval(Duration.ofSeconds(5))) @@ -57,7 +58,8 @@ public static void main(String[] args) throws IOException { List formsWithUnlabeledModel = client.beginRecognizeCustomForms(new FileInputStream(analyzeFile), analyzeFile.length(), - "{unlabeled_model_Id}", new RecognizeOptions() + "{unlabeled_model_Id}", + new RecognizeOptions() .setContentType(FormContentType.APPLICATION_PDF) .setIncludeFieldElements(true) .setPollInterval(Duration.ofSeconds(5))) @@ -109,15 +111,14 @@ public static void main(String[] args) throws IOException { String.format("[%.2f, %.2f]", point.getX(), point.getY())).forEach(boundingBoxStr::append); } - final StringBuilder boundingBoxLabelStr = new StringBuilder(); if (formField.getLabelData() != null && formField.getLabelData().getBoundingBox() != null) { formField.getLabelData().getBoundingBox().getPoints().stream().map(point -> String.format("[%.2f, %.2f]", point.getX(), point.getY())).forEach(boundingBoxStr::append); - } - System.out.printf("Field %s has label %s within bounding box %s with a confidence score " - + "of %.2f.%n", - label, formField.getLabelData().getText(), boundingBoxLabelStr, formField.getConfidence()); + System.out.printf("Field %s has label %s within bounding box %s with a confidence score " + + "of %.2f.%n", + label, formField.getLabelData().getText(), "", formField.getConfidence()); + } System.out.printf("Field %s has value %s based on %s within bounding box %s with a confidence score " + "of %.2f.%n", label, formField.getValue(), formField.getValueData().getText(), boundingBoxStr, diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/src/samples/java/com/azure/ai/formrecognizer/AdvancedDiffLabeledUnlabeledDataAsync.java b/sdk/formrecognizer/azure-ai-formrecognizer/src/samples/java/com/azure/ai/formrecognizer/AdvancedDiffLabeledUnlabeledDataAsync.java index 24b783a515d1a..6263691407dae 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/src/samples/java/com/azure/ai/formrecognizer/AdvancedDiffLabeledUnlabeledDataAsync.java +++ b/sdk/formrecognizer/azure-ai-formrecognizer/src/samples/java/com/azure/ai/formrecognizer/AdvancedDiffLabeledUnlabeledDataAsync.java @@ -56,7 +56,8 @@ public static void main(String[] args) throws IOException { PollerFlux> labeledCustomFormPoller = client.beginRecognizeCustomForms(toFluxByteBuffer(new ByteArrayInputStream(fileContent)), - analyzeFile.length(), "{labeled_model_Id}", new RecognizeOptions() + analyzeFile.length(), "{labeled_model_Id}", + new RecognizeOptions() .setContentType(FormContentType.APPLICATION_PDF) .setIncludeFieldElements(true) .setPollInterval(Duration.ofSeconds(5))); @@ -71,25 +72,24 @@ public static void main(String[] args) throws IOException { Mono> labeledDataResult = labeledCustomFormPoller .last() - .flatMap(trainingOperationResponse -> { - if (trainingOperationResponse.getStatus().isComplete()) { + .flatMap(pollResponse -> { + if (pollResponse.getStatus().isComplete()) { // training completed successfully, retrieving final result. - return trainingOperationResponse.getFinalResult(); + return pollResponse.getFinalResult(); } else { return Mono.error(new RuntimeException("Polling completed unsuccessfully with status:" - + trainingOperationResponse.getStatus())); + + pollResponse.getStatus())); } }); Mono> unlabeledDataResult = unlabeledCustomFormPoller .last() - .flatMap(trainingOperationResponse -> { - if (trainingOperationResponse.getStatus().isComplete()) { - // training completed successfully, retrieving final result. - return trainingOperationResponse.getFinalResult(); + .flatMap(pollResponse -> { + if (pollResponse.getStatus().isComplete()) { + return pollResponse.getFinalResult(); } else { return Mono.error(new RuntimeException("Polling completed unsuccessfully with status:" - + trainingOperationResponse.getStatus())); + + pollResponse.getStatus())); } }); @@ -146,14 +146,14 @@ public static void main(String[] args) throws IOException { String.format("[%.2f, %.2f]", point.getX(), point.getY())).forEach(boundingBoxStr::append); } - final StringBuilder boundingBoxLabelStr = new StringBuilder(); if (formField.getLabelData() != null && formField.getLabelData().getBoundingBox() != null) { formField.getLabelData().getBoundingBox().getPoints().stream().map(point -> String.format("[%.2f, %.2f]", point.getX(), point.getY())).forEach(boundingBoxStr::append); + + System.out.printf("Field %s has label %s within bounding box %s with a confidence score " + + "of %.2f.%n", + label, formField.getLabelData().getText(), "", formField.getConfidence()); } - System.out.printf("Field %s has label %s within bounding box %s with a confidence score " - + "of %.2f.%n", - label, formField.getLabelData().getText(), boundingBoxLabelStr, formField.getConfidence()); System.out.printf("Field %s has value %s based on %s within bounding box %s with a confidence " + "score of %.2f.%n", diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/src/samples/java/com/azure/ai/formrecognizer/Authentication.java b/sdk/formrecognizer/azure-ai-formrecognizer/src/samples/java/com/azure/ai/formrecognizer/Authentication.java index 121fa1b04037c..c9c261c424aed 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/src/samples/java/com/azure/ai/formrecognizer/Authentication.java +++ b/sdk/formrecognizer/azure-ai-formrecognizer/src/samples/java/com/azure/ai/formrecognizer/Authentication.java @@ -31,11 +31,11 @@ public class Authentication { * */ public static void main(String[] args) { - /** - * Set the environment variables with your own values before running the sample: - * AZURE_CLIENT_ID - the client ID of your active directory application. - * AZURE_TENANT_ID - the tenant ID of your active directory application. - * AZURE_CLIENT_SECRET - the secret of your active directory application. + /* + Set the environment variables with your own values before running the sample: + AZURE_CLIENT_ID - the client ID of your active directory application. + AZURE_TENANT_ID - the tenant ID of your active directory application. + AZURE_CLIENT_SECRET - the secret of your active directory application. */ // Form recognizer client: Key credential @@ -92,10 +92,10 @@ private static void beginRecognizeCustomFormsFromUrl(FormRecognizerClient formRe for (int i = 0; i < receiptPageResults.size(); i++) { RecognizedForm recognizedForm = receiptPageResults.get(i); Map> recognizedFields = recognizedForm.getFields(); - System.out.printf("----------- Recognized Receipt page %d -----------%n", i); + System.out.printf("----------- Recognizing receipt info for page %d -----------%n", i); FormField merchantNameField = recognizedFields.get("MerchantName"); if (merchantNameField != null) { - if (FieldValueType.STRING.equals(merchantNameField.getValueType())) { + if (FieldValueType.STRING == merchantNameField.getValueType()) { String merchantName = FieldValueType.STRING.cast(merchantNameField); System.out.printf("Merchant Name: %s, confidence: %.2f%n", merchantName, merchantNameField.getConfidence()); @@ -104,7 +104,7 @@ private static void beginRecognizeCustomFormsFromUrl(FormRecognizerClient formRe FormField merchantPhoneNumberField = recognizedFields.get("MerchantPhoneNumber"); if (merchantPhoneNumberField != null) { - if (FieldValueType.PHONE_NUMBER.equals(merchantNameField.getValueType())) { + if (FieldValueType.PHONE_NUMBER == merchantPhoneNumberField.getValueType()) { String merchantAddress = FieldValueType.PHONE_NUMBER.cast(merchantPhoneNumberField); System.out.printf("Merchant Phone number: %s, confidence: %.2f%n", merchantAddress, merchantPhoneNumberField.getConfidence()); @@ -113,7 +113,7 @@ private static void beginRecognizeCustomFormsFromUrl(FormRecognizerClient formRe FormField transactionDateField = recognizedFields.get("TransactionDate"); if (transactionDateField != null) { - if (FieldValueType.DATE.equals(transactionDateField.getValueType())) { + if (FieldValueType.DATE == transactionDateField.getValueType()) { LocalDate transactionDate = FieldValueType.DATE.cast(transactionDateField); System.out.printf("Transaction Date: %s, confidence: %.2f%n", transactionDate, transactionDateField.getConfidence()); @@ -123,29 +123,27 @@ private static void beginRecognizeCustomFormsFromUrl(FormRecognizerClient formRe FormField receiptItemsField = recognizedFields.get("Items"); if (receiptItemsField != null) { System.out.printf("Receipt Items: %n"); - if (FieldValueType.LIST.equals(receiptItemsField.getValueType())) { + if (FieldValueType.LIST == receiptItemsField.getValueType()) { List> receiptItems = FieldValueType.LIST.cast(receiptItemsField); - receiptItems.forEach(receiptItem -> { - if (FieldValueType.MAP.equals(receiptItem.getValueType())) { - Map> formFieldMap = FieldValueType.MAP.cast(receiptItem); - formFieldMap.forEach((key, formField) -> { - if ("Name".equals(key)) { - if (FieldValueType.STRING.equals(formField.getValueType())) { - String name = FieldValueType.STRING.cast(formField); - System.out.printf("Name: %s, confidence: %.2fs%n", - name, formField.getConfidence()); - } + receiptItems.stream() + .filter(receiptItem -> FieldValueType.MAP == receiptItem.getValueType()) + .>>map(FieldValueType.MAP::cast) + .forEach(formFieldMap -> formFieldMap.forEach((key, formField) -> { + if ("Name".equals(key)) { + if (FieldValueType.STRING == formField.getValueType()) { + String name = FieldValueType.STRING.cast(formField); + System.out.printf("Name: %s, confidence: %.2fs%n", + name, formField.getConfidence()); } - if ("Quantity".equals(key)) { - if (FieldValueType.DOUBLE.equals(formField.getValueType())) { - Float quantity = FieldValueType.DOUBLE.cast(formField); - System.out.printf("Quantity: %f, confidence: %.2f%n", - quantity, formField.getConfidence()); - } + } + if ("Quantity".equals(key)) { + if (FieldValueType.DOUBLE == formField.getValueType()) { + Float quantity = FieldValueType.DOUBLE.cast(formField); + System.out.printf("Quantity: %f, confidence: %.2f%n", + quantity, formField.getConfidence()); } - }); - } - }); + } + })); } } System.out.print("-----------------------------------"); diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/src/samples/java/com/azure/ai/formrecognizer/CopyModelAsync.java b/sdk/formrecognizer/azure-ai-formrecognizer/src/samples/java/com/azure/ai/formrecognizer/CopyModelAsync.java index fd6df45da834c..b90d38314f6b5 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/src/samples/java/com/azure/ai/formrecognizer/CopyModelAsync.java +++ b/sdk/formrecognizer/azure-ai-formrecognizer/src/samples/java/com/azure/ai/formrecognizer/CopyModelAsync.java @@ -6,6 +6,7 @@ import com.azure.ai.formrecognizer.training.FormTrainingAsyncClient; import com.azure.ai.formrecognizer.training.FormTrainingClientBuilder; import com.azure.core.credential.AzureKeyCredential; +import com.azure.core.util.polling.AsyncPollResponse; import java.util.concurrent.TimeUnit; @@ -42,7 +43,8 @@ public static void main(final String[] args) { // Start copy operation from the source client // The Id of the model that needs to be copied to the target resource .subscribe(copyAuthorization -> sourceClient.beginCopyModel(copyModelId, copyAuthorization) - .subscribe(copyPoller -> copyPoller.getFinalResult() + .filter(pollResponse -> pollResponse.getStatus().isComplete()) + .flatMap(AsyncPollResponse::getFinalResult) .subscribe(customFormModelInfo -> { System.out.printf("Original model has model Id: %s, model status: %s, training started on: %s," + " training completed on: %s.%n", @@ -59,7 +61,7 @@ public static void main(final String[] args) { customFormModel.getModelStatus(), customFormModel.getTrainingStartedOn(), customFormModel.getTrainingCompletedOn())); - }))); + })); // The .subscribe() creation and assignment is not a blocking call. For the purpose of this example, we sleep // the thread so the program does not end before the send operation is complete. Using .block() instead of diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/src/samples/java/com/azure/ai/formrecognizer/FormRecognizerAsyncClientJavaDocCodeSnippets.java b/sdk/formrecognizer/azure-ai-formrecognizer/src/samples/java/com/azure/ai/formrecognizer/FormRecognizerAsyncClientJavaDocCodeSnippets.java index 3ac36fa322436..7a1602434a2c7 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/src/samples/java/com/azure/ai/formrecognizer/FormRecognizerAsyncClientJavaDocCodeSnippets.java +++ b/sdk/formrecognizer/azure-ai-formrecognizer/src/samples/java/com/azure/ai/formrecognizer/FormRecognizerAsyncClientJavaDocCodeSnippets.java @@ -11,6 +11,7 @@ import com.azure.core.credential.AzureKeyCredential; import com.azure.core.http.HttpPipeline; import com.azure.core.http.HttpPipelineBuilder; +import com.azure.core.util.polling.AsyncPollResponse; import reactor.core.publisher.Flux; import java.io.ByteArrayInputStream; @@ -70,17 +71,17 @@ public void beginRecognizeCustomFormsFromUrl() { String formUrl = "{form_url}"; String modelId = "{custom_trained_model_id}"; - formRecognizerAsyncClient.beginRecognizeCustomFormsFromUrl(formUrl, modelId).flatMap( - recognizePollingOperation -> - // if training polling operation completed, retrieve the final result. - recognizePollingOperation.getFinalResult()).subscribe(recognizedForms -> - recognizedForms.forEach(recognizedForm -> { - recognizedForm.getFields().forEach((fieldText, fieldValue) -> { - System.out.printf("Field text: %s%n", fieldText); - System.out.printf("Field value: %s%n", fieldValue.getValue()); - System.out.printf("Confidence score: %.2f%n", fieldValue.getConfidence()); - }); - })); + // if training polling operation completed, retrieve the final result. + formRecognizerAsyncClient.beginRecognizeCustomFormsFromUrl(formUrl, modelId) + // if training polling operation completed, retrieve the final result. + .flatMap(AsyncPollResponse::getFinalResult) + .flatMap(Flux::fromIterable) + .subscribe(recognizedForm -> recognizedForm.getFields() + .forEach((fieldText, fieldValue) -> { + System.out.printf("Field text: %s%n", fieldText); + System.out.printf("Field value: %s%n", fieldValue.getValue()); + System.out.printf("Confidence score: %.2f%n", fieldValue.getConfidence()); + })); // END: com.azure.ai.formrecognizer.FormRecognizerAsyncClient.beginRecognizeCustomFormsFromUrl#string-string } @@ -98,16 +99,15 @@ public void beginRecognizeCustomFormsFromUrlWithOptions() { new RecognizeOptions() .setIncludeFieldElements(includeTextContent) .setPollInterval(Duration.ofSeconds(10))) - .flatMap(recognizePollingOperation -> - // if training polling operation completed, retrieve the final result. - recognizePollingOperation.getFinalResult()).subscribe(recognizedForms -> - recognizedForms.forEach(recognizedForm -> { - recognizedForm.getFields().forEach((fieldText, fieldValue) -> { - System.out.printf("Field text: %s%n", fieldText); - System.out.printf("Field value: %s%n", fieldValue.getValue()); - System.out.printf("Confidence score: %.2f%n", fieldValue.getConfidence()); - }); - })); + // if training polling operation completed, retrieve the final result. + .flatMap(AsyncPollResponse::getFinalResult) + .flatMap(Flux::fromIterable) + .subscribe(recognizedForm -> recognizedForm.getFields() + .forEach((fieldText, fieldValue) -> { + System.out.printf("Field text: %s%n", fieldText); + System.out.printf("Field value: %s%n", fieldValue.getValue()); + System.out.printf("Confidence score: %.2f%n", fieldValue.getConfidence()); + })); // END: com.azure.ai.formrecognizer.FormRecognizerAsyncClient.beginRecognizeCustomFormsFromUrl#string-string-recognizeOptions } @@ -123,17 +123,17 @@ public void beginRecognizeCustomForms() throws IOException { // Utility method to convert input stream to Byte buffer Flux buffer = toFluxByteBuffer(new ByteArrayInputStream(Files.readAllBytes(form.toPath()))); + // if training polling operation completed, retrieve the final result. formRecognizerAsyncClient.beginRecognizeCustomForms(buffer, form.length(), modelId) - .flatMap(recognizePollingOperation -> - // if training polling operation completed, retrieve the final result. - recognizePollingOperation.getFinalResult()).subscribe(recognizedForms -> - recognizedForms.forEach(recognizedForm -> { - recognizedForm.getFields().forEach((fieldText, fieldValue) -> { - System.out.printf("Field text: %s%n", fieldText); - System.out.printf("Field value: %s%n", fieldValue.getValue()); - System.out.printf("Confidence score: %.2f%n", fieldValue.getConfidence()); - }); - })); + // if training polling operation completed, retrieve the final result. + .flatMap(AsyncPollResponse::getFinalResult) + .flatMap(Flux::fromIterable) + .subscribe(recognizedForm -> recognizedForm.getFields() + .forEach((fieldText, fieldValue) -> { + System.out.printf("Field text: %s%n", fieldText); + System.out.printf("Field value: %s%n", fieldValue.getValue()); + System.out.printf("Confidence score: %.2f%n", fieldValue.getConfidence()); + })); // END: com.azure.ai.formrecognizer.FormRecognizerAsyncClient.beginRecognizeCustomForms#Flux-long-string } @@ -152,21 +152,21 @@ public void beginRecognizeCustomFormsWithOptions() throws IOException { // Utility method to convert input stream to Byte buffer Flux buffer = toFluxByteBuffer(new ByteArrayInputStream(Files.readAllBytes(form.toPath()))); + // if training polling operation completed, retrieve the final result. formRecognizerAsyncClient.beginRecognizeCustomForms(buffer, form.length(), modelId, new RecognizeOptions() .setContentType(FormContentType.IMAGE_JPEG) .setIncludeFieldElements(includeFieldElements) .setPollInterval(Duration.ofSeconds(5))) - .flatMap(recognizePollingOperation -> - // if training polling operation completed, retrieve the final result. - recognizePollingOperation.getFinalResult()).subscribe(recognizedForms -> - recognizedForms.forEach(recognizedForm -> { - recognizedForm.getFields().forEach((fieldText, fieldValue) -> { - System.out.printf("Field text: %s%n", fieldText); - System.out.printf("Field value: %s%n", fieldValue.getValue()); - System.out.printf("Confidence score: %.2f%n", fieldValue.getConfidence()); - }); - })); + // if training polling operation completed, retrieve the final result. + .flatMap(AsyncPollResponse::getFinalResult) + .flatMap(Flux::fromIterable) + .subscribe(recognizedForm -> recognizedForm.getFields() + .forEach((fieldText, fieldValue) -> { + System.out.printf("Field text: %s%n", fieldText); + System.out.printf("Field value: %s%n", fieldValue.getValue()); + System.out.printf("Confidence score: %.2f%n", fieldValue.getConfidence()); + })); // END: com.azure.ai.formrecognizer.FormRecognizerAsyncClient.beginRecognizeCustomForms#Flux-long-string-recognizeOptions } @@ -178,18 +178,19 @@ public void beginRecognizeCustomFormsWithOptions() throws IOException { public void beginRecognizeContentFromUrl() { // BEGIN: com.azure.ai.formrecognizer.FormRecognizerAsyncClient.beginRecognizeContentFromUrl#string String formUrl = "{formUrl}"; - formRecognizerAsyncClient.beginRecognizeContentFromUrl(formUrl).flatMap( - recognizePollingOperation -> - recognizePollingOperation.getFinalResult()).subscribe(layoutPageResults -> - layoutPageResults.forEach(recognizedForm -> { - System.out.printf("Page Angle: %s%n", recognizedForm.getTextAngle()); - System.out.printf("Page Dimension unit: %s%n", recognizedForm.getUnit()); - // Table information - System.out.println("Recognized Tables: "); - recognizedForm.getTables().forEach(formTable -> - formTable.getCells().forEach(recognizedTableCell -> - System.out.printf("%s ", recognizedTableCell.getText()))); - })); + formRecognizerAsyncClient.beginRecognizeContentFromUrl(formUrl) + // if training polling operation completed, retrieve the final result. + .flatMap(AsyncPollResponse::getFinalResult) + .flatMap(Flux::fromIterable) + .subscribe(formPage -> { + System.out.printf("Page Angle: %s%n", formPage.getTextAngle()); + System.out.printf("Page Dimension unit: %s%n", formPage.getUnit()); + // Table information + System.out.println("Recognized Tables: "); + formPage.getTables().forEach(formTable -> + formTable.getCells().forEach(recognizedTableCell -> + System.out.printf("%s ", recognizedTableCell.getText()))); + }); // END: com.azure.ai.formrecognizer.FormRecognizerAsyncClient.beginRecognizeContentFromUrl#string } @@ -200,21 +201,20 @@ public void beginRecognizeContentFromUrl() { public void beginRecognizeContentFromUrlWithOptions() { // BEGIN: com.azure.ai.formrecognizer.FormRecognizerAsyncClient.beginRecognizeContentFromUrl#string-recognizeOptions String formUrl = "{formUrl}"; + // if training polling operation completed, retrieve the final result. formRecognizerAsyncClient.beginRecognizeContentFromUrl(formUrl, new RecognizeOptions().setPollInterval(Duration.ofSeconds(5))) - .flatMap(recognizePollingOperation -> - // if training polling operation completed, retrieve the final result. - recognizePollingOperation.getFinalResult()) - .subscribe(contentPageResult -> - contentPageResult.forEach(recognizedForm -> { - System.out.printf("Page Angle: %s%n", recognizedForm.getTextAngle()); - System.out.printf("Page Dimension unit: %s%n", recognizedForm.getUnit()); - // Table information - System.out.println("Recognized Tables: "); - recognizedForm.getTables().forEach(formTable -> - formTable.getCells().forEach(recognizedTableCell -> - System.out.printf("%s ", recognizedTableCell.getText()))); - })); + .flatMap(AsyncPollResponse::getFinalResult) + .flatMap(Flux::fromIterable) + .subscribe(formPage -> { + System.out.printf("Page Angle: %s%n", formPage.getTextAngle()); + System.out.printf("Page Dimension unit: %s%n", formPage.getUnit()); + // Table information + System.out.println("Recognized Tables: "); + formPage.getTables().forEach(formTable -> + formTable.getCells().forEach(recognizedTableCell -> + System.out.printf("%s ", recognizedTableCell.getText()))); + }); // END: com.azure.ai.formrecognizer.FormRecognizerAsyncClient.beginRecognizeContentFromUrl#string-recognizeOptions } @@ -229,20 +229,19 @@ public void beginRecognizeContent() throws IOException { // Utility method to convert input stream to Byte buffer Flux buffer = toFluxByteBuffer(new ByteArrayInputStream(Files.readAllBytes(form.toPath()))); + // if training polling operation completed, retrieve the final result. formRecognizerAsyncClient.beginRecognizeContent(buffer, form.length()) - .flatMap(recognizePollingOperation -> - // if training polling operation completed, retrieve the final result. - recognizePollingOperation.getFinalResult()) - .subscribe(contentPageResult -> - contentPageResult.forEach(formPage -> { - System.out.printf("Page Angle: %s%n", formPage.getTextAngle()); - System.out.printf("Page Dimension unit: %s%n", formPage.getUnit()); - // Table information - System.out.println("Recognized Tables: "); - formPage.getTables().forEach(formTable -> - formTable.getCells().forEach(recognizedTableCell -> - System.out.printf("%s ", recognizedTableCell.getText()))); - })); + .flatMap(AsyncPollResponse::getFinalResult) + .flatMap(Flux::fromIterable) + .subscribe(formPage -> { + System.out.printf("Page Angle: %s%n", formPage.getTextAngle()); + System.out.printf("Page Dimension unit: %s%n", formPage.getUnit()); + // Table information + System.out.println("Recognized Tables: "); + formPage.getTables().forEach(formTable -> + formTable.getCells().forEach(recognizedTableCell -> + System.out.printf("%s ", recognizedTableCell.getText()))); + }); // END: com.azure.ai.formrecognizer.FormRecognizerAsyncClient.beginRecognizeContent#Flux-long } @@ -257,22 +256,21 @@ public void beginRecognizeContentWithOptions() throws IOException { File form = new File("{local/file_path/fileName.jpg}"); // Utility method to convert input stream to Byte buffer Flux buffer = toFluxByteBuffer(new ByteArrayInputStream(Files.readAllBytes(form.toPath()))); + // if training polling operation completed, retrieve the final result. formRecognizerAsyncClient.beginRecognizeContent(buffer, form.length(), new RecognizeOptions() .setContentType(FormContentType.APPLICATION_PDF) .setPollInterval(Duration.ofSeconds(5))) - .flatMap(recognizePollingOperation -> - // if training polling operation completed, retrieve the final result. - recognizePollingOperation.getFinalResult()) - .subscribe(contentPageResult -> - contentPageResult.forEach(formPage -> { - System.out.printf("Page Angle: %s%n", formPage.getTextAngle()); - System.out.printf("Page Dimension unit: %s%n", formPage.getUnit()); - // Table information - System.out.println("Recognized Tables: "); - formPage.getTables().forEach(formTable -> formTable.getCells().forEach(recognizedTableCell -> - System.out.printf("%s ", recognizedTableCell.getText()))); - })); + .flatMap(AsyncPollResponse::getFinalResult) + .flatMap(Flux::fromIterable) + .subscribe(formPage -> { + System.out.printf("Page Angle: %s%n", formPage.getTextAngle()); + System.out.printf("Page Dimension unit: %s%n", formPage.getUnit()); + // Table information + System.out.println("Recognized Tables: "); + formPage.getTables().forEach(formTable -> formTable.getCells().forEach(recognizedTableCell -> + System.out.printf("%s ", recognizedTableCell.getText()))); + }); // END: com.azure.ai.formrecognizer.FormRecognizerAsyncClient.beginRecognizeContent#Flux-long-recognizeOptions } @@ -284,10 +282,10 @@ public void beginRecognizeContentWithOptions() throws IOException { public void beginRecognizeReceiptsFromUrl() { // BEGIN: com.azure.ai.formrecognizer.FormRecognizerAsyncClient.beginRecognizeReceiptsFromUrl#string String receiptUrl = "{receiptUrl}"; + // if training polling operation completed, retrieve the final result. formRecognizerAsyncClient.beginRecognizeReceiptsFromUrl(receiptUrl) - .flatMap(recognizePollingOperation -> - // if training polling operation completed, retrieve the final result. - recognizePollingOperation.getFinalResult()) + // if training polling operation completed, retrieve the final result. + .flatMap(AsyncPollResponse::getFinalResult) .subscribe(recognizedReceipts -> { for (int i = 0; i < recognizedReceipts.size(); i++) { RecognizedForm recognizedForm = recognizedReceipts.get(i); @@ -295,7 +293,7 @@ public void beginRecognizeReceiptsFromUrl() { System.out.printf("----------- Recognized Receipt page %d -----------%n", i); FormField merchantNameField = recognizedFields.get("MerchantName"); if (merchantNameField != null) { - if (FieldValueType.STRING.equals(merchantNameField.getValueType())) { + if (FieldValueType.STRING == merchantNameField.getValueType()) { String merchantName = FieldValueType.STRING.cast(merchantNameField); System.out.printf("Merchant Name: %s, confidence: %.2f%n", merchantName, merchantNameField.getConfidence()); @@ -304,7 +302,7 @@ public void beginRecognizeReceiptsFromUrl() { FormField merchantPhoneNumberField = recognizedFields.get("MerchantPhoneNumber"); if (merchantPhoneNumberField != null) { - if (FieldValueType.PHONE_NUMBER.equals(merchantNameField.getValueType())) { + if (FieldValueType.PHONE_NUMBER == merchantPhoneNumberField.getValueType()) { String merchantAddress = FieldValueType.PHONE_NUMBER.cast(merchantPhoneNumberField); System.out.printf("Merchant Phone number: %s, confidence: %.2f%n", merchantAddress, merchantPhoneNumberField.getConfidence()); @@ -313,7 +311,7 @@ public void beginRecognizeReceiptsFromUrl() { FormField transactionDateField = recognizedFields.get("TransactionDate"); if (transactionDateField != null) { - if (FieldValueType.DATE.equals(transactionDateField.getValueType())) { + if (FieldValueType.DATE == transactionDateField.getValueType()) { LocalDate transactionDate = FieldValueType.DATE.cast(transactionDateField); System.out.printf("Transaction Date: %s, confidence: %.2f%n", transactionDate, transactionDateField.getConfidence()); @@ -323,23 +321,20 @@ public void beginRecognizeReceiptsFromUrl() { FormField receiptItemsField = recognizedFields.get("Items"); if (receiptItemsField != null) { System.out.printf("Receipt Items: %n"); - if (FieldValueType.LIST.equals(receiptItemsField.getValueType())) { + if (FieldValueType.LIST == receiptItemsField.getValueType()) { List> receiptItems = FieldValueType.LIST.cast(receiptItemsField); - receiptItems.forEach(receiptItem -> { - if (FieldValueType.MAP.equals(receiptItem.getValueType())) { - - Map> formFieldMap = FieldValueType.MAP.cast(receiptItem); - formFieldMap.forEach((key, formField) -> { - if ("Quantity".equals(key)) { - if (FieldValueType.DOUBLE.equals(formField.getValueType())) { - Float quantity = FieldValueType.DOUBLE.cast(formField); - System.out.printf("Quantity: %f, confidence: %.2f%n", - quantity, formField.getConfidence()); - } + receiptItems.stream() + .filter(receiptItem -> FieldValueType.MAP == receiptItem.getValueType()) + .>>map(FieldValueType.MAP::cast) + .forEach(formFieldMap -> formFieldMap.forEach((key, formField) -> { + if ("Quantity".equals(key)) { + if (FieldValueType.DOUBLE == formField.getValueType()) { + Float quantity = FieldValueType.DOUBLE.cast(formField); + System.out.printf("Quantity: %f, confidence: %.2f%n", + quantity, formField.getConfidence()); } - }); - } - }); + } + })); } } } @@ -354,13 +349,12 @@ public void beginRecognizeReceiptsFromUrlWithOptions() { // BEGIN: com.azure.ai.formrecognizer.FormRecognizerAsyncClient.beginRecognizeReceiptsFromUrl#string-recognizeOptions String receiptUrl = "{receiptUrl}"; boolean includeTextContent = true; + // if training polling operation completed, retrieve the final result. formRecognizerAsyncClient.beginRecognizeReceiptsFromUrl(receiptUrl, new RecognizeOptions() .setIncludeFieldElements(includeTextContent) .setPollInterval(Duration.ofSeconds(5))) - .flatMap(recognizePollingOperation -> - // if training polling operation completed, retrieve the final result. - recognizePollingOperation.getFinalResult()) + .flatMap(AsyncPollResponse::getFinalResult) .subscribe(recognizedReceipts -> { for (int i = 0; i < recognizedReceipts.size(); i++) { RecognizedForm recognizedReceipt = recognizedReceipts.get(i); @@ -368,7 +362,7 @@ public void beginRecognizeReceiptsFromUrlWithOptions() { System.out.printf("----------- Recognized Receipt page %d -----------%n", i); FormField merchantNameField = recognizedFields.get("MerchantName"); if (merchantNameField != null) { - if (FieldValueType.STRING.equals(merchantNameField.getValueType())) { + if (FieldValueType.STRING == merchantNameField.getValueType()) { String merchantName = FieldValueType.STRING.cast(merchantNameField); System.out.printf("Merchant Name: %s, confidence: %.2f%n", merchantName, merchantNameField.getConfidence()); @@ -377,7 +371,7 @@ public void beginRecognizeReceiptsFromUrlWithOptions() { FormField merchantPhoneNumberField = recognizedFields.get("MerchantPhoneNumber"); if (merchantPhoneNumberField != null) { - if (FieldValueType.PHONE_NUMBER.equals(merchantNameField.getValueType())) { + if (FieldValueType.PHONE_NUMBER == merchantPhoneNumberField.getValueType()) { String merchantAddress = FieldValueType.PHONE_NUMBER.cast(merchantPhoneNumberField); System.out.printf("Merchant Phone number: %s, confidence: %.2f%n", merchantAddress, merchantPhoneNumberField.getConfidence()); @@ -386,7 +380,7 @@ public void beginRecognizeReceiptsFromUrlWithOptions() { FormField transactionDateField = recognizedFields.get("TransactionDate"); if (transactionDateField != null) { - if (FieldValueType.DATE.equals(transactionDateField.getValueType())) { + if (FieldValueType.DATE == transactionDateField.getValueType()) { LocalDate transactionDate = FieldValueType.DATE.cast(transactionDateField); System.out.printf("Transaction Date: %s, confidence: %.2f%n", transactionDate, transactionDateField.getConfidence()); @@ -396,23 +390,20 @@ public void beginRecognizeReceiptsFromUrlWithOptions() { FormField receiptItemsField = recognizedFields.get("Items"); if (receiptItemsField != null) { System.out.printf("Receipt Items: %n"); - if (FieldValueType.LIST.equals(receiptItemsField.getValueType())) { + if (FieldValueType.LIST == receiptItemsField.getValueType()) { List> receiptItems = FieldValueType.LIST.cast(receiptItemsField); - receiptItems.forEach(receiptItem -> { - if (FieldValueType.MAP.equals(receiptItem.getValueType())) { - - Map> formFieldMap = FieldValueType.MAP.cast(receiptItem); - formFieldMap.forEach((key, formField) -> { - if ("Quantity".equals(key)) { - if (FieldValueType.DOUBLE.equals(formField.getValueType())) { - Float quantity = FieldValueType.DOUBLE.cast(formField); - System.out.printf("Quantity: %f, confidence: %.2f%n", - quantity, formField.getConfidence()); - } + receiptItems.stream() + .filter(receiptItem -> FieldValueType.MAP == receiptItem.getValueType()) + .>>map(FieldValueType.MAP::cast) + .forEach(formFieldMap -> formFieldMap.forEach((key, formField) -> { + if ("Quantity".equals(key)) { + if (FieldValueType.DOUBLE == formField.getValueType()) { + Float quantity = FieldValueType.DOUBLE.cast(formField); + System.out.printf("Quantity: %f, confidence: %.2f%n", + quantity, formField.getConfidence()); } - }); - } - }); + } + })); } } } @@ -429,65 +420,62 @@ public void beginRecognizeReceipts() throws IOException { // BEGIN: com.azure.ai.formrecognizer.FormRecognizerAsyncClient.beginRecognizeReceipts#Flux-long File receipt = new File("{file_source_url}"); Flux buffer = toFluxByteBuffer(new ByteArrayInputStream(Files.readAllBytes(receipt.toPath()))); + // if training polling operation completed, retrieve the final result. formRecognizerAsyncClient.beginRecognizeReceipts(buffer, receipt.length()) - .subscribe(recognizePollingOperation -> - // if training polling operation completed, retrieve the final result. - recognizePollingOperation.getFinalResult().subscribe(recognizedReceipts -> { - for (int i = 0; i < recognizedReceipts.size(); i++) { - RecognizedForm recognizedForm = recognizedReceipts.get(i); - Map> recognizedFields = recognizedForm.getFields(); - System.out.printf("----------- Recognized Receipt page %d -----------%n", i); - FormField merchantNameField = recognizedFields.get("MerchantName"); - if (merchantNameField != null) { - if (FieldValueType.STRING.equals(merchantNameField.getValueType())) { - String merchantName = FieldValueType.STRING.cast(merchantNameField); - System.out.printf("Merchant Name: %s, confidence: %.2f%n", - merchantName, merchantNameField.getConfidence()); + .flatMap(AsyncPollResponse::getFinalResult) + .subscribe(recognizedReceipts -> { + for (int i = 0; i < recognizedReceipts.size(); i++) { + RecognizedForm recognizedForm = recognizedReceipts.get(i); + Map> recognizedFields = recognizedForm.getFields(); + System.out.printf("----------- Recognized Receipt page %d -----------%n", i); + FormField merchantNameField = recognizedFields.get("MerchantName"); + if (merchantNameField != null) { + if (FieldValueType.STRING == merchantNameField.getValueType()) { + String merchantName = FieldValueType.STRING.cast(merchantNameField); + System.out.printf("Merchant Name: %s, confidence: %.2f%n", + merchantName, merchantNameField.getConfidence()); + } } - } - FormField merchantPhoneNumberField = recognizedFields.get("MerchantPhoneNumber"); - if (merchantPhoneNumberField != null) { - if (FieldValueType.PHONE_NUMBER.equals(merchantNameField.getValueType())) { - String merchantAddress = FieldValueType.PHONE_NUMBER.cast(merchantPhoneNumberField); - System.out.printf("Merchant Phone number: %s, confidence: %.2f%n", - merchantAddress, merchantPhoneNumberField.getConfidence()); + FormField merchantPhoneNumberField = recognizedFields.get("MerchantPhoneNumber"); + if (merchantPhoneNumberField != null) { + if (FieldValueType.PHONE_NUMBER == merchantPhoneNumberField.getValueType()) { + String merchantAddress = FieldValueType.PHONE_NUMBER.cast(merchantPhoneNumberField); + System.out.printf("Merchant Phone number: %s, confidence: %.2f%n", + merchantAddress, merchantPhoneNumberField.getConfidence()); + } } - } - FormField transactionDateField = recognizedFields.get("TransactionDate"); - if (transactionDateField != null) { - if (FieldValueType.DATE.equals(transactionDateField.getValueType())) { - LocalDate transactionDate = FieldValueType.DATE.cast(transactionDateField); - System.out.printf("Transaction Date: %s, confidence: %.2f%n", - transactionDate, transactionDateField.getConfidence()); + FormField transactionDateField = recognizedFields.get("TransactionDate"); + if (transactionDateField != null) { + if (FieldValueType.DATE == transactionDateField.getValueType()) { + LocalDate transactionDate = FieldValueType.DATE.cast(transactionDateField); + System.out.printf("Transaction Date: %s, confidence: %.2f%n", + transactionDate, transactionDateField.getConfidence()); + } } - } - FormField receiptItemsField = recognizedFields.get("Items"); - if (receiptItemsField != null) { - System.out.printf("Receipt Items: %n"); - if (FieldValueType.LIST.equals(receiptItemsField.getValueType())) { - List> receiptItems = FieldValueType.LIST.cast(receiptItemsField); - receiptItems.forEach(receiptItem -> { - if (FieldValueType.MAP.equals(receiptItem.getValueType())) { - - Map> formFieldMap = FieldValueType.MAP.cast(receiptItem); - formFieldMap.forEach((key, formField) -> { + FormField receiptItemsField = recognizedFields.get("Items"); + if (receiptItemsField != null) { + System.out.printf("Receipt Items: %n"); + if (FieldValueType.LIST == receiptItemsField.getValueType()) { + List> receiptItems = FieldValueType.LIST.cast(receiptItemsField); + receiptItems.stream() + .filter(receiptItem -> FieldValueType.MAP == receiptItem.getValueType()) + .>>map(FieldValueType.MAP::cast) + .forEach(formFieldMap -> formFieldMap.forEach((key, formField) -> { if ("Quantity".equals(key)) { - if (FieldValueType.DOUBLE.equals(formField.getValueType())) { + if (FieldValueType.DOUBLE == formField.getValueType()) { Float quantity = FieldValueType.DOUBLE.cast(formField); System.out.printf("Quantity: %f, confidence: %.2f%n", quantity, formField.getConfidence()); } } - }); - } - }); + })); + } } } - } - })); + }); // END: com.azure.ai.formrecognizer.FormRecognizerAsyncClient.beginRecognizeReceipts#Flux-long } @@ -503,70 +491,66 @@ public void beginRecognizeReceiptsWithOptions() throws IOException { boolean includeFieldElements = true; // Utility method to convert input stream to Byte buffer Flux buffer = toFluxByteBuffer(new ByteArrayInputStream(Files.readAllBytes(receipt.toPath()))); + // if training polling operation completed, retrieve the final result. formRecognizerAsyncClient.beginRecognizeReceipts(buffer, receipt.length(), new RecognizeOptions() .setContentType(FormContentType.IMAGE_JPEG) .setIncludeFieldElements(includeFieldElements) .setPollInterval(Duration.ofSeconds(5))) - .subscribe(recognizePollingOperation -> - // if training polling operation completed, retrieve the final result. - recognizePollingOperation.getFinalResult().subscribe(recognizedReceipts -> { - for (int i = 0; i < recognizedReceipts.size(); i++) { - RecognizedForm recognizedForm = recognizedReceipts.get(i); - Map> recognizedFields = recognizedForm.getFields(); - System.out.printf("----------- Recognized Receipt page %d -----------%n", i); - FormField merchantNameField = recognizedFields.get("MerchantName"); - if (merchantNameField != null) { - if (FieldValueType.STRING.equals(merchantNameField.getValueType())) { - String merchantName = FieldValueType.STRING.cast(merchantNameField); - System.out.printf("Merchant Name: %s, confidence: %.2f%n", - merchantName, merchantNameField.getConfidence()); - } + .flatMap(AsyncPollResponse::getFinalResult) + .subscribe(recognizedReceipts -> { + for (int i = 0; i < recognizedReceipts.size(); i++) { + RecognizedForm recognizedForm = recognizedReceipts.get(i); + Map> recognizedFields = recognizedForm.getFields(); + System.out.printf("----------- Recognized Receipt page %d -----------%n", i); + FormField merchantNameField = recognizedFields.get("MerchantName"); + if (merchantNameField != null) { + if (FieldValueType.STRING == merchantNameField.getValueType()) { + String merchantName = FieldValueType.STRING.cast(merchantNameField); + System.out.printf("Merchant Name: %s, confidence: %.2f%n", + merchantName, merchantNameField.getConfidence()); } + } - FormField merchantPhoneNumberField = recognizedFields.get("MerchantPhoneNumber"); - if (merchantPhoneNumberField != null) { - if (FieldValueType.PHONE_NUMBER.equals(merchantNameField.getValueType())) { - String merchantAddress = FieldValueType.PHONE_NUMBER.cast(merchantPhoneNumberField); - System.out.printf("Merchant Phone number: %s, confidence: %.2f%n", - merchantAddress, merchantPhoneNumberField.getConfidence()); - } + FormField merchantPhoneNumberField = recognizedFields.get("MerchantPhoneNumber"); + if (merchantPhoneNumberField != null) { + if (FieldValueType.PHONE_NUMBER == merchantPhoneNumberField.getValueType()) { + String merchantAddress = FieldValueType.PHONE_NUMBER.cast(merchantPhoneNumberField); + System.out.printf("Merchant Phone number: %s, confidence: %.2f%n", + merchantAddress, merchantPhoneNumberField.getConfidence()); } + } - FormField transactionDateField = recognizedFields.get("TransactionDate"); - if (transactionDateField != null) { - if (FieldValueType.DATE.equals(transactionDateField.getValueType())) { - LocalDate transactionDate = FieldValueType.DATE.cast(transactionDateField); - System.out.printf("Transaction Date: %s, confidence: %.2f%n", - transactionDate, transactionDateField.getConfidence()); - } + FormField transactionDateField = recognizedFields.get("TransactionDate"); + if (transactionDateField != null) { + if (FieldValueType.DATE == transactionDateField.getValueType()) { + LocalDate transactionDate = FieldValueType.DATE.cast(transactionDateField); + System.out.printf("Transaction Date: %s, confidence: %.2f%n", + transactionDate, transactionDateField.getConfidence()); } + } - FormField receiptItemsField = recognizedFields.get("Items"); - if (receiptItemsField != null) { - System.out.printf("Receipt Items: %n"); - if (FieldValueType.LIST.equals(receiptItemsField.getValueType())) { - List> receiptItems = FieldValueType.LIST.cast(receiptItemsField); - receiptItems.forEach(receiptItem -> { - if (FieldValueType.MAP.equals(receiptItem.getValueType())) { - - Map> formFieldMap = FieldValueType.MAP.cast(receiptItem); - formFieldMap.forEach((key, formField) -> { - if ("Quantity".equals(key)) { - if (FieldValueType.DOUBLE.equals(formField.getValueType())) { - Float quantity = FieldValueType.DOUBLE.cast(formField); - System.out.printf("Quantity: %f, confidence: %.2f%n", - quantity, formField.getConfidence()); - } - } - }); + FormField receiptItemsField = recognizedFields.get("Items"); + if (receiptItemsField != null) { + System.out.printf("Receipt Items: %n"); + if (FieldValueType.LIST == receiptItemsField.getValueType()) { + List> receiptItems = FieldValueType.LIST.cast(receiptItemsField); + receiptItems.stream() + .filter(receiptItem -> FieldValueType.MAP == receiptItem.getValueType()) + .>>map(FieldValueType.MAP::cast) + .forEach(formFieldMap -> formFieldMap.forEach((key, formField) -> { + if ("Quantity".equals(key)) { + if (FieldValueType.DOUBLE == formField.getValueType()) { + Float quantity = FieldValueType.DOUBLE.cast(formField); + System.out.printf("Quantity: %f, confidence: %.2f%n", + quantity, formField.getConfidence()); + } } - }); - } + })); } } - })); - + } + }); // END: com.azure.ai.formrecognizer.FormRecognizerAsyncClient.beginRecognizeReceipts#Flux-long-recognizeOptions } } diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/src/samples/java/com/azure/ai/formrecognizer/FormRecognizerClientJavaDocCodeSnippets.java b/sdk/formrecognizer/azure-ai-formrecognizer/src/samples/java/com/azure/ai/formrecognizer/FormRecognizerClientJavaDocCodeSnippets.java index 3e88ff23d154f..ff6c25bf2bf1f 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/src/samples/java/com/azure/ai/formrecognizer/FormRecognizerClientJavaDocCodeSnippets.java +++ b/sdk/formrecognizer/azure-ai-formrecognizer/src/samples/java/com/azure/ai/formrecognizer/FormRecognizerClientJavaDocCodeSnippets.java @@ -6,7 +6,9 @@ import com.azure.ai.formrecognizer.models.FieldValueType; import com.azure.ai.formrecognizer.models.FormContentType; import com.azure.ai.formrecognizer.models.FormField; +import com.azure.ai.formrecognizer.models.FormPage; import com.azure.ai.formrecognizer.models.RecognizeOptions; +import com.azure.ai.formrecognizer.models.RecognizedForm; import com.azure.core.credential.AzureKeyCredential; import com.azure.core.http.HttpPipeline; import com.azure.core.http.HttpPipelineBuilder; @@ -68,12 +70,14 @@ public void beginRecognizeCustomFormsFromUrl() { String modelId = "{custom_trained_model_id}"; formRecognizerClient.beginRecognizeCustomFormsFromUrl(formUrl, modelId).getFinalResult() - .forEach(recognizedForm -> - recognizedForm.getFields().forEach((fieldText, fieldValue) -> { - System.out.printf("Field text: %s%n", fieldText); - System.out.printf("Field value: %s%n", fieldValue.getValue()); - System.out.printf("Confidence score: %.2f%n", fieldValue.getConfidence()); - })); + .stream() + .map(RecognizedForm::getFields) + .forEach(formFieldMap -> formFieldMap.forEach((fieldText, formField) -> { + System.out.printf("Field text: %s%n", fieldText); + System.out.printf("Field value: %s%n", formField.getValue()); + System.out.printf("Confidence score: %.2f%n", formField.getConfidence()); + })); + // END: com.azure.ai.formrecognizer.FormRecognizerClient.beginRecognizeCustomFormsFromUrl#string-string } @@ -92,10 +96,12 @@ public void beginRecognizeCustomFormsFromUrlWithOptions() { .setIncludeFieldElements(includeFieldElements) .setPollInterval(Duration.ofSeconds(10))) .getFinalResult() - .forEach(recognizedForm -> recognizedForm.getFields().forEach((fieldText, fieldValue) -> { + .stream() + .map(RecognizedForm::getFields) + .forEach(formFieldMap -> formFieldMap.forEach((fieldText, formField) -> { System.out.printf("Field text: %s%n", fieldText); - System.out.printf("Field value: %s%n", fieldValue.getValue()); - System.out.printf("Confidence score: %.2f%n", fieldValue.getConfidence()); + System.out.printf("Field value: %s%n", formField.getValue()); + System.out.printf("Confidence score: %.2f%n", formField.getConfidence()); })); // END: com.azure.ai.formrecognizer.FormRecognizerClient.beginRecognizeCustomFormsFromUrl#string-string-recognizeOptions } @@ -111,14 +117,18 @@ public void beginRecognizeCustomForms() throws IOException { File form = new File("{local/file_path/fileName.jpg}"); String modelId = "{custom_trained_model_id}"; byte[] fileContent = Files.readAllBytes(form.toPath()); - InputStream targetStream = new ByteArrayInputStream(fileContent); + try (InputStream targetStream = new ByteArrayInputStream(fileContent)) { - formRecognizerClient.beginRecognizeCustomForms(targetStream, form.length(), modelId).getFinalResult() - .forEach(recognizedForm -> recognizedForm.getFields().forEach((fieldText, fieldValue) -> { - System.out.printf("Field text: %s%n", fieldText); - System.out.printf("Field value: %s%n", fieldValue.getValue()); - System.out.printf("Confidence score: %.2f%n", fieldValue.getConfidence()); - })); + formRecognizerClient.beginRecognizeCustomForms(targetStream, form.length(), modelId) + .getFinalResult() + .stream() + .map(RecognizedForm::getFields) + .forEach(formFieldMap -> formFieldMap.forEach((fieldText, formField) -> { + System.out.printf("Field text: %s%n", fieldText); + System.out.printf("Field value: %s%n", formField.getValue()); + System.out.printf("Confidence score: %.2f%n", formField.getConfidence()); + })); + } // END: com.azure.ai.formrecognizer.FormRecognizerClient.beginRecognizeCustomForms#InputStream-long-string } @@ -133,21 +143,23 @@ public void beginRecognizeCustomFormsWithOptions() throws IOException { File form = new File("{local/file_path/fileName.jpg}"); String modelId = "{custom_trained_model_id}"; boolean includeFieldElements = true; - byte[] fileContent = Files.readAllBytes(form.toPath()); - InputStream targetStream = new ByteArrayInputStream(fileContent); - formRecognizerClient.beginRecognizeCustomForms(targetStream, form.length(), modelId, - new RecognizeOptions() - .setContentType(FormContentType.IMAGE_JPEG) - .setIncludeFieldElements(includeFieldElements) - .setPollInterval(Duration.ofSeconds(10))) - .getFinalResult() - .forEach(recognizedForm -> recognizedForm.getFields().forEach((fieldText, fieldValue) -> { - System.out.printf("Field text: %s%n", fieldText); - System.out.printf("Field value: %s%n", fieldValue.getValue()); - System.out.printf("Confidence score: %.2f%n", fieldValue.getConfidence()); - })); + try (InputStream targetStream = new ByteArrayInputStream(fileContent)) { + formRecognizerClient.beginRecognizeCustomForms(targetStream, form.length(), modelId, + new RecognizeOptions() + .setContentType(FormContentType.IMAGE_JPEG) + .setIncludeFieldElements(includeFieldElements) + .setPollInterval(Duration.ofSeconds(10))) + .getFinalResult() + .stream() + .map(RecognizedForm::getFields) + .forEach(formFieldMap -> formFieldMap.forEach((fieldText, formField) -> { + System.out.printf("Field text: %s%n", fieldText); + System.out.printf("Field value: %s%n", formField.getValue()); + System.out.printf("Confidence score: %.2f%n", formField.getConfidence()); + })); + } // END: com.azure.ai.formrecognizer.FormRecognizerClient.beginRecognizeCustomForms#InputStream-long-string-recognizeOptions } @@ -159,14 +171,18 @@ public void beginRecognizeCustomFormsWithOptions() throws IOException { public void beginRecognizeContentFromUrl() { // BEGIN: com.azure.ai.formrecognizer.FormRecognizerClient.beginRecognizeContentFromUrl#string String formUrl = "{form_url}"; - formRecognizerClient.beginRecognizeContentFromUrl(formUrl).getFinalResult().forEach(recognizedForm -> { - System.out.printf("Page Angle: %s%n", recognizedForm.getTextAngle()); - System.out.printf("Page Dimension unit: %s%n", recognizedForm.getUnit()); - // Table information - System.out.println("Recognized Tables: "); - recognizedForm.getTables().forEach(formTable -> formTable.getCells().forEach(recognizedTableCell -> - System.out.printf("%s ", recognizedTableCell.getText()))); - }); + formRecognizerClient.beginRecognizeContentFromUrl(formUrl) + .getFinalResult() + .forEach(formPage -> { + System.out.printf("Page Angle: %s%n", formPage.getTextAngle()); + System.out.printf("Page Dimension unit: %s%n", formPage.getUnit()); + // Table information + System.out.println("Recognized Tables: "); + formPage.getTables() + .stream() + .flatMap(formTable -> formTable.getCells().stream()) + .forEach(recognizedTableCell -> System.out.printf("%s ", recognizedTableCell.getText())); + }); // END: com.azure.ai.formrecognizer.FormRecognizerClient.beginRecognizeContentFromUrl#string } @@ -181,14 +197,15 @@ public void beginRecognizeContentFromUrlWithOptions() { new RecognizeOptions() .setPollInterval(Duration.ofSeconds(5))) .getFinalResult() - .forEach(recognizedForm -> { - System.out.printf("Page Angle: %s%n", recognizedForm.getTextAngle()); - System.out.printf("Page Dimension unit: %s%n", recognizedForm.getUnit()); + .forEach(formPage -> { + System.out.printf("Page Angle: %s%n", formPage.getTextAngle()); + System.out.printf("Page Dimension unit: %s%n", formPage.getUnit()); // Table information System.out.println("Recognized Tables: "); - recognizedForm.getTables().forEach(formTable -> - formTable.getCells().forEach(recognizedTableCell -> - System.out.printf("%s ", recognizedTableCell.getText()))); + formPage.getTables() + .stream() + .flatMap(formTable -> formTable.getCells().stream()) + .forEach(recognizedTableCell -> System.out.printf("%s ", recognizedTableCell.getText())); }); // END: com.azure.ai.formrecognizer.FormRecognizerClient.beginRecognizeContentFromUrl#string-recognizeOptions } @@ -202,15 +219,20 @@ public void beginRecognizeContent() throws IOException { // BEGIN: com.azure.ai.formrecognizer.FormRecognizerClient.beginRecognizeContent#InputStream-long File form = new File("{local/file_path/fileName.pdf}"); byte[] fileContent = Files.readAllBytes(form.toPath()); - InputStream targetStream = new ByteArrayInputStream(fileContent); - formRecognizerClient.beginRecognizeContent(targetStream, form.length()).getFinalResult() - .forEach(recognizedForm -> { - System.out.printf("Page Angle: %f%n", recognizedForm.getTextAngle()); - System.out.printf("Page Dimension unit: %s%n", recognizedForm.getUnit()); - System.out.println("Recognized Tables: "); - recognizedForm.getTables().forEach(formTable -> formTable.getCells().forEach(recognizedTableCell -> - System.out.printf("%s ", recognizedTableCell.getText()))); - }); + try (InputStream targetStream = new ByteArrayInputStream(fileContent)) { + formRecognizerClient.beginRecognizeContent(targetStream, form.length()) + .getFinalResult() + .forEach(formPage -> { + System.out.printf("Page Angle: %s%n", formPage.getTextAngle()); + System.out.printf("Page Dimension unit: %s%n", formPage.getUnit()); + // Table information + System.out.println("Recognized Tables: "); + formPage.getTables() + .stream() + .flatMap(formTable -> formTable.getCells().stream()) + .forEach(recognizedTableCell -> System.out.printf("%s ", recognizedTableCell.getText())); + }); + } // END: com.azure.ai.formrecognizer.FormRecognizerClient.beginRecognizeContent#InputStream-long } @@ -224,19 +246,22 @@ public void beginRecognizeContentWithOptions() throws IOException { // BEGIN: com.azure.ai.formrecognizer.FormRecognizerClient.beginRecognizeContent#InputStream-long-recognizeOptions File form = new File("{file_source_url}"); byte[] fileContent = Files.readAllBytes(form.toPath()); - InputStream targetStream = new ByteArrayInputStream(fileContent); - - formRecognizerClient.beginRecognizeContent(targetStream, form.length(), - new RecognizeOptions() - .setPollInterval(Duration.ofSeconds(5))) - .getFinalResult().forEach(recognizedForm -> { - System.out.printf("Page Angle: %f%n", recognizedForm.getTextAngle()); - System.out.printf("Page Dimension unit: %s%n", recognizedForm.getUnit()); + try (InputStream targetStream = new ByteArrayInputStream(fileContent)) { + + for (FormPage formPage : formRecognizerClient.beginRecognizeContent(targetStream, form.length(), + new RecognizeOptions() + .setPollInterval(Duration.ofSeconds(5))) + .getFinalResult()) { + System.out.printf("Page Angle: %s%n", formPage.getTextAngle()); + System.out.printf("Page Dimension unit: %s%n", formPage.getUnit()); // Table information System.out.println("Recognized Tables: "); - recognizedForm.getTables().forEach(formTable -> formTable.getCells().forEach(recognizedTableCell -> - System.out.printf("%s ", recognizedTableCell.getText()))); - }); + formPage.getTables() + .stream() + .flatMap(formTable -> formTable.getCells().stream()) + .forEach(recognizedTableCell -> System.out.printf("%s ", recognizedTableCell.getText())); + } + } // END: com.azure.ai.formrecognizer.FormRecognizerClient.beginRecognizeContent#InputStream-long-recognizeOptions } @@ -248,12 +273,13 @@ public void beginRecognizeContentWithOptions() throws IOException { public void beginRecognizeReceiptsFromUrl() { // BEGIN: com.azure.ai.formrecognizer.FormRecognizerClient.beginRecognizeReceiptsFromUrl#string String receiptUrl = "{file_source_url}"; - formRecognizerClient.beginRecognizeReceiptsFromUrl(receiptUrl).getFinalResult() + formRecognizerClient.beginRecognizeReceiptsFromUrl(receiptUrl) + .getFinalResult() .forEach(recognizedReceipt -> { Map> recognizedFields = recognizedReceipt.getFields(); FormField merchantNameField = recognizedFields.get("MerchantName"); if (merchantNameField != null) { - if (FieldValueType.STRING.equals(merchantNameField.getValueType())) { + if (FieldValueType.STRING == merchantNameField.getValueType()) { String merchantName = FieldValueType.STRING.cast(merchantNameField); System.out.printf("Merchant Name: %s, confidence: %.2f%n", merchantName, merchantNameField.getConfidence()); @@ -262,7 +288,7 @@ public void beginRecognizeReceiptsFromUrl() { FormField merchantPhoneNumberField = recognizedFields.get("MerchantPhoneNumber"); if (merchantPhoneNumberField != null) { - if (FieldValueType.PHONE_NUMBER.equals(merchantNameField.getValueType())) { + if (FieldValueType.PHONE_NUMBER == merchantPhoneNumberField.getValueType()) { String merchantAddress = FieldValueType.PHONE_NUMBER.cast(merchantPhoneNumberField); System.out.printf("Merchant Phone number: %s, confidence: %.2f%n", merchantAddress, merchantPhoneNumberField.getConfidence()); @@ -271,7 +297,7 @@ public void beginRecognizeReceiptsFromUrl() { FormField transactionDateField = recognizedFields.get("TransactionDate"); if (transactionDateField != null) { - if (FieldValueType.DATE.equals(transactionDateField.getValueType())) { + if (FieldValueType.DATE == transactionDateField.getValueType()) { LocalDate transactionDate = FieldValueType.DATE.cast(transactionDateField); System.out.printf("Transaction Date: %s, confidence: %.2f%n", transactionDate, transactionDateField.getConfidence()); @@ -281,16 +307,16 @@ public void beginRecognizeReceiptsFromUrl() { FormField receiptItemsField = recognizedFields.get("Items"); if (receiptItemsField != null) { System.out.printf("Receipt Items: %n"); - if (FieldValueType.LIST.equals(receiptItemsField.getValueType())) { + if (FieldValueType.LIST == receiptItemsField.getValueType()) { List> receiptItems = FieldValueType.LIST.cast(receiptItemsField); receiptItems.forEach(receiptItem -> { - if (FieldValueType.MAP.equals(receiptItem.getValueType())) { + if (FieldValueType.MAP == receiptItem.getValueType()) { Map> formFieldMap = FieldValueType.MAP.cast(receiptItem); formFieldMap.forEach((key, formField) -> { if ("Quantity".equals(key)) { - if (FieldValueType.DOUBLE.equals(formField.getValueType())) { + if (FieldValueType.DOUBLE == formField.getValueType()) { Float quantity = FieldValueType.DOUBLE.cast(formField); - System.out.printf("Quantity: %d, confidence: %.2f%n", + System.out.printf("Quantity: %f, confidence: %.2f%n", quantity, formField.getConfidence()); } } @@ -314,7 +340,7 @@ public void beginRecognizeReceiptsFromUrlWithOptions() { Map> recognizedFields = recognizedReceipt.getFields(); FormField merchantNameField = recognizedFields.get("MerchantName"); if (merchantNameField != null) { - if (FieldValueType.STRING.equals(merchantNameField.getValueType())) { + if (FieldValueType.STRING == merchantNameField.getValueType()) { String merchantName = FieldValueType.STRING.cast(merchantNameField); System.out.printf("Merchant Name: %s, confidence: %.2f%n", merchantName, merchantNameField.getConfidence()); @@ -323,7 +349,7 @@ public void beginRecognizeReceiptsFromUrlWithOptions() { FormField merchantPhoneNumberField = recognizedFields.get("MerchantPhoneNumber"); if (merchantPhoneNumberField != null) { - if (FieldValueType.PHONE_NUMBER.equals(merchantNameField.getValueType())) { + if (FieldValueType.PHONE_NUMBER == merchantPhoneNumberField.getValueType()) { String merchantAddress = FieldValueType.PHONE_NUMBER.cast(merchantPhoneNumberField); System.out.printf("Merchant Phone number: %s, confidence: %.2f%n", merchantAddress, merchantPhoneNumberField.getConfidence()); @@ -332,7 +358,7 @@ public void beginRecognizeReceiptsFromUrlWithOptions() { FormField transactionDateField = recognizedFields.get("TransactionDate"); if (transactionDateField != null) { - if (FieldValueType.DATE.equals(transactionDateField.getValueType())) { + if (FieldValueType.DATE == transactionDateField.getValueType()) { LocalDate transactionDate = FieldValueType.DATE.cast(transactionDateField); System.out.printf("Transaction Date: %s, confidence: %.2f%n", transactionDate, transactionDateField.getConfidence()); @@ -342,22 +368,20 @@ public void beginRecognizeReceiptsFromUrlWithOptions() { FormField receiptItemsField = recognizedFields.get("Items"); if (receiptItemsField != null) { System.out.printf("Receipt Items: %n"); - if (FieldValueType.LIST.equals(receiptItemsField.getValueType())) { + if (FieldValueType.LIST == receiptItemsField.getValueType()) { List> receiptItems = FieldValueType.LIST.cast(receiptItemsField); - receiptItems.forEach(receiptItem -> { - if (FieldValueType.MAP.equals(receiptItem.getValueType())) { - Map> formFieldMap = FieldValueType.MAP.cast(receiptItem); - formFieldMap.forEach((key, formField) -> { - if ("Quantity".equals(key)) { - if (FieldValueType.DOUBLE.equals(formField.getValueType())) { - Float quantity = FieldValueType.DOUBLE.cast(formField); - System.out.printf("Quantity: %d, confidence: %.2f%n", - quantity, formField.getConfidence()); - } + receiptItems.stream() + .filter(receiptItem -> FieldValueType.MAP == receiptItem.getValueType()) + .>>map(FieldValueType.MAP::cast) + .forEach(formFieldMap -> formFieldMap.forEach((key, formField) -> { + if ("Quantity".equals(key)) { + if (FieldValueType.DOUBLE == formField.getValueType()) { + Float quantity = FieldValueType.DOUBLE.cast(formField); + System.out.printf("Quantity: %f, confidence: %.2f%n", + quantity, formField.getConfidence()); } - }); - } - }); + } + })); } } }); @@ -373,60 +397,59 @@ public void beginRecognizeReceipts() throws IOException { // BEGIN: com.azure.ai.formrecognizer.FormRecognizerClient.beginRecognizeReceipts#InputStream-long File receipt = new File("{receipt_url}"); byte[] fileContent = Files.readAllBytes(receipt.toPath()); - InputStream targetStream = new ByteArrayInputStream(fileContent); - - formRecognizerClient.beginRecognizeReceipts(targetStream, receipt.length()) - .getFinalResult().forEach(recognizedReceipt -> { - Map> recognizedFields = recognizedReceipt.getFields(); - FormField merchantNameField = recognizedFields.get("MerchantName"); - if (merchantNameField != null) { - if (FieldValueType.STRING.equals(merchantNameField.getValueType())) { - String merchantName = FieldValueType.STRING.cast(merchantNameField); - System.out.printf("Merchant Name: %s, confidence: %.2f%n", - merchantName, merchantNameField.getConfidence()); + try (InputStream targetStream = new ByteArrayInputStream(fileContent)) { + + formRecognizerClient.beginRecognizeReceipts(targetStream, receipt.length()).getFinalResult() + .forEach(recognizedReceipt -> { + Map> recognizedFields = recognizedReceipt.getFields(); + FormField merchantNameField = recognizedFields.get("MerchantName"); + if (merchantNameField != null) { + if (FieldValueType.STRING == merchantNameField.getValueType()) { + String merchantName = FieldValueType.STRING.cast(merchantNameField); + System.out.printf("Merchant Name: %s, confidence: %.2f%n", + merchantName, merchantNameField.getConfidence()); + } } - } - FormField merchantPhoneNumberField = recognizedFields.get("MerchantPhoneNumber"); - if (merchantPhoneNumberField != null) { - if (FieldValueType.PHONE_NUMBER.equals(merchantNameField.getValueType())) { - String merchantAddress = FieldValueType.PHONE_NUMBER.cast(merchantPhoneNumberField); - System.out.printf("Merchant Phone number: %s, confidence: %.2f%n", - merchantAddress, merchantPhoneNumberField.getConfidence()); + FormField merchantPhoneNumberField = recognizedFields.get("MerchantPhoneNumber"); + if (merchantPhoneNumberField != null) { + if (FieldValueType.PHONE_NUMBER == merchantPhoneNumberField.getValueType()) { + String merchantAddress = FieldValueType.PHONE_NUMBER.cast(merchantPhoneNumberField); + System.out.printf("Merchant Phone number: %s, confidence: %.2f%n", + merchantAddress, merchantPhoneNumberField.getConfidence()); + } } - } - FormField transactionDateField = recognizedFields.get("TransactionDate"); - if (transactionDateField != null) { - if (FieldValueType.DATE.equals(transactionDateField.getValueType())) { - LocalDate transactionDate = FieldValueType.DATE.cast(transactionDateField); - System.out.printf("Transaction Date: %s, confidence: %.2f%n", - transactionDate, transactionDateField.getConfidence()); + FormField transactionDateField = recognizedFields.get("TransactionDate"); + if (transactionDateField != null) { + if (FieldValueType.DATE == transactionDateField.getValueType()) { + LocalDate transactionDate = FieldValueType.DATE.cast(transactionDateField); + System.out.printf("Transaction Date: %s, confidence: %.2f%n", + transactionDate, transactionDateField.getConfidence()); + } } - } - FormField receiptItemsField = recognizedFields.get("Items"); - if (receiptItemsField != null) { - System.out.printf("Receipt Items: %n"); - if (FieldValueType.LIST.equals(receiptItemsField.getValueType())) { - List> receiptItems = FieldValueType.LIST.cast(receiptItemsField); - receiptItems.forEach(receiptItem -> { - if (FieldValueType.MAP.equals(receiptItem.getValueType())) { - Map> formFieldMap = FieldValueType.MAP.cast(receiptItem); - formFieldMap.forEach((key, formField) -> { + FormField receiptItemsField = recognizedFields.get("Items"); + if (receiptItemsField != null) { + System.out.printf("Receipt Items: %n"); + if (FieldValueType.LIST == receiptItemsField.getValueType()) { + List> receiptItems = FieldValueType.LIST.cast(receiptItemsField); + receiptItems.stream() + .filter(receiptItem -> FieldValueType.MAP == receiptItem.getValueType()) + .>>map(FieldValueType.MAP::cast) + .forEach(formFieldMap -> formFieldMap.forEach((key, formField) -> { if ("Quantity".equals(key)) { - if (FieldValueType.DOUBLE.equals(formField.getValueType())) { + if (FieldValueType.DOUBLE == formField.getValueType()) { Float quantity = FieldValueType.DOUBLE.cast(formField); - System.out.printf("Quantity: %d, confidence: %.2f%n", + System.out.printf("Quantity: %f, confidence: %.2f%n", quantity, formField.getConfidence()); } } - }); - } - }); + })); + } } - } - }); + }); + } // END: com.azure.ai.formrecognizer.FormRecognizerClient.beginRecognizeReceipts#InputStream-long } @@ -442,63 +465,59 @@ public void beginRecognizeReceiptsWithOptions() throws IOException { File receipt = new File("{local/file_path/fileName.jpg}"); boolean includeFieldElements = true; byte[] fileContent = Files.readAllBytes(receipt.toPath()); - InputStream targetStream = new ByteArrayInputStream(fileContent); - formRecognizerClient.beginRecognizeReceipts(targetStream, receipt.length(), - new RecognizeOptions() - .setContentType(FormContentType.IMAGE_JPEG) - .setIncludeFieldElements(includeFieldElements) - .setPollInterval(Duration.ofSeconds(5))) - .getFinalResult().forEach(recognizedReceipt -> { - Map> recognizedFields = recognizedReceipt.getFields(); + try (InputStream targetStream = new ByteArrayInputStream(fileContent)) { + for (RecognizedForm recognizedForm : formRecognizerClient.beginRecognizeReceipts(targetStream, receipt.length(), + new RecognizeOptions() + .setContentType(FormContentType.IMAGE_JPEG) + .setIncludeFieldElements(includeFieldElements) + .setPollInterval(Duration.ofSeconds(5))) + .getFinalResult()) { + Map> recognizedFields = recognizedForm.getFields(); FormField merchantNameField = recognizedFields.get("MerchantName"); if (merchantNameField != null) { - if (FieldValueType.STRING.equals(merchantNameField.getValueType())) { + if (FieldValueType.STRING == merchantNameField.getValueType()) { String merchantName = FieldValueType.STRING.cast(merchantNameField); System.out.printf("Merchant Name: %s, confidence: %.2f%n", merchantName, merchantNameField.getConfidence()); } } - FormField merchantPhoneNumberField = recognizedFields.get("MerchantPhoneNumber"); if (merchantPhoneNumberField != null) { - if (FieldValueType.PHONE_NUMBER.equals(merchantNameField.getValueType())) { + if (FieldValueType.PHONE_NUMBER == merchantPhoneNumberField.getValueType()) { String merchantAddress = FieldValueType.PHONE_NUMBER.cast(merchantPhoneNumberField); System.out.printf("Merchant Phone number: %s, confidence: %.2f%n", merchantAddress, merchantPhoneNumberField.getConfidence()); } } - FormField transactionDateField = recognizedFields.get("TransactionDate"); if (transactionDateField != null) { - if (FieldValueType.DATE.equals(transactionDateField.getValueType())) { + if (FieldValueType.DATE == transactionDateField.getValueType()) { LocalDate transactionDate = FieldValueType.DATE.cast(transactionDateField); System.out.printf("Transaction Date: %s, confidence: %.2f%n", transactionDate, transactionDateField.getConfidence()); } } - FormField receiptItemsField = recognizedFields.get("Items"); if (receiptItemsField != null) { System.out.printf("Receipt Items: %n"); - if (FieldValueType.LIST.equals(receiptItemsField.getValueType())) { + if (FieldValueType.LIST == receiptItemsField.getValueType()) { List> receiptItems = FieldValueType.LIST.cast(receiptItemsField); - receiptItems.forEach(receiptItem -> { - if (FieldValueType.MAP.equals(receiptItem.getValueType())) { - Map> formFieldMap = FieldValueType.MAP.cast(receiptItem); - formFieldMap.forEach((key, formField) -> { - if ("Quantity".equals(key)) { - if (FieldValueType.DOUBLE.equals(formField.getValueType())) { - Float quantity = FieldValueType.DOUBLE.cast(formField); - System.out.printf("Quantity: %d, confidence: %.2f%n", - quantity, formField.getConfidence()); - } + receiptItems.stream() + .filter(receiptItem -> FieldValueType.MAP == receiptItem.getValueType()) + .>>map(FieldValueType.MAP::cast) + .forEach(formFieldMap -> formFieldMap.forEach((key, formField) -> { + if ("Quantity".equals(key)) { + if (FieldValueType.DOUBLE == formField.getValueType()) { + Float quantity = FieldValueType.DOUBLE.cast(formField); + System.out.printf("Quantity: %f, confidence: %.2f%n", + quantity, formField.getConfidence()); } - }); - } - }); + } + })); } } - }); + } + } // END: com.azure.ai.formrecognizer.FormRecognizerClient.beginRecognizeReceipts#InputStream-long-recognizeOptions } } diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/src/samples/java/com/azure/ai/formrecognizer/FormTrainingAsyncClientJavaDocCodeSnippets.java b/sdk/formrecognizer/azure-ai-formrecognizer/src/samples/java/com/azure/ai/formrecognizer/FormTrainingAsyncClientJavaDocCodeSnippets.java index f9970f236f6c5..5cab6b343e4be 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/src/samples/java/com/azure/ai/formrecognizer/FormTrainingAsyncClientJavaDocCodeSnippets.java +++ b/sdk/formrecognizer/azure-ai-formrecognizer/src/samples/java/com/azure/ai/formrecognizer/FormTrainingAsyncClientJavaDocCodeSnippets.java @@ -12,6 +12,7 @@ import com.azure.core.credential.AzureKeyCredential; import com.azure.core.http.HttpPipeline; import com.azure.core.http.HttpPipelineBuilder; +import com.azure.core.util.polling.AsyncPollResponse; import java.time.Duration; @@ -54,17 +55,17 @@ public void beginTraining() { // BEGIN: com.azure.ai.formrecognizer.training.FormTrainingAsyncClient.beginTraining#string-boolean String trainingFilesUrl = "{SAS-URL-of-your-container-in-blob-storage}"; boolean useTrainingLabels = true; - formTrainingAsyncClient.beginTraining(trainingFilesUrl, useTrainingLabels).subscribe( - trainingPollingOperation -> { - // if training polling operation completed, retrieve the final result. - trainingPollingOperation.getFinalResult().subscribe(customFormModel -> { - System.out.printf("Model Id: %s%n", customFormModel.getModelId()); - System.out.printf("Model Status: %s%n", customFormModel.getModelStatus()); - customFormModel.getSubmodels().forEach(customFormSubmodel -> - customFormSubmodel.getFields().forEach((key, customFormModelField) -> - System.out.printf("Form type: %s Field Text: %s Field Accuracy: %s%n", + formTrainingAsyncClient.beginTraining(trainingFilesUrl, useTrainingLabels) + // if training polling operation completed, retrieve the final result. + .flatMap(AsyncPollResponse::getFinalResult) + .subscribe(customFormModel -> { + System.out.printf("Model Id: %s%n", customFormModel.getModelId()); + System.out.printf("Model Status: %s%n", customFormModel.getModelStatus()); + customFormModel.getSubmodels() + .forEach(customFormSubmodel -> customFormSubmodel.getFields() + .forEach((key, customFormModelField) -> + System.out.printf("Form type: %s Field Text: %s Field Accuracy: %f%n", key, customFormModelField.getName(), customFormModelField.getAccuracy()))); - }); }); // END: com.azure.ai.formrecognizer.training.FormTrainingAsyncClient.beginTraining#string-boolean } @@ -76,19 +77,19 @@ public void beginTraining() { public void beginTrainingWithOptions() { // BEGIN: com.azure.ai.formrecognizer.training.FormTrainingAsyncClient.beginTraining#string-boolean-trainingFileFilter-Duration String trainingFilesUrl = "{SAS-URL-of-your-container-in-blob-storage}"; - TrainingFileFilter trainingFileFilter = new TrainingFileFilter().setIncludeSubFolders(false).setPrefix("Invoice"); + TrainingFileFilter trainingFileFilter = new TrainingFileFilter().setIncludeSubFolders(true).setPrefix("Invoice"); formTrainingAsyncClient.beginTraining(trainingFilesUrl, true, trainingFileFilter, - Duration.ofSeconds(5)).subscribe(trainingPollingOperation -> { - // if training polling operation completed, retrieve the final result. - trainingPollingOperation.getFinalResult().subscribe(customFormModel -> { - System.out.printf("Model Id: %s%n", customFormModel.getModelId()); - System.out.printf("Model Status: %s%n", customFormModel.getModelStatus()); - customFormModel.getSubmodels().forEach(customFormSubmodel -> - customFormSubmodel.getFields().forEach((key, customFormModelField) -> - System.out.printf("Form Type: %s Field Text: %s Field Accuracy: %s%n", - key, customFormModelField.getName(), customFormModelField.getAccuracy()))); - }); + Duration.ofSeconds(5)) + // if training polling operation completed, retrieve the final result. + .flatMap(AsyncPollResponse::getFinalResult) + .subscribe(customFormModel -> { + System.out.printf("Model Id: %s%n", customFormModel.getModelId()); + System.out.printf("Model Status: %s%n", customFormModel.getModelStatus()); + customFormModel.getSubmodels().forEach(customFormSubmodel -> + customFormSubmodel.getFields().forEach((key, customFormModelField) -> + System.out.printf("Form Type: %s Field Text: %s Field Accuracy: %f%n", + key, customFormModelField.getName(), customFormModelField.getAccuracy()))); }); // END: com.azure.ai.formrecognizer.training.FormTrainingAsyncClient.beginTraining#string-boolean-trainingFileFilter-Duration } @@ -102,10 +103,11 @@ public void getCustomModel() { formTrainingAsyncClient.getCustomModel(modelId).subscribe(customFormModel -> { System.out.printf("Model Id: %s%n", customFormModel.getModelId()); System.out.printf("Model Status: %s%n", customFormModel.getModelStatus()); - customFormModel.getSubmodels().forEach(customFormSubmodel -> - customFormSubmodel.getFields().forEach((key, customFormModelField) -> - System.out.printf("Form Type: %s Field Text: %s Field Accuracy: %s%n", - key, customFormModelField.getName(), customFormModelField.getAccuracy()))); + customFormModel.getSubmodels() + .forEach(customFormSubmodel -> customFormSubmodel.getFields() + .forEach((key, customFormModelField) -> + System.out.printf("Form Type: %s Field Text: %s Field Accuracy: %f%n", + key, customFormModelField.getName(), customFormModelField.getAccuracy()))); }); // END: com.azure.ai.formrecognizer.training.FormTrainingAsyncClient.getCustomModel#string @@ -122,10 +124,11 @@ public void getCustomModelWithResponse() { CustomFormModel customFormModel = response.getValue(); System.out.printf("Model Id: %s%n", customFormModel.getModelId()); System.out.printf("Model Status: %s%n", customFormModel.getModelStatus()); - customFormModel.getSubmodels().forEach(customFormSubmodel -> - customFormSubmodel.getFields().forEach((key, customFormModelField) -> - System.out.printf("Form Type: %s Field Text: %s Field Accuracy: %f%n", - key, customFormModelField.getName(), customFormModelField.getAccuracy()))); + customFormModel.getSubmodels() + .forEach(customFormSubmodel -> customFormSubmodel.getFields() + .forEach((key, customFormModelField) -> + System.out.printf("Form Type: %s Field Text: %s Field Accuracy: %f%n", + key, customFormModelField.getName(), customFormModelField.getAccuracy()))); }); // END: com.azure.ai.formrecognizer.training.FormTrainingAsyncClient.getCustomModelWithResponse#string } @@ -135,11 +138,13 @@ public void getCustomModelWithResponse() { */ public void getAccountProperties() { // BEGIN: com.azure.ai.formrecognizer.training.FormTrainingAsyncClient.getAccountProperties - formTrainingAsyncClient.getAccountProperties().subscribe(accountProperties -> { - System.out.printf("Max number of models that can be trained for this account: %s%n", - accountProperties.getCustomModelLimit()); - System.out.printf("Current count of trained custom models: %d%n", accountProperties.getCustomModelCount()); - }); + formTrainingAsyncClient.getAccountProperties() + .subscribe(accountProperties -> { + System.out.printf("Max number of models that can be trained for this account: %d%n", + accountProperties.getCustomModelLimit()); + System.out.printf("Current count of trained custom models: %d%n", + accountProperties.getCustomModelCount()); + }); // END: com.azure.ai.formrecognizer.training.FormTrainingAsyncClient.getAccountProperties } @@ -148,13 +153,15 @@ public void getAccountProperties() { */ public void getAccountPropertiesWithResponse() { // BEGIN: com.azure.ai.formrecognizer.training.FormTrainingAsyncClient.getAccountPropertiesWithResponse - formTrainingAsyncClient.getAccountPropertiesWithResponse().subscribe(response -> { - System.out.printf("Response Status Code: %d.", response.getStatusCode()); - AccountProperties accountProperties = response.getValue(); - System.out.printf("Max number of models that can be trained for this account: %s%n", - accountProperties.getCustomModelLimit()); - System.out.printf("Current count of trained custom models: %d%n", accountProperties.getCustomModelCount()); - }); + formTrainingAsyncClient.getAccountPropertiesWithResponse() + .subscribe(response -> { + System.out.printf("Response Status Code: %d.", response.getStatusCode()); + AccountProperties accountProperties = response.getValue(); + System.out.printf("Max number of models that can be trained for this account: %d%n", + accountProperties.getCustomModelLimit()); + System.out.printf("Current count of trained custom models: %d%n", + accountProperties.getCustomModelCount()); + }); // END: com.azure.ai.formrecognizer.training.FormTrainingAsyncClient.getAccountPropertiesWithResponse } @@ -164,8 +171,8 @@ public void getAccountPropertiesWithResponse() { public void deleteModel() { // BEGIN: com.azure.ai.formrecognizer.training.FormTrainingAsyncClient.deleteModel#string String modelId = "{model_id}"; - formTrainingAsyncClient.deleteModel(modelId).subscribe(val -> - System.out.printf("Model Id: %s is deleted%n", modelId)); + formTrainingAsyncClient.deleteModel(modelId) + .subscribe(ignored -> System.out.printf("Model Id: %s is deleted%n", modelId)); // END: com.azure.ai.formrecognizer.training.FormTrainingAsyncClient.deleteModel#string } @@ -175,10 +182,11 @@ public void deleteModel() { public void deleteModelWithResponse() { // BEGIN: com.azure.ai.formrecognizer.training.FormTrainingAsyncClient.deleteModelWithResponse#string String modelId = "{model_id}"; - formTrainingAsyncClient.deleteModelWithResponse(modelId).subscribe(response -> { - System.out.printf("Response Status Code: %d.", response.getStatusCode()); - System.out.printf("Model Id: %s is deleted.%n", modelId); - }); + formTrainingAsyncClient.deleteModelWithResponse(modelId) + .subscribe(response -> { + System.out.printf("Response Status Code: %d.", response.getStatusCode()); + System.out.printf("Model Id: %s is deleted.%n", modelId); + }); // END: com.azure.ai.formrecognizer.training.FormTrainingAsyncClient.deleteModelWithResponse#string } @@ -187,12 +195,13 @@ public void deleteModelWithResponse() { */ public void listCustomModels() { // BEGIN: com.azure.ai.formrecognizer.training.FormTrainingAsyncClient.listCustomModels - formTrainingAsyncClient.listCustomModels().subscribe(customModel -> - System.out.printf("Model Id: %s, Model status: %s, Created on: %s, Last updated on: %s.%n", - customModel.getModelId(), - customModel.getStatus(), - customModel.getTrainingStartedOn(), - customModel.getTrainingCompletedOn())); + formTrainingAsyncClient.listCustomModels() + .subscribe(customModel -> + System.out.printf("Model Id: %s, Model status: %s, Created on: %s, Last updated on: %s.%n", + customModel.getModelId(), + customModel.getStatus(), + customModel.getTrainingStartedOn(), + customModel.getTrainingCompletedOn())); // END: com.azure.ai.formrecognizer.training.FormTrainingAsyncClient.listCustomModels } @@ -205,15 +214,15 @@ public void beginCopy() { String resourceRegion = "target-resource-region"; String copyModelId = "copy-model-Id"; formTrainingAsyncClient.getCopyAuthorization(resourceId, resourceRegion) - .subscribe(copyAuthorization -> formTrainingAsyncClient.beginCopyModel(copyModelId, copyAuthorization) - .subscribe(copyPoller -> copyPoller.getFinalResult().subscribe(customFormModelInfo -> { - System.out.printf("Copied model has model Id: %s, model status: %s, training started on: %s," - + " training completed on: %s.%n", - customFormModelInfo.getModelId(), - customFormModelInfo.getStatus(), - customFormModelInfo.getTrainingStartedOn(), - customFormModelInfo.getTrainingCompletedOn()); - }))); + .flatMapMany(copyAuthorization -> formTrainingAsyncClient.beginCopyModel(copyModelId, copyAuthorization)) + .flatMap(AsyncPollResponse::getFinalResult) + .subscribe(customFormModelInfo -> + System.out.printf("Copied model has model Id: %s, model status: %s, training started on: %s," + + " training completed on: %s.%n", + customFormModelInfo.getModelId(), + customFormModelInfo.getStatus(), + customFormModelInfo.getTrainingStartedOn(), + customFormModelInfo.getTrainingCompletedOn())); // END: com.azure.ai.formrecognizer.training.FormTrainingAsyncClient.beginCopyModel#string-copyAuthorization } @@ -226,16 +235,16 @@ public void beginCopyOverload() { String resourceRegion = "target-resource-region"; String copyModelId = "copy-model-Id"; formTrainingAsyncClient.getCopyAuthorization(resourceId, resourceRegion) - .subscribe(copyAuthorization -> formTrainingAsyncClient.beginCopyModel(copyModelId, copyAuthorization, - Duration.ofSeconds(5)).subscribe(copyPoller -> - copyPoller.getFinalResult().subscribe(customFormModelInfo -> { + .flatMapMany(copyAuthorization -> formTrainingAsyncClient.beginCopyModel(copyModelId, copyAuthorization, + Duration.ofSeconds(5))) + .flatMap(AsyncPollResponse::getFinalResult) + .subscribe(customFormModelInfo -> System.out.printf("Copied model has model Id: %s, model status: %s, training started on: %s," - + "training completed on: %s.%n", - customFormModelInfo.getModelId(), - customFormModelInfo.getStatus(), - customFormModelInfo.getTrainingStartedOn(), - customFormModelInfo.getTrainingCompletedOn()); - }))); + + "training completed on: %s.%n", + customFormModelInfo.getModelId(), + customFormModelInfo.getStatus(), + customFormModelInfo.getTrainingStartedOn(), + customFormModelInfo.getTrainingCompletedOn())); // END: com.azure.ai.formrecognizer.training.FormTrainingAsyncClient.beginCopyModel#string-copyAuthorization-Duration } diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/src/samples/java/com/azure/ai/formrecognizer/FormTrainingClientJavaDocCodeSnippets.java b/sdk/formrecognizer/azure-ai-formrecognizer/src/samples/java/com/azure/ai/formrecognizer/FormTrainingClientJavaDocCodeSnippets.java index 9a0ed89563c27..2137a636f1b89 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/src/samples/java/com/azure/ai/formrecognizer/FormTrainingClientJavaDocCodeSnippets.java +++ b/sdk/formrecognizer/azure-ai-formrecognizer/src/samples/java/com/azure/ai/formrecognizer/FormTrainingClientJavaDocCodeSnippets.java @@ -41,10 +41,11 @@ public void beginTraining() { formTrainingClient.beginTraining(trainingFilesUrl, useTrainingLabels).getFinalResult(); System.out.printf("Model Id: %s%n", customFormModel.getModelId()); System.out.printf("Model Status: %s%n", customFormModel.getModelStatus()); - customFormModel.getSubmodels().forEach(customFormSubmodel -> - customFormSubmodel.getFields().forEach((key, customFormModelField) -> - System.out.printf("Form Type: %s Field Text: %s Field Accuracy: %f%n", - key, customFormModelField.getName(), customFormModelField.getAccuracy()))); + customFormModel.getSubmodels() + .forEach(customFormSubmodel -> customFormSubmodel.getFields() + .forEach((key, customFormModelField) -> + System.out.printf("Form Type: %s Field Text: %s Field Accuracy: %f%n", + key, customFormModelField.getName(), customFormModelField.getAccuracy()))); // END: com.azure.ai.formrecognizer.training.FormTrainingClient.beginTraining#string-boolean } @@ -63,10 +64,11 @@ public void beginTrainingWithOptions() { System.out.printf("Model Id: %s%n", customFormModel.getModelId()); System.out.printf("Model Status: %s%n", customFormModel.getModelStatus()); - customFormModel.getSubmodels().forEach(customFormSubmodel -> - customFormSubmodel.getFields().forEach((key, customFormModelField) -> - System.out.printf("Form Type: %s Field Text: %s Field Accuracy: %f%n", - key, customFormModelField.getName(), customFormModelField.getAccuracy()))); + customFormModel.getSubmodels() + .forEach(customFormSubmodel -> customFormSubmodel.getFields() + .forEach((key, customFormModelField) -> + System.out.printf("Form Type: %s Field Text: %s Field Accuracy: %f%n", + key, customFormModelField.getName(), customFormModelField.getAccuracy()))); // END: com.azure.ai.formrecognizer.training.FormTrainingClient.beginTraining#string-boolean-trainingFileFilter-Duration } @@ -79,10 +81,11 @@ public void getCustomModel() { CustomFormModel customFormModel = formTrainingClient.getCustomModel(modelId); System.out.printf("Model Id: %s%n", customFormModel.getModelId()); System.out.printf("Model Status: %s%n", customFormModel.getModelStatus()); - customFormModel.getSubmodels().forEach(customFormSubmodel -> - customFormSubmodel.getFields().forEach((key, customFormModelField) -> - System.out.printf("Form Type: %s Field Text: %s Field Accuracy: %f%n", - key, customFormModelField.getName(), customFormModelField.getAccuracy()))); + customFormModel.getSubmodels() + .forEach(customFormSubmodel -> customFormSubmodel.getFields() + .forEach((key, customFormModelField) -> + System.out.printf("Form Type: %s Field Text: %s Field Accuracy: %f%n", + key, customFormModelField.getName(), customFormModelField.getAccuracy()))); // END: com.azure.ai.formrecognizer.training.FormTrainingClient.getCustomModel#string } @@ -97,10 +100,11 @@ public void getCustomModelWithResponse() { CustomFormModel customFormModel = response.getValue(); System.out.printf("Model Id: %s%n", customFormModel.getModelId()); System.out.printf("Model Status: %s%n", customFormModel.getModelStatus()); - customFormModel.getSubmodels().forEach(customFormSubmodel -> - customFormSubmodel.getFields().forEach((key, customFormModelField) -> - System.out.printf("Field: %s Field Text: %s Field Accuracy: %f%n", - key, customFormModelField.getName(), customFormModelField.getAccuracy()))); + customFormModel.getSubmodels() + .forEach(customFormSubmodel -> customFormSubmodel.getFields() + .forEach((key, customFormModelField) -> + System.out.printf("Field: %s Field Text: %s Field Accuracy: %f%n", + key, customFormModelField.getName(), customFormModelField.getAccuracy()))); // END: com.azure.ai.formrecognizer.training.FormTrainingClient.getCustomModelWithResponse#string-Context } @@ -110,7 +114,7 @@ public void getCustomModelWithResponse() { public void getAccountProperties() { // BEGIN: com.azure.ai.formrecognizer.training.FormTrainingClient.getAccountProperties AccountProperties accountProperties = formTrainingClient.getAccountProperties(); - System.out.printf("Max number of models that can be trained for this account: %s%n", + System.out.printf("Max number of models that can be trained for this account: %d%n", accountProperties.getCustomModelLimit()); System.out.printf("Current count of trained custom models: %d%n", accountProperties.getCustomModelCount()); // END: com.azure.ai.formrecognizer.training.FormTrainingClient.getAccountProperties @@ -158,13 +162,14 @@ public void deleteModelWithResponse() { */ public void listCustomModels() { // BEGIN: com.azure.ai.formrecognizer.training.FormTrainingClient.listCustomModels - formTrainingClient.listCustomModels().forEach(customModel -> - System.out.printf("Model Id: %s, Model status: %s, Training started on: %s, Training completed on: %s.%n", - customModel.getModelId(), - customModel.getStatus(), - customModel.getTrainingStartedOn(), - customModel.getTrainingCompletedOn()) - ); + formTrainingClient.listCustomModels() + .forEach(customModel -> + System.out.printf("Model Id: %s, Model status: %s, Training started on: %s, Training completed on: %s.%n", + customModel.getModelId(), + customModel.getStatus(), + customModel.getTrainingStartedOn(), + customModel.getTrainingCompletedOn()) + ); // END: com.azure.ai.formrecognizer.training.FormTrainingClient.listCustomModels } @@ -173,13 +178,14 @@ public void listCustomModels() { */ public void listCustomModelsWithContext() { // BEGIN: com.azure.ai.formrecognizer.training.FormTrainingClient.listCustomModels#Context - formTrainingClient.listCustomModels(Context.NONE).forEach(customModel -> - System.out.printf("Model Id: %s, Model status: %s, Training started on: %s, Training completed on: %s.%n", - customModel.getModelId(), - customModel.getStatus(), - customModel.getTrainingStartedOn(), - customModel.getTrainingCompletedOn()) - ); + formTrainingClient.listCustomModels(Context.NONE) + .forEach(customModel -> + System.out.printf("Model Id: %s, Model status: %s, Training started on: %s, Training completed on: %s.%n", + customModel.getModelId(), + customModel.getStatus(), + customModel.getTrainingStartedOn(), + customModel.getTrainingCompletedOn()) + ); // END: com.azure.ai.formrecognizer.training.FormTrainingClient.listCustomModels#Context } diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/src/samples/java/com/azure/ai/formrecognizer/GetBoundingBoxes.java b/sdk/formrecognizer/azure-ai-formrecognizer/src/samples/java/com/azure/ai/formrecognizer/GetBoundingBoxes.java index f6f72e2d9c951..b4f881cd7aabc 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/src/samples/java/com/azure/ai/formrecognizer/GetBoundingBoxes.java +++ b/sdk/formrecognizer/azure-ai-formrecognizer/src/samples/java/com/azure/ai/formrecognizer/GetBoundingBoxes.java @@ -40,10 +40,9 @@ public static void main(String[] args) { List recognizedForms = recognizeFormPoller.getFinalResult(); - System.out.println("--------RECOGNIZING FORM --------"); for (int i = 0; i < recognizedForms.size(); i++) { final RecognizedForm recognizedForm = recognizedForms.get(i); - System.out.printf("Form %s has type: %s%n", i, recognizedForm.getFormType()); + System.out.printf("Form %d has type: %s%n", i, recognizedForm.getFormType()); // each field is of type FormField // The value of the field can also be a FormField, or a list of FormFields // In our sample, it is not. @@ -57,8 +56,8 @@ public static void main(String[] args) { final List pages = recognizedForm.getPages(); for (int i1 = 0; i1 < pages.size(); i1++) { final FormPage formPage = pages.get(i1); - System.out.printf("-------Recognizing Page %s of Form -------%n", i1); - System.out.printf("Has width %f , angle %.2f, height %f %n", formPage.getWidth(), + System.out.printf("-------Recognizing info on page %s of Form -------%n", i1); + System.out.printf("Has width: %f, angle: %.2f, height: %f %n", formPage.getWidth(), formPage.getTextAngle(), formPage.getHeight()); // Table information System.out.println("Recognized Tables: "); @@ -66,27 +65,27 @@ public static void main(String[] args) { for (int i2 = 0; i2 < tables.size(); i2++) { final FormTable formTable = tables.get(i2); System.out.printf("Table %d%n", i2); - formTable.getCells().forEach(formTableCell -> { - System.out.printf("Cell text %s has following words: %n", formTableCell.getText()); - // textContent only exists if you set includeFieldElements to True in your - // call to beginRecognizeCustomFormsFromUrl - // It is also a list of FormWords and FormLines, but in this example, we only deal with - // FormWords - formTableCell.getFieldElements().forEach(formContent -> { - if (formContent instanceof FormWord) { - FormWord formWordElement = (FormWord) (formContent); - StringBuilder boundingBoxStr = new StringBuilder(); - if (formWordElement.getBoundingBox() != null) { - formWordElement.getBoundingBox().getPoints().forEach(point -> { - boundingBoxStr.append(String.format("[%.2f, %.2f]", point.getX(), - point.getY())); - }); - } - System.out.printf("Word '%s' within bounding box %s with a confidence of %.2f.%n", - formWordElement.getText(), boundingBoxStr, formWordElement.getConfidence()); - } + formTable.getCells() + .forEach(formTableCell -> { + System.out.printf("Cell text %s has following words: %n", formTableCell.getText()); + // FormElements only exists if you set includeFieldElements to true in your + // call to beginRecognizeCustomFormsFromUrl + // It is also a list of FormWords and FormLines, but in this example, we only deal with + // FormWords + formTableCell.getFieldElements().stream() + .filter(formContent -> formContent instanceof FormWord) + .map(formContent -> (FormWord) (formContent)) + .forEach(formWordElement -> { + StringBuilder boundingBoxStr = new StringBuilder(); + if (formWordElement.getBoundingBox() != null) { + formWordElement.getBoundingBox().getPoints() + .forEach(point -> boundingBoxStr.append( + String.format("[%.2f, %.2f]", point.getX(), point.getY()))); + } + System.out.printf("Word '%s' within bounding box %s with a confidence of %.2f.%n", + formWordElement.getText(), boundingBoxStr.toString(), formWordElement.getConfidence()); + }); }); - }); System.out.println(); } } diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/src/samples/java/com/azure/ai/formrecognizer/GetBoundingBoxesAsync.java b/sdk/formrecognizer/azure-ai-formrecognizer/src/samples/java/com/azure/ai/formrecognizer/GetBoundingBoxesAsync.java index ebfad4bdc35f7..7482ea6f98a63 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/src/samples/java/com/azure/ai/formrecognizer/GetBoundingBoxesAsync.java +++ b/sdk/formrecognizer/azure-ai-formrecognizer/src/samples/java/com/azure/ai/formrecognizer/GetBoundingBoxesAsync.java @@ -37,42 +37,40 @@ public static void main(String[] args) { String modelId = "{model_Id}"; String formUrl = "{form_url}"; PollerFlux> recognizeFormPoller = - client.beginRecognizeCustomFormsFromUrl(formUrl, modelId, new RecognizeOptions() - .setIncludeFieldElements(true)); + client.beginRecognizeCustomFormsFromUrl(formUrl, modelId, + new RecognizeOptions() + .setIncludeFieldElements(true)); Mono> recognizeFormResult = recognizeFormPoller .last() - .flatMap(trainingOperationResponse -> { - if (trainingOperationResponse.getStatus().isComplete()) { + .flatMap(pollResponse -> { + if (pollResponse.getStatus().isComplete()) { // training completed successfully, retrieving final result. - return trainingOperationResponse.getFinalResult(); + return pollResponse.getFinalResult(); } else { return Mono.error(new RuntimeException("Polling completed unsuccessfully with status:" - + trainingOperationResponse.getStatus())); + + pollResponse.getStatus())); } }); - System.out.println("--------RECOGNIZING FORM --------"); recognizeFormResult.subscribe(recognizedForms -> { for (int i = 0; i < recognizedForms.size(); i++) { final RecognizedForm recognizedForm = recognizedForms.get(i); - System.out.printf("Form %s has type: %s%n", i, recognizedForm.getFormType()); + System.out.printf("Form %d has type: %s%n", i, recognizedForm.getFormType()); // each field is of type FormField - // The value of the field can also be a FormField, or a list of FormFields - // In our sample, it is not. - recognizedForm.getFields().forEach((fieldText, fieldValue) -> { + // The value of the field can also be a FormField, or a list of FormFields + // In our sample, it is not. + recognizedForm.getFields().forEach((fieldText, fieldValue) -> System.out.printf("Field %s has value %s based on %s with a confidence score " - + "of %.2f.%n", - fieldText, fieldValue.getValue(), fieldValue.getValueData().getText(), - fieldValue.getConfidence()); - }); + + "of %.2f.%n", fieldText, fieldValue.getValue(), fieldValue.getValueData().getText(), + fieldValue.getConfidence())); // Page Information final List pages = recognizedForm.getPages(); for (int i1 = 0; i1 < pages.size(); i1++) { final FormPage formPage = pages.get(i1); - System.out.printf("-------Recognizing Page %s of Form -------%n", i1); - System.out.printf("Has width %f , angle %f, height %f %n", formPage.getWidth(), + System.out.printf("-------Recognizing info on page %s of Form -------%n", i1); + System.out.printf("Has width: %f , angle: %f, height: %f %n", formPage.getWidth(), formPage.getTextAngle(), formPage.getHeight()); // Table information System.out.println("Recognized Tables: "); @@ -82,25 +80,24 @@ public static void main(String[] args) { System.out.printf("Table %d%n", i2); formTable.getCells().forEach(formTableCell -> { System.out.printf("Cell text %s has following words: %n", formTableCell.getText()); - // textContent only exists if you set includeFieldElements to True in your + // FormElements only exists if you set includeFieldElements to true in your // call to beginRecognizeCustomFormsFromUrl // It is also a list of FormWords and FormLines, but in this example, we only deal with // FormWords - formTableCell.getFieldElements().forEach(formContent -> { - if (formContent instanceof FormWord) { - FormWord formWordElement = (FormWord) (formContent); + formTableCell.getFieldElements().stream() + .filter(formContent -> formContent instanceof FormWord) + .map(formContent -> (FormWord) (formContent)) + .forEach(formWordElement -> { final StringBuilder boundingBoxStr = new StringBuilder(); if (formWordElement.getBoundingBox() != null) { - formWordElement.getBoundingBox().getPoints().forEach(point -> { + formWordElement.getBoundingBox().getPoints().forEach(point -> boundingBoxStr.append(String.format("[%.2f, %.2f]", point.getX(), - point.getY())); - }); + point.getY()))); } System.out.printf("Word '%s' within bounding box %s with a confidence of %.2f.%n", formWordElement.getText(), boundingBoxStr, formWordElement.getConfidence()); - } - }); + }); }); System.out.println(); } diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/src/samples/java/com/azure/ai/formrecognizer/ManageCustomModels.java b/sdk/formrecognizer/azure-ai-formrecognizer/src/samples/java/com/azure/ai/formrecognizer/ManageCustomModels.java index 70495fb9df390..943ff59089652 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/src/samples/java/com/azure/ai/formrecognizer/ManageCustomModels.java +++ b/sdk/formrecognizer/azure-ai-formrecognizer/src/samples/java/com/azure/ai/formrecognizer/ManageCustomModels.java @@ -60,12 +60,11 @@ public static void main(final String[] args) { System.out.printf("Field Accuracy: %.2f%n", customFormModelField.getAccuracy()); }); } - }); }); // Delete Custom Model - System.out.printf("Deleted model with model Id: %s operation completed with status: %s%n", modelId.get(), + System.out.printf("Deleted model with model Id: %s, operation completed with status: %s%n", modelId.get(), client.deleteModelWithResponse(modelId.get(), Context.NONE).getStatusCode()); } } diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/src/samples/java/com/azure/ai/formrecognizer/ManageCustomModelsAsync.java b/sdk/formrecognizer/azure-ai-formrecognizer/src/samples/java/com/azure/ai/formrecognizer/ManageCustomModelsAsync.java index 12dc7aa5a7539..786578e6813eb 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/src/samples/java/com/azure/ai/formrecognizer/ManageCustomModelsAsync.java +++ b/sdk/formrecognizer/azure-ai-formrecognizer/src/samples/java/com/azure/ai/formrecognizer/ManageCustomModelsAsync.java @@ -55,13 +55,13 @@ public static void main(final String[] args) { System.out.printf("Field Accuracy: %.2f%n", customFormModelField.getAccuracy()); }); } - }); }); }); // Delete Custom Model - System.out.printf("Deleted model with model Id: %s%n", modelId.get(), client.deleteModelWithResponse(modelId.get())); + client.deleteModel(modelId.get()); + System.out.printf("Deleted model with model Id: %s%n", modelId.get()); // The .subscribe() creation and assignment is not a blocking call. For the purpose of this example, we sleep // the thread so the program does not end before the send operation is complete. Using .block() instead of diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/src/samples/java/com/azure/ai/formrecognizer/ReadmeSamples.java b/sdk/formrecognizer/azure-ai-formrecognizer/src/samples/java/com/azure/ai/formrecognizer/ReadmeSamples.java index e1851afe0cd48..c4ec2ee6b2da8 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/src/samples/java/com/azure/ai/formrecognizer/ReadmeSamples.java +++ b/sdk/formrecognizer/azure-ai-formrecognizer/src/samples/java/com/azure/ai/formrecognizer/ReadmeSamples.java @@ -28,7 +28,6 @@ import java.time.LocalDate; import java.util.List; import java.util.Map; -import java.util.concurrent.atomic.AtomicReference; /** * WARNING: MODIFYING THIS FILE WILL REQUIRE CORRESPONDING UPDATES TO README.md FILE. LINE NUMBERS ARE USED TO EXTRACT @@ -95,7 +94,7 @@ public void recognizeCustomForm() { for (int i = 0; i < recognizedForms.size(); i++) { RecognizedForm form = recognizedForms.get(i); - System.out.printf("----------- Recognized Form %d -----------%n", i); + System.out.printf("----------- Recognized custom form info for page %d -----------%n", i); System.out.printf("Form type: %s%n", form.getFormType()); form.getFields().forEach((label, formField) -> System.out.printf("Field %s has value %s with confidence score of %f.%n", label, @@ -123,7 +122,7 @@ public void recognizeContent() throws IOException { for (int i = 0; i < contentPageResults.size(); i++) { FormPage formPage = contentPageResults.get(i); - System.out.printf("----Recognizing content for page %d ----%n", i); + System.out.printf("----Recognizing content info for page %d ----%n", i); // Table information System.out.printf("Has width: %f and height: %f, measured with unit: %s.%n", formPage.getWidth(), formPage.getHeight(), @@ -147,10 +146,10 @@ public void recognizeReceipt() { for (int i = 0; i < receiptPageResults.size(); i++) { RecognizedForm recognizedForm = receiptPageResults.get(i); Map> recognizedFields = recognizedForm.getFields(); - System.out.printf("----------- Recognized Receipt page %d -----------%n", i); + System.out.printf("----------- Recognizing receipt info for page %d -----------%n", i); FormField merchantNameField = recognizedFields.get("MerchantName"); if (merchantNameField != null) { - if (FieldValueType.STRING.equals(merchantNameField.getValueType())) { + if (FieldValueType.STRING == merchantNameField.getValueType()) { String merchantName = FieldValueType.STRING.cast(merchantNameField); System.out.printf("Merchant Name: %s, confidence: %.2f%n", merchantName, merchantNameField.getConfidence()); @@ -159,7 +158,7 @@ public void recognizeReceipt() { FormField merchantPhoneNumberField = recognizedFields.get("MerchantPhoneNumber"); if (merchantPhoneNumberField != null) { - if (FieldValueType.PHONE_NUMBER.equals(merchantNameField.getValueType())) { + if (FieldValueType.PHONE_NUMBER == merchantPhoneNumberField.getValueType()) { String merchantAddress = FieldValueType.PHONE_NUMBER.cast(merchantPhoneNumberField); System.out.printf("Merchant Phone number: %s, confidence: %.2f%n", merchantAddress, merchantPhoneNumberField.getConfidence()); @@ -168,7 +167,7 @@ public void recognizeReceipt() { FormField transactionDateField = recognizedFields.get("TransactionDate"); if (transactionDateField != null) { - if (FieldValueType.DATE.equals(transactionDateField.getValueType())) { + if (FieldValueType.DATE == transactionDateField.getValueType()) { LocalDate transactionDate = FieldValueType.DATE.cast(transactionDateField); System.out.printf("Transaction Date: %s, confidence: %.2f%n", transactionDate, transactionDateField.getConfidence()); @@ -178,14 +177,14 @@ public void recognizeReceipt() { FormField receiptItemsField = recognizedFields.get("Items"); if (receiptItemsField != null) { System.out.printf("Receipt Items: %n"); - if (FieldValueType.LIST.equals(receiptItemsField.getValueType())) { + if (FieldValueType.LIST == receiptItemsField.getValueType()) { List> receiptItems = FieldValueType.LIST.cast(receiptItemsField); receiptItems.forEach(receiptItem -> { - if (FieldValueType.MAP.equals(receiptItem.getValueType())) { + if (FieldValueType.MAP == receiptItem.getValueType()) { Map> formFieldMap = FieldValueType.MAP.cast(receiptItem); formFieldMap.forEach((key, formField) -> { if ("Quantity".equals(key)) { - if (FieldValueType.DOUBLE.equals(formField.getValueType())) { + if (FieldValueType.DOUBLE == formField.getValueType()) { Float quantity = FieldValueType.DOUBLE.cast(formField); System.out.printf("Quantity: %f, confidence: %.2f%n", quantity, formField.getConfidence()); @@ -200,7 +199,7 @@ public void recognizeReceipt() { } public void trainModel() { - String trainingFilesUrl = "{SAS-URL-of-your-container-in-blob-storage}"; + String trainingFilesUrl = "{SAS_URL_of_your_container_in_blob_storage}"; SyncPoller trainingPoller = formTrainingClient.beginTraining(trainingFilesUrl, false); @@ -213,7 +212,7 @@ public void trainModel() { System.out.printf("Training completed on: %s%n%n", customFormModel.getTrainingCompletedOn()); System.out.println("Recognized Fields:"); - // looping through the sub-models, which contains the fields they were trained on + // looping through the subModels, which contains the fields they were trained on // Since the given training documents are unlabeled, we still group them but they do not have a label. customFormModel.getSubmodels().forEach(customFormSubmodel -> { // Since the training data is unlabeled, we are unable to return the accuracy of this model @@ -224,7 +223,6 @@ public void trainModel() { } public void manageModels() { - AtomicReference modelId = new AtomicReference<>(); // First, we see how many custom models we have, and what our limit is AccountProperties accountProperties = formTrainingClient.getAccountProperties(); System.out.printf("The account has %d custom models, and we can have at most %d custom models", @@ -235,8 +233,7 @@ public void manageModels() { System.out.println("We have following models in the account:"); customModels.forEach(customFormModelInfo -> { System.out.printf("Model Id: %s%n", customFormModelInfo.getModelId()); - // get custom model info - modelId.set(customFormModelInfo.getModelId()); + // get specific custom model info CustomFormModel customModel = formTrainingClient.getCustomModel(customFormModelInfo.getModelId()); System.out.printf("Model Status: %s%n", customModel.getModelStatus()); System.out.printf("Training started on: %s%n", customModel.getTrainingStartedOn()); @@ -252,8 +249,9 @@ public void manageModels() { } }); }); + // Delete Custom Model - formTrainingClient.deleteModel(modelId.get()); + formTrainingClient.deleteModel("{modelId}"); } /** diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/src/samples/java/com/azure/ai/formrecognizer/RecognizeContent.java b/sdk/formrecognizer/azure-ai-formrecognizer/src/samples/java/com/azure/ai/formrecognizer/RecognizeContent.java index 2aced3ff91fea..22fa42953b646 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/src/samples/java/com/azure/ai/formrecognizer/RecognizeContent.java +++ b/sdk/formrecognizer/azure-ai-formrecognizer/src/samples/java/com/azure/ai/formrecognizer/RecognizeContent.java @@ -30,7 +30,6 @@ public class RecognizeContent { */ public static void main(final String[] args) throws IOException { // Instantiate a client that will be used to call the service. - FormRecognizerClient client = new FormRecognizerClientBuilder() .credential(new AzureKeyCredential("{key}")) .endpoint("https://{endpoint}.cognitiveservices.azure.com/") @@ -48,9 +47,9 @@ public static void main(final String[] args) throws IOException { for (int i = 0; i < contentPageResults.size(); i++) { final FormPage formPage = contentPageResults.get(i); - System.out.printf("----Recognizing content for page %d ----%n", i); + System.out.printf("---- Recognized content info for page %d ----%n", i); // Table information - System.out.printf("Has width: %f and height: %f, measured with unit: %s%n", formPage.getWidth(), + System.out.printf("Has width: %.2f and height: %.2f, measured with unit: %s%n", formPage.getWidth(), formPage.getHeight(), formPage.getUnit()); final List tables = formPage.getTables(); @@ -64,7 +63,7 @@ public static void main(final String[] args) throws IOException { formTableCell.getBoundingBox().getPoints().forEach(point -> boundingBoxStr.append(String.format("[%.2f, %.2f]", point.getX(), point.getY()))); } - System.out.printf("Cell has text %s, within bounding box %s.%n", formTableCell.getText(), + System.out.printf("Cell has text '%s', within bounding box %s.%n", formTableCell.getText(), boundingBoxStr); }); System.out.println(); diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/src/samples/java/com/azure/ai/formrecognizer/RecognizeContentAsync.java b/sdk/formrecognizer/azure-ai-formrecognizer/src/samples/java/com/azure/ai/formrecognizer/RecognizeContentFromUrlAsync.java similarity index 87% rename from sdk/formrecognizer/azure-ai-formrecognizer/src/samples/java/com/azure/ai/formrecognizer/RecognizeContentAsync.java rename to sdk/formrecognizer/azure-ai-formrecognizer/src/samples/java/com/azure/ai/formrecognizer/RecognizeContentFromUrlAsync.java index 83db8fa0dc75e..63d1d82c01b20 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/src/samples/java/com/azure/ai/formrecognizer/RecognizeContentAsync.java +++ b/sdk/formrecognizer/azure-ai-formrecognizer/src/samples/java/com/azure/ai/formrecognizer/RecognizeContentFromUrlAsync.java @@ -16,7 +16,7 @@ /** * Async sample for recognizing content information from a document given through a URL. */ -public class RecognizeContentAsync { +public class RecognizeContentFromUrlAsync { /** * Main method to invoke this demo. @@ -36,20 +36,20 @@ public static void main(final String[] args) { Mono> contentPageResults = recognizeContentPoller .last() - .flatMap(trainingOperationResponse -> { - if (trainingOperationResponse.getStatus().isComplete()) { + .flatMap(pollResponse -> { + if (pollResponse.getStatus().isComplete()) { // training completed successfully, retrieving final result. - return trainingOperationResponse.getFinalResult(); + return pollResponse.getFinalResult(); } else { return Mono.error(new RuntimeException("Polling completed unsuccessfully with status:" - + trainingOperationResponse.getStatus())); + + pollResponse.getStatus())); } }); contentPageResults.subscribe(formPages -> { for (int i = 0; i < formPages.size(); i++) { final FormPage formPage = formPages.get(i); - System.out.printf("----Recognizing content for page %d ----%n", i); + System.out.printf("---- Recognized content info for page %d ----%n", i); System.out.printf("Has width: %f and height: %f, measured with unit: %s%n", formPage.getWidth(), formPage.getHeight(), formPage.getUnit()); @@ -65,7 +65,7 @@ public static void main(final String[] args) { formTableCell.getBoundingBox().getPoints().forEach(point -> boundingBoxStr.append(String.format("[%.2f, %.2f]", point.getX(), point.getY()))); } - System.out.printf("Cell has text %s, within bounding box %s.%n", formTableCell.getText(), + System.out.printf("Cell has text '%s', within bounding box %s.%n", formTableCell.getText(), boundingBoxStr); }); System.out.println(); diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/src/samples/java/com/azure/ai/formrecognizer/RecognizeCustomFormsAsync.java b/sdk/formrecognizer/azure-ai-formrecognizer/src/samples/java/com/azure/ai/formrecognizer/RecognizeCustomFormsAsync.java index a2391e3763f0f..81fd527f23896 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/src/samples/java/com/azure/ai/formrecognizer/RecognizeCustomFormsAsync.java +++ b/sdk/formrecognizer/azure-ai-formrecognizer/src/samples/java/com/azure/ai/formrecognizer/RecognizeCustomFormsAsync.java @@ -43,35 +43,35 @@ public static void main(String[] args) throws IOException { File sourceFile = new File("../formrecognizer/azure-ai-formrecognizer/src/samples/java/sample-forms/" + "forms/Invoice_6.pdf"); byte[] fileContent = Files.readAllBytes(sourceFile.toPath()); - InputStream targetStream = new ByteArrayInputStream(fileContent); String modelId = "{modelId}"; - - PollerFlux> recognizeFormPoller = - client.beginRecognizeCustomForms(toFluxByteBuffer(targetStream), sourceFile.length(), modelId); + PollerFlux> recognizeFormPoller; + try (InputStream targetStream = new ByteArrayInputStream(fileContent)) { + recognizeFormPoller = client.beginRecognizeCustomForms(toFluxByteBuffer(targetStream), sourceFile.length(), + modelId); + } Mono> recognizeFormResult = recognizeFormPoller .last() - .flatMap(recognizeFormPollOperation -> { - if (recognizeFormPollOperation.getStatus().isComplete()) { + .flatMap(pollResponse -> { + if (pollResponse.getStatus().isComplete()) { // training completed successfully, retrieving final result. - return recognizeFormPollOperation.getFinalResult(); + return pollResponse.getFinalResult(); } else { return Mono.error(new RuntimeException("Polling completed unsuccessfully with status:" - + recognizeFormPollOperation.getStatus())); + + pollResponse.getStatus())); } }); recognizeFormResult.subscribe(recognizedForms -> { for (int i = 0; i < recognizedForms.size(); i++) { final RecognizedForm form = recognizedForms.get(i); - System.out.printf("----------- Recognized Form page %d -----------%n", i); + System.out.printf("----------- Recognized custom form info for page %d -----------%n", i); System.out.printf("Form type: %s%n", form.getFormType()); form.getFields().forEach((label, formField) -> { - System.out.printf("Field %s has value %s with confidence score of %.2f.%n", label, - formField.getValueData().getText(), + System.out.printf("Field '%s' has label '%s' with confidence score of %.2f.%n", label, + formField.getLabelData().getText(), formField.getConfidence()); }); - System.out.print("-----------------------------------"); } }); diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/src/samples/java/com/azure/ai/formrecognizer/RecognizeCustomForms.java b/sdk/formrecognizer/azure-ai-formrecognizer/src/samples/java/com/azure/ai/formrecognizer/RecognizeCustomFormsFromUrl.java similarity index 67% rename from sdk/formrecognizer/azure-ai-formrecognizer/src/samples/java/com/azure/ai/formrecognizer/RecognizeCustomForms.java rename to sdk/formrecognizer/azure-ai-formrecognizer/src/samples/java/com/azure/ai/formrecognizer/RecognizeCustomFormsFromUrl.java index e7914b2717505..4f063ff665b62 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/src/samples/java/com/azure/ai/formrecognizer/RecognizeCustomForms.java +++ b/sdk/formrecognizer/azure-ai-formrecognizer/src/samples/java/com/azure/ai/formrecognizer/RecognizeCustomFormsFromUrl.java @@ -14,7 +14,7 @@ * Sample to analyze a form from a document with a custom trained model. To learn how to train your own models, * look at TrainModelWithoutLabels.java and TrainModelWithLabels.java. */ -public class RecognizeCustomForms { +public class RecognizeCustomFormsFromUrl { /** * Main method to invoke this demo. @@ -29,23 +29,22 @@ public static void main(String[] args) { .endpoint("https://{endpoint}.cognitiveservices.azure.com/") .buildClient(); - String analyzeFilePath = "{file_source_url}"; + String formUrl = "{form_url}"; String modelId = "{custom_trained_model_id}"; SyncPoller> recognizeFormPoller = - client.beginRecognizeCustomFormsFromUrl(analyzeFilePath, modelId); + client.beginRecognizeCustomFormsFromUrl(formUrl, modelId); List recognizedForms = recognizeFormPoller.getFinalResult(); for (int i = 0; i < recognizedForms.size(); i++) { final RecognizedForm form = recognizedForms.get(i); - System.out.printf("----------- Recognized Form page %d -----------%n", i); + System.out.printf("----------- Recognized custom form info for page %d -----------%n", i); System.out.printf("Form type: %s%n", form.getFormType()); - form.getFields().forEach((label, formField) -> { - System.out.printf("Field %s has value %s with confidence score of %.2f.%n", label, - formField.getValueData().getText(), - formField.getConfidence()); - }); - System.out.print("-----------------------------------"); + form.getFields().forEach((label, formField) -> + // label data is populated if you are using a model trained with unlabeled data, + // since the service needs to make predictions for labels if not explicitly given to it. + System.out.printf("Field '%s' has label '%s' with a confidence " + + "score of %.2f.%n", label, formField.getLabelData().getText(), formField.getConfidence())); } } } diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/src/samples/java/com/azure/ai/formrecognizer/RecognizeReceipts.java b/sdk/formrecognizer/azure-ai-formrecognizer/src/samples/java/com/azure/ai/formrecognizer/RecognizeReceipts.java index cd612e70d4a65..c7e50a70e2e86 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/src/samples/java/com/azure/ai/formrecognizer/RecognizeReceipts.java +++ b/sdk/formrecognizer/azure-ai-formrecognizer/src/samples/java/com/azure/ai/formrecognizer/RecognizeReceipts.java @@ -54,10 +54,10 @@ public static void main(final String[] args) throws IOException { for (int i = 0; i < receiptPageResults.size(); i++) { RecognizedForm recognizedForm = receiptPageResults.get(i); Map> recognizedFields = recognizedForm.getFields(); - System.out.printf("----------- Recognized Receipt page %d -----------%n", i); + System.out.printf("----------- Recognized receipt info for page %d -----------%n", i); FormField merchantNameField = recognizedFields.get("MerchantName"); if (merchantNameField != null) { - if (FieldValueType.STRING.equals(merchantNameField.getValueType())) { + if (FieldValueType.STRING == merchantNameField.getValueType()) { String merchantName = FieldValueType.STRING.cast(merchantNameField); System.out.printf("Merchant Name: %s, confidence: %.2f%n", merchantName, merchantNameField.getConfidence()); @@ -66,7 +66,7 @@ public static void main(final String[] args) throws IOException { FormField merchantPhoneNumberField = recognizedFields.get("MerchantPhoneNumber"); if (merchantPhoneNumberField != null) { - if (FieldValueType.PHONE_NUMBER.equals(merchantNameField.getValueType())) { + if (FieldValueType.PHONE_NUMBER == merchantPhoneNumberField.getValueType()) { String merchantAddress = FieldValueType.PHONE_NUMBER.cast(merchantPhoneNumberField); System.out.printf("Merchant Phone number: %s, confidence: %.2f%n", merchantAddress, merchantPhoneNumberField.getConfidence()); @@ -75,7 +75,7 @@ public static void main(final String[] args) throws IOException { FormField merchantAddressField = recognizedFields.get("MerchantAddress"); if (merchantAddressField != null) { - if (FieldValueType.STRING.equals(merchantNameField.getValueType())) { + if (FieldValueType.STRING == merchantAddressField.getValueType()) { String merchantAddress = FieldValueType.STRING.cast(merchantAddressField); System.out.printf("Merchant Address: %s, confidence: %.2f%n", merchantAddress, merchantAddressField.getConfidence()); @@ -84,7 +84,7 @@ public static void main(final String[] args) throws IOException { FormField transactionDateField = recognizedFields.get("TransactionDate"); if (transactionDateField != null) { - if (FieldValueType.DATE.equals(transactionDateField.getValueType())) { + if (FieldValueType.DATE == transactionDateField.getValueType()) { LocalDate transactionDate = FieldValueType.DATE.cast(transactionDateField); System.out.printf("Transaction Date: %s, confidence: %.2f%n", transactionDate, transactionDateField.getConfidence()); @@ -94,46 +94,43 @@ public static void main(final String[] args) throws IOException { FormField receiptItemsField = recognizedFields.get("Items"); if (receiptItemsField != null) { System.out.printf("Receipt Items: %n"); - if (FieldValueType.LIST.equals(receiptItemsField.getValueType())) { + if (FieldValueType.LIST == receiptItemsField.getValueType()) { List> receiptItems = FieldValueType.LIST.cast(receiptItemsField); - receiptItems.forEach(receiptItem -> { - if (FieldValueType.MAP.equals(receiptItem.getValueType())) { - Map> formFieldMap = FieldValueType.MAP.cast(receiptItem); - formFieldMap.forEach((key, formField) -> { - if ("Name".equals(key)) { - if (FieldValueType.STRING.equals(formField.getValueType())) { - String name = FieldValueType.STRING.cast(formField); - System.out.printf("Name: %s, confidence: %.2fs%n", - name, formField.getConfidence()); - } + receiptItems.stream() + .filter(receiptItem -> FieldValueType.MAP == receiptItem.getValueType()) + .>>map(FieldValueType.MAP::cast) + .forEach(formFieldMap -> formFieldMap.forEach((key, formField) -> { + if ("Name".equals(key)) { + if (FieldValueType.STRING == formField.getValueType()) { + String name = FieldValueType.STRING.cast(formField); + System.out.printf("Name: %s, confidence: %.2fs%n", + name, formField.getConfidence()); } - if ("Quantity".equals(key)) { - if (FieldValueType.DOUBLE.equals(formField.getValueType())) { - Float quantity = FieldValueType.DOUBLE.cast(formField); - System.out.printf("Quantity: %f, confidence: %.2f%n", - quantity, formField.getConfidence()); - } + } + if ("Quantity".equals(key)) { + if (FieldValueType.DOUBLE == formField.getValueType()) { + Float quantity = FieldValueType.DOUBLE.cast(formField); + System.out.printf("Quantity: %f, confidence: %.2f%n", + quantity, formField.getConfidence()); } - if ("Price".equals(key)) { - if (FieldValueType.DOUBLE.equals(formField.getValueType())) { - Float price = FieldValueType.DOUBLE.cast(formField); - System.out.printf("Price: %f, confidence: %.2f%n", - price, formField.getConfidence()); - } + } + if ("Price".equals(key)) { + if (FieldValueType.DOUBLE == formField.getValueType()) { + Float price = FieldValueType.DOUBLE.cast(formField); + System.out.printf("Price: %f, confidence: %.2f%n", + price, formField.getConfidence()); } - if ("TotalPrice".equals(key)) { - if (FieldValueType.DOUBLE.equals(formField.getValueType())) { - Float totalPrice = FieldValueType.DOUBLE.cast(formField); - System.out.printf("Total Price: %f, confidence: %.2f%n", - totalPrice, formField.getConfidence()); - } + } + if ("TotalPrice".equals(key)) { + if (FieldValueType.DOUBLE == formField.getValueType()) { + Float totalPrice = FieldValueType.DOUBLE.cast(formField); + System.out.printf("Total Price: %f, confidence: %.2f%n", + totalPrice, formField.getConfidence()); } - }); - } - }); + } + })); } } - System.out.print("-----------------------------------"); } } } diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/src/samples/java/com/azure/ai/formrecognizer/RecognizeReceiptsAsync.java b/sdk/formrecognizer/azure-ai-formrecognizer/src/samples/java/com/azure/ai/formrecognizer/RecognizeReceiptsAsync.java index d9c1b3849187c..bcb1859e55f78 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/src/samples/java/com/azure/ai/formrecognizer/RecognizeReceiptsAsync.java +++ b/sdk/formrecognizer/azure-ai-formrecognizer/src/samples/java/com/azure/ai/formrecognizer/RecognizeReceiptsAsync.java @@ -48,22 +48,21 @@ public static void main(final String[] args) throws IOException { File sourceFile = new File("../formrecognizer/azure-ai-formrecognizer/src/samples/java/sample-forms/" + "receipts/contoso-allinone.jpg"); byte[] fileContent = Files.readAllBytes(sourceFile.toPath()); - InputStream targetStream = new ByteArrayInputStream(fileContent); - - PollerFlux> analyzeReceiptPoller = - client.beginRecognizeReceipts(toFluxByteBuffer(targetStream), - sourceFile.length()); + PollerFlux> recognizeReceiptPoller; + try (InputStream targetStream = new ByteArrayInputStream(fileContent)) { + recognizeReceiptPoller = client.beginRecognizeReceipts(toFluxByteBuffer(targetStream), sourceFile.length()); + } - Mono> receiptPageResultsMono = analyzeReceiptPoller + Mono> receiptPageResultsMono = recognizeReceiptPoller .last() - .flatMap(recognizeReceiptPollOperation -> { - if (recognizeReceiptPollOperation.getStatus().isComplete()) { + .flatMap(pollResponse -> { + if (pollResponse.getStatus().isComplete()) { System.out.println("Polling completed successfully"); // training completed successfully, retrieving final result. - return recognizeReceiptPollOperation.getFinalResult(); + return pollResponse.getFinalResult(); } else { return Mono.error(new RuntimeException("Polling completed unsuccessfully with status:" - + recognizeReceiptPollOperation.getStatus())); + + pollResponse.getStatus())); } }); @@ -71,10 +70,10 @@ public static void main(final String[] args) throws IOException { for (int i = 0; i < receiptPageResults.size(); i++) { RecognizedForm recognizedForm = receiptPageResults.get(i); Map> recognizedFields = recognizedForm.getFields(); - System.out.printf("----------- Recognized Receipt page %d -----------%n", i); + System.out.printf("----------- Recognized receipt info for page %d -----------%n", i); FormField merchantNameField = recognizedFields.get("MerchantName"); if (merchantNameField != null) { - if (FieldValueType.STRING.equals(merchantNameField.getValueType())) { + if (FieldValueType.STRING == merchantNameField.getValueType()) { String merchantName = FieldValueType.STRING.cast(merchantNameField); System.out.printf("Merchant Name: %s, confidence: %.2f%n", merchantName, merchantNameField.getConfidence()); @@ -83,7 +82,7 @@ public static void main(final String[] args) throws IOException { FormField merchantPhoneNumberField = recognizedFields.get("MerchantPhoneNumber"); if (merchantPhoneNumberField != null) { - if (FieldValueType.PHONE_NUMBER.equals(merchantNameField.getValueType())) { + if (FieldValueType.PHONE_NUMBER == merchantPhoneNumberField.getValueType()) { String merchantAddress = FieldValueType.PHONE_NUMBER.cast(merchantPhoneNumberField); System.out.printf("Merchant Phone number: %s, confidence: %.2f%n", merchantAddress, merchantPhoneNumberField.getConfidence()); @@ -92,7 +91,7 @@ public static void main(final String[] args) throws IOException { FormField merchantAddressField = recognizedFields.get("MerchantAddress"); if (merchantAddressField != null) { - if (FieldValueType.STRING.equals(merchantNameField.getValueType())) { + if (FieldValueType.STRING == merchantAddressField.getValueType()) { String merchantAddress = FieldValueType.STRING.cast(merchantAddressField); System.out.printf("Merchant Address: %s, confidence: %.2f%n", merchantAddress, merchantAddressField.getConfidence()); @@ -101,7 +100,7 @@ public static void main(final String[] args) throws IOException { FormField transactionDateField = recognizedFields.get("TransactionDate"); if (transactionDateField != null) { - if (FieldValueType.DATE.equals(transactionDateField.getValueType())) { + if (FieldValueType.DATE == transactionDateField.getValueType()) { LocalDate transactionDate = FieldValueType.DATE.cast(transactionDateField); System.out.printf("Transaction Date: %s, confidence: %.2f%n", transactionDate, transactionDateField.getConfidence()); @@ -111,46 +110,43 @@ public static void main(final String[] args) throws IOException { FormField receiptItemsField = recognizedFields.get("Items"); if (receiptItemsField != null) { System.out.printf("Receipt Items: %n"); - if (FieldValueType.LIST.equals(receiptItemsField.getValueType())) { + if (FieldValueType.LIST == receiptItemsField.getValueType()) { List> receiptItems = FieldValueType.LIST.cast(receiptItemsField); - receiptItems.forEach(receiptItem -> { - if (FieldValueType.MAP.equals(receiptItem.getValueType())) { - Map> formFieldMap = FieldValueType.MAP.cast(receiptItem); - formFieldMap.forEach((key, formField) -> { - if ("Name".equals(key)) { - if (FieldValueType.STRING.equals(formField.getValueType())) { - String name = FieldValueType.STRING.cast(formField); - System.out.printf("Name: %s, confidence: %.2fs%n", - name, formField.getConfidence()); - } + receiptItems.stream() + .filter(receiptItem -> FieldValueType.MAP == receiptItem.getValueType()) + .>>map(FieldValueType.MAP::cast) + .forEach(formFieldMap -> formFieldMap.forEach((key, formField) -> { + if ("Name".equals(key)) { + if (FieldValueType.STRING == formField.getValueType()) { + String name = FieldValueType.STRING.cast(formField); + System.out.printf("Name: %s, confidence: %.2fs%n", + name, formField.getConfidence()); } - if ("Quantity".equals(key)) { - if (FieldValueType.DOUBLE.equals(formField.getValueType())) { - Float quantity = FieldValueType.DOUBLE.cast(formField); - System.out.printf("Quantity: %f, confidence: %.2f%n", - quantity, formField.getConfidence()); - } + } + if ("Quantity".equals(key)) { + if (FieldValueType.DOUBLE == formField.getValueType()) { + Float quantity = FieldValueType.DOUBLE.cast(formField); + System.out.printf("Quantity: %f, confidence: %.2f%n", + quantity, formField.getConfidence()); } - if ("Price".equals(key)) { - if (FieldValueType.DOUBLE.equals(formField.getValueType())) { - Float price = FieldValueType.DOUBLE.cast(formField); - System.out.printf("Price: %f, confidence: %.2f%n", - price, formField.getConfidence()); - } + } + if ("Price".equals(key)) { + if (FieldValueType.DOUBLE == formField.getValueType()) { + Float price = FieldValueType.DOUBLE.cast(formField); + System.out.printf("Price: %f, confidence: %.2f%n", + price, formField.getConfidence()); } - if ("TotalPrice".equals(key)) { - if (FieldValueType.DOUBLE.equals(formField.getValueType())) { - Float totalPrice = FieldValueType.DOUBLE.cast(formField); - System.out.printf("Total Price: %f, confidence: %.2f%n", - totalPrice, formField.getConfidence()); - } + } + if ("TotalPrice".equals(key)) { + if (FieldValueType.DOUBLE == formField.getValueType()) { + Float totalPrice = FieldValueType.DOUBLE.cast(formField); + System.out.printf("Total Price: %f, confidence: %.2f%n", + totalPrice, formField.getConfidence()); } - }); - } - }); + } + })); } } - System.out.print("-----------------------------------"); } }); diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/src/samples/java/com/azure/ai/formrecognizer/RecognizeReceiptsFromUrl.java b/sdk/formrecognizer/azure-ai-formrecognizer/src/samples/java/com/azure/ai/formrecognizer/RecognizeReceiptsFromUrl.java index df9c21ca7d093..1f3b08c3fa1c0 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/src/samples/java/com/azure/ai/formrecognizer/RecognizeReceiptsFromUrl.java +++ b/sdk/formrecognizer/azure-ai-formrecognizer/src/samples/java/com/azure/ai/formrecognizer/RecognizeReceiptsFromUrl.java @@ -44,10 +44,10 @@ public static void main(final String[] args) { for (int i = 0; i < receiptPageResults.size(); i++) { RecognizedForm recognizedForm = receiptPageResults.get(i); Map> recognizedFields = recognizedForm.getFields(); - System.out.printf("----------- Recognized Receipt page %d -----------%n", i); + System.out.printf("----------- Recognized receipt info for page %d -----------%n", i); FormField merchantNameField = recognizedFields.get("MerchantName"); if (merchantNameField != null) { - if (FieldValueType.STRING.equals(merchantNameField.getValueType())) { + if (FieldValueType.STRING == merchantNameField.getValueType()) { String merchantName = FieldValueType.STRING.cast(merchantNameField); System.out.printf("Merchant Name: %s, confidence: %.2f%n", merchantName, merchantNameField.getConfidence()); @@ -56,7 +56,7 @@ public static void main(final String[] args) { FormField merchantAddressField = recognizedFields.get("MerchantAddress"); if (merchantAddressField != null) { - if (FieldValueType.STRING.equals(merchantNameField.getValueType())) { + if (FieldValueType.STRING == merchantAddressField.getValueType()) { String merchantAddress = FieldValueType.STRING.cast(merchantAddressField); System.out.printf("Merchant Address: %s, confidence: %.2f%n", merchantAddress, merchantAddressField.getConfidence()); @@ -65,7 +65,7 @@ public static void main(final String[] args) { FormField merchantPhoneNumberField = recognizedFields.get("MerchantPhoneNumber"); if (merchantPhoneNumberField != null) { - if (FieldValueType.PHONE_NUMBER.equals(merchantNameField.getValueType())) { + if (FieldValueType.PHONE_NUMBER == merchantPhoneNumberField.getValueType()) { String merchantAddress = FieldValueType.PHONE_NUMBER.cast(merchantPhoneNumberField); System.out.printf("Merchant Phone number: %s, confidence: %.2f%n", merchantAddress, merchantPhoneNumberField.getConfidence()); @@ -74,7 +74,7 @@ public static void main(final String[] args) { FormField transactionDateField = recognizedFields.get("TransactionDate"); if (transactionDateField != null) { - if (FieldValueType.DATE.equals(transactionDateField.getValueType())) { + if (FieldValueType.DATE == transactionDateField.getValueType()) { LocalDate transactionDate = FieldValueType.DATE.cast(transactionDateField); System.out.printf("Transaction Date: %s, confidence: %.2f%n", transactionDate, transactionDateField.getConfidence()); @@ -84,46 +84,43 @@ public static void main(final String[] args) { FormField receiptItemsField = recognizedFields.get("Items"); if (receiptItemsField != null) { System.out.printf("Receipt Items: %n"); - if (FieldValueType.LIST.equals(receiptItemsField.getValueType())) { + if (FieldValueType.LIST == receiptItemsField.getValueType()) { List> receiptItems = FieldValueType.LIST.cast(receiptItemsField); - receiptItems.forEach(receiptItem -> { - if (FieldValueType.MAP.equals(receiptItem.getValueType())) { - Map> formFieldMap = FieldValueType.MAP.cast(receiptItem); - formFieldMap.forEach((key, formField) -> { - if ("Name".equals(key)) { - if (FieldValueType.STRING.equals(formField.getValueType())) { - String name = FieldValueType.STRING.cast(formField); - System.out.printf("Name: %s, confidence: %.2fs%n", - name, formField.getConfidence()); - } + receiptItems.stream() + .filter(receiptItem -> FieldValueType.MAP == receiptItem.getValueType()) + .>>map(FieldValueType.MAP::cast) + .forEach(formFieldMap -> formFieldMap.forEach((key, formField) -> { + if ("Name".equals(key)) { + if (FieldValueType.STRING == formField.getValueType()) { + String name = FieldValueType.STRING.cast(formField); + System.out.printf("Name: %s, confidence: %.2fs%n", + name, formField.getConfidence()); } - if ("Quantity".equals(key)) { - if (FieldValueType.DOUBLE.equals(formField.getValueType())) { - Float quantity = FieldValueType.DOUBLE.cast(formField); - System.out.printf("Quantity: %f, confidence: %.2f%n", - quantity, formField.getConfidence()); - } + } + if ("Quantity".equals(key)) { + if (FieldValueType.DOUBLE == formField.getValueType()) { + Float quantity = FieldValueType.DOUBLE.cast(formField); + System.out.printf("Quantity: %f, confidence: %.2f%n", + quantity, formField.getConfidence()); } - if ("Price".equals(key)) { - if (FieldValueType.DOUBLE.equals(formField.getValueType())) { - Float price = FieldValueType.DOUBLE.cast(formField); - System.out.printf("Price: %f, confidence: %.2f%n", - price, formField.getConfidence()); - } + } + if ("Price".equals(key)) { + if (FieldValueType.DOUBLE == formField.getValueType()) { + Float price = FieldValueType.DOUBLE.cast(formField); + System.out.printf("Price: %f, confidence: %.2f%n", + price, formField.getConfidence()); } - if ("TotalPrice".equals(key)) { - if (FieldValueType.DOUBLE.equals(formField.getValueType())) { - Float totalPrice = FieldValueType.DOUBLE.cast(formField); - System.out.printf("Total Price: %f, confidence: %.2f%n", - totalPrice, formField.getConfidence()); - } + } + if ("TotalPrice".equals(key)) { + if (FieldValueType.DOUBLE == formField.getValueType()) { + Float totalPrice = FieldValueType.DOUBLE.cast(formField); + System.out.printf("Total Price: %f, confidence: %.2f%n", + totalPrice, formField.getConfidence()); } - }); - } - }); + } + })); } } - System.out.print("-----------------------------------"); } } } diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/src/samples/java/com/azure/ai/formrecognizer/RecognizeReceiptsFromUrlAsync.java b/sdk/formrecognizer/azure-ai-formrecognizer/src/samples/java/com/azure/ai/formrecognizer/RecognizeReceiptsFromUrlAsync.java index 4df763056b81d..8f20c95731283 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/src/samples/java/com/azure/ai/formrecognizer/RecognizeReceiptsFromUrlAsync.java +++ b/sdk/formrecognizer/azure-ai-formrecognizer/src/samples/java/com/azure/ai/formrecognizer/RecognizeReceiptsFromUrlAsync.java @@ -43,14 +43,14 @@ public static void main(final String[] args) { Mono> receiptPageResults = recognizeReceiptPoller .last() - .flatMap(trainingOperationResponse -> { - if (trainingOperationResponse.getStatus().isComplete()) { + .flatMap(pollResponse -> { + if (pollResponse.getStatus().isComplete()) { System.out.println("Polling completed successfully"); // training completed successfully, retrieving final result. - return trainingOperationResponse.getFinalResult(); + return pollResponse.getFinalResult(); } else { return Mono.error(new RuntimeException("Polling completed unsuccessfully with status:" - + trainingOperationResponse.getStatus())); + + pollResponse.getStatus())); } }); @@ -58,10 +58,10 @@ public static void main(final String[] args) { for (int i = 0; i < recognizedReceipts.size(); i++) { RecognizedForm recognizedForm = recognizedReceipts.get(i); Map> recognizedFields = recognizedForm.getFields(); - System.out.printf("----------- Recognized Receipt page %d -----------%n", i); + System.out.printf("----------- Recognized receipt for page %d -----------%n", i); FormField merchantNameField = recognizedFields.get("MerchantName"); if (merchantNameField != null) { - if (FieldValueType.STRING.equals(merchantNameField.getValueType())) { + if (FieldValueType.STRING == merchantNameField.getValueType()) { String merchantName = FieldValueType.STRING.cast(merchantNameField); System.out.printf("Merchant Name: %s, confidence: %.2f%n", merchantName, merchantNameField.getConfidence()); @@ -70,7 +70,7 @@ public static void main(final String[] args) { FormField merchantPhoneNumberField = recognizedFields.get("MerchantPhoneNumber"); if (merchantPhoneNumberField != null) { - if (FieldValueType.PHONE_NUMBER.equals(merchantNameField.getValueType())) { + if (FieldValueType.PHONE_NUMBER == merchantPhoneNumberField.getValueType()) { String merchantAddress = FieldValueType.PHONE_NUMBER.cast(merchantPhoneNumberField); System.out.printf("Merchant Address: %s, confidence: %.2f%n", merchantAddress, merchantPhoneNumberField.getConfidence()); @@ -79,7 +79,7 @@ public static void main(final String[] args) { FormField merchantAddressField = recognizedFields.get("MerchantAddress"); if (merchantAddressField != null) { - if (FieldValueType.STRING.equals(merchantNameField.getValueType())) { + if (FieldValueType.STRING == merchantAddressField.getValueType()) { String merchantAddress = FieldValueType.STRING.cast(merchantAddressField); System.out.printf("Merchant Address: %s, confidence: %.2f%n", merchantAddress, merchantAddressField.getConfidence()); @@ -88,7 +88,7 @@ public static void main(final String[] args) { FormField transactionDateField = recognizedFields.get("TransactionDate"); if (transactionDateField != null) { - if (FieldValueType.DATE.equals(transactionDateField.getValueType())) { + if (FieldValueType.DATE == transactionDateField.getValueType()) { LocalDate transactionDate = FieldValueType.DATE.cast(transactionDateField); System.out.printf("Transaction Date: %s, confidence: %.2f%n", transactionDate, transactionDateField.getConfidence()); @@ -98,47 +98,44 @@ public static void main(final String[] args) { FormField receiptItemsField = recognizedFields.get("Items"); if (receiptItemsField != null) { System.out.printf("Receipt Items: %n"); - if (FieldValueType.LIST.equals(receiptItemsField.getValueType())) { + if (FieldValueType.LIST == receiptItemsField.getValueType()) { List> receiptItems = FieldValueType.LIST.cast(receiptItemsField); - receiptItems.forEach(receiptItem -> { - if (FieldValueType.MAP.equals(receiptItem.getValueType())) { - // we still have to cast or assign - Map> formFieldMap = FieldValueType.MAP.cast(receiptItem); - formFieldMap.forEach((key, formField) -> { - if ("Name".equals(key)) { - if (FieldValueType.STRING.equals(formField.getValueType())) { - String name = FieldValueType.STRING.cast(formField); - System.out.printf("Name: %s, confidence: %.2fs%n", - name, formField.getConfidence()); - } + // we still have to cast or assign + receiptItems.stream() + .filter(receiptItem -> FieldValueType.MAP == receiptItem.getValueType()) + .>>map(FieldValueType.MAP::cast) + .forEach(formFieldMap -> formFieldMap.forEach((key, formField) -> { + if ("Name".equals(key)) { + if (FieldValueType.STRING == formField.getValueType()) { + String name = FieldValueType.STRING.cast(formField); + System.out.printf("Name: %s, confidence: %.2fs%n", + name, formField.getConfidence()); } - if ("Quantity".equals(key)) { - if (FieldValueType.DOUBLE.equals(formField.getValueType())) { - Float quantity = FieldValueType.DOUBLE.cast(formField); - System.out.printf("Quantity: %f, confidence: %.2f%n", - quantity, formField.getConfidence()); - } + } + if ("Quantity".equals(key)) { + if (FieldValueType.DOUBLE == formField.getValueType()) { + Float quantity = FieldValueType.DOUBLE.cast(formField); + System.out.printf("Quantity: %f, confidence: %.2f%n", + quantity, formField.getConfidence()); } - if ("Price".equals(key)) { - if (FieldValueType.DOUBLE.equals(formField.getValueType())) { - Float price = FieldValueType.DOUBLE.cast(formField); - System.out.printf("Price: %f, confidence: %.2f%n", - price, formField.getConfidence()); - } + } + if ("Price".equals(key)) { + if (FieldValueType.DOUBLE == formField.getValueType()) { + Float price = FieldValueType.DOUBLE.cast(formField); + System.out.printf("Price: %f, confidence: %.2f%n", + price, formField.getConfidence()); } - if ("TotalPrice".equals(key)) { - if (FieldValueType.DOUBLE.equals(formField.getValueType())) { - Float totalPrice = FieldValueType.DOUBLE.cast(formField); - System.out.printf("Total Price: %f, confidence: %.2f%n", - totalPrice, formField.getConfidence()); - } + } + if ("TotalPrice".equals(key)) { + if (FieldValueType.DOUBLE == formField.getValueType()) { + Float totalPrice = FieldValueType.DOUBLE.cast(formField); + System.out.printf("Total Price: %f, confidence: %.2f%n", + totalPrice, formField.getConfidence()); } - }); - } - }); + } + })); } } - System.out.print("-----------------------------------"); } }); diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/src/samples/java/com/azure/ai/formrecognizer/StronglyTypedRecognizedForm.java b/sdk/formrecognizer/azure-ai-formrecognizer/src/samples/java/com/azure/ai/formrecognizer/StronglyTypedRecognizedForm.java index f0144fdc9a565..53862e130c29a 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/src/samples/java/com/azure/ai/formrecognizer/StronglyTypedRecognizedForm.java +++ b/sdk/formrecognizer/azure-ai-formrecognizer/src/samples/java/com/azure/ai/formrecognizer/StronglyTypedRecognizedForm.java @@ -25,7 +25,7 @@ public class StronglyTypedRecognizedForm { public static void main(final String[] args) { // Instantiate a client that will be used to call the service. FormRecognizerClient client = new FormRecognizerClientBuilder() - .credential(new AzureKeyCredential("{api_Key}")) + .credential(new AzureKeyCredential("{key}")) .endpoint("https://{endpoint}.cognitiveservices.azure.com/") .buildClient(); @@ -38,7 +38,7 @@ public static void main(final String[] args) { for (int i = 0; i < receiptPageResults.size(); i++) { final RecognizedForm recognizedForm = receiptPageResults.get(i); - System.out.printf("----------- Recognized Receipt page %d -----------%n", i); + System.out.printf("----------- Recognized receipt info for page %d -----------%n", i); // Use Receipt model transform the recognized form to strongly typed US receipt fields Receipt usReceipt = new Receipt(recognizedForm); System.out.printf("Merchant Name: %s, confidence: %.2f%n", usReceipt.getMerchantName().getValue(), @@ -48,7 +48,7 @@ public static void main(final String[] args) { usReceipt.getMerchantAddress().getConfidence()); System.out.printf("Merchant Phone Number %s, confidence: %.2f%n", usReceipt.getMerchantPhoneNumber().getValue(), usReceipt.getMerchantPhoneNumber().getConfidence()); - System.out.printf("Total: %s confidence: %.2f%n", usReceipt.getTotal().getValue(), + System.out.printf("Total: %.2f confidence: %.2f%n", usReceipt.getTotal().getValue(), usReceipt.getTotal().getConfidence()); System.out.printf("Transaction Date: %s, confidence: %.2f%n", usReceipt.getTransactionDate().getValue(), usReceipt.getTransactionDate().getConfidence()); @@ -73,7 +73,7 @@ public static void main(final String[] args) { receiptItem.getTotalPrice().getValue(), receiptItem.getTotalPrice().getConfidence()); } }); - System.out.print("-----------------------------------"); + System.out.println("-----------------------------------"); } } } diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/src/samples/java/com/azure/ai/formrecognizer/TrainModelWithLabels.java b/sdk/formrecognizer/azure-ai-formrecognizer/src/samples/java/com/azure/ai/formrecognizer/TrainModelWithLabels.java index fb06d585cdfa8..cdc096fc8337c 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/src/samples/java/com/azure/ai/formrecognizer/TrainModelWithLabels.java +++ b/sdk/formrecognizer/azure-ai-formrecognizer/src/samples/java/com/azure/ai/formrecognizer/TrainModelWithLabels.java @@ -28,14 +28,14 @@ public class TrainModelWithLabels { */ public static void main(String[] args) { // Instantiate a client that will be used to call the service. - FormTrainingClient client = new FormTrainingClientBuilder() .credential(new AzureKeyCredential("{key}")) .endpoint("https://{endpoint}.cognitiveservices.azure.com/") .buildClient(); // Train custom model - String trainingFilesUrl = "{CONTAINER_SAS_URL}"; // The shared access signature (SAS) Url of your Azure Blob Storage container with your forms. + String trainingFilesUrl = "{SAS_URL_of_your_container_in_blob_storage}"; + // The shared access signature (SAS) Url of your Azure Blob Storage container with your forms. SyncPoller trainingPoller = client.beginTraining(trainingFilesUrl, true); CustomFormModel customFormModel = trainingPoller.getFinalResult(); @@ -46,20 +46,21 @@ public static void main(String[] args) { System.out.printf("Training started on: %s%n", customFormModel.getTrainingStartedOn()); System.out.printf("Training completed on: %s%n%n", customFormModel.getTrainingCompletedOn()); - // looping through the sub-models, which contains the fields they were trained on + // looping through the subModels, which contains the fields they were trained on // The labels are based on the ones you gave the training document. System.out.println("Recognized Fields:"); // Since the data is labeled, we are able to return the accuracy of the model customFormModel.getSubmodels().forEach(customFormSubmodel -> { - System.out.printf("Sub-model accuracy: %.2f%n", customFormSubmodel.getAccuracy()); + System.out.printf("The subModel with form type %s has accuracy: %.2f%n", + customFormSubmodel.getFormType(), customFormSubmodel.getAccuracy()); customFormSubmodel.getFields().forEach((label, customFormModelField) -> - System.out.printf("Field: %s Field Name: %s Field Accuracy: %.2f%n", + System.out.printf("The model found field '%s' to have name: %s with an accuracy: %.2f%n", label, customFormModelField.getName(), customFormModelField.getAccuracy())); }); System.out.println(); customFormModel.getTrainingDocuments().forEach(trainingDocumentInfo -> { System.out.printf("Document name: %s%n", trainingDocumentInfo.getName()); - System.out.printf("Document status: %s%n", trainingDocumentInfo.getName()); + System.out.printf("Document status: %s%n", trainingDocumentInfo.getTrainingStatus()); System.out.printf("Document page count: %d%n", trainingDocumentInfo.getPageCount()); if (!trainingDocumentInfo.getDocumentErrors().isEmpty()) { System.out.println("Document Errors:"); diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/src/samples/java/com/azure/ai/formrecognizer/TrainModelWithLabelsAsync.java b/sdk/formrecognizer/azure-ai-formrecognizer/src/samples/java/com/azure/ai/formrecognizer/TrainModelWithLabelsAsync.java index 67ef5513fedf4..d905f3357aaec 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/src/samples/java/com/azure/ai/formrecognizer/TrainModelWithLabelsAsync.java +++ b/sdk/formrecognizer/azure-ai-formrecognizer/src/samples/java/com/azure/ai/formrecognizer/TrainModelWithLabelsAsync.java @@ -8,7 +8,6 @@ import com.azure.ai.formrecognizer.training.FormTrainingAsyncClient; import com.azure.ai.formrecognizer.training.FormTrainingClientBuilder; import com.azure.core.credential.AzureKeyCredential; -import com.azure.core.util.polling.LongRunningOperationStatus; import com.azure.core.util.polling.PollerFlux; import reactor.core.publisher.Mono; @@ -31,25 +30,24 @@ public class TrainModelWithLabelsAsync { */ public static void main(String[] args) { // Instantiate a client that will be used to call the service. - FormTrainingAsyncClient client = new FormTrainingClientBuilder() - .credential(new AzureKeyCredential("{api_Key}")) + .credential(new AzureKeyCredential("{key}")) .endpoint("https://{endpoint}.cognitiveservices.azure.com/") .buildAsyncClient(); - // Train custom model - String trainingFilesUrl = "{CONTAINER_SAS_URL}"; // The shared access signature (SAS) Url of your Azure Blob Storage container with your forms. + String trainingFilesUrl = "{SAS_URL_of_your_container_in_blob_storage}"; + // The shared access signature (SAS) Url of your Azure Blob Storage container with your forms. PollerFlux trainingPoller = client.beginTraining(trainingFilesUrl, true); Mono customFormModelResult = trainingPoller .last() - .flatMap(trainingOperationResponse -> { - if (trainingOperationResponse.getStatus().equals(LongRunningOperationStatus.SUCCESSFULLY_COMPLETED)) { + .flatMap(pollResponse -> { + if (pollResponse.getStatus().isComplete()) { // training completed successfully, retrieving final result. - return trainingOperationResponse.getFinalResult(); + return pollResponse.getFinalResult(); } else { return Mono.error(new RuntimeException("Polling completed unsuccessfully with status:" - + trainingOperationResponse.getStatus())); + + pollResponse.getStatus())); } }); @@ -65,15 +63,16 @@ public static void main(String[] args) { System.out.println("Recognized Fields:"); // Since the data is labeled, we are able to return the accuracy of the model customFormModel.getSubmodels().forEach(customFormSubmodel -> { - System.out.printf("Sub-model accuracy: %.2f%n", customFormSubmodel.getAccuracy()); + System.out.printf("The subModel with form type %s has accuracy: %.2f%n", + customFormSubmodel.getFormType(), customFormSubmodel.getAccuracy()); customFormSubmodel.getFields().forEach((label, customFormModelField) -> - System.out.printf("Field: %s Field Name: %s Field Accuracy: %.2f%n", + System.out.printf("The model found field '%s' to have name: %s with an accuracy: %.2f%n", label, customFormModelField.getName(), customFormModelField.getAccuracy())); }); System.out.println(); customFormModel.getTrainingDocuments().forEach(trainingDocumentInfo -> { System.out.printf("Document name: %s%n", trainingDocumentInfo.getName()); - System.out.printf("Document status: %s%n", trainingDocumentInfo.getName()); + System.out.printf("Document status: %s%n", trainingDocumentInfo.getTrainingStatus()); System.out.printf("Document page count: %d%n", trainingDocumentInfo.getPageCount()); if (!trainingDocumentInfo.getDocumentErrors().isEmpty()) { System.out.println("Document Errors:"); diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/src/samples/java/com/azure/ai/formrecognizer/TrainModelWithoutLabels.java b/sdk/formrecognizer/azure-ai-formrecognizer/src/samples/java/com/azure/ai/formrecognizer/TrainModelWithoutLabels.java index f60180abb0d3c..048b009ac8f82 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/src/samples/java/com/azure/ai/formrecognizer/TrainModelWithoutLabels.java +++ b/sdk/formrecognizer/azure-ai-formrecognizer/src/samples/java/com/azure/ai/formrecognizer/TrainModelWithoutLabels.java @@ -27,14 +27,14 @@ public class TrainModelWithoutLabels { */ public static void main(String[] args) { // Instantiate a client that will be used to call the service. - FormTrainingClient client = new FormTrainingClientBuilder() - .credential(new AzureKeyCredential("{api_Key}")) + .credential(new AzureKeyCredential("{key}")) .endpoint("https://{endpoint}.cognitiveservices.azure.com/") .buildClient(); // Train custom model - String trainingFilesUrl = "{CONTAINER_SAS_URL}"; // The shared access signature (SAS) Url of your Azure Blob Storage container with your forms. + String trainingFilesUrl = "{SAS_URL_of_your_container_in_blob_storage}"; + // The shared access signature (SAS) Url of your Azure Blob Storage container with your forms. SyncPoller trainingPoller = client.beginTraining(trainingFilesUrl, false); CustomFormModel customFormModel = trainingPoller.getFinalResult(); @@ -46,12 +46,13 @@ public static void main(String[] args) { System.out.printf("Training completed on: %s%n%n", customFormModel.getTrainingCompletedOn()); System.out.println("Recognized Fields:"); - // looping through the sub-models, which contains the fields they were trained on + // looping through the subModels, which contains the fields they were trained on // Since the given training documents are unlabeled, we still group them but they do not have a label. customFormModel.getSubmodels().forEach(customFormSubmodel -> { // Since the training data is unlabeled, we are unable to return the accuracy of this model + System.out.printf("The subModel has form type %s%n", customFormSubmodel.getFormType()); customFormSubmodel.getFields().forEach((field, customFormModelField) -> - System.out.printf("Field: %s Field Label: %s%n", + System.out.printf("The model found field '%s' with label: %s%n", field, customFormModelField.getLabel())); }); System.out.println(); @@ -59,7 +60,7 @@ public static void main(String[] args) { // Training result information customFormModel.getTrainingDocuments().forEach(trainingDocumentInfo -> { System.out.printf("Document name: %s%n", trainingDocumentInfo.getName()); - System.out.printf("Document status: %s%n", trainingDocumentInfo.getName()); + System.out.printf("Document status: %s%n", trainingDocumentInfo.getTrainingStatus()); System.out.printf("Document page count: %d%n", trainingDocumentInfo.getPageCount()); if (!trainingDocumentInfo.getDocumentErrors().isEmpty()) { System.out.println("Document Errors:"); diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/src/samples/java/com/azure/ai/formrecognizer/TrainModelWithoutLabelsAsync.java b/sdk/formrecognizer/azure-ai-formrecognizer/src/samples/java/com/azure/ai/formrecognizer/TrainModelWithoutLabelsAsync.java index e7d720c6f4c45..d62eb7688c242 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/src/samples/java/com/azure/ai/formrecognizer/TrainModelWithoutLabelsAsync.java +++ b/sdk/formrecognizer/azure-ai-formrecognizer/src/samples/java/com/azure/ai/formrecognizer/TrainModelWithoutLabelsAsync.java @@ -8,7 +8,6 @@ import com.azure.ai.formrecognizer.training.FormTrainingAsyncClient; import com.azure.ai.formrecognizer.training.FormTrainingClientBuilder; import com.azure.core.credential.AzureKeyCredential; -import com.azure.core.util.polling.LongRunningOperationStatus; import com.azure.core.util.polling.PollerFlux; import reactor.core.publisher.Mono; @@ -32,25 +31,25 @@ public class TrainModelWithoutLabelsAsync { */ public static void main(String[] args) { // Instantiate a client that will be used to call the service. - FormTrainingAsyncClient client = new FormTrainingClientBuilder() .credential(new AzureKeyCredential("{key}")) .endpoint("https://{endpoint}.cognitiveservices.azure.com/") .buildAsyncClient(); // Train custom model - String trainingSetSource = "{unlabeled_training_set_SAS_URL}"; - PollerFlux trainingPoller = client.beginTraining(trainingSetSource, false); + String trainingFilesUrl = "{SAS_URL_of_your_container_in_blob_storage}"; + // The shared access signature (SAS) Url of your Azure Blob Storage container with your forms. + PollerFlux trainingPoller = client.beginTraining(trainingFilesUrl, false); Mono customFormModelResult = trainingPoller .last() - .flatMap(trainingOperationResponse -> { - if (trainingOperationResponse.getStatus().equals(LongRunningOperationStatus.SUCCESSFULLY_COMPLETED)) { + .flatMap(pollResponse -> { + if (pollResponse.getStatus().isComplete()) { // training completed successfully, retrieving final result. - return trainingOperationResponse.getFinalResult(); + return pollResponse.getFinalResult(); } else { return Mono.error(new RuntimeException("Polling completed unsuccessfully with status:" - + trainingOperationResponse.getStatus())); + + pollResponse.getStatus())); } }); @@ -62,19 +61,21 @@ public static void main(String[] args) { System.out.printf("Training completed on: %s%n%n", customFormModel.getTrainingCompletedOn()); System.out.println("Recognized Fields:"); - // looping through the sub-models, which contains the fields they were trained on + // looping through the subModels, which contains the fields they were trained on // Since the given training documents are unlabeled, we still group them but they do not have a label. customFormModel.getSubmodels().forEach(customFormSubmodel -> { // Since the training data is unlabeled, we are unable to return the accuracy of this model + System.out.printf("The subModel has form type %s%n", customFormSubmodel.getFormType()); customFormSubmodel.getFields().forEach((field, customFormModelField) -> - System.out.printf("Field: %s Field Label: %s%n", field, customFormModelField.getLabel())); + System.out.printf("The model found field '%s' with label: %s%n", + field, customFormModelField.getLabel())); }); System.out.println(); // Training result information customFormModel.getTrainingDocuments().forEach(trainingDocumentInfo -> { System.out.printf("Document name: %s%n", trainingDocumentInfo.getName()); - System.out.printf("Document status: %s%n", trainingDocumentInfo.getName()); + System.out.printf("Document status: %s%n", trainingDocumentInfo.getTrainingStatus()); System.out.printf("Document page count: %d%n", trainingDocumentInfo.getPageCount()); if (!trainingDocumentInfo.getDocumentErrors().isEmpty()) { System.out.println("Document Errors:"); diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/src/test/java/com/azure/ai/formrecognizer/FormRecognizerAsyncClientTest.java b/sdk/formrecognizer/azure-ai-formrecognizer/src/test/java/com/azure/ai/formrecognizer/FormRecognizerAsyncClientTest.java index 5aa35327f249c..be4340c7dbd6b 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/src/test/java/com/azure/ai/formrecognizer/FormRecognizerAsyncClientTest.java +++ b/sdk/formrecognizer/azure-ai-formrecognizer/src/test/java/com/azure/ai/formrecognizer/FormRecognizerAsyncClientTest.java @@ -666,7 +666,7 @@ public void recognizeCustomFormUnlabeledData(HttpClient httpClient, FormRecogniz })); } /** - * Verifies custom form data for a document using source as input stream data and valid include text content + * Verifies custom form data for a document using source as input stream data and valid include field elements */ @ParameterizedTest(name = DISPLAY_NAME_WITH_ARGUMENTS) @MethodSource("com.azure.ai.formrecognizer.TestUtils#getTestParameters") From 511309d72a7703b59903cc7eea33ff634b779724 Mon Sep 17 00:00:00 2001 From: Annie Liang <64233642+xinlian12@users.noreply.github.com> Date: Tue, 14 Jul 2020 13:16:11 -0700 Subject: [PATCH 110/129] 4.2.0 release (#13145) * 4.2.0 release Co-authored-by: Annie Liang --- eng/jacoco-test-coverage/pom.xml | 2 +- eng/versioning/version_client.txt | 2 +- sdk/cosmos/azure-cosmos-benchmark/pom.xml | 2 +- sdk/cosmos/azure-cosmos/CHANGELOG.md | 13 +++++++++++-- sdk/cosmos/azure-cosmos/README.md | 2 +- sdk/cosmos/azure-cosmos/pom.xml | 2 +- 6 files changed, 16 insertions(+), 7 deletions(-) diff --git a/eng/jacoco-test-coverage/pom.xml b/eng/jacoco-test-coverage/pom.xml index c6cf18e8b4a7d..b2c8e843b4403 100644 --- a/eng/jacoco-test-coverage/pom.xml +++ b/eng/jacoco-test-coverage/pom.xml @@ -109,7 +109,7 @@ com.azure azure-cosmos - 4.2.0-beta.1 + 4.2.0 com.azure diff --git a/eng/versioning/version_client.txt b/eng/versioning/version_client.txt index 8edfb99d62d69..322a6bc727b31 100644 --- a/eng/versioning/version_client.txt +++ b/eng/versioning/version_client.txt @@ -19,7 +19,7 @@ com.azure:azure-core-serializer-json-gson;1.0.0-beta.1;1.0.0-beta.2 com.azure:azure-core-serializer-json-jackson;1.0.0-beta.1;1.0.0-beta.2 com.azure:azure-core-test;1.3.1;1.4.0-beta.1 com.azure:azure-core-tracing-opentelemetry;1.0.0-beta.5;1.0.0-beta.6 -com.azure:azure-cosmos;4.1.0;4.2.0-beta.1 +com.azure:azure-cosmos;4.1.0;4.2.0 com.azure:azure-cosmos-benchmark;4.0.1-beta.1;4.0.1-beta.1 com.azure:azure-data-appconfiguration;1.1.3;1.2.0-beta.1 com.azure:azure-data-schemaregistry;1.0.0-beta.2;1.0.0-beta.3 diff --git a/sdk/cosmos/azure-cosmos-benchmark/pom.xml b/sdk/cosmos/azure-cosmos-benchmark/pom.xml index 60b596f4909a6..607609ca2fcce 100644 --- a/sdk/cosmos/azure-cosmos-benchmark/pom.xml +++ b/sdk/cosmos/azure-cosmos-benchmark/pom.xml @@ -43,7 +43,7 @@ Licensed under the MIT License. com.azure azure-cosmos - 4.2.0-beta.1 + 4.2.0 diff --git a/sdk/cosmos/azure-cosmos/CHANGELOG.md b/sdk/cosmos/azure-cosmos/CHANGELOG.md index b0da674c5186d..10d2aac1d1337 100644 --- a/sdk/cosmos/azure-cosmos/CHANGELOG.md +++ b/sdk/cosmos/azure-cosmos/CHANGELOG.md @@ -1,7 +1,16 @@ # Release History -## 4.2.0-beta.1 (Unreleased) - +## 4.2.0 (2020-07-14) +### New Features +* Added script logging enabled API to `CosmosStoredProcedureRequestOptions`. +* Updated `DirectConnectionConfig` default `idleEndpointTimeout` to 1h and default `connectTimeout` to 5s. +### Key Bug Fixes +* Fixed issue where `GatewayConnectionConfig` `idleConnectionTimeout` was overriding `DirectConnectionConfig` `idleConnectionTimeout`. +* Fixed `responseContinuationTokenLimitInKb` get and set APIs in `CosmosQueryRequestOptions`. +* Fixed issue in query and change feed when recreating the collection with same name. +* Fixed issue with top query throwing ClassCastException. +* Fixed issue with order by query throwing NullPointerException. +* Fixed issue in handling of cancelled requests in direct mode causing reactor `onErrorDropped` being called. ## 4.1.0 (2020-06-25) ### New Features diff --git a/sdk/cosmos/azure-cosmos/README.md b/sdk/cosmos/azure-cosmos/README.md index 14339f753b03c..f36b2d2123948 100644 --- a/sdk/cosmos/azure-cosmos/README.md +++ b/sdk/cosmos/azure-cosmos/README.md @@ -14,7 +14,7 @@ This project provides SDK library in Java for interacting with [SQL API][sql_api com.azure azure-cosmos - 4.1.0 + 4.2.0 ``` [//]: # ({x-version-update-end}) diff --git a/sdk/cosmos/azure-cosmos/pom.xml b/sdk/cosmos/azure-cosmos/pom.xml index 049bb9b7fab02..d3d34b1769892 100644 --- a/sdk/cosmos/azure-cosmos/pom.xml +++ b/sdk/cosmos/azure-cosmos/pom.xml @@ -13,7 +13,7 @@ Licensed under the MIT License. com.azure azure-cosmos - 4.2.0-beta.1 + 4.2.0 Microsoft Azure SDK for SQL API of Azure Cosmos DB Service This Package contains Microsoft Azure Cosmos SDK (with Reactive Extension Reactor support) for Azure Cosmos DB SQL API jar From 653763ee9fb7149cf429aa78caee65672a03d10e Mon Sep 17 00:00:00 2001 From: Sameeksha Vaity Date: Tue, 14 Jul 2020 14:21:03 -0700 Subject: [PATCH 111/129] Fix field order to preserve service side field ordering (#13147) --- sdk/formrecognizer/azure-ai-formrecognizer/CHANGELOG.md | 2 ++ .../main/java/com/azure/ai/formrecognizer/Transforms.java | 5 +++-- .../ai/formrecognizer/FormRecognizerClientTestBase.java | 8 +++++--- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/CHANGELOG.md b/sdk/formrecognizer/azure-ai-formrecognizer/CHANGELOG.md index 11a6b1faf6d47..f5b4e9ff48ade 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/CHANGELOG.md +++ b/sdk/formrecognizer/azure-ai-formrecognizer/CHANGELOG.md @@ -2,6 +2,8 @@ ## 1.0.0-beta.5 (Unreleased) +### Key Bug Fixes +- Fixed `getFields()` to preserve service side ordering of fields. ## 1.0.0-beta.4 (2020-07-07) ### Breaking Changes diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/src/main/java/com/azure/ai/formrecognizer/Transforms.java b/sdk/formrecognizer/azure-ai-formrecognizer/src/main/java/com/azure/ai/formrecognizer/Transforms.java index 9ddbefa914a1d..354656ae3d337 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/src/main/java/com/azure/ai/formrecognizer/Transforms.java +++ b/sdk/formrecognizer/azure-ai-formrecognizer/src/main/java/com/azure/ai/formrecognizer/Transforms.java @@ -32,6 +32,7 @@ import java.time.format.DateTimeFormatter; import java.util.ArrayList; import java.util.Collections; +import java.util.LinkedHashMap; import java.util.List; import java.util.Map; import java.util.TreeMap; @@ -199,7 +200,7 @@ static List getReadResultFormLines(ReadResult readResultItem) { */ private static Map> getUnlabeledFieldMap(DocumentResult documentResultItem, List readResults, boolean includeFieldElements) { - Map> extractedFieldMap = new TreeMap<>(); + Map> extractedFieldMap = new LinkedHashMap<>(); // add receipt fields if (!CoreUtils.isNullOrEmpty(documentResultItem.getFields())) { documentResultItem.getFields().forEach((key, fieldValue) -> { @@ -367,7 +368,7 @@ private static FormPage getFormPage(ReadResult readResultItem, List p private static Map> getLabeledFieldMap(boolean includeFieldElements, List readResults, PageResult pageResultItem, Integer pageNumber) { - Map> formFieldMap = new TreeMap<>(); + Map> formFieldMap = new LinkedHashMap<>(); List keyValuePairs = pageResultItem.getKeyValuePairs(); forEachWithIndex(keyValuePairs, ((index, keyValuePair) -> { List formKeyContentList = null; diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/src/test/java/com/azure/ai/formrecognizer/FormRecognizerClientTestBase.java b/sdk/formrecognizer/azure-ai-formrecognizer/src/test/java/com/azure/ai/formrecognizer/FormRecognizerClientTestBase.java index 4fa322aff7449..b1023e6bdcfbb 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/src/test/java/com/azure/ai/formrecognizer/FormRecognizerClientTestBase.java +++ b/sdk/formrecognizer/azure-ai-formrecognizer/src/test/java/com/azure/ai/formrecognizer/FormRecognizerClientTestBase.java @@ -696,9 +696,10 @@ void beginTrainingMultipageRunner(Consumer testRunner) { private void validateUnLabeledResult(RecognizedForm actualForm, boolean includeFieldElements, List readResults, PageResult expectedPage) { validatePageRangeData(expectedPage.getPage(), actualForm.getFormPageRange()); - for (int i = 0; i < expectedPage.getKeyValuePairs().size(); i++) { - final KeyValuePair expectedFormField = expectedPage.getKeyValuePairs().get(i); - final FormField actualFormField = actualForm.getFields().get("field-" + i); + int i = 0; + for (Map.Entry> entry : actualForm.getFields().entrySet()) { + FormField actualFormField = entry.getValue(); + final KeyValuePair expectedFormField = expectedPage.getKeyValuePairs().get(i++); assertEquals(expectedFormField.getConfidence(), actualFormField.getConfidence()); assertEquals(expectedFormField.getKey().getText(), actualFormField.getLabelData().getText()); validateBoundingBoxData(expectedFormField.getKey().getBoundingBox(), @@ -720,6 +721,7 @@ private void validateLabeledData(RecognizedForm actualForm, boolean includeField assertEquals(documentResult.getPageRange().get(0), actualForm.getFormPageRange().getFirstPageNumber()); assertEquals(documentResult.getPageRange().get(1), actualForm.getFormPageRange().getLastPageNumber()); + assertEquals(documentResult.getFields().keySet(), actualForm.getFields().keySet()); documentResult.getFields().forEach((label, expectedFieldValue) -> { final FormField actualFormField = actualForm.getFields().get(label); assertEquals(label, actualFormField.getName()); From cd875c19ab39e82c3203184660e59077d88a0f7f Mon Sep 17 00:00:00 2001 From: Azure SDK Bot <53356347+azure-sdk@users.noreply.github.com> Date: Tue, 14 Jul 2020 15:16:51 -0700 Subject: [PATCH 112/129] Increment package version after release of com.azure azure-cosmos (#13149) --- eng/jacoco-test-coverage/pom.xml | 2 +- eng/versioning/version_client.txt | 2 +- sdk/cosmos/azure-cosmos-benchmark/pom.xml | 2 +- sdk/cosmos/azure-cosmos/CHANGELOG.md | 3 +++ sdk/cosmos/azure-cosmos/pom.xml | 2 +- 5 files changed, 7 insertions(+), 4 deletions(-) diff --git a/eng/jacoco-test-coverage/pom.xml b/eng/jacoco-test-coverage/pom.xml index b2c8e843b4403..88a63b14c44a7 100644 --- a/eng/jacoco-test-coverage/pom.xml +++ b/eng/jacoco-test-coverage/pom.xml @@ -109,7 +109,7 @@ com.azure azure-cosmos - 4.2.0 + 4.3.0-beta.1 com.azure diff --git a/eng/versioning/version_client.txt b/eng/versioning/version_client.txt index 322a6bc727b31..f01fead1e5042 100644 --- a/eng/versioning/version_client.txt +++ b/eng/versioning/version_client.txt @@ -19,7 +19,7 @@ com.azure:azure-core-serializer-json-gson;1.0.0-beta.1;1.0.0-beta.2 com.azure:azure-core-serializer-json-jackson;1.0.0-beta.1;1.0.0-beta.2 com.azure:azure-core-test;1.3.1;1.4.0-beta.1 com.azure:azure-core-tracing-opentelemetry;1.0.0-beta.5;1.0.0-beta.6 -com.azure:azure-cosmos;4.1.0;4.2.0 +com.azure:azure-cosmos;4.2.0;4.3.0-beta.1 com.azure:azure-cosmos-benchmark;4.0.1-beta.1;4.0.1-beta.1 com.azure:azure-data-appconfiguration;1.1.3;1.2.0-beta.1 com.azure:azure-data-schemaregistry;1.0.0-beta.2;1.0.0-beta.3 diff --git a/sdk/cosmos/azure-cosmos-benchmark/pom.xml b/sdk/cosmos/azure-cosmos-benchmark/pom.xml index 607609ca2fcce..38363860f0ac0 100644 --- a/sdk/cosmos/azure-cosmos-benchmark/pom.xml +++ b/sdk/cosmos/azure-cosmos-benchmark/pom.xml @@ -43,7 +43,7 @@ Licensed under the MIT License. com.azure azure-cosmos - 4.2.0 + 4.3.0-beta.1 diff --git a/sdk/cosmos/azure-cosmos/CHANGELOG.md b/sdk/cosmos/azure-cosmos/CHANGELOG.md index 10d2aac1d1337..a3ae24c7918cc 100644 --- a/sdk/cosmos/azure-cosmos/CHANGELOG.md +++ b/sdk/cosmos/azure-cosmos/CHANGELOG.md @@ -1,5 +1,8 @@ # Release History +## 4.3.0-beta.1 (Unreleased) + + ## 4.2.0 (2020-07-14) ### New Features * Added script logging enabled API to `CosmosStoredProcedureRequestOptions`. diff --git a/sdk/cosmos/azure-cosmos/pom.xml b/sdk/cosmos/azure-cosmos/pom.xml index d3d34b1769892..303fa14f63308 100644 --- a/sdk/cosmos/azure-cosmos/pom.xml +++ b/sdk/cosmos/azure-cosmos/pom.xml @@ -13,7 +13,7 @@ Licensed under the MIT License. com.azure azure-cosmos - 4.2.0 + 4.3.0-beta.1 Microsoft Azure SDK for SQL API of Azure Cosmos DB Service This Package contains Microsoft Azure Cosmos SDK (with Reactive Extension Reactor support) for Azure Cosmos DB SQL API jar From f3fdd21d4a710c2dbb305d5a19472f992375c80f Mon Sep 17 00:00:00 2001 From: Mitch Denny Date: Wed, 15 Jul 2020 13:11:07 +1000 Subject: [PATCH 113/129] Artifact grouping (#10564) * Artifact segregation (#10490) --- eng/jacoco-test-coverage/pom.xml | 2 +- .../templates/jobs/archetype-sdk-client.yml | 4 ++-- .../templates/steps/stage-artifacts.yml | 9 +++++++-- eng/versioning/version_client.txt | 2 +- sdk/template/azure-sdk-template/CHANGELOG.md | 17 ++++++++++++++++- sdk/template/azure-sdk-template/pom.xml | 2 +- 6 files changed, 28 insertions(+), 8 deletions(-) diff --git a/eng/jacoco-test-coverage/pom.xml b/eng/jacoco-test-coverage/pom.xml index 88a63b14c44a7..27a675955041c 100644 --- a/eng/jacoco-test-coverage/pom.xml +++ b/eng/jacoco-test-coverage/pom.xml @@ -225,7 +225,7 @@ com.azure azure-sdk-template - 1.0.4-beta.20 + 1.0.4-beta.25 diff --git a/eng/pipelines/templates/jobs/archetype-sdk-client.yml b/eng/pipelines/templates/jobs/archetype-sdk-client.yml index 23e1e2c3d3941..ef828b3ab10b2 100644 --- a/eng/pipelines/templates/jobs/archetype-sdk-client.yml +++ b/eng/pipelines/templates/jobs/archetype-sdk-client.yml @@ -107,8 +107,8 @@ jobs: displayName: 'Build and Package , JDK Version: $(JavaBuildVersion)' inputs: mavenPomFile: pom.xml - goals: 'package' - options: '$(DefaultOptions) "-DpackageOutputDirectory=$(Build.ArtifactStagingDirectory)" -DskipTests -Dinject-codesnippets -Dgenerate-overview -pl $(ProjectList) -am' # We include template-module so we ensure it always builds in CI + goals: 'deploy' + options: '$(DefaultOptions) -DskipTests -Dinject-codesnippets -Dgenerate-overview -Dspotbugs.skip=true -Dcheckstyle.skip=true -Drevapi.skip=true -pl $(ProjectList) -am -DaltDeploymentRepository=id::default::file://$(Build.ArtifactStagingDirectory)' # We include template-module so we ensure it always builds in CI mavenOptions: '$(MemoryOptions) $(LoggingOptions)' javaHomeOption: 'JDKVersion' jdkVersionOption: $(JavaBuildVersion) diff --git a/eng/pipelines/templates/steps/stage-artifacts.yml b/eng/pipelines/templates/steps/stage-artifacts.yml index 61929573655fa..129684dbd65aa 100644 --- a/eng/pipelines/templates/steps/stage-artifacts.yml +++ b/eng/pipelines/templates/steps/stage-artifacts.yml @@ -6,5 +6,10 @@ parameters: steps: - pwsh: | New-Item -Force -Type Directory -Name ${{parameters.TargetFolder}} -Path $(Pipeline.Workspace) - Copy-Item $(Pipeline.Workspace)/${{parameters.SourceFolder}}/${{parameters.PackageName}}-[0-9]*.[0-9]*.[0-9]* $(Pipeline.Workspace)/${{parameters.TargetFolder}} - displayName: Stage artifacts \ No newline at end of file + $items = Get-ChildItem -Recurse -Path $(Pipeline.Workspace)/${{parameters.SourceFolder}} + Write-Host "Found $($items.Count) total items in source folder" + $filteredItems = $items | Where-Object -FilterScript { $_.Name -like "${{parameters.PackageName}}-[0-9]*.[0-9]*.[0-9]*-*" } + Write-Host "Found $($filteredItems.Count) items which match filter criteria" + $filteredItems | Copy-Item -Destination $(Pipeline.Workspace)/${{parameters.TargetFolder}} + Get-ChildItem $(Pipeline.Workspace)/${{parameters.TargetFolder}} + displayName: Stage artifacts diff --git a/eng/versioning/version_client.txt b/eng/versioning/version_client.txt index f01fead1e5042..93d2bbdc12734 100644 --- a/eng/versioning/version_client.txt +++ b/eng/versioning/version_client.txt @@ -35,7 +35,7 @@ com.azure:azure-search-documents;11.0.0;11.1.0-beta.1 com.azure:azure-security-keyvault-certificates;4.0.4;4.1.0-beta.4 com.azure:azure-security-keyvault-keys;4.1.4;4.2.0-beta.5 com.azure:azure-security-keyvault-secrets;4.1.4;4.2.0-beta.4 -com.azure:azure-sdk-template;1.0.4-beta.19;1.0.4-beta.20 +com.azure:azure-sdk-template;1.0.4-beta.24;1.0.4-beta.25 com.azure:azure-spring-data-cosmos;3.0.0-beta.1;3.0.0-beta.1 com.azure:azure-storage-blob;12.8.0-beta.1;12.8.0-beta.2 com.azure:azure-storage-blob-batch;12.6.0-beta.1;12.6.0-beta.2 diff --git a/sdk/template/azure-sdk-template/CHANGELOG.md b/sdk/template/azure-sdk-template/CHANGELOG.md index aeecf4eeebd08..4ecf7ed2d7ff0 100644 --- a/sdk/template/azure-sdk-template/CHANGELOG.md +++ b/sdk/template/azure-sdk-template/CHANGELOG.md @@ -1,6 +1,21 @@ # Release History -## 1.0.4-beta.20 (Unreleased) +## 1.0.4-beta.25 (Unreleased) + +## 1.0.4-beta.24 (2020-07-13) +- Test Java Release Pipeline (normal docs, normal sources) + +## 1.0.4-beta.23 (2020-07-13) +- Test Java Release Pipeline (normal docs, normal sources) + +## 1.0.4-beta.22 (2020-07-13) +- Test Java Release Pipeline (normal docs, normal sources) + +## 1.0.4-beta.21 (2020-07-13) +- Test Java Release Pipeline (normal docs, normal sources) + +## 1.0.4-beta.20 (2020-07-13) +- Test Java Release Pipeline (normal docs, normal sources) ## 1.0.4-beta.19 (2020-05-20) - Test Java Release Pipeline (normal docs, normal sources) diff --git a/sdk/template/azure-sdk-template/pom.xml b/sdk/template/azure-sdk-template/pom.xml index a8087f8d000be..8e9f67f7e9b45 100644 --- a/sdk/template/azure-sdk-template/pom.xml +++ b/sdk/template/azure-sdk-template/pom.xml @@ -11,7 +11,7 @@ com.azure azure-sdk-template - 1.0.4-beta.20 + 1.0.4-beta.25 Microsoft Azure SDK for Template This package contains Microsoft Azure SDK for Template. From c15f392aacda50ffae18dfc9e5b402f49bb09644 Mon Sep 17 00:00:00 2001 From: Mitch Denny Date: Wed, 15 Jul 2020 13:41:05 +1000 Subject: [PATCH 114/129] Bump package versions for test release. (#13157) --- sdk/boms/azure-sdk-template-bom/CHANGELOG.md | 3 ++- sdk/template/azure-sdk-template/CHANGELOG.md | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/sdk/boms/azure-sdk-template-bom/CHANGELOG.md b/sdk/boms/azure-sdk-template-bom/CHANGELOG.md index cfac04f0b52e2..31b97f304c54e 100644 --- a/sdk/boms/azure-sdk-template-bom/CHANGELOG.md +++ b/sdk/boms/azure-sdk-template-bom/CHANGELOG.md @@ -1,7 +1,8 @@ # Release History -## 1.0.0-beta.5 (Unreleased) +## 1.0.0-beta.5 (2020-07-15) +- Release test 5 ## 1.0.0-beta.4 (2020-06-30) diff --git a/sdk/template/azure-sdk-template/CHANGELOG.md b/sdk/template/azure-sdk-template/CHANGELOG.md index 4ecf7ed2d7ff0..d4ce4c4b439d2 100644 --- a/sdk/template/azure-sdk-template/CHANGELOG.md +++ b/sdk/template/azure-sdk-template/CHANGELOG.md @@ -1,6 +1,7 @@ # Release History -## 1.0.4-beta.25 (Unreleased) +## 1.0.4-beta.25 (2020-07-15) +- Test Java Release Pipeline (normal docs, normal sources) ## 1.0.4-beta.24 (2020-07-13) - Test Java Release Pipeline (normal docs, normal sources) From 67046783a57dbec6cb763d47a80336b054800ffc Mon Sep 17 00:00:00 2001 From: Weidong Xu Date: Wed, 15 Jul 2020 15:22:34 +0800 Subject: [PATCH 115/129] mgmt doc on LRO beginCreate/beginDelete (#12899) * support beginCreate beginDelete for GenericResource * use generic type * doc (preview) for LRO * Update README.md * rename to getActivationResponse --- .../implementation/VirtualMachineImpl.java | 2 +- .../VirtualMachineOperationsTests.java | 18 +- sdk/management/README.md | 3 + sdk/management/docs/DESIGN_PREVIEW.md | 54 ++++ .../resources/fluentcore/model/Accepted.java | 6 +- .../model/implementation/AcceptedImpl.java | 2 +- .../CreatableUpdatableImpl.java | 10 +- .../implementation/DeploymentImpl.java | 2 +- .../implementation/DeploymentsImpl.java | 1 - .../implementation/GenericResourceImpl.java | 98 +++++-- .../implementation/GenericResourcesImpl.java | 25 +- .../resources/models/GenericResource.java | 8 + .../resources/models/GenericResources.java | 9 + .../resources/DeploymentsTests.java | 32 +-- .../resources/GenericResourcesTests.java | 54 ++++ .../canCreateDeleteResourceSyncPoll.json | 251 ++++++++++++++++++ 16 files changed, 511 insertions(+), 64 deletions(-) create mode 100644 sdk/management/docs/DESIGN_PREVIEW.md create mode 100644 sdk/resources/mgmt/src/test/resources/session-records/canCreateDeleteResourceSyncPoll.json diff --git a/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/implementation/VirtualMachineImpl.java b/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/implementation/VirtualMachineImpl.java index 35b9f795dd503..a65c2eea6715c 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/implementation/VirtualMachineImpl.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/implementation/VirtualMachineImpl.java @@ -1786,7 +1786,7 @@ public Accepted beginCreate() { inner -> new VirtualMachineImpl(inner.name(), inner, this.manager(), this.storageManager, this.networkManager, this.authorizationManager)); - reset(accepted.getAcceptedResult().getValue().inner()); + reset(accepted.getActivationResponse().getValue().inner()); return accepted; } } diff --git a/sdk/compute/mgmt/src/test/java/com/azure/resourcemanager/compute/VirtualMachineOperationsTests.java b/sdk/compute/mgmt/src/test/java/com/azure/resourcemanager/compute/VirtualMachineOperationsTests.java index e1f36bef08b93..1bf08a91f2754 100644 --- a/sdk/compute/mgmt/src/test/java/com/azure/resourcemanager/compute/VirtualMachineOperationsTests.java +++ b/sdk/compute/mgmt/src/test/java/com/azure/resourcemanager/compute/VirtualMachineOperationsTests.java @@ -211,17 +211,17 @@ public void canCreateVirtualMachineSyncPoll() throws Exception { .withOSDiskName("javatest") .withLicenseType("Windows_Server") .beginCreate(); - VirtualMachine createdVirtualMachine = acceptedVirtualMachine.getAcceptedResult().getValue(); + VirtualMachine createdVirtualMachine = acceptedVirtualMachine.getActivationResponse().getValue(); Assertions.assertNotEquals("Succeeded", createdVirtualMachine.provisioningState()); - LongRunningOperationStatus pollStatus = acceptedVirtualMachine.getAcceptedResult().getStatus(); - int delayInMills = acceptedVirtualMachine.getAcceptedResult().getRetryAfter() == null + LongRunningOperationStatus pollStatus = acceptedVirtualMachine.getActivationResponse().getStatus(); + int delayInMills = acceptedVirtualMachine.getActivationResponse().getRetryAfter() == null ? 0 - : (int) acceptedVirtualMachine.getAcceptedResult().getRetryAfter().toMillis(); + : (int) acceptedVirtualMachine.getActivationResponse().getRetryAfter().toMillis(); while (!pollStatus.isComplete()) { SdkContext.sleep(delayInMills); - PollResponse pollResponse = acceptedVirtualMachine.getSyncPoller().poll(); + PollResponse pollResponse = acceptedVirtualMachine.getSyncPoller().poll(); pollStatus = pollResponse.getStatus(); delayInMills = pollResponse.getRetryAfter() == null ? 10000 @@ -234,15 +234,15 @@ public void canCreateVirtualMachineSyncPoll() throws Exception { Accepted acceptedDelete = computeManager.virtualMachines() .beginDeleteByResourceGroup(virtualMachine.resourceGroupName(), virtualMachine.name()); - pollStatus = acceptedDelete.getAcceptedResult().getStatus(); - delayInMills = acceptedDelete.getAcceptedResult().getRetryAfter() == null + pollStatus = acceptedDelete.getActivationResponse().getStatus(); + delayInMills = acceptedDelete.getActivationResponse().getRetryAfter() == null ? 0 - : (int) acceptedDelete.getAcceptedResult().getRetryAfter().toMillis(); + : (int) acceptedDelete.getActivationResponse().getRetryAfter().toMillis(); while (!pollStatus.isComplete()) { SdkContext.sleep(delayInMills); - PollResponse pollResponse = acceptedDelete.getSyncPoller().poll(); + PollResponse pollResponse = acceptedDelete.getSyncPoller().poll(); pollStatus = pollResponse.getStatus(); delayInMills = pollResponse.getRetryAfter() == null ? 10000 diff --git a/sdk/management/README.md b/sdk/management/README.md index 647a346676d1b..4de42fe746d28 100644 --- a/sdk/management/README.md +++ b/sdk/management/README.md @@ -103,6 +103,8 @@ The key concepts of Azure Management Libraries includes: - Integration with Azure role-based access control. - Asynchronous operations with [Reactor][reactor]. (Preview) - Configurable client, e.g. configuring HTTP client, retries, logging, etc. +- [API design][design] +- [API design (preview)][design_preview] ### Service features @@ -325,4 +327,5 @@ If you would like to become an active contributor to this project please follow [authenticate]: docs/AUTH.md [sample]: docs/SAMPLE.md [design]: docs/DESIGN.md +[design_preview]: docs/DESIGN_PREVIEW.md [reactor]: https://projectreactor.io/ diff --git a/sdk/management/docs/DESIGN_PREVIEW.md b/sdk/management/docs/DESIGN_PREVIEW.md new file mode 100644 index 0000000000000..cdb7bd7cb5a92 --- /dev/null +++ b/sdk/management/docs/DESIGN_PREVIEW.md @@ -0,0 +1,54 @@ +# Design for Azure Management Libraries for Java (Preview) + +## Fluent interface + +### Fine control over long-running operation + +Resource provision takes time, a typical solution adopted by Azure services is the [long-running operation (LRO)][lro]. + +Fluent interface does the polling operations in background, and only returns the final result. + +Azure Management Libraries supports fine control over the polling for certain important resources, via `Accepted` and `SyncPoller` class. Method verb is `beginCreate` and `beginDelete`. + +`Accepted` class provides following functionalities: +- `ActivationResponse` via `getActivationResponse` method provides the response of the first activation operation. Note that though it wraps a resource instance, some action on this resource instance will not work, since it is not provisioned yet. +- `SyncPoller` via `getSyncPoller` method provides the control of the polling operations. `SyncPoller.poll` can be called at desired time. +- Resource instance via `getFinalResult` method, after completion of the polling operations. The method will throw `ManagementException` if polling failed and resource cannot be provisioned. + +Here is sample code for Deployment. + +```java +// begin provision +Accepted acceptedDeployment = azure.deployments() + .define(name) + ... + .beginCreate(); +Deployment provisioningDeployment = acceptedDeployment.getAcceptedResult().getValue(); + +LongRunningOperationStatus pollStatus = acceptedDeployment.getAcceptedResult().getStatus(); +int delayInMills = acceptedDeployment.getAcceptedResult().getRetryAfter() == null + ? 0 + : (int) acceptedDeployment.getAcceptedResult().getRetryAfter().toMillis(); +while (!pollStatus.isComplete()) { + Thread.sleep(delayInMills); + + // poll + PollResponse pollResponse = acceptedDeployment.getSyncPoller().poll(); + pollStatus = pollResponse.getStatus(); + delayInMills = pollResponse.getRetryAfter() == null + ? DEFAULT_DELAY_IN_MILLIS + : (int) pollResponse.getRetryAfter().toMillis(); +} +// pollStatus == LongRunningOperationStatus.SUCCESSFULLY_COMPLETED, if successful + +// final result +Deployment deployment = acceptedDeployment.getFinalResult(); +``` + +Supported Azure resources: +- `delete` for `ResourceGroup` +- `create` for `Deployment` +- `create` and `delete` for `GenericResource` +- `create` and `delete` for `VirtualMachine` + +[lro]: https://docs.microsoft.com/en-us/azure/architecture/patterns/async-request-reply diff --git a/sdk/resources/mgmt/src/main/java/com/azure/resourcemanager/resources/fluentcore/model/Accepted.java b/sdk/resources/mgmt/src/main/java/com/azure/resourcemanager/resources/fluentcore/model/Accepted.java index 2f909b5e18f27..44fbfed5b345b 100644 --- a/sdk/resources/mgmt/src/main/java/com/azure/resourcemanager/resources/fluentcore/model/Accepted.java +++ b/sdk/resources/mgmt/src/main/java/com/azure/resourcemanager/resources/fluentcore/model/Accepted.java @@ -14,11 +14,11 @@ public interface Accepted { /** - * Gets the accepted result of LRO. + * Gets the activation response of LRO. * - * @return the accepted result + * @return the activation response */ - ActivationResponse getAcceptedResult(); + ActivationResponse getActivationResponse(); /** * Gets the {@link SyncPoller} of LRO. diff --git a/sdk/resources/mgmt/src/main/java/com/azure/resourcemanager/resources/fluentcore/model/implementation/AcceptedImpl.java b/sdk/resources/mgmt/src/main/java/com/azure/resourcemanager/resources/fluentcore/model/implementation/AcceptedImpl.java index c56eac46a50fb..65254bcf2eaee 100644 --- a/sdk/resources/mgmt/src/main/java/com/azure/resourcemanager/resources/fluentcore/model/implementation/AcceptedImpl.java +++ b/sdk/resources/mgmt/src/main/java/com/azure/resourcemanager/resources/fluentcore/model/implementation/AcceptedImpl.java @@ -63,7 +63,7 @@ public AcceptedImpl(Response> activationResponse, } @Override - public ActivationResponse getAcceptedResult() { + public ActivationResponse getActivationResponse() { try { T value = wrapOperation.apply(serializerAdapter.deserialize( new String(getResponse(), StandardCharsets.UTF_8), diff --git a/sdk/resources/mgmt/src/main/java/com/azure/resourcemanager/resources/fluentcore/model/implementation/CreatableUpdatableImpl.java b/sdk/resources/mgmt/src/main/java/com/azure/resourcemanager/resources/fluentcore/model/implementation/CreatableUpdatableImpl.java index d214c79511d99..76f32c74bbd65 100644 --- a/sdk/resources/mgmt/src/main/java/com/azure/resourcemanager/resources/fluentcore/model/implementation/CreatableUpdatableImpl.java +++ b/sdk/resources/mgmt/src/main/java/com/azure/resourcemanager/resources/fluentcore/model/implementation/CreatableUpdatableImpl.java @@ -269,13 +269,11 @@ protected T taskResult(String key) { } } + @SuppressWarnings("unchecked") protected Function innerToFluentMap(final FluentModelImplT fluentModelImplT) { - return new Function() { - @Override - public FluentModelT apply(InnerModelT innerModel) { - fluentModelImplT.setInner(innerModel); - return (FluentModelT) fluentModelImplT; - } + return innerModel -> { + fluentModelImplT.setInner(innerModel); + return (FluentModelT) fluentModelImplT; }; } diff --git a/sdk/resources/mgmt/src/main/java/com/azure/resourcemanager/resources/implementation/DeploymentImpl.java b/sdk/resources/mgmt/src/main/java/com/azure/resourcemanager/resources/implementation/DeploymentImpl.java index 1a34f2caa37db..8da188cfef7de 100644 --- a/sdk/resources/mgmt/src/main/java/com/azure/resourcemanager/resources/implementation/DeploymentImpl.java +++ b/sdk/resources/mgmt/src/main/java/com/azure/resourcemanager/resources/implementation/DeploymentImpl.java @@ -325,7 +325,7 @@ public Accepted beginCreate() { DeploymentExtendedInner.class, inner -> new DeploymentImpl(inner, inner.name(), resourceManager)); - setInner(accepted.getAcceptedResult().getValue().inner()); + setInner(accepted.getActivationResponse().getValue().inner()); return accepted; } } diff --git a/sdk/resources/mgmt/src/main/java/com/azure/resourcemanager/resources/implementation/DeploymentsImpl.java b/sdk/resources/mgmt/src/main/java/com/azure/resourcemanager/resources/implementation/DeploymentsImpl.java index 5b36dc61b8296..3d8321324e141 100644 --- a/sdk/resources/mgmt/src/main/java/com/azure/resourcemanager/resources/implementation/DeploymentsImpl.java +++ b/sdk/resources/mgmt/src/main/java/com/azure/resourcemanager/resources/implementation/DeploymentsImpl.java @@ -106,7 +106,6 @@ public void deleteById(String id) { deleteByIdAsync(id).block(); } - @Override public Mono deleteByIdAsync(String id) { return deleteByResourceGroupAsync(ResourceUtils.groupFromResourceId(id), ResourceUtils.nameFromResourceId(id)); diff --git a/sdk/resources/mgmt/src/main/java/com/azure/resourcemanager/resources/implementation/GenericResourceImpl.java b/sdk/resources/mgmt/src/main/java/com/azure/resourcemanager/resources/implementation/GenericResourceImpl.java index 07f5cb58b3111..251ea7d1b90e5 100644 --- a/sdk/resources/mgmt/src/main/java/com/azure/resourcemanager/resources/implementation/GenericResourceImpl.java +++ b/sdk/resources/mgmt/src/main/java/com/azure/resourcemanager/resources/implementation/GenericResourceImpl.java @@ -3,7 +3,11 @@ package com.azure.resourcemanager.resources.implementation; +import com.azure.core.http.rest.Response; +import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.resources.ResourceManager; +import com.azure.resourcemanager.resources.fluentcore.model.Accepted; +import com.azure.resourcemanager.resources.fluentcore.model.implementation.AcceptedImpl; import com.azure.resourcemanager.resources.models.GenericResource; import com.azure.resourcemanager.resources.models.Plan; import com.azure.resourcemanager.resources.fluentcore.arm.ResourceUtils; @@ -12,8 +16,11 @@ import com.azure.resourcemanager.resources.fluent.inner.GenericResourceInner; import com.azure.resourcemanager.resources.ResourceManagementClient; import com.azure.resourcemanager.resources.fluent.ResourcesClient; +import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; +import java.nio.ByteBuffer; + /** * The implementation for GenericResource and its nested interfaces. */ @@ -28,6 +35,9 @@ final class GenericResourceImpl GenericResource.Definition, GenericResource.UpdateStages.WithApiVersion, GenericResource.Update { + + private final ClientLogger logger = new ClientLogger(GenericResourceImpl.class); + private String resourceProviderNamespace; private String parentResourcePath; private String resourceType; @@ -140,33 +150,44 @@ public GenericResourceImpl withApiVersion(String apiVersion) { return this; } - // CreateUpdateTaskGroup.ResourceCreator implementation @Override - public Mono createResourceAsync() { - final GenericResourceImpl self = this; - Mono observable = null; - if (apiVersion != null) { - observable = Mono.just(apiVersion); + public Accepted beginCreate() { + String apiVersion = this.getApiVersionAsync().block(); + + String name = this.name(); + if (!isInCreateMode()) { + name = ResourceUtils.nameFromResourceId(inner().id()); + } + + Response> activationResponse = this.manager().inner().getResources() + .createOrUpdateWithResponseAsync( + resourceGroupName(), + resourceProviderNamespace, + parentResourcePath(), + resourceType, + name, + apiVersion, + inner()).block(); + if (activationResponse == null) { + throw logger.logExceptionAsError(new NullPointerException()); } else { - final ResourceManagementClient serviceClient = this.manager().inner(); - observable = this.manager().providers().getByNameAsync(resourceProviderNamespace) - .flatMap(provider -> { - String id; - if (!isInCreateMode()) { - id = inner().id(); - } else { - id = ResourceUtils.constructResourceId( - serviceClient.getSubscriptionId(), - resourceGroupName(), - resourceProviderNamespace(), - resourceType(), - this.name(), - parentResourcePath()); - } - self.apiVersion = ResourceUtils.defaultApiVersion(id, provider); - return Mono.just(self.apiVersion); - }); + Accepted accepted = new AcceptedImpl( + activationResponse, + this.manager().inner().getSerializerAdapter(), + this.manager().inner().getHttpPipeline(), + GenericResourceInner.class, + GenericResourceInner.class, + inner -> new GenericResourceImpl(inner.id(), inner, this.manager())); + + setInner(accepted.getActivationResponse().getValue().inner()); + return accepted; } + } + + // CreateUpdateTaskGroup.ResourceCreator implementation + @Override + public Mono createResourceAsync() { + Mono observable = this.getApiVersionAsync(); final ResourcesClient resourceClient = this.manager().inner().getResources(); return observable .flatMap(api -> { @@ -183,7 +204,34 @@ public Mono createResourceAsync() { api, inner()) .subscribeOn(SdkContext.getReactorScheduler()) - .map(innerToFluentMap(self)); + .map(innerToFluentMap(this)); }); } + + private Mono getApiVersionAsync() { + Mono apiVersion; + if (this.apiVersion != null) { + apiVersion = Mono.just(this.apiVersion); + } else { + final ResourceManagementClient serviceClient = this.manager().inner(); + apiVersion = this.manager().providers().getByNameAsync(resourceProviderNamespace) + .flatMap(provider -> { + String id; + if (!isInCreateMode()) { + id = inner().id(); + } else { + id = ResourceUtils.constructResourceId( + serviceClient.getSubscriptionId(), + resourceGroupName(), + resourceProviderNamespace(), + resourceType(), + this.name(), + parentResourcePath()); + } + this.apiVersion = ResourceUtils.defaultApiVersion(id, provider); + return Mono.just(this.apiVersion); + }); + } + return apiVersion; + } } diff --git a/sdk/resources/mgmt/src/main/java/com/azure/resourcemanager/resources/implementation/GenericResourcesImpl.java b/sdk/resources/mgmt/src/main/java/com/azure/resourcemanager/resources/implementation/GenericResourcesImpl.java index d49f6fa7c3346..0e4228c610bd2 100644 --- a/sdk/resources/mgmt/src/main/java/com/azure/resourcemanager/resources/implementation/GenericResourcesImpl.java +++ b/sdk/resources/mgmt/src/main/java/com/azure/resourcemanager/resources/implementation/GenericResourcesImpl.java @@ -5,8 +5,11 @@ import com.azure.core.http.rest.PagedFlux; import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.resources.ResourceManager; +import com.azure.resourcemanager.resources.fluentcore.model.Accepted; +import com.azure.resourcemanager.resources.fluentcore.model.implementation.AcceptedImpl; import com.azure.resourcemanager.resources.models.GenericResource; import com.azure.resourcemanager.resources.models.GenericResources; import com.azure.resourcemanager.resources.models.ResourceGroup; @@ -17,9 +20,12 @@ import com.azure.resourcemanager.resources.fluentcore.utils.Utils; import com.azure.resourcemanager.resources.fluent.inner.GenericResourceInner; import com.azure.resourcemanager.resources.fluent.ResourcesClient; +import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; +import java.nio.ByteBuffer; import java.util.List; +import java.util.function.Function; /** * Implementation of the {@link GenericResources}. @@ -179,7 +185,6 @@ public Mono deleteAsync(String resourceGroupName, String resourceProviderN parentResourcePath, resourceType, resourceName, apiVersion); } - @Override protected GenericResourceImpl wrapModel(String id) { return new GenericResourceImpl(id, new GenericResourceInner(), this.manager()) @@ -222,6 +227,24 @@ public Mono deleteByIdAsync(final String id) { .flatMap(apiVersion -> inner.deleteByIdAsync(id, apiVersion)); } + @Override + public Accepted beginDeleteById(String id) { + String apiVersion = getApiVersionFromId(id).block(); + + Response> activationResponse = this.inner() + .deleteByIdWithResponseAsync(id, apiVersion).block(); + if (activationResponse == null) { + throw logger.logExceptionAsError(new NullPointerException()); + } else { + return new AcceptedImpl(activationResponse, + manager().inner().getSerializerAdapter(), + manager().inner().getHttpPipeline(), + Void.class, + Void.class, + Function.identity()); + } + } + private Mono getApiVersionFromId(final String id) { return this.manager().providers().getByNameAsync(ResourceUtils.resourceProviderFromResourceId(id)) .map(provider -> ResourceUtils.defaultApiVersion(id, provider)); diff --git a/sdk/resources/mgmt/src/main/java/com/azure/resourcemanager/resources/models/GenericResource.java b/sdk/resources/mgmt/src/main/java/com/azure/resourcemanager/resources/models/GenericResource.java index 71b0ae9e33879..54a5753e0cb0a 100644 --- a/sdk/resources/mgmt/src/main/java/com/azure/resourcemanager/resources/models/GenericResource.java +++ b/sdk/resources/mgmt/src/main/java/com/azure/resourcemanager/resources/models/GenericResource.java @@ -6,6 +6,7 @@ import com.azure.core.annotation.Fluent; import com.azure.resourcemanager.resources.fluentcore.arm.models.GroupableResource; import com.azure.resourcemanager.resources.fluentcore.arm.models.Resource; +import com.azure.resourcemanager.resources.fluentcore.model.Accepted; import com.azure.resourcemanager.resources.fluentcore.model.Appliable; import com.azure.resourcemanager.resources.fluentcore.model.Creatable; import com.azure.resourcemanager.resources.fluentcore.model.Refreshable; @@ -181,6 +182,13 @@ interface WithCreate extends * @return the next stage of generic resource definition */ WithCreate withProperties(Object properties); + + /** + * Begins creating the Azure resource. + * + * @return the accepted create operation + */ + Accepted beginCreate(); } } diff --git a/sdk/resources/mgmt/src/main/java/com/azure/resourcemanager/resources/models/GenericResources.java b/sdk/resources/mgmt/src/main/java/com/azure/resourcemanager/resources/models/GenericResources.java index cd0b58bc0a44d..68a89e1f37294 100644 --- a/sdk/resources/mgmt/src/main/java/com/azure/resourcemanager/resources/models/GenericResources.java +++ b/sdk/resources/mgmt/src/main/java/com/azure/resourcemanager/resources/models/GenericResources.java @@ -12,6 +12,7 @@ import com.azure.resourcemanager.resources.fluentcore.collection.SupportsDeletingById; import com.azure.resourcemanager.resources.fluentcore.collection.SupportsListing; import com.azure.resourcemanager.resources.ResourceManager; +import com.azure.resourcemanager.resources.fluentcore.model.Accepted; import reactor.core.publisher.Mono; import java.util.List; @@ -136,4 +137,12 @@ void delete(String resourceGroupName, String resourceProviderNamespace, */ Mono deleteAsync(String resourceGroupName, String resourceProviderNamespace, String parentResourcePath, String resourceType, String resourceName, String apiVersion); + + /** + * Begins deleting a resource from Azure, identifying it by its resource ID. + * + * @param id the resource ID of the resource to delete + * @return the accepted deleting operation + */ + Accepted beginDeleteById(String id); } diff --git a/sdk/resources/mgmt/src/test/java/com/azure/resourcemanager/resources/DeploymentsTests.java b/sdk/resources/mgmt/src/test/java/com/azure/resourcemanager/resources/DeploymentsTests.java index 5213aa76befa8..c65cf85461370 100644 --- a/sdk/resources/mgmt/src/test/java/com/azure/resourcemanager/resources/DeploymentsTests.java +++ b/sdk/resources/mgmt/src/test/java/com/azure/resourcemanager/resources/DeploymentsTests.java @@ -212,7 +212,7 @@ public void canUpdateVirtualNetworkDeployment() throws Exception { .withParametersLink(parametersUri, contentVersion) .withMode(DeploymentMode.COMPLETE) .beginCreate(); - Deployment createdDeployment = acceptedDeployment.getAcceptedResult().getValue(); + Deployment createdDeployment = acceptedDeployment.getActivationResponse().getValue(); Deployment deployment = resourceClient.deployments().getByResourceGroup(rgName, dp); Assertions.assertEquals(createdDeployment.correlationId(), deployment.correlationId()); Assertions.assertEquals(dp, deployment.name()); @@ -246,17 +246,17 @@ public void canDeployVirtualNetworkSyncPoll() throws Exception { .withParametersLink(parametersUri, contentVersion) .withMode(DeploymentMode.COMPLETE) .beginCreate(); - Deployment createdDeployment = acceptedDeployment.getAcceptedResult().getValue(); + Deployment createdDeployment = acceptedDeployment.getActivationResponse().getValue(); Assertions.assertNotEquals("Succeeded", createdDeployment.provisioningState()); - LongRunningOperationStatus pollStatus = acceptedDeployment.getAcceptedResult().getStatus(); - int delayInMills = acceptedDeployment.getAcceptedResult().getRetryAfter() == null + LongRunningOperationStatus pollStatus = acceptedDeployment.getActivationResponse().getStatus(); + int delayInMills = acceptedDeployment.getActivationResponse().getRetryAfter() == null ? 0 - : (int) acceptedDeployment.getAcceptedResult().getRetryAfter().toMillis(); + : (int) acceptedDeployment.getActivationResponse().getRetryAfter().toMillis(); while (!pollStatus.isComplete()) { SdkContext.sleep(delayInMills); - PollResponse pollResponse = acceptedDeployment.getSyncPoller().poll(); + PollResponse pollResponse = acceptedDeployment.getSyncPoller().poll(); pollStatus = pollResponse.getStatus(); delayInMills = pollResponse.getRetryAfter() == null ? 10000 @@ -280,17 +280,17 @@ public void canDeployVirtualNetworkSyncPollWithFailure() throws Exception { .withParameters("{}") .withMode(DeploymentMode.COMPLETE) .beginCreate(); - Deployment createdDeployment = acceptedDeployment.getAcceptedResult().getValue(); + Deployment createdDeployment = acceptedDeployment.getActivationResponse().getValue(); Assertions.assertNotEquals("Succeeded", createdDeployment.provisioningState()); - LongRunningOperationStatus pollStatus = acceptedDeployment.getAcceptedResult().getStatus(); - int delayInMills = acceptedDeployment.getAcceptedResult().getRetryAfter() == null + LongRunningOperationStatus pollStatus = acceptedDeployment.getActivationResponse().getStatus(); + int delayInMills = acceptedDeployment.getActivationResponse().getRetryAfter() == null ? 0 - : (int) acceptedDeployment.getAcceptedResult().getRetryAfter().toMillis(); + : (int) acceptedDeployment.getActivationResponse().getRetryAfter().toMillis(); while (!pollStatus.isComplete()) { SdkContext.sleep(delayInMills); - PollResponse pollResponse = acceptedDeployment.getSyncPoller().poll(); + PollResponse pollResponse = acceptedDeployment.getSyncPoller().poll(); pollStatus = pollResponse.getStatus(); delayInMills = pollResponse.getRetryAfter() == null ? 10000 @@ -312,17 +312,17 @@ public void canDeployVirtualNetworkSyncPollWithFailure() throws Exception { .withParameters("{}") .withMode(DeploymentMode.COMPLETE) .beginCreate(); - createdDeployment = acceptedDeployment.getAcceptedResult().getValue(); + createdDeployment = acceptedDeployment.getActivationResponse().getValue(); Assertions.assertNotEquals("Succeeded", createdDeployment.provisioningState()); - pollStatus = acceptedDeployment.getAcceptedResult().getStatus(); - delayInMills = acceptedDeployment.getAcceptedResult().getRetryAfter() == null + pollStatus = acceptedDeployment.getActivationResponse().getStatus(); + delayInMills = acceptedDeployment.getActivationResponse().getRetryAfter() == null ? 0 - : (int) acceptedDeployment.getAcceptedResult().getRetryAfter().toMillis(); + : (int) acceptedDeployment.getActivationResponse().getRetryAfter().toMillis(); while (!pollStatus.isComplete()) { SdkContext.sleep(delayInMills); - PollResponse pollResponse = acceptedDeployment.getSyncPoller().poll(); + PollResponse pollResponse = acceptedDeployment.getSyncPoller().poll(); pollStatus = pollResponse.getStatus(); delayInMills = pollResponse.getRetryAfter() == null ? 10000 diff --git a/sdk/resources/mgmt/src/test/java/com/azure/resourcemanager/resources/GenericResourcesTests.java b/sdk/resources/mgmt/src/test/java/com/azure/resourcemanager/resources/GenericResourcesTests.java index fbdd7d8b18a32..bc5a4fd92d3dc 100644 --- a/sdk/resources/mgmt/src/test/java/com/azure/resourcemanager/resources/GenericResourcesTests.java +++ b/sdk/resources/mgmt/src/test/java/com/azure/resourcemanager/resources/GenericResourcesTests.java @@ -5,8 +5,14 @@ import com.azure.core.http.HttpPipeline; import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.polling.LongRunningOperationStatus; +import com.azure.core.util.polling.PollResponse; +import com.azure.resourcemanager.resources.fluent.inner.GenericResourceExpandedInner; import com.azure.resourcemanager.resources.fluentcore.arm.Region; +import com.azure.resourcemanager.resources.fluentcore.arm.ResourceUtils; +import com.azure.resourcemanager.resources.fluentcore.model.Accepted; import com.azure.resourcemanager.resources.fluentcore.profile.AzureProfile; +import com.azure.resourcemanager.resources.fluentcore.utils.SdkContext; import com.azure.resourcemanager.resources.models.GenericResource; import com.azure.resourcemanager.resources.models.GenericResources; import com.azure.resourcemanager.resources.models.ResourceGroups; @@ -15,6 +21,7 @@ import org.junit.jupiter.api.Test; import java.util.Arrays; +import java.util.Optional; public class GenericResourcesTests extends ResourceManagerTestBase { private ResourceGroups resourceGroups; @@ -87,4 +94,51 @@ public void canCreateUpdateMoveResource() throws Exception { Assertions.assertFalse(genericResources.checkExistence(newRgName, resource.resourceProviderNamespace(), resource.parentResourcePath(), resource.resourceType(), resource.name(), resource.apiVersion())); Assertions.assertFalse(genericResources.checkExistenceById(resource.id())); } + + @Test + public void canCreateDeleteResourceSyncPoll() throws Exception { + final String resourceName = "rs" + testId; + // Create + Accepted acceptedResource = genericResources.define(resourceName) + .withRegion(Region.US_SOUTH_CENTRAL) + .withExistingResourceGroup(rgName) + .withResourceType("sites") + .withProviderNamespace("Microsoft.Web") + .withoutPlan() + .withParentResourcePath("") + .withProperties(new ObjectMapper().readTree("{\"SiteMode\":\"Limited\",\"ComputeMode\":\"Shared\"}")) + .beginCreate(); + + LongRunningOperationStatus pollStatus = acceptedResource.getActivationResponse().getStatus(); + int delayInMills = acceptedResource.getActivationResponse().getRetryAfter() == null + ? 0 + : (int) acceptedResource.getActivationResponse().getRetryAfter().toMillis(); + while (!pollStatus.isComplete()) { + SdkContext.sleep(delayInMills); + + PollResponse pollResponse = acceptedResource.getSyncPoller().poll(); + pollStatus = pollResponse.getStatus(); + delayInMills = pollResponse.getRetryAfter() == null + ? 10000 + : (int) pollResponse.getRetryAfter().toMillis(); + } + Assertions.assertEquals(LongRunningOperationStatus.SUCCESSFULLY_COMPLETED, pollStatus); + GenericResource resource = acceptedResource.getFinalResult(); + Assertions.assertNotNull(resource.id()); + Assertions.assertEquals(resourceName, ResourceUtils.nameFromResourceId(resource.id())); + + PagedIterable resources = + genericResources.manager().inner().getResources() + .listByResourceGroup(rgName, null, "provisioningState", null); + Optional resourceOpt + = resources.stream().filter(r -> resourceName.equals(r.name())).findFirst(); + Assertions.assertTrue(resourceOpt.isPresent()); + Assertions.assertEquals("Succeeded", resourceOpt.get().provisioningState()); + + Accepted acceptedDelete = genericResources.beginDeleteById(resource.id()); + acceptedDelete.getFinalResult(); + PagedIterable resourcesAfterDelete = genericResources.listByResourceGroup(rgName); + boolean deleted = resourcesAfterDelete.stream().noneMatch(r -> resourceName.equals(r.name())); + Assertions.assertTrue(deleted); + } } diff --git a/sdk/resources/mgmt/src/test/resources/session-records/canCreateDeleteResourceSyncPoll.json b/sdk/resources/mgmt/src/test/resources/session-records/canCreateDeleteResourceSyncPoll.json new file mode 100644 index 0000000000000..215f202c1abae --- /dev/null +++ b/sdk/resources/mgmt/src/test/resources/session-records/canCreateDeleteResourceSyncPoll.json @@ -0,0 +1,251 @@ +{ + "networkCallRecords" : [ { + "Method" : "PUT", + "Uri" : "http://localhost:1234/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg72b81582?api-version=2019-08-01", + "Headers" : { + "User-Agent" : "azsdk-java-com.azure.resourcemanager.resources/2.0.0-SNAPSHOT (14.0.1; Windows 10 10.0)", + "Content-Type" : "application/json" + }, + "Response" : { + "date" : "Wed, 08 Jul 2020 03:28:55 GMT", + "content-length" : "307", + "expires" : "-1", + "x-ms-ratelimit-remaining-subscription-writes" : "1199", + "retry-after" : "0", + "StatusCode" : "201", + "strict-transport-security" : "max-age=31536000; includeSubDomains", + "pragma" : "no-cache", + "x-ms-correlation-request-id" : "0e8545dc-c82d-4a75-a6e0-ea4fa86a86ab", + "x-content-type-options" : "nosniff", + "x-ms-routing-request-id" : "SOUTHEASTASIA:20200708T032855Z:0e8545dc-c82d-4a75-a6e0-ea4fa86a86ab", + "content-type" : "application/json; charset=utf-8", + "cache-control" : "no-cache", + "x-ms-request-id" : "0e8545dc-c82d-4a75-a6e0-ea4fa86a86ab", + "Body" : "{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg72b81582\",\"name\":\"rg72b81582\",\"type\":\"Microsoft.Resources/resourceGroups\",\"location\":\"eastus\",\"tags\":{\"date\":\"2020-07-08T03:28:51.783595400Z\",\"product\":\"javasdk\",\"cause\":\"automation\"},\"properties\":{\"provisioningState\":\"Succeeded\"}}" + } + }, { + "Method" : "PUT", + "Uri" : "http://localhost:1234/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rgB72b81582?api-version=2019-08-01", + "Headers" : { + "User-Agent" : "azsdk-java-com.azure.resourcemanager.resources/2.0.0-SNAPSHOT (14.0.1; Windows 10 10.0)", + "Content-Type" : "application/json" + }, + "Response" : { + "date" : "Wed, 08 Jul 2020 03:28:57 GMT", + "content-length" : "317", + "expires" : "-1", + "x-ms-ratelimit-remaining-subscription-writes" : "1198", + "retry-after" : "0", + "StatusCode" : "201", + "strict-transport-security" : "max-age=31536000; includeSubDomains", + "pragma" : "no-cache", + "x-ms-correlation-request-id" : "f451763a-5337-4a59-ba7e-84b91db79129", + "x-content-type-options" : "nosniff", + "x-ms-routing-request-id" : "SOUTHEASTASIA:20200708T032858Z:f451763a-5337-4a59-ba7e-84b91db79129", + "content-type" : "application/json; charset=utf-8", + "cache-control" : "no-cache", + "x-ms-request-id" : "f451763a-5337-4a59-ba7e-84b91db79129", + "Body" : "{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgB72b81582\",\"name\":\"rgB72b81582\",\"type\":\"Microsoft.Resources/resourceGroups\",\"location\":\"southcentralus\",\"tags\":{\"date\":\"2020-07-08T03:28:55.767339800Z\",\"product\":\"javasdk\",\"cause\":\"automation\"},\"properties\":{\"provisioningState\":\"Succeeded\"}}" + } + }, { + "Method" : "GET", + "Uri" : "http://localhost:1234/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Web?api-version=2019-08-01", + "Headers" : { + "User-Agent" : "azsdk-java-com.azure.resourcemanager.resources/2.0.0-SNAPSHOT (14.0.1; Windows 10 10.0)", + "Content-Type" : "application/json" + }, + "Response" : { + "date" : "Wed, 08 Jul 2020 03:28:58 GMT", + "content-length" : "54768", + "expires" : "-1", + "retry-after" : "0", + "x-ms-ratelimit-remaining-subscription-reads" : "11999", + "StatusCode" : "200", + "strict-transport-security" : "max-age=31536000; includeSubDomains", + "pragma" : "no-cache", + "x-ms-correlation-request-id" : "3f6faf19-ead9-4c45-afa1-929f94a4221e", + "x-content-type-options" : "nosniff", + "x-ms-routing-request-id" : "SOUTHEASTASIA:20200708T032858Z:3f6faf19-ead9-4c45-afa1-929f94a4221e", + "content-type" : "application/json; charset=utf-8", + "cache-control" : "no-cache", + "x-ms-request-id" : "3f6faf19-ead9-4c45-afa1-929f94a4221e", + "Body" : "{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Web\",\"namespace\":\"Microsoft.Web\",\"authorization\":{\"applicationId\":\"abfa0a7c-a6b6-4736-8310-5855508787cd\",\"roleDefinitionId\":\"f47ed98b-b063-4a5b-9e10-4b9b44fa7735\"},\"resourceTypes\":[{\"resourceType\":\"publishingUsers\",\"locations\":[\"Central US\",\"North Europe\",\"West Europe\",\"Southeast Asia\",\"Korea Central\",\"Korea South\",\"West US\",\"East US\",\"Japan West\",\"Japan East\",\"East Asia\",\"East US 2\",\"North Central US\",\"South Central US\",\"Brazil South\",\"Australia East\",\"Australia Southeast\",\"West India\",\"Central India\",\"South India\",\"Canada Central\",\"Canada East\",\"West Central US\",\"UK West\",\"UK South\",\"West US 2\",\"MSFT West US\",\"MSFT East US\",\"MSFT East Asia\",\"MSFT North Europe\",\"East US 2 (Stage)\",\"East Asia (Stage)\",\"Central US (Stage)\",\"North Central US (Stage)\",\"France Central\",\"South Africa North\",\"Australia Central\",\"Switzerland North\",\"Germany West Central\",\"Norway East\",\"East US 2 EUAP\",\"Central US EUAP\"],\"apiVersions\":[\"2019-08-01\",\"2018-11-01\",\"2018-02-01\",\"2016-03-01\",\"2015-08-01\",\"2015-07-01\",\"2015-06-01\",\"2015-05-01\",\"2015-04-01\",\"2015-02-01\",\"2014-11-01\",\"2014-06-01\",\"2014-04-01-preview\",\"2014-04-01\"],\"apiProfiles\":[{\"profileVersion\":\"2017-03-09-profile\",\"apiVersion\":\"2016-03-01\"},{\"profileVersion\":\"2018-03-01-hybrid\",\"apiVersion\":\"2016-03-01\"},{\"profileVersion\":\"2018-06-01-profile\",\"apiVersion\":\"2016-03-01\"},{\"profileVersion\":\"2019-03-01-hybrid\",\"apiVersion\":\"2018-02-01\"}],\"capabilities\":\"None\"},{\"resourceType\":\"ishostnameavailable\",\"locations\":[\"Central US\",\"North Europe\",\"West Europe\",\"Southeast Asia\",\"Korea Central\",\"Korea South\",\"West US\",\"East US\",\"Japan West\",\"Japan East\",\"East Asia\",\"East US 2\",\"North Central US\",\"South Central US\",\"Brazil South\",\"Australia East\",\"Australia Southeast\",\"West India\",\"Central India\",\"South India\",\"Canada Central\",\"Canada East\",\"West Central US\",\"UK West\",\"UK South\",\"West US 2\",\"MSFT West US\",\"MSFT East US\",\"MSFT East Asia\",\"MSFT North Europe\",\"East US 2 (Stage)\",\"East Asia (Stage)\",\"Central US (Stage)\",\"North Central US (Stage)\",\"France Central\",\"South Africa North\",\"Australia Central\",\"Switzerland North\",\"Germany West Central\",\"Norway East\",\"East US 2 EUAP\",\"Central US EUAP\"],\"apiVersions\":[\"2019-08-01\",\"2018-11-01\",\"2018-02-01\",\"2016-03-01\",\"2015-08-01\",\"2015-07-01\",\"2015-06-01\",\"2015-05-01\",\"2015-04-01\",\"2015-02-01\",\"2014-11-01\",\"2014-06-01\",\"2014-04-01-preview\",\"2014-04-01\"],\"apiProfiles\":[{\"profileVersion\":\"2017-03-09-profile\",\"apiVersion\":\"2016-03-01\"},{\"profileVersion\":\"2018-03-01-hybrid\",\"apiVersion\":\"2016-03-01\"},{\"profileVersion\":\"2018-06-01-profile\",\"apiVersion\":\"2016-03-01\"},{\"profileVersion\":\"2019-03-01-hybrid\",\"apiVersion\":\"2018-02-01\"}],\"capabilities\":\"None\"},{\"resourceType\":\"validate\",\"locations\":[\"Central US\",\"North Europe\",\"West Europe\",\"Southeast Asia\",\"Korea Central\",\"Korea South\",\"West US\",\"East US\",\"Japan West\",\"Japan East\",\"East Asia\",\"East US 2\",\"North Central US\",\"South Central US\",\"Brazil South\",\"Australia East\",\"Australia Southeast\",\"West India\",\"Central India\",\"South India\",\"Canada Central\",\"Canada East\",\"West Central US\",\"West US 2\",\"MSFT West US\",\"MSFT East US\",\"MSFT East Asia\",\"MSFT North Europe\",\"East US 2 (Stage)\",\"East Asia (Stage)\",\"Central US (Stage)\",\"North Central US (Stage)\",\"France Central\",\"South Africa North\",\"Australia Central\",\"Switzerland North\",\"Germany West Central\",\"Norway East\",\"East US 2 EUAP\",\"Central US EUAP\"],\"apiVersions\":[\"2019-08-01\",\"2018-11-01\",\"2018-02-01\",\"2016-03-01\",\"2015-08-01\",\"2015-07-01\",\"2015-06-01\",\"2015-05-01\",\"2015-04-01\",\"2015-02-01\",\"2014-11-01\",\"2014-06-01\",\"2014-04-01-preview\",\"2014-04-01\"],\"apiProfiles\":[{\"profileVersion\":\"2017-03-09-profile\",\"apiVersion\":\"2016-03-01\"},{\"profileVersion\":\"2018-03-01-hybrid\",\"apiVersion\":\"2016-03-01\"},{\"profileVersion\":\"2018-06-01-profile\",\"apiVersion\":\"2016-03-01\"},{\"profileVersion\":\"2019-03-01-hybrid\",\"apiVersion\":\"2018-02-01\"}],\"capabilities\":\"None\"},{\"resourceType\":\"isusernameavailable\",\"locations\":[\"Central US\",\"North Europe\",\"West Europe\",\"Southeast Asia\",\"Korea Central\",\"Korea South\",\"West US\",\"East US\",\"Japan West\",\"Japan East\",\"East Asia\",\"East US 2\",\"North Central US\",\"South Central US\",\"Brazil South\",\"Australia East\",\"Australia Southeast\",\"West India\",\"Central India\",\"South India\",\"Canada Central\",\"Canada East\",\"West Central US\",\"UK West\",\"UK South\",\"West US 2\",\"MSFT West US\",\"MSFT East US\",\"MSFT East Asia\",\"MSFT North Europe\",\"East US 2 (Stage)\",\"East Asia (Stage)\",\"Central US (Stage)\",\"North Central US (Stage)\",\"France Central\",\"South Africa North\",\"Australia Central\",\"Switzerland North\",\"Germany West Central\",\"Norway East\",\"East US 2 EUAP\",\"Central US EUAP\"],\"apiVersions\":[\"2019-08-01\",\"2018-11-01\",\"2018-02-01\",\"2016-03-01\",\"2015-08-01\",\"2015-07-01\",\"2015-06-01\",\"2015-05-01\",\"2015-04-01\",\"2015-02-01\",\"2014-11-01\",\"2014-06-01\",\"2014-04-01-preview\",\"2014-04-01\"],\"apiProfiles\":[{\"profileVersion\":\"2017-03-09-profile\",\"apiVersion\":\"2016-03-01\"},{\"profileVersion\":\"2018-03-01-hybrid\",\"apiVersion\":\"2016-03-01\"},{\"profileVersion\":\"2018-06-01-profile\",\"apiVersion\":\"2016-03-01\"},{\"profileVersion\":\"2019-03-01-hybrid\",\"apiVersion\":\"2018-02-01\"}],\"capabilities\":\"None\"},{\"resourceType\":\"sourceControls\",\"locations\":[\"Central US\",\"North Europe\",\"West Europe\",\"Southeast Asia\",\"Korea Central\",\"Korea South\",\"West US\",\"East US\",\"Japan West\",\"Japan East\",\"East Asia\",\"East US 2\",\"North Central US\",\"South Central US\",\"Brazil South\",\"Australia East\",\"Australia Southeast\",\"West India\",\"Central India\",\"South India\",\"Canada Central\",\"Canada East\",\"West Central US\",\"UK West\",\"UK South\",\"West US 2\",\"MSFT West US\",\"MSFT East US\",\"MSFT East Asia\",\"MSFT North Europe\",\"East US 2 (Stage)\",\"East Asia (Stage)\",\"Central US (Stage)\",\"North Central US (Stage)\",\"France Central\",\"South Africa North\",\"Australia Central\",\"Switzerland North\",\"Germany West Central\",\"Norway East\",\"East US 2 EUAP\",\"Central US EUAP\"],\"apiVersions\":[\"2019-08-01\",\"2018-11-01\",\"2018-02-01\",\"2016-03-01\",\"2015-08-01\",\"2015-07-01\",\"2015-06-01\",\"2015-05-01\",\"2015-04-01\",\"2015-02-01\",\"2014-11-01\",\"2014-06-01\",\"2014-04-01-preview\",\"2014-04-01\"],\"apiProfiles\":[{\"profileVersion\":\"2017-03-09-profile\",\"apiVersion\":\"2016-03-01\"},{\"profileVersion\":\"2018-03-01-hybrid\",\"apiVersion\":\"2016-03-01\"},{\"profileVersion\":\"2018-06-01-profile\",\"apiVersion\":\"2016-03-01\"},{\"profileVersion\":\"2019-03-01-hybrid\",\"apiVersion\":\"2018-02-01\"}],\"capabilities\":\"None\"},{\"resourceType\":\"availableStacks\",\"locations\":[\"Central US\",\"North Europe\",\"West Europe\",\"Southeast Asia\",\"Korea Central\",\"Korea South\",\"West US\",\"East US\",\"Japan West\",\"Japan East\",\"East Asia\",\"East US 2\",\"North Central US\",\"South Central US\",\"Brazil South\",\"Australia East\",\"Australia Southeast\",\"West India\",\"Central India\",\"South India\",\"Canada Central\",\"Canada East\",\"West Central US\",\"UK West\",\"UK South\",\"West US 2\",\"MSFT West US\",\"MSFT East US\",\"MSFT East Asia\",\"MSFT North Europe\",\"East US 2 (Stage)\",\"East Asia (Stage)\",\"Central US (Stage)\",\"North Central US (Stage)\",\"France Central\",\"South Africa North\",\"Australia Central\",\"Switzerland North\",\"Germany West Central\",\"Norway East\",\"East US 2 EUAP\",\"Central US EUAP\"],\"apiVersions\":[\"2019-08-01\",\"2018-11-01\",\"2018-02-01\",\"2016-03-01\",\"2015-08-01\",\"2015-07-01\",\"2015-06-01\",\"2015-05-01\",\"2015-04-01\",\"2015-02-01\",\"2014-11-01\",\"2014-06-01\",\"2014-04-01-preview\",\"2014-04-01\"],\"apiProfiles\":[{\"profileVersion\":\"2017-03-09-profile\",\"apiVersion\":\"2016-03-01\"},{\"profileVersion\":\"2018-03-01-hybrid\",\"apiVersion\":\"2016-03-01\"},{\"profileVersion\":\"2018-06-01-profile\",\"apiVersion\":\"2016-03-01\"},{\"profileVersion\":\"2019-03-01-hybrid\",\"apiVersion\":\"2018-02-01\"}],\"capabilities\":\"None\"},{\"resourceType\":\"staticSites\",\"locations\":[\"West US 2\",\"Central US\",\"East US 2\",\"West Europe\",\"East Asia\"],\"apiVersions\":[\"2019-12-01-preview\",\"2019-08-01\"],\"capabilities\":\"SupportsTags, SupportsLocation\"},{\"resourceType\":\"listSitesAssignedToHostName\",\"locations\":[\"Central US\",\"North Europe\",\"West Europe\",\"Southeast Asia\",\"Korea Central\",\"Korea South\",\"West US\",\"East US\",\"Japan West\",\"Japan East\",\"East Asia\",\"East US 2\",\"North Central US\",\"South Central US\",\"Brazil South\",\"Australia East\",\"Australia Southeast\",\"West India\",\"Central India\",\"South India\",\"Canada Central\",\"Canada East\",\"West Central US\",\"UK West\",\"UK South\",\"West US 2\",\"MSFT West US\",\"MSFT East US\",\"MSFT East Asia\",\"MSFT North Europe\",\"East US 2 (Stage)\",\"East Asia (Stage)\",\"Central US (Stage)\",\"North Central US (Stage)\",\"France Central\",\"South Africa North\",\"Australia Central\",\"Switzerland North\",\"Germany West Central\",\"Norway East\",\"East US 2 EUAP\",\"Central US EUAP\"],\"apiVersions\":[\"2019-08-01\",\"2018-11-01\",\"2018-02-01\",\"2016-03-01\",\"2015-08-01\",\"2015-07-01\",\"2015-06-01\",\"2015-05-01\",\"2015-04-01\",\"2015-02-01\"],\"apiProfiles\":[{\"profileVersion\":\"2017-03-09-profile\",\"apiVersion\":\"2016-03-01\"},{\"profileVersion\":\"2018-03-01-hybrid\",\"apiVersion\":\"2016-03-01\"},{\"profileVersion\":\"2018-06-01-profile\",\"apiVersion\":\"2016-03-01\"},{\"profileVersion\":\"2019-03-01-hybrid\",\"apiVersion\":\"2018-02-01\"}],\"capabilities\":\"None\"},{\"resourceType\":\"locations/getNetworkPolicies\",\"locations\":[\"Central US\",\"North Europe\",\"West Europe\",\"Southeast Asia\",\"Korea Central\",\"Korea South\",\"West US\",\"East US\",\"Japan West\",\"Japan East\",\"East Asia\",\"East US 2\",\"North Central US\",\"South Central US\",\"Brazil South\",\"Australia East\",\"Australia Southeast\",\"West India\",\"Central India\",\"South India\",\"Canada Central\",\"Canada East\",\"UK West\",\"UK South\",\"West US 2\",\"MSFT West US\",\"MSFT East US\",\"MSFT East Asia\",\"MSFT North Europe\",\"East US 2 (Stage)\",\"Central US (Stage)\",\"France Central\",\"West Central US\",\"East Asia (Stage)\",\"North Central US (Stage)\",\"East US 2 EUAP\",\"Central US EUAP\"],\"apiVersions\":[\"2019-08-01\",\"2018-02-01\",\"2016-08-01\"],\"defaultApiVersion\":\"2018-02-01\",\"apiProfiles\":[{\"profileVersion\":\"2017-03-09-profile\",\"apiVersion\":\"2016-08-01\"},{\"profileVersion\":\"2018-03-01-hybrid\",\"apiVersion\":\"2016-08-01\"},{\"profileVersion\":\"2018-06-01-profile\",\"apiVersion\":\"2018-02-01\"},{\"profileVersion\":\"2019-03-01-hybrid\",\"apiVersion\":\"2018-02-01\"}],\"capabilities\":\"None\"},{\"resourceType\":\"locations/operations\",\"locations\":[\"South Central US\",\"MSFT West US\",\"MSFT East US\",\"MSFT East Asia\",\"MSFT North Europe\",\"East US 2 (Stage)\",\"Central US (Stage)\",\"South Africa North\",\"West US 2\",\"East US 2\",\"East US\",\"UK South\",\"Southeast Asia\",\"North Europe\",\"Japan East\",\"West Europe\",\"East Asia\",\"West US\",\"Australia East\",\"Brazil South\",\"Central US\",\"Japan West\",\"Central India\",\"Canada East\",\"Korea Central\",\"France Central\",\"West India\",\"Australia Central\",\"Germany West Central\",\"Norway East\",\"Switzerland North\",\"North Central US\",\"UK West\",\"Australia Southeast\",\"Korea South\",\"Canada Central\",\"South India\",\"West Central US\",\"East Asia (Stage)\",\"North Central US (Stage)\",\"East US 2 EUAP\",\"Central US EUAP\"],\"apiVersions\":[\"2019-12-01-preview\",\"2019-08-01\",\"2019-01-01\",\"2018-11-01\",\"2018-02-01\",\"2016-08-01\"],\"defaultApiVersion\":\"2019-01-01\",\"apiProfiles\":[{\"profileVersion\":\"2017-03-09-profile\",\"apiVersion\":\"2016-08-01\"},{\"profileVersion\":\"2018-03-01-hybrid\",\"apiVersion\":\"2016-08-01\"},{\"profileVersion\":\"2018-06-01-profile\",\"apiVersion\":\"2018-02-01\"},{\"profileVersion\":\"2019-03-01-hybrid\",\"apiVersion\":\"2018-02-01\"}],\"capabilities\":\"None\"},{\"resourceType\":\"locations/operationResults\",\"locations\":[\"South Central US\",\"MSFT West US\",\"MSFT East US\",\"MSFT East Asia\",\"MSFT North Europe\",\"East US 2 (Stage)\",\"Central US (Stage)\",\"South Africa North\",\"West US 2\",\"East US 2\",\"East US\",\"UK South\",\"Southeast Asia\",\"North Europe\",\"Japan East\",\"West Europe\",\"East Asia\",\"West US\",\"Australia East\",\"Brazil South\",\"Central US\",\"Japan West\",\"Central India\",\"Canada East\",\"Korea Central\",\"France Central\",\"West India\",\"Australia Central\",\"Germany West Central\",\"Norway East\",\"Switzerland North\",\"North Central US\",\"UK West\",\"Australia Southeast\",\"Korea South\",\"Canada Central\",\"South India\",\"West Central US\",\"East Asia (Stage)\",\"North Central US (Stage)\",\"East US 2 EUAP\",\"Central US EUAP\"],\"apiVersions\":[\"2019-12-01-preview\",\"2019-08-01\",\"2019-01-01\",\"2018-11-01\",\"2018-02-01\",\"2016-08-01\"],\"defaultApiVersion\":\"2019-01-01\",\"apiProfiles\":[{\"profileVersion\":\"2017-03-09-profile\",\"apiVersion\":\"2016-08-01\"},{\"profileVersion\":\"2018-03-01-hybrid\",\"apiVersion\":\"2016-08-01\"},{\"profileVersion\":\"2018-06-01-profile\",\"apiVersion\":\"2018-02-01\"},{\"profileVersion\":\"2019-03-01-hybrid\",\"apiVersion\":\"2018-02-01\"}],\"capabilities\":\"None\"},{\"resourceType\":\"sites/networkConfig\",\"locations\":[\"South Central US\",\"MSFT West US\",\"MSFT East US\",\"MSFT East Asia\",\"MSFT North Europe\",\"East US 2 (Stage)\",\"Central US (Stage)\",\"South Africa North\",\"East Asia\",\"Japan East\",\"Australia East\",\"Brazil South\",\"Southeast Asia\",\"Central US\",\"Japan West\",\"Central India\",\"UK South\",\"Canada East\",\"Korea Central\",\"France Central\",\"North Europe\",\"West US 2\",\"West India\",\"East US 2\",\"Australia Central\",\"Germany West Central\",\"Norway East\",\"Switzerland North\",\"North Central US\",\"UK West\",\"Australia Southeast\",\"Korea South\",\"Canada Central\",\"West Europe\",\"South India\",\"West Central US\",\"East Asia (Stage)\",\"North Central US (Stage)\",\"West US\",\"East US\",\"East US 2 EUAP\",\"Central US EUAP\"],\"apiVersions\":[\"2019-08-01\",\"2018-11-01\",\"2018-02-01\",\"2016-08-01\",\"2016-03-01\",\"2015-08-01\",\"2015-07-01\",\"2015-06-01\",\"2015-05-01\",\"2015-04-01\",\"2015-02-01\"],\"apiProfiles\":[{\"profileVersion\":\"2017-03-09-profile\",\"apiVersion\":\"2016-08-01\"},{\"profileVersion\":\"2018-03-01-hybrid\",\"apiVersion\":\"2016-08-01\"},{\"profileVersion\":\"2018-06-01-profile\",\"apiVersion\":\"2018-02-01\"},{\"profileVersion\":\"2019-03-01-hybrid\",\"apiVersion\":\"2018-02-01\"}],\"capabilities\":\"None\"},{\"resourceType\":\"sites/slots/networkConfig\",\"locations\":[\"South Central US\",\"MSFT West US\",\"MSFT East US\",\"MSFT East Asia\",\"MSFT North Europe\",\"East US 2 (Stage)\",\"Central US (Stage)\",\"South Africa North\",\"East Asia\",\"Japan East\",\"Australia East\",\"Brazil South\",\"Southeast Asia\",\"Central US\",\"Japan West\",\"Central India\",\"UK South\",\"Canada East\",\"Korea Central\",\"France Central\",\"North Europe\",\"West US 2\",\"West India\",\"East US 2\",\"Australia Central\",\"Germany West Central\",\"Norway East\",\"Switzerland North\",\"North Central US\",\"UK West\",\"Australia Southeast\",\"Korea South\",\"Canada Central\",\"West Europe\",\"South India\",\"West Central US\",\"East Asia (Stage)\",\"North Central US (Stage)\",\"West US\",\"East US\",\"East US 2 EUAP\",\"Central US EUAP\"],\"apiVersions\":[\"2019-08-01\",\"2018-11-01\",\"2018-02-01\",\"2016-08-01\",\"2016-03-01\",\"2015-08-01\",\"2015-07-01\",\"2015-06-01\",\"2015-05-01\",\"2015-04-01\",\"2015-02-01\"],\"apiProfiles\":[{\"profileVersion\":\"2017-03-09-profile\",\"apiVersion\":\"2016-08-01\"},{\"profileVersion\":\"2018-03-01-hybrid\",\"apiVersion\":\"2016-08-01\"},{\"profileVersion\":\"2018-06-01-profile\",\"apiVersion\":\"2018-02-01\"},{\"profileVersion\":\"2019-03-01-hybrid\",\"apiVersion\":\"2018-02-01\"}],\"capabilities\":\"None\"},{\"resourceType\":\"sites/hostNameBindings\",\"locations\":[\"South Central US\",\"MSFT West US\",\"MSFT East US\",\"MSFT East Asia\",\"MSFT North Europe\",\"East US 2 (Stage)\",\"Central US (Stage)\",\"South Africa North\",\"East Asia\",\"Japan East\",\"Australia East\",\"Brazil South\",\"Southeast Asia\",\"Central US\",\"Japan West\",\"Central India\",\"UK South\",\"Canada East\",\"Korea Central\",\"France Central\",\"North Europe\",\"West US 2\",\"West India\",\"East US 2\",\"Australia Central\",\"Germany West Central\",\"Norway East\",\"Switzerland North\",\"North Central US\",\"UK West\",\"Australia Southeast\",\"Korea South\",\"Canada Central\",\"West Europe\",\"South India\",\"West Central US\",\"East Asia (Stage)\",\"North Central US (Stage)\",\"West US\",\"East US\",\"East US 2 EUAP\",\"Central US EUAP\"],\"apiVersions\":[\"2019-08-01\",\"2018-11-01\",\"2018-02-01\",\"2016-08-01\",\"2016-03-01\",\"2015-08-01\",\"2015-07-01\",\"2015-06-01\",\"2015-05-01\",\"2015-04-01\",\"2015-02-01\"],\"apiProfiles\":[{\"profileVersion\":\"2017-03-09-profile\",\"apiVersion\":\"2016-08-01\"},{\"profileVersion\":\"2018-03-01-hybrid\",\"apiVersion\":\"2016-08-01\"},{\"profileVersion\":\"2018-06-01-profile\",\"apiVersion\":\"2018-02-01\"},{\"profileVersion\":\"2019-03-01-hybrid\",\"apiVersion\":\"2018-02-01\"}],\"capabilities\":\"None\"},{\"resourceType\":\"sites/slots/hostNameBindings\",\"locations\":[\"South Central US\",\"MSFT West US\",\"MSFT East US\",\"MSFT East Asia\",\"MSFT North Europe\",\"East US 2 (Stage)\",\"Central US (Stage)\",\"South Africa North\",\"East Asia\",\"Japan East\",\"Australia East\",\"Brazil South\",\"Southeast Asia\",\"Central US\",\"Japan West\",\"Central India\",\"UK South\",\"Canada East\",\"Korea Central\",\"France Central\",\"North Europe\",\"West US 2\",\"West India\",\"East US 2\",\"Australia Central\",\"Germany West Central\",\"Norway East\",\"Switzerland North\",\"North Central US\",\"UK West\",\"Australia Southeast\",\"Korea South\",\"Canada Central\",\"West Europe\",\"South India\",\"West Central US\",\"East Asia (Stage)\",\"North Central US (Stage)\",\"West US\",\"East US\",\"East US 2 EUAP\",\"Central US EUAP\"],\"apiVersions\":[\"2019-08-01\",\"2018-11-01\",\"2018-02-01\",\"2016-08-01\",\"2016-03-01\",\"2015-08-01\",\"2015-07-01\",\"2015-06-01\",\"2015-05-01\",\"2015-04-01\",\"2015-02-01\"],\"apiProfiles\":[{\"profileVersion\":\"2017-03-09-profile\",\"apiVersion\":\"2016-08-01\"},{\"profileVersion\":\"2018-03-01-hybrid\",\"apiVersion\":\"2016-08-01\"},{\"profileVersion\":\"2018-06-01-profile\",\"apiVersion\":\"2018-02-01\"},{\"profileVersion\":\"2019-03-01-hybrid\",\"apiVersion\":\"2018-02-01\"}],\"capabilities\":\"None\"},{\"resourceType\":\"operations\",\"locations\":[\"Central US\",\"North Europe\",\"West Europe\",\"Southeast Asia\",\"Korea Central\",\"Korea South\",\"West US\",\"East US\",\"Japan West\",\"Japan East\",\"East Asia\",\"East US 2\",\"North Central US\",\"South Central US\",\"Brazil South\",\"Australia East\",\"Australia Southeast\",\"West India\",\"Central India\",\"South India\",\"Canada Central\",\"Canada East\",\"West Central US\",\"UK West\",\"UK South\",\"West US 2\",\"MSFT West US\",\"MSFT East US\",\"MSFT East Asia\",\"MSFT North Europe\",\"East US 2 (Stage)\",\"East Asia (Stage)\",\"Central US (Stage)\",\"North Central US (Stage)\",\"France Central\",\"South Africa North\",\"Australia Central\",\"Switzerland North\",\"Germany West Central\",\"Norway East\",\"East US 2 EUAP\",\"Central US EUAP\"],\"apiVersions\":[\"2019-08-01\",\"2018-11-01\",\"2018-02-01\",\"2016-03-01\",\"2015-08-01\",\"2015-07-01\",\"2015-06-01\",\"2015-05-01\",\"2015-04-01\",\"2015-02-01\",\"2014-11-01\",\"2014-06-01\",\"2014-04-01-preview\",\"2014-04-01\"],\"apiProfiles\":[{\"profileVersion\":\"2017-03-09-profile\",\"apiVersion\":\"2016-03-01\"},{\"profileVersion\":\"2018-03-01-hybrid\",\"apiVersion\":\"2016-03-01\"},{\"profileVersion\":\"2018-06-01-profile\",\"apiVersion\":\"2018-02-01\"},{\"profileVersion\":\"2019-03-01-hybrid\",\"apiVersion\":\"2018-02-01\"}],\"capabilities\":\"None\"},{\"resourceType\":\"certificates\",\"locations\":[\"South Central US\",\"MSFT West US\",\"MSFT East US\",\"MSFT East Asia\",\"MSFT North Europe\",\"East US 2 (Stage)\",\"Central US (Stage)\",\"South Africa North\",\"East Asia\",\"Japan East\",\"Australia East\",\"Brazil South\",\"Southeast Asia\",\"Central US\",\"Japan West\",\"Central India\",\"UK South\",\"Canada East\",\"Korea Central\",\"France Central\",\"North Europe\",\"West US 2\",\"West India\",\"East US 2\",\"Australia Central\",\"Germany West Central\",\"Norway East\",\"Switzerland North\",\"North Central US\",\"UK West\",\"Australia Southeast\",\"Korea South\",\"Canada Central\",\"West Europe\",\"South India\",\"West Central US\",\"East Asia (Stage)\",\"North Central US (Stage)\",\"East US 2 EUAP\",\"Central US EUAP\",\"West US\",\"East US\"],\"apiVersions\":[\"2019-08-01\",\"2018-11-01\",\"2018-02-01\",\"2016-03-01\",\"2015-08-01-preview\",\"2015-08-01\",\"2015-07-01\",\"2015-06-01\",\"2015-05-01\",\"2015-04-01\",\"2015-02-01\",\"2014-11-01\",\"2014-06-01\",\"2014-04-01-preview\",\"2014-04-01\"],\"apiProfiles\":[{\"profileVersion\":\"2017-03-09-profile\",\"apiVersion\":\"2016-03-01\"},{\"profileVersion\":\"2018-03-01-hybrid\",\"apiVersion\":\"2016-03-01\"},{\"profileVersion\":\"2018-06-01-profile\",\"apiVersion\":\"2018-02-01\"},{\"profileVersion\":\"2019-03-01-hybrid\",\"apiVersion\":\"2018-02-01\"}],\"capabilities\":\"CrossSubscriptionResourceMove, SupportsTags, SupportsLocation\"},{\"resourceType\":\"serverFarms\",\"locations\":[\"South Central US\",\"MSFT West US\",\"MSFT East US\",\"MSFT East Asia\",\"MSFT North Europe\",\"East US 2 (Stage)\",\"Central US (Stage)\",\"South Africa North\",\"Australia East\",\"Brazil South\",\"Southeast Asia\",\"Central US\",\"Japan West\",\"Central India\",\"UK South\",\"Canada East\",\"Korea Central\",\"France Central\",\"North Europe\",\"West US 2\",\"West India\",\"East US 2\",\"Australia Central\",\"Germany West Central\",\"Norway East\",\"Switzerland North\",\"North Central US\",\"UK West\",\"Australia Southeast\",\"Korea South\",\"Canada Central\",\"West Europe\",\"South India\",\"West Central US\",\"East Asia (Stage)\",\"North Central US (Stage)\",\"East Asia\",\"Japan East\",\"East US 2 EUAP\",\"Central US EUAP\",\"West US\",\"East US\"],\"apiVersions\":[\"2019-08-01\",\"2018-11-01\",\"2018-02-01\",\"2017-08-01\",\"2016-09-01\",\"2016-03-01\",\"2015-08-01\",\"2015-07-01\",\"2015-06-01\",\"2015-05-01\",\"2015-04-01\",\"2015-02-01\",\"2014-11-01\",\"2014-06-01\",\"2014-04-01-preview\",\"2014-04-01\"],\"apiProfiles\":[{\"profileVersion\":\"2017-03-09-profile\",\"apiVersion\":\"2016-09-01\"},{\"profileVersion\":\"2018-03-01-hybrid\",\"apiVersion\":\"2017-08-01\"},{\"profileVersion\":\"2018-06-01-profile\",\"apiVersion\":\"2018-02-01\"},{\"profileVersion\":\"2019-03-01-hybrid\",\"apiVersion\":\"2018-02-01\"}],\"capabilities\":\"CrossResourceGroupResourceMove, CrossSubscriptionResourceMove, SupportsTags, SupportsLocation\"},{\"resourceType\":\"sites\",\"locations\":[\"South Central US\",\"MSFT West US\",\"MSFT East US\",\"MSFT East Asia\",\"MSFT North Europe\",\"East US 2 (Stage)\",\"Central US (Stage)\",\"South Africa North\",\"Australia East\",\"Brazil South\",\"Southeast Asia\",\"Central US\",\"Japan West\",\"Central India\",\"UK South\",\"Canada East\",\"Korea Central\",\"France Central\",\"North Europe\",\"West US 2\",\"West India\",\"East US 2\",\"Australia Central\",\"Germany West Central\",\"Norway East\",\"Switzerland North\",\"North Central US\",\"UK West\",\"Australia Southeast\",\"Korea South\",\"Canada Central\",\"West Europe\",\"South India\",\"West Central US\",\"East Asia (Stage)\",\"North Central US (Stage)\",\"East Asia\",\"Japan East\",\"East US 2 EUAP\",\"Central US EUAP\",\"West US\",\"East US\"],\"apiVersions\":[\"2019-08-01\",\"2018-11-01\",\"2018-02-01\",\"2017-08-01\",\"2016-09-01\",\"2016-08-01\",\"2016-03-01\",\"2015-11-01\",\"2015-08-01-preview\",\"2015-08-01\",\"2015-07-01\",\"2015-06-01\",\"2015-05-01\",\"2015-04-01\",\"2015-02-01\",\"2015-01-01\",\"2014-11-01\",\"2014-06-01\",\"2014-04-01-preview\",\"2014-04-01\"],\"apiProfiles\":[{\"profileVersion\":\"2017-03-09-profile\",\"apiVersion\":\"2016-08-01\"},{\"profileVersion\":\"2018-03-01-hybrid\",\"apiVersion\":\"2016-08-01\"},{\"profileVersion\":\"2018-06-01-profile\",\"apiVersion\":\"2018-02-01\"},{\"profileVersion\":\"2019-03-01-hybrid\",\"apiVersion\":\"2018-02-01\"}],\"capabilities\":\"CrossResourceGroupResourceMove, CrossSubscriptionResourceMove, SystemAssignedResourceIdentity, SupportsTags, SupportsLocation\"},{\"resourceType\":\"sites/slots\",\"locations\":[\"South Central US\",\"MSFT West US\",\"MSFT East US\",\"MSFT East Asia\",\"MSFT North Europe\",\"East US 2 (Stage)\",\"Central US (Stage)\",\"South Africa North\",\"Australia East\",\"Brazil South\",\"Southeast Asia\",\"Central US\",\"Japan West\",\"Central India\",\"UK South\",\"Canada East\",\"Korea Central\",\"France Central\",\"North Europe\",\"West US 2\",\"West India\",\"East US 2\",\"Australia Central\",\"Germany West Central\",\"Norway East\",\"Switzerland North\",\"North Central US\",\"UK West\",\"Australia Southeast\",\"Korea South\",\"Canada Central\",\"West Europe\",\"South India\",\"West Central US\",\"East Asia (Stage)\",\"North Central US (Stage)\",\"East Asia\",\"Japan East\",\"East US 2 EUAP\",\"Central US EUAP\",\"West US\",\"East US\"],\"apiVersions\":[\"2019-08-01\",\"2018-11-01\",\"2018-02-01\",\"2017-08-01\",\"2016-09-01\",\"2016-08-01\",\"2016-03-01\",\"2015-11-01\",\"2015-08-01\",\"2015-07-01\",\"2015-06-01\",\"2015-05-01\",\"2015-04-01\",\"2015-02-01\",\"2015-01-01\",\"2014-11-01\",\"2014-06-01\",\"2014-04-01-preview\",\"2014-04-01\"],\"apiProfiles\":[{\"profileVersion\":\"2017-03-09-profile\",\"apiVersion\":\"2016-08-01\"},{\"profileVersion\":\"2018-03-01-hybrid\",\"apiVersion\":\"2016-08-01\"},{\"profileVersion\":\"2018-06-01-profile\",\"apiVersion\":\"2018-02-01\"},{\"profileVersion\":\"2019-03-01-hybrid\",\"apiVersion\":\"2018-02-01\"}],\"capabilities\":\"CrossResourceGroupResourceMove, CrossSubscriptionResourceMove, SystemAssignedResourceIdentity, SupportsTags, SupportsLocation\"},{\"resourceType\":\"runtimes\",\"locations\":[],\"apiVersions\":[\"2019-08-01\",\"2018-11-01\",\"2018-02-01\",\"2016-03-01\",\"2015-08-01\",\"2015-07-01\",\"2015-06-01\",\"2015-05-01\",\"2015-04-01\",\"2015-02-01\",\"2014-11-01\",\"2014-06-01\",\"2014-04-01\"],\"apiProfiles\":[{\"profileVersion\":\"2017-03-09-profile\",\"apiVersion\":\"2016-03-01\"},{\"profileVersion\":\"2018-03-01-hybrid\",\"apiVersion\":\"2016-03-01\"},{\"profileVersion\":\"2018-06-01-profile\",\"apiVersion\":\"2016-03-01\"},{\"profileVersion\":\"2019-03-01-hybrid\",\"apiVersion\":\"2018-02-01\"}],\"capabilities\":\"None\"},{\"resourceType\":\"recommendations\",\"locations\":[],\"apiVersions\":[\"2019-08-01\",\"2018-11-01\",\"2018-02-01\",\"2016-03-01\",\"2015-08-01\",\"2015-07-01\",\"2015-06-01\",\"2015-05-01\",\"2015-04-01\",\"2015-02-01\",\"2014-11-01\",\"2014-06-01\",\"2014-04-01-preview\",\"2014-04-01\"],\"apiProfiles\":[{\"profileVersion\":\"2017-03-09-profile\",\"apiVersion\":\"2016-03-01\"},{\"profileVersion\":\"2018-03-01-hybrid\",\"apiVersion\":\"2016-03-01\"},{\"profileVersion\":\"2018-06-01-profile\",\"apiVersion\":\"2016-03-01\"},{\"profileVersion\":\"2019-03-01-hybrid\",\"apiVersion\":\"2018-02-01\"}],\"capabilities\":\"None\"},{\"resourceType\":\"resourceHealthMetadata\",\"locations\":[],\"apiVersions\":[\"2019-08-01\",\"2018-11-01\",\"2018-02-01\",\"2016-03-01\",\"2015-08-01\",\"2015-07-01\",\"2015-06-01\",\"2015-05-01\",\"2015-04-01\",\"2015-02-01\",\"2014-11-01\",\"2014-06-01\",\"2014-04-01-preview\",\"2014-04-01\"],\"apiProfiles\":[{\"profileVersion\":\"2017-03-09-profile\",\"apiVersion\":\"2016-03-01\"},{\"profileVersion\":\"2018-03-01-hybrid\",\"apiVersion\":\"2016-03-01\"},{\"profileVersion\":\"2018-06-01-profile\",\"apiVersion\":\"2016-03-01\"},{\"profileVersion\":\"2019-03-01-hybrid\",\"apiVersion\":\"2018-02-01\"}],\"capabilities\":\"None\"},{\"resourceType\":\"georegions\",\"locations\":[],\"apiVersions\":[\"2019-08-01\",\"2018-11-01\",\"2018-02-01\",\"2016-03-01\",\"2015-08-01\",\"2015-07-01\",\"2015-06-01\",\"2015-05-01\",\"2015-04-01\",\"2015-02-01\",\"2014-11-01\",\"2014-06-01\",\"2014-04-01-preview\",\"2014-04-01\"],\"apiProfiles\":[{\"profileVersion\":\"2017-03-09-profile\",\"apiVersion\":\"2016-03-01\"},{\"profileVersion\":\"2018-03-01-hybrid\",\"apiVersion\":\"2016-03-01\"},{\"profileVersion\":\"2018-06-01-profile\",\"apiVersion\":\"2016-03-01\"},{\"profileVersion\":\"2019-03-01-hybrid\",\"apiVersion\":\"2018-02-01\"}],\"capabilities\":\"None\"},{\"resourceType\":\"sites/premieraddons\",\"locations\":[\"South Central US\",\"MSFT West US\",\"MSFT East US\",\"MSFT East Asia\",\"MSFT North Europe\",\"East US 2 (Stage)\",\"Central US (Stage)\",\"South Africa North\",\"East Asia\",\"Japan East\",\"Australia East\",\"Brazil South\",\"Southeast Asia\",\"Central US\",\"Japan West\",\"Central India\",\"UK South\",\"Canada East\",\"Korea Central\",\"France Central\",\"North Europe\",\"West US 2\",\"West India\",\"East US 2\",\"Australia Central\",\"Germany West Central\",\"Norway East\",\"Switzerland North\",\"North Central US\",\"UK West\",\"Australia Southeast\",\"Korea South\",\"Canada Central\",\"West Europe\",\"South India\",\"West Central US\",\"East Asia (Stage)\",\"North Central US (Stage)\",\"East US 2 EUAP\",\"Central US EUAP\",\"West US\",\"East US\"],\"apiVersions\":[\"2019-08-01\",\"2018-11-01\",\"2018-02-01\",\"2016-03-01\",\"2015-08-01\",\"2015-07-01\",\"2015-06-01\",\"2015-05-01\",\"2015-04-01\"],\"apiProfiles\":[{\"profileVersion\":\"2017-03-09-profile\",\"apiVersion\":\"2016-03-01\"},{\"profileVersion\":\"2018-03-01-hybrid\",\"apiVersion\":\"2016-03-01\"},{\"profileVersion\":\"2018-06-01-profile\",\"apiVersion\":\"2016-03-01\"},{\"profileVersion\":\"2019-03-01-hybrid\",\"apiVersion\":\"2018-02-01\"}],\"capabilities\":\"CrossResourceGroupResourceMove, CrossSubscriptionResourceMove, SupportsTags, SupportsLocation\"},{\"resourceType\":\"hostingEnvironments\",\"locations\":[\"South Central US\",\"MSFT West US\",\"MSFT East US\",\"MSFT East Asia\",\"MSFT North Europe\",\"East US 2 (Stage)\",\"Central US (Stage)\",\"South Africa North\",\"West US 2\",\"East US 2\",\"UK South\",\"Southeast Asia\",\"North Europe\",\"Japan East\",\"West Europe\",\"East Asia\",\"Australia East\",\"Brazil South\",\"Central US\",\"Japan West\",\"Central India\",\"Canada East\",\"Korea Central\",\"France Central\",\"West India\",\"Australia Central\",\"Germany West Central\",\"Norway East\",\"Switzerland North\",\"North Central US\",\"UK West\",\"Australia Southeast\",\"Korea South\",\"Canada Central\",\"South India\",\"West Central US\",\"East Asia (Stage)\",\"North Central US (Stage)\",\"West US\",\"East US\",\"East US 2 EUAP\",\"Central US EUAP\"],\"apiVersions\":[\"2019-08-01\",\"2019-02-01\",\"2019-01-01\",\"2018-11-01\",\"2018-08-01\",\"2018-05-01-preview\",\"2018-02-01\",\"2017-08-01\",\"2016-09-01\",\"2016-03-01\",\"2015-08-01\",\"2015-07-01\",\"2015-06-01\",\"2015-05-01\",\"2015-04-01\",\"2015-02-01\",\"2014-11-01\",\"2014-06-01\",\"2014-04-01\"],\"apiProfiles\":[{\"profileVersion\":\"2017-03-09-profile\",\"apiVersion\":\"2016-09-01\"},{\"profileVersion\":\"2018-03-01-hybrid\",\"apiVersion\":\"2017-08-01\"},{\"profileVersion\":\"2018-06-01-profile\",\"apiVersion\":\"2018-02-01\"}],\"zoneMappings\":[{\"location\":\"East US 2\",\"zones\":[\"3\",\"2\",\"1\"]},{\"location\":\"Central US\",\"zones\":[\"3\",\"2\",\"1\"]},{\"location\":\"West Europe\",\"zones\":[\"3\",\"2\",\"1\"]},{\"location\":\"East US 2 EUAP\",\"zones\":[\"2\",\"1\",\"3\"]},{\"location\":\"Central US EUAP\",\"zones\":[]},{\"location\":\"France Central\",\"zones\":[\"3\",\"2\",\"1\"]},{\"location\":\"Southeast Asia\",\"zones\":[\"3\",\"2\",\"1\"]},{\"location\":\"West US 2\",\"zones\":[\"3\",\"2\",\"1\"]},{\"location\":\"North Europe\",\"zones\":[\"3\",\"2\",\"1\"]},{\"location\":\"East US\",\"zones\":[\"3\",\"2\",\"1\"]},{\"location\":\"UK South\",\"zones\":[\"3\",\"2\",\"1\"]},{\"location\":\"Japan East\",\"zones\":[\"3\",\"2\",\"1\"]},{\"location\":\"Australia East\",\"zones\":[]},{\"location\":\"South Africa North\",\"zones\":[]},{\"location\":\"South Central US\",\"zones\":[]},{\"location\":\"Canada Central\",\"zones\":[]},{\"location\":\"Germany West Central\",\"zones\":[]}],\"capabilities\":\"SupportsTags, SupportsLocation\"},{\"resourceType\":\"hostingEnvironments/multiRolePools\",\"locations\":[\"South Central US\",\"MSFT West US\",\"MSFT East US\",\"MSFT East Asia\",\"MSFT North Europe\",\"East US 2 (Stage)\",\"Central US (Stage)\",\"South Africa North\",\"East Asia\",\"Japan East\",\"Australia East\",\"Brazil South\",\"Southeast Asia\",\"Central US\",\"Japan West\",\"Central India\",\"UK South\",\"Canada East\",\"Korea Central\",\"France Central\",\"North Europe\",\"West US 2\",\"West India\",\"East US 2\",\"Australia Central\",\"Germany West Central\",\"Norway East\",\"Switzerland North\",\"North Central US\",\"UK West\",\"Australia Southeast\",\"Korea South\",\"Canada Central\",\"West Europe\",\"South India\",\"West Central US\",\"East Asia (Stage)\",\"North Central US (Stage)\",\"West US\",\"East US\",\"East US 2 EUAP\",\"Central US EUAP\"],\"apiVersions\":[\"2019-08-01\",\"2019-02-01\",\"2018-11-01\",\"2018-08-01\",\"2018-02-01\",\"2017-08-01\",\"2016-09-01\",\"2016-03-01\",\"2015-08-01\",\"2015-07-01\",\"2015-06-01\",\"2015-05-01\",\"2015-04-01\",\"2015-02-01\",\"2014-11-01\",\"2014-06-01\",\"2014-04-01\"],\"apiProfiles\":[{\"profileVersion\":\"2017-03-09-profile\",\"apiVersion\":\"2016-09-01\"},{\"profileVersion\":\"2018-03-01-hybrid\",\"apiVersion\":\"2017-08-01\"},{\"profileVersion\":\"2018-06-01-profile\",\"apiVersion\":\"2018-02-01\"},{\"profileVersion\":\"2019-03-01-hybrid\",\"apiVersion\":\"2018-02-01\"}],\"capabilities\":\"None\"},{\"resourceType\":\"hostingEnvironments/workerPools\",\"locations\":[\"South Central US\",\"MSFT West US\",\"MSFT East US\",\"MSFT East Asia\",\"MSFT North Europe\",\"East US 2 (Stage)\",\"Central US (Stage)\",\"South Africa North\",\"East Asia\",\"Japan East\",\"Australia East\",\"Brazil South\",\"Southeast Asia\",\"Central US\",\"Japan West\",\"Central India\",\"UK South\",\"Canada East\",\"Korea Central\",\"France Central\",\"North Europe\",\"West US 2\",\"West India\",\"East US 2\",\"Australia Central\",\"Germany West Central\",\"Norway East\",\"Switzerland North\",\"North Central US\",\"UK West\",\"Australia Southeast\",\"Korea South\",\"Canada Central\",\"West Europe\",\"South India\",\"West Central US\",\"East Asia (Stage)\",\"North Central US (Stage)\",\"West US\",\"East US\",\"East US 2 EUAP\",\"Central US EUAP\"],\"apiVersions\":[\"2019-08-01\",\"2019-02-01\",\"2018-11-01\",\"2018-08-01\",\"2018-02-01\",\"2017-08-01\",\"2016-09-01\",\"2016-03-01\",\"2015-08-01\",\"2015-07-01\",\"2015-06-01\",\"2015-05-01\",\"2015-04-01\",\"2015-02-01\",\"2014-11-01\",\"2014-06-01\",\"2014-04-01\"],\"apiProfiles\":[{\"profileVersion\":\"2017-03-09-profile\",\"apiVersion\":\"2016-09-01\"},{\"profileVersion\":\"2018-03-01-hybrid\",\"apiVersion\":\"2017-08-01\"},{\"profileVersion\":\"2018-06-01-profile\",\"apiVersion\":\"2018-02-01\"},{\"profileVersion\":\"2019-03-01-hybrid\",\"apiVersion\":\"2018-02-01\"}],\"capabilities\":\"None\"},{\"resourceType\":\"kubeEnvironments\",\"locations\":[\"North Central US (Stage)\"],\"apiVersions\":[\"2019-08-01\",\"2019-02-01\",\"2019-01-01\",\"2018-11-01\",\"2018-08-01\",\"2018-05-01-preview\",\"2018-02-01\",\"2017-08-01\",\"2016-09-01\",\"2016-03-01\",\"2015-08-01\",\"2015-07-01\",\"2015-06-01\",\"2015-05-01\",\"2015-04-01\",\"2015-02-01\",\"2014-11-01\",\"2014-06-01\",\"2014-04-01\"],\"apiProfiles\":[{\"profileVersion\":\"2017-03-09-profile\",\"apiVersion\":\"2016-09-01\"},{\"profileVersion\":\"2018-03-01-hybrid\",\"apiVersion\":\"2017-08-01\"},{\"profileVersion\":\"2018-06-01-profile\",\"apiVersion\":\"2018-02-01\"}],\"capabilities\":\"CrossResourceGroupResourceMove, CrossSubscriptionResourceMove, SupportsTags, SupportsLocation\"},{\"resourceType\":\"deploymentLocations\",\"locations\":[\"Central US\",\"North Europe\",\"West Europe\",\"Southeast Asia\",\"Korea Central\",\"Korea South\",\"West US\",\"East US\",\"Japan West\",\"Japan East\",\"East Asia\",\"East US 2\",\"North Central US\",\"South Central US\",\"Brazil South\",\"Australia East\",\"Australia Southeast\",\"West India\",\"Central India\",\"South India\",\"Canada Central\",\"Canada East\",\"West Central US\",\"UK West\",\"UK South\",\"West US 2\",\"MSFT West US\",\"MSFT East US\",\"MSFT East Asia\",\"MSFT North Europe\",\"East US 2 (Stage)\",\"Central US (Stage)\",\"North Central US (Stage)\",\"France Central\",\"South Africa North\",\"Australia Central\",\"Switzerland North\",\"Germany West Central\",\"Norway East\"],\"apiVersions\":[\"2019-08-01\",\"2018-11-01\",\"2018-02-01\",\"2016-03-01\",\"2015-08-01\",\"2015-07-01\",\"2015-06-01\",\"2015-05-01\",\"2015-04-01\",\"2015-02-01\",\"2014-11-01\",\"2014-06-01\",\"2014-04-01-preview\",\"2014-04-01\"],\"apiProfiles\":[{\"profileVersion\":\"2017-03-09-profile\",\"apiVersion\":\"2016-03-01\"},{\"profileVersion\":\"2018-03-01-hybrid\",\"apiVersion\":\"2016-03-01\"},{\"profileVersion\":\"2018-06-01-profile\",\"apiVersion\":\"2018-02-01\"},{\"profileVersion\":\"2019-03-01-hybrid\",\"apiVersion\":\"2018-02-01\"}],\"capabilities\":\"None\"},{\"resourceType\":\"deletedSites\",\"locations\":[\"South Central US\",\"MSFT West US\",\"MSFT East US\",\"MSFT East Asia\",\"MSFT North Europe\",\"East US 2 (Stage)\",\"Central US (Stage)\",\"South Africa North\",\"East Asia\",\"Japan East\",\"Australia East\",\"Brazil South\",\"Southeast Asia\",\"Central US\",\"Japan West\",\"Central India\",\"UK South\",\"Canada East\",\"Korea Central\",\"France Central\",\"North Europe\",\"West US 2\",\"West India\",\"East US 2\",\"Australia Central\",\"Germany West Central\",\"Norway East\",\"Switzerland North\",\"North Central US\",\"UK West\",\"Australia Southeast\",\"Korea South\",\"Canada Central\",\"West Europe\",\"South India\",\"West Central US\",\"East Asia (Stage)\",\"North Central US (Stage)\",\"West US\",\"East US\",\"East US 2 EUAP\",\"Central US EUAP\"],\"apiVersions\":[\"2019-08-01\",\"2018-11-01\",\"2018-02-01\",\"2016-03-01\",\"2015-08-01\",\"2015-07-01\",\"2015-06-01\",\"2015-05-01\",\"2015-04-01\",\"2015-02-01\",\"2014-11-01\",\"2014-06-01\",\"2014-04-01-preview\",\"2014-04-01\"],\"apiProfiles\":[{\"profileVersion\":\"2017-03-09-profile\",\"apiVersion\":\"2016-03-01\"},{\"profileVersion\":\"2018-03-01-hybrid\",\"apiVersion\":\"2016-03-01\"},{\"profileVersion\":\"2018-06-01-profile\",\"apiVersion\":\"2018-02-01\"},{\"profileVersion\":\"2019-03-01-hybrid\",\"apiVersion\":\"2018-02-01\"}],\"capabilities\":\"None\"},{\"resourceType\":\"locations/deletedSites\",\"locations\":[\"South Central US\",\"MSFT West US\",\"MSFT East US\",\"MSFT East Asia\",\"MSFT North Europe\",\"East US 2 (Stage)\",\"Central US (Stage)\",\"South Africa North\",\"East Asia\",\"Japan East\",\"Australia East\",\"Brazil South\",\"Southeast Asia\",\"Central US\",\"Japan West\",\"Central India\",\"UK South\",\"Canada East\",\"Korea Central\",\"France Central\",\"North Europe\",\"West US 2\",\"West India\",\"East US 2\",\"Australia Central\",\"Germany West Central\",\"Norway East\",\"Switzerland North\",\"North Central US\",\"UK West\",\"Australia Southeast\",\"Korea South\",\"Canada Central\",\"West Europe\",\"South India\",\"West Central US\",\"East Asia (Stage)\",\"North Central US (Stage)\",\"West US\",\"East US\",\"East US 2 EUAP\",\"Central US EUAP\"],\"apiVersions\":[\"2019-08-01\",\"2018-11-01\",\"2018-02-01\",\"2016-03-01\",\"2015-08-01\",\"2015-07-01\",\"2015-06-01\",\"2015-05-01\",\"2015-04-01\",\"2015-02-01\",\"2014-11-01\",\"2014-06-01\",\"2014-04-01-preview\",\"2014-04-01\"],\"defaultApiVersion\":\"2018-02-01\",\"apiProfiles\":[{\"profileVersion\":\"2017-03-09-profile\",\"apiVersion\":\"2016-03-01\"},{\"profileVersion\":\"2018-03-01-hybrid\",\"apiVersion\":\"2016-03-01\"},{\"profileVersion\":\"2018-06-01-profile\",\"apiVersion\":\"2018-02-01\"},{\"profileVersion\":\"2019-03-01-hybrid\",\"apiVersion\":\"2018-02-01\"}],\"capabilities\":\"None\"},{\"resourceType\":\"ishostingenvironmentnameavailable\",\"locations\":[],\"apiVersions\":[\"2019-08-01\",\"2018-11-01\",\"2018-02-01\",\"2016-03-01\",\"2015-08-01\",\"2015-07-01\",\"2015-06-01\",\"2015-05-01\",\"2015-04-01\",\"2015-02-01\",\"2014-11-01\",\"2014-06-01\",\"2014-04-01-preview\",\"2014-04-01\"],\"apiProfiles\":[{\"profileVersion\":\"2017-03-09-profile\",\"apiVersion\":\"2016-03-01\"},{\"profileVersion\":\"2018-03-01-hybrid\",\"apiVersion\":\"2016-03-01\"},{\"profileVersion\":\"2018-06-01-profile\",\"apiVersion\":\"2018-02-01\"},{\"profileVersion\":\"2019-03-01-hybrid\",\"apiVersion\":\"2018-02-01\"}],\"capabilities\":\"None\"},{\"resourceType\":\"locations/deleteVirtualNetworkOrSubnets\",\"locations\":[\"South Central US\",\"MSFT West US\",\"MSFT East US\",\"MSFT East Asia\",\"MSFT North Europe\",\"East US 2 (Stage)\",\"Central US (Stage)\",\"South Africa North\",\"Australia East\",\"Brazil South\",\"Southeast Asia\",\"Central US\",\"Japan West\",\"Central India\",\"UK South\",\"Canada East\",\"Korea Central\",\"France Central\",\"North Europe\",\"West US 2\",\"West India\",\"East US 2\",\"Australia Central\",\"Germany West Central\",\"Norway East\",\"Switzerland North\",\"North Central US\",\"UK West\",\"Australia Southeast\",\"Korea South\",\"Canada Central\",\"West Europe\",\"South India\",\"West Central US\",\"East Asia (Stage)\",\"North Central US (Stage)\",\"East Asia\",\"Japan East\",\"East US 2 EUAP\",\"Central US EUAP\",\"West US\",\"East US\"],\"apiVersions\":[\"2019-08-01\",\"2018-11-01\",\"2018-02-01\",\"2016-11-01\",\"2016-08-01\",\"2016-03-01\",\"2015-08-01-preview\",\"2015-08-01\",\"2015-07-01\",\"2015-06-01\",\"2015-05-01\",\"2015-04-01\",\"2015-02-01\",\"2014-11-01\",\"2014-06-01\",\"2014-04-01-preview\",\"2014-04-01\"],\"defaultApiVersion\":\"2018-02-01\",\"apiProfiles\":[{\"profileVersion\":\"2019-03-01-hybrid\",\"apiVersion\":\"2018-02-01\"}],\"capabilities\":\"None\"},{\"resourceType\":\"connections\",\"locations\":[\"North Central US\",\"Central US\",\"South Central US\",\"North Europe\",\"West Europe\",\"East Asia\",\"Southeast Asia\",\"West US\",\"East US\",\"East US 2\",\"Japan West\",\"Japan East\",\"Brazil South\",\"Australia East\",\"Australia Southeast\",\"South India\",\"Central India\",\"West India\",\"West US 2\",\"West Central US\",\"Canada Central\",\"Canada East\",\"UK South\",\"UK West\",\"France Central\",\"France South\",\"Korea Central\",\"Korea South\",\"South Africa West\",\"South Africa North\",\"UAE Central\",\"Central US EUAP\",\"East US 2 EUAP\"],\"apiVersions\":[\"2018-07-01-preview\",\"2018-03-01-preview\",\"2016-06-01\",\"2015-08-01-preview\"],\"apiProfiles\":[{\"profileVersion\":\"2017-03-09-profile\",\"apiVersion\":\"2016-06-01\"},{\"profileVersion\":\"2018-03-01-hybrid\",\"apiVersion\":\"2016-06-01\"},{\"profileVersion\":\"2018-06-01-profile\",\"apiVersion\":\"2018-03-01-preview\"}],\"capabilities\":\"CrossResourceGroupResourceMove, CrossSubscriptionResourceMove, SupportsTags, SupportsLocation\"},{\"resourceType\":\"customApis\",\"locations\":[\"North Central US\",\"Central US\",\"South Central US\",\"North Europe\",\"West Europe\",\"East Asia\",\"Southeast Asia\",\"West US\",\"East US\",\"East US 2\",\"Japan West\",\"Japan East\",\"Brazil South\",\"Australia East\",\"Australia Southeast\",\"South India\",\"Central India\",\"West India\",\"West US 2\",\"West Central US\",\"Canada Central\",\"Canada East\",\"UK South\",\"UK West\",\"France Central\",\"France South\",\"Korea Central\",\"Korea South\",\"South Africa West\",\"South Africa North\",\"UAE Central\",\"Central US EUAP\",\"East US 2 EUAP\"],\"apiVersions\":[\"2018-07-01-preview\",\"2018-03-01-preview\",\"2016-06-01\",\"2015-08-01-preview\"],\"apiProfiles\":[{\"profileVersion\":\"2017-03-09-profile\",\"apiVersion\":\"2016-06-01\"},{\"profileVersion\":\"2018-03-01-hybrid\",\"apiVersion\":\"2016-06-01\"},{\"profileVersion\":\"2018-06-01-profile\",\"apiVersion\":\"2018-03-01-preview\"}],\"capabilities\":\"CrossResourceGroupResourceMove, CrossSubscriptionResourceMove, SupportsTags, SupportsLocation\"},{\"resourceType\":\"locations\",\"locations\":[],\"apiVersions\":[\"2018-07-01-preview\",\"2018-03-01-preview\",\"2016-06-01\",\"2015-08-01-preview\"],\"apiProfiles\":[{\"profileVersion\":\"2017-03-09-profile\",\"apiVersion\":\"2016-06-01\"},{\"profileVersion\":\"2018-03-01-hybrid\",\"apiVersion\":\"2016-06-01\"},{\"profileVersion\":\"2018-06-01-profile\",\"apiVersion\":\"2018-03-01-preview\"}],\"capabilities\":\"None\"},{\"resourceType\":\"locations/listWsdlInterfaces\",\"locations\":[\"North Central US\",\"Central US\",\"South Central US\",\"North Europe\",\"West Europe\",\"East Asia\",\"Southeast Asia\",\"West US\",\"East US\",\"East US 2\",\"Japan West\",\"Japan East\",\"Brazil South\",\"Australia East\",\"Australia Southeast\",\"South India\",\"Central India\",\"West India\",\"West US 2\",\"West Central US\",\"Canada Central\",\"Canada East\",\"UK South\",\"UK West\",\"France Central\",\"France South\",\"Korea Central\",\"Korea South\",\"South Africa West\",\"South Africa North\",\"UAE Central\",\"Central US EUAP\",\"East US 2 EUAP\"],\"apiVersions\":[\"2018-03-01-preview\",\"2016-06-01\",\"2015-08-01-preview\"],\"apiProfiles\":[{\"profileVersion\":\"2017-03-09-profile\",\"apiVersion\":\"2016-06-01\"},{\"profileVersion\":\"2018-03-01-hybrid\",\"apiVersion\":\"2016-06-01\"},{\"profileVersion\":\"2018-06-01-profile\",\"apiVersion\":\"2018-03-01-preview\"}],\"capabilities\":\"None\"},{\"resourceType\":\"locations/extractApiDefinitionFromWsdl\",\"locations\":[\"North Central US\",\"Central US\",\"South Central US\",\"North Europe\",\"West Europe\",\"East Asia\",\"Southeast Asia\",\"West US\",\"East US\",\"East US 2\",\"Japan West\",\"Japan East\",\"Brazil South\",\"Australia East\",\"Australia Southeast\",\"South India\",\"Central India\",\"West India\",\"West US 2\",\"West Central US\",\"Canada Central\",\"Canada East\",\"UK South\",\"UK West\",\"France Central\",\"France South\",\"Korea Central\",\"Korea South\",\"South Africa West\",\"South Africa North\",\"UAE Central\",\"Central US EUAP\",\"East US 2 EUAP\"],\"apiVersions\":[\"2018-03-01-preview\",\"2016-06-01\",\"2015-08-01-preview\"],\"apiProfiles\":[{\"profileVersion\":\"2017-03-09-profile\",\"apiVersion\":\"2016-06-01\"},{\"profileVersion\":\"2018-03-01-hybrid\",\"apiVersion\":\"2016-06-01\"},{\"profileVersion\":\"2018-06-01-profile\",\"apiVersion\":\"2018-03-01-preview\"}],\"capabilities\":\"None\"},{\"resourceType\":\"locations/managedApis\",\"locations\":[\"North Central US\",\"Central US\",\"South Central US\",\"North Europe\",\"West Europe\",\"East Asia\",\"Southeast Asia\",\"West US\",\"East US\",\"East US 2\",\"Japan West\",\"Japan East\",\"Brazil South\",\"Australia East\",\"Australia Southeast\",\"South India\",\"Central India\",\"West India\",\"West US 2\",\"West Central US\",\"Canada Central\",\"Canada East\",\"UK South\",\"UK West\",\"France Central\",\"France South\",\"Korea Central\",\"Korea South\",\"South Africa West\",\"South Africa North\",\"UAE Central\",\"Central US EUAP\",\"East US 2 EUAP\"],\"apiVersions\":[\"2018-07-01-preview\",\"2018-03-01-preview\",\"2016-06-01\",\"2015-08-01-preview\"],\"apiProfiles\":[{\"profileVersion\":\"2017-03-09-profile\",\"apiVersion\":\"2016-06-01\"},{\"profileVersion\":\"2018-03-01-hybrid\",\"apiVersion\":\"2016-06-01\"},{\"profileVersion\":\"2018-06-01-profile\",\"apiVersion\":\"2018-03-01-preview\"}],\"capabilities\":\"None\"},{\"resourceType\":\"locations/runtimes\",\"locations\":[\"North Central US\",\"Central US\",\"South Central US\",\"North Europe\",\"West Europe\",\"East Asia\",\"Southeast Asia\",\"West US\",\"East US\",\"East US 2\",\"Japan West\",\"Japan East\",\"Brazil South\",\"Australia East\",\"Australia Southeast\",\"South India\",\"Central India\",\"West India\",\"West US 2\",\"West Central US\",\"Canada Central\",\"Canada East\",\"UK South\",\"UK West\",\"France Central\",\"France South\",\"Korea Central\",\"Korea South\",\"South Africa West\",\"South Africa North\",\"UAE Central\",\"Central US EUAP\",\"East US 2 EUAP\"],\"apiVersions\":[\"2018-03-01-preview\",\"2016-06-01\",\"2015-08-01-preview\"],\"apiProfiles\":[{\"profileVersion\":\"2017-03-09-profile\",\"apiVersion\":\"2016-06-01\"},{\"profileVersion\":\"2018-03-01-hybrid\",\"apiVersion\":\"2016-06-01\"},{\"profileVersion\":\"2018-06-01-profile\",\"apiVersion\":\"2018-03-01-preview\"}],\"capabilities\":\"None\"},{\"resourceType\":\"locations/apiOperations\",\"locations\":[\"North Central US\",\"Central US\",\"South Central US\",\"North Europe\",\"West Europe\",\"East Asia\",\"Southeast Asia\",\"West US\",\"East US\",\"East US 2\",\"Japan West\",\"Japan East\",\"Brazil South\",\"Australia East\",\"Australia Southeast\",\"South India\",\"Central India\",\"West India\",\"West US 2\",\"West Central US\",\"Canada Central\",\"Canada East\",\"UK South\",\"UK West\",\"France Central\",\"France South\",\"Korea Central\",\"Korea South\",\"South Africa West\",\"South Africa North\",\"UAE Central\",\"Central US EUAP\",\"East US 2 EUAP\"],\"apiVersions\":[\"2018-07-01-preview\",\"2018-03-01-preview\",\"2016-06-01\",\"2015-08-01-preview\"],\"apiProfiles\":[{\"profileVersion\":\"2017-03-09-profile\",\"apiVersion\":\"2016-06-01\"},{\"profileVersion\":\"2018-03-01-hybrid\",\"apiVersion\":\"2016-06-01\"},{\"profileVersion\":\"2018-06-01-profile\",\"apiVersion\":\"2018-03-01-preview\"}],\"capabilities\":\"None\"},{\"resourceType\":\"connectionGateways\",\"locations\":[\"North Central US\",\"Central US\",\"South Central US\",\"North Europe\",\"West Europe\",\"East Asia\",\"Southeast Asia\",\"West US\",\"East US\",\"East US 2\",\"Japan West\",\"Japan East\",\"Brazil South\",\"Australia East\",\"Australia Southeast\",\"South India\",\"Central India\",\"West India\",\"West US 2\",\"West Central US\",\"Canada Central\",\"Canada East\",\"UK South\",\"UK West\",\"France Central\",\"France South\",\"Korea Central\",\"Korea South\",\"South Africa West\",\"South Africa North\",\"UAE Central\",\"Central US EUAP\",\"East US 2 EUAP\"],\"apiVersions\":[\"2018-03-01-preview\",\"2016-06-01\",\"2015-08-01-preview\"],\"apiProfiles\":[{\"profileVersion\":\"2017-03-09-profile\",\"apiVersion\":\"2016-06-01\"},{\"profileVersion\":\"2018-03-01-hybrid\",\"apiVersion\":\"2016-06-01\"},{\"profileVersion\":\"2018-06-01-profile\",\"apiVersion\":\"2018-03-01-preview\"}],\"capabilities\":\"CrossResourceGroupResourceMove, CrossSubscriptionResourceMove, SupportsTags, SupportsLocation\"},{\"resourceType\":\"locations/connectionGatewayInstallations\",\"locations\":[\"North Central US\",\"Central US\",\"South Central US\",\"North Europe\",\"West Europe\",\"East Asia\",\"Southeast Asia\",\"West US\",\"East US\",\"East US 2\",\"Japan West\",\"Japan East\",\"Brazil South\",\"Australia East\",\"Australia Southeast\",\"South India\",\"Central India\",\"West India\",\"West US 2\",\"West Central US\",\"Canada Central\",\"Canada East\",\"UK South\",\"UK West\",\"France Central\",\"France South\",\"Korea Central\",\"Korea South\",\"South Africa West\",\"South Africa North\",\"UAE Central\",\"Central US EUAP\",\"East US 2 EUAP\"],\"apiVersions\":[\"2018-03-01-preview\",\"2016-06-01\",\"2015-08-01-preview\"],\"apiProfiles\":[{\"profileVersion\":\"2017-03-09-profile\",\"apiVersion\":\"2016-06-01\"},{\"profileVersion\":\"2018-03-01-hybrid\",\"apiVersion\":\"2016-06-01\"},{\"profileVersion\":\"2018-06-01-profile\",\"apiVersion\":\"2018-03-01-preview\"}],\"capabilities\":\"None\"},{\"resourceType\":\"checkNameAvailability\",\"locations\":[\"Central US\",\"North Europe\",\"West Europe\",\"Southeast Asia\",\"Korea Central\",\"Korea South\",\"West US\",\"East US\",\"Japan West\",\"Japan East\",\"East Asia\",\"East US 2\",\"North Central US\",\"South Central US\",\"Brazil South\",\"Australia East\",\"Australia Southeast\",\"West India\",\"Central India\",\"South India\",\"Canada Central\",\"Canada East\",\"West Central US\",\"UK West\",\"UK South\",\"West US 2\",\"MSFT West US\",\"MSFT East US\",\"MSFT East Asia\",\"MSFT North Europe\",\"East US 2 (Stage)\",\"East Asia (Stage)\",\"Central US (Stage)\",\"North Central US (Stage)\",\"France Central\",\"South Africa North\",\"Australia Central\",\"Switzerland North\",\"Germany West Central\",\"Norway East\",\"East US 2 EUAP\",\"Central US EUAP\"],\"apiVersions\":[\"2019-08-01\",\"2018-11-01\",\"2018-02-01\",\"2016-03-01\",\"2015-08-01-preview\",\"2015-08-01\",\"2015-07-01\",\"2015-06-01\",\"2015-05-01\",\"2015-04-01\",\"2015-02-01\",\"2014-11-01\",\"2014-06-01\",\"2014-04-01-preview\",\"2014-04-01\"],\"apiProfiles\":[{\"profileVersion\":\"2017-03-09-profile\",\"apiVersion\":\"2016-03-01\"},{\"profileVersion\":\"2018-03-01-hybrid\",\"apiVersion\":\"2016-03-01\"},{\"profileVersion\":\"2018-06-01-profile\",\"apiVersion\":\"2018-02-01\"},{\"profileVersion\":\"2019-03-01-hybrid\",\"apiVersion\":\"2018-02-01\"}],\"capabilities\":\"None\"},{\"resourceType\":\"billingMeters\",\"locations\":[\"Central US\",\"North Europe\",\"West Europe\",\"Southeast Asia\",\"Korea Central\",\"Korea South\",\"West US\",\"East US\",\"Japan West\",\"Japan East\",\"East Asia\",\"East US 2\",\"North Central US\",\"South Central US\",\"Brazil South\",\"Australia East\",\"Australia Southeast\",\"West India\",\"Central India\",\"South India\",\"Canada Central\",\"Canada East\",\"West Central US\",\"UK West\",\"UK South\",\"West US 2\",\"MSFT West US\",\"MSFT East US\",\"MSFT East Asia\",\"MSFT North Europe\",\"East US 2 (Stage)\",\"East Asia (Stage)\",\"Central US (Stage)\",\"North Central US (Stage)\",\"France Central\",\"South Africa North\",\"Australia Central\",\"Switzerland North\",\"Germany West Central\",\"Norway East\",\"East US 2 EUAP\",\"Central US EUAP\"],\"apiVersions\":[\"2019-08-01\",\"2018-11-01\",\"2018-02-01\",\"2016-03-01\",\"2015-08-01-preview\",\"2015-08-01\",\"2015-07-01\",\"2015-06-01\",\"2015-05-01\",\"2015-04-01\",\"2015-02-01\",\"2014-11-01\",\"2014-06-01\",\"2014-04-01-preview\",\"2014-04-01\"],\"apiProfiles\":[{\"profileVersion\":\"2017-03-09-profile\",\"apiVersion\":\"2016-03-01\"},{\"profileVersion\":\"2018-03-01-hybrid\",\"apiVersion\":\"2016-03-01\"},{\"profileVersion\":\"2018-06-01-profile\",\"apiVersion\":\"2018-02-01\"},{\"profileVersion\":\"2019-03-01-hybrid\",\"apiVersion\":\"2018-02-01\"}],\"capabilities\":\"None\"},{\"resourceType\":\"verifyHostingEnvironmentVnet\",\"locations\":[\"Central US\",\"North Europe\",\"West Europe\",\"Southeast Asia\",\"Korea Central\",\"Korea South\",\"West US\",\"East US\",\"Japan West\",\"Japan East\",\"East Asia\",\"East US 2\",\"North Central US\",\"South Central US\",\"Brazil South\",\"Australia East\",\"Australia Southeast\",\"West India\",\"Central India\",\"South India\",\"Canada Central\",\"Canada East\",\"West Central US\",\"UK West\",\"UK South\",\"West US 2\",\"MSFT West US\",\"MSFT East US\",\"MSFT East Asia\",\"MSFT North Europe\",\"East US 2 (Stage)\",\"East Asia (Stage)\",\"Central US (Stage)\",\"North Central US (Stage)\",\"France Central\",\"South Africa North\",\"Australia Central\",\"Switzerland North\",\"Germany West Central\",\"Norway East\",\"East US 2 EUAP\",\"Central US EUAP\"],\"apiVersions\":[\"2019-08-01\",\"2018-11-01\",\"2018-02-01\",\"2016-03-01\",\"2015-08-01\",\"2015-07-01\",\"2015-06-01\",\"2015-05-01\",\"2015-04-01\",\"2015-02-01\",\"2014-11-01\",\"2014-06-01\",\"2014-04-01-preview\",\"2014-04-01\"],\"apiProfiles\":[{\"profileVersion\":\"2017-03-09-profile\",\"apiVersion\":\"2016-03-01\"},{\"profileVersion\":\"2018-03-01-hybrid\",\"apiVersion\":\"2016-03-01\"},{\"profileVersion\":\"2018-06-01-profile\",\"apiVersion\":\"2018-02-01\"},{\"profileVersion\":\"2019-03-01-hybrid\",\"apiVersion\":\"2018-02-01\"}],\"capabilities\":\"None\"},{\"resourceType\":\"serverFarms/eventGridFilters\",\"locations\":[\"South Central US\",\"MSFT West US\",\"MSFT East US\",\"MSFT East Asia\",\"MSFT North Europe\",\"East US 2 (Stage)\",\"Central US (Stage)\",\"South Africa North\",\"Australia East\",\"Brazil South\",\"Southeast Asia\",\"Central US\",\"Japan West\",\"Central India\",\"UK South\",\"Canada East\",\"Korea Central\",\"France Central\",\"North Europe\",\"West US 2\",\"West India\",\"East US 2\",\"Australia Central\",\"Germany West Central\",\"Norway West\",\"Norway East\",\"Switzerland North\",\"North Central US\",\"UK West\",\"Australia Southeast\",\"Korea South\",\"Canada Central\",\"West Europe\",\"South India\",\"West Central US\",\"East Asia (Stage)\",\"North Central US (Stage)\",\"East Asia\",\"Japan East\",\"South Africa West\",\"East US 2 EUAP\",\"Central US EUAP\",\"West US\",\"East US\"],\"apiVersions\":[\"2019-08-01\",\"2018-11-01\",\"2018-02-01\",\"2017-08-01\",\"2016-09-01\",\"2016-03-01\",\"2015-08-01\",\"2015-07-01\",\"2015-06-01\",\"2015-05-01\",\"2015-04-01\",\"2015-02-01\",\"2014-11-01\",\"2014-06-01\",\"2014-04-01-preview\",\"2014-04-01\"],\"capabilities\":\"None\"},{\"resourceType\":\"sites/eventGridFilters\",\"locations\":[\"South Central US\",\"MSFT West US\",\"MSFT East US\",\"MSFT East Asia\",\"MSFT North Europe\",\"East US 2 (Stage)\",\"Central US (Stage)\",\"South Africa North\",\"Australia East\",\"Brazil South\",\"Southeast Asia\",\"Central US\",\"Japan West\",\"Central India\",\"UK South\",\"Canada East\",\"Korea Central\",\"France Central\",\"North Europe\",\"West US 2\",\"West India\",\"East US 2\",\"Australia Central\",\"Germany West Central\",\"Norway West\",\"Norway East\",\"Switzerland North\",\"North Central US\",\"UK West\",\"Australia Southeast\",\"Korea South\",\"Canada Central\",\"West Europe\",\"South India\",\"West Central US\",\"East Asia (Stage)\",\"North Central US (Stage)\",\"East Asia\",\"Japan East\",\"South Africa West\",\"East US 2 EUAP\",\"Central US EUAP\",\"West US\",\"East US\"],\"apiVersions\":[\"2019-08-01\",\"2018-11-01\",\"2018-02-01\",\"2017-08-01\",\"2016-09-01\",\"2016-08-01\",\"2016-03-01\",\"2015-11-01\",\"2015-08-01-preview\",\"2015-08-01\",\"2015-07-01\",\"2015-06-01\",\"2015-05-01\",\"2015-04-01\",\"2015-02-01\",\"2015-01-01\",\"2014-11-01\",\"2014-06-01\",\"2014-04-01-preview\",\"2014-04-01\"],\"capabilities\":\"None\"},{\"resourceType\":\"sites/slots/eventGridFilters\",\"locations\":[\"South Central US\",\"MSFT West US\",\"MSFT East US\",\"MSFT East Asia\",\"MSFT North Europe\",\"East US 2 (Stage)\",\"Central US (Stage)\",\"South Africa North\",\"Australia East\",\"Brazil South\",\"Southeast Asia\",\"Central US\",\"Japan West\",\"Central India\",\"UK South\",\"Canada East\",\"Korea Central\",\"France Central\",\"North Europe\",\"West US 2\",\"West India\",\"East US 2\",\"Australia Central\",\"Germany West Central\",\"Norway West\",\"Norway East\",\"Switzerland North\",\"North Central US\",\"UK West\",\"Australia Southeast\",\"Korea South\",\"Canada Central\",\"West Europe\",\"South India\",\"West Central US\",\"East Asia (Stage)\",\"North Central US (Stage)\",\"East Asia\",\"Japan East\",\"South Africa West\",\"East US 2 EUAP\",\"Central US EUAP\",\"West US\",\"East US\"],\"apiVersions\":[\"2019-08-01\",\"2018-11-01\",\"2018-02-01\",\"2017-08-01\",\"2016-09-01\",\"2016-08-01\",\"2016-03-01\",\"2015-11-01\",\"2015-08-01\",\"2015-07-01\",\"2015-06-01\",\"2015-05-01\",\"2015-04-01\",\"2015-02-01\",\"2015-01-01\",\"2014-11-01\",\"2014-06-01\",\"2014-04-01-preview\",\"2014-04-01\"],\"capabilities\":\"None\"},{\"resourceType\":\"hostingEnvironments/eventGridFilters\",\"locations\":[\"North Central US\",\"South Central US\",\"Brazil South\",\"Canada East\",\"UK West\",\"MSFT West US\",\"MSFT East US\",\"MSFT East Asia\",\"MSFT North Europe\",\"East US 2 (Stage)\",\"Central US (Stage)\",\"South Africa North\",\"West US 2\",\"East US 2\",\"UK South\",\"Southeast Asia\",\"North Europe\",\"Japan East\",\"West Europe\",\"East Asia\",\"Australia East\",\"Central US\",\"Japan West\",\"Central India\",\"Korea Central\",\"France Central\",\"West India\",\"Australia Central\",\"Germany West Central\",\"Norway East\",\"Switzerland North\",\"Australia Southeast\",\"Korea South\",\"Canada Central\",\"South India\",\"West Central US\",\"East Asia (Stage)\",\"North Central US (Stage)\",\"West US\",\"East US\",\"East US 2 EUAP\",\"Central US EUAP\"],\"apiVersions\":[\"2019-08-01\",\"2019-02-01\",\"2019-01-01\",\"2018-11-01\",\"2018-08-01\",\"2018-05-01-preview\",\"2018-02-01\",\"2017-08-01\",\"2016-09-01\",\"2016-03-01\",\"2015-08-01\",\"2015-07-01\",\"2015-06-01\",\"2015-05-01\",\"2015-04-01\",\"2015-02-01\",\"2014-11-01\",\"2014-06-01\",\"2014-04-01\"],\"capabilities\":\"None\"}],\"registrationState\":\"Registered\",\"registrationPolicy\":\"RegistrationRequired\"}" + } + }, { + "Method" : "PUT", + "Uri" : "http://localhost:1234/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg72b81582/providers/Microsoft.Web//sites/rs72b81582?api-version=2019-08-01", + "Headers" : { + "User-Agent" : "azsdk-java-com.azure.resourcemanager.resources/2.0.0-SNAPSHOT (14.0.1; Windows 10 10.0)", + "Content-Type" : "application/json" + }, + "Response" : { + "date" : "Wed, 08 Jul 2020 03:29:26 GMT", + "server" : "Microsoft-IIS/10.0", + "content-length" : "5230", + "expires" : "-1", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "x-ms-correlation-request-id" : "01db4fcc-805f-4567-8167-d6157363a816", + "strict-transport-security" : "max-age=31536000; includeSubDomains", + "x-content-type-options" : "nosniff", + "x-ms-ratelimit-remaining-subscription-resource-requests" : "499", + "x-ms-routing-request-id" : "SOUTHEASTASIA:20200708T032926Z:01db4fcc-805f-4567-8167-d6157363a816", + "x-powered-by" : "ASP.NET", + "etag" : "\"1D654D7F0FCA7C0\"", + "content-type" : "application/json", + "cache-control" : "no-cache", + "x-ms-request-id" : "5e325e97-9bc3-4f7b-bee2-1fd25e272df0", + "Body" : "{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg72b81582/providers/Microsoft.Web/sites/rs72b81582\",\"name\":\"rs72b81582\",\"type\":\"Microsoft.Web/sites\",\"kind\":\"app\",\"location\":\"southcentralus\",\"tags\":{},\"properties\":{\"name\":\"rs72b81582\",\"state\":\"Running\",\"hostNames\":[\"rs72b81582.azurewebsites.net\"],\"webSpace\":\"rg72b81582-SouthCentralUSwebspace\",\"selfLink\":\"https://waws-prod-sn1-127.api.azurewebsites.windows.net:454/subscriptions/00000000-0000-0000-0000-000000000000/webspaces/rg72b81582-SouthCentralUSwebspace/sites/rs72b81582\",\"repositorySiteName\":\"rs72b81582\",\"owner\":null,\"usageState\":\"Normal\",\"enabled\":true,\"adminEnabled\":true,\"enabledHostNames\":[\"rs72b81582.azurewebsites.net\",\"rs72b81582.scm.azurewebsites.net\"],\"siteProperties\":{\"metadata\":null,\"properties\":[{\"name\":\"LinuxFxVersion\",\"value\":\"\"},{\"name\":\"WindowsFxVersion\",\"value\":null}],\"appSettings\":null},\"availabilityState\":\"Normal\",\"sslCertificates\":null,\"csrs\":[],\"cers\":null,\"siteMode\":null,\"hostNameSslStates\":[{\"name\":\"rs72b81582.azurewebsites.net\",\"sslState\":\"Disabled\",\"ipBasedSslResult\":null,\"virtualIP\":null,\"thumbprint\":null,\"toUpdate\":null,\"toUpdateIpBasedSsl\":null,\"ipBasedSslState\":\"NotConfigured\",\"hostType\":\"Standard\"},{\"name\":\"rs72b81582.scm.azurewebsites.net\",\"sslState\":\"Disabled\",\"ipBasedSslResult\":null,\"virtualIP\":null,\"thumbprint\":null,\"toUpdate\":null,\"toUpdateIpBasedSsl\":null,\"ipBasedSslState\":\"NotConfigured\",\"hostType\":\"Repository\"}],\"computeMode\":null,\"serverFarm\":null,\"serverFarmId\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg72b81582/providers/Microsoft.Web/serverfarms/Default1pf\",\"reserved\":false,\"isXenon\":false,\"hyperV\":false,\"lastModifiedTimeUtc\":\"2020-07-08T03:29:08.99\",\"storageRecoveryDefaultState\":\"Running\",\"contentAvailabilityState\":\"Normal\",\"runtimeAvailabilityState\":\"Normal\",\"siteConfig\":{\"numberOfWorkers\":null,\"defaultDocuments\":null,\"netFrameworkVersion\":null,\"phpVersion\":null,\"pythonVersion\":null,\"nodeVersion\":null,\"powerShellVersion\":null,\"linuxFxVersion\":null,\"windowsFxVersion\":null,\"requestTracingEnabled\":null,\"remoteDebuggingEnabled\":null,\"remoteDebuggingVersion\":null,\"httpLoggingEnabled\":null,\"azureMonitorLogCategories\":null,\"acrUseManagedIdentityCreds\":false,\"acrUserManagedIdentityID\":null,\"logsDirectorySizeLimit\":null,\"detailedErrorLoggingEnabled\":null,\"publishingUsername\":null,\"publishingPassword\":null,\"appSettings\":null,\"metadata\":null,\"connectionStrings\":null,\"machineKey\":null,\"handlerMappings\":null,\"documentRoot\":null,\"scmType\":null,\"use32BitWorkerProcess\":null,\"webSocketsEnabled\":null,\"alwaysOn\":null,\"javaVersion\":null,\"javaContainer\":null,\"javaContainerVersion\":null,\"appCommandLine\":null,\"managedPipelineMode\":null,\"virtualApplications\":null,\"winAuthAdminState\":null,\"winAuthTenantState\":null,\"customAppPoolIdentityAdminState\":null,\"customAppPoolIdentityTenantState\":null,\"runtimeADUser\":null,\"runtimeADUserPassword\":null,\"loadBalancing\":null,\"routingRules\":null,\"experiments\":null,\"limits\":null,\"autoHealEnabled\":null,\"autoHealRules\":null,\"tracingOptions\":null,\"vnetName\":null,\"cors\":null,\"push\":null,\"apiDefinition\":null,\"apiManagementConfig\":null,\"autoSwapSlotName\":null,\"localMySqlEnabled\":null,\"managedServiceIdentityId\":null,\"xManagedServiceIdentityId\":null,\"ipSecurityRestrictions\":[{\"ipAddress\":\"Any\",\"action\":\"Allow\",\"priority\":1,\"name\":\"Allow all\",\"description\":\"Allow all access\"}],\"scmIpSecurityRestrictions\":[{\"ipAddress\":\"Any\",\"action\":\"Allow\",\"priority\":1,\"name\":\"Allow all\",\"description\":\"Allow all access\"}],\"scmIpSecurityRestrictionsUseMain\":null,\"http20Enabled\":null,\"minTlsVersion\":null,\"ftpsState\":null,\"preWarmedInstanceCount\":null,\"healthCheckPath\":null,\"fileChangeAuditEnabled\":null,\"functionsRuntimeScaleMonitoringEnabled\":null,\"websiteTimeZone\":null,\"minimumElasticInstanceCount\":0},\"deploymentId\":\"rs72b81582\",\"trafficManagerHostNames\":null,\"sku\":\"Free\",\"scmSiteAlsoStopped\":false,\"targetSwapSlot\":null,\"hostingEnvironment\":null,\"hostingEnvironmentProfile\":null,\"clientAffinityEnabled\":true,\"clientCertEnabled\":false,\"clientCertMode\":\"Required\",\"clientCertExclusionPaths\":null,\"hostNamesDisabled\":false,\"domainVerificationIdentifiers\":null,\"customDomainVerificationId\":\"0FFA32248F34E67BEAA6BC639753005F4F7BED4F59950F668037EEAB327F1054\",\"kind\":\"app\",\"inboundIpAddress\":\"52.171.218.239\",\"possibleInboundIpAddresses\":\"52.171.218.239\",\"ftpUsername\":\"rs72b81582\\\\$rs72b81582\",\"ftpsHostName\":\"ftps://waws-prod-sn1-127.ftp.azurewebsites.windows.net/site/wwwroot\",\"outboundIpAddresses\":\"52.171.218.239,52.171.223.92,52.171.217.31,52.171.216.93,52.171.220.134\",\"possibleOutboundIpAddresses\":\"52.171.218.239,52.171.223.92,52.171.217.31,52.171.216.93,52.171.220.134,40.84.145.193,23.98.149.67,23.98.148.122\",\"containerSize\":0,\"dailyMemoryTimeQuota\":0,\"suspendedTill\":null,\"siteDisabledReason\":0,\"functionExecutionUnitsCache\":null,\"maxNumberOfWorkers\":null,\"homeStamp\":\"waws-prod-sn1-127\",\"cloningInfo\":null,\"hostingEnvironmentId\":null,\"tags\":{},\"resourceGroup\":\"rg72b81582\",\"defaultHostName\":\"rs72b81582.azurewebsites.net\",\"slotSwapStatus\":null,\"httpsOnly\":false,\"redundancyMode\":\"None\",\"inProgressOperationId\":null,\"geoDistributions\":null,\"privateEndpointConnections\":null,\"buildVersion\":null,\"targetBuildVersion\":null}}" + } + }, { + "Method" : "GET", + "Uri" : "http://localhost:1234/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg72b81582/resources?$expand=provisioningState&api-version=2019-08-01", + "Headers" : { + "User-Agent" : "azsdk-java-com.azure.resourcemanager.resources/2.0.0-SNAPSHOT (14.0.1; Windows 10 10.0)", + "Content-Type" : "application/json" + }, + "Response" : { + "date" : "Wed, 08 Jul 2020 03:29:26 GMT", + "content-length" : "271", + "expires" : "-1", + "retry-after" : "0", + "x-ms-ratelimit-remaining-subscription-reads" : "11998", + "StatusCode" : "200", + "strict-transport-security" : "max-age=31536000; includeSubDomains", + "pragma" : "no-cache", + "x-ms-correlation-request-id" : "75892b78-a29b-45c1-84b8-9b16d2057b8e", + "x-content-type-options" : "nosniff", + "x-ms-routing-request-id" : "SOUTHEASTASIA:20200708T032927Z:75892b78-a29b-45c1-84b8-9b16d2057b8e", + "content-type" : "application/json; charset=utf-8", + "cache-control" : "no-cache", + "x-ms-request-id" : "75892b78-a29b-45c1-84b8-9b16d2057b8e", + "Body" : "{\"value\":[{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg72b81582/providers/Microsoft.Web/sites/rs72b81582\",\"name\":\"rs72b81582\",\"type\":\"Microsoft.Web/sites\",\"kind\":\"app\",\"location\":\"southcentralus\",\"provisioningState\":\"Succeeded\",\"tags\":{}}]}" + } + }, { + "Method" : "GET", + "Uri" : "http://localhost:1234/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Web?api-version=2019-08-01", + "Headers" : { + "User-Agent" : "azsdk-java-com.azure.resourcemanager.resources/2.0.0-SNAPSHOT (14.0.1; Windows 10 10.0)", + "Content-Type" : "application/json" + }, + "Response" : { + "date" : "Wed, 08 Jul 2020 03:29:27 GMT", + "content-length" : "54768", + "expires" : "-1", + "retry-after" : "0", + "x-ms-ratelimit-remaining-subscription-reads" : "11997", + "StatusCode" : "200", + "strict-transport-security" : "max-age=31536000; includeSubDomains", + "pragma" : "no-cache", + "x-ms-correlation-request-id" : "5434697f-d488-4e46-b187-2a411197e02f", + "x-content-type-options" : "nosniff", + "x-ms-routing-request-id" : "SOUTHEASTASIA:20200708T032927Z:5434697f-d488-4e46-b187-2a411197e02f", + "content-type" : "application/json; charset=utf-8", + "cache-control" : "no-cache", + "x-ms-request-id" : "5434697f-d488-4e46-b187-2a411197e02f", + "Body" : "{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Web\",\"namespace\":\"Microsoft.Web\",\"authorization\":{\"applicationId\":\"abfa0a7c-a6b6-4736-8310-5855508787cd\",\"roleDefinitionId\":\"f47ed98b-b063-4a5b-9e10-4b9b44fa7735\"},\"resourceTypes\":[{\"resourceType\":\"publishingUsers\",\"locations\":[\"Central US\",\"North Europe\",\"West Europe\",\"Southeast Asia\",\"Korea Central\",\"Korea South\",\"West US\",\"East US\",\"Japan West\",\"Japan East\",\"East Asia\",\"East US 2\",\"North Central US\",\"South Central US\",\"Brazil South\",\"Australia East\",\"Australia Southeast\",\"West India\",\"Central India\",\"South India\",\"Canada Central\",\"Canada East\",\"West Central US\",\"UK West\",\"UK South\",\"West US 2\",\"MSFT West US\",\"MSFT East US\",\"MSFT East Asia\",\"MSFT North Europe\",\"East US 2 (Stage)\",\"East Asia (Stage)\",\"Central US (Stage)\",\"North Central US (Stage)\",\"France Central\",\"South Africa North\",\"Australia Central\",\"Switzerland North\",\"Germany West Central\",\"Norway East\",\"East US 2 EUAP\",\"Central US EUAP\"],\"apiVersions\":[\"2019-08-01\",\"2018-11-01\",\"2018-02-01\",\"2016-03-01\",\"2015-08-01\",\"2015-07-01\",\"2015-06-01\",\"2015-05-01\",\"2015-04-01\",\"2015-02-01\",\"2014-11-01\",\"2014-06-01\",\"2014-04-01-preview\",\"2014-04-01\"],\"apiProfiles\":[{\"profileVersion\":\"2017-03-09-profile\",\"apiVersion\":\"2016-03-01\"},{\"profileVersion\":\"2018-03-01-hybrid\",\"apiVersion\":\"2016-03-01\"},{\"profileVersion\":\"2018-06-01-profile\",\"apiVersion\":\"2016-03-01\"},{\"profileVersion\":\"2019-03-01-hybrid\",\"apiVersion\":\"2018-02-01\"}],\"capabilities\":\"None\"},{\"resourceType\":\"ishostnameavailable\",\"locations\":[\"Central US\",\"North Europe\",\"West Europe\",\"Southeast Asia\",\"Korea Central\",\"Korea South\",\"West US\",\"East US\",\"Japan West\",\"Japan East\",\"East Asia\",\"East US 2\",\"North Central US\",\"South Central US\",\"Brazil South\",\"Australia East\",\"Australia Southeast\",\"West India\",\"Central India\",\"South India\",\"Canada Central\",\"Canada East\",\"West Central US\",\"UK West\",\"UK South\",\"West US 2\",\"MSFT West US\",\"MSFT East US\",\"MSFT East Asia\",\"MSFT North Europe\",\"East US 2 (Stage)\",\"East Asia (Stage)\",\"Central US (Stage)\",\"North Central US (Stage)\",\"France Central\",\"South Africa North\",\"Australia Central\",\"Switzerland North\",\"Germany West Central\",\"Norway East\",\"East US 2 EUAP\",\"Central US EUAP\"],\"apiVersions\":[\"2019-08-01\",\"2018-11-01\",\"2018-02-01\",\"2016-03-01\",\"2015-08-01\",\"2015-07-01\",\"2015-06-01\",\"2015-05-01\",\"2015-04-01\",\"2015-02-01\",\"2014-11-01\",\"2014-06-01\",\"2014-04-01-preview\",\"2014-04-01\"],\"apiProfiles\":[{\"profileVersion\":\"2017-03-09-profile\",\"apiVersion\":\"2016-03-01\"},{\"profileVersion\":\"2018-03-01-hybrid\",\"apiVersion\":\"2016-03-01\"},{\"profileVersion\":\"2018-06-01-profile\",\"apiVersion\":\"2016-03-01\"},{\"profileVersion\":\"2019-03-01-hybrid\",\"apiVersion\":\"2018-02-01\"}],\"capabilities\":\"None\"},{\"resourceType\":\"validate\",\"locations\":[\"Central US\",\"North Europe\",\"West Europe\",\"Southeast Asia\",\"Korea Central\",\"Korea South\",\"West US\",\"East US\",\"Japan West\",\"Japan East\",\"East Asia\",\"East US 2\",\"North Central US\",\"South Central US\",\"Brazil South\",\"Australia East\",\"Australia Southeast\",\"West India\",\"Central India\",\"South India\",\"Canada Central\",\"Canada East\",\"West Central US\",\"West US 2\",\"MSFT West US\",\"MSFT East US\",\"MSFT East Asia\",\"MSFT North Europe\",\"East US 2 (Stage)\",\"East Asia (Stage)\",\"Central US (Stage)\",\"North Central US (Stage)\",\"France Central\",\"South Africa North\",\"Australia Central\",\"Switzerland North\",\"Germany West Central\",\"Norway East\",\"East US 2 EUAP\",\"Central US EUAP\"],\"apiVersions\":[\"2019-08-01\",\"2018-11-01\",\"2018-02-01\",\"2016-03-01\",\"2015-08-01\",\"2015-07-01\",\"2015-06-01\",\"2015-05-01\",\"2015-04-01\",\"2015-02-01\",\"2014-11-01\",\"2014-06-01\",\"2014-04-01-preview\",\"2014-04-01\"],\"apiProfiles\":[{\"profileVersion\":\"2017-03-09-profile\",\"apiVersion\":\"2016-03-01\"},{\"profileVersion\":\"2018-03-01-hybrid\",\"apiVersion\":\"2016-03-01\"},{\"profileVersion\":\"2018-06-01-profile\",\"apiVersion\":\"2016-03-01\"},{\"profileVersion\":\"2019-03-01-hybrid\",\"apiVersion\":\"2018-02-01\"}],\"capabilities\":\"None\"},{\"resourceType\":\"isusernameavailable\",\"locations\":[\"Central US\",\"North Europe\",\"West Europe\",\"Southeast Asia\",\"Korea Central\",\"Korea South\",\"West US\",\"East US\",\"Japan West\",\"Japan East\",\"East Asia\",\"East US 2\",\"North Central US\",\"South Central US\",\"Brazil South\",\"Australia East\",\"Australia Southeast\",\"West India\",\"Central India\",\"South India\",\"Canada Central\",\"Canada East\",\"West Central US\",\"UK West\",\"UK South\",\"West US 2\",\"MSFT West US\",\"MSFT East US\",\"MSFT East Asia\",\"MSFT North Europe\",\"East US 2 (Stage)\",\"East Asia (Stage)\",\"Central US (Stage)\",\"North Central US (Stage)\",\"France Central\",\"South Africa North\",\"Australia Central\",\"Switzerland North\",\"Germany West Central\",\"Norway East\",\"East US 2 EUAP\",\"Central US EUAP\"],\"apiVersions\":[\"2019-08-01\",\"2018-11-01\",\"2018-02-01\",\"2016-03-01\",\"2015-08-01\",\"2015-07-01\",\"2015-06-01\",\"2015-05-01\",\"2015-04-01\",\"2015-02-01\",\"2014-11-01\",\"2014-06-01\",\"2014-04-01-preview\",\"2014-04-01\"],\"apiProfiles\":[{\"profileVersion\":\"2017-03-09-profile\",\"apiVersion\":\"2016-03-01\"},{\"profileVersion\":\"2018-03-01-hybrid\",\"apiVersion\":\"2016-03-01\"},{\"profileVersion\":\"2018-06-01-profile\",\"apiVersion\":\"2016-03-01\"},{\"profileVersion\":\"2019-03-01-hybrid\",\"apiVersion\":\"2018-02-01\"}],\"capabilities\":\"None\"},{\"resourceType\":\"sourceControls\",\"locations\":[\"Central US\",\"North Europe\",\"West Europe\",\"Southeast Asia\",\"Korea Central\",\"Korea South\",\"West US\",\"East US\",\"Japan West\",\"Japan East\",\"East Asia\",\"East US 2\",\"North Central US\",\"South Central US\",\"Brazil South\",\"Australia East\",\"Australia Southeast\",\"West India\",\"Central India\",\"South India\",\"Canada Central\",\"Canada East\",\"West Central US\",\"UK West\",\"UK South\",\"West US 2\",\"MSFT West US\",\"MSFT East US\",\"MSFT East Asia\",\"MSFT North Europe\",\"East US 2 (Stage)\",\"East Asia (Stage)\",\"Central US (Stage)\",\"North Central US (Stage)\",\"France Central\",\"South Africa North\",\"Australia Central\",\"Switzerland North\",\"Germany West Central\",\"Norway East\",\"East US 2 EUAP\",\"Central US EUAP\"],\"apiVersions\":[\"2019-08-01\",\"2018-11-01\",\"2018-02-01\",\"2016-03-01\",\"2015-08-01\",\"2015-07-01\",\"2015-06-01\",\"2015-05-01\",\"2015-04-01\",\"2015-02-01\",\"2014-11-01\",\"2014-06-01\",\"2014-04-01-preview\",\"2014-04-01\"],\"apiProfiles\":[{\"profileVersion\":\"2017-03-09-profile\",\"apiVersion\":\"2016-03-01\"},{\"profileVersion\":\"2018-03-01-hybrid\",\"apiVersion\":\"2016-03-01\"},{\"profileVersion\":\"2018-06-01-profile\",\"apiVersion\":\"2016-03-01\"},{\"profileVersion\":\"2019-03-01-hybrid\",\"apiVersion\":\"2018-02-01\"}],\"capabilities\":\"None\"},{\"resourceType\":\"availableStacks\",\"locations\":[\"Central US\",\"North Europe\",\"West Europe\",\"Southeast Asia\",\"Korea Central\",\"Korea South\",\"West US\",\"East US\",\"Japan West\",\"Japan East\",\"East Asia\",\"East US 2\",\"North Central US\",\"South Central US\",\"Brazil South\",\"Australia East\",\"Australia Southeast\",\"West India\",\"Central India\",\"South India\",\"Canada Central\",\"Canada East\",\"West Central US\",\"UK West\",\"UK South\",\"West US 2\",\"MSFT West US\",\"MSFT East US\",\"MSFT East Asia\",\"MSFT North Europe\",\"East US 2 (Stage)\",\"East Asia (Stage)\",\"Central US (Stage)\",\"North Central US (Stage)\",\"France Central\",\"South Africa North\",\"Australia Central\",\"Switzerland North\",\"Germany West Central\",\"Norway East\",\"East US 2 EUAP\",\"Central US EUAP\"],\"apiVersions\":[\"2019-08-01\",\"2018-11-01\",\"2018-02-01\",\"2016-03-01\",\"2015-08-01\",\"2015-07-01\",\"2015-06-01\",\"2015-05-01\",\"2015-04-01\",\"2015-02-01\",\"2014-11-01\",\"2014-06-01\",\"2014-04-01-preview\",\"2014-04-01\"],\"apiProfiles\":[{\"profileVersion\":\"2017-03-09-profile\",\"apiVersion\":\"2016-03-01\"},{\"profileVersion\":\"2018-03-01-hybrid\",\"apiVersion\":\"2016-03-01\"},{\"profileVersion\":\"2018-06-01-profile\",\"apiVersion\":\"2016-03-01\"},{\"profileVersion\":\"2019-03-01-hybrid\",\"apiVersion\":\"2018-02-01\"}],\"capabilities\":\"None\"},{\"resourceType\":\"staticSites\",\"locations\":[\"West US 2\",\"Central US\",\"East US 2\",\"West Europe\",\"East Asia\"],\"apiVersions\":[\"2019-12-01-preview\",\"2019-08-01\"],\"capabilities\":\"SupportsTags, SupportsLocation\"},{\"resourceType\":\"listSitesAssignedToHostName\",\"locations\":[\"Central US\",\"North Europe\",\"West Europe\",\"Southeast Asia\",\"Korea Central\",\"Korea South\",\"West US\",\"East US\",\"Japan West\",\"Japan East\",\"East Asia\",\"East US 2\",\"North Central US\",\"South Central US\",\"Brazil South\",\"Australia East\",\"Australia Southeast\",\"West India\",\"Central India\",\"South India\",\"Canada Central\",\"Canada East\",\"West Central US\",\"UK West\",\"UK South\",\"West US 2\",\"MSFT West US\",\"MSFT East US\",\"MSFT East Asia\",\"MSFT North Europe\",\"East US 2 (Stage)\",\"East Asia (Stage)\",\"Central US (Stage)\",\"North Central US (Stage)\",\"France Central\",\"South Africa North\",\"Australia Central\",\"Switzerland North\",\"Germany West Central\",\"Norway East\",\"East US 2 EUAP\",\"Central US EUAP\"],\"apiVersions\":[\"2019-08-01\",\"2018-11-01\",\"2018-02-01\",\"2016-03-01\",\"2015-08-01\",\"2015-07-01\",\"2015-06-01\",\"2015-05-01\",\"2015-04-01\",\"2015-02-01\"],\"apiProfiles\":[{\"profileVersion\":\"2017-03-09-profile\",\"apiVersion\":\"2016-03-01\"},{\"profileVersion\":\"2018-03-01-hybrid\",\"apiVersion\":\"2016-03-01\"},{\"profileVersion\":\"2018-06-01-profile\",\"apiVersion\":\"2016-03-01\"},{\"profileVersion\":\"2019-03-01-hybrid\",\"apiVersion\":\"2018-02-01\"}],\"capabilities\":\"None\"},{\"resourceType\":\"locations/getNetworkPolicies\",\"locations\":[\"Central US\",\"North Europe\",\"West Europe\",\"Southeast Asia\",\"Korea Central\",\"Korea South\",\"West US\",\"East US\",\"Japan West\",\"Japan East\",\"East Asia\",\"East US 2\",\"North Central US\",\"South Central US\",\"Brazil South\",\"Australia East\",\"Australia Southeast\",\"West India\",\"Central India\",\"South India\",\"Canada Central\",\"Canada East\",\"UK West\",\"UK South\",\"West US 2\",\"MSFT West US\",\"MSFT East US\",\"MSFT East Asia\",\"MSFT North Europe\",\"East US 2 (Stage)\",\"Central US (Stage)\",\"France Central\",\"West Central US\",\"East Asia (Stage)\",\"North Central US (Stage)\",\"East US 2 EUAP\",\"Central US EUAP\"],\"apiVersions\":[\"2019-08-01\",\"2018-02-01\",\"2016-08-01\"],\"defaultApiVersion\":\"2018-02-01\",\"apiProfiles\":[{\"profileVersion\":\"2017-03-09-profile\",\"apiVersion\":\"2016-08-01\"},{\"profileVersion\":\"2018-03-01-hybrid\",\"apiVersion\":\"2016-08-01\"},{\"profileVersion\":\"2018-06-01-profile\",\"apiVersion\":\"2018-02-01\"},{\"profileVersion\":\"2019-03-01-hybrid\",\"apiVersion\":\"2018-02-01\"}],\"capabilities\":\"None\"},{\"resourceType\":\"locations/operations\",\"locations\":[\"South Central US\",\"MSFT West US\",\"MSFT East US\",\"MSFT East Asia\",\"MSFT North Europe\",\"East US 2 (Stage)\",\"Central US (Stage)\",\"South Africa North\",\"West US 2\",\"East US 2\",\"East US\",\"UK South\",\"Southeast Asia\",\"North Europe\",\"Japan East\",\"West Europe\",\"East Asia\",\"West US\",\"Australia East\",\"Brazil South\",\"Central US\",\"Japan West\",\"Central India\",\"Canada East\",\"Korea Central\",\"France Central\",\"West India\",\"Australia Central\",\"Germany West Central\",\"Norway East\",\"Switzerland North\",\"North Central US\",\"UK West\",\"Australia Southeast\",\"Korea South\",\"Canada Central\",\"South India\",\"West Central US\",\"East Asia (Stage)\",\"North Central US (Stage)\",\"East US 2 EUAP\",\"Central US EUAP\"],\"apiVersions\":[\"2019-12-01-preview\",\"2019-08-01\",\"2019-01-01\",\"2018-11-01\",\"2018-02-01\",\"2016-08-01\"],\"defaultApiVersion\":\"2019-01-01\",\"apiProfiles\":[{\"profileVersion\":\"2017-03-09-profile\",\"apiVersion\":\"2016-08-01\"},{\"profileVersion\":\"2018-03-01-hybrid\",\"apiVersion\":\"2016-08-01\"},{\"profileVersion\":\"2018-06-01-profile\",\"apiVersion\":\"2018-02-01\"},{\"profileVersion\":\"2019-03-01-hybrid\",\"apiVersion\":\"2018-02-01\"}],\"capabilities\":\"None\"},{\"resourceType\":\"locations/operationResults\",\"locations\":[\"South Central US\",\"MSFT West US\",\"MSFT East US\",\"MSFT East Asia\",\"MSFT North Europe\",\"East US 2 (Stage)\",\"Central US (Stage)\",\"South Africa North\",\"West US 2\",\"East US 2\",\"East US\",\"UK South\",\"Southeast Asia\",\"North Europe\",\"Japan East\",\"West Europe\",\"East Asia\",\"West US\",\"Australia East\",\"Brazil South\",\"Central US\",\"Japan West\",\"Central India\",\"Canada East\",\"Korea Central\",\"France Central\",\"West India\",\"Australia Central\",\"Germany West Central\",\"Norway East\",\"Switzerland North\",\"North Central US\",\"UK West\",\"Australia Southeast\",\"Korea South\",\"Canada Central\",\"South India\",\"West Central US\",\"East Asia (Stage)\",\"North Central US (Stage)\",\"East US 2 EUAP\",\"Central US EUAP\"],\"apiVersions\":[\"2019-12-01-preview\",\"2019-08-01\",\"2019-01-01\",\"2018-11-01\",\"2018-02-01\",\"2016-08-01\"],\"defaultApiVersion\":\"2019-01-01\",\"apiProfiles\":[{\"profileVersion\":\"2017-03-09-profile\",\"apiVersion\":\"2016-08-01\"},{\"profileVersion\":\"2018-03-01-hybrid\",\"apiVersion\":\"2016-08-01\"},{\"profileVersion\":\"2018-06-01-profile\",\"apiVersion\":\"2018-02-01\"},{\"profileVersion\":\"2019-03-01-hybrid\",\"apiVersion\":\"2018-02-01\"}],\"capabilities\":\"None\"},{\"resourceType\":\"sites/networkConfig\",\"locations\":[\"South Central US\",\"MSFT West US\",\"MSFT East US\",\"MSFT East Asia\",\"MSFT North Europe\",\"East US 2 (Stage)\",\"Central US (Stage)\",\"South Africa North\",\"East Asia\",\"Japan East\",\"Australia East\",\"Brazil South\",\"Southeast Asia\",\"Central US\",\"Japan West\",\"Central India\",\"UK South\",\"Canada East\",\"Korea Central\",\"France Central\",\"North Europe\",\"West US 2\",\"West India\",\"East US 2\",\"Australia Central\",\"Germany West Central\",\"Norway East\",\"Switzerland North\",\"North Central US\",\"UK West\",\"Australia Southeast\",\"Korea South\",\"Canada Central\",\"West Europe\",\"South India\",\"West Central US\",\"East Asia (Stage)\",\"North Central US (Stage)\",\"West US\",\"East US\",\"East US 2 EUAP\",\"Central US EUAP\"],\"apiVersions\":[\"2019-08-01\",\"2018-11-01\",\"2018-02-01\",\"2016-08-01\",\"2016-03-01\",\"2015-08-01\",\"2015-07-01\",\"2015-06-01\",\"2015-05-01\",\"2015-04-01\",\"2015-02-01\"],\"apiProfiles\":[{\"profileVersion\":\"2017-03-09-profile\",\"apiVersion\":\"2016-08-01\"},{\"profileVersion\":\"2018-03-01-hybrid\",\"apiVersion\":\"2016-08-01\"},{\"profileVersion\":\"2018-06-01-profile\",\"apiVersion\":\"2018-02-01\"},{\"profileVersion\":\"2019-03-01-hybrid\",\"apiVersion\":\"2018-02-01\"}],\"capabilities\":\"None\"},{\"resourceType\":\"sites/slots/networkConfig\",\"locations\":[\"South Central US\",\"MSFT West US\",\"MSFT East US\",\"MSFT East Asia\",\"MSFT North Europe\",\"East US 2 (Stage)\",\"Central US (Stage)\",\"South Africa North\",\"East Asia\",\"Japan East\",\"Australia East\",\"Brazil South\",\"Southeast Asia\",\"Central US\",\"Japan West\",\"Central India\",\"UK South\",\"Canada East\",\"Korea Central\",\"France Central\",\"North Europe\",\"West US 2\",\"West India\",\"East US 2\",\"Australia Central\",\"Germany West Central\",\"Norway East\",\"Switzerland North\",\"North Central US\",\"UK West\",\"Australia Southeast\",\"Korea South\",\"Canada Central\",\"West Europe\",\"South India\",\"West Central US\",\"East Asia (Stage)\",\"North Central US (Stage)\",\"West US\",\"East US\",\"East US 2 EUAP\",\"Central US EUAP\"],\"apiVersions\":[\"2019-08-01\",\"2018-11-01\",\"2018-02-01\",\"2016-08-01\",\"2016-03-01\",\"2015-08-01\",\"2015-07-01\",\"2015-06-01\",\"2015-05-01\",\"2015-04-01\",\"2015-02-01\"],\"apiProfiles\":[{\"profileVersion\":\"2017-03-09-profile\",\"apiVersion\":\"2016-08-01\"},{\"profileVersion\":\"2018-03-01-hybrid\",\"apiVersion\":\"2016-08-01\"},{\"profileVersion\":\"2018-06-01-profile\",\"apiVersion\":\"2018-02-01\"},{\"profileVersion\":\"2019-03-01-hybrid\",\"apiVersion\":\"2018-02-01\"}],\"capabilities\":\"None\"},{\"resourceType\":\"sites/hostNameBindings\",\"locations\":[\"South Central US\",\"MSFT West US\",\"MSFT East US\",\"MSFT East Asia\",\"MSFT North Europe\",\"East US 2 (Stage)\",\"Central US (Stage)\",\"South Africa North\",\"East Asia\",\"Japan East\",\"Australia East\",\"Brazil South\",\"Southeast Asia\",\"Central US\",\"Japan West\",\"Central India\",\"UK South\",\"Canada East\",\"Korea Central\",\"France Central\",\"North Europe\",\"West US 2\",\"West India\",\"East US 2\",\"Australia Central\",\"Germany West Central\",\"Norway East\",\"Switzerland North\",\"North Central US\",\"UK West\",\"Australia Southeast\",\"Korea South\",\"Canada Central\",\"West Europe\",\"South India\",\"West Central US\",\"East Asia (Stage)\",\"North Central US (Stage)\",\"West US\",\"East US\",\"East US 2 EUAP\",\"Central US EUAP\"],\"apiVersions\":[\"2019-08-01\",\"2018-11-01\",\"2018-02-01\",\"2016-08-01\",\"2016-03-01\",\"2015-08-01\",\"2015-07-01\",\"2015-06-01\",\"2015-05-01\",\"2015-04-01\",\"2015-02-01\"],\"apiProfiles\":[{\"profileVersion\":\"2017-03-09-profile\",\"apiVersion\":\"2016-08-01\"},{\"profileVersion\":\"2018-03-01-hybrid\",\"apiVersion\":\"2016-08-01\"},{\"profileVersion\":\"2018-06-01-profile\",\"apiVersion\":\"2018-02-01\"},{\"profileVersion\":\"2019-03-01-hybrid\",\"apiVersion\":\"2018-02-01\"}],\"capabilities\":\"None\"},{\"resourceType\":\"sites/slots/hostNameBindings\",\"locations\":[\"South Central US\",\"MSFT West US\",\"MSFT East US\",\"MSFT East Asia\",\"MSFT North Europe\",\"East US 2 (Stage)\",\"Central US (Stage)\",\"South Africa North\",\"East Asia\",\"Japan East\",\"Australia East\",\"Brazil South\",\"Southeast Asia\",\"Central US\",\"Japan West\",\"Central India\",\"UK South\",\"Canada East\",\"Korea Central\",\"France Central\",\"North Europe\",\"West US 2\",\"West India\",\"East US 2\",\"Australia Central\",\"Germany West Central\",\"Norway East\",\"Switzerland North\",\"North Central US\",\"UK West\",\"Australia Southeast\",\"Korea South\",\"Canada Central\",\"West Europe\",\"South India\",\"West Central US\",\"East Asia (Stage)\",\"North Central US (Stage)\",\"West US\",\"East US\",\"East US 2 EUAP\",\"Central US EUAP\"],\"apiVersions\":[\"2019-08-01\",\"2018-11-01\",\"2018-02-01\",\"2016-08-01\",\"2016-03-01\",\"2015-08-01\",\"2015-07-01\",\"2015-06-01\",\"2015-05-01\",\"2015-04-01\",\"2015-02-01\"],\"apiProfiles\":[{\"profileVersion\":\"2017-03-09-profile\",\"apiVersion\":\"2016-08-01\"},{\"profileVersion\":\"2018-03-01-hybrid\",\"apiVersion\":\"2016-08-01\"},{\"profileVersion\":\"2018-06-01-profile\",\"apiVersion\":\"2018-02-01\"},{\"profileVersion\":\"2019-03-01-hybrid\",\"apiVersion\":\"2018-02-01\"}],\"capabilities\":\"None\"},{\"resourceType\":\"operations\",\"locations\":[\"Central US\",\"North Europe\",\"West Europe\",\"Southeast Asia\",\"Korea Central\",\"Korea South\",\"West US\",\"East US\",\"Japan West\",\"Japan East\",\"East Asia\",\"East US 2\",\"North Central US\",\"South Central US\",\"Brazil South\",\"Australia East\",\"Australia Southeast\",\"West India\",\"Central India\",\"South India\",\"Canada Central\",\"Canada East\",\"West Central US\",\"UK West\",\"UK South\",\"West US 2\",\"MSFT West US\",\"MSFT East US\",\"MSFT East Asia\",\"MSFT North Europe\",\"East US 2 (Stage)\",\"East Asia (Stage)\",\"Central US (Stage)\",\"North Central US (Stage)\",\"France Central\",\"South Africa North\",\"Australia Central\",\"Switzerland North\",\"Germany West Central\",\"Norway East\",\"East US 2 EUAP\",\"Central US EUAP\"],\"apiVersions\":[\"2019-08-01\",\"2018-11-01\",\"2018-02-01\",\"2016-03-01\",\"2015-08-01\",\"2015-07-01\",\"2015-06-01\",\"2015-05-01\",\"2015-04-01\",\"2015-02-01\",\"2014-11-01\",\"2014-06-01\",\"2014-04-01-preview\",\"2014-04-01\"],\"apiProfiles\":[{\"profileVersion\":\"2017-03-09-profile\",\"apiVersion\":\"2016-03-01\"},{\"profileVersion\":\"2018-03-01-hybrid\",\"apiVersion\":\"2016-03-01\"},{\"profileVersion\":\"2018-06-01-profile\",\"apiVersion\":\"2018-02-01\"},{\"profileVersion\":\"2019-03-01-hybrid\",\"apiVersion\":\"2018-02-01\"}],\"capabilities\":\"None\"},{\"resourceType\":\"certificates\",\"locations\":[\"South Central US\",\"MSFT West US\",\"MSFT East US\",\"MSFT East Asia\",\"MSFT North Europe\",\"East US 2 (Stage)\",\"Central US (Stage)\",\"South Africa North\",\"East Asia\",\"Japan East\",\"Australia East\",\"Brazil South\",\"Southeast Asia\",\"Central US\",\"Japan West\",\"Central India\",\"UK South\",\"Canada East\",\"Korea Central\",\"France Central\",\"North Europe\",\"West US 2\",\"West India\",\"East US 2\",\"Australia Central\",\"Germany West Central\",\"Norway East\",\"Switzerland North\",\"North Central US\",\"UK West\",\"Australia Southeast\",\"Korea South\",\"Canada Central\",\"West Europe\",\"South India\",\"West Central US\",\"East Asia (Stage)\",\"North Central US (Stage)\",\"East US 2 EUAP\",\"Central US EUAP\",\"West US\",\"East US\"],\"apiVersions\":[\"2019-08-01\",\"2018-11-01\",\"2018-02-01\",\"2016-03-01\",\"2015-08-01-preview\",\"2015-08-01\",\"2015-07-01\",\"2015-06-01\",\"2015-05-01\",\"2015-04-01\",\"2015-02-01\",\"2014-11-01\",\"2014-06-01\",\"2014-04-01-preview\",\"2014-04-01\"],\"apiProfiles\":[{\"profileVersion\":\"2017-03-09-profile\",\"apiVersion\":\"2016-03-01\"},{\"profileVersion\":\"2018-03-01-hybrid\",\"apiVersion\":\"2016-03-01\"},{\"profileVersion\":\"2018-06-01-profile\",\"apiVersion\":\"2018-02-01\"},{\"profileVersion\":\"2019-03-01-hybrid\",\"apiVersion\":\"2018-02-01\"}],\"capabilities\":\"CrossSubscriptionResourceMove, SupportsTags, SupportsLocation\"},{\"resourceType\":\"serverFarms\",\"locations\":[\"South Central US\",\"MSFT West US\",\"MSFT East US\",\"MSFT East Asia\",\"MSFT North Europe\",\"East US 2 (Stage)\",\"Central US (Stage)\",\"South Africa North\",\"Australia East\",\"Brazil South\",\"Southeast Asia\",\"Central US\",\"Japan West\",\"Central India\",\"UK South\",\"Canada East\",\"Korea Central\",\"France Central\",\"North Europe\",\"West US 2\",\"West India\",\"East US 2\",\"Australia Central\",\"Germany West Central\",\"Norway East\",\"Switzerland North\",\"North Central US\",\"UK West\",\"Australia Southeast\",\"Korea South\",\"Canada Central\",\"West Europe\",\"South India\",\"West Central US\",\"East Asia (Stage)\",\"North Central US (Stage)\",\"East Asia\",\"Japan East\",\"East US 2 EUAP\",\"Central US EUAP\",\"West US\",\"East US\"],\"apiVersions\":[\"2019-08-01\",\"2018-11-01\",\"2018-02-01\",\"2017-08-01\",\"2016-09-01\",\"2016-03-01\",\"2015-08-01\",\"2015-07-01\",\"2015-06-01\",\"2015-05-01\",\"2015-04-01\",\"2015-02-01\",\"2014-11-01\",\"2014-06-01\",\"2014-04-01-preview\",\"2014-04-01\"],\"apiProfiles\":[{\"profileVersion\":\"2017-03-09-profile\",\"apiVersion\":\"2016-09-01\"},{\"profileVersion\":\"2018-03-01-hybrid\",\"apiVersion\":\"2017-08-01\"},{\"profileVersion\":\"2018-06-01-profile\",\"apiVersion\":\"2018-02-01\"},{\"profileVersion\":\"2019-03-01-hybrid\",\"apiVersion\":\"2018-02-01\"}],\"capabilities\":\"CrossResourceGroupResourceMove, CrossSubscriptionResourceMove, SupportsTags, SupportsLocation\"},{\"resourceType\":\"sites\",\"locations\":[\"South Central US\",\"MSFT West US\",\"MSFT East US\",\"MSFT East Asia\",\"MSFT North Europe\",\"East US 2 (Stage)\",\"Central US (Stage)\",\"South Africa North\",\"Australia East\",\"Brazil South\",\"Southeast Asia\",\"Central US\",\"Japan West\",\"Central India\",\"UK South\",\"Canada East\",\"Korea Central\",\"France Central\",\"North Europe\",\"West US 2\",\"West India\",\"East US 2\",\"Australia Central\",\"Germany West Central\",\"Norway East\",\"Switzerland North\",\"North Central US\",\"UK West\",\"Australia Southeast\",\"Korea South\",\"Canada Central\",\"West Europe\",\"South India\",\"West Central US\",\"East Asia (Stage)\",\"North Central US (Stage)\",\"East Asia\",\"Japan East\",\"East US 2 EUAP\",\"Central US EUAP\",\"West US\",\"East US\"],\"apiVersions\":[\"2019-08-01\",\"2018-11-01\",\"2018-02-01\",\"2017-08-01\",\"2016-09-01\",\"2016-08-01\",\"2016-03-01\",\"2015-11-01\",\"2015-08-01-preview\",\"2015-08-01\",\"2015-07-01\",\"2015-06-01\",\"2015-05-01\",\"2015-04-01\",\"2015-02-01\",\"2015-01-01\",\"2014-11-01\",\"2014-06-01\",\"2014-04-01-preview\",\"2014-04-01\"],\"apiProfiles\":[{\"profileVersion\":\"2017-03-09-profile\",\"apiVersion\":\"2016-08-01\"},{\"profileVersion\":\"2018-03-01-hybrid\",\"apiVersion\":\"2016-08-01\"},{\"profileVersion\":\"2018-06-01-profile\",\"apiVersion\":\"2018-02-01\"},{\"profileVersion\":\"2019-03-01-hybrid\",\"apiVersion\":\"2018-02-01\"}],\"capabilities\":\"CrossResourceGroupResourceMove, CrossSubscriptionResourceMove, SystemAssignedResourceIdentity, SupportsTags, SupportsLocation\"},{\"resourceType\":\"sites/slots\",\"locations\":[\"South Central US\",\"MSFT West US\",\"MSFT East US\",\"MSFT East Asia\",\"MSFT North Europe\",\"East US 2 (Stage)\",\"Central US (Stage)\",\"South Africa North\",\"Australia East\",\"Brazil South\",\"Southeast Asia\",\"Central US\",\"Japan West\",\"Central India\",\"UK South\",\"Canada East\",\"Korea Central\",\"France Central\",\"North Europe\",\"West US 2\",\"West India\",\"East US 2\",\"Australia Central\",\"Germany West Central\",\"Norway East\",\"Switzerland North\",\"North Central US\",\"UK West\",\"Australia Southeast\",\"Korea South\",\"Canada Central\",\"West Europe\",\"South India\",\"West Central US\",\"East Asia (Stage)\",\"North Central US (Stage)\",\"East Asia\",\"Japan East\",\"East US 2 EUAP\",\"Central US EUAP\",\"West US\",\"East US\"],\"apiVersions\":[\"2019-08-01\",\"2018-11-01\",\"2018-02-01\",\"2017-08-01\",\"2016-09-01\",\"2016-08-01\",\"2016-03-01\",\"2015-11-01\",\"2015-08-01\",\"2015-07-01\",\"2015-06-01\",\"2015-05-01\",\"2015-04-01\",\"2015-02-01\",\"2015-01-01\",\"2014-11-01\",\"2014-06-01\",\"2014-04-01-preview\",\"2014-04-01\"],\"apiProfiles\":[{\"profileVersion\":\"2017-03-09-profile\",\"apiVersion\":\"2016-08-01\"},{\"profileVersion\":\"2018-03-01-hybrid\",\"apiVersion\":\"2016-08-01\"},{\"profileVersion\":\"2018-06-01-profile\",\"apiVersion\":\"2018-02-01\"},{\"profileVersion\":\"2019-03-01-hybrid\",\"apiVersion\":\"2018-02-01\"}],\"capabilities\":\"CrossResourceGroupResourceMove, CrossSubscriptionResourceMove, SystemAssignedResourceIdentity, SupportsTags, SupportsLocation\"},{\"resourceType\":\"runtimes\",\"locations\":[],\"apiVersions\":[\"2019-08-01\",\"2018-11-01\",\"2018-02-01\",\"2016-03-01\",\"2015-08-01\",\"2015-07-01\",\"2015-06-01\",\"2015-05-01\",\"2015-04-01\",\"2015-02-01\",\"2014-11-01\",\"2014-06-01\",\"2014-04-01\"],\"apiProfiles\":[{\"profileVersion\":\"2017-03-09-profile\",\"apiVersion\":\"2016-03-01\"},{\"profileVersion\":\"2018-03-01-hybrid\",\"apiVersion\":\"2016-03-01\"},{\"profileVersion\":\"2018-06-01-profile\",\"apiVersion\":\"2016-03-01\"},{\"profileVersion\":\"2019-03-01-hybrid\",\"apiVersion\":\"2018-02-01\"}],\"capabilities\":\"None\"},{\"resourceType\":\"recommendations\",\"locations\":[],\"apiVersions\":[\"2019-08-01\",\"2018-11-01\",\"2018-02-01\",\"2016-03-01\",\"2015-08-01\",\"2015-07-01\",\"2015-06-01\",\"2015-05-01\",\"2015-04-01\",\"2015-02-01\",\"2014-11-01\",\"2014-06-01\",\"2014-04-01-preview\",\"2014-04-01\"],\"apiProfiles\":[{\"profileVersion\":\"2017-03-09-profile\",\"apiVersion\":\"2016-03-01\"},{\"profileVersion\":\"2018-03-01-hybrid\",\"apiVersion\":\"2016-03-01\"},{\"profileVersion\":\"2018-06-01-profile\",\"apiVersion\":\"2016-03-01\"},{\"profileVersion\":\"2019-03-01-hybrid\",\"apiVersion\":\"2018-02-01\"}],\"capabilities\":\"None\"},{\"resourceType\":\"resourceHealthMetadata\",\"locations\":[],\"apiVersions\":[\"2019-08-01\",\"2018-11-01\",\"2018-02-01\",\"2016-03-01\",\"2015-08-01\",\"2015-07-01\",\"2015-06-01\",\"2015-05-01\",\"2015-04-01\",\"2015-02-01\",\"2014-11-01\",\"2014-06-01\",\"2014-04-01-preview\",\"2014-04-01\"],\"apiProfiles\":[{\"profileVersion\":\"2017-03-09-profile\",\"apiVersion\":\"2016-03-01\"},{\"profileVersion\":\"2018-03-01-hybrid\",\"apiVersion\":\"2016-03-01\"},{\"profileVersion\":\"2018-06-01-profile\",\"apiVersion\":\"2016-03-01\"},{\"profileVersion\":\"2019-03-01-hybrid\",\"apiVersion\":\"2018-02-01\"}],\"capabilities\":\"None\"},{\"resourceType\":\"georegions\",\"locations\":[],\"apiVersions\":[\"2019-08-01\",\"2018-11-01\",\"2018-02-01\",\"2016-03-01\",\"2015-08-01\",\"2015-07-01\",\"2015-06-01\",\"2015-05-01\",\"2015-04-01\",\"2015-02-01\",\"2014-11-01\",\"2014-06-01\",\"2014-04-01-preview\",\"2014-04-01\"],\"apiProfiles\":[{\"profileVersion\":\"2017-03-09-profile\",\"apiVersion\":\"2016-03-01\"},{\"profileVersion\":\"2018-03-01-hybrid\",\"apiVersion\":\"2016-03-01\"},{\"profileVersion\":\"2018-06-01-profile\",\"apiVersion\":\"2016-03-01\"},{\"profileVersion\":\"2019-03-01-hybrid\",\"apiVersion\":\"2018-02-01\"}],\"capabilities\":\"None\"},{\"resourceType\":\"sites/premieraddons\",\"locations\":[\"South Central US\",\"MSFT West US\",\"MSFT East US\",\"MSFT East Asia\",\"MSFT North Europe\",\"East US 2 (Stage)\",\"Central US (Stage)\",\"South Africa North\",\"East Asia\",\"Japan East\",\"Australia East\",\"Brazil South\",\"Southeast Asia\",\"Central US\",\"Japan West\",\"Central India\",\"UK South\",\"Canada East\",\"Korea Central\",\"France Central\",\"North Europe\",\"West US 2\",\"West India\",\"East US 2\",\"Australia Central\",\"Germany West Central\",\"Norway East\",\"Switzerland North\",\"North Central US\",\"UK West\",\"Australia Southeast\",\"Korea South\",\"Canada Central\",\"West Europe\",\"South India\",\"West Central US\",\"East Asia (Stage)\",\"North Central US (Stage)\",\"East US 2 EUAP\",\"Central US EUAP\",\"West US\",\"East US\"],\"apiVersions\":[\"2019-08-01\",\"2018-11-01\",\"2018-02-01\",\"2016-03-01\",\"2015-08-01\",\"2015-07-01\",\"2015-06-01\",\"2015-05-01\",\"2015-04-01\"],\"apiProfiles\":[{\"profileVersion\":\"2017-03-09-profile\",\"apiVersion\":\"2016-03-01\"},{\"profileVersion\":\"2018-03-01-hybrid\",\"apiVersion\":\"2016-03-01\"},{\"profileVersion\":\"2018-06-01-profile\",\"apiVersion\":\"2016-03-01\"},{\"profileVersion\":\"2019-03-01-hybrid\",\"apiVersion\":\"2018-02-01\"}],\"capabilities\":\"CrossResourceGroupResourceMove, CrossSubscriptionResourceMove, SupportsTags, SupportsLocation\"},{\"resourceType\":\"hostingEnvironments\",\"locations\":[\"South Central US\",\"MSFT West US\",\"MSFT East US\",\"MSFT East Asia\",\"MSFT North Europe\",\"East US 2 (Stage)\",\"Central US (Stage)\",\"South Africa North\",\"West US 2\",\"East US 2\",\"UK South\",\"Southeast Asia\",\"North Europe\",\"Japan East\",\"West Europe\",\"East Asia\",\"Australia East\",\"Brazil South\",\"Central US\",\"Japan West\",\"Central India\",\"Canada East\",\"Korea Central\",\"France Central\",\"West India\",\"Australia Central\",\"Germany West Central\",\"Norway East\",\"Switzerland North\",\"North Central US\",\"UK West\",\"Australia Southeast\",\"Korea South\",\"Canada Central\",\"South India\",\"West Central US\",\"East Asia (Stage)\",\"North Central US (Stage)\",\"West US\",\"East US\",\"East US 2 EUAP\",\"Central US EUAP\"],\"apiVersions\":[\"2019-08-01\",\"2019-02-01\",\"2019-01-01\",\"2018-11-01\",\"2018-08-01\",\"2018-05-01-preview\",\"2018-02-01\",\"2017-08-01\",\"2016-09-01\",\"2016-03-01\",\"2015-08-01\",\"2015-07-01\",\"2015-06-01\",\"2015-05-01\",\"2015-04-01\",\"2015-02-01\",\"2014-11-01\",\"2014-06-01\",\"2014-04-01\"],\"apiProfiles\":[{\"profileVersion\":\"2017-03-09-profile\",\"apiVersion\":\"2016-09-01\"},{\"profileVersion\":\"2018-03-01-hybrid\",\"apiVersion\":\"2017-08-01\"},{\"profileVersion\":\"2018-06-01-profile\",\"apiVersion\":\"2018-02-01\"}],\"zoneMappings\":[{\"location\":\"East US 2\",\"zones\":[\"3\",\"2\",\"1\"]},{\"location\":\"Central US\",\"zones\":[\"3\",\"2\",\"1\"]},{\"location\":\"West Europe\",\"zones\":[\"3\",\"2\",\"1\"]},{\"location\":\"East US 2 EUAP\",\"zones\":[\"2\",\"1\",\"3\"]},{\"location\":\"Central US EUAP\",\"zones\":[]},{\"location\":\"France Central\",\"zones\":[\"3\",\"2\",\"1\"]},{\"location\":\"Southeast Asia\",\"zones\":[\"3\",\"2\",\"1\"]},{\"location\":\"West US 2\",\"zones\":[\"3\",\"2\",\"1\"]},{\"location\":\"North Europe\",\"zones\":[\"3\",\"2\",\"1\"]},{\"location\":\"East US\",\"zones\":[\"3\",\"2\",\"1\"]},{\"location\":\"UK South\",\"zones\":[\"3\",\"2\",\"1\"]},{\"location\":\"Japan East\",\"zones\":[\"3\",\"2\",\"1\"]},{\"location\":\"Australia East\",\"zones\":[]},{\"location\":\"South Africa North\",\"zones\":[]},{\"location\":\"South Central US\",\"zones\":[]},{\"location\":\"Canada Central\",\"zones\":[]},{\"location\":\"Germany West Central\",\"zones\":[]}],\"capabilities\":\"SupportsTags, SupportsLocation\"},{\"resourceType\":\"hostingEnvironments/multiRolePools\",\"locations\":[\"South Central US\",\"MSFT West US\",\"MSFT East US\",\"MSFT East Asia\",\"MSFT North Europe\",\"East US 2 (Stage)\",\"Central US (Stage)\",\"South Africa North\",\"East Asia\",\"Japan East\",\"Australia East\",\"Brazil South\",\"Southeast Asia\",\"Central US\",\"Japan West\",\"Central India\",\"UK South\",\"Canada East\",\"Korea Central\",\"France Central\",\"North Europe\",\"West US 2\",\"West India\",\"East US 2\",\"Australia Central\",\"Germany West Central\",\"Norway East\",\"Switzerland North\",\"North Central US\",\"UK West\",\"Australia Southeast\",\"Korea South\",\"Canada Central\",\"West Europe\",\"South India\",\"West Central US\",\"East Asia (Stage)\",\"North Central US (Stage)\",\"West US\",\"East US\",\"East US 2 EUAP\",\"Central US EUAP\"],\"apiVersions\":[\"2019-08-01\",\"2019-02-01\",\"2018-11-01\",\"2018-08-01\",\"2018-02-01\",\"2017-08-01\",\"2016-09-01\",\"2016-03-01\",\"2015-08-01\",\"2015-07-01\",\"2015-06-01\",\"2015-05-01\",\"2015-04-01\",\"2015-02-01\",\"2014-11-01\",\"2014-06-01\",\"2014-04-01\"],\"apiProfiles\":[{\"profileVersion\":\"2017-03-09-profile\",\"apiVersion\":\"2016-09-01\"},{\"profileVersion\":\"2018-03-01-hybrid\",\"apiVersion\":\"2017-08-01\"},{\"profileVersion\":\"2018-06-01-profile\",\"apiVersion\":\"2018-02-01\"},{\"profileVersion\":\"2019-03-01-hybrid\",\"apiVersion\":\"2018-02-01\"}],\"capabilities\":\"None\"},{\"resourceType\":\"hostingEnvironments/workerPools\",\"locations\":[\"South Central US\",\"MSFT West US\",\"MSFT East US\",\"MSFT East Asia\",\"MSFT North Europe\",\"East US 2 (Stage)\",\"Central US (Stage)\",\"South Africa North\",\"East Asia\",\"Japan East\",\"Australia East\",\"Brazil South\",\"Southeast Asia\",\"Central US\",\"Japan West\",\"Central India\",\"UK South\",\"Canada East\",\"Korea Central\",\"France Central\",\"North Europe\",\"West US 2\",\"West India\",\"East US 2\",\"Australia Central\",\"Germany West Central\",\"Norway East\",\"Switzerland North\",\"North Central US\",\"UK West\",\"Australia Southeast\",\"Korea South\",\"Canada Central\",\"West Europe\",\"South India\",\"West Central US\",\"East Asia (Stage)\",\"North Central US (Stage)\",\"West US\",\"East US\",\"East US 2 EUAP\",\"Central US EUAP\"],\"apiVersions\":[\"2019-08-01\",\"2019-02-01\",\"2018-11-01\",\"2018-08-01\",\"2018-02-01\",\"2017-08-01\",\"2016-09-01\",\"2016-03-01\",\"2015-08-01\",\"2015-07-01\",\"2015-06-01\",\"2015-05-01\",\"2015-04-01\",\"2015-02-01\",\"2014-11-01\",\"2014-06-01\",\"2014-04-01\"],\"apiProfiles\":[{\"profileVersion\":\"2017-03-09-profile\",\"apiVersion\":\"2016-09-01\"},{\"profileVersion\":\"2018-03-01-hybrid\",\"apiVersion\":\"2017-08-01\"},{\"profileVersion\":\"2018-06-01-profile\",\"apiVersion\":\"2018-02-01\"},{\"profileVersion\":\"2019-03-01-hybrid\",\"apiVersion\":\"2018-02-01\"}],\"capabilities\":\"None\"},{\"resourceType\":\"kubeEnvironments\",\"locations\":[\"North Central US (Stage)\"],\"apiVersions\":[\"2019-08-01\",\"2019-02-01\",\"2019-01-01\",\"2018-11-01\",\"2018-08-01\",\"2018-05-01-preview\",\"2018-02-01\",\"2017-08-01\",\"2016-09-01\",\"2016-03-01\",\"2015-08-01\",\"2015-07-01\",\"2015-06-01\",\"2015-05-01\",\"2015-04-01\",\"2015-02-01\",\"2014-11-01\",\"2014-06-01\",\"2014-04-01\"],\"apiProfiles\":[{\"profileVersion\":\"2017-03-09-profile\",\"apiVersion\":\"2016-09-01\"},{\"profileVersion\":\"2018-03-01-hybrid\",\"apiVersion\":\"2017-08-01\"},{\"profileVersion\":\"2018-06-01-profile\",\"apiVersion\":\"2018-02-01\"}],\"capabilities\":\"CrossResourceGroupResourceMove, CrossSubscriptionResourceMove, SupportsTags, SupportsLocation\"},{\"resourceType\":\"deploymentLocations\",\"locations\":[\"Central US\",\"North Europe\",\"West Europe\",\"Southeast Asia\",\"Korea Central\",\"Korea South\",\"West US\",\"East US\",\"Japan West\",\"Japan East\",\"East Asia\",\"East US 2\",\"North Central US\",\"South Central US\",\"Brazil South\",\"Australia East\",\"Australia Southeast\",\"West India\",\"Central India\",\"South India\",\"Canada Central\",\"Canada East\",\"West Central US\",\"UK West\",\"UK South\",\"West US 2\",\"MSFT West US\",\"MSFT East US\",\"MSFT East Asia\",\"MSFT North Europe\",\"East US 2 (Stage)\",\"Central US (Stage)\",\"North Central US (Stage)\",\"France Central\",\"South Africa North\",\"Australia Central\",\"Switzerland North\",\"Germany West Central\",\"Norway East\"],\"apiVersions\":[\"2019-08-01\",\"2018-11-01\",\"2018-02-01\",\"2016-03-01\",\"2015-08-01\",\"2015-07-01\",\"2015-06-01\",\"2015-05-01\",\"2015-04-01\",\"2015-02-01\",\"2014-11-01\",\"2014-06-01\",\"2014-04-01-preview\",\"2014-04-01\"],\"apiProfiles\":[{\"profileVersion\":\"2017-03-09-profile\",\"apiVersion\":\"2016-03-01\"},{\"profileVersion\":\"2018-03-01-hybrid\",\"apiVersion\":\"2016-03-01\"},{\"profileVersion\":\"2018-06-01-profile\",\"apiVersion\":\"2018-02-01\"},{\"profileVersion\":\"2019-03-01-hybrid\",\"apiVersion\":\"2018-02-01\"}],\"capabilities\":\"None\"},{\"resourceType\":\"deletedSites\",\"locations\":[\"South Central US\",\"MSFT West US\",\"MSFT East US\",\"MSFT East Asia\",\"MSFT North Europe\",\"East US 2 (Stage)\",\"Central US (Stage)\",\"South Africa North\",\"East Asia\",\"Japan East\",\"Australia East\",\"Brazil South\",\"Southeast Asia\",\"Central US\",\"Japan West\",\"Central India\",\"UK South\",\"Canada East\",\"Korea Central\",\"France Central\",\"North Europe\",\"West US 2\",\"West India\",\"East US 2\",\"Australia Central\",\"Germany West Central\",\"Norway East\",\"Switzerland North\",\"North Central US\",\"UK West\",\"Australia Southeast\",\"Korea South\",\"Canada Central\",\"West Europe\",\"South India\",\"West Central US\",\"East Asia (Stage)\",\"North Central US (Stage)\",\"West US\",\"East US\",\"East US 2 EUAP\",\"Central US EUAP\"],\"apiVersions\":[\"2019-08-01\",\"2018-11-01\",\"2018-02-01\",\"2016-03-01\",\"2015-08-01\",\"2015-07-01\",\"2015-06-01\",\"2015-05-01\",\"2015-04-01\",\"2015-02-01\",\"2014-11-01\",\"2014-06-01\",\"2014-04-01-preview\",\"2014-04-01\"],\"apiProfiles\":[{\"profileVersion\":\"2017-03-09-profile\",\"apiVersion\":\"2016-03-01\"},{\"profileVersion\":\"2018-03-01-hybrid\",\"apiVersion\":\"2016-03-01\"},{\"profileVersion\":\"2018-06-01-profile\",\"apiVersion\":\"2018-02-01\"},{\"profileVersion\":\"2019-03-01-hybrid\",\"apiVersion\":\"2018-02-01\"}],\"capabilities\":\"None\"},{\"resourceType\":\"locations/deletedSites\",\"locations\":[\"South Central US\",\"MSFT West US\",\"MSFT East US\",\"MSFT East Asia\",\"MSFT North Europe\",\"East US 2 (Stage)\",\"Central US (Stage)\",\"South Africa North\",\"East Asia\",\"Japan East\",\"Australia East\",\"Brazil South\",\"Southeast Asia\",\"Central US\",\"Japan West\",\"Central India\",\"UK South\",\"Canada East\",\"Korea Central\",\"France Central\",\"North Europe\",\"West US 2\",\"West India\",\"East US 2\",\"Australia Central\",\"Germany West Central\",\"Norway East\",\"Switzerland North\",\"North Central US\",\"UK West\",\"Australia Southeast\",\"Korea South\",\"Canada Central\",\"West Europe\",\"South India\",\"West Central US\",\"East Asia (Stage)\",\"North Central US (Stage)\",\"West US\",\"East US\",\"East US 2 EUAP\",\"Central US EUAP\"],\"apiVersions\":[\"2019-08-01\",\"2018-11-01\",\"2018-02-01\",\"2016-03-01\",\"2015-08-01\",\"2015-07-01\",\"2015-06-01\",\"2015-05-01\",\"2015-04-01\",\"2015-02-01\",\"2014-11-01\",\"2014-06-01\",\"2014-04-01-preview\",\"2014-04-01\"],\"defaultApiVersion\":\"2018-02-01\",\"apiProfiles\":[{\"profileVersion\":\"2017-03-09-profile\",\"apiVersion\":\"2016-03-01\"},{\"profileVersion\":\"2018-03-01-hybrid\",\"apiVersion\":\"2016-03-01\"},{\"profileVersion\":\"2018-06-01-profile\",\"apiVersion\":\"2018-02-01\"},{\"profileVersion\":\"2019-03-01-hybrid\",\"apiVersion\":\"2018-02-01\"}],\"capabilities\":\"None\"},{\"resourceType\":\"ishostingenvironmentnameavailable\",\"locations\":[],\"apiVersions\":[\"2019-08-01\",\"2018-11-01\",\"2018-02-01\",\"2016-03-01\",\"2015-08-01\",\"2015-07-01\",\"2015-06-01\",\"2015-05-01\",\"2015-04-01\",\"2015-02-01\",\"2014-11-01\",\"2014-06-01\",\"2014-04-01-preview\",\"2014-04-01\"],\"apiProfiles\":[{\"profileVersion\":\"2017-03-09-profile\",\"apiVersion\":\"2016-03-01\"},{\"profileVersion\":\"2018-03-01-hybrid\",\"apiVersion\":\"2016-03-01\"},{\"profileVersion\":\"2018-06-01-profile\",\"apiVersion\":\"2018-02-01\"},{\"profileVersion\":\"2019-03-01-hybrid\",\"apiVersion\":\"2018-02-01\"}],\"capabilities\":\"None\"},{\"resourceType\":\"locations/deleteVirtualNetworkOrSubnets\",\"locations\":[\"South Central US\",\"MSFT West US\",\"MSFT East US\",\"MSFT East Asia\",\"MSFT North Europe\",\"East US 2 (Stage)\",\"Central US (Stage)\",\"South Africa North\",\"Australia East\",\"Brazil South\",\"Southeast Asia\",\"Central US\",\"Japan West\",\"Central India\",\"UK South\",\"Canada East\",\"Korea Central\",\"France Central\",\"North Europe\",\"West US 2\",\"West India\",\"East US 2\",\"Australia Central\",\"Germany West Central\",\"Norway East\",\"Switzerland North\",\"North Central US\",\"UK West\",\"Australia Southeast\",\"Korea South\",\"Canada Central\",\"West Europe\",\"South India\",\"West Central US\",\"East Asia (Stage)\",\"North Central US (Stage)\",\"East Asia\",\"Japan East\",\"East US 2 EUAP\",\"Central US EUAP\",\"West US\",\"East US\"],\"apiVersions\":[\"2019-08-01\",\"2018-11-01\",\"2018-02-01\",\"2016-11-01\",\"2016-08-01\",\"2016-03-01\",\"2015-08-01-preview\",\"2015-08-01\",\"2015-07-01\",\"2015-06-01\",\"2015-05-01\",\"2015-04-01\",\"2015-02-01\",\"2014-11-01\",\"2014-06-01\",\"2014-04-01-preview\",\"2014-04-01\"],\"defaultApiVersion\":\"2018-02-01\",\"apiProfiles\":[{\"profileVersion\":\"2019-03-01-hybrid\",\"apiVersion\":\"2018-02-01\"}],\"capabilities\":\"None\"},{\"resourceType\":\"connections\",\"locations\":[\"North Central US\",\"Central US\",\"South Central US\",\"North Europe\",\"West Europe\",\"East Asia\",\"Southeast Asia\",\"West US\",\"East US\",\"East US 2\",\"Japan West\",\"Japan East\",\"Brazil South\",\"Australia East\",\"Australia Southeast\",\"South India\",\"Central India\",\"West India\",\"West US 2\",\"West Central US\",\"Canada Central\",\"Canada East\",\"UK South\",\"UK West\",\"France Central\",\"France South\",\"Korea Central\",\"Korea South\",\"South Africa West\",\"South Africa North\",\"UAE Central\",\"Central US EUAP\",\"East US 2 EUAP\"],\"apiVersions\":[\"2018-07-01-preview\",\"2018-03-01-preview\",\"2016-06-01\",\"2015-08-01-preview\"],\"apiProfiles\":[{\"profileVersion\":\"2017-03-09-profile\",\"apiVersion\":\"2016-06-01\"},{\"profileVersion\":\"2018-03-01-hybrid\",\"apiVersion\":\"2016-06-01\"},{\"profileVersion\":\"2018-06-01-profile\",\"apiVersion\":\"2018-03-01-preview\"}],\"capabilities\":\"CrossResourceGroupResourceMove, CrossSubscriptionResourceMove, SupportsTags, SupportsLocation\"},{\"resourceType\":\"customApis\",\"locations\":[\"North Central US\",\"Central US\",\"South Central US\",\"North Europe\",\"West Europe\",\"East Asia\",\"Southeast Asia\",\"West US\",\"East US\",\"East US 2\",\"Japan West\",\"Japan East\",\"Brazil South\",\"Australia East\",\"Australia Southeast\",\"South India\",\"Central India\",\"West India\",\"West US 2\",\"West Central US\",\"Canada Central\",\"Canada East\",\"UK South\",\"UK West\",\"France Central\",\"France South\",\"Korea Central\",\"Korea South\",\"South Africa West\",\"South Africa North\",\"UAE Central\",\"Central US EUAP\",\"East US 2 EUAP\"],\"apiVersions\":[\"2018-07-01-preview\",\"2018-03-01-preview\",\"2016-06-01\",\"2015-08-01-preview\"],\"apiProfiles\":[{\"profileVersion\":\"2017-03-09-profile\",\"apiVersion\":\"2016-06-01\"},{\"profileVersion\":\"2018-03-01-hybrid\",\"apiVersion\":\"2016-06-01\"},{\"profileVersion\":\"2018-06-01-profile\",\"apiVersion\":\"2018-03-01-preview\"}],\"capabilities\":\"CrossResourceGroupResourceMove, CrossSubscriptionResourceMove, SupportsTags, SupportsLocation\"},{\"resourceType\":\"locations\",\"locations\":[],\"apiVersions\":[\"2018-07-01-preview\",\"2018-03-01-preview\",\"2016-06-01\",\"2015-08-01-preview\"],\"apiProfiles\":[{\"profileVersion\":\"2017-03-09-profile\",\"apiVersion\":\"2016-06-01\"},{\"profileVersion\":\"2018-03-01-hybrid\",\"apiVersion\":\"2016-06-01\"},{\"profileVersion\":\"2018-06-01-profile\",\"apiVersion\":\"2018-03-01-preview\"}],\"capabilities\":\"None\"},{\"resourceType\":\"locations/listWsdlInterfaces\",\"locations\":[\"North Central US\",\"Central US\",\"South Central US\",\"North Europe\",\"West Europe\",\"East Asia\",\"Southeast Asia\",\"West US\",\"East US\",\"East US 2\",\"Japan West\",\"Japan East\",\"Brazil South\",\"Australia East\",\"Australia Southeast\",\"South India\",\"Central India\",\"West India\",\"West US 2\",\"West Central US\",\"Canada Central\",\"Canada East\",\"UK South\",\"UK West\",\"France Central\",\"France South\",\"Korea Central\",\"Korea South\",\"South Africa West\",\"South Africa North\",\"UAE Central\",\"Central US EUAP\",\"East US 2 EUAP\"],\"apiVersions\":[\"2018-03-01-preview\",\"2016-06-01\",\"2015-08-01-preview\"],\"apiProfiles\":[{\"profileVersion\":\"2017-03-09-profile\",\"apiVersion\":\"2016-06-01\"},{\"profileVersion\":\"2018-03-01-hybrid\",\"apiVersion\":\"2016-06-01\"},{\"profileVersion\":\"2018-06-01-profile\",\"apiVersion\":\"2018-03-01-preview\"}],\"capabilities\":\"None\"},{\"resourceType\":\"locations/extractApiDefinitionFromWsdl\",\"locations\":[\"North Central US\",\"Central US\",\"South Central US\",\"North Europe\",\"West Europe\",\"East Asia\",\"Southeast Asia\",\"West US\",\"East US\",\"East US 2\",\"Japan West\",\"Japan East\",\"Brazil South\",\"Australia East\",\"Australia Southeast\",\"South India\",\"Central India\",\"West India\",\"West US 2\",\"West Central US\",\"Canada Central\",\"Canada East\",\"UK South\",\"UK West\",\"France Central\",\"France South\",\"Korea Central\",\"Korea South\",\"South Africa West\",\"South Africa North\",\"UAE Central\",\"Central US EUAP\",\"East US 2 EUAP\"],\"apiVersions\":[\"2018-03-01-preview\",\"2016-06-01\",\"2015-08-01-preview\"],\"apiProfiles\":[{\"profileVersion\":\"2017-03-09-profile\",\"apiVersion\":\"2016-06-01\"},{\"profileVersion\":\"2018-03-01-hybrid\",\"apiVersion\":\"2016-06-01\"},{\"profileVersion\":\"2018-06-01-profile\",\"apiVersion\":\"2018-03-01-preview\"}],\"capabilities\":\"None\"},{\"resourceType\":\"locations/managedApis\",\"locations\":[\"North Central US\",\"Central US\",\"South Central US\",\"North Europe\",\"West Europe\",\"East Asia\",\"Southeast Asia\",\"West US\",\"East US\",\"East US 2\",\"Japan West\",\"Japan East\",\"Brazil South\",\"Australia East\",\"Australia Southeast\",\"South India\",\"Central India\",\"West India\",\"West US 2\",\"West Central US\",\"Canada Central\",\"Canada East\",\"UK South\",\"UK West\",\"France Central\",\"France South\",\"Korea Central\",\"Korea South\",\"South Africa West\",\"South Africa North\",\"UAE Central\",\"Central US EUAP\",\"East US 2 EUAP\"],\"apiVersions\":[\"2018-07-01-preview\",\"2018-03-01-preview\",\"2016-06-01\",\"2015-08-01-preview\"],\"apiProfiles\":[{\"profileVersion\":\"2017-03-09-profile\",\"apiVersion\":\"2016-06-01\"},{\"profileVersion\":\"2018-03-01-hybrid\",\"apiVersion\":\"2016-06-01\"},{\"profileVersion\":\"2018-06-01-profile\",\"apiVersion\":\"2018-03-01-preview\"}],\"capabilities\":\"None\"},{\"resourceType\":\"locations/runtimes\",\"locations\":[\"North Central US\",\"Central US\",\"South Central US\",\"North Europe\",\"West Europe\",\"East Asia\",\"Southeast Asia\",\"West US\",\"East US\",\"East US 2\",\"Japan West\",\"Japan East\",\"Brazil South\",\"Australia East\",\"Australia Southeast\",\"South India\",\"Central India\",\"West India\",\"West US 2\",\"West Central US\",\"Canada Central\",\"Canada East\",\"UK South\",\"UK West\",\"France Central\",\"France South\",\"Korea Central\",\"Korea South\",\"South Africa West\",\"South Africa North\",\"UAE Central\",\"Central US EUAP\",\"East US 2 EUAP\"],\"apiVersions\":[\"2018-03-01-preview\",\"2016-06-01\",\"2015-08-01-preview\"],\"apiProfiles\":[{\"profileVersion\":\"2017-03-09-profile\",\"apiVersion\":\"2016-06-01\"},{\"profileVersion\":\"2018-03-01-hybrid\",\"apiVersion\":\"2016-06-01\"},{\"profileVersion\":\"2018-06-01-profile\",\"apiVersion\":\"2018-03-01-preview\"}],\"capabilities\":\"None\"},{\"resourceType\":\"locations/apiOperations\",\"locations\":[\"North Central US\",\"Central US\",\"South Central US\",\"North Europe\",\"West Europe\",\"East Asia\",\"Southeast Asia\",\"West US\",\"East US\",\"East US 2\",\"Japan West\",\"Japan East\",\"Brazil South\",\"Australia East\",\"Australia Southeast\",\"South India\",\"Central India\",\"West India\",\"West US 2\",\"West Central US\",\"Canada Central\",\"Canada East\",\"UK South\",\"UK West\",\"France Central\",\"France South\",\"Korea Central\",\"Korea South\",\"South Africa West\",\"South Africa North\",\"UAE Central\",\"Central US EUAP\",\"East US 2 EUAP\"],\"apiVersions\":[\"2018-07-01-preview\",\"2018-03-01-preview\",\"2016-06-01\",\"2015-08-01-preview\"],\"apiProfiles\":[{\"profileVersion\":\"2017-03-09-profile\",\"apiVersion\":\"2016-06-01\"},{\"profileVersion\":\"2018-03-01-hybrid\",\"apiVersion\":\"2016-06-01\"},{\"profileVersion\":\"2018-06-01-profile\",\"apiVersion\":\"2018-03-01-preview\"}],\"capabilities\":\"None\"},{\"resourceType\":\"connectionGateways\",\"locations\":[\"North Central US\",\"Central US\",\"South Central US\",\"North Europe\",\"West Europe\",\"East Asia\",\"Southeast Asia\",\"West US\",\"East US\",\"East US 2\",\"Japan West\",\"Japan East\",\"Brazil South\",\"Australia East\",\"Australia Southeast\",\"South India\",\"Central India\",\"West India\",\"West US 2\",\"West Central US\",\"Canada Central\",\"Canada East\",\"UK South\",\"UK West\",\"France Central\",\"France South\",\"Korea Central\",\"Korea South\",\"South Africa West\",\"South Africa North\",\"UAE Central\",\"Central US EUAP\",\"East US 2 EUAP\"],\"apiVersions\":[\"2018-03-01-preview\",\"2016-06-01\",\"2015-08-01-preview\"],\"apiProfiles\":[{\"profileVersion\":\"2017-03-09-profile\",\"apiVersion\":\"2016-06-01\"},{\"profileVersion\":\"2018-03-01-hybrid\",\"apiVersion\":\"2016-06-01\"},{\"profileVersion\":\"2018-06-01-profile\",\"apiVersion\":\"2018-03-01-preview\"}],\"capabilities\":\"CrossResourceGroupResourceMove, CrossSubscriptionResourceMove, SupportsTags, SupportsLocation\"},{\"resourceType\":\"locations/connectionGatewayInstallations\",\"locations\":[\"North Central US\",\"Central US\",\"South Central US\",\"North Europe\",\"West Europe\",\"East Asia\",\"Southeast Asia\",\"West US\",\"East US\",\"East US 2\",\"Japan West\",\"Japan East\",\"Brazil South\",\"Australia East\",\"Australia Southeast\",\"South India\",\"Central India\",\"West India\",\"West US 2\",\"West Central US\",\"Canada Central\",\"Canada East\",\"UK South\",\"UK West\",\"France Central\",\"France South\",\"Korea Central\",\"Korea South\",\"South Africa West\",\"South Africa North\",\"UAE Central\",\"Central US EUAP\",\"East US 2 EUAP\"],\"apiVersions\":[\"2018-03-01-preview\",\"2016-06-01\",\"2015-08-01-preview\"],\"apiProfiles\":[{\"profileVersion\":\"2017-03-09-profile\",\"apiVersion\":\"2016-06-01\"},{\"profileVersion\":\"2018-03-01-hybrid\",\"apiVersion\":\"2016-06-01\"},{\"profileVersion\":\"2018-06-01-profile\",\"apiVersion\":\"2018-03-01-preview\"}],\"capabilities\":\"None\"},{\"resourceType\":\"checkNameAvailability\",\"locations\":[\"Central US\",\"North Europe\",\"West Europe\",\"Southeast Asia\",\"Korea Central\",\"Korea South\",\"West US\",\"East US\",\"Japan West\",\"Japan East\",\"East Asia\",\"East US 2\",\"North Central US\",\"South Central US\",\"Brazil South\",\"Australia East\",\"Australia Southeast\",\"West India\",\"Central India\",\"South India\",\"Canada Central\",\"Canada East\",\"West Central US\",\"UK West\",\"UK South\",\"West US 2\",\"MSFT West US\",\"MSFT East US\",\"MSFT East Asia\",\"MSFT North Europe\",\"East US 2 (Stage)\",\"East Asia (Stage)\",\"Central US (Stage)\",\"North Central US (Stage)\",\"France Central\",\"South Africa North\",\"Australia Central\",\"Switzerland North\",\"Germany West Central\",\"Norway East\",\"East US 2 EUAP\",\"Central US EUAP\"],\"apiVersions\":[\"2019-08-01\",\"2018-11-01\",\"2018-02-01\",\"2016-03-01\",\"2015-08-01-preview\",\"2015-08-01\",\"2015-07-01\",\"2015-06-01\",\"2015-05-01\",\"2015-04-01\",\"2015-02-01\",\"2014-11-01\",\"2014-06-01\",\"2014-04-01-preview\",\"2014-04-01\"],\"apiProfiles\":[{\"profileVersion\":\"2017-03-09-profile\",\"apiVersion\":\"2016-03-01\"},{\"profileVersion\":\"2018-03-01-hybrid\",\"apiVersion\":\"2016-03-01\"},{\"profileVersion\":\"2018-06-01-profile\",\"apiVersion\":\"2018-02-01\"},{\"profileVersion\":\"2019-03-01-hybrid\",\"apiVersion\":\"2018-02-01\"}],\"capabilities\":\"None\"},{\"resourceType\":\"billingMeters\",\"locations\":[\"Central US\",\"North Europe\",\"West Europe\",\"Southeast Asia\",\"Korea Central\",\"Korea South\",\"West US\",\"East US\",\"Japan West\",\"Japan East\",\"East Asia\",\"East US 2\",\"North Central US\",\"South Central US\",\"Brazil South\",\"Australia East\",\"Australia Southeast\",\"West India\",\"Central India\",\"South India\",\"Canada Central\",\"Canada East\",\"West Central US\",\"UK West\",\"UK South\",\"West US 2\",\"MSFT West US\",\"MSFT East US\",\"MSFT East Asia\",\"MSFT North Europe\",\"East US 2 (Stage)\",\"East Asia (Stage)\",\"Central US (Stage)\",\"North Central US (Stage)\",\"France Central\",\"South Africa North\",\"Australia Central\",\"Switzerland North\",\"Germany West Central\",\"Norway East\",\"East US 2 EUAP\",\"Central US EUAP\"],\"apiVersions\":[\"2019-08-01\",\"2018-11-01\",\"2018-02-01\",\"2016-03-01\",\"2015-08-01-preview\",\"2015-08-01\",\"2015-07-01\",\"2015-06-01\",\"2015-05-01\",\"2015-04-01\",\"2015-02-01\",\"2014-11-01\",\"2014-06-01\",\"2014-04-01-preview\",\"2014-04-01\"],\"apiProfiles\":[{\"profileVersion\":\"2017-03-09-profile\",\"apiVersion\":\"2016-03-01\"},{\"profileVersion\":\"2018-03-01-hybrid\",\"apiVersion\":\"2016-03-01\"},{\"profileVersion\":\"2018-06-01-profile\",\"apiVersion\":\"2018-02-01\"},{\"profileVersion\":\"2019-03-01-hybrid\",\"apiVersion\":\"2018-02-01\"}],\"capabilities\":\"None\"},{\"resourceType\":\"verifyHostingEnvironmentVnet\",\"locations\":[\"Central US\",\"North Europe\",\"West Europe\",\"Southeast Asia\",\"Korea Central\",\"Korea South\",\"West US\",\"East US\",\"Japan West\",\"Japan East\",\"East Asia\",\"East US 2\",\"North Central US\",\"South Central US\",\"Brazil South\",\"Australia East\",\"Australia Southeast\",\"West India\",\"Central India\",\"South India\",\"Canada Central\",\"Canada East\",\"West Central US\",\"UK West\",\"UK South\",\"West US 2\",\"MSFT West US\",\"MSFT East US\",\"MSFT East Asia\",\"MSFT North Europe\",\"East US 2 (Stage)\",\"East Asia (Stage)\",\"Central US (Stage)\",\"North Central US (Stage)\",\"France Central\",\"South Africa North\",\"Australia Central\",\"Switzerland North\",\"Germany West Central\",\"Norway East\",\"East US 2 EUAP\",\"Central US EUAP\"],\"apiVersions\":[\"2019-08-01\",\"2018-11-01\",\"2018-02-01\",\"2016-03-01\",\"2015-08-01\",\"2015-07-01\",\"2015-06-01\",\"2015-05-01\",\"2015-04-01\",\"2015-02-01\",\"2014-11-01\",\"2014-06-01\",\"2014-04-01-preview\",\"2014-04-01\"],\"apiProfiles\":[{\"profileVersion\":\"2017-03-09-profile\",\"apiVersion\":\"2016-03-01\"},{\"profileVersion\":\"2018-03-01-hybrid\",\"apiVersion\":\"2016-03-01\"},{\"profileVersion\":\"2018-06-01-profile\",\"apiVersion\":\"2018-02-01\"},{\"profileVersion\":\"2019-03-01-hybrid\",\"apiVersion\":\"2018-02-01\"}],\"capabilities\":\"None\"},{\"resourceType\":\"serverFarms/eventGridFilters\",\"locations\":[\"South Central US\",\"MSFT West US\",\"MSFT East US\",\"MSFT East Asia\",\"MSFT North Europe\",\"East US 2 (Stage)\",\"Central US (Stage)\",\"South Africa North\",\"Australia East\",\"Brazil South\",\"Southeast Asia\",\"Central US\",\"Japan West\",\"Central India\",\"UK South\",\"Canada East\",\"Korea Central\",\"France Central\",\"North Europe\",\"West US 2\",\"West India\",\"East US 2\",\"Australia Central\",\"Germany West Central\",\"Norway West\",\"Norway East\",\"Switzerland North\",\"North Central US\",\"UK West\",\"Australia Southeast\",\"Korea South\",\"Canada Central\",\"West Europe\",\"South India\",\"West Central US\",\"East Asia (Stage)\",\"North Central US (Stage)\",\"East Asia\",\"Japan East\",\"South Africa West\",\"East US 2 EUAP\",\"Central US EUAP\",\"West US\",\"East US\"],\"apiVersions\":[\"2019-08-01\",\"2018-11-01\",\"2018-02-01\",\"2017-08-01\",\"2016-09-01\",\"2016-03-01\",\"2015-08-01\",\"2015-07-01\",\"2015-06-01\",\"2015-05-01\",\"2015-04-01\",\"2015-02-01\",\"2014-11-01\",\"2014-06-01\",\"2014-04-01-preview\",\"2014-04-01\"],\"capabilities\":\"None\"},{\"resourceType\":\"sites/eventGridFilters\",\"locations\":[\"South Central US\",\"MSFT West US\",\"MSFT East US\",\"MSFT East Asia\",\"MSFT North Europe\",\"East US 2 (Stage)\",\"Central US (Stage)\",\"South Africa North\",\"Australia East\",\"Brazil South\",\"Southeast Asia\",\"Central US\",\"Japan West\",\"Central India\",\"UK South\",\"Canada East\",\"Korea Central\",\"France Central\",\"North Europe\",\"West US 2\",\"West India\",\"East US 2\",\"Australia Central\",\"Germany West Central\",\"Norway West\",\"Norway East\",\"Switzerland North\",\"North Central US\",\"UK West\",\"Australia Southeast\",\"Korea South\",\"Canada Central\",\"West Europe\",\"South India\",\"West Central US\",\"East Asia (Stage)\",\"North Central US (Stage)\",\"East Asia\",\"Japan East\",\"South Africa West\",\"East US 2 EUAP\",\"Central US EUAP\",\"West US\",\"East US\"],\"apiVersions\":[\"2019-08-01\",\"2018-11-01\",\"2018-02-01\",\"2017-08-01\",\"2016-09-01\",\"2016-08-01\",\"2016-03-01\",\"2015-11-01\",\"2015-08-01-preview\",\"2015-08-01\",\"2015-07-01\",\"2015-06-01\",\"2015-05-01\",\"2015-04-01\",\"2015-02-01\",\"2015-01-01\",\"2014-11-01\",\"2014-06-01\",\"2014-04-01-preview\",\"2014-04-01\"],\"capabilities\":\"None\"},{\"resourceType\":\"sites/slots/eventGridFilters\",\"locations\":[\"South Central US\",\"MSFT West US\",\"MSFT East US\",\"MSFT East Asia\",\"MSFT North Europe\",\"East US 2 (Stage)\",\"Central US (Stage)\",\"South Africa North\",\"Australia East\",\"Brazil South\",\"Southeast Asia\",\"Central US\",\"Japan West\",\"Central India\",\"UK South\",\"Canada East\",\"Korea Central\",\"France Central\",\"North Europe\",\"West US 2\",\"West India\",\"East US 2\",\"Australia Central\",\"Germany West Central\",\"Norway West\",\"Norway East\",\"Switzerland North\",\"North Central US\",\"UK West\",\"Australia Southeast\",\"Korea South\",\"Canada Central\",\"West Europe\",\"South India\",\"West Central US\",\"East Asia (Stage)\",\"North Central US (Stage)\",\"East Asia\",\"Japan East\",\"South Africa West\",\"East US 2 EUAP\",\"Central US EUAP\",\"West US\",\"East US\"],\"apiVersions\":[\"2019-08-01\",\"2018-11-01\",\"2018-02-01\",\"2017-08-01\",\"2016-09-01\",\"2016-08-01\",\"2016-03-01\",\"2015-11-01\",\"2015-08-01\",\"2015-07-01\",\"2015-06-01\",\"2015-05-01\",\"2015-04-01\",\"2015-02-01\",\"2015-01-01\",\"2014-11-01\",\"2014-06-01\",\"2014-04-01-preview\",\"2014-04-01\"],\"capabilities\":\"None\"},{\"resourceType\":\"hostingEnvironments/eventGridFilters\",\"locations\":[\"North Central US\",\"South Central US\",\"Brazil South\",\"Canada East\",\"UK West\",\"MSFT West US\",\"MSFT East US\",\"MSFT East Asia\",\"MSFT North Europe\",\"East US 2 (Stage)\",\"Central US (Stage)\",\"South Africa North\",\"West US 2\",\"East US 2\",\"UK South\",\"Southeast Asia\",\"North Europe\",\"Japan East\",\"West Europe\",\"East Asia\",\"Australia East\",\"Central US\",\"Japan West\",\"Central India\",\"Korea Central\",\"France Central\",\"West India\",\"Australia Central\",\"Germany West Central\",\"Norway East\",\"Switzerland North\",\"Australia Southeast\",\"Korea South\",\"Canada Central\",\"South India\",\"West Central US\",\"East Asia (Stage)\",\"North Central US (Stage)\",\"West US\",\"East US\",\"East US 2 EUAP\",\"Central US EUAP\"],\"apiVersions\":[\"2019-08-01\",\"2019-02-01\",\"2019-01-01\",\"2018-11-01\",\"2018-08-01\",\"2018-05-01-preview\",\"2018-02-01\",\"2017-08-01\",\"2016-09-01\",\"2016-03-01\",\"2015-08-01\",\"2015-07-01\",\"2015-06-01\",\"2015-05-01\",\"2015-04-01\",\"2015-02-01\",\"2014-11-01\",\"2014-06-01\",\"2014-04-01\"],\"capabilities\":\"None\"}],\"registrationState\":\"Registered\",\"registrationPolicy\":\"RegistrationRequired\"}" + } + }, { + "Method" : "DELETE", + "Uri" : "http://localhost:1234//subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg72b81582/providers/Microsoft.Web/sites/rs72b81582?api-version=2019-08-01", + "Headers" : { + "User-Agent" : "azsdk-java-com.azure.resourcemanager.resources/2.0.0-SNAPSHOT (14.0.1; Windows 10 10.0)", + "Content-Type" : "application/json" + }, + "Response" : { + "date" : "Wed, 08 Jul 2020 03:29:35 GMT", + "server" : "Microsoft-IIS/10.0", + "content-length" : "0", + "expires" : "-1", + "x-ms-ratelimit-remaining-subscription-deletes" : "14999", + "x-aspnet-version" : "4.0.30319", + "retry-after" : "0", + "StatusCode" : "200", + "pragma" : "no-cache", + "x-ms-correlation-request-id" : "51fcfc05-96e4-43cf-9da8-0ef4cdfcd6ec", + "strict-transport-security" : "max-age=31536000; includeSubDomains", + "x-content-type-options" : "nosniff", + "x-ms-routing-request-id" : "SOUTHEASTASIA:20200708T032935Z:51fcfc05-96e4-43cf-9da8-0ef4cdfcd6ec", + "x-powered-by" : "ASP.NET", + "etag" : "\"1D654D7F0FCA7C0\"", + "cache-control" : "no-cache", + "x-ms-request-id" : "6cbc7071-d4b1-4d26-a08e-43a104de872e", + "Body" : "" + } + }, { + "Method" : "GET", + "Uri" : "http://localhost:1234/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg72b81582/resources?api-version=2019-08-01", + "Headers" : { + "User-Agent" : "azsdk-java-com.azure.resourcemanager.resources/2.0.0-SNAPSHOT (14.0.1; Windows 10 10.0)", + "Content-Type" : "application/json" + }, + "Response" : { + "date" : "Wed, 08 Jul 2020 03:30:05 GMT", + "content-length" : "12", + "expires" : "-1", + "retry-after" : "0", + "x-ms-ratelimit-remaining-subscription-reads" : "11996", + "StatusCode" : "200", + "strict-transport-security" : "max-age=31536000; includeSubDomains", + "pragma" : "no-cache", + "x-ms-correlation-request-id" : "f6632c16-6389-4d41-a747-e9e401ccd63c", + "x-content-type-options" : "nosniff", + "x-ms-routing-request-id" : "SOUTHEASTASIA:20200708T033006Z:f6632c16-6389-4d41-a747-e9e401ccd63c", + "content-type" : "application/json; charset=utf-8", + "cache-control" : "no-cache", + "x-ms-request-id" : "f6632c16-6389-4d41-a747-e9e401ccd63c", + "Body" : "{\"value\":[]}" + } + }, { + "Method" : "DELETE", + "Uri" : "http://localhost:1234/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rgB72b81582?api-version=2019-08-01", + "Headers" : { + "User-Agent" : "azsdk-java-com.azure.resourcemanager.resources/2.0.0-SNAPSHOT (14.0.1; Windows 10 10.0)", + "Content-Type" : "application/json" + }, + "Response" : { + "date" : "Wed, 08 Jul 2020 03:30:09 GMT", + "content-length" : "0", + "expires" : "-1", + "x-ms-ratelimit-remaining-subscription-deletes" : "14998", + "retry-after" : "0", + "StatusCode" : "202", + "pragma" : "no-cache", + "x-ms-correlation-request-id" : "4379b08a-e72e-45ab-90cc-8e406295e598", + "strict-transport-security" : "max-age=31536000; includeSubDomains", + "x-content-type-options" : "nosniff", + "x-ms-routing-request-id" : "SOUTHEASTASIA:20200708T033010Z:4379b08a-e72e-45ab-90cc-8e406295e598", + "location" : "http://localhost:1234/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1SR0I3MkI4MTU4Mi1TT1VUSENFTlRSQUxVUyIsImpvYkxvY2F0aW9uIjoic291dGhjZW50cmFsdXMifQ?api-version=2019-08-01", + "cache-control" : "no-cache", + "x-ms-request-id" : "4379b08a-e72e-45ab-90cc-8e406295e598", + "Body" : "" + } + }, { + "Method" : "DELETE", + "Uri" : "http://localhost:1234/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg72b81582?api-version=2019-08-01", + "Headers" : { + "User-Agent" : "azsdk-java-com.azure.resourcemanager.resources/2.0.0-SNAPSHOT (14.0.1; Windows 10 10.0)", + "Content-Type" : "application/json" + }, + "Response" : { + "date" : "Wed, 08 Jul 2020 03:30:13 GMT", + "content-length" : "0", + "expires" : "-1", + "x-ms-ratelimit-remaining-subscription-deletes" : "14997", + "retry-after" : "0", + "StatusCode" : "202", + "pragma" : "no-cache", + "x-ms-correlation-request-id" : "ea86cb6c-ddae-4c25-93fa-21ee8d962f58", + "strict-transport-security" : "max-age=31536000; includeSubDomains", + "x-content-type-options" : "nosniff", + "x-ms-routing-request-id" : "SOUTHEASTASIA:20200708T033014Z:ea86cb6c-ddae-4c25-93fa-21ee8d962f58", + "location" : "http://localhost:1234/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1SRzcyQjgxNTgyLUVBU1RVUyIsImpvYkxvY2F0aW9uIjoiZWFzdHVzIn0?api-version=2019-08-01", + "cache-control" : "no-cache", + "x-ms-request-id" : "ea86cb6c-ddae-4c25-93fa-21ee8d962f58", + "Body" : "" + } + } ], + "variables" : [ "72b81582" ] +} \ No newline at end of file From 553f998a988390bbb01d819e892d3b5e27e3b45f Mon Sep 17 00:00:00 2001 From: Weidong Xu Date: Wed, 15 Jul 2020 16:54:20 +0800 Subject: [PATCH 116/129] mgmt, update user-agent (#13085) * update user-agent * fix for toReactorContext issue for older azure-core * copy UserAgentUtil until keyvault data uses 1.6.0 azure-core * read version from properties prepared by maven --- sdk/management/README.md | 4 +- sdk/management/pom.xml | 9 +-- sdk/resources/mgmt/pom.xml | 11 +-- .../fluentcore/AzureServiceClient.java | 45 ++++-------- .../fluentcore/policy/UserAgentPolicy.java | 68 +++++++++---------- .../mgmt/src/main/resources/azure.properties | 1 + 6 files changed, 58 insertions(+), 80 deletions(-) create mode 100644 sdk/resources/mgmt/src/main/resources/azure.properties diff --git a/sdk/management/README.md b/sdk/management/README.md index 4de42fe746d28..89511077a6eaa 100644 --- a/sdk/management/README.md +++ b/sdk/management/README.md @@ -46,7 +46,7 @@ Azure Management Libraries require a `TokenCredential` implementation for authen com.azure azure-identity - 1.1.0-beta.5 + 1.0.8 ``` [//]: # ({x-version-update-end}) @@ -58,7 +58,7 @@ Azure Management Libraries require a `TokenCredential` implementation for authen com.azure azure-core-http-netty - 1.5.2 + 1.5.3 ``` [//]: # ({x-version-update-end}) diff --git a/sdk/management/pom.xml b/sdk/management/pom.xml index a290e23ca8e75..3e1c72a73bdb8 100644 --- a/sdk/management/pom.xml +++ b/sdk/management/pom.xml @@ -55,11 +55,6 @@ - - com.azure - azure-core - 1.5.0 - com.azure azure-core-management @@ -113,13 +108,13 @@ com.azure azure-core-http-netty - 1.4.0 + 1.5.3 test com.azure azure-identity - 1.1.0-beta.3 + 1.0.8 test diff --git a/sdk/resources/mgmt/pom.xml b/sdk/resources/mgmt/pom.xml index 0894610293ef8..030fcf07163ab 100644 --- a/sdk/resources/mgmt/pom.xml +++ b/sdk/resources/mgmt/pom.xml @@ -47,10 +47,6 @@ - - com.azure - azure-core - com.azure azure-core-management @@ -92,6 +88,13 @@ + + + src/main/resources + true + + + org.apache.maven.plugins diff --git a/sdk/resources/mgmt/src/main/java/com/azure/resourcemanager/resources/fluentcore/AzureServiceClient.java b/sdk/resources/mgmt/src/main/java/com/azure/resourcemanager/resources/fluentcore/AzureServiceClient.java index 35c6193d74c46..27cc88d828ccf 100644 --- a/sdk/resources/mgmt/src/main/java/com/azure/resourcemanager/resources/fluentcore/AzureServiceClient.java +++ b/sdk/resources/mgmt/src/main/java/com/azure/resourcemanager/resources/fluentcore/AzureServiceClient.java @@ -46,27 +46,22 @@ public abstract class AzureServiceClient { private final ClientLogger logger = new ClientLogger(getClass()); - protected AzureServiceClient(HttpPipeline httpPipeline, AzureEnvironment environment) { - ((AzureJacksonAdapter) serializerAdapter).serializer().registerModule(DateTimeDeserializer.getModule()); - } - - private static final String OS; - private static final String OS_NAME; - private static final String OS_VERSION; - private static final String JAVA_VERSION; - private static final String SDK_VERSION = "2.0.0-SNAPSHOT"; + private static final Map PROPERTIES = + CoreUtils.getProperties("azure.properties"); + private static final String SDK_VERSION; static { - OS_NAME = System.getProperty("os.name"); - OS_VERSION = System.getProperty("os.version"); - OS = OS_NAME + "/" + OS_VERSION; - String version = System.getProperty("java.version"); - JAVA_VERSION = version != null ? version : "Unknown"; + SDK_VERSION = PROPERTIES.getOrDefault("version", "UnknownVersion"); } private final SerializerAdapter serializerAdapter = new AzureJacksonAdapter(); - private String sdkName; + private final String sdkName; + + protected AzureServiceClient(HttpPipeline httpPipeline, AzureEnvironment environment) { + sdkName = this.getClass().getPackage().getName(); + ((AzureJacksonAdapter) serializerAdapter).serializer().registerModule(DateTimeDeserializer.getModule()); + } /** * Gets serializer adapter for JSON serialization/de-serialization. @@ -83,24 +78,8 @@ public SerializerAdapter getSerializerAdapter() { * @return the default client context. */ public Context getContext() { - Context context = new Context("java.version", JAVA_VERSION); - if (!CoreUtils.isNullOrEmpty(OS_NAME)) { - context = context.addData("os.name", OS_NAME); - } - if (!CoreUtils.isNullOrEmpty(OS_VERSION)) { - context = context.addData("os.version", OS_VERSION); - } - if (sdkName == null) { - String packageName = this.getClass().getPackage().getName(); - if (packageName.endsWith(".models")) { - sdkName = packageName.substring(0, packageName.length() - ".models".length()); - } else { - sdkName = packageName; - } - } - context = context.addData("Sdk-Name", sdkName); - context = context.addData("Sdk-Version", SDK_VERSION); - return context; + return new Context("Sdk-Name", sdkName) + .addData("Sdk-Version", SDK_VERSION); } /** diff --git a/sdk/resources/mgmt/src/main/java/com/azure/resourcemanager/resources/fluentcore/policy/UserAgentPolicy.java b/sdk/resources/mgmt/src/main/java/com/azure/resourcemanager/resources/fluentcore/policy/UserAgentPolicy.java index fb907e2bebf92..8bd010728836c 100644 --- a/sdk/resources/mgmt/src/main/java/com/azure/resourcemanager/resources/fluentcore/policy/UserAgentPolicy.java +++ b/sdk/resources/mgmt/src/main/java/com/azure/resourcemanager/resources/fluentcore/policy/UserAgentPolicy.java @@ -21,36 +21,12 @@ public class UserAgentPolicy implements HttpPipelinePolicy { private static final String SDK_VERSION_KEY = "Sdk-Version"; private static final String APPLICATION_ID_KEY = "Application-Id"; - private static final String OS_NAME = System.getProperty("os.name"); - private static final String OS_VERSION = System.getProperty("os.version"); - private static final String JAVA_VERSION = System.getProperty("java.version"); - - /* - * The base User-Agent header format is azsdk-java-/. Additional information such as the - * application ID will be prepended and platform telemetry will be appended, a fully configured User-Agent header - * format is azsdk-java-/ . - */ - private static final String DEFAULT_USER_AGENT_FORMAT = "azsdk-java-%s/%s"; - - // From the design guidelines, the platform info format is: - // ; - private static final String PLATFORM_INFO_FORMAT = "%s; %s %s"; - private final String defaultSdkName = this.getClass().getPackage().getName(); private final String defaultSdkVersion = this.getClass().getPackage().getSpecificationVersion(); private final HttpLogOptions httpLogOptions; private final Configuration configuration; - private static final UserAgentPolicy DEFAULT_USER_AGENT_POLICY = new UserAgentPolicy(null, null); - - /** - * @return default user agent policy - */ - public static UserAgentPolicy getDefaultUserAgentPolicy() { - return DEFAULT_USER_AGENT_POLICY; - } - /** * @param httpLogOptions used for get application id * @param configuration used for check telemetry enable or not @@ -69,32 +45,54 @@ public UserAgentPolicy(HttpLogOptions httpLogOptions, Configuration configuratio } } - protected String buildUserAgent(String applicationId, String sdkName, String sdkVersion) { + // begin of UserAgentUtil.toUserAgentString + public static final String DEFAULT_USER_AGENT_HEADER = "azsdk-java"; + private static final String PLATFORM_INFO_FORMAT = "%s; %s; %s"; + private static final int MAX_APP_ID_LENGTH = 24; + + private static String toUserAgentString(String applicationId, String sdkName, String sdkVersion, + Configuration configuration) { StringBuilder userAgentBuilder = new StringBuilder(); // Only add the application ID if it is present as it is optional. if (applicationId != null) { + applicationId = applicationId.length() > MAX_APP_ID_LENGTH ? applicationId.substring(0, MAX_APP_ID_LENGTH) + : applicationId; userAgentBuilder.append(applicationId).append(" "); } // Add the required default User-Agent string. - userAgentBuilder.append(String.format(DEFAULT_USER_AGENT_FORMAT, sdkName, sdkVersion)); + userAgentBuilder.append(DEFAULT_USER_AGENT_HEADER) + .append("-") + .append(sdkName) + .append("/") + .append(sdkVersion); // Only add the platform telemetry if it is allowed as it is optional. - if (!telemetryDisabled()) { - String platformInfo = String.format(PLATFORM_INFO_FORMAT, JAVA_VERSION, OS_NAME, OS_VERSION); + if (!isTelemetryDisabled(configuration)) { userAgentBuilder.append(" ") - .append("(") - .append(platformInfo) - .append(")"); + .append("(") + .append(getPlatformInfo()) + .append(")"); } return userAgentBuilder.toString(); } - private boolean telemetryDisabled() { - return configuration.get(Configuration.PROPERTY_AZURE_TELEMETRY_DISABLED, false); + private static String getPlatformInfo() { + String javaVersion = Configuration.getGlobalConfiguration().get("java.version"); + String osName = Configuration.getGlobalConfiguration().get("os.name"); + String osVersion = Configuration.getGlobalConfiguration().get("os.version"); + + return String.format(PLATFORM_INFO_FORMAT, javaVersion, osName, osVersion); + } + + private static boolean isTelemetryDisabled(Configuration configuration) { + return (configuration == null) + ? Configuration.getGlobalConfiguration().get(Configuration.PROPERTY_AZURE_TELEMETRY_DISABLED, false) + : configuration.get(Configuration.PROPERTY_AZURE_TELEMETRY_DISABLED, false); } + // end of UserAgentUtil.toUserAgentString @Override public Mono process(HttpPipelineCallContext context, HttpPipelineNextPolicy next) { @@ -124,7 +122,9 @@ public Mono process(HttpPipelineCallContext context, HttpPipelineN applicationId = httpLogOptions.getApplicationId(); } - context.getHttpRequest().setHeader(USER_AGENT_KEY, buildUserAgent(applicationId, sdkName, sdkVersion)); + context.getHttpRequest().setHeader(USER_AGENT_KEY, + //UserAgentUtil.toUserAgentString(applicationId, sdkName, sdkVersion, configuration)); + toUserAgentString(applicationId, sdkName, sdkVersion, configuration)); return next.process(); } } diff --git a/sdk/resources/mgmt/src/main/resources/azure.properties b/sdk/resources/mgmt/src/main/resources/azure.properties new file mode 100644 index 0000000000000..defbd48204e47 --- /dev/null +++ b/sdk/resources/mgmt/src/main/resources/azure.properties @@ -0,0 +1 @@ +version=${project.version} From 2eb4fa6b813564c1d074b3ff189fc4f29cea3984 Mon Sep 17 00:00:00 2001 From: Azure SDK Bot <53356347+azure-sdk@users.noreply.github.com> Date: Wed, 15 Jul 2020 07:04:50 -0700 Subject: [PATCH 117/129] Sync eng/common directory with azure-sdk-tools repository (#13062) --- .../TestResources/deploy-test-resources.yml | 2 +- .../templates/steps/create-pull-request.yml | 16 ++++ .../templates/steps/docs-metadata-release.yml | 4 + .../templates/steps/get-pr-owners.yml | 46 +++++++++++ eng/common/scripts/Submit-PullRequest.ps1 | 6 ++ .../scripts/add-pullrequest-reviewers.ps1 | 79 +++++++++++++++++++ eng/common/scripts/get-codeowners.ps1 | 40 ++++++++++ 7 files changed, 192 insertions(+), 1 deletion(-) create mode 100644 eng/common/pipelines/templates/steps/get-pr-owners.yml create mode 100644 eng/common/scripts/add-pullrequest-reviewers.ps1 create mode 100644 eng/common/scripts/get-codeowners.ps1 diff --git a/eng/common/TestResources/deploy-test-resources.yml b/eng/common/TestResources/deploy-test-resources.yml index b580d73f14062..b875a806b143a 100644 --- a/eng/common/TestResources/deploy-test-resources.yml +++ b/eng/common/TestResources/deploy-test-resources.yml @@ -13,7 +13,7 @@ parameters: # "TestApplicationId": "", # "TestApplicationSecret": "", # "ProvisionerApplicationId": "", -# "ProvisoinerApplicationSecret": "", +# "ProvisionerApplicationSecret": "", # "Environment": "AzureCloud | AzureGov | AzureChina | " # } diff --git a/eng/common/pipelines/templates/steps/create-pull-request.yml b/eng/common/pipelines/templates/steps/create-pull-request.yml index 790de92bcbe5f..ce0680ff8f997 100644 --- a/eng/common/pipelines/templates/steps/create-pull-request.yml +++ b/eng/common/pipelines/templates/steps/create-pull-request.yml @@ -12,6 +12,8 @@ parameters: WorkingDirectory: $(System.DefaultWorkingDirectory) PRTitle: not-specified ScriptDirectory: eng/common/scripts + GHReviewersVariable: '' + GHTeamReviewersVariable: '' steps: @@ -63,3 +65,17 @@ steps: -PRBranch "${{ parameters.PRBranchName }}" -AuthToken "$(azuresdk-github-pat)" -PRTitle "${{ parameters.PRTitle }}" + +- task: PowerShell@2 + displayName: Tag a Reviewer on PR + inputs: + pwsh: true + workingDirectory: ${{ parameters.WorkingDirectory }} + filePath: ${{ parameters.ScriptDirectory }}/add-pullrequest-reviewers.ps1 + arguments: > + -RepoOwner "${{ parameters.RepoOwner }}" + -RepoName "${{ parameters.RepoName }}" + -AuthToken "$(azuresdk-github-pat)" + -GitHubUsers "$(${{ parameters.GHReviewersVariable }})" + -GitHubTeams "$(${{ parameters.GHTeamReviewersVariable }})" + -PRNumber "$(Submitted.PullRequest.Number)" diff --git a/eng/common/pipelines/templates/steps/docs-metadata-release.yml b/eng/common/pipelines/templates/steps/docs-metadata-release.yml index 6ff9f84ff3ee7..a9ff8c4e17b41 100644 --- a/eng/common/pipelines/templates/steps/docs-metadata-release.yml +++ b/eng/common/pipelines/templates/steps/docs-metadata-release.yml @@ -12,6 +12,8 @@ parameters: ArtifactName: '' Language: '' DocRepoDestinationPath: '' #usually docs-ref-services/ + GHReviewersVariable: '' + GHTeamReviewersVariable: '' # externally set, as eng-common does not have the identity-resolver. Run as pre-step steps: - pwsh: | @@ -56,3 +58,5 @@ steps: BaseBranchName: smoke-test WorkingDirectory: ${{ parameters.WorkingDirectory }}/repo ScriptDirectory: ${{ parameters.WorkingDirectory }}/${{ parameters.ScriptDirectory }} + GHReviewersVariable: ${{ parameters.GHReviewersVariable }} + GHTeamReviewersVariable: ${{ parameters.GHTeamReviewersVariable }} diff --git a/eng/common/pipelines/templates/steps/get-pr-owners.yml b/eng/common/pipelines/templates/steps/get-pr-owners.yml new file mode 100644 index 0000000000000..a80d5b83b2de5 --- /dev/null +++ b/eng/common/pipelines/templates/steps/get-pr-owners.yml @@ -0,0 +1,46 @@ +parameters: + TargetVariable: '' + ServiceDirectory: '' + +steps: + - pwsh: | + git clone https://github.com/Azure/azure-sdk-tools.git $(Build.SourcesDirectory)/tools_repo + cd $(Build.SourcesDirectory)/tools_repo + git checkout 564ad63ae72d18422533fa1da9d396e7703c1cb5 + displayName: Setup Identity Resolver + + - pwsh: | + $result = dotnet run -v q -- ` + --aad-app-id-var APP_ID ` + --aad-app-secret-var APP_SECRET ` + --aad-tenant-var AAD_TENANT ` + --kusto-url-var KUSTO_URL ` + --kusto-database-var KUSTO_DB ` + --kusto-table-var KUSTO_TABLE ` + --identity "$(Build.QueuedBy)" + $resolvedIdentity = $result[-1] | ConvertFrom-Json + + Write-Host $resolvedIdentity + + Write-Output "##vso[task.setvariable variable=${{ parameters.TargetVariable }}]$($resolvedIdentity.GithubUserName)" + displayName: 'Resolving Queuing User' + workingDirectory: $(Build.SourcesDirectory)/tools_repo/tools/notification-configuration/identity-resolver + env: + APP_ID: $(notification-aad-app-id) + APP_SECRET: $(notification-aad-secret) + AAD_TENANT: $(notification-aad-tenant) + KUSTO_URL: $(notification-kusto-url) + KUSTO_DB: $(notification-kusto-db) + KUSTO_TABLE: $(notification-kusto-table) + + - pwsh: | + Remove-Item -Force -Recurse $(Build.SourcesDirectory)/tools_repo + displayName: Clean Up Cloned Tools Repo + + - pwsh: | + $originalValue = "$(${{ parameters.TargetVariable }})" + $result = $(Build.SourcesDirectory)/eng/common/scripts/get-codeowners.ps1 -TargetDirectory /sdk/${{ parameters.ServiceDirectory }}/ -RootDirectory $(Build.SourcesDirectory) + if ($result) { + Write-Output "##vso[task.setvariable variable=${{ parameters.TargetVariable }}]$originalValue,$result" + } + displayName: Add CodeOwners if Present \ No newline at end of file diff --git a/eng/common/scripts/Submit-PullRequest.ps1 b/eng/common/scripts/Submit-PullRequest.ps1 index ef2a6f5450615..5edabc599a99f 100644 --- a/eng/common/scripts/Submit-PullRequest.ps1 +++ b/eng/common/scripts/Submit-PullRequest.ps1 @@ -58,6 +58,9 @@ $resp | Write-Verbose if ($resp.Count -gt 0) { Write-Host -f green "Pull request already exists $($resp[0].html_url)" + + # setting variable to reference the pull request by number + Write-Host "##vso[task.setvariable variable=Submitted.PullRequest.Number]$($resp[0].number)" } else { $data = @{ @@ -80,4 +83,7 @@ else { $resp | Write-Verbose Write-Host -f green "Pull request created https://github.com/$RepoOwner/$RepoName/pull/$($resp.number)" + + # setting variable to reference the pull request by number + Write-Host "##vso[task.setvariable variable=Submitted.PullRequest.Number]$($resp.number)" } diff --git a/eng/common/scripts/add-pullrequest-reviewers.ps1 b/eng/common/scripts/add-pullrequest-reviewers.ps1 new file mode 100644 index 0000000000000..00460ce701f09 --- /dev/null +++ b/eng/common/scripts/add-pullrequest-reviewers.ps1 @@ -0,0 +1,79 @@ +param( + [Parameter(Mandatory = $true)] + $RepoOwner, + + [Parameter(Mandatory = $true)] + $RepoName, + + [Parameter(Mandatory = $false)] + $GitHubUsers = "", + + [Parameter(Mandatory = $false)] + $GitHubTeams = "", + + [Parameter(Mandatory = $true)] + $PRNumber, + + [Parameter(Mandatory = $true)] + $AuthToken +) + +# at least one of these needs to be populated +if (-not $GitHubUsers -and -not $GitHubTeams) { + Write-Host "No user provided for addition, exiting." + exit 0 +} + +$userAdditions = @($GitHubUsers.Split(",") | % { $_.Trim() } | ? { return $_ }) +$teamAdditions = @($GitHubTeams.Split(",") | % { $_.Trim() } | ? { return $_ }) + +$headers = @{ + Authorization = "bearer $AuthToken" +} +$uri = "https://api.github.com/repos/$RepoOwner/$RepoName/pulls/$PRNumber/requested_reviewers" + +try { + $resp = Invoke-RestMethod -Headers $headers $uri -MaximumRetryCount 3 +} +catch { + Write-Error "Invoke-RestMethod [$uri] failed with exception:`n$_" + exit 1 +} + +# the response object takes this form: https://developer.github.com/v3/pulls/review_requests/#response-1 +# before we can push a new reviewer, we need to pull the simple Ids out of the complex objects that came back in the response +$userReviewers = @($resp.users | % { return $_.login }) +$teamReviewers = @($resp.teams | % { return $_.slug }) + +if (!$usersReviewers) { $modifiedUserReviewers = @() } else { $modifiedUserReviewers = $usersReviewers.Clone() } +$modifiedUserReviewers += ($modifiedUserReviewers | ? { !$usersReviews.Contains($_) }) + +if ($teamReviewers) { $modifiedTeamReviewers = @() } else { $modifiedTeamReviewers = $teamReviewers.Clone() } +$modifiedTeamReviewers += ($modifiedUserReviewers | ? { !$teamReviewers.Contains($_) }) + +$detectedUserDiffs = Compare-Object -ReferenceObject $userReviewers -DifferenceObject $modifiedUserReviewers +$detectedTeamDiffs = Compare-Object -ReferenceObject $teamReviewers -DifferenceObject $modifiedTeamReviewers + +# Compare-Object returns values when there is a difference between the comparied objects. +# we only want to run the update if there IS a difference. +if ($detectedUserDiffs -or $detectedTeamDiffs) { + $postResp = @{} + + if ($modifiedUserReviewers) { $postResp["reviewers"] = $modifiedUserReviewers } + if ($modifiedTeamReviewers) { $postResp["team_reviewers"] = $modifiedTeamReviewers } + + $postResp = $postResp | ConvertTo-Json + + try { + $resp = Invoke-RestMethod -Method Post -Headers $headers -Body $postResp -Uri $uri -MaximumRetryCount 3 + $resp | Write-Verbose + } + catch { + Write-Error "Unable to update PR reviewers. `n$_" + } +} +else { + $results = $GitHubUsers + $GitHubTeams + Write-Host "Reviewers $results already added. Exiting." + exit(0) +} diff --git a/eng/common/scripts/get-codeowners.ps1 b/eng/common/scripts/get-codeowners.ps1 new file mode 100644 index 0000000000000..edbae4cb18c6f --- /dev/null +++ b/eng/common/scripts/get-codeowners.ps1 @@ -0,0 +1,40 @@ +param ( + $TargetDirectory, # should be in relative form from root of repo. EG: sdk/servicebus + $RootDirectory # ideally $(Build.SourcesDirectory) +) + +$codeOwnersLocation = Join-Path $RootDirectory -ChildPath ".github/CODEOWNERS" + +if (!(Test-Path $codeOwnersLocation)) { + Write-Host "Unable to find CODEOWNERS file in target directory $RootDirectory" + exit 1 +} + +$codeOwnersContent = Get-Content $codeOwnersLocation + +$ownedFolders = @{} + +foreach ($contentLine in $codeOwnersContent) { + if (-not $contentLine.StartsWith("#") -and $contentLine){ + $splitLine = $contentLine -split "\s+" + + # CODEOWNERS file can also have labels present after the owner aliases + # gh aliases start with @ in codeowners. don't pass on to API calls + $ownedFolders[$splitLine[0].ToLower()] = ($splitLine[1..$($splitLine.Length)] ` + | ? { $_.StartsWith("@") } ` + | % { return $_.substring(1) }) -join "," + } +} + +$results = $ownedFolders[$TargetDirectory.ToLower()] + +if ($results) { + Write-Host "Discovered code owners for path $TargetDirectory are $results." + return $results +} +else { + Write-Host "Unable to match path $TargetDirectory in CODEOWNERS file located at $codeOwnersLocation." + Write-Host $ownedFolders | ConvertTo-Json + return "" +} + From b1441161ac0b4913e0dc4b675a4492166b8d0378 Mon Sep 17 00:00:00 2001 From: M <19926623+moarychan@users.noreply.github.com> Date: Wed, 15 Jul 2020 23:39:46 +0800 Subject: [PATCH 118/129] Support AllIgnoreCase and IgnoreCase keywords in Cosmos (#13128) * New feature, support AllIgnoreCase and IgnoreCase keywords in Cosmos database to ignore case query. * added findByXXXIgnoreCase testcase --- .../data/cosmos/core/CosmosTemplate.java | 3 +- .../generator/AbstractQueryGenerator.java | 42 +++++++++++++- .../data/cosmos/core/query/Criteria.java | 18 +++++- .../repository/query/CosmosQueryCreator.java | 2 +- .../query/ReactiveCosmosQueryCreator.java | 2 +- .../data/cosmos/core/CosmosTemplateIT.java | 22 ++++++- .../core/CosmosTemplateIllegalTest.java | 7 ++- .../core/CosmosTemplatePartitionIT.java | 57 ++++++++++++++++--- .../cosmos/core/ReactiveCosmosTemplateIT.java | 20 ++++++- .../ReactiveCosmosTemplatePartitionIT.java | 28 ++++++++- .../cosmos/core/query/CriteriaUnitTest.java | 20 +++++-- .../core/query/DocumentQueryUnitTest.java | 4 +- .../ReactiveCourseRepositoryIT.java | 20 +++++++ .../integration/StudentRepositoryIT.java | 49 ++++++++++++++++ .../repository/ReactiveCourseRepository.java | 25 +++++++- .../repository/StudentRepository.java | 47 +++++++++++++++ 16 files changed, 335 insertions(+), 31 deletions(-) diff --git a/sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/core/CosmosTemplate.java b/sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/core/CosmosTemplate.java index 7b0043ca791b7..c8ef03254879c 100644 --- a/sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/core/CosmosTemplate.java +++ b/sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/core/CosmosTemplate.java @@ -36,6 +36,7 @@ import org.springframework.context.ApplicationContextAware; import org.springframework.data.domain.Page; import org.springframework.data.domain.Pageable; +import org.springframework.data.repository.query.parser.Part; import org.springframework.lang.NonNull; import org.springframework.util.Assert; import org.springframework.util.StringUtils; @@ -462,7 +463,7 @@ public List findByIds(Iterable ids, Class domainType, String c Assert.hasText(containerName, "container should not be null, empty or only whitespaces"); final DocumentQuery query = new DocumentQuery(Criteria.getInstance(CriteriaType.IN, "id", - Collections.singletonList(ids))); + Collections.singletonList(ids), Part.IgnoreCaseType.NEVER)); return find(query, domainType, containerName); } diff --git a/sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/core/generator/AbstractQueryGenerator.java b/sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/core/generator/AbstractQueryGenerator.java index 680ec4045ac52..68719b5c3280c 100644 --- a/sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/core/generator/AbstractQueryGenerator.java +++ b/sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/core/generator/AbstractQueryGenerator.java @@ -10,6 +10,7 @@ import com.azure.spring.data.cosmos.exception.IllegalQueryException; import org.javatuples.Pair; import org.springframework.data.domain.Sort; +import org.springframework.data.repository.query.parser.Part; import org.springframework.lang.NonNull; import org.springframework.util.Assert; import org.springframework.util.StringUtils; @@ -53,13 +54,48 @@ private String generateBinaryQuery(@NonNull Criteria criteria, @NonNull List subjectValues; private final CriteriaType type; private final List subCriteria; + private Part.IgnoreCaseType ignoreCase; + + /** + * Ignore case flag + * @return ignore case flag + */ + public Part.IgnoreCaseType getIgnoreCase() { + return ignoreCase; + } /** * To get subject @@ -55,18 +65,20 @@ private Criteria(CriteriaType type) { } /** - * To get a criteria instance with subject + * To get a criteria instance with subject and ignore case * @param type CriteriaType * @param subject subject * @param values subject value + * @param ignoreCase ignore case flag * @return Criteria instance */ - public static Criteria getInstance(CriteriaType type, @NonNull String subject, @NonNull List values) { + public static Criteria getInstance(CriteriaType type, @NonNull String subject, + @NonNull List values, @NonNull Part.IgnoreCaseType ignoreCase) { final Criteria criteria = new Criteria(type); criteria.subject = subject; criteria.subjectValues = values; - + criteria.ignoreCase = ignoreCase; return criteria; } diff --git a/sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/repository/query/CosmosQueryCreator.java b/sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/repository/query/CosmosQueryCreator.java index ceafd6096c327..20c20a092323c 100644 --- a/sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/repository/query/CosmosQueryCreator.java +++ b/sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/repository/query/CosmosQueryCreator.java @@ -74,7 +74,7 @@ protected Criteria create(Part part, Iterator parameters) { values.add(parameters.next()); } - return Criteria.getInstance(CriteriaType.toCriteriaType(type), subject, values); + return Criteria.getInstance(CriteriaType.toCriteriaType(type), subject, values, part.shouldIgnoreCase()); } @Override diff --git a/sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/repository/query/ReactiveCosmosQueryCreator.java b/sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/repository/query/ReactiveCosmosQueryCreator.java index 300651feefffa..1ef6c82bd2dff 100644 --- a/sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/repository/query/ReactiveCosmosQueryCreator.java +++ b/sdk/cosmos/azure-spring-data-cosmos/src/main/java/com/azure/spring/data/cosmos/repository/query/ReactiveCosmosQueryCreator.java @@ -72,7 +72,7 @@ protected Criteria create(Part part, Iterator parameters) { values.add(parameters.next()); } - return Criteria.getInstance(CriteriaType.toCriteriaType(type), subject, values); + return Criteria.getInstance(CriteriaType.toCriteriaType(type), subject, values, part.shouldIgnoreCase()); } @Override diff --git a/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/core/CosmosTemplateIT.java b/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/core/CosmosTemplateIT.java index c445b25be9cef..090902aca03aa 100644 --- a/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/core/CosmosTemplateIT.java +++ b/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/core/CosmosTemplateIT.java @@ -31,6 +31,7 @@ import org.springframework.data.domain.Page; import org.springframework.data.domain.PageRequest; import org.springframework.data.domain.Sort; +import org.springframework.data.repository.query.parser.Part; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; @@ -287,12 +288,20 @@ public void testCountByQuery() { assertThat(responseDiagnosticsTestUtils.getCosmosResponseStatistics()).isNull(); final Criteria criteria = Criteria.getInstance(CriteriaType.IS_EQUAL, "firstName", - Collections.singletonList(TEST_PERSON_2.getFirstName())); + Collections.singletonList(TEST_PERSON_2.getFirstName()), Part.IgnoreCaseType.NEVER); final DocumentQuery query = new DocumentQuery(criteria); final long count = cosmosTemplate.count(query, Person.class, containerName); assertThat(count).isEqualTo(1); + // add ignoreCase testing + final Criteria criteriaIgnoreCase = Criteria.getInstance(CriteriaType.IS_EQUAL, "firstName", + Collections.singletonList(TEST_PERSON_2.getFirstName().toUpperCase()), Part.IgnoreCaseType.ALWAYS); + final DocumentQuery queryIgnoreCase = new DocumentQuery(criteriaIgnoreCase); + + final long countIgnoreCase = cosmosTemplate.count(queryIgnoreCase, Person.class, containerName); + assertThat(countIgnoreCase).isEqualTo(1); + assertThat(responseDiagnosticsTestUtils.getFeedResponseDiagnostics()).isNotNull(); assertThat(responseDiagnosticsTestUtils.getCosmosResponseStatistics()).isNotNull(); assertThat(responseDiagnosticsTestUtils.getCosmosResponseStatistics().getRequestCharge()).isGreaterThan(0); @@ -339,7 +348,7 @@ public void testPaginationQuery() { assertThat(responseDiagnosticsTestUtils.getCosmosResponseStatistics()).isNull(); final Criteria criteria = Criteria.getInstance(CriteriaType.IS_EQUAL, "firstName", - Collections.singletonList(FIRST_NAME)); + Collections.singletonList(FIRST_NAME), Part.IgnoreCaseType.NEVER); final PageRequest pageRequest = new CosmosPageRequest(0, PAGE_SIZE_2, null); final DocumentQuery query = new DocumentQuery(criteria).with(pageRequest); @@ -347,6 +356,15 @@ public void testPaginationQuery() { assertThat(page.getContent().size()).isEqualTo(1); PageTestUtils.validateLastPage(page, page.getContent().size()); + // add ignore case testing + final Criteria criteriaIgnoreCase = Criteria.getInstance(CriteriaType.IS_EQUAL, "firstName", + Collections.singletonList(FIRST_NAME.toUpperCase()), Part.IgnoreCaseType.ALWAYS); + final DocumentQuery queryIgnoreCase = new DocumentQuery(criteriaIgnoreCase).with(pageRequest); + + final Page pageIgnoreCase = cosmosTemplate.paginationQuery(queryIgnoreCase, Person.class, containerName); + assertThat(pageIgnoreCase.getContent().size()).isEqualTo(1); + PageTestUtils.validateLastPage(pageIgnoreCase, pageIgnoreCase.getContent().size()); + assertThat(responseDiagnosticsTestUtils.getCosmosResponseDiagnostics()).isNull(); assertThat(responseDiagnosticsTestUtils.getFeedResponseDiagnostics()).isNotNull(); assertThat(responseDiagnosticsTestUtils.getCosmosResponseStatistics()).isNotNull(); diff --git a/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/core/CosmosTemplateIllegalTest.java b/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/core/CosmosTemplateIllegalTest.java index b569f8d211592..dd63b2e930409 100644 --- a/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/core/CosmosTemplateIllegalTest.java +++ b/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/core/CosmosTemplateIllegalTest.java @@ -14,6 +14,7 @@ import org.mockito.Answers; import org.mockito.Mock; import org.mockito.junit.MockitoJUnitRunner; +import org.springframework.data.repository.query.parser.Part; import org.springframework.util.Assert; import java.lang.reflect.InvocationTargetException; @@ -42,8 +43,10 @@ public void setUp() { @Test public void deleteIllegalShouldFail() throws NoSuchMethodException { - final Method method = dbTemplateClass.getMethod("delete", DocumentQuery.class, Class.class, String.class); - final Criteria criteria = Criteria.getInstance(CriteriaType.IS_EQUAL, "faker", Arrays.asList("faker-value")); + final Method method = dbTemplateClass.getMethod("delete", + DocumentQuery.class, Class.class, String.class); + final Criteria criteria = Criteria.getInstance(CriteriaType.IS_EQUAL, + "faker", Arrays.asList("faker-value"), Part.IgnoreCaseType.NEVER); final DocumentQuery query = new DocumentQuery(criteria); checkIllegalArgument(method, null, Person.class, DUMMY_COLL); diff --git a/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/core/CosmosTemplatePartitionIT.java b/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/core/CosmosTemplatePartitionIT.java index b72787b917ca8..adce25d05db49 100644 --- a/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/core/CosmosTemplatePartitionIT.java +++ b/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/core/CosmosTemplatePartitionIT.java @@ -27,6 +27,7 @@ import org.springframework.data.annotation.Persistent; import org.springframework.data.domain.Page; import org.springframework.data.domain.PageRequest; +import org.springframework.data.repository.query.parser.Part; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; @@ -91,7 +92,8 @@ public static void afterClassCleanup() { @Test public void testFindWithPartition() { - Criteria criteria = Criteria.getInstance(CriteriaType.IS_EQUAL, PROPERTY_LAST_NAME, Arrays.asList(LAST_NAME)); + Criteria criteria = Criteria.getInstance(CriteriaType.IS_EQUAL, PROPERTY_LAST_NAME, + Arrays.asList(LAST_NAME), Part.IgnoreCaseType.NEVER); DocumentQuery query = new DocumentQuery(criteria); List result = cosmosTemplate.find(query, PartitionPerson.class, PartitionPerson.class.getSimpleName()); @@ -99,9 +101,23 @@ public void testFindWithPartition() { assertThat(result.size()).isEqualTo(1); assertEquals(TEST_PERSON, result.get(0)); - criteria = Criteria.getInstance(CriteriaType.IS_EQUAL, PROPERTY_ID, Arrays.asList(ID_1)); + criteria = Criteria.getInstance(CriteriaType.IS_EQUAL, PROPERTY_ID, + Arrays.asList(ID_1), Part.IgnoreCaseType.NEVER); query = new DocumentQuery(criteria); - result = cosmosTemplate.find(query, PartitionPerson.class, PartitionPerson.class.getSimpleName()); + result = cosmosTemplate.find(query, PartitionPerson.class, + PartitionPerson.class.getSimpleName()); + + assertThat(result.size()).isEqualTo(1); + assertEquals(TEST_PERSON, result.get(0)); + } + + @Test + public void testFindIgnoreCaseWithPartition() { + Criteria criteria = Criteria.getInstance(CriteriaType.IS_EQUAL, PROPERTY_LAST_NAME, + Arrays.asList(LAST_NAME.toUpperCase()), Part.IgnoreCaseType.ALWAYS); + DocumentQuery query = new DocumentQuery(criteria); + List result = cosmosTemplate.find(query, PartitionPerson.class, + PartitionPerson.class.getSimpleName()); assertThat(result.size()).isEqualTo(1); assertEquals(TEST_PERSON, result.get(0)); @@ -119,7 +135,8 @@ public void testFindByIdWithPartition() { @Test public void testFindByNonExistIdWithPartition() { - final Criteria criteria = Criteria.getInstance(CriteriaType.IS_EQUAL, PROPERTY_ID, Arrays.asList(NOT_EXIST_ID)); + final Criteria criteria = Criteria.getInstance(CriteriaType.IS_EQUAL, PROPERTY_ID, + Arrays.asList(NOT_EXIST_ID), Part.IgnoreCaseType.NEVER); final DocumentQuery query = new DocumentQuery(criteria); final List result = cosmosTemplate.find(query, PartitionPerson.class, @@ -191,17 +208,29 @@ public void testCountForPartitionedCollectionByQuery() { cosmosTemplate.insert(TEST_PERSON_2, new PartitionKey(TEST_PERSON_2.getLastName())); final Criteria criteria = Criteria.getInstance(CriteriaType.IS_EQUAL, "firstName", - Arrays.asList(TEST_PERSON_2.getFirstName())); + Arrays.asList(TEST_PERSON_2.getFirstName()), Part.IgnoreCaseType.NEVER); final DocumentQuery query = new DocumentQuery(criteria); final long count = cosmosTemplate.count(query, PartitionPerson.class, containerName); assertThat(count).isEqualTo(1); } + @Test + public void testCountIgnoreCaseForPartitionedCollectionByQuery() { + cosmosTemplate.insert(TEST_PERSON_2, new PartitionKey(TEST_PERSON_2.getLastName())); + final Criteria criteriaIgnoreCase = Criteria.getInstance(CriteriaType.IS_EQUAL, "firstName", + Arrays.asList(TEST_PERSON_2.getFirstName().toUpperCase()), Part.IgnoreCaseType.ALWAYS); + final DocumentQuery queryIgnoreCase = new DocumentQuery(criteriaIgnoreCase); + + final long countIgnoreCase = cosmosTemplate.count(queryIgnoreCase, + PartitionPerson.class, containerName); + assertThat(countIgnoreCase).isEqualTo(1); + } + @Test public void testNonExistFieldValue() { final Criteria criteria = Criteria.getInstance(CriteriaType.IS_EQUAL, "firstName", - Arrays.asList("non-exist-first-name")); + Arrays.asList("non-exist-first-name"), Part.IgnoreCaseType.NEVER); final DocumentQuery query = new DocumentQuery(criteria); final long count = cosmosTemplate.count(query, PartitionPerson.class, containerName); @@ -229,7 +258,7 @@ public void testPartitionedPaginationQuery() { cosmosTemplate.insert(TEST_PERSON_2, new PartitionKey(TEST_PERSON_2.getLastName())); final Criteria criteria = Criteria.getInstance(CriteriaType.IS_EQUAL, "firstName", - Arrays.asList(FIRST_NAME)); + Arrays.asList(FIRST_NAME), Part.IgnoreCaseType.NEVER); final PageRequest pageRequest = new CosmosPageRequest(0, PAGE_SIZE_2, null); final DocumentQuery query = new DocumentQuery(criteria).with(pageRequest); @@ -237,4 +266,18 @@ public void testPartitionedPaginationQuery() { assertThat(page.getContent().size()).isEqualTo(1); PageTestUtils.validateLastPage(page, page.getContent().size()); } + + @Test + public void testPartitionedPaginationQueryIgnoreCase() { + cosmosTemplate.insert(TEST_PERSON_2, new PartitionKey(TEST_PERSON_2.getLastName())); + final Criteria criteriaIgnoreCase = Criteria.getInstance(CriteriaType.IS_EQUAL, "firstName", + Arrays.asList(FIRST_NAME.toUpperCase()), Part.IgnoreCaseType.ALWAYS); + final PageRequest pageRequest = new CosmosPageRequest(0, PAGE_SIZE_2, null); + final DocumentQuery queryIgnoreCase = new DocumentQuery(criteriaIgnoreCase).with(pageRequest); + + final Page pageIgnoreCase = cosmosTemplate + .paginationQuery(queryIgnoreCase, PartitionPerson.class, containerName); + assertThat(pageIgnoreCase.getContent().size()).isEqualTo(1); + PageTestUtils.validateLastPage(pageIgnoreCase, pageIgnoreCase.getContent().size()); + } } diff --git a/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/core/ReactiveCosmosTemplateIT.java b/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/core/ReactiveCosmosTemplateIT.java index 46c056d6ac947..9971897c3afa0 100644 --- a/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/core/ReactiveCosmosTemplateIT.java +++ b/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/core/ReactiveCosmosTemplateIT.java @@ -27,6 +27,7 @@ import org.springframework.boot.autoconfigure.domain.EntityScanner; import org.springframework.context.ApplicationContext; import org.springframework.data.annotation.Persistent; +import org.springframework.data.repository.query.parser.Part; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import reactor.core.publisher.Flux; @@ -343,12 +344,20 @@ public void testDeleteByIdBySecondaryKey() { @Test public void testFind() { final Criteria criteria = Criteria.getInstance(CriteriaType.IS_EQUAL, "firstName", - Arrays.asList(TEST_PERSON.getFirstName())); + Arrays.asList(TEST_PERSON.getFirstName()), Part.IgnoreCaseType.NEVER); final DocumentQuery query = new DocumentQuery(criteria); final Flux personFlux = cosmosTemplate.find(query, Person.class, Person.class.getSimpleName()); StepVerifier.create(personFlux).expectNextCount(1).verifyComplete(); + // add ignore testing + final Criteria criteriaIgnoreCase = Criteria.getInstance(CriteriaType.IS_EQUAL, "firstName", + Arrays.asList(TEST_PERSON.getFirstName().toUpperCase()), Part.IgnoreCaseType.ALWAYS); + final DocumentQuery queryIgnoreCase = new DocumentQuery(criteriaIgnoreCase); + final Flux personFluxIgnoreCase = cosmosTemplate.find(queryIgnoreCase, Person.class, + Person.class.getSimpleName()); + StepVerifier.create(personFluxIgnoreCase).expectNextCount(1).verifyComplete(); + assertThat(responseDiagnosticsTestUtils.getFeedResponseDiagnostics()).isNotNull(); Assertions.assertThat(responseDiagnosticsTestUtils.getCosmosResponseStatistics()).isNotNull(); Assertions.assertThat(responseDiagnosticsTestUtils.getCosmosResponseStatistics().getRequestCharge()).isGreaterThan(0); @@ -358,11 +367,18 @@ public void testFind() { @Test public void testExists() { final Criteria criteria = Criteria.getInstance(CriteriaType.IS_EQUAL, "firstName", - Arrays.asList(TEST_PERSON.getFirstName())); + Arrays.asList(TEST_PERSON.getFirstName()), Part.IgnoreCaseType.NEVER); final DocumentQuery query = new DocumentQuery(criteria); final Mono exists = cosmosTemplate.exists(query, Person.class, containerName); StepVerifier.create(exists).expectNext(true).verifyComplete(); + // add ignore testing + final Criteria criteriaIgnoreCase = Criteria.getInstance(CriteriaType.IS_EQUAL, "firstName", + Arrays.asList(TEST_PERSON.getFirstName().toUpperCase()), Part.IgnoreCaseType.ALWAYS); + final DocumentQuery queryIgnoreCase = new DocumentQuery(criteriaIgnoreCase); + final Mono existsIgnoreCase = cosmosTemplate.exists(queryIgnoreCase, Person.class, containerName); + StepVerifier.create(existsIgnoreCase).expectNext(true).verifyComplete(); + assertThat(responseDiagnosticsTestUtils.getFeedResponseDiagnostics()).isNotNull(); Assertions.assertThat(responseDiagnosticsTestUtils.getCosmosResponseStatistics()).isNotNull(); Assertions.assertThat(responseDiagnosticsTestUtils.getCosmosResponseStatistics().getRequestCharge()).isGreaterThan(0); diff --git a/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/core/ReactiveCosmosTemplatePartitionIT.java b/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/core/ReactiveCosmosTemplatePartitionIT.java index 934b6bb546fd3..2e75a27f2e054 100644 --- a/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/core/ReactiveCosmosTemplatePartitionIT.java +++ b/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/core/ReactiveCosmosTemplatePartitionIT.java @@ -20,6 +20,7 @@ import org.springframework.boot.autoconfigure.domain.EntityScanner; import org.springframework.context.ApplicationContext; import org.springframework.data.annotation.Persistent; +import org.springframework.data.repository.query.parser.Part; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import reactor.core.publisher.Flux; @@ -89,7 +90,21 @@ public static void afterClassCleanup() { @Test public void testFindWithPartition() { final Criteria criteria = Criteria.getInstance(CriteriaType.IS_EQUAL, TestConstants.PROPERTY_LAST_NAME, - Arrays.asList(TestConstants.LAST_NAME)); + Arrays.asList(TestConstants.LAST_NAME), Part.IgnoreCaseType.NEVER); + final DocumentQuery query = new DocumentQuery(criteria); + final Flux partitionPersonFlux = cosmosTemplate.find(query, + PartitionPerson.class, + PartitionPerson.class.getSimpleName()); + StepVerifier.create(partitionPersonFlux).consumeNextWith(actual -> { + Assert.assertThat(actual.getFirstName(), is(equalTo(TEST_PERSON.getFirstName()))); + Assert.assertThat(actual.getLastName(), is(equalTo(TEST_PERSON.getLastName()))); + }).verifyComplete(); + } + + @Test + public void testFindIgnoreCaseWithPartition() { + final Criteria criteria = Criteria.getInstance(CriteriaType.IS_EQUAL, TestConstants.PROPERTY_LAST_NAME, + Arrays.asList(TestConstants.LAST_NAME.toUpperCase()), Part.IgnoreCaseType.ALWAYS); final DocumentQuery query = new DocumentQuery(criteria); final Flux partitionPersonFlux = cosmosTemplate.find(query, PartitionPerson.class, @@ -181,11 +196,20 @@ public void testCountForPartitionedCollection() { public void testCountForPartitionedCollectionByQuery() { cosmosTemplate.insert(TEST_PERSON_2, new PartitionKey(TEST_PERSON_2.getLastName())).block(); final Criteria criteria = Criteria.getInstance(CriteriaType.IS_EQUAL, "firstName", - Arrays.asList(TEST_PERSON_2.getFirstName())); + Arrays.asList(TEST_PERSON_2.getFirstName()), Part.IgnoreCaseType.NEVER); final DocumentQuery query = new DocumentQuery(criteria); StepVerifier.create(cosmosTemplate.count(query, containerName)) .expectNext((long) 1).verifyComplete(); + } + @Test + public void testCountIgnoreCaseForPartitionedCollectionByQuery() { + cosmosTemplate.insert(TEST_PERSON_2, new PartitionKey(TEST_PERSON_2.getLastName())).block(); + final Criteria criteriaIgnoreCase = Criteria.getInstance(CriteriaType.IS_EQUAL, "firstName", + Arrays.asList(TEST_PERSON_2.getFirstName().toUpperCase()), Part.IgnoreCaseType.ALWAYS); + final DocumentQuery queryIgnoreCase = new DocumentQuery(criteriaIgnoreCase); + StepVerifier.create(cosmosTemplate.count(queryIgnoreCase, containerName)) + .expectNext((long) 1).verifyComplete(); } } diff --git a/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/core/query/CriteriaUnitTest.java b/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/core/query/CriteriaUnitTest.java index 1128cefbf5a5e..5ff98407b2dee 100644 --- a/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/core/query/CriteriaUnitTest.java +++ b/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/core/query/CriteriaUnitTest.java @@ -6,6 +6,7 @@ import com.azure.spring.data.cosmos.exception.IllegalQueryException; import org.junit.Assert; import org.junit.Test; +import org.springframework.data.repository.query.parser.Part; import java.util.Arrays; import java.util.Collections; @@ -19,20 +20,24 @@ public class CriteriaUnitTest { @Test public void testUnaryCriteria() { final List values = Arrays.asList(CRITERIA_OBJECT); - final Criteria criteria = Criteria.getInstance(CriteriaType.IS_EQUAL, CRITERIA_KEY, values); + final Criteria criteria = Criteria.getInstance(CriteriaType.IS_EQUAL, + CRITERIA_KEY, values, Part.IgnoreCaseType.NEVER); Assert.assertTrue(criteria.getSubCriteria().isEmpty()); Assert.assertEquals(values, criteria.getSubjectValues()); Assert.assertEquals(CriteriaType.IS_EQUAL, criteria.getType()); Assert.assertEquals(CRITERIA_KEY, criteria.getSubject()); Assert.assertTrue(CriteriaType.isBinary(criteria.getType())); + Assert.assertEquals(Part.IgnoreCaseType.NEVER, criteria.getIgnoreCase()); } @Test public void testBinaryCriteria() { final List values = Arrays.asList(CRITERIA_OBJECT); - final Criteria leftCriteria = Criteria.getInstance(CriteriaType.IS_EQUAL, CRITERIA_KEY, values); - final Criteria rightCriteria = Criteria.getInstance(CriteriaType.IS_EQUAL, CRITERIA_OBJECT, values); + final Criteria leftCriteria = Criteria.getInstance(CriteriaType.IS_EQUAL, + CRITERIA_KEY, values, Part.IgnoreCaseType.NEVER); + final Criteria rightCriteria = Criteria.getInstance(CriteriaType.IS_EQUAL, + CRITERIA_OBJECT, values, Part.IgnoreCaseType.NEVER); final Criteria criteria = Criteria.getInstance(CriteriaType.AND, leftCriteria, rightCriteria); Assert.assertNotNull(criteria.getSubCriteria()); @@ -44,12 +49,16 @@ public void testBinaryCriteria() { Assert.assertEquals(2, criteria.getSubCriteria().size()); Assert.assertEquals(leftCriteria, criteria.getSubCriteria().get(0)); Assert.assertEquals(rightCriteria, criteria.getSubCriteria().get(1)); + + Assert.assertEquals(Part.IgnoreCaseType.NEVER, criteria.getSubCriteria().get(0).getIgnoreCase()); + Assert.assertEquals(Part.IgnoreCaseType.NEVER, criteria.getSubCriteria().get(1).getIgnoreCase()); } @Test(expected = IllegalQueryException.class) public void testInvalidInKeywordParameter() { final List values = Collections.singletonList(CRITERIA_OBJECT); - final Criteria criteria = Criteria.getInstance(CriteriaType.IN, CRITERIA_KEY, values); + final Criteria criteria = Criteria.getInstance(CriteriaType.IN, + CRITERIA_KEY, values, Part.IgnoreCaseType.NEVER); final DocumentQuery query = new DocumentQuery(criteria); new FindQuerySpecGenerator().generateCosmos(query); @@ -58,7 +67,8 @@ public void testInvalidInKeywordParameter() { @Test(expected = IllegalQueryException.class) public void testInvalidInKeywordType() { final List values = Collections.singletonList(new IllegalQueryException("")); - final Criteria criteria = Criteria.getInstance(CriteriaType.IN, CRITERIA_KEY, values); + final Criteria criteria = Criteria.getInstance(CriteriaType.IN, + CRITERIA_KEY, values, Part.IgnoreCaseType.NEVER); final DocumentQuery query = new DocumentQuery(criteria); new FindQuerySpecGenerator().generateCosmos(query); diff --git a/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/core/query/DocumentQueryUnitTest.java b/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/core/query/DocumentQueryUnitTest.java index 06cdf4370ac63..553e4e9acf75b 100644 --- a/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/core/query/DocumentQueryUnitTest.java +++ b/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/core/query/DocumentQueryUnitTest.java @@ -6,6 +6,7 @@ import org.junit.Test; import org.springframework.data.domain.Pageable; import org.springframework.data.domain.Sort; +import org.springframework.data.repository.query.parser.Part; import java.util.Arrays; @@ -17,12 +18,13 @@ public class DocumentQueryUnitTest { @Test public void testDocumentQueryCreate() { final Criteria criteria = Criteria.getInstance(CriteriaType.IS_EQUAL, CRITERIA_KEY, - Arrays.asList(CRITERIA_OBJECT)); + Arrays.asList(CRITERIA_OBJECT), Part.IgnoreCaseType.NEVER); final DocumentQuery query = new DocumentQuery(criteria); Assert.assertEquals(criteria, query.getCriteria()); Assert.assertEquals(Sort.unsorted(), query.getSort()); Assert.assertEquals(Pageable.unpaged(), query.getPageable()); + Assert.assertEquals(Part.IgnoreCaseType.NEVER, criteria.getIgnoreCase()); } } diff --git a/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/repository/integration/ReactiveCourseRepositoryIT.java b/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/repository/integration/ReactiveCourseRepositoryIT.java index df2780cfc2163..d23671b4aa311 100644 --- a/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/repository/integration/ReactiveCourseRepositoryIT.java +++ b/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/repository/integration/ReactiveCourseRepositoryIT.java @@ -257,4 +257,24 @@ public void testFindAllByPartitionKey() { }) .verifyComplete(); } + + @Test + public void testFindByNameIgnoreCase() { + final Flux findResult = repository.findByNameIgnoreCase(COURSE_NAME_1.toLowerCase()); + StepVerifier.create(findResult).expectNext(COURSE_1).verifyComplete(); + } + + @Test + public void testFindByNameAndDepartmentAllIgnoreCase() { + final Flux findResult = repository.findByNameAndDepartmentAllIgnoreCase( + COURSE_NAME_1.toLowerCase(), DEPARTMENT_NAME_3.toLowerCase()); + StepVerifier.create(findResult).expectNext(COURSE_1).verifyComplete(); + } + + @Test + public void testFindByNameOrDepartmentAllIgnoreCase() { + final Flux findResult = repository.findByNameOrDepartmentAllIgnoreCase( + COURSE_NAME_3.toLowerCase(), DEPARTMENT_NAME_3.toLowerCase()); + StepVerifier.create(findResult).expectNext(COURSE_1, COURSE_3).verifyComplete(); + } } diff --git a/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/repository/integration/StudentRepositoryIT.java b/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/repository/integration/StudentRepositoryIT.java index 5da443d21f66a..36948a82e2876 100644 --- a/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/repository/integration/StudentRepositoryIT.java +++ b/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/repository/integration/StudentRepositoryIT.java @@ -165,4 +165,53 @@ public void testExists() { assertTrue(repository.existsByLastNameContaining("N")); assertFalse(repository.existsByLastNameContaining("X")); } + + @Test + public void testFindByLastNameIgnoreCase() { + List people = repository.findByLastNameIgnoreCase(LAST_NAME_0.toLowerCase()); + assertPeopleEquals(people, Arrays.asList(STUDENT_0)); + assertTrue(people.get(0).getLastName().equals(LAST_NAME_0)); + } + + @Test + public void testFindByLastNameAndFirstNameAllIgnoreCase() { + List people = repository + .findByLastNameAndFirstNameAllIgnoreCase(LAST_NAME_0.toLowerCase(), FIRST_NAME_0.toLowerCase()); + assertPeopleEquals(people, Arrays.asList(STUDENT_0)); + assertTrue(people.get(0).getFirstName().equals(FIRST_NAME_0)); + assertTrue(people.get(0).getLastName().equals(LAST_NAME_0)); + } + + @Test + public void testFindByLastNameOrFirstNameAllIgnoreCase() { + List people = repository + .findByLastNameOrFirstNameAllIgnoreCase(LAST_NAME_0.toLowerCase(), FIRST_NAME_1.toLowerCase()); + assertPeopleEquals(people, Arrays.asList(STUDENT_0, STUDENT_1)); + } + + @Test + public void testFindByFirstNameEndsWithIgnoreCase() { + List people = repository + .findByFirstNameEndsWithIgnoreCase(FIRST_NAME_0.toLowerCase().substring(2)); + assertPeopleEquals(people, Arrays.asList(STUDENT_0)); + assertTrue(people.get(0).getFirstName().equals(FIRST_NAME_0)); + } + + @Test + public void testFindByLastNameStartsWithAndFirstNameStartsWithAllIgnoreCase() { + List people = repository + .findByLastNameStartsWithAndFirstNameStartsWithAllIgnoreCase( + LAST_NAME_0.toLowerCase().substring(0, 2), FIRST_NAME_0.toLowerCase().substring(0, 2)); + assertPeopleEquals(people, Arrays.asList(STUDENT_0)); + assertTrue(people.get(0).getLastName().equals(LAST_NAME_0)); + assertTrue(people.get(0).getFirstName().equals(FIRST_NAME_0)); + } + + @Test + public void testFindByLastNameStartsWithOrFirstNameStartsWithAllIgnoreCase() { + List people = repository + .findByLastNameStartsWithOrFirstNameStartsWithAllIgnoreCase( + LAST_NAME_0.toLowerCase().substring(0, 2), FIRST_NAME_1.toLowerCase().substring(0, 3)); + assertPeopleEquals(people, Arrays.asList(STUDENT_0, STUDENT_1)); + } } diff --git a/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/repository/repository/ReactiveCourseRepository.java b/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/repository/repository/ReactiveCourseRepository.java index 50f589f4b31eb..ceaa3e87b0e87 100644 --- a/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/repository/repository/ReactiveCourseRepository.java +++ b/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/repository/repository/ReactiveCourseRepository.java @@ -2,8 +2,8 @@ // Licensed under the MIT License. package com.azure.spring.data.cosmos.repository.repository; -import com.azure.spring.data.cosmos.repository.ReactiveCosmosRepository; import com.azure.spring.data.cosmos.domain.Course; +import com.azure.spring.data.cosmos.repository.ReactiveCosmosRepository; import reactor.core.publisher.Flux; import java.util.Collection; @@ -11,4 +11,27 @@ public interface ReactiveCourseRepository extends ReactiveCosmosRepository { Flux findByDepartmentIn(Collection departments); + + /** + * Find Course list by name without case sensitive + * @param name name + * @return Course list + */ + Flux findByNameIgnoreCase(String name); + + /** + * Find Course list by name and department without case sensitive + * @param name name + * @param department department + * @return Course list + */ + Flux findByNameAndDepartmentAllIgnoreCase(String name, String department); + + /** + * Find Course list by name or department without case sensitive + * @param name name + * @param department department + * @return Course list + */ + Flux findByNameOrDepartmentAllIgnoreCase(String name, String department); } diff --git a/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/repository/repository/StudentRepository.java b/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/repository/repository/StudentRepository.java index f8039bc21388b..e543d74b07be5 100644 --- a/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/repository/repository/StudentRepository.java +++ b/sdk/cosmos/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/repository/repository/StudentRepository.java @@ -32,4 +32,51 @@ public interface StudentRepository extends CosmosRepository { Boolean existsByFirstName(String firstName); Boolean existsByLastNameContaining(String lastName); + + /** + * Find student list by last name without case sensitive + * @param lastName last name + * @return student list + */ + List findByLastNameIgnoreCase(String lastName); + + /** + * Find student list by last name and first name without case sensitive + * @param lastName last name + * @param firstName first name + * @return student list + */ + List findByLastNameAndFirstNameAllIgnoreCase(String lastName, String firstName); + + /** + * Find student list by last name or first name without case sensitive + * @param lastName last name + * @param firstName first name + * @return Student list + */ + List findByLastNameOrFirstNameAllIgnoreCase(String lastName, String firstName); + + /** + * Find student list by first name matching end without case sensitive + * @param firstName + * @return + */ + List findByFirstNameEndsWithIgnoreCase(String firstName); + + /** + * Find student list by last name matching end and first name matching end without case sensitive + * @param lastName + * @param firstName + * @return + */ + List findByLastNameStartsWithAndFirstNameStartsWithAllIgnoreCase(String lastName, String firstName); + + /** + * Find student list by last name matching or and first name matching end without case sensitive + * @param lastName + * @param firstName + * @return + */ + List findByLastNameStartsWithOrFirstNameStartsWithAllIgnoreCase(String lastName, String firstName); + } From 679c08a9466728556f772451dfbe22df69891562 Mon Sep 17 00:00:00 2001 From: Rick Ley Date: Wed, 15 Jul 2020 09:24:52 -0700 Subject: [PATCH 119/129] Upload incorrect length (#13144) * Fixed a couple bugs * CI * CI * CI --- sdk/storage/azure-storage-blob/CHANGELOG.md | 3 +- .../azure/storage/blob/BlobAsyncClient.java | 4 +- .../com/azure/storage/blob/BlobAPITest.groovy | 35 ++++++-- .../BlobAPITestuploadincorrectsize[0].json | 90 +++++++++++++++++++ .../BlobAPITestuploadincorrectsize[1].json | 90 +++++++++++++++++++ .../BlobAPITestuploadincorrectsize[2].json | 90 +++++++++++++++++++ .../BlobAPITestuploadincorrectsize[3].json | 90 +++++++++++++++++++ .../common/implementation/UploadUtils.java | 9 ++ 8 files changed, 401 insertions(+), 10 deletions(-) create mode 100644 sdk/storage/azure-storage-blob/src/test/resources/session-records/BlobAPITestuploadincorrectsize[0].json create mode 100644 sdk/storage/azure-storage-blob/src/test/resources/session-records/BlobAPITestuploadincorrectsize[1].json create mode 100644 sdk/storage/azure-storage-blob/src/test/resources/session-records/BlobAPITestuploadincorrectsize[2].json create mode 100644 sdk/storage/azure-storage-blob/src/test/resources/session-records/BlobAPITestuploadincorrectsize[3].json diff --git a/sdk/storage/azure-storage-blob/CHANGELOG.md b/sdk/storage/azure-storage-blob/CHANGELOG.md index 3b4cc6ce59c2b..6cf72b742aa96 100644 --- a/sdk/storage/azure-storage-blob/CHANGELOG.md +++ b/sdk/storage/azure-storage-blob/CHANGELOG.md @@ -1,7 +1,8 @@ # Release History ## 12.8.0-beta.2 (Unreleased) - +- Fixed a bug that, when the data length parameter did not match the actual length of the data in BlobClient.upload, caused a zero length blob to be uploaded rather than throwing an exception. +- Fixed a bug that ignored the customer's specified block size when determining buffer sizes in BlobClient.upload ## 12.8.0-beta.1 (2020-07-07) - Added support for the 2019-12-12 service version. diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/BlobAsyncClient.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/BlobAsyncClient.java index 6548b3a8824d8..7410eac63e0ab 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/BlobAsyncClient.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/BlobAsyncClient.java @@ -439,7 +439,9 @@ public Mono> uploadWithResponse(BlobParallelUploadOption .setTier(options.getTier()).setRequestConditions(options.getRequestConditions())); Flux data = options.getDataFlux() == null ? Utility.convertStreamToByteBuffer( - options.getDataStream(), options.getLength(), BLOB_DEFAULT_UPLOAD_BLOCK_SIZE) + options.getDataStream(), options.getLength(), + // We can only buffer up to max int due to restrictions in ByteBuffer. + (int) Math.min(Integer.MAX_VALUE, validatedParallelTransferOptions.getBlockSizeLong())) : options.getDataFlux(); return UploadUtils.uploadFullOrChunked(data, ModelHelper.wrapBlobOptions(validatedParallelTransferOptions), uploadInChunksFunction, uploadFullBlobMethod); diff --git a/sdk/storage/azure-storage-blob/src/test/java/com/azure/storage/blob/BlobAPITest.groovy b/sdk/storage/azure-storage-blob/src/test/java/com/azure/storage/blob/BlobAPITest.groovy index e0443ee9fb696..669564ca26409 100644 --- a/sdk/storage/azure-storage-blob/src/test/java/com/azure/storage/blob/BlobAPITest.groovy +++ b/sdk/storage/azure-storage-blob/src/test/java/com/azure/storage/blob/BlobAPITest.groovy @@ -85,8 +85,9 @@ class BlobAPITest extends APISpec { } /* Tests an issue found where buffered upload would not deep copy buffers while determining what upload path to take. */ + @Unroll - def "Upload input stream single upload" () { + def "Upload input stream single upload"() { setup: def randomData = getRandomByteArray(20 * Constants.KB) def input = new ByteArrayInputStream(randomData) @@ -100,15 +101,15 @@ class BlobAPITest extends APISpec { stream.toByteArray() == randomData where: - size || _ - 1 * Constants.KB || _ /* Less than copyToOutputStream buffer size, Less than maxSingleUploadSize */ - 8 * Constants.KB || _ /* Equal to copyToOutputStream buffer size, Less than maxSingleUploadSize */ - 20 * Constants.KB || _ /* Greater than copyToOutputStream buffer size, Less than maxSingleUploadSize */ + size || _ + 1 * Constants.KB || _ /* Less than copyToOutputStream buffer size, Less than maxSingleUploadSize */ + 8 * Constants.KB || _ /* Equal to copyToOutputStream buffer size, Less than maxSingleUploadSize */ + 20 * Constants.KB || _ /* Greater than copyToOutputStream buffer size, Less than maxSingleUploadSize */ } /* TODO (gapra): Add more tests to test large data sizes. */ - @Requires( { liveMode() } ) + @Requires({ liveMode() }) def "Upload input stream large data"() { setup: def randomData = getRandomByteArray(20 * Constants.MB) @@ -124,6 +125,22 @@ class BlobAPITest extends APISpec { notThrown(BlobStorageException) } + @Unroll + def "Upload incorrect size"() { + when: + bc.upload(defaultInputStream.get(), dataSize, true) + + then: + thrown(IllegalStateException) + + where: + dataSize | threshold + defaultDataSize + 1 | null + defaultDataSize - 1 | null + defaultDataSize + 1 | 1 // Test the chunked case as well + defaultDataSize - 1 | 1 + } + @Unroll def "Upload numBlocks"() { setup: @@ -156,7 +173,8 @@ class BlobAPITest extends APISpec { .getValue().getETag() != null } - @Requires({ liveMode() }) // Reading from recordings will not allow for the timing of the test to work correctly. + @Requires({ liveMode() }) + // Reading from recordings will not allow for the timing of the test to work correctly. def "Upload timeout"() { setup: def size = 1024 @@ -973,7 +991,8 @@ class BlobAPITest extends APISpec { This test requires two accounts that are configured in a very specific way. It is not feasible to setup that relationship programmatically, so we have recorded a successful interaction and only test recordings. */ - @Requires( {playbackMode()}) + + @Requires({ playbackMode() }) def "Get properties ORS"() { setup: def sourceBlob = primaryBlobServiceClient.getBlobContainerClient("test1") diff --git a/sdk/storage/azure-storage-blob/src/test/resources/session-records/BlobAPITestuploadincorrectsize[0].json b/sdk/storage/azure-storage-blob/src/test/resources/session-records/BlobAPITestuploadincorrectsize[0].json new file mode 100644 index 0000000000000..4ad94f6f9120e --- /dev/null +++ b/sdk/storage/azure-storage-blob/src/test/resources/session-records/BlobAPITestuploadincorrectsize[0].json @@ -0,0 +1,90 @@ +{ + "networkCallRecords" : [ { + "Method" : "PUT", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcuploadincorrectsize0blobapitestuploadincorrectsize61a372717?restype=container", + "Headers" : { + "x-ms-version" : "2019-12-12", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.2 (11.0.7; Windows 10; 10.0)", + "x-ms-client-request-id" : "6bf35f33-b5b3-409c-8dc2-5f130fb97710" + }, + "Response" : { + "x-ms-version" : "2019-12-12", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "ETag" : "0x8D82819FF1A5384", + "Last-Modified" : "Tue, 14 Jul 2020 17:18:59 GMT", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "d46d6efa-901e-0054-2b02-5abe5e000000", + "Date" : "Tue, 14 Jul 2020 17:18:59 GMT", + "x-ms-client-request-id" : "6bf35f33-b5b3-409c-8dc2-5f130fb97710" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcuploadincorrectsize0blobapitestuploadincorrectsize61a372717/javablobuploadincorrectsize192960ae99c1dbb885442", + "Headers" : { + "x-ms-version" : "2019-12-12", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.2 (11.0.7; Windows 10; 10.0)", + "x-ms-client-request-id" : "0addb259-10d1-4120-888b-ca7ae000dbb7", + "Content-Type" : "application/octet-stream" + }, + "Response" : { + "x-ms-version" : "2019-12-12", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-content-crc64" : "6RYQPwaVsyQ=", + "Last-Modified" : "Tue, 14 Jul 2020 17:19:00 GMT", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-server-encrypted" : "true", + "Date" : "Tue, 14 Jul 2020 17:18:59 GMT", + "Content-MD5" : "wh+Wm18D0z1D4E+PE252gg==", + "ETag" : "0x8D82819FFBE88FD", + "Content-Length" : "0", + "x-ms-request-id" : "b2e2badf-b01e-0061-7402-5a100b000000", + "x-ms-client-request-id" : "0addb259-10d1-4120-888b-ca7ae000dbb7" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.blob.core.windows.net?prefix=jtcuploadincorrectsize&comp=list", + "Headers" : { + "x-ms-version" : "2019-12-12", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.2 (11.0.7; Windows 10; 10.0)", + "x-ms-client-request-id" : "3062524d-62b2-4ecf-8aa6-b0466c650321" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-12-12", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "3bcebc16-c01e-006e-3e02-5afdfd000000", + "Body" : "jtcuploadincorrectsizejtcuploadincorrectsize0blobapitestuploadincorrectsize61a372717Tue, 14 Jul 2020 17:18:59 GMT\"0x8D82819FF1A5384\"unlockedavailable$account-encryption-keyfalsefalsefalse", + "Date" : "Tue, 14 Jul 2020 17:19:00 GMT", + "x-ms-client-request-id" : "3062524d-62b2-4ecf-8aa6-b0466c650321", + "Content-Type" : "application/xml" + }, + "Exception" : null + }, { + "Method" : "DELETE", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcuploadincorrectsize0blobapitestuploadincorrectsize61a372717?restype=container", + "Headers" : { + "x-ms-version" : "2019-12-12", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.2 (11.0.7; Windows 10; 10.0)", + "x-ms-client-request-id" : "bf4ee0d9-d744-4434-86cd-d42dae8ef27a" + }, + "Response" : { + "x-ms-version" : "2019-12-12", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "202", + "x-ms-request-id" : "8f04ebd6-801e-0040-0402-5a7d3a000000", + "Date" : "Tue, 14 Jul 2020 17:19:01 GMT", + "x-ms-client-request-id" : "bf4ee0d9-d744-4434-86cd-d42dae8ef27a" + }, + "Exception" : null + } ], + "variables" : [ "jtcuploadincorrectsize0blobapitestuploadincorrectsize61a372717", "javablobuploadincorrectsize192960ae99c1dbb885442" ] +} \ No newline at end of file diff --git a/sdk/storage/azure-storage-blob/src/test/resources/session-records/BlobAPITestuploadincorrectsize[1].json b/sdk/storage/azure-storage-blob/src/test/resources/session-records/BlobAPITestuploadincorrectsize[1].json new file mode 100644 index 0000000000000..37e09ec0556de --- /dev/null +++ b/sdk/storage/azure-storage-blob/src/test/resources/session-records/BlobAPITestuploadincorrectsize[1].json @@ -0,0 +1,90 @@ +{ + "networkCallRecords" : [ { + "Method" : "PUT", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcuploadincorrectsize0blobapitestuploadincorrectsizec47250537?restype=container", + "Headers" : { + "x-ms-version" : "2019-12-12", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.2 (11.0.7; Windows 10; 10.0)", + "x-ms-client-request-id" : "3357dd18-4743-45cc-8c81-678638cd39d0" + }, + "Response" : { + "x-ms-version" : "2019-12-12", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "ETag" : "0x8D8281A00C3DE5B", + "Last-Modified" : "Tue, 14 Jul 2020 17:19:02 GMT", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "4e84195f-e01e-009c-5b02-5a2f69000000", + "Date" : "Tue, 14 Jul 2020 17:19:01 GMT", + "x-ms-client-request-id" : "3357dd18-4743-45cc-8c81-678638cd39d0" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcuploadincorrectsize0blobapitestuploadincorrectsizec47250537/javablobuploadincorrectsize105800ad666ed1358e41c", + "Headers" : { + "x-ms-version" : "2019-12-12", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.2 (11.0.7; Windows 10; 10.0)", + "x-ms-client-request-id" : "b65064d9-44e9-4637-8afc-f1c27f9f1a99", + "Content-Type" : "application/octet-stream" + }, + "Response" : { + "x-ms-version" : "2019-12-12", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-content-crc64" : "6RYQPwaVsyQ=", + "Last-Modified" : "Tue, 14 Jul 2020 17:19:02 GMT", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-server-encrypted" : "true", + "Date" : "Tue, 14 Jul 2020 17:19:01 GMT", + "Content-MD5" : "wh+Wm18D0z1D4E+PE252gg==", + "ETag" : "0x8D8281A00F2D3DC", + "Content-Length" : "0", + "x-ms-request-id" : "b9dba07a-101e-000a-1102-5a4d5d000000", + "x-ms-client-request-id" : "b65064d9-44e9-4637-8afc-f1c27f9f1a99" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.blob.core.windows.net?prefix=jtcuploadincorrectsize&comp=list", + "Headers" : { + "x-ms-version" : "2019-12-12", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.2 (11.0.7; Windows 10; 10.0)", + "x-ms-client-request-id" : "039695a3-cdd6-4f4f-bf61-0607b7441c14" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-12-12", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "919d11bb-201e-002b-5202-5a206c000000", + "Body" : "jtcuploadincorrectsizejtcuploadincorrectsize0blobapitestuploadincorrectsizec47250537Tue, 14 Jul 2020 17:19:02 GMT\"0x8D8281A00C3DE5B\"unlockedavailable$account-encryption-keyfalsefalsefalse", + "Date" : "Tue, 14 Jul 2020 17:19:02 GMT", + "x-ms-client-request-id" : "039695a3-cdd6-4f4f-bf61-0607b7441c14", + "Content-Type" : "application/xml" + }, + "Exception" : null + }, { + "Method" : "DELETE", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcuploadincorrectsize0blobapitestuploadincorrectsizec47250537?restype=container", + "Headers" : { + "x-ms-version" : "2019-12-12", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.2 (11.0.7; Windows 10; 10.0)", + "x-ms-client-request-id" : "44c31a46-1731-4413-a8a8-08a3dee3d7c6" + }, + "Response" : { + "x-ms-version" : "2019-12-12", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "202", + "x-ms-request-id" : "77df9095-901e-0010-4502-5a6232000000", + "Date" : "Tue, 14 Jul 2020 17:19:02 GMT", + "x-ms-client-request-id" : "44c31a46-1731-4413-a8a8-08a3dee3d7c6" + }, + "Exception" : null + } ], + "variables" : [ "jtcuploadincorrectsize0blobapitestuploadincorrectsizec47250537", "javablobuploadincorrectsize105800ad666ed1358e41c" ] +} \ No newline at end of file diff --git a/sdk/storage/azure-storage-blob/src/test/resources/session-records/BlobAPITestuploadincorrectsize[2].json b/sdk/storage/azure-storage-blob/src/test/resources/session-records/BlobAPITestuploadincorrectsize[2].json new file mode 100644 index 0000000000000..5a5e1216e04b8 --- /dev/null +++ b/sdk/storage/azure-storage-blob/src/test/resources/session-records/BlobAPITestuploadincorrectsize[2].json @@ -0,0 +1,90 @@ +{ + "networkCallRecords" : [ { + "Method" : "PUT", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcuploadincorrectsize0blobapitestuploadincorrectsizea0271001d?restype=container", + "Headers" : { + "x-ms-version" : "2019-12-12", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.2 (11.0.7; Windows 10; 10.0)", + "x-ms-client-request-id" : "d37e8d0e-2ed0-4aff-817f-5aecbe772444" + }, + "Response" : { + "x-ms-version" : "2019-12-12", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "ETag" : "0x8D8281A01899BB6", + "Last-Modified" : "Tue, 14 Jul 2020 17:19:03 GMT", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "167610af-a01e-0031-6502-5a0f03000000", + "Date" : "Tue, 14 Jul 2020 17:19:03 GMT", + "x-ms-client-request-id" : "d37e8d0e-2ed0-4aff-817f-5aecbe772444" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcuploadincorrectsize0blobapitestuploadincorrectsizea0271001d/javablobuploadincorrectsize1958500e125872c20b445", + "Headers" : { + "x-ms-version" : "2019-12-12", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.2 (11.0.7; Windows 10; 10.0)", + "x-ms-client-request-id" : "70a6acea-8a74-46ec-a8bf-dd19d4162bbe", + "Content-Type" : "application/octet-stream" + }, + "Response" : { + "x-ms-version" : "2019-12-12", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-content-crc64" : "6RYQPwaVsyQ=", + "Last-Modified" : "Tue, 14 Jul 2020 17:19:03 GMT", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-server-encrypted" : "true", + "Date" : "Tue, 14 Jul 2020 17:19:03 GMT", + "Content-MD5" : "wh+Wm18D0z1D4E+PE252gg==", + "ETag" : "0x8D8281A01B9A32A", + "Content-Length" : "0", + "x-ms-request-id" : "d2c931c3-d01e-00f2-7c02-5a8640000000", + "x-ms-client-request-id" : "70a6acea-8a74-46ec-a8bf-dd19d4162bbe" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.blob.core.windows.net?prefix=jtcuploadincorrectsize&comp=list", + "Headers" : { + "x-ms-version" : "2019-12-12", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.2 (11.0.7; Windows 10; 10.0)", + "x-ms-client-request-id" : "bdd56435-50ac-4727-9134-747e0bed473e" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-12-12", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "8193fad7-d01e-003e-6d02-5ae2f5000000", + "Body" : "jtcuploadincorrectsizejtcuploadincorrectsize0blobapitestuploadincorrectsizea0271001dTue, 14 Jul 2020 17:19:03 GMT\"0x8D8281A01899BB6\"unlockedavailable$account-encryption-keyfalsefalsefalse", + "Date" : "Tue, 14 Jul 2020 17:19:03 GMT", + "x-ms-client-request-id" : "bdd56435-50ac-4727-9134-747e0bed473e", + "Content-Type" : "application/xml" + }, + "Exception" : null + }, { + "Method" : "DELETE", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcuploadincorrectsize0blobapitestuploadincorrectsizea0271001d?restype=container", + "Headers" : { + "x-ms-version" : "2019-12-12", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.2 (11.0.7; Windows 10; 10.0)", + "x-ms-client-request-id" : "cc682a78-2410-4fa2-b4af-8489aeb9b645" + }, + "Response" : { + "x-ms-version" : "2019-12-12", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "202", + "x-ms-request-id" : "a98ba26c-301e-013b-0902-5a50df000000", + "Date" : "Tue, 14 Jul 2020 17:19:03 GMT", + "x-ms-client-request-id" : "cc682a78-2410-4fa2-b4af-8489aeb9b645" + }, + "Exception" : null + } ], + "variables" : [ "jtcuploadincorrectsize0blobapitestuploadincorrectsizea0271001d", "javablobuploadincorrectsize1958500e125872c20b445" ] +} \ No newline at end of file diff --git a/sdk/storage/azure-storage-blob/src/test/resources/session-records/BlobAPITestuploadincorrectsize[3].json b/sdk/storage/azure-storage-blob/src/test/resources/session-records/BlobAPITestuploadincorrectsize[3].json new file mode 100644 index 0000000000000..8577b8efce5cf --- /dev/null +++ b/sdk/storage/azure-storage-blob/src/test/resources/session-records/BlobAPITestuploadincorrectsize[3].json @@ -0,0 +1,90 @@ +{ + "networkCallRecords" : [ { + "Method" : "PUT", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcuploadincorrectsize0blobapitestuploadincorrectsize427036766?restype=container", + "Headers" : { + "x-ms-version" : "2019-12-12", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.2 (11.0.7; Windows 10; 10.0)", + "x-ms-client-request-id" : "8df45dbd-50b9-4d73-99b5-bd2404f101e5" + }, + "Response" : { + "x-ms-version" : "2019-12-12", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "ETag" : "0x8D8281A023E3FBF", + "Last-Modified" : "Tue, 14 Jul 2020 17:19:04 GMT", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "56b2105f-d01e-00d0-0e02-5ae876000000", + "Date" : "Tue, 14 Jul 2020 17:19:04 GMT", + "x-ms-client-request-id" : "8df45dbd-50b9-4d73-99b5-bd2404f101e5" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcuploadincorrectsize0blobapitestuploadincorrectsize427036766/javablobuploadincorrectsize1366272b06ad9df88a401", + "Headers" : { + "x-ms-version" : "2019-12-12", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.2 (11.0.7; Windows 10; 10.0)", + "x-ms-client-request-id" : "9f5fdea6-cca6-40d3-b436-202a2cf5b9cc", + "Content-Type" : "application/octet-stream" + }, + "Response" : { + "x-ms-version" : "2019-12-12", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-content-crc64" : "6RYQPwaVsyQ=", + "Last-Modified" : "Tue, 14 Jul 2020 17:19:04 GMT", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-server-encrypted" : "true", + "Date" : "Tue, 14 Jul 2020 17:19:04 GMT", + "Content-MD5" : "wh+Wm18D0z1D4E+PE252gg==", + "ETag" : "0x8D8281A0270DF3E", + "Content-Length" : "0", + "x-ms-request-id" : "2f53615d-e01e-003d-0702-5ae1f2000000", + "x-ms-client-request-id" : "9f5fdea6-cca6-40d3-b436-202a2cf5b9cc" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.blob.core.windows.net?prefix=jtcuploadincorrectsize&comp=list", + "Headers" : { + "x-ms-version" : "2019-12-12", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.2 (11.0.7; Windows 10; 10.0)", + "x-ms-client-request-id" : "429137e8-db49-453b-afe9-d423893e0e63" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-12-12", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "09b7b005-401e-009a-1102-5ad811000000", + "Body" : "jtcuploadincorrectsizejtcuploadincorrectsize0blobapitestuploadincorrectsize427036766Tue, 14 Jul 2020 17:19:04 GMT\"0x8D8281A023E3FBF\"unlockedavailable$account-encryption-keyfalsefalsefalse", + "Date" : "Tue, 14 Jul 2020 17:19:04 GMT", + "x-ms-client-request-id" : "429137e8-db49-453b-afe9-d423893e0e63", + "Content-Type" : "application/xml" + }, + "Exception" : null + }, { + "Method" : "DELETE", + "Uri" : "https://REDACTED.blob.core.windows.net/jtcuploadincorrectsize0blobapitestuploadincorrectsize427036766?restype=container", + "Headers" : { + "x-ms-version" : "2019-12-12", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.2 (11.0.7; Windows 10; 10.0)", + "x-ms-client-request-id" : "2ddecade-681e-4e3b-8085-81c4f82d0b00" + }, + "Response" : { + "x-ms-version" : "2019-12-12", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "202", + "x-ms-request-id" : "f65a13c8-701e-00bb-4b02-5ab520000000", + "Date" : "Tue, 14 Jul 2020 17:19:04 GMT", + "x-ms-client-request-id" : "2ddecade-681e-4e3b-8085-81c4f82d0b00" + }, + "Exception" : null + } ], + "variables" : [ "jtcuploadincorrectsize0blobapitestuploadincorrectsize427036766", "javablobuploadincorrectsize1366272b06ad9df88a401" ] +} \ No newline at end of file diff --git a/sdk/storage/azure-storage-common/src/main/java/com/azure/storage/common/implementation/UploadUtils.java b/sdk/storage/azure-storage-common/src/main/java/com/azure/storage/common/implementation/UploadUtils.java index 6c97ce64d2f0c..607d5a0f3223e 100644 --- a/sdk/storage/azure-storage-common/src/main/java/com/azure/storage/common/implementation/UploadUtils.java +++ b/sdk/storage/azure-storage-common/src/main/java/com/azure/storage/common/implementation/UploadUtils.java @@ -47,6 +47,15 @@ public static Mono> uploadFullOrChunked(final Flux d // First buffer is emitted after threshold is breached or there's no more data. // Therefore we can make a decision how to upload data on first element. .switchOnFirst((signal, flux) -> { + // If there is an error before the threshold is reached, propagate the error + if (signal.isOnError()) { + Throwable t = signal.getThrowable(); + if (t != null) { + return Flux.error(t); + } else { + return Flux.error(new IllegalStateException("Source flux failed but cause is unretrievable")); + } + } if (gate.isThresholdBreached()) { // In this case we can pass a flux that can have just one subscriber because // the chunked upload is going to cache the data downstream before sending chunks over the wire. From 6bd5b6719f3bcf57926e6060db70352f66f6e2e1 Mon Sep 17 00:00:00 2001 From: Rick Ley Date: Wed, 15 Jul 2020 10:38:39 -0700 Subject: [PATCH 120/129] Nio javadocs (#13150) * Updated lots of docs * Added javadocs to AzurePath * Added docs for all parameters passed to methods * Small fixes * CI --- sdk/storage/azure-storage-blob-nio/README.md | 28 +- .../blob/nio/AzureBasicFileAttributeView.java | 22 +- .../blob/nio/AzureBasicFileAttributes.java | 42 ++- .../blob/nio/AzureBlobFileAttributeView.java | 19 +- .../blob/nio/AzureBlobFileAttributes.java | 109 +++++-- .../blob/nio/AzureDirectoryStream.java | 2 +- .../storage/blob/nio/AzureFileStore.java | 66 ++-- .../storage/blob/nio/AzureFileSystem.java | 107 +++++-- .../blob/nio/AzureFileSystemProvider.java | 298 ++++++++++++++---- .../com/azure/storage/blob/nio/AzurePath.java | 265 +++++++++++++--- .../storage/blob/nio/LoggingUtility.java | 2 +- .../storage/blob/nio/NioBlobInputStream.java | 2 +- .../storage/blob/nio/NioBlobOutputStream.java | 2 +- .../azure/storage/blob/nio/ReadmeSamples.java | 3 +- .../storage/blob/nio/AttributeViewTest.groovy | 2 - .../nio/AzureFileSystemProviderTest.groovy | 2 +- 16 files changed, 727 insertions(+), 244 deletions(-) diff --git a/sdk/storage/azure-storage-blob-nio/README.md b/sdk/storage/azure-storage-blob-nio/README.md index bf9c0f7fb96ee..e8f77faadb0a1 100644 --- a/sdk/storage/azure-storage-blob-nio/README.md +++ b/sdk/storage/azure-storage-blob-nio/README.md @@ -116,7 +116,7 @@ fallback and retry options available. The view of the FileSystem from within an instance of the JVM will be consistent, but the AzureFileSystem makes no guarantees on behavior or state should other processes operate on the same data. The AzureFileSystem will assume that it has exclusive access to the resources stored in Azure Blob Storage and will behave without regard for potential -interfering applications +interfering applications. Finally, this implementation has currently chosen to always read/write directly to/from Azure Storage without a local cache. Our team has determined that with the tradeoffs of complexity, correctness, safety, performance, debuggability, @@ -146,11 +146,12 @@ Create a `FileSystem` using the [`shared key`](#get-credentials) retrieved above Note that you can further configure the file system using constants available in `AzureFileSystem`. Please see the docs for `AzureFileSystemProvider` for a full explanation of initializing and configuring a filesystem - + ```java Map config = new HashMap<>(); +String[] stores = {""); -config.put(AzureFileSystem.AZURE_STORAGE_FILE_STORES, ""); +config.put(AzureFileSystem.AZURE_STORAGE_FILE_STORES, stores); FileSystem myFs = FileSystems.newFileSystem(new URI("azb://?account= + ```java Path dirPath = myFs.getPath("dir"); Files.createDirectory(dirPath); @@ -168,7 +169,7 @@ Files.createDirectory(dirPath); Iterate over a directory using a `DirectoryStream` - + ```java for (Path p : Files.newDirectoryStream(dirPath)) { System.out.println(p.toString()); @@ -179,7 +180,7 @@ for (Path p : Files.newDirectoryStream(dirPath)) { Read the contents of a file using an `InputStream`. Skipping, marking, and resetting are all supported. - + ```java Path filePath = myFs.getPath("file"); InputStream is = Files.newInputStream(filePath); @@ -192,7 +193,7 @@ is.close(); Write to a file. Only writing whole files is supported. Random IO is not supported. The stream must be closed in order to guarantee that the data is available to be read. - + ```java OutputStream os = Files.newOutputStream(filePath); os.write(0); @@ -201,7 +202,7 @@ os.close(); ### Copy a file - + ```java Path destinationPath = myFs.getPath("destinationFile"); Files.copy(filePath, destinationPath, StandardCopyOption.COPY_ATTRIBUTES); @@ -209,7 +210,7 @@ Files.copy(filePath, destinationPath, StandardCopyOption.COPY_ATTRIBUTES); ### Delete a file - + ```java Files.delete(filePath); ``` @@ -218,7 +219,7 @@ Files.delete(filePath); Read attributes of a file through the `AzureBlobFileAttributes`. - + ```java AzureBlobFileAttributes attr = Files.readAttributes(filePath, AzureBlobFileAttributes.class); BlobHttpHeaders headers = attr.blobHttpHeaders(); @@ -228,7 +229,7 @@ Or read attributes dynamically by specifying a string of desired attributes. Thi to retrieve any attribute will always retrieve all of them as an atomic bulk operation. You may specify "*" instead of a list of specific attributes to have all attributes returned in the map. - + ```java Map attributes = Files.readAttributes(filePath, "azureBlob:metadata,headers"); ``` @@ -237,7 +238,7 @@ Map attributes = Files.readAttributes(filePath, "azureBlob:metad Set attributes of a file through the `AzureBlobFileAttributeView`. - + ```java AzureBlobFileAttributeView view = Files.getFileAttributeView(filePath, AzureBlobFileAttributeView.class); view.setMetadata(Collections.EMPTY_MAP); @@ -245,7 +246,7 @@ view.setMetadata(Collections.EMPTY_MAP); Or set an attribute dynamically by specifying the attribute as a string. - + ```java Files.setAttribute(filePath, "azureBlob:blobHttpHeaders", new BlobHttpHeaders()); ``` @@ -282,6 +283,7 @@ not be possible or otherwise may conflict with established design goals and ther - Hidden files - Random writes - File locks +- Read only files or file stores - Watches on directory events - Support for other Azure Storage services such as ADLS Gen 2 (Datalake) and Azure Files (shares) - Token authentication diff --git a/sdk/storage/azure-storage-blob-nio/src/main/java/com/azure/storage/blob/nio/AzureBasicFileAttributeView.java b/sdk/storage/azure-storage-blob-nio/src/main/java/com/azure/storage/blob/nio/AzureBasicFileAttributeView.java index 01ae0bd2e7a2c..338c95b1b6413 100644 --- a/sdk/storage/azure-storage-blob-nio/src/main/java/com/azure/storage/blob/nio/AzureBasicFileAttributeView.java +++ b/sdk/storage/azure-storage-blob-nio/src/main/java/com/azure/storage/blob/nio/AzureBasicFileAttributeView.java @@ -10,14 +10,12 @@ /** * Provides support for basic file attributes. - * + *

* The operations supported by this view and the attributes it reads are a strict subset of * {@link AzureBlobFileAttributeView} and has the same network behavior. Therefore, while this type is offered for * compliance with the NIO spec, {@link AzureBlobFileAttributeView} is generally preferred. - * + *

* {@link #setTimes(FileTime, FileTime, FileTime)} is not supported. - * - * {@inheritDoc} */ public final class AzureBasicFileAttributeView implements BasicFileAttributeView { @@ -30,8 +28,9 @@ public final class AzureBasicFileAttributeView implements BasicFileAttributeView } /** - * Returns {@code "azureBasic"} - * {@inheritDoc} + * Returns the name of the attribute view: {@code "azureBasic"} + * + * @return the name of the attribute view: {@code "azureBasic"} */ @Override public String name() { @@ -39,7 +38,11 @@ public String name() { } /** - * {@inheritDoc} + * Reads the basic file attributes as a bulk operation. + *

+ * All file attributes are read as an atomic operation with respect to other file system operations. + * + * @return {@link AzureBasicFileAttributes} */ @Override public AzureBasicFileAttributes readAttributes() throws IOException { @@ -49,8 +52,11 @@ public AzureBasicFileAttributes readAttributes() throws IOException { /** * Unsupported. * + * @param lastModifiedTime the new last modified time, or null to not change the value + * @param lastAccessTime the last access time, or null to not change the value + * @param createTime the file's create time, or null to not change the value * @throws UnsupportedOperationException Operation not supported. - * {@inheritDoc} + * @throws IOException never */ @Override public void setTimes(FileTime lastModifiedTime, FileTime lastAccessTime, FileTime createTime) throws IOException { diff --git a/sdk/storage/azure-storage-blob-nio/src/main/java/com/azure/storage/blob/nio/AzureBasicFileAttributes.java b/sdk/storage/azure-storage-blob-nio/src/main/java/com/azure/storage/blob/nio/AzureBasicFileAttributes.java index b6c2d555a0908..c41e284712850 100644 --- a/sdk/storage/azure-storage-blob-nio/src/main/java/com/azure/storage/blob/nio/AzureBasicFileAttributes.java +++ b/sdk/storage/azure-storage-blob-nio/src/main/java/com/azure/storage/blob/nio/AzureBasicFileAttributes.java @@ -24,9 +24,8 @@ * {@link AzureBlobFileAttributes} is generally preferred. *

* Some attributes are not supported. Refer to the javadocs on each method for more information. - * {@inheritDoc} */ -public class AzureBasicFileAttributes implements BasicFileAttributes { +public final class AzureBasicFileAttributes implements BasicFileAttributes { private final ClientLogger logger = new ClientLogger(AzureBasicFileAttributes.class); // For verifying parameters on FileSystemProvider.readAttributes @@ -62,7 +61,9 @@ public class AzureBasicFileAttributes implements BasicFileAttributes { } /** - * {@inheritDoc} + * Returns the time of last modification. + * + * @return the time of last modification. */ @Override public FileTime lastModifiedTime() { @@ -70,17 +71,22 @@ public FileTime lastModifiedTime() { } /** - * Unsupported. - * @throws UnsupportedOperationException Operation not supported. - * {@inheritDoc} + * Returns the time of last modification. + *

+ * Last access time is not supported by the blob service. In this case, it is typical for implementations to return + * the {@link #lastModifiedTime()}. + * + * @return the time of last modification. */ @Override public FileTime lastAccessTime() { - throw new UnsupportedOperationException(); + return this.lastModifiedTime(); } /** - * {@inheritDoc} + * Returns the creation time. The creation time is the time that the file was created. + * + * @return The creation time. */ @Override public FileTime creationTime() { @@ -88,7 +94,9 @@ public FileTime creationTime() { } /** - * {@inheritDoc} + * Tells whether the file is a regular file with opaque content. + * + * @return whether the file is a regular file. */ @Override public boolean isRegularFile() { @@ -96,11 +104,13 @@ public boolean isRegularFile() { } /** - * {@inheritDoc} + * Tells whether the file is a directory. *

* Will only return true if the directory is a concrete directory. See * {@link AzureFileSystemProvider#createDirectory(Path, FileAttribute[])} for more information on virtual and * concrete directories. + * + * @return whether the file is a directory */ @Override public boolean isDirectory() { @@ -108,6 +118,8 @@ public boolean isDirectory() { } /** + * Tells whether the file is a symbolic link. + * * @return false. Symbolic links are not supported. */ @Override @@ -116,7 +128,9 @@ public boolean isSymbolicLink() { } /** - * @return false + * Tells whether the file is something other than a regular file, directory, or symbolic link. + * + * @return false. No other object types are supported. */ @Override public boolean isOther() { @@ -124,7 +138,9 @@ public boolean isOther() { } /** - * {@inheritDoc} + * Returns the size of the file (in bytes). + * + * @return the size of the file */ @Override public long size() { @@ -133,8 +149,8 @@ public long size() { /** * Unsupported. + * * @throws UnsupportedOperationException Operation not supported. - * {@inheritDoc} */ @Override public Object fileKey() { diff --git a/sdk/storage/azure-storage-blob-nio/src/main/java/com/azure/storage/blob/nio/AzureBlobFileAttributeView.java b/sdk/storage/azure-storage-blob-nio/src/main/java/com/azure/storage/blob/nio/AzureBlobFileAttributeView.java index 241d72e474aef..3162309752a08 100644 --- a/sdk/storage/azure-storage-blob-nio/src/main/java/com/azure/storage/blob/nio/AzureBlobFileAttributeView.java +++ b/sdk/storage/azure-storage-blob-nio/src/main/java/com/azure/storage/blob/nio/AzureBlobFileAttributeView.java @@ -70,8 +70,9 @@ static Map> setAttributeConsumers(AzureBlobFileAttribut } /** - * Returns "azureBlob". - * {@inheritDoc} + * Returns the name of the attribute view: {@code "azureBlob"} + * + * @return the name of the attribute view: {@code "azureBlob"} */ @Override public String name() { @@ -80,8 +81,9 @@ public String name() { /** * Reads the file attributes as a bulk operation. - * - * Gets a fresh copy every time it is called. + *

+ * All file attributes are read as an atomic operation with respect to other file system operations. A fresh copy is + * retrieved every time this method is called. * @return {@link AzureBlobFileAttributes} * @throws IOException if an IOException occurs. */ @@ -122,7 +124,7 @@ public void setMetadata(Map metadata) throws IOException { /** * Sets the {@link AccessTier} on the file. - * + *

* See {@link BlobClientBase#setAccessTier(AccessTier)} for more information. * @param tier {@link AccessTier} * @throws IOException if an IOException occurs. @@ -138,11 +140,14 @@ public void setTier(AccessTier tier) throws IOException { /** * Unsupported. * + * @param lastModifiedTime the new last modified time, or null to not change the value + * @param lastAccessTime the last access time, or null to not change the value + * @param createTime the file's create time, or null to not change the value * @throws UnsupportedOperationException Operation not supported. - * {@inheritDoc} + * @throws IOException never */ @Override - public void setTimes(FileTime fileTime, FileTime fileTime1, FileTime fileTime2) throws IOException { + public void setTimes(FileTime lastModifiedTime, FileTime lastAccessTime, FileTime createTime) throws IOException { throw new UnsupportedOperationException(); } } diff --git a/sdk/storage/azure-storage-blob-nio/src/main/java/com/azure/storage/blob/nio/AzureBlobFileAttributes.java b/sdk/storage/azure-storage-blob-nio/src/main/java/com/azure/storage/blob/nio/AzureBlobFileAttributes.java index 7c8c25b7fe531..ab224ca8ee1b2 100644 --- a/sdk/storage/azure-storage-blob-nio/src/main/java/com/azure/storage/blob/nio/AzureBlobFileAttributes.java +++ b/sdk/storage/azure-storage-blob-nio/src/main/java/com/azure/storage/blob/nio/AzureBlobFileAttributes.java @@ -24,7 +24,7 @@ import java.util.function.Supplier; /** - * File attributes associated with a file stored as a blob in Azure Storage. + * Provides support for attributes associated with a file stored as a blob in Azure Storage. *

* Some of the attributes inherited from {@link BasicFileAttributes} are not supported. See the docs on each method for * more information. @@ -32,10 +32,11 @@ public final class AzureBlobFileAttributes implements BasicFileAttributes { /* Some blob properties do not have getters as they do not make sense in the context of nio. These properties are: - - incremental snapshot related properties - - lease related properties - - sequence number - - encryption key sha256 + - incremental snapshot related properties (only for page blobs) + - lease related properties (leases not currently supported) + - sequence number (only for page blobs) + - encryption key sha256 (cpk not supported) + - committed block count (only for append blobs) */ private final ClientLogger logger = new ClientLogger(AzureBlobFileAttributes.class); @@ -69,7 +70,6 @@ static Map> getAttributeSuppliers(AzureBlobFileAttribut map.put("archiveStatus", attributes::archiveStatus); map.put("accessTierChangeTime", attributes::accessTierChangeTime); map.put("metadata", attributes::metadata); - map.put("committedBlockCount", attributes::committedBlockCount); map.put("isRegularFile", attributes::isRegularFile); map.put("isDirectory", attributes::isDirectory); map.put("isSymbolicLink", attributes::isSymbolicLink); @@ -79,7 +79,9 @@ static Map> getAttributeSuppliers(AzureBlobFileAttribut } /** - * {@inheritDoc} + * Returns the creation time. The creation time is the time that the file was created. + * + * @return The creation time. */ @Override public FileTime creationTime() { @@ -87,7 +89,9 @@ public FileTime creationTime() { } /** - * {@inheritDoc} + * Returns the time of last modification. + * + * @return the time of last modification. */ @Override public FileTime lastModifiedTime() { @@ -95,6 +99,8 @@ public FileTime lastModifiedTime() { } /** + * Returns the eTag of the blob. + * * @return the eTag of the blob */ public String eTag() { @@ -102,6 +108,8 @@ public String eTag() { } /** + * Returns the {@link BlobHttpHeaders} of the blob. + * * @return {@link BlobHttpHeaders} */ public BlobHttpHeaders blobHttpHeaders() { @@ -120,6 +128,8 @@ public BlobHttpHeaders blobHttpHeaders() { } /** + * Returns the type of the blob. + * * @return the type of the blob */ public BlobType blobType() { @@ -127,92 +137,116 @@ public BlobType blobType() { } /** - * @return the identifier of the last copy operation. If this blob hasn't been the target of a copy operation or has + * Returns the identifier of the last copy operation. If this blob hasn't been the target of a copy operation or has * been modified since this won't be set. + * + * @return the identifier of the last copy operation. */ public String copyId() { return this.properties.getCopyId(); } /** - * @return the status of the last copy operation. If this blob hasn't been the target of a copy operation or has + * Returns the status of the last copy operation. If this blob hasn't been the target of a copy operation or has * been modified since this won't be set. + * + * @return the status of the last copy operation. */ public CopyStatusType copyStatus() { return this.properties.getCopyStatus(); } /** - * @return the source blob URL from the last copy operation. If this blob hasn't been the target of a copy operation + * Returns the source blob URL from the last copy operation. If this blob hasn't been the target of a copy operation * or has been modified since this won't be set. + * + * @return the source blob URL from the last copy operation. */ public String copySource() { return this.properties.getCopySource(); } /** - * @return the number of bytes copied and total bytes in the source from the last copy operation (bytes copied/total + * Returns the number of bytes copied and total bytes in the source from the last copy operation (bytes copied/total * bytes). If this blob hasn't been the target of a copy operation or has been modified since this won't be set. + * + * @return the number of bytes copied and total bytes in the source from the last copy operation */ public String copyProgress() { return this.properties.getCopyProgress(); } /** - * @return the completion time of the last copy operation. If this blob hasn't been the target of a copy operation + * Returns the completion time of the last copy operation. If this blob hasn't been the target of a copy operation * or has been modified since this won't be set. + * + * @return the completion time of the last copy operation. */ public OffsetDateTime copyCompletionTime() { return this.properties.getCopyCompletionTime(); } /** - * @return the description of the last copy failure, this is set when the {@link #copyStatus() getCopyStatus} is + * Returns the description of the last copy failure, this is set when the {@link #copyStatus() getCopyStatus} is * {@link CopyStatusType#FAILED failed} or {@link CopyStatusType#ABORTED aborted}. If this blob hasn't been the * target of a copy operation or has been modified since this won't be set. + * + * @return the description of the last copy failure. */ public String copyStatusDescription() { return this.properties.getCopyStatusDescription(); } /** - * @return the status of the blob being encrypted on the server + * Returns the status of the blob being encrypted on the server. + * + * @return the status of the blob being encrypted on the server. */ public Boolean isServerEncrypted() { return this.properties.isServerEncrypted(); } /** - * @return the tier of the blob. This is only set for Page blobs on a premium storage account or for Block blobs on + * Returns the tier of the blob. This is only set for Page blobs on a premium storage account or for Block blobs on * blob storage or general purpose V2 account. + * + * @return the tier of the blob. */ public AccessTier accessTier() { return this.properties.getAccessTier(); } /** - * @return the status of the tier being inferred for the blob. This is only set for Page blobs on a premium storage + * Returns the status of the tier being inferred for the blob. This is only set for Page blobs on a premium storage * account or for Block blobs on blob storage or general purpose V2 account. + * + * @return the status of the tier being inferred for the blob. */ public Boolean isAccessTierInferred() { return this.properties.isAccessTierInferred(); } /** - * @return the archive status of the blob. This is only for blobs on a blob storage and general purpose v2 account. + * Returns the archive status of the blob. This is only for blobs on a blob storage and general purpose v2 account. + * + * @return the archive status of the blob. */ public ArchiveStatus archiveStatus() { return this.properties.getArchiveStatus(); } /** - * @return the time when the access tier for the blob was last changed + * Returns the time when the access tier for the blob was last changed. + * + * @return the time when the access tier for the blob was last changed. */ public OffsetDateTime accessTierChangeTime() { return this.properties.getAccessTierChangeTime(); } /** + * Returns the metadata associated with this blob. + * * @return the metadata associated with this blob */ public Map metadata() { @@ -220,24 +254,22 @@ public Map metadata() { } /** - * @return the number of committed blocks in the blob. This is only returned for Append blobs. - */ - public Integer committedBlockCount() { - return this.properties.getCommittedBlockCount(); - } - - /** - * Unsupported. - * @throws UnsupportedOperationException Operation not supported. - * {@inheritDoc} + * Returns the time of last modification. + *

+ * Last access time is not supported by the blob service. In this case, it is typical for implementations to return + * the {@link #lastModifiedTime()}. + * + * @return the time of last modification. */ @Override public FileTime lastAccessTime() { - throw new UnsupportedOperationException(); + return this.lastModifiedTime(); } /** - * {@inheritDoc} + * Tells whether the file is a regular file with opaque content. + * + * @return whether the file is a regular file. */ @Override public boolean isRegularFile() { @@ -245,11 +277,13 @@ public boolean isRegularFile() { } /** - * {@inheritDoc} + * Tells whether the file is a directory. *

* Will only return true if the directory is a concrete directory. See * {@link AzureFileSystemProvider#createDirectory(Path, FileAttribute[])} for more information on virtual and * concrete directories. + * + * @return whether the file is a directory */ @Override public boolean isDirectory() { @@ -257,6 +291,8 @@ public boolean isDirectory() { } /** + * Tells whether the file is a symbolic link. + * * @return false. Symbolic links are not supported. */ @Override @@ -265,7 +301,9 @@ public boolean isSymbolicLink() { } /** - * @return false + * Tells whether the file is something other than a regular file, directory, or symbolic link. + * + * @return false. No other object types are supported. */ @Override public boolean isOther() { @@ -273,7 +311,9 @@ public boolean isOther() { } /** - * {@inheritDoc} + * Returns the size of the file (in bytes). + * + * @return the size of the file */ @Override public long size() { @@ -283,7 +323,6 @@ public long size() { /** * Unsupported. * @throws UnsupportedOperationException Operation not supported. - * {@inheritDoc} */ @Override public Object fileKey() { diff --git a/sdk/storage/azure-storage-blob-nio/src/main/java/com/azure/storage/blob/nio/AzureDirectoryStream.java b/sdk/storage/azure-storage-blob-nio/src/main/java/com/azure/storage/blob/nio/AzureDirectoryStream.java index b8b92e0c39ef6..2ae98a2bd0942 100644 --- a/sdk/storage/azure-storage-blob-nio/src/main/java/com/azure/storage/blob/nio/AzureDirectoryStream.java +++ b/sdk/storage/azure-storage-blob-nio/src/main/java/com/azure/storage/blob/nio/AzureDirectoryStream.java @@ -26,7 +26,7 @@ * * {@inheritDoc} */ -public class AzureDirectoryStream implements DirectoryStream { +public final class AzureDirectoryStream implements DirectoryStream { private final ClientLogger logger = new ClientLogger(AzureDirectoryStream.class); private final AzurePath path; diff --git a/sdk/storage/azure-storage-blob-nio/src/main/java/com/azure/storage/blob/nio/AzureFileStore.java b/sdk/storage/azure-storage-blob-nio/src/main/java/com/azure/storage/blob/nio/AzureFileStore.java index bf5507446bef9..8495b7d334d15 100644 --- a/sdk/storage/azure-storage-blob-nio/src/main/java/com/azure/storage/blob/nio/AzureFileStore.java +++ b/sdk/storage/azure-storage-blob-nio/src/main/java/com/azure/storage/blob/nio/AzureFileStore.java @@ -13,14 +13,13 @@ import java.util.Objects; /** - * An {@code AzureFileStore} is backed by an Azure Blob Storage container. - * - * {@inheritDoc} + * An {@code AzureFileStore} is a {@link FileStore} backed by an Azure Blob Storage container. */ public final class AzureFileStore extends FileStore { + private final ClientLogger logger = new ClientLogger(AzureFileStore.class); + private static final String AZURE_FILE_STORE_TYPE = "AzureBlobContainer"; - private final ClientLogger logger = new ClientLogger(AzureFileStore.class); private final AzureFileSystem parentFileSystem; private final BlobContainerClient containerClient; @@ -48,7 +47,7 @@ public final class AzureFileStore extends FileStore { /** * Returns the name of the container that underlies this file store. * - * {@inheritDoc} + * @return the name of the container that underlies this file store. */ @Override public String name() { @@ -59,7 +58,7 @@ public String name() { * Returns the {@code String "AzureBlobContainer"} to indicate that the file store is backed by a remote blob * container in Azure Storage. * - * {@inheritDoc} + * @return {@code "AzureBlobContainer"} */ @Override public String type() { @@ -67,12 +66,14 @@ public String type() { } /** - * Always returns false. It may be the case that the authentication method provided to this file system only + * Always returns false. + *

+ * It may be the case that the authentication method provided to this file system only * supports read operations and hence the file store is implicitly read only in this view, but that does not * imply the underlying container/file store is inherently read only. Creating/specifying read only file stores * is not currently supported. * - * {@inheritDoc} + * @return false. */ @Override public boolean isReadOnly() { @@ -80,9 +81,12 @@ public boolean isReadOnly() { } /** + * Returns the size, in bytes, of the file store. + *

* Containers do not limit the amount of data stored. This method will always return max long. * - * {@inheritDoc} + * @return the size of the file store. + * @throws IOException If an I/O error occurs. */ @Override public long getTotalSpace() throws IOException { @@ -90,9 +94,12 @@ public long getTotalSpace() throws IOException { } /** + * Returns the number of bytes available to this Java virtual machine on the file store. + *

* Containers do not limit the amount of data stored. This method will always return max long. * - * {@inheritDoc} + * @return the number of bytes available on the file store. + * @throws IOException If an I/O error occurs. */ @Override public long getUsableSpace() throws IOException { @@ -100,9 +107,12 @@ public long getUsableSpace() throws IOException { } /** + * Returns the number of unallocated bytes in the file store. + *

* Containers do not limit the amount of data stored. This method will always return max long. * - * {@inheritDoc} + * @return the number of unallocated bytes in the file store. + * @throws IOException If an I/O error occurs. */ @Override public long getUnallocatedSpace() throws IOException { @@ -110,39 +120,48 @@ public long getUnallocatedSpace() throws IOException { } /** + * Tells whether or not this file store supports the file attributes identified by the given file attribute view. + *

* All file stores in this file system support the following views: *

    *
  • {@link java.nio.file.attribute.BasicFileAttributeView}
  • - *
  • {@link java.nio.file.attribute.UserDefinedFileAttributeView}
  • *
  • {@link AzureBasicFileAttributeView}
  • + *
  • {@link AzureBlobFileAttributeView}
  • *
* - * {@inheritDoc} + * @param type the file attribute view type + * @return Whether the file attribute view is supported. */ @Override - public boolean supportsFileAttributeView(Class aClass) { - return AzureFileSystem.SUPPORTED_ATTRIBUTE_VIEWS.containsKey(aClass); + public boolean supportsFileAttributeView(Class type) { + return AzureFileSystem.SUPPORTED_ATTRIBUTE_VIEWS.containsKey(type); } /** + * Tells whether or not this file store supports the file attributes identified by the given file attribute view. + *

* All file stores in this file system support the following views: *

    *
  • {@link java.nio.file.attribute.BasicFileAttributeView}
  • - *
  • {@link java.nio.file.attribute.UserDefinedFileAttributeView}
  • *
  • {@link AzureBasicFileAttributeView}
  • + *
  • {@link AzureBlobFileAttributeView}
  • *
* - * {@inheritDoc} + * @param name the name of the file attribute view + * @return whether the file attribute view is supported. */ @Override - public boolean supportsFileAttributeView(String s) { - return AzureFileSystem.SUPPORTED_ATTRIBUTE_VIEWS.containsValue(s); + public boolean supportsFileAttributeView(String name) { + return AzureFileSystem.SUPPORTED_ATTRIBUTE_VIEWS.containsValue(name); } /** + * Returns a FileStoreAttributeView of the given type. + *

* This method always returns null as no {@link FileStoreAttributeView} is currently supported. * - * {@inheritDoc} + * @param aClass a class + * @return null */ @Override public V getFileStoreAttributeView(Class aClass) { @@ -150,10 +169,15 @@ public V getFileStoreAttributeView(Class a } /** + * Unsupported. + *

* This method always throws an {@code UnsupportedOperationException} as no {@link FileStoreAttributeView} is * currently supported. * - * {@inheritDoc} + * @param s a string + * @return The attribute value. + * @throws UnsupportedOperationException unsupported + * @throws IOException never */ @Override public Object getAttribute(String s) throws IOException { diff --git a/sdk/storage/azure-storage-blob-nio/src/main/java/com/azure/storage/blob/nio/AzureFileSystem.java b/sdk/storage/azure-storage-blob-nio/src/main/java/com/azure/storage/blob/nio/AzureFileSystem.java index 423264e135b5b..6e661d75ec754 100644 --- a/sdk/storage/azure-storage-blob-nio/src/main/java/com/azure/storage/blob/nio/AzureFileSystem.java +++ b/sdk/storage/azure-storage-blob-nio/src/main/java/com/azure/storage/blob/nio/AzureFileSystem.java @@ -17,6 +17,7 @@ import java.io.IOException; import java.nio.file.FileStore; import java.nio.file.FileSystem; +import java.nio.file.InvalidPathException; import java.nio.file.Path; import java.nio.file.PathMatcher; import java.nio.file.WatchService; @@ -31,16 +32,25 @@ import java.util.Map; import java.util.Objects; import java.util.Set; +import java.util.regex.PatternSyntaxException; import java.util.stream.Collectors; /** + * Implement's Java's {@link FileSystem} interface for Azure Blob Storage. + *

+ * The following behavior is specific to this FileSystem: + *

* In the hierarchy of this file system, an {@code AzureFileSystem} corresponds to an Azure Blob Storage account. A * file store is represented by a container in the storage account. Each container has one root directory. - * + *

* Closing the file system will not block on outstanding operations. Any operations in progress will be allowed to * terminate naturally after the file system is closed, though no further operations may be started after the parent * file system is closed. - * {@inheritDoc} + *

+ * All instance of {@code AzureFileSystem} are opened for read-write access. + *

+ * For a more complete description of the uses for the constants described here, please see the instructions for opening + * and configuring a FileSystem in the docs of {@link FileSystemProvider}. */ public final class AzureFileSystem extends FileSystem { private final ClientLogger logger = new ClientLogger(AzureFileSystem.class); @@ -115,9 +125,13 @@ public final class AzureFileSystem extends FileSystem { * Expected type: Boolean */ public static final String AZURE_STORAGE_USE_HTTPS = "AzureStorageUseHttps"; + static final String AZURE_STORAGE_HTTP_CLIENT = "AzureStorageHttpClient"; // undocumented; for test. static final String AZURE_STORAGE_HTTP_POLICIES = "AzureStorageHttpPolicies"; // undocumented; for test. + /** + * Expected type: String + */ public static final String AZURE_STORAGE_FILE_STORES = "AzureStorageFileStores"; static final String PATH_SEPARATOR = "/"; @@ -174,7 +188,9 @@ public final class AzureFileSystem extends FileSystem { } /** - * {@inheritDoc} + * Returns the provider that created this file system. + * + * @return the provider that created this file system. */ @Override public FileSystemProvider provider() { @@ -182,12 +198,19 @@ public FileSystemProvider provider() { } /** + * Closes this file system. + *

+ * After a file system is closed then all subsequent access to the file system, either by methods defined by this + * class or on objects associated with this file system, throw ClosedFileSystemException. If the file system is + * already closed then invoking this method has no effect. + *

* Closing the file system will not block on outstanding operations. Any operations in progress will be allowed to * terminate naturally after the file system is closed, though no further operations may be started after the * parent file system is closed. - * + *

* Once closed, a file system with the same identifier as the one closed may be re-opened. - * {@inheritDoc} + * + * @throws IOException If an I/O error occurs. */ @Override public void close() throws IOException { @@ -196,7 +219,9 @@ public void close() throws IOException { } /** - * {@inheritDoc} + * Tells whether or not this file system is open. + * + * @return whether or not this file system is open. */ @Override public boolean isOpen() { @@ -204,12 +229,14 @@ public boolean isOpen() { } /** + * Tells whether or not this file system allows only read-only access to its file stores. + *

* Always returns false. It may be the case that the authentication method provided to this file system only * supports read operations and hence the file system is implicitly read only in this view, but that does not * imply the underlying account/file system is inherently read only. Creating/specifying read only file * systems is not supported. * - * {@inheritDoc} + * @return false */ @Override public boolean isReadOnly() { @@ -217,9 +244,11 @@ public boolean isReadOnly() { } /** + * Returns the name separator, represented as a string. + *

* The separator used in this file system is {@code "/"}. * - * {@inheritDoc} + * @return "/" */ @Override public String getSeparator() { @@ -227,50 +256,60 @@ public String getSeparator() { } /** + * Returns an object to iterate over the paths of the root directories. + *

* The list of root directories corresponds to the list of available file stores and therefore containers specified - * upon initialization. A root directory always takes the form {@code "<file-store-name>:"}. This list will + * upon initialization. A root directory always takes the form {@code ":"}. This list will * respect the parameters provided during initialization. *

* If a finite list of containers was provided on start up, this list will not change during the lifetime of this * object. If containers are added to the account after initialization, they will be ignored. If a container is * deleted or otherwise becomes unavailable, its root directory will still be returned but operations to it will - * fail. If the file system was set to use all containers in the account, the account will be re-queried and the - * list may grow or shrink if containers were added or deleted. + * fail. * - * {@inheritDoc} + * @return an object to iterate over the paths of the root directories */ @Override public Iterable getRootDirectories() { + /* + Should we add different initialization options later: + If the file system was set to use all containers in the account, the account will be re-queried and the + list may grow or shrink if containers were added or deleted. + */ return fileStores.keySet().stream() .map(name -> this.getPath(name + AzurePath.ROOT_DIR_SUFFIX)) .collect(Collectors.toList()); } /** + * Returns an object to iterate over the underlying file stores + *

* This list will respect the parameters provided during initialization. *

* If a finite list of containers was provided on start up, this list will not change during the lifetime of this * object. If containers are added to the account after initialization, they will be ignored. If a container is * deleted or otherwise becomes unavailable, its root directory will still be returned but operations to it will - * fail. If the file system was set to use all containers in the account, the account will be re-queried and the - * list may grow or shrink if containers were added or deleted. - * - * {@inheritDoc} + * fail. */ @Override public Iterable getFileStores() { + /* + Should we add different intialization options later: + If the file system was set to use all containers in the account, the account will be re-queried and the + list may grow or shrink if containers were added or deleted. + */ return this.fileStores.values(); } /** + * Returns the set of the names of the file attribute views supported by this FileSystem. + *

* This file system supports the following views: *

    *
  • {@link java.nio.file.attribute.BasicFileAttributeView}
  • - *
  • {@link java.nio.file.attribute.UserDefinedFileAttributeView}
  • *
  • {@link AzureBasicFileAttributeView}
  • + *
  • {@link AzureBlobFileAttributeView}
  • *
- * - * {@inheritDoc} */ @Override public Set supportedFileAttributeViews() { @@ -278,33 +317,46 @@ public Set supportedFileAttributeViews() { } /** - * Each name element will be {@code String}-joined to the other elements by this file system's path separator. + * Converts a path string, or a sequence of more that when joined form a path string, to a Path. + *

+ * If more does not specify any elements then the value of the first parameter is the path string to convert. If + * more specifies one or more elements then each non-empty string, including first, is considered to be a sequence + * of name elements (see Path) and is joined to form a path string. The more will be joined using the name + * separator. + *

+ * Each name element will be {@code String}-joined to the other elements by this file system'first path separator. * Naming conventions and allowed characters are as * defined * by the Azure Blob Storage service. The root component is interpreted as the container name and all name elements * are interpreted as a part of the blob name. The character {@code ':'} is only allowed in the root component and * must be the last character of the root component. * - * {@inheritDoc} + * @param first the path string or initial part of the path string + * @param more additional strings to be joined to form the path string + * @throws InvalidPathException if the path string cannot be converted. */ @Override - public Path getPath(String s, String... strings) { - return new AzurePath(this, s, strings); + public Path getPath(String first, String... more) { + return new AzurePath(this, first, more); } /** * Unsupported. * - * {@inheritDoc} + * @param s the matcher + * @throws UnsupportedOperationException unsupported. + * @throws IllegalArgumentException never + * @throws PatternSyntaxException never */ @Override - public PathMatcher getPathMatcher(String s) { + public PathMatcher getPathMatcher(String s) throws IllegalArgumentException, PatternSyntaxException { throw LoggingUtility.logError(logger, new UnsupportedOperationException()); } /** * Unsupported. - * {@inheritDoc} + * + * @throws UnsupportedOperationException unsupported. */ @Override public UserPrincipalLookupService getUserPrincipalLookupService() { @@ -314,7 +366,8 @@ public UserPrincipalLookupService getUserPrincipalLookupService() { /** * Unsupported. * - * {@inheritDoc} + * @throws UnsupportedOperationException unsupported. + * @throws IOException never. */ @Override public WatchService newWatchService() throws IOException { diff --git a/sdk/storage/azure-storage-blob-nio/src/main/java/com/azure/storage/blob/nio/AzureFileSystemProvider.java b/sdk/storage/azure-storage-blob-nio/src/main/java/com/azure/storage/blob/nio/AzureFileSystemProvider.java index 1a63f257dd364..8b3211aa99669 100644 --- a/sdk/storage/azure-storage-blob-nio/src/main/java/com/azure/storage/blob/nio/AzureFileSystemProvider.java +++ b/sdk/storage/azure-storage-blob-nio/src/main/java/com/azure/storage/blob/nio/AzureFileSystemProvider.java @@ -76,7 +76,7 @@ * {@link FileSystemProvider}. *

* The scheme for this provider is {@code "azb"}, and the format of the URI to identify an {@code AzureFileSystem} is - * {@code "azb://?account=<accountName>"}. The name of the Storage account is used to uniquely identify the file + * {@code "azb://?account="}. The name of the Storage account is used to uniquely identify the file * system. *

* An {@link AzureFileSystem} is backed by an account. An {@link AzureFileStore} is backed by a container. Any number of @@ -125,11 +125,34 @@ public final class AzureFileSystemProvider extends FileSystemProvider { private final ClientLogger logger = new ClientLogger(AzureFileSystemProvider.class); + /** + * A helper for setting the HTTP properties when creating a directory. + */ public static final String CONTENT_TYPE = "Content-Type"; + + /** + * A helper for setting the HTTP properties when creating a directory. + */ public static final String CONTENT_DISPOSITION = "Content-Disposition"; + + /** + * A helper for setting the HTTP properties when creating a directory. + */ public static final String CONTENT_LANGUAGE = "Content-Language"; + + /** + * A helper for setting the HTTP properties when creating a directory. + */ public static final String CONTENT_ENCODING = "Content-Encoding"; + + /** + * A helper for setting the HTTP properties when creating a directory. + */ public static final String CONTENT_MD5 = "Content-MD5"; + + /** + * A helper for setting the HTTP properties when creating a directory. + */ public static final String CACHE_CONTROL = "Cache-Control"; private static final String ACCOUNT_QUERY_KEY = "account"; @@ -147,7 +170,9 @@ public AzureFileSystemProvider() { } /** - * Returns {@code "azb".} + * Returns the URI scheme that identifies this provider: {@code "azb".} + * + * @return {@code "azb"} */ @Override public String getScheme() { @@ -155,10 +180,20 @@ public String getScheme() { } /** - * The format of a {@code URI} identifying a file system is {@code "azb://?account=<accountName>"}. + * Constructs a new FileSystem object identified by a URI. + *

+ * The format of a {@code URI} identifying a file system is {@code "azb://?account="}. *

* Once closed, a file system with the same identifier may be reopened. - * {@inheritDoc} + * + * @param uri URI reference + * @param config A map of provider specific properties to configure the file system + * @return a new file system. + * @throws IllegalArgumentException If the pre-conditions for the uri parameter aren't met, or the env parameter + * does not contain properties required by the provider, or a property value is invalid. + * @throws IOException If an I/O error occurs. + * @throws SecurityException never + * @throws FileSystemAlreadyExistsException If the file system has already been created. */ @Override public FileSystem newFileSystem(URI uri, Map config) throws IOException { @@ -175,11 +210,18 @@ public FileSystem newFileSystem(URI uri, Map config) throws IOExcepti } /** + * Returns an existing FileSystem created by this provider. + *

* The format of a {@code URI} identifying an file system is {@code "azb://?account=<accountName>"}. *

* Trying to retrieve a closed file system will throw a {@link FileSystemNotFoundException}. Once closed, a * file system with the same identifier may be reopened. - * {@inheritDoc} + * + * @param uri URI reference + * @return the file system + * @throws IllegalArgumentException If the pre-conditions for the uri parameter aren't met + * @throws FileSystemNotFoundException If the file system already exists + * @throws SecurityException never */ @Override public FileSystem getFileSystem(URI uri) { @@ -191,7 +233,17 @@ public FileSystem getFileSystem(URI uri) { } /** - * {@inheritDoc} + * Return a Path object by converting the given URI. The resulting Path is associated with a FileSystem that already + * exists. + * + * @param uri The URI to convert + * @return The path identified by the URI. + * @throws IllegalArgumentException If the URI scheme does not identify this provider or other preconditions on the + * uri parameter do not hold + * @throws FileSystemNotFoundException if the file system identified by the query does not exist + * @throws SecurityException never + * + * @see #getFileSystem(URI) for information on the URI format */ @Override public Path getPath(URI uri) { @@ -199,8 +251,19 @@ public Path getPath(URI uri) { } /** + * Unsupported. Use {@link #newInputStream(Path, OpenOption...)} or {@link #newOutputStream(Path, OpenOption...)} + * instead. + * + * @param path the Path + * @param set open options + * @param fileAttributes attributes + * @return a new seekable byte channel * @throws UnsupportedOperationException Operation is not supported. - * {@inheritDoc} + * @throws IllegalArgumentException if the set contains an invalid combination of options + * @throws FileAlreadyExistsException if a file of that name already exists and the CREATE_NEW option is specified + * (optional specific exception) + * @throws IOException If an I/O error occurs. + * @throws SecurityException never */ @Override public SeekableByteChannel newByteChannel(Path path, Set set, @@ -217,7 +280,13 @@ public SeekableByteChannel newByteChannel(Path path, Set s *

* Only {@link StandardOpenOption#READ} is supported. Any other option will throw. * - * {@inheritDoc} + * @param path the path to the file to open + * @param options options specifying how the file is opened + * @return a new input stream + * @throws IllegalArgumentException if an invalid combination of options is specified + * @throws UnsupportedOperationException if an unsupported option is specified + * @throws IOException If an I/O error occurs. + * @throws SecurityException never */ @Override public InputStream newInputStream(Path path, OpenOption... options) throws IOException { @@ -267,7 +336,13 @@ public InputStream newInputStream(Path path, OpenOption... options) throws IOExc * This can be a useful tool because writing happens asynchronously, and therefore an error from a previous write * may not otherwise be thrown unless the stream is flushed, closed, or written to again. * - * {@inheritDoc} + * @param path the path to the file to open or create + * @param options options specifying how the file is opened + * @return a new output stream + * @throws IllegalArgumentException if an invalid combination of options is specified + * @throws UnsupportedOperationException if an unsupported option is specified + * @throws IOException If an I/O error occurs. + * @throws SecurityException never */ @Override public OutputStream newOutputStream(Path path, OpenOption... options) throws IOException { @@ -340,10 +415,25 @@ public OutputStream newOutputStream(Path path, OpenOption... options) throws IOE } /** - * Returns an {@link AzureDirectoryStream} for iterating over the contents of a directory. + * Returns an {@link AzureDirectoryStream} for iterating over the contents of a directory. The elements returned by + * the directory stream's iterator are of type Path, each one representing an entry in the directory. The Path + * objects are obtained as if by resolving the name of the directory entry against dir. The entries returned by the + * iterator are filtered by the given filter. + *

+ * When not using the try-with-resources construct, then directory stream's close method should be invoked after + * iteration is completed so as to free any resources held for the open directory. + *

+ * Where the filter terminates due to an uncaught error or runtime exception then it is propagated to the hasNext or + * next method. Where an IOException is thrown, it results in the hasNext or next method throwing a + * DirectoryIteratorException with the IOException as the cause. * - * {@inheritDoc} + * @param path the path to the directory + * @param filter the directory stream filter + * @return a new and open {@code DirectoryStream} object * @throws IllegalArgumentException If the path type is not an instance of {@link AzurePath}. + * @throws NotDirectoryException if the file could not otherwise be opened because it is not a directory + * @throws IOException If an I/O error occurs. + * @throws SecurityException never */ @Override public DirectoryStream newDirectoryStream(Path path, DirectoryStream.Filter filter) @@ -399,7 +489,8 @@ public DirectoryStream newDirectoryStream(Path path, DirectoryStream.Filte * location. In other words, it is possible to "double create" a directory if it first weakly exists and then is * strongly created. This is both because it is impossible to atomically check if a virtual directory exists while * creating a concrete directory and because such behavior will have minimal side effects--no files will be - * overwritten and the directory will still be available for writing as intended, though it may not be empty. + * overwritten and the directory will still be available for writing as intended, though it may not be empty. This + * is not a complete list of such unintuitive behavior. *

* This method will attempt to extract standard HTTP content headers from the list of file attributes to set them * as blob headers. All other attributes will be set as blob metadata. The value of every attribute will be @@ -419,8 +510,15 @@ public DirectoryStream newDirectoryStream(Path path, DirectoryStream.Filte * Azure Docs for more * information. * - * {@inheritDoc} + * @param path the directory to create + * @param fileAttributes an optional list of file attributes to set atomically when creating the directory * @throws IllegalArgumentException If the path type is not an instance of {@link AzurePath}. + * @throws UnsupportedOperationException if the array contains an attribute that cannot be set atomically when + * creating the directory + * @throws FileAlreadyExistsException if a directory could not otherwise be created because a file of that name + * already exists + * @throws IOException If an I/O error occurs. + * @throws SecurityException never */ @Override public void createDirectory(Path path, FileAttribute... fileAttributes) throws IOException { @@ -453,12 +551,17 @@ public void createDirectory(Path path, FileAttribute... fileAttributes) throw /** * Deletes the specified resource. *

- * This method is not atomic. It is possible to delete a file in use by another process, and doing so will not - * immediately invalidate any channels open to that file--they will simply start to fail. Root directories cannot be - * deleted even when empty. - * {@inheritDoc} + * This method is not atomic with respect to other file system operations. It is possible to delete a file in use by + * another process, and doing so will not immediately invalidate any channels open to that file--they will simply + * start to fail. Root directories cannot be deleted even when empty. * + * @param path the path to the file to delete * @throws IllegalArgumentException If the path type is not an instance of {@link AzurePath}. + * @throws NoSuchFileException if the file does not exist + * @throws DirectoryNotEmptyException if the file is a directory and could not otherwise be deleted because the + * directory is not empty + * @throws IOException If an I/O error occurs. + * @throws SecurityException never */ @Override public void delete(Path path) throws IOException { @@ -488,26 +591,36 @@ public void delete(Path path) throws IOException { /** * Copies the resource at the source location to the destination. *

- * This method is not atomic. More specifically, the checks necessary to validate the - * inputs and state of the file system are not atomic with the actual copying of data. If the copy is triggered, - * the copy itself is atomic and only a complete copy will ever be left at the destination. + * This method is not atomic with respect to other file system operations. More specifically, the checks necessary + * to validate the inputs and state of the file system are not atomic with the actual copying of data. If the copy + * is triggered, the copy itself is atomic and only a complete copy will ever be left at the destination. + *

+ * In addition to those in the docs for {@link FileSystemProvider#copy(Path, Path, CopyOption...)}, this method has + * the following requirements for successful completion. {@link StandardCopyOption#COPY_ATTRIBUTES} must be passed + * as it is impossible not to copy blob properties; if this option is not passed, an + * {@link UnsupportedOperationException} will be thrown. Neither the source nor the destination can be a root + * directory; if either is a root directory, an {@link IllegalArgumentException} will be thrown. The parent + * directory of the destination must at least weakly exist; if it does not, an {@link IOException} will be thrown. + * The only supported option other than {@link StandardCopyOption#COPY_ATTRIBUTES} is + * {@link StandardCopyOption#REPLACE_EXISTING}; the presence of any other option will result in an + * {@link UnsupportedOperationException}. *

- * In addition to those in the nio javadocs, this method has the following requirements for successful completion. - * {@link StandardCopyOption#COPY_ATTRIBUTES} must be passed as it is impossible not to copy blob properties; - * if this option is not passed, an {@link UnsupportedOperationException} will be thrown. Neither the source nor the - * destination can be a root directory; if either is a root directory, an {@link IllegalArgumentException} will be - * thrown. The parent directory of the destination must at least weakly exist; if it does not, an - * {@link IOException} will be thrown. The only supported option other than - * {@link StandardCopyOption#COPY_ATTRIBUTES} is {@link StandardCopyOption#REPLACE_EXISTING}; the presence of any - * other option will result in an {@link UnsupportedOperationException}. - * * This method supports both virtual and concrete directories as both the source and destination. Unlike when * creating a directory, the existence of a virtual directory at the destination will cause this operation to fail. * This is in order to prevent the possibility of overwriting a non-empty virtual directory with a file. Still, as * mentioned above, this check is not atomic with the creation of the resultant directory. * - * {@inheritDoc} + * @param source the path to the file to copy + * @param destination the path to the target file + * @param copyOptions specifying how the copy should be done + * @throws UnsupportedOperationException if the array contains a copy option that is not supported + * @throws FileAlreadyExistsException if the target file exists but cannot be replaced because the REPLACE_EXISTING + * option is not specified + * @throws DirectoryNotEmptyException the REPLACE_EXISTING option is specified but the file cannot be replaced + * because it is a non-empty directory + * @throws IOException If an I/O error occurs. * @throws IllegalArgumentException If the path type is not an instance of {@link AzurePath}. + * @throws SecurityException never * @see #createDirectory(Path, FileAttribute[]) for more information about directory existence. */ @Override @@ -612,8 +725,12 @@ public void copy(Path source, Path destination, CopyOption... copyOptions) throw }*/ /** + * Unsupported. + * + * @param path path + * @param path1 path + * @param copyOptions options * @throws UnsupportedOperationException Operation is not supported. - * {@inheritDoc} */ @Override public void move(Path path, Path path1, CopyOption... copyOptions) throws IOException { @@ -621,8 +738,11 @@ public void move(Path path, Path path1, CopyOption... copyOptions) throws IOExce } /** + * Unsupported. + * + * @param path path + * @param path1 path * @throws UnsupportedOperationException Operation is not supported. - * {@inheritDoc} */ @Override public boolean isSameFile(Path path, Path path1) throws IOException { @@ -630,7 +750,12 @@ public boolean isSameFile(Path path, Path path1) throws IOException { } /** - * {@inheritDoc} + * Always returns false as hidden files are not supported. + * + * @param path the path + * @return false + * @throws IOException If an I/O error occurs. + * @throws SecurityException never */ @Override public boolean isHidden(Path path) throws IOException { @@ -638,8 +763,13 @@ public boolean isHidden(Path path) throws IOException { } /** + * Unsupported. + * + * @param path path + * @return the file store where the file is stored. * @throws UnsupportedOperationException Operation is not supported. - * {@inheritDoc} + * @throws IOException If an I/O error occurs. + * @throws SecurityException never */ @Override public FileStore getFileStore(Path path) throws IOException { @@ -647,8 +777,16 @@ public FileStore getFileStore(Path path) throws IOException { } /** + * Unsupported. + * + * @param path path + * @param accessModes accessMode * @throws UnsupportedOperationException Operation is not supported. - * {@inheritDoc} + * @throws NoSuchFileException if a file does not exist + * @throws java.nio.file.AccessDeniedException the requested access would be denied or the access cannot be + * determined because the Java virtual machine has insufficient privileges or other reasons + * @throws IOException If an I/O error occurs. + * @throws SecurityException never */ @Override public void checkAccess(Path path, AccessMode... accessModes) throws IOException { @@ -657,23 +795,27 @@ public void checkAccess(Path path, AccessMode... accessModes) throws IOException /** * Returns a file attribute view of a given type. - * + *

* See {@link AzureBasicFileAttributeView} and {@link AzureBlobFileAttributeView} for more information. - * + *

* Reading or setting attributes on a virtual directory is not supported and will throw an {@link IOException}. See * {@link #createDirectory(Path, FileAttribute[])} for more information on virtual directories. - * {@inheritDoc} + * + * @param path the path to the file + * @param type the Class object corresponding to the file attribute view + * @param linkOptions ignored + * @return a file attribute view of the specified type, or null if the attribute view type is not available */ @Override @SuppressWarnings("unchecked") - public V getFileAttributeView(Path path, Class aClass, LinkOption... linkOptions) { + public V getFileAttributeView(Path path, Class type, LinkOption... linkOptions) { /* No resource validation is necessary here. That can happen at the time of making a network requests internal to the view object. */ - if (aClass == BasicFileAttributeView.class || aClass == AzureBasicFileAttributeView.class) { + if (type == BasicFileAttributeView.class || type == AzureBasicFileAttributeView.class) { return (V) new AzureBasicFileAttributeView(path); - } else if (aClass == AzureBlobFileAttributeView.class) { + } else if (type == AzureBlobFileAttributeView.class) { return (V) new AzureBlobFileAttributeView(path); } else { return null; @@ -682,21 +824,28 @@ public V getFileAttributeView(Path path, Class /** * Reads a file's attributes as a bulk operation. - * + *

* See {@link AzureBasicFileAttributes} and {@link AzureBlobFileAttributes} for more information. - * + *

* Reading attributes on a virtual directory is not supported and will throw an {@link IOException}. See * {@link #createDirectory(Path, FileAttribute[])} for more information on virtual directories. - * {@inheritDoc} + * + * @param path the path to the file + * @param type the Class of the file attributes required to read + * @param linkOptions ignored + * @return the file attributes + * @throws UnsupportedOperationException if an attributes of the given type are not supported + * @throws IOException If an I/O error occurs. + * @throws SecurityException never */ @Override @SuppressWarnings("unchecked") - public A readAttributes(Path path, Class aClass, LinkOption... linkOptions) + public A readAttributes(Path path, Class type, LinkOption... linkOptions) throws IOException { Class view; - if (aClass == BasicFileAttributes.class || aClass == AzureBasicFileAttributes.class) { + if (type == BasicFileAttributes.class || type == AzureBasicFileAttributes.class) { view = AzureBasicFileAttributeView.class; - } else if (aClass == AzureBlobFileAttributes.class) { + } else if (type == AzureBlobFileAttributes.class) { view = AzureBlobFileAttributeView.class; } else { throw new UnsupportedOperationException(); @@ -711,16 +860,26 @@ public A readAttributes(Path path, Class aCla /** * Reads a set of file attributes as a bulk operation. - * + *

* See {@link AzureBasicFileAttributes} and {@link AzureBlobFileAttributes} for more information. - * + *

* Reading attributes on a virtual directory is not supported and will throw an {@link IOException}. See * {@link #createDirectory(Path, FileAttribute[])} for more information on virtual directories. - * {@inheritDoc} + * + * @param path the path to the file + * @param attributes the attributes to read + * @param linkOptions ignored + * @return a map of the attributes returned; may be empty. The map's keys are the attribute names, its values are + * the attribute values + * @throws UnsupportedOperationException if an attributes of the given type are not supported + * @throws IllegalArgumentException if no attributes are specified or an unrecognized attributes is specified + * @throws IOException If an I/O error occurs. + * @throws SecurityException never */ @Override - public Map readAttributes(Path path, String s, LinkOption... linkOptions) throws IOException { - if (s == null) { + public Map readAttributes(Path path, String attributes, LinkOption... linkOptions) + throws IOException { + if (attributes == null) { throw LoggingUtility.logError(logger, new IllegalArgumentException("Attribute string cannot be null.")); } @@ -735,16 +894,16 @@ public Map readAttributes(Path path, String s, LinkOption... lin Map> attributeSuppliers = null; // Initialized later as needed. String viewType; String attributeList; - String[] parts = s.split(":"); + String[] parts = attributes.split(":"); if (parts.length > 2) { throw LoggingUtility.logError(logger, - new IllegalArgumentException("Invalid format for attribute string: " + s)); + new IllegalArgumentException("Invalid format for attribute string: " + attributes)); } if (parts.length == 1) { viewType = "basic"; // Per jdk docs. - attributeList = s; + attributeList = attributes; } else { viewType = parts[0]; attributeList = parts[1]; @@ -811,7 +970,7 @@ public Map readAttributes(Path path, String s, LinkOption... lin // Throw if nothing specified per jdk docs. if (results.isEmpty()) { throw LoggingUtility.logError(logger, - new IllegalArgumentException("No attributes were specified. Attributes: " + s)); + new IllegalArgumentException("No attributes were specified. Attributes: " + attributes)); } return results; @@ -819,25 +978,36 @@ public Map readAttributes(Path path, String s, LinkOption... lin /** * Sets the value of a file attribute. - * + *

* See {@link AzureBlobFileAttributeView} for more information. - * + *

* Setting attributes on a virtual directory is not supported and will throw an {@link IOException}. See * {@link #createDirectory(Path, FileAttribute[])} for more information on virtual directories. - * {@inheritDoc} + * + * @param path the path to the file + * @param attributes the attribute to set + * @param value the attribute value + * @param linkOptions ignored + * @throws UnsupportedOperationException if an attribute view is not available + * @throws IllegalArgumentException if the attribute name is not specified, or is not recognized, or the attribute + * value is of the correct type but has an inappropriate value + * @throws ClassCastException If the attribute value is not of the expected type or is a collection containing + * elements that are not of the expected type + * @throws IOException If an I/O error occurs. + * @throws SecurityException never */ @Override - public void setAttribute(Path path, String s, Object o, LinkOption... linkOptions) throws IOException { + public void setAttribute(Path path, String attributes, Object value, LinkOption... linkOptions) throws IOException { String viewType; String attributeName; - String[] parts = s.split(":"); + String[] parts = attributes.split(":"); if (parts.length > 2) { throw LoggingUtility.logError(logger, - new IllegalArgumentException("Invalid format for attribute string: " + s)); + new IllegalArgumentException("Invalid format for attribute string: " + attributes)); } if (parts.length == 1) { viewType = "basic"; // Per jdk docs. - attributeName = s; + attributeName = attributes; } else { viewType = parts[0]; attributeName = parts[1]; @@ -866,7 +1036,7 @@ public void setAttribute(Path path, String s, Object o, LinkOption... linkOption + ". Attribute: " + attributeName)); } try { - attributeConsumers.get(attributeName).accept(o); + attributeConsumers.get(attributeName).accept(value); } catch (UncheckedIOException e) { if (e.getMessage().equals(AzureBlobFileAttributeView.ATTR_CONSUMER_ERROR)) { throw LoggingUtility.logError(logger, e.getCause()); diff --git a/sdk/storage/azure-storage-blob-nio/src/main/java/com/azure/storage/blob/nio/AzurePath.java b/sdk/storage/azure-storage-blob-nio/src/main/java/com/azure/storage/blob/nio/AzurePath.java index 9f2fb2449a3f5..6ba74a99aafc8 100644 --- a/sdk/storage/azure-storage-blob-nio/src/main/java/com/azure/storage/blob/nio/AzurePath.java +++ b/sdk/storage/azure-storage-blob-nio/src/main/java/com/azure/storage/blob/nio/AzurePath.java @@ -29,6 +29,8 @@ import java.util.stream.Stream; /** + * An object that may be used to locate a file in a file system. + *

* The root component, if it is present, is the first element of the path and is denoted by a {@code ':'} as the last * character. Hence, only one instance of {@code ':'} may appear in a path string and it may only be the last character * of the first element in the path. The root component is used to identify which container a path belongs to. @@ -41,9 +43,9 @@ * If a resource is accessed via a relative path, it will be resolved against the default directory of the file system. * The default directory is as defined in the {@link AzureFileSystem} docs. *

- * Leading and trailing separators will be stripped. This has the effect of making "foo/" and "foo" equivalent paths. - * - * {@inheritDoc} + * Leading and trailing separators will be stripped from each component passed to + * {@link AzureFileSystem#getPath(String, String...)}. This has the effect of treating "foo/" as though it were simply + * "foo". */ public final class AzurePath implements Path { private final ClientLogger logger = new ClientLogger(AzurePath.class); @@ -91,7 +93,9 @@ public final class AzurePath implements Path { } /** - * {@inheritDoc} + * Returns the file system that created this object. + * + * @return the file system that created this object */ @Override public FileSystem getFileSystem() { @@ -99,9 +103,12 @@ public FileSystem getFileSystem() { } /** - * A path is considered absolute in this file system if it contains a root component. + * Tells whether or not this path is absolute. + *

+ * An absolute path is complete in that it doesn't need to be combined with other path information in order to + * locate a file. A path is considered absolute in this file system if it contains a root component. * - * {@inheritDoc} + * @return whether the path is absolute */ @Override public boolean isAbsolute() { @@ -109,11 +116,13 @@ public boolean isAbsolute() { } /** + * Returns the root component of this path as a Path object, or null if this path does not have a root component. + *

* The root component of this path also identifies the Azure Storage Container in which the file is stored. This * method will not validate that the root component corresponds to an actual file store/container in this * file system. It will simply return the root component of the path if one is present and syntactically valid. * - * {@inheritDoc} + * @return a path representing the root component of this path, or null */ @Override public Path getRoot() { @@ -126,7 +135,10 @@ public Path getRoot() { } /** - * {@inheritDoc} + * Returns the name of the file or directory denoted by this path as a Path object. The file name is the farthest + * element from the root in the directory hierarchy. + * + * @return a path representing the name of the file or directory, or null if this path has zero elements */ @Override public Path getFileName() { @@ -141,7 +153,21 @@ public Path getFileName() { } /** - * {@inheritDoc} + * Returns the parent path, or null if this path does not have a parent. + *

+ * The parent of this path object consists of this path's root component, if any, and each element in the path + * except for the farthest from the root in the directory hierarchy. This method does not access the file system; + * the path or its parent may not exist. Furthermore, this method does not eliminate special names such as "." and + * ".." that may be used in some implementations. On UNIX for example, the parent of "/a/b/c" is "/a/b", and the + * parent of "x/y/." is "x/y". This method may be used with the normalize method, to eliminate redundant names, for + * cases where shell-like navigation is required. + *

+ * If this path has one or more elements, and no root component, then this method is equivalent to evaluating the + * expression: + * + * {@code subpath(0, getNameCount()-1);} + * + * @return a path representing the path's parent */ @Override public Path getParent() { @@ -159,7 +185,9 @@ public Path getParent() { } /** - * {@inheritDoc} + * Returns the number of name elements in the path. + * + * @return the number of elements in the path, or 0 if this path only represents a root component */ @Override public int getNameCount() { @@ -170,13 +198,21 @@ public int getNameCount() { } /** - * {@inheritDoc} + * Returns a name element of this path as a Path object. + *

+ * The index parameter is the index of the name element to return. The element that is closest to the root in the + * directory hierarchy has index 0. The element that is farthest from the root has index {@code count-1}. + * + * @param index the index of the element + * @return the name element + * @throws IllegalArgumentException if index is negative, index is greater than or equal to the number of elements, + * or this path has zero name elements */ @Override - public Path getName(int i) { - if (i < 0 || i >= this.getNameCount()) { + public Path getName(int index) { + if (index < 0 || index >= this.getNameCount()) { throw LoggingUtility.logError(logger, new IllegalArgumentException(String.format("Index %d is out of " - + "bounds", i))); + + "bounds", index))); } // If the path is empty, the only valid option is also an empty path. if (this.pathString.isEmpty()) { @@ -186,11 +222,20 @@ public Path getName(int i) { if (this.pathString.isEmpty()) { return this; } - return this.parentFileSystem.getPath(this.splitToElements(this.withoutRoot())[i]); + return this.parentFileSystem.getPath(this.splitToElements(this.withoutRoot())[index]); } /** - * {@inheritDoc} + * Returns a relative Path that is a subsequence of the name elements of this path. + *

+ * The beginIndex and endIndex parameters specify the subsequence of name elements. The name that is closest to the + * root in the directory hierarchy has index 0. The name that is farthest from the root has index {@code count-1}. + * The returned Path object has the name elements that begin at beginIndex and extend to the element at index + * {@code endIndex-1}. + * + * @param begin the index of the first element, inclusive + * @param end the index of the last element, exclusive + * @return a new Path object that is a subsequence of the name elements in this Path */ @Override public Path subpath(int begin, int end) { @@ -209,10 +254,22 @@ public Path subpath(int begin, int end) { } /** + * Tests if this path starts with the given path. + *

+ * This path starts with the given path if this path's root component starts with the root component of the given + * path, and this path starts with the same name elements as the given path. If the given path has more name + * elements than this path then false is returned. + *

+ * If this path does not have a root component and the given path has a root component then this path does not start + * with the given path. + *

+ * If the given path is associated with a different FileSystem to this path then false is returned. + *

* In this implementation, a root component starts with another root component if the two root components are * equivalent strings. In other words, if the files are stored in the same container. * - * {@inheritDoc} + * @param path the given path + * @return true if this path starts with the given path; otherwise false */ @Override public boolean startsWith(Path path) { @@ -240,18 +297,37 @@ public boolean startsWith(Path path) { } /** - * {@inheritDoc} + * Tests if this path starts with a Path, constructed by converting the given path string, in exactly the manner + * specified by the startsWith(Path) method. + * + * @param path the given path string + * @return true if this path starts with the given path; otherwise false + * @throws InvalidPathException If the path string cannot be converted to a Path. */ @Override - public boolean startsWith(String s) { - return this.startsWith(this.parentFileSystem.getPath(s)); + public boolean startsWith(String path) { + return this.startsWith(this.parentFileSystem.getPath(path)); } /** + * Tests if this path ends with the given path. + *

+ * If the given path has N elements, and no root component, and this path has N or more elements, then this path + * ends with the given path if the last N elements of each path, starting at the element farthest from the root, + * are equal. + *

+ * If the given path has a root component then this path ends with the given path if the root component of this path + * ends with the root component of the given path, and the corresponding elements of both paths are equal. If this + * path does not have a root component and the given path has a root component then this path does not end with the + * given path. + *

+ * If the given path is associated with a different FileSystem to this path then false is returned. + *

* In this implementation, a root component ends with another root component if the two root components are * equivalent strings. In other words, if the files are stored in the same container. * - * {@inheritDoc} + * @param path the given path + * @return true if this path ends with the given path; otherwise false */ @Override public boolean endsWith(Path path) { @@ -287,17 +363,32 @@ public boolean endsWith(Path path) { } /** - * {@inheritDoc} + * Tests if this path ends with a Path, constructed by converting the given path string, in exactly the manner + * specified by the endsWith(Path) method. + * + * @param path the given path string + * @return true if this path starts with the given path; otherwise false + * @throws InvalidPathException If the path string cannot be converted to a Path. */ @Override - public boolean endsWith(String s) { - return this.endsWith(this.parentFileSystem.getPath(s)); + public boolean endsWith(String path) { + return this.endsWith(this.parentFileSystem.getPath(path)); } /** - * This file system follows the standard practice mentioned in the original docs. + * Returns a path that is this path with redundant name elements eliminated. + *

+ * It derives from this path, a path that does not contain redundant name elements. The "." and ".." are special + * names used to indicate the current directory and parent directory. All occurrences of "." are considered + * redundant. If a ".." is preceded by a non-".." name then both names are considered redundant (the process to + * identify such names is repeated until is it no longer applicable). + *

+ * This method does not access the file system; the path may not locate a file that exists. Eliminating ".." and a + * preceding name from a path may result in the path that locates a different file than the original path + * + * @return the resulting path or this path if it does not contain redundant name elements; an empty path is returned + * if this path does have a root component and all name elements are redundant * - * {@inheritDoc} */ @Override public Path normalize() { @@ -336,9 +427,17 @@ public Path normalize() { } /** - * If the other path has a root component, it is considered absolute, and it is returned. + * Resolve the given path against this path. + *

+ * If the other parameter is an absolute path then this method trivially returns other. If other is an empty path + * then this method trivially returns this path. Otherwise this method considers this path to be a directory and + * resolves the given path against this path. In the simplest case, the given path does not have a root component, + * in which case this method joins the given path to this path and returns a resulting path that ends with the given + * path. Where the given path has a root component then resolution is highly implementation dependent and therefore + * unspecified. * - * {@inheritDoc} + * @param path the path to resolve against this path + * @return the resulting path */ @Override public Path resolve(Path path) { @@ -352,15 +451,27 @@ public Path resolve(Path path) { } /** - * {@inheritDoc} + * Converts a given path string to a Path and resolves it against this Path in exactly the manner specified by the + * {@link #resolve(Path) resolve} method. + * + * @param path the path string to resolve against this path + * @return the resulting path + * @throws InvalidPathException if the path string cannot be converted to a Path. */ @Override - public Path resolve(String s) { - return this.resolve(this.parentFileSystem.getPath(s)); + public Path resolve(String path) { + return this.resolve(this.parentFileSystem.getPath(path)); } /** - * {@inheritDoc} + * Resolves the given path against this path's parent path. This is useful where a file name needs to be replaced + * with another file name. For example, suppose that the name separator is "/" and a path represents + * "dir1/dir2/foo", then invoking this method with the Path "bar" will result in the Path "dir1/dir2/bar". If this + * path does not have a parent path, or other is absolute, then this method returns other. If other is an empty path + * then this method returns this path's parent, or where this path doesn't have a parent, the empty path. + * + * @param path the path to resolve against this path's parent + * @return the resulting path */ @Override public Path resolveSibling(Path path) { @@ -373,17 +484,34 @@ public Path resolveSibling(Path path) { } /** - * {@inheritDoc} + * Converts a given path string to a Path and resolves it against this path's parent path in exactly the manner + * specified by the resolveSibling method. + * + * @param path the path string to resolve against this path's parent + * @return the resulting path + * @throws InvalidPathException if the path string cannot be converted to a Path. */ @Override - public Path resolveSibling(String s) { - return this.resolveSibling(this.parentFileSystem.getPath(s)); + public Path resolveSibling(String path) { + return this.resolveSibling(this.parentFileSystem.getPath(path)); } /** - * If both paths have a root component, it is still to relativize one against the other. + * Constructs a relative path between this path and a given path. + *

+ * Relativization is the inverse of resolution. This method attempts to construct a relative path that when resolved + * against this path, yields a path that locates the same file as the given path. + *

+ * A relative path cannot be constructed if only one of the paths have a root component. If both paths have a root + * component, it is still possible to relativize one against the other. If this path and the given path are equal + * then an empty path is returned. + *

+ * For any two normalized paths p and q, where q does not have a root component, + * {@code p.relativize(p.resolve(q)).equals(q)} * - * {@inheritDoc} + * @param path the path to relativize against this path + * @return the resulting relative path, or an empty path if both paths are equal + * @throws IllegalArgumentException if other is not a Path that can be relativized against this path */ @Override public Path relativize(Path path) { @@ -413,10 +541,15 @@ public Path relativize(Path path) { } /** + * Returns a URI to represent this path. + *

+ * This method constructs an absolute URI with a scheme equal to the URI scheme that identifies the provider. + *

* No authority component is defined for the {@code URI} returned by this method. This implementation offers the * same equivalence guarantee as the default provider. * - * {@inheritDoc} + * @return the URI representing this path + * @throws SecurityException never */ @Override public URI toUri() { @@ -429,7 +562,13 @@ public URI toUri() { } /** - * {@inheritDoc} + * Returns a Path object representing the absolute path of this path. + *

+ * If this path is already absolute then this method simply returns this path. Otherwise, this method resolves the + * path against the default directory. + * + * @return a Path object representing the absolute path + * @throws SecurityException never */ @Override public Path toAbsolutePath() { @@ -442,7 +581,9 @@ public Path toAbsolutePath() { /** * Unsupported. *

- * {@inheritDoc} + * @param linkOptions options + * @return the real path + * @throws UnsupportedOperationException operation not suported. */ @Override public Path toRealPath(LinkOption... linkOptions) throws IOException { @@ -450,7 +591,10 @@ public Path toRealPath(LinkOption... linkOptions) throws IOException { } /** - * {@inheritDoc} + * Unsupported. + *

+ * @return the file + * @throws UnsupportedOperationException operation not suported. */ @Override public File toFile() { @@ -460,7 +604,11 @@ public File toFile() { /** * Unsupported. *

- * {@inheritDoc} + * @param watchService watchService + * @param kinds kinds + * @param modifiers modifiers + * @return the watch key + * @throws UnsupportedOperationException operation not suported. */ @Override public WatchKey register(WatchService watchService, WatchEvent.Kind[] kinds, WatchEvent.Modifier... modifiers) @@ -471,7 +619,10 @@ public WatchKey register(WatchService watchService, WatchEvent.Kind[] kinds, /** * Unsupported. *

- * {@inheritDoc} + * @param watchService watchService + * @param kinds kinds + * @return the watch key + * @throws UnsupportedOperationException operation not suported. */ @Override public WatchKey register(WatchService watchService, WatchEvent.Kind... kinds) throws IOException { @@ -479,9 +630,13 @@ public WatchKey register(WatchService watchService, WatchEvent.Kind... kinds) } /** - * Unsupported + * Returns an iterator over the name elements of this path. *

- * {@inheritDoc} + * The first element returned by the iterator represents the name element that is closest to the root in the + * directory hierarchy, the second element is the next closest, and so on. The last element returned is the name of + * the file or directory denoted by this path. The root component, if present, is not returned by the iterator. + * + * @return an iterator over the name elements of this path. */ @Override public Iterator iterator() { @@ -495,9 +650,16 @@ public Iterator iterator() { } /** + * Compares two abstract paths lexicographically. This method does not access the file system and neither file is + * required to exist. + *

+ * This method may not be used to compare paths that are associated with different file system providers. + *

* This result of this method is identical to a string comparison on the underlying path strings. * - * {@inheritDoc} + * @return zero if the argument is equal to this path, a value less than zero if this path is lexicographically less + * than the argument, or a value greater than zero if this path is lexicographically greater than the argument + * @throws ClassCastException if the paths are associated with different providers */ @Override public int compareTo(Path path) { @@ -510,7 +672,14 @@ public int compareTo(Path path) { } /** - * {@inheritDoc} + * Returns the string representation of this path. + *

+ * If this path was created by converting a path string using the getPath method then the path string returned by + * this method may differ from the original String used to create the path. + *

+ * The returned path string uses the default name separator to separate names in the path. + * + * @return the string representation of this path */ @Override public String toString() { @@ -521,7 +690,7 @@ public String toString() { * A path is considered equal to another path if it is associated with the same file system instance and if the * path strings are equivalent. * - * {@inheritDoc} + * @return true if, and only if, the given object is a Path that is identical to this Path */ @Override public boolean equals(Object o) { diff --git a/sdk/storage/azure-storage-blob-nio/src/main/java/com/azure/storage/blob/nio/LoggingUtility.java b/sdk/storage/azure-storage-blob-nio/src/main/java/com/azure/storage/blob/nio/LoggingUtility.java index b2a98e32b2a32..3cd503f98c21d 100644 --- a/sdk/storage/azure-storage-blob-nio/src/main/java/com/azure/storage/blob/nio/LoggingUtility.java +++ b/sdk/storage/azure-storage-blob-nio/src/main/java/com/azure/storage/blob/nio/LoggingUtility.java @@ -8,7 +8,7 @@ /** * Only a minimal Utility class to get around a shortcoming in Core's logging. */ -class LoggingUtility { +final class LoggingUtility { public static T logError(ClientLogger logger, T e) { logger.error(e.getMessage()); return e; diff --git a/sdk/storage/azure-storage-blob-nio/src/main/java/com/azure/storage/blob/nio/NioBlobInputStream.java b/sdk/storage/azure-storage-blob-nio/src/main/java/com/azure/storage/blob/nio/NioBlobInputStream.java index ed350cb00f0bd..b765ab73e7372 100644 --- a/sdk/storage/azure-storage-blob-nio/src/main/java/com/azure/storage/blob/nio/NioBlobInputStream.java +++ b/sdk/storage/azure-storage-blob-nio/src/main/java/com/azure/storage/blob/nio/NioBlobInputStream.java @@ -12,7 +12,7 @@ /** * Provides an InputStream to read a file stored as an Azure Blob. */ -public class NioBlobInputStream extends InputStream { +public final class NioBlobInputStream extends InputStream { private final ClientLogger logger = new ClientLogger(NioBlobInputStream.class); private final BlobInputStream blobInputStream; diff --git a/sdk/storage/azure-storage-blob-nio/src/main/java/com/azure/storage/blob/nio/NioBlobOutputStream.java b/sdk/storage/azure-storage-blob-nio/src/main/java/com/azure/storage/blob/nio/NioBlobOutputStream.java index 6ec976616ebb5..b048128d6445a 100644 --- a/sdk/storage/azure-storage-blob-nio/src/main/java/com/azure/storage/blob/nio/NioBlobOutputStream.java +++ b/sdk/storage/azure-storage-blob-nio/src/main/java/com/azure/storage/blob/nio/NioBlobOutputStream.java @@ -12,7 +12,7 @@ /** * Provides an OutputStream to write to a file stored as an Azure Blob. */ -public class NioBlobOutputStream extends OutputStream { +public final class NioBlobOutputStream extends OutputStream { private final ClientLogger logger = new ClientLogger(NioBlobOutputStream.class); private final BlobOutputStream blobOutputStream; diff --git a/sdk/storage/azure-storage-blob-nio/src/samples/java/com/azure/storage/blob/nio/ReadmeSamples.java b/sdk/storage/azure-storage-blob-nio/src/samples/java/com/azure/storage/blob/nio/ReadmeSamples.java index 004d5cfd1e1e9..88c9ded9f25a5 100644 --- a/sdk/storage/azure-storage-blob-nio/src/samples/java/com/azure/storage/blob/nio/ReadmeSamples.java +++ b/sdk/storage/azure-storage-blob-nio/src/samples/java/com/azure/storage/blob/nio/ReadmeSamples.java @@ -37,8 +37,9 @@ public ReadmeSamples() throws URISyntaxException, IOException { public void createAFileSystem() throws URISyntaxException, IOException { Map config = new HashMap<>(); + String[] stores = {""); - config.put(AzureFileSystem.AZURE_STORAGE_FILE_STORES, ""); + config.put(AzureFileSystem.AZURE_STORAGE_FILE_STORES, stores); FileSystem myFs = FileSystems.newFileSystem(new URI("azb://?account= Date: Wed, 15 Jul 2020 11:06:28 -0700 Subject: [PATCH 121/129] Implemented ORS List Blobs (#13096) --- .../blob/implementation/util/ModelHelper.java | 50 +++++--- .../azure/storage/blob/models/BlobItem.java | 52 ++------- .../blob/models/BlobItemProperties.java | 7 -- .../storage/blob/ContainerAPITest.groovy | 78 +++++++++++++ .../ContainerAPITestlistblobsflators.json | 107 ++++++++++++++++++ .../ContainerAPITestlistblobshierors.json | 107 ++++++++++++++++++ 6 files changed, 336 insertions(+), 65 deletions(-) create mode 100644 sdk/storage/azure-storage-blob/src/test/resources/session-records/ContainerAPITestlistblobsflators.json create mode 100644 sdk/storage/azure-storage-blob/src/test/resources/session-records/ContainerAPITestlistblobshierors.json diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/util/ModelHelper.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/util/ModelHelper.java index 5de41dd10a21e..5d8b837b8e00a 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/util/ModelHelper.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/util/ModelHelper.java @@ -202,6 +202,9 @@ public static BlobItem populateBlobItem(BlobItemInternal blobItemInternal) { } blobItem.setTags(tags); + blobItem.setObjectReplicationSourcePolicies( + transformObjectReplicationMetadata(blobItemInternal.getObjectReplicationMetadata())); + return blobItem; } @@ -247,25 +250,36 @@ public static BlobItemProperties populateBlobItemProperties(BlobItemPropertiesIn blobItemProperties.setAccessTierChangeTime(blobItemPropertiesInternal.getAccessTierChangeTime()); blobItemProperties.setTagCount(blobItemPropertiesInternal.getTagCount()); - // TODO: (rickle-msft) Uncomment when these properties are returned on lists. - /*this.objectReplicationSourcePolicies = new HashMap<>(); - this.objectReplicationDestinationPolicyId = objectReplicationStatus.getOrDefault("policy-id", null); - if (objectReplicationDestinationPolicyId == null) { - for (String str : objectReplicationStatus.keySet()) { - String[] split = str.split("_"); - String policyId = split[0]; - String ruleId = split[1]; - if (objectReplicationSourcePolicies.containsKey(policyId)) { - objectReplicationSourcePolicies.get(policyId) - .putRuleAndStatus(ruleId, objectReplicationStatus.get(str)); - } else { - ObjectReplicationPolicy policy = new ObjectReplicationPolicy(policyId); - policy.putRuleAndStatus(ruleId, objectReplicationStatus.get(str)); - objectReplicationSourcePolicies.put(policyId, policy); - } + return blobItemProperties; + } + + private static List transformObjectReplicationMetadata( + Map objectReplicationMetadata) { + + Map> internalSourcePolicies = new HashMap<>(); + objectReplicationMetadata = objectReplicationMetadata == null ? new HashMap<>() : objectReplicationMetadata; + for (Map.Entry entry : objectReplicationMetadata.entrySet()) { + String orString = entry.getKey(); + String str = orString.startsWith("or-") ? orString.substring(3) : orString; + String[] split = str.split("_"); + String policyId = split[0]; + String ruleId = split[1]; + ObjectReplicationRule rule = new ObjectReplicationRule(ruleId, + ObjectReplicationStatus.fromString(entry.getValue())); + if (!internalSourcePolicies.containsKey(policyId)) { + internalSourcePolicies.put(policyId, new ArrayList<>()); } - }*/ + internalSourcePolicies.get(policyId).add(rule); + } - return blobItemProperties; + if (internalSourcePolicies.isEmpty()) { + return null; + } + List objectReplicationSourcePolicies = new ArrayList<>(); + for (Map.Entry> entry : internalSourcePolicies.entrySet()) { + objectReplicationSourcePolicies.add(new ObjectReplicationPolicy(entry.getKey(), entry.getValue())); + } + return objectReplicationSourcePolicies; } + } diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobItem.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobItem.java index 24c0072d6782d..8d7f452f37388 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobItem.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobItem.java @@ -8,6 +8,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement; +import java.util.List; import java.util.Map; /** @@ -57,17 +58,11 @@ public final class BlobItem { private Boolean isCurrentVersion; - /* - * The objectReplicationPolicyId property. - */ - @JsonProperty(value = "ObjectReplicationPolicyId") - private String objectReplicationPolicyId; - /* * The objectReplicationRuleStatus property. */ @JsonProperty(value = "BlobObjectReplicationRuleStatus") - private Map objectReplicationRuleStatus; + private List objectReplicationSourcePolicies; /* * The isPrefix property. @@ -236,48 +231,25 @@ public BlobItem setCurrentVersion(Boolean isCurrentVersion) { } /** - * Get the objectReplicationPolicyId property: The - * objectReplicationPolicyId property. - * - * @return the objectReplicationPolicyId value. - */ - public String getObjectReplicationPolicyId() { - return this.objectReplicationPolicyId; - } - - /** - * Set the objectReplicationPolicyId property: The - * objectReplicationPolicyId property. - * - * @param objectReplicationPolicyId the objectReplicationPolicyId value to - * set. - * @return the BlobItem object itself. - */ - public BlobItem setObjectReplicationPolicyId(String objectReplicationPolicyId) { - this.objectReplicationPolicyId = objectReplicationPolicyId; - return this; - } - - /** - * Get the objectReplicationRuleStatus property: The - * objectReplicationRuleStatus property. + * Get the objectReplicationSourcePolicies property: The + * objectReplicationSourcePolicies property. * - * @return the objectReplicationRuleStatus value. + * @return the objectReplicationSourcePolicies value. */ - public Map getObjectReplicationRuleStatus() { - return this.objectReplicationRuleStatus; + public List getObjectReplicationSourcePolicies() { + return this.objectReplicationSourcePolicies; } /** - * Set the objectReplicationRuleStatus property: The - * objectReplicationRuleStatus property. + * Set the objectReplicationSourcePolicies property: The + * objectReplicationSourcePolicies property. * - * @param objectReplicationRuleStatus the objectReplicationRuleStatus value + * @param objectReplicationSourcePolicies the objectReplicationSourcePolicies value * to set. * @return the BlobItem object itself. */ - public BlobItem setObjectReplicationRuleStatus(Map objectReplicationRuleStatus) { - this.objectReplicationRuleStatus = objectReplicationRuleStatus; + public BlobItem setObjectReplicationSourcePolicies(List objectReplicationSourcePolicies) { + this.objectReplicationSourcePolicies = objectReplicationSourcePolicies; return this; } diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobItemProperties.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobItemProperties.java index fedca0cb3a098..877ca109e2496 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobItemProperties.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobItemProperties.java @@ -212,13 +212,6 @@ public final class BlobItemProperties { @JsonProperty(value = "AccessTierChangeTime") private OffsetDateTime accessTierChangeTime; - // TODO: (rickle-msft) uncomment when these are returned on lists. - /* - private Map objectReplicationSourcePolicies; - - private String objectReplicationDestinationPolicyId; - */ - /* * The tagCount property. */ diff --git a/sdk/storage/azure-storage-blob/src/test/java/com/azure/storage/blob/ContainerAPITest.groovy b/sdk/storage/azure-storage-blob/src/test/java/com/azure/storage/blob/ContainerAPITest.groovy index 3bd7fd98bb069..ca0004a8bdc21 100644 --- a/sdk/storage/azure-storage-blob/src/test/java/com/azure/storage/blob/ContainerAPITest.groovy +++ b/sdk/storage/azure-storage-blob/src/test/java/com/azure/storage/blob/ContainerAPITest.groovy @@ -20,12 +20,15 @@ import com.azure.storage.blob.models.CustomerProvidedKey import com.azure.storage.blob.models.LeaseStateType import com.azure.storage.blob.models.LeaseStatusType import com.azure.storage.blob.models.ListBlobsOptions +import com.azure.storage.blob.models.ObjectReplicationPolicy +import com.azure.storage.blob.models.ObjectReplicationStatus import com.azure.storage.blob.options.PageBlobCreateOptions import com.azure.storage.blob.models.PublicAccessType import com.azure.storage.blob.specialized.AppendBlobClient import com.azure.storage.blob.specialized.BlobClientBase import com.azure.storage.common.Utility import reactor.test.StepVerifier +import spock.lang.Requires import spock.lang.Unroll import java.time.Duration @@ -983,6 +986,50 @@ class ContainerAPITest extends APISpec { notThrown(Exception) } + /* + This test requires two accounts that are configured in a very specific way. It is not feasible to setup that + relationship programmatically, so we have recorded a successful interaction and only test recordings. + */ + @Requires( {playbackMode()}) + def "List blobs flat ORS"() { + setup: + def sourceContainer = primaryBlobServiceClient.getBlobContainerClient("test1") + def destContainer = alternateBlobServiceClient.getBlobContainerClient("test2") + + when: + def sourceBlobs = sourceContainer.listBlobs().stream().collect(Collectors.toList()) + def destBlobs = destContainer.listBlobs().stream().collect(Collectors.toList()) + + then: + int i = 0 + for (def blob : sourceBlobs) { + if (i == 1) { + assert blob.getObjectReplicationSourcePolicies() == null + } else { + assert validateOR(blob.getObjectReplicationSourcePolicies(), "fd2da1b9-56f5-45ff-9eb6-310e6dfc2c80", "105f9aad-f39b-4064-8e47-ccd7937295ca") + } + i++ + } + + /* Service specifies no ors metadata on the dest blobs. */ + for (def blob : destBlobs) { + assert blob.getObjectReplicationSourcePolicies() == null + } + } + + def validateOR(List policies, String policyId, String ruleId) { + return policies.stream() + .filter({ policy -> policyId.equals(policy.getPolicyId()) }) + .findFirst() + .get() + .getRules() + .stream() + .filter({ rule -> ruleId.equals(rule.getRuleId()) }) + .findFirst() + .get() + .getStatus() == ObjectReplicationStatus.COMPLETE + } + def "List blobs hierarchy"() { setup: def name = generateBlobName() @@ -1226,6 +1273,37 @@ class ContainerAPITest extends APISpec { secondPage.getContinuationToken() == null } + /* + This test requires two accounts that are configured in a very specific way. It is not feasible to setup that + relationship programmatically, so we have recorded a successful interaction and only test recordings. + */ + @Requires( {playbackMode()}) + def "List blobs hier ORS"() { + setup: + def sourceContainer = primaryBlobServiceClient.getBlobContainerClient("test1") + def destContainer = alternateBlobServiceClient.getBlobContainerClient("test2") + + when: + def sourceBlobs = sourceContainer.listBlobsByHierarchy("/").stream().collect(Collectors.toList()) + def destBlobs = destContainer.listBlobsByHierarchy("/").stream().collect(Collectors.toList()) + + then: + int i = 0 + for (def blob : sourceBlobs) { + if (i == 1) { + assert blob.getObjectReplicationSourcePolicies() == null + } else { + assert validateOR(blob.getObjectReplicationSourcePolicies(), "fd2da1b9-56f5-45ff-9eb6-310e6dfc2c80", "105f9aad-f39b-4064-8e47-ccd7937295ca") + } + i++ + } + + /* Service specifies no ors metadata on the dest blobs. */ + for (def blob : destBlobs) { + assert blob.getObjectReplicationSourcePolicies() == null + } + } + def "List blobs flat simple"() { setup: "Create 10 page blobs in the container" def NUM_BLOBS = 10 diff --git a/sdk/storage/azure-storage-blob/src/test/resources/session-records/ContainerAPITestlistblobsflators.json b/sdk/storage/azure-storage-blob/src/test/resources/session-records/ContainerAPITestlistblobsflators.json new file mode 100644 index 0000000000000..9803f8fd4babc --- /dev/null +++ b/sdk/storage/azure-storage-blob/src/test/resources/session-records/ContainerAPITestlistblobsflators.json @@ -0,0 +1,107 @@ +{ + "networkCallRecords" : [ { + "Method" : "PUT", + "Uri" : "https://REDACTED.blob.core.windows.net/jtclistblobsflators0containerapitestlistblobsflatorsa59637709?restype=container", + "Headers" : { + "x-ms-version" : "2019-12-12", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.2 (11.0.7; Windows 10; 10.0)", + "x-ms-client-request-id" : "d07024dd-1f41-4c49-9df9-1b1b39c9fdc6" + }, + "Response" : { + "x-ms-version" : "2019-12-12", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "ETag" : "0x8D82784272BC411", + "Last-Modified" : "Mon, 13 Jul 2020 23:26:21 GMT", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "dadc1a5e-601e-005d-3e6d-594724000000", + "Date" : "Mon, 13 Jul 2020 23:26:21 GMT", + "x-ms-client-request-id" : "d07024dd-1f41-4c49-9df9-1b1b39c9fdc6" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.blob.core.windows.net/test1?restype=container&comp=list", + "Headers" : { + "x-ms-version" : "2019-12-12", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.2 (11.0.7; Windows 10; 10.0)", + "x-ms-client-request-id" : "2407cee4-8724-45f8-9035-566088ae4def" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-12-12", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "a7f8263e-301e-007f-386d-59823b000000", + "Body" : "bla.txt2020-05-18T09:53:04.5502688ZtrueMon, 18 May 2020 09:53:04 GMTMon, 18 May 2020 09:53:04 GMT0x8D7FB114288CFC90application/octet-stream1B2M2Y8AsgTpgAmY7PhCfg==BlockBlobHottrueunlockedavailabletruecompleteempty.txt2020-03-19T18:21:09.4878662ZtrueThu, 19 Mar 2020 18:21:09 GMTThu, 19 Mar 2020 18:21:09 GMT0x8D7CC324C3049C60text/plain1B2M2Y8AsgTpgAmY7PhCfg==BlockBlobHottrueunlockedavailabletrueempty2.txt2020-03-19T18:36:03.0870309ZtrueThu, 19 Mar 2020 18:36:03 GMTThu, 19 Mar 2020 18:36:03 GMT0x8D7CC3460D0B3250text/plain1B2M2Y8AsgTpgAmY7PhCfg==BlockBlobHottrueunlockedavailabletruecompletejavablobgetpropertiesors2blobapitestgetpropertiesors57d93407b2020-04-21T21:14:42.3905881ZtrueTue, 21 Apr 2020 21:14:42 GMTTue, 21 Apr 2020 21:14:42 GMT0x8D7E6390264E6597application/octet-streamwh+Wm18D0z1D4E+PE252gg==BlockBlobHottrueunlockedavailabletruecompletejavablobgetpropertiesors2blobapitestgetpropertiesorsa300090272020-04-21T21:12:08.2403198ZtrueTue, 21 Apr 2020 21:12:08 GMTTue, 21 Apr 2020 21:12:08 GMT0x8D7E638A68348677application/octet-streamwh+Wm18D0z1D4E+PE252gg==BlockBlobHottrueunlockedavailabletruecompletenetgetpropertiesors2blobapitestgetpropertiesors2020-04-23T22:04:56.9882747ZtrueThu, 23 Apr 2020 22:04:56 GMTThu, 23 Apr 2020 22:04:56 GMT0x8D7E7D25C0F807B1024application/octet-streameyObQAWrMwC74Eh3CuRM2g==BlockBlobHottrueunlockedavailabletruecompletepythonorstest2020-05-19T08:19:55.0147367ZtrueTue, 19 May 2020 08:19:55 GMTTue, 19 May 2020 08:19:55 GMT0x8D7FBCD695347271024application/octet-streameyObQAWrMwC74Eh3CuRM2g==BlockBlobHottrueunlockedavailabletruecompletetest-blob-19f4217a-3814-436b-a70d-3be4b0c604e22020-04-15T09:03:31.2849799ZtrueWed, 15 Apr 2020 09:03:31 GMTWed, 15 Apr 2020 09:03:31 GMT0x8D7E11BDEB2C86B1024application/octet-streamsVLUBL9mQUUJgLz3ayOPnw==BlockBlobHottrueunlockedavailabletruecomplete", + "Date" : "Mon, 13 Jul 2020 23:26:21 GMT", + "x-ms-client-request-id" : "2407cee4-8724-45f8-9035-566088ae4def", + "Content-Type" : "application/xml" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.blob.core.windows.net/test2?restype=container&comp=list", + "Headers" : { + "x-ms-version" : "2019-12-12", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.2 (11.0.7; Windows 10; 10.0)", + "x-ms-client-request-id" : "5153d2bc-ef9a-469c-98b8-4245ff663d0e" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-12-12", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "6d9b466f-a01e-0084-4f6d-59a8c3000000", + "Body" : "bla.txtMon, 18 May 2020 09:55:04 GMTMon, 18 May 2020 09:55:04 GMT0x8D7FB118A463E240application/octet-streamAAAAAAAAAAA=1B2M2Y8AsgTpgAmY7PhCfg==BlockBlobHottrueunlockedavailabletrueempty2.txtThu, 19 Mar 2020 18:37:06 GMTThu, 19 Mar 2020 18:37:06 GMT0x8D7CC3486E43BC60text/plainAAAAAAAAAAA=1B2M2Y8AsgTpgAmY7PhCfg==BlockBlobHottrueunlockedavailabletruejavablobgetpropertiesors2blobapitestgetpropertiesors57d93407b2020-04-21T21:15:42.8141548ZtrueTue, 21 Apr 2020 21:15:42 GMTTue, 21 Apr 2020 21:15:42 GMT0x8D7E6392667E1617application/octet-stream6RYQPwaVsyQ=wh+Wm18D0z1D4E+PE252gg==BlockBlobHottrueunlockedavailabletruejavablobgetpropertiesors2blobapitestgetpropertiesorsa30009027Tue, 21 Apr 2020 21:13:08 GMTTue, 21 Apr 2020 21:13:08 GMT0x8D7E638CA717B137application/octet-stream6RYQPwaVsyQ=wh+Wm18D0z1D4E+PE252gg==BlockBlobHottrueunlockedavailabletruenetgetpropertiesors2blobapitestgetpropertiesorsThu, 23 Apr 2020 22:06:35 GMTThu, 23 Apr 2020 22:06:35 GMT0x8D7E7D296E942361024application/octet-streammvPi4gbJB9o=eyObQAWrMwC74Eh3CuRM2g==BlockBlobHottrueunlockedavailabletruepythonorstest2020-05-19T08:22:07.2080089ZtrueTue, 19 May 2020 08:22:07 GMTTue, 19 May 2020 08:22:07 GMT0x8D7FBCDB81E37C01024application/octet-streamBlockBlobHottrueunlockedavailabletruetest-blob-19f4217a-3814-436b-a70d-3be4b0c604e22020-04-15T09:05:43.9282492ZtrueWed, 15 Apr 2020 09:05:43 GMTWed, 15 Apr 2020 09:05:43 GMT0x8D7E11C2DC2456B1024application/octet-stream94WCAc7HFGQ=sVLUBL9mQUUJgLz3ayOPnw==BlockBlobHottrueunlockedavailabletrue", + "Date" : "Mon, 13 Jul 2020 23:26:22 GMT", + "x-ms-client-request-id" : "5153d2bc-ef9a-469c-98b8-4245ff663d0e", + "Content-Type" : "application/xml" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.blob.core.windows.net?prefix=jtclistblobsflators&comp=list", + "Headers" : { + "x-ms-version" : "2019-12-12", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.2 (11.0.7; Windows 10; 10.0)", + "x-ms-client-request-id" : "e9a2dc50-309a-41e3-8eff-3fb70f3ca180" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-12-12", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "86a74d5c-d01e-0067-3f6d-595d5c000000", + "Body" : "jtclistblobsflatorsjtclistblobsflators0containerapitestlistblobsflatorsa59637709Mon, 13 Jul 2020 23:26:21 GMT\"0x8D82784272BC411\"unlockedavailable$account-encryption-keyfalsefalsefalse", + "Date" : "Mon, 13 Jul 2020 23:26:23 GMT", + "x-ms-client-request-id" : "e9a2dc50-309a-41e3-8eff-3fb70f3ca180", + "Content-Type" : "application/xml" + }, + "Exception" : null + }, { + "Method" : "DELETE", + "Uri" : "https://REDACTED.blob.core.windows.net/jtclistblobsflators0containerapitestlistblobsflatorsa59637709?restype=container", + "Headers" : { + "x-ms-version" : "2019-12-12", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.2 (11.0.7; Windows 10; 10.0)", + "x-ms-client-request-id" : "21e86bfe-fcb7-48ec-ad5c-433a92c2a17d" + }, + "Response" : { + "x-ms-version" : "2019-12-12", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "202", + "x-ms-request-id" : "ea0167d8-001e-0039-196d-59b6bc000000", + "Date" : "Mon, 13 Jul 2020 23:26:24 GMT", + "x-ms-client-request-id" : "21e86bfe-fcb7-48ec-ad5c-433a92c2a17d" + }, + "Exception" : null + } ], + "variables" : [ "jtclistblobsflators0containerapitestlistblobsflatorsa59637709" ] +} \ No newline at end of file diff --git a/sdk/storage/azure-storage-blob/src/test/resources/session-records/ContainerAPITestlistblobshierors.json b/sdk/storage/azure-storage-blob/src/test/resources/session-records/ContainerAPITestlistblobshierors.json new file mode 100644 index 0000000000000..9ec76ca0880e1 --- /dev/null +++ b/sdk/storage/azure-storage-blob/src/test/resources/session-records/ContainerAPITestlistblobshierors.json @@ -0,0 +1,107 @@ +{ + "networkCallRecords" : [ { + "Method" : "PUT", + "Uri" : "https://REDACTED.blob.core.windows.net/jtclistblobshierors0containerapitestlistblobshierors3d8486925?restype=container", + "Headers" : { + "x-ms-version" : "2019-12-12", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.2 (11.0.7; Windows 10; 10.0)", + "x-ms-client-request-id" : "6440d54d-c90b-4c72-85a6-44d65ec36c9b" + }, + "Response" : { + "x-ms-version" : "2019-12-12", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "ETag" : "0x8D8278470455EF4", + "Last-Modified" : "Mon, 13 Jul 2020 23:28:24 GMT", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "4929ce18-701e-001c-236d-591fc0000000", + "Date" : "Mon, 13 Jul 2020 23:28:24 GMT", + "x-ms-client-request-id" : "6440d54d-c90b-4c72-85a6-44d65ec36c9b" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.blob.core.windows.net/test1?prefix=/&delimiter=/&restype=container&comp=list", + "Headers" : { + "x-ms-version" : "2019-12-12", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.2 (11.0.7; Windows 10; 10.0)", + "x-ms-client-request-id" : "179bfd9c-1189-48a6-93e5-8694a3ca545e" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-12-12", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "210c151d-301e-0022-726d-5988bf000000", + "Body" : "//", + "Date" : "Mon, 13 Jul 2020 23:28:24 GMT", + "x-ms-client-request-id" : "179bfd9c-1189-48a6-93e5-8694a3ca545e", + "Content-Type" : "application/xml" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.blob.core.windows.net/test2?prefix=/&delimiter=/&restype=container&comp=list", + "Headers" : { + "x-ms-version" : "2019-12-12", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.2 (11.0.7; Windows 10; 10.0)", + "x-ms-client-request-id" : "058cfb63-f0cb-432e-a3d9-eb41e2bab6a8" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-12-12", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "1e1044d0-d01e-0018-5d6d-5905a5000000", + "Body" : "//", + "Date" : "Mon, 13 Jul 2020 23:28:25 GMT", + "x-ms-client-request-id" : "058cfb63-f0cb-432e-a3d9-eb41e2bab6a8", + "Content-Type" : "application/xml" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.blob.core.windows.net?prefix=jtclistblobshierors&comp=list", + "Headers" : { + "x-ms-version" : "2019-12-12", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.2 (11.0.7; Windows 10; 10.0)", + "x-ms-client-request-id" : "d278b929-6978-4505-97ec-b3f060894a90" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-12-12", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "5c1900e6-201e-002e-656d-591fb7000000", + "Body" : "jtclistblobshierorsjtclistblobshierors0containerapitestlistblobshierors3d8486925Mon, 13 Jul 2020 23:28:24 GMT\"0x8D8278470455EF4\"unlockedavailable$account-encryption-keyfalsefalsefalse", + "Date" : "Mon, 13 Jul 2020 23:28:26 GMT", + "x-ms-client-request-id" : "d278b929-6978-4505-97ec-b3f060894a90", + "Content-Type" : "application/xml" + }, + "Exception" : null + }, { + "Method" : "DELETE", + "Uri" : "https://REDACTED.blob.core.windows.net/jtclistblobshierors0containerapitestlistblobshierors3d8486925?restype=container", + "Headers" : { + "x-ms-version" : "2019-12-12", + "User-Agent" : "azsdk-java-azure-storage-blob/12.8.0-beta.2 (11.0.7; Windows 10; 10.0)", + "x-ms-client-request-id" : "97729b9b-8a2a-481e-848e-0bd5cf61b945" + }, + "Response" : { + "x-ms-version" : "2019-12-12", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "202", + "x-ms-request-id" : "2458a4d8-f01e-0070-7d6d-59f457000000", + "Date" : "Mon, 13 Jul 2020 23:28:26 GMT", + "x-ms-client-request-id" : "97729b9b-8a2a-481e-848e-0bd5cf61b945" + }, + "Exception" : null + } ], + "variables" : [ "jtclistblobshierors0containerapitestlistblobshierors3d8486925" ] +} \ No newline at end of file From 6163d2c0601c83dc124aa3ec374a2e134974a1e0 Mon Sep 17 00:00:00 2001 From: Shawn Fang <45607042+mssfang@users.noreply.github.com> Date: Wed, 15 Jul 2020 13:17:05 -0700 Subject: [PATCH 122/129] Regenerated base code and all tests passed (#13153) * regenerated base code and all tests passed now, added service API version 3.1-preview.1 and updates tests --- .../AnalyzeSentimentAsyncClient.java | 13 +- .../DetectLanguageAsyncClient.java | 9 +- .../ExtractKeyPhraseAsyncClient.java | 11 +- .../RecognizeEntityAsyncClient.java | 11 +- .../RecognizeLinkedEntityAsyncClient.java | 11 +- .../TextAnalyticsClientBuilder.java | 2 +- .../TextAnalyticsServiceVersion.java | 5 +- .../TextAnalyticsClientImpl.java | 259 +++++++++--------- .../TextAnalyticsClientImplBuilder.java | 24 +- .../models/AspectConfidenceScoreLabel.java | 64 +++++ .../implementation/models/AspectRelation.java | 64 +++++ .../models/AspectRelationType.java | 34 +++ .../models/DetectedLanguage.java | 40 ++- .../models/DocumentEntities.java | 34 +-- .../implementation/models/DocumentError.java | 12 +- .../models/DocumentKeyPhrases.java | 44 ++- .../models/DocumentLanguage.java | 18 +- .../models/DocumentLinkedEntities.java | 40 ++- .../models/DocumentSentiment.java | 56 ++-- .../models/DocumentSentimentValue.java | 26 +- .../models/DocumentStatistics.java | 24 +- .../implementation/models/EntitiesResult.java | 34 +-- .../implementation/models/Entity.java | 62 ++--- .../models/EntityLinkingResult.java | 34 +-- .../implementation/models/ErrorCodeValue.java | 26 +- .../implementation/models/InnerError.java | 30 +- .../models/InnerErrorCodeValue.java | 46 +--- .../models/KeyPhraseResult.java | 34 +-- .../models/LanguageBatchInput.java | 8 +- .../implementation/models/LanguageInput.java | 16 +- .../implementation/models/LanguageResult.java | 34 +-- .../implementation/models/LinkedEntity.java | 46 ++-- .../implementation/models/Match.java | 46 ++-- .../models/MultiLanguageBatchInput.java | 14 +- .../models/MultiLanguageInput.java | 26 +- .../models/RequestStatistics.java | 50 ++-- .../implementation/models/SentenceAspect.java | 170 ++++++++++++ .../models/SentenceAspectSentiment.java | 37 +++ .../models/SentenceOpinion.java | 169 ++++++++++++ .../models/SentenceOpinionSentiment.java | 37 +++ .../models/SentenceSentiment.java | 99 +++++-- .../models/SentenceSentimentValue.java | 22 +- .../SentimentConfidenceScorePerLabel.java | 16 +- .../models/SentimentResponse.java | 34 +-- .../models/TextAnalyticsError.java | 36 +-- .../models/TextAnalyticsErrorException.java | 8 +- .../models/TextAnalyticsWarning.java | 22 +- .../models/WarningCodeValue.java | 18 +- .../implementation/models/package-info.java | 13 +- .../implementation/package-info.java | 14 +- .../TextAnalyticsAsyncClientTest.java | 31 ++- .../analyzeSentimentDuplicateIdInput.json | 14 +- .../analyzeSentimentForBatchInput.json | 14 +- ...eSentimentForBatchInputShowStatistics.json | 14 +- .../analyzeSentimentForBatchStringInput.json | 14 +- .../analyzeSentimentForEmptyText.json | 14 +- .../analyzeSentimentForFaultyText.json | 14 +- .../analyzeSentimentForListLanguageHint.json | 14 +- ...lyzeSentimentForListStringWithOptions.json | 14 +- .../analyzeSentimentForTextInput.json | 14 +- .../clientBuilderWithDefaultCountryHint.json | 12 +- ...thDefaultCountryHintForBatchOperation.json | 12 +- .../clientBuilderWithDefaultLanguage.json | 12 +- ...rWithDefaultLanguageForBatchOperation.json | 12 +- .../clientBuilderWithDefaultPipeline.json | 12 +- ...entBuilderWithInvalidApiKeyCredential.json | 17 +- .../clientBuilderWithNewCountryHint.json | 12 +- ...erWithNewCountryHintForBatchOperation.json | 12 +- .../clientBuilderWithNewLanguage.json | 12 +- ...ilderWithNewLanguageForBatchOperation.json | 12 +- .../clientBuilderWithNullServiceVersion.json | 12 +- .../clientBuilderWithRotateToInvalidKey.json | 17 +- .../clientBuilderWithRotateToValidKey.json | 12 +- ...lientBuilderWithValidApiKeyCredential.json | 12 +- .../detectLanguageDuplicateIdInput.json | 14 +- .../detectLanguageEmptyCountryHint.json | 12 +- .../detectLanguageEmptyText.json | 13 +- .../detectLanguageFaultyText.json | 12 +- .../detectLanguageInvalidCountryHint.json | 13 +- .../detectLanguageNoneCountryHint.json | 12 +- .../detectLanguagesBatchInput.json | 12 +- ...tectLanguagesBatchInputShowStatistics.json | 12 +- ...tLanguagesBatchInputShowStatisticsNew.json | 27 -- .../detectLanguagesBatchListCountryHint.json | 12 +- ...guagesBatchListCountryHintWithOptions.json | 12 +- .../detectLanguagesBatchStringInput.json | 12 +- .../detectLanguagesBatchStringList.json | 27 -- .../detectSingleTextLanguage.json | 12 +- .../extractKeyPhrasesBatchWarning.json | 12 +- .../extractKeyPhrasesDuplicateIdInput.json | 14 +- .../extractKeyPhrasesForBatchInput.json | 12 +- ...KeyPhrasesForBatchInputShowStatistics.json | 12 +- .../extractKeyPhrasesForBatchStringInput.json | 12 +- .../extractKeyPhrasesForEmptyText.json | 12 +- .../extractKeyPhrasesForFaultyText.json | 10 +- .../extractKeyPhrasesForListLanguageHint.json | 12 +- ...actKeyPhrasesForListStringWithOptions.json | 12 +- .../extractKeyPhrasesForTextInput.json | 12 +- .../extractKeyPhrasesWarning.json | 12 +- ...ecognizeEntitiesBatchInputSingleError.json | 12 +- .../recognizeEntitiesDuplicateIdInput.json | 14 +- .../recognizeEntitiesForBatchInput.json | 14 +- ...zeEntitiesForBatchInputShowStatistics.json | 14 +- .../recognizeEntitiesForBatchStringInput.json | 14 +- .../recognizeEntitiesForEmptyText.json | 12 +- .../recognizeEntitiesForFaultyText.json | 12 +- .../recognizeEntitiesForListLanguageHint.json | 14 +- .../recognizeEntitiesForListWithOptions.json | 14 +- .../recognizeEntitiesForTextInput.json | 14 +- .../recognizeEntitiesTooManyDocuments.json | 12 +- ...cognizeLinkedEntitiesDuplicateIdInput.json | 14 +- .../recognizeLinkedEntitiesForBatchInput.json | 14 +- ...edEntitiesForBatchInputShowStatistics.json | 14 +- ...nizeLinkedEntitiesForBatchStringInput.json | 14 +- .../recognizeLinkedEntitiesForEmptyText.json | 12 +- .../recognizeLinkedEntitiesForFaultyText.json | 12 +- ...nizeLinkedEntitiesForListLanguageHint.json | 14 +- ...inkedEntitiesForListStringWithOptions.json | 14 +- .../recognizeLinkedEntitiesForTextInput.json | 14 +- ...cognizeLinkedEntitiesTooManyDocuments.json | 10 +- .../azure-ai-textanalytics/swagger/README.md | 2 +- 121 files changed, 1664 insertions(+), 1287 deletions(-) create mode 100644 sdk/textanalytics/azure-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/implementation/models/AspectConfidenceScoreLabel.java create mode 100644 sdk/textanalytics/azure-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/implementation/models/AspectRelation.java create mode 100644 sdk/textanalytics/azure-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/implementation/models/AspectRelationType.java create mode 100644 sdk/textanalytics/azure-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/implementation/models/SentenceAspect.java create mode 100644 sdk/textanalytics/azure-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/implementation/models/SentenceAspectSentiment.java create mode 100644 sdk/textanalytics/azure-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/implementation/models/SentenceOpinion.java create mode 100644 sdk/textanalytics/azure-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/implementation/models/SentenceOpinionSentiment.java delete mode 100644 sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/detectLanguagesBatchInputShowStatisticsNew.json delete mode 100644 sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/detectLanguagesBatchStringList.json diff --git a/sdk/textanalytics/azure-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/AnalyzeSentimentAsyncClient.java b/sdk/textanalytics/azure-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/AnalyzeSentimentAsyncClient.java index cc0ad672ecd80..19e30d65f6aa1 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/AnalyzeSentimentAsyncClient.java +++ b/sdk/textanalytics/azure-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/AnalyzeSentimentAsyncClient.java @@ -105,12 +105,12 @@ Mono> analyzeSentimentBatchWithContex * Helper method to convert the service response of {@link SentimentResponse} to {@link Response} that contains * {@link AnalyzeSentimentResultCollection}. * - * @param response The {@link SimpleResponse} of {@link SentimentResponse} returned by the service. + * @param response The {@link Response} of {@link SentimentResponse} returned by the service. * * @return A {@link Response} contains {@link AnalyzeSentimentResultCollection}. */ private Response toAnalyzeSentimentResultCollectionResponse( - SimpleResponse response) { + Response response) { final SentimentResponse sentimentResponse = response.getValue(); final List analyzeSentimentResults = new ArrayList<>(); for (DocumentSentiment documentSentiment : sentimentResponse.getDocuments()) { @@ -125,7 +125,8 @@ private Response toAnalyzeSentimentResultColle if (documentError.getId().isEmpty()) { throw logger.logExceptionAsError( new HttpResponseException(documentError.getError().getInnererror().getMessage(), - getEmptyErrorIdHttpResponse(response), documentError.getError().getInnererror().getCode())); + getEmptyErrorIdHttpResponse(new SimpleResponse<>(response, response.getValue())), + documentError.getError().getInnererror().getCode())); } analyzeSentimentResults.add(new AnalyzeSentimentResult(documentError.getId(), null, toTextAnalyticsError(documentError.getError()), null)); @@ -194,11 +195,13 @@ private AnalyzeSentimentResult convertToAnalyzeSentimentResult(DocumentSentiment */ private Mono> getAnalyzedSentimentResponse( Iterable documents, TextAnalyticsRequestOptions options, Context context) { + // TODO: add opinion mining in the following PR return service.sentimentWithResponseAsync( new MultiLanguageBatchInput().setDocuments(toMultiLanguageInput(documents)), - context.addData(AZ_TRACING_NAMESPACE_KEY, COGNITIVE_TRACING_NAMESPACE_VALUE), options == null ? null : options.getModelVersion(), - options == null ? null : options.isIncludeStatistics()) + options == null ? null : options.isIncludeStatistics(), + null, + context.addData(AZ_TRACING_NAMESPACE_KEY, COGNITIVE_TRACING_NAMESPACE_VALUE)) .doOnSubscribe(ignoredValue -> logger.info("A batch of documents - {}", documents.toString())) .doOnSuccess(response -> logger.info("Analyzed sentiment for a batch of documents - {}", response)) .doOnError(error -> logger.warning("Failed to analyze sentiment - {}", error)) diff --git a/sdk/textanalytics/azure-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/DetectLanguageAsyncClient.java b/sdk/textanalytics/azure-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/DetectLanguageAsyncClient.java index 942844ba1ff25..67a844cb18590 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/DetectLanguageAsyncClient.java +++ b/sdk/textanalytics/azure-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/DetectLanguageAsyncClient.java @@ -103,7 +103,7 @@ Mono> detectLanguageBatchWithContext( * @return A {@link Response} that contains {@link DetectLanguageResultCollection}. */ private Response toTextAnalyticsResultDocumentResponse( - SimpleResponse response) { + Response response) { final LanguageResult languageResult = response.getValue(); final List detectLanguageResults = new ArrayList<>(); for (DocumentLanguage documentLanguage : languageResult.getDocuments()) { @@ -138,7 +138,8 @@ private Response toTextAnalyticsResultDocumentRe if (documentError.getId().isEmpty()) { throw logger.logExceptionAsError( new HttpResponseException(documentError.getError().getInnererror().getMessage(), - getEmptyErrorIdHttpResponse(response), documentError.getError().getInnererror().getCode())); + getEmptyErrorIdHttpResponse(new SimpleResponse<>(response, response.getValue())), + documentError.getError().getInnererror().getCode())); } detectLanguageResults.add(new DetectLanguageResult(documentError.getId(), null, @@ -164,9 +165,9 @@ private Mono> getDetectedLanguageRespon Iterable documents, TextAnalyticsRequestOptions options, Context context) { return service.languagesWithResponseAsync( new LanguageBatchInput().setDocuments(toLanguageInput(documents)), - context.addData(AZ_TRACING_NAMESPACE_KEY, COGNITIVE_TRACING_NAMESPACE_VALUE), options == null ? null : options.getModelVersion(), - options == null ? null : options.isIncludeStatistics()) + options == null ? null : options.isIncludeStatistics(), + context.addData(AZ_TRACING_NAMESPACE_KEY, COGNITIVE_TRACING_NAMESPACE_VALUE)) .doOnSubscribe(ignoredValue -> logger.info("A batch of documents - {}", documents.toString())) .doOnSuccess(response -> logger.info("Detected languages for a batch of documents - {}", response.getValue())) diff --git a/sdk/textanalytics/azure-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/ExtractKeyPhraseAsyncClient.java b/sdk/textanalytics/azure-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/ExtractKeyPhraseAsyncClient.java index 28bc6dd54f594..a5644deaa97c4 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/ExtractKeyPhraseAsyncClient.java +++ b/sdk/textanalytics/azure-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/ExtractKeyPhraseAsyncClient.java @@ -135,12 +135,12 @@ Mono> extractKeyPhrasesBatchWithCont * Helper method to convert the service response of {@link KeyPhraseResult} to {@link Response} * which contains {@link ExtractKeyPhrasesResultCollection}. * - * @param response the {@link SimpleResponse} returned by the service. + * @param response the {@link Response} returned by the service. * * @return A {@link Response} which contains {@link ExtractKeyPhrasesResultCollection}. */ private Response toExtractKeyPhrasesResultCollectionResponse( - final SimpleResponse response) { + final Response response) { final KeyPhraseResult keyPhraseResult = response.getValue(); // List of documents results final List keyPhraseResultList = new ArrayList<>(); @@ -169,7 +169,8 @@ private Response toExtractKeyPhrasesResultCol if (documentError.getId().isEmpty()) { throw logger.logExceptionAsError( new HttpResponseException(documentError.getError().getInnererror().getMessage(), - getEmptyErrorIdHttpResponse(response), documentError.getError().getInnererror().getCode())); + getEmptyErrorIdHttpResponse(new SimpleResponse<>(response, response.getValue())), + documentError.getError().getInnererror().getCode())); } final TextAnalyticsError error = toTextAnalyticsError(documentError.getError()); @@ -198,9 +199,9 @@ private Mono> getExtractedKeyPhrases Iterable documents, TextAnalyticsRequestOptions options, Context context) { return service.keyPhrasesWithResponseAsync( new MultiLanguageBatchInput().setDocuments(toMultiLanguageInput(documents)), - context.addData(AZ_TRACING_NAMESPACE_KEY, COGNITIVE_TRACING_NAMESPACE_VALUE), options == null ? null : options.getModelVersion(), - options == null ? null : options.isIncludeStatistics()) + options == null ? null : options.isIncludeStatistics(), + context.addData(AZ_TRACING_NAMESPACE_KEY, COGNITIVE_TRACING_NAMESPACE_VALUE)) .doOnSubscribe(ignoredValue -> logger.info("A batch of document - {}", documents.toString())) .doOnSuccess(response -> logger.info("A batch of key phrases output - {}", response.getValue())) .doOnError(error -> logger.warning("Failed to extract key phrases - {}", error)) diff --git a/sdk/textanalytics/azure-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/RecognizeEntityAsyncClient.java b/sdk/textanalytics/azure-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/RecognizeEntityAsyncClient.java index 30a026f24a6d2..0ec5fadddcc8f 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/RecognizeEntityAsyncClient.java +++ b/sdk/textanalytics/azure-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/RecognizeEntityAsyncClient.java @@ -133,12 +133,12 @@ Mono> recognizeEntitiesBatchWithCont * Helper method to convert the service response of {@link EntitiesResult} to {@link Response} which contains * {@link RecognizeEntitiesResultCollection}. * - * @param response the {@link SimpleResponse} of {@link EntitiesResult} returned by the service. + * @param response the {@link Response} of {@link EntitiesResult} returned by the service. * * @return A {@link Response} that contains {@link RecognizeEntitiesResultCollection}. */ private Response toRecognizeEntitiesResultCollectionResponse( - final SimpleResponse response) { + final Response response) { EntitiesResult entitiesResult = response.getValue(); // List of documents results List recognizeEntitiesResults = new ArrayList<>(); @@ -171,7 +171,8 @@ private Response toRecognizeEntitiesResultCol if (documentError.getId().isEmpty()) { throw logger.logExceptionAsError( new HttpResponseException(documentError.getError().getInnererror().getMessage(), - getEmptyErrorIdHttpResponse(response), documentError.getError().getInnererror().getCode())); + getEmptyErrorIdHttpResponse(new SimpleResponse<>(response, response.getValue())), + documentError.getError().getInnererror().getCode())); } recognizeEntitiesResults.add( @@ -198,9 +199,9 @@ private Mono> getRecognizedEntitiesR Iterable documents, TextAnalyticsRequestOptions options, Context context) { return service.entitiesRecognitionGeneralWithResponseAsync( new MultiLanguageBatchInput().setDocuments(toMultiLanguageInput(documents)), - context.addData(AZ_TRACING_NAMESPACE_KEY, COGNITIVE_TRACING_NAMESPACE_VALUE), options == null ? null : options.getModelVersion(), - options == null ? null : options.isIncludeStatistics()) + options == null ? null : options.isIncludeStatistics(), + context.addData(AZ_TRACING_NAMESPACE_KEY, COGNITIVE_TRACING_NAMESPACE_VALUE)) .doOnSubscribe(ignoredValue -> logger.info("A batch of documents - {}", documents.toString())) .doOnSuccess(response -> logger.info("Recognized entities for a batch of documents- {}", response.getValue())) diff --git a/sdk/textanalytics/azure-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/RecognizeLinkedEntityAsyncClient.java b/sdk/textanalytics/azure-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/RecognizeLinkedEntityAsyncClient.java index 035762c54c6b3..db1da00fc2106 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/RecognizeLinkedEntityAsyncClient.java +++ b/sdk/textanalytics/azure-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/RecognizeLinkedEntityAsyncClient.java @@ -135,12 +135,12 @@ Mono> recognizeLinkedEntitiesB * Helper method to convert the service response of {@link EntityLinkingResult} to * {@link Response} which contains {@link RecognizeLinkedEntitiesResultCollection}. * - * @param response the {@link SimpleResponse} of {@link EntityLinkingResult} returned by the service. + * @param response the {@link Response} of {@link EntityLinkingResult} returned by the service. * * @return A {@link Response} that contains {@link RecognizeLinkedEntitiesResultCollection}. */ private Response toRecognizeLinkedEntitiesResultCollectionResponse( - final SimpleResponse response) { + final Response response) { final EntityLinkingResult entityLinkingResult = response.getValue(); // List of documents results final List linkedEntitiesResults = new ArrayList<>(); @@ -170,7 +170,8 @@ private Response toRecognizeLinkedEntit if (documentError.getId().isEmpty()) { throw logger.logExceptionAsError( new HttpResponseException(documentError.getError().getInnererror().getMessage(), - getEmptyErrorIdHttpResponse(response), documentError.getError().getInnererror().getCode())); + getEmptyErrorIdHttpResponse(new SimpleResponse<>(response, response.getValue())), + documentError.getError().getInnererror().getCode())); } linkedEntitiesResults.add( @@ -213,9 +214,9 @@ private IterableStream mapLinkedEntity( Context context) { return service.entitiesLinkingWithResponseAsync( new MultiLanguageBatchInput().setDocuments(toMultiLanguageInput(documents)), - context.addData(AZ_TRACING_NAMESPACE_KEY, COGNITIVE_TRACING_NAMESPACE_VALUE), options == null ? null : options.getModelVersion(), - options == null ? null : options.isIncludeStatistics()) + options == null ? null : options.isIncludeStatistics(), + context.addData(AZ_TRACING_NAMESPACE_KEY, COGNITIVE_TRACING_NAMESPACE_VALUE)) .doOnSubscribe(ignoredValue -> logger.info("A batch of documents - {}", documents.toString())) .doOnSuccess(response -> logger.info("Recognized linked entities for a batch of documents - {}", response.getValue())) diff --git a/sdk/textanalytics/azure-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/TextAnalyticsClientBuilder.java b/sdk/textanalytics/azure-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/TextAnalyticsClientBuilder.java index b78dfeac66104..c1caf08b07855 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/TextAnalyticsClientBuilder.java +++ b/sdk/textanalytics/azure-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/TextAnalyticsClientBuilder.java @@ -200,7 +200,7 @@ public TextAnalyticsAsyncClient buildAsyncClient() { final TextAnalyticsClientImpl textAnalyticsAPI = new TextAnalyticsClientImplBuilder() .endpoint(endpoint) .pipeline(pipeline) - .build(); + .buildClient(); return new TextAnalyticsAsyncClient(textAnalyticsAPI, serviceVersion, defaultCountryHint, defaultLanguage); } diff --git a/sdk/textanalytics/azure-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/TextAnalyticsServiceVersion.java b/sdk/textanalytics/azure-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/TextAnalyticsServiceVersion.java index 0dff36a6128a6..b8367546eb42a 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/TextAnalyticsServiceVersion.java +++ b/sdk/textanalytics/azure-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/TextAnalyticsServiceVersion.java @@ -9,7 +9,8 @@ * The versions of Azure Text Analytics supported by this client library. */ public enum TextAnalyticsServiceVersion implements ServiceVersion { - V3_0("v3.0"); + V3_0("v3.0"), + V3_1_PREVIEW_1("v3.1-preview.1"); private final String version; @@ -31,7 +32,7 @@ public String getVersion() { * @return the latest {@link TextAnalyticsServiceVersion} */ public static TextAnalyticsServiceVersion getLatest() { - return V3_0; + return V3_1_PREVIEW_1; } } diff --git a/sdk/textanalytics/azure-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/implementation/TextAnalyticsClientImpl.java b/sdk/textanalytics/azure-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/implementation/TextAnalyticsClientImpl.java index 858589603bdcc..f285b7398e18d 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/implementation/TextAnalyticsClientImpl.java +++ b/sdk/textanalytics/azure-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/implementation/TextAnalyticsClientImpl.java @@ -27,272 +27,265 @@ import com.azure.core.http.policy.CookiePolicy; import com.azure.core.http.policy.RetryPolicy; import com.azure.core.http.policy.UserAgentPolicy; +import com.azure.core.http.rest.Response; import com.azure.core.http.rest.RestProxy; -import com.azure.core.http.rest.SimpleResponse; import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; import reactor.core.publisher.Mono; -/** - * Initializes a new instance of the TextAnalyticsClient type. - */ +/** Initializes a new instance of the TextAnalyticsClient type. */ public final class TextAnalyticsClientImpl { - /** - * The proxy service used to perform REST calls. - */ + /** The proxy service used to perform REST calls. */ private final TextAnalyticsClientService service; /** - * Supported Cognitive Services endpoints (protocol and hostname, for example: https://westus.api.cognitive.microsoft.com). + * Supported Cognitive Services endpoints (protocol and hostname, for example: + * https://westus.api.cognitive.microsoft.com). */ - private String endpoint; + private final String endpoint; /** - * Gets Supported Cognitive Services endpoints (protocol and hostname, for example: https://westus.api.cognitive.microsoft.com). - * + * Gets Supported Cognitive Services endpoints (protocol and hostname, for example: + * https://westus.api.cognitive.microsoft.com). + * * @return the endpoint value. */ public String getEndpoint() { 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 TextAnalyticsClientImpl setEndpoint(String endpoint) { - this.endpoint = endpoint; - return this; - } - - /** - * The HTTP pipeline to send requests through. - */ + /** The HTTP pipeline to send requests through. */ private final HttpPipeline httpPipeline; /** * Gets The HTTP pipeline to send requests through. - * + * * @return the httpPipeline value. */ public HttpPipeline getHttpPipeline() { return this.httpPipeline; } - /** - * Initializes an instance of TextAnalyticsClient client. - */ - public TextAnalyticsClientImpl() { - this(new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy(), new CookiePolicy()).build()); + /** Initializes an instance of TextAnalyticsClient client. */ + TextAnalyticsClientImpl(String endpoint) { + this( + new HttpPipelineBuilder() + .policies(new UserAgentPolicy(), new RetryPolicy(), new CookiePolicy()) + .build(), + endpoint); } /** * Initializes an instance of TextAnalyticsClient client. - * + * * @param httpPipeline The HTTP pipeline to send requests through. */ - public TextAnalyticsClientImpl(HttpPipeline httpPipeline) { + TextAnalyticsClientImpl(HttpPipeline httpPipeline, String endpoint) { this.httpPipeline = httpPipeline; + this.endpoint = endpoint; this.service = RestProxy.create(TextAnalyticsClientService.class, this.httpPipeline); } /** - * The interface defining all the services for TextAnalyticsClient to be - * used by the proxy service to perform REST calls. + * The interface defining all the services for TextAnalyticsClient to be used by the proxy service to perform REST + * calls. */ - @Host("{Endpoint}/text/analytics/v3.0") + @Host("{Endpoint}/text/analytics/v3.1-preview.1") @ServiceInterface(name = "TextAnalyticsClient") private interface TextAnalyticsClientService { @Post("/entities/recognition/general") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(TextAnalyticsErrorException.class) - Mono> entitiesRecognitionGeneral(@HostParam("Endpoint") String endpoint, @QueryParam("model-version") String modelVersion, @QueryParam("showStats") Boolean showStats, @BodyParam("application/json") MultiLanguageBatchInput input, Context context); + Mono> entitiesRecognitionGeneral( + @HostParam("Endpoint") String endpoint, + @QueryParam("model-version") String modelVersion, + @QueryParam("showStats") Boolean showStats, + @BodyParam("application/json") MultiLanguageBatchInput input, + Context context); + + @Post("/entities/recognition/pii") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(TextAnalyticsErrorException.class) + Mono> entitiesRecognitionPii( + @HostParam("Endpoint") String endpoint, + @QueryParam("model-version") String modelVersion, + @QueryParam("showStats") Boolean showStats, + @QueryParam("domain") String domain, + @BodyParam("application/json") MultiLanguageBatchInput input, + Context context); @Post("/entities/linking") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(TextAnalyticsErrorException.class) - Mono> entitiesLinking(@HostParam("Endpoint") String endpoint, @QueryParam("model-version") String modelVersion, @QueryParam("showStats") Boolean showStats, @BodyParam("application/json") MultiLanguageBatchInput input, Context context); + Mono> entitiesLinking( + @HostParam("Endpoint") String endpoint, + @QueryParam("model-version") String modelVersion, + @QueryParam("showStats") Boolean showStats, + @BodyParam("application/json") MultiLanguageBatchInput input, + Context context); @Post("/keyPhrases") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(TextAnalyticsErrorException.class) - Mono> keyPhrases(@HostParam("Endpoint") String endpoint, @QueryParam("model-version") String modelVersion, @QueryParam("showStats") Boolean showStats, @BodyParam("application/json") MultiLanguageBatchInput input, Context context); + Mono> keyPhrases( + @HostParam("Endpoint") String endpoint, + @QueryParam("model-version") String modelVersion, + @QueryParam("showStats") Boolean showStats, + @BodyParam("application/json") MultiLanguageBatchInput input, + Context context); @Post("/languages") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(TextAnalyticsErrorException.class) - Mono> languages(@HostParam("Endpoint") String endpoint, @QueryParam("model-version") String modelVersion, @QueryParam("showStats") Boolean showStats, @BodyParam("application/json") LanguageBatchInput input, Context context); + Mono> languages( + @HostParam("Endpoint") String endpoint, + @QueryParam("model-version") String modelVersion, + @QueryParam("showStats") Boolean showStats, + @BodyParam("application/json") LanguageBatchInput input, + Context context); @Post("/sentiment") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(TextAnalyticsErrorException.class) - Mono> sentiment(@HostParam("Endpoint") String endpoint, @QueryParam("model-version") String modelVersion, @QueryParam("showStats") Boolean showStats, @BodyParam("application/json") MultiLanguageBatchInput input, Context context); + Mono> sentiment( + @HostParam("Endpoint") String endpoint, + @QueryParam("model-version") String modelVersion, + @QueryParam("showStats") Boolean showStats, + @QueryParam("opinionMining") Boolean opinionMining, + @BodyParam("application/json") MultiLanguageBatchInput input, + Context context); } /** - * The API returns a list of general named entities in a given document. For the list of supported entity types, check <a href="https://aka.ms/taner">Supported Entity Types in Text Analytics API</a>. See the <a href="https://aka.ms/talangs">Supported languages in Text Analytics API</a> for the list of enabled languages. - * + * The API returns a list of general named entities in a given document. For the list of supported entity types, + * check <a href="https://aka.ms/taner">Supported Entity Types in Text Analytics API</a>. See the <a + * href="https://aka.ms/talangs">Supported languages in Text Analytics API</a> for the list of enabled + * languages. + * * @param input Contains a set of input documents to be analyzed by the service. - * @param modelVersion (Optional) This value indicates which model will be used for scoring. If a model-version is not specified, the API should default to the latest, non-preview version. + * @param modelVersion (Optional) This value indicates which model will be used for scoring. If a model-version is + * not specified, the API should default to the latest, non-preview version. * @param showStats (Optional) if set to true, response will contain input and document level statistics. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws TextAnalyticsErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> entitiesRecognitionGeneralWithResponseAsync(MultiLanguageBatchInput input, String modelVersion, Boolean showStats) { - return FluxUtil.withContext(context -> service.entitiesRecognitionGeneral(this.getEndpoint(), modelVersion, showStats, input, context)); - } - - /** - * The API returns a list of general named entities in a given document. For the list of supported entity types, check <a href="https://aka.ms/taner">Supported Entity Types in Text Analytics API</a>. See the <a href="https://aka.ms/talangs">Supported languages in Text Analytics API</a> for the list of enabled languages. - * - * @param input Contains a set of input documents to be analyzed by the service. * @param context The context to associate with this operation. - * @param modelVersion (Optional) This value indicates which model will be used for scoring. If a model-version is not specified, the API should default to the latest, non-preview version. - * @param showStats (Optional) if set to true, response will contain input and document level statistics. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws TextAnalyticsErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the response. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> entitiesRecognitionGeneralWithResponseAsync(MultiLanguageBatchInput input, Context context, String modelVersion, Boolean showStats) { + public Mono> entitiesRecognitionGeneralWithResponseAsync( + MultiLanguageBatchInput input, String modelVersion, Boolean showStats, Context context) { return service.entitiesRecognitionGeneral(this.getEndpoint(), modelVersion, showStats, input, context); } /** - * The API returns a list of recognized entities with links to a well-known knowledge base. See the <a href="https://aka.ms/talangs">Supported languages in Text Analytics API</a> for the list of enabled languages. - * + * The API returns a list of entities with personal information (\"SSN\", \"Bank Account\" etc) in the document. For + * the list of supported entity types, check <a href="https://aka.ms/tanerpii">Supported Entity Types in Text + * Analytics API</a>. See the <a href="https://aka.ms/talangs">Supported languages in Text Analytics + * API</a> for the list of enabled languages. + * * @param input Contains a set of input documents to be analyzed by the service. - * @param modelVersion (Optional) This value indicates which model will be used for scoring. If a model-version is not specified, the API should default to the latest, non-preview version. + * @param modelVersion (Optional) This value indicates which model will be used for scoring. If a model-version is + * not specified, the API should default to the latest, non-preview version. * @param showStats (Optional) if set to true, response will contain input and document level statistics. + * @param domain (Optional) if set to 'PHI', response will contain only PHI entities. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws TextAnalyticsErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the response. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> entitiesLinkingWithResponseAsync(MultiLanguageBatchInput input, String modelVersion, Boolean showStats) { - return FluxUtil.withContext(context -> service.entitiesLinking(this.getEndpoint(), modelVersion, showStats, input, context)); + public Mono> entitiesRecognitionPiiWithResponseAsync( + MultiLanguageBatchInput input, String modelVersion, Boolean showStats, String domain, Context context) { + return service.entitiesRecognitionPii(this.getEndpoint(), modelVersion, showStats, domain, input, context); } /** - * The API returns a list of recognized entities with links to a well-known knowledge base. See the <a href="https://aka.ms/talangs">Supported languages in Text Analytics API</a> for the list of enabled languages. - * + * The API returns a list of recognized entities with links to a well-known knowledge base. See the <a + * href="https://aka.ms/talangs">Supported languages in Text Analytics API</a> for the list of enabled + * languages. + * * @param input Contains a set of input documents to be analyzed by the service. - * @param context The context to associate with this operation. - * @param modelVersion (Optional) This value indicates which model will be used for scoring. If a model-version is not specified, the API should default to the latest, non-preview version. + * @param modelVersion (Optional) This value indicates which model will be used for scoring. If a model-version is + * not specified, the API should default to the latest, non-preview version. * @param showStats (Optional) if set to true, response will contain input and document level statistics. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws TextAnalyticsErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the response. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> entitiesLinkingWithResponseAsync(MultiLanguageBatchInput input, Context context, String modelVersion, Boolean showStats) { + public Mono> entitiesLinkingWithResponseAsync( + MultiLanguageBatchInput input, String modelVersion, Boolean showStats, Context context) { return service.entitiesLinking(this.getEndpoint(), modelVersion, showStats, input, context); } /** - * The API returns a list of strings denoting the key phrases in the input text. See the <a href="https://aka.ms/talangs">Supported languages in Text Analytics API</a> for the list of enabled languages. - * + * The API returns a list of strings denoting the key phrases in the input text. See the <a + * href="https://aka.ms/talangs">Supported languages in Text Analytics API</a> for the list of enabled + * languages. + * * @param input Contains a set of input documents to be analyzed by the service. - * @param modelVersion (Optional) This value indicates which model will be used for scoring. If a model-version is not specified, the API should default to the latest, non-preview version. + * @param modelVersion (Optional) This value indicates which model will be used for scoring. If a model-version is + * not specified, the API should default to the latest, non-preview version. * @param showStats (Optional) if set to true, response will contain input and document level statistics. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws TextAnalyticsErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> keyPhrasesWithResponseAsync(MultiLanguageBatchInput input, String modelVersion, Boolean showStats) { - return FluxUtil.withContext(context -> service.keyPhrases(this.getEndpoint(), modelVersion, showStats, input, context)); - } - - /** - * The API returns a list of strings denoting the key phrases in the input text. See the <a href="https://aka.ms/talangs">Supported languages in Text Analytics API</a> for the list of enabled languages. - * - * @param input Contains a set of input documents to be analyzed by the service. * @param context The context to associate with this operation. - * @param modelVersion (Optional) This value indicates which model will be used for scoring. If a model-version is not specified, the API should default to the latest, non-preview version. - * @param showStats (Optional) if set to true, response will contain input and document level statistics. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws TextAnalyticsErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the response. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> keyPhrasesWithResponseAsync(MultiLanguageBatchInput input, Context context, String modelVersion, Boolean showStats) { + public Mono> keyPhrasesWithResponseAsync( + MultiLanguageBatchInput input, String modelVersion, Boolean showStats, Context context) { return service.keyPhrases(this.getEndpoint(), modelVersion, showStats, input, context); } /** - * The API returns the detected language and a numeric score between 0 and 1. Scores close to 1 indicate 100% certainty that the identified language is true. See the <a href="https://aka.ms/talangs">Supported languages in Text Analytics API</a> for the list of enabled languages. - * + * The API returns the detected language and a numeric score between 0 and 1. Scores close to 1 indicate 100% + * certainty that the identified language is true. See the <a href="https://aka.ms/talangs">Supported + * languages in Text Analytics API</a> for the list of enabled languages. + * * @param input Collection of documents to analyze. - * @param modelVersion (Optional) This value indicates which model will be used for scoring. If a model-version is not specified, the API should default to the latest, non-preview version. + * @param modelVersion (Optional) This value indicates which model will be used for scoring. If a model-version is + * not specified, the API should default to the latest, non-preview version. * @param showStats (Optional) if set to true, response will contain input and document level statistics. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws TextAnalyticsErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> languagesWithResponseAsync(LanguageBatchInput input, String modelVersion, Boolean showStats) { - return FluxUtil.withContext(context -> service.languages(this.getEndpoint(), modelVersion, showStats, input, context)); - } - - /** - * The API returns the detected language and a numeric score between 0 and 1. Scores close to 1 indicate 100% certainty that the identified language is true. See the <a href="https://aka.ms/talangs">Supported languages in Text Analytics API</a> for the list of enabled languages. - * - * @param input Collection of documents to analyze. * @param context The context to associate with this operation. - * @param modelVersion (Optional) This value indicates which model will be used for scoring. If a model-version is not specified, the API should default to the latest, non-preview version. - * @param showStats (Optional) if set to true, response will contain input and document level statistics. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws TextAnalyticsErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the response. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> languagesWithResponseAsync(LanguageBatchInput input, Context context, String modelVersion, Boolean showStats) { + public Mono> languagesWithResponseAsync( + LanguageBatchInput input, String modelVersion, Boolean showStats, Context context) { return service.languages(this.getEndpoint(), modelVersion, showStats, input, context); } /** - * The API returns a sentiment prediction, as well as sentiment scores for each sentiment class (Positive, Negative, and Neutral) for the document and each sentence within it. See the <a href="https://aka.ms/talangs">Supported languages in Text Analytics API</a> for the list of enabled languages. - * + * The API returns a detailed sentiment analysis for the input text. The analysis is done in multiple levels of + * granularity, start from the a document level, down to sentence and key terms (aspects) and opinions. + * * @param input Contains a set of input documents to be analyzed by the service. - * @param modelVersion (Optional) This value indicates which model will be used for scoring. If a model-version is not specified, the API should default to the latest, non-preview version. + * @param modelVersion (Optional) This value indicates which model will be used for scoring. If a model-version is + * not specified, the API should default to the latest, non-preview version. * @param showStats (Optional) if set to true, response will contain input and document level statistics. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws TextAnalyticsErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> sentimentWithResponseAsync(MultiLanguageBatchInput input, String modelVersion, Boolean showStats) { - return FluxUtil.withContext(context -> service.sentiment(this.getEndpoint(), modelVersion, showStats, input, context)); - } - - /** - * The API returns a sentiment prediction, as well as sentiment scores for each sentiment class (Positive, Negative, and Neutral) for the document and each sentence within it. See the <a href="https://aka.ms/talangs">Supported languages in Text Analytics API</a> for the list of enabled languages. - * - * @param input Contains a set of input documents to be analyzed by the service. + * @param opinionMining (Optional) if set to true, response will contain input and document level statistics + * including aspect-based sentiment analysis results. * @param context The context to associate with this operation. - * @param modelVersion (Optional) This value indicates which model will be used for scoring. If a model-version is not specified, the API should default to the latest, non-preview version. - * @param showStats (Optional) if set to true, response will contain input and document level statistics. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws TextAnalyticsErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the response. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> sentimentWithResponseAsync(MultiLanguageBatchInput input, Context context, String modelVersion, Boolean showStats) { - return service.sentiment(this.getEndpoint(), modelVersion, showStats, input, context); + public Mono> sentimentWithResponseAsync( + MultiLanguageBatchInput input, + String modelVersion, + Boolean showStats, + Boolean opinionMining, + Context context) { + return service.sentiment(this.getEndpoint(), modelVersion, showStats, opinionMining, input, context); } } diff --git a/sdk/textanalytics/azure-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/implementation/TextAnalyticsClientImplBuilder.java b/sdk/textanalytics/azure-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/implementation/TextAnalyticsClientImplBuilder.java index dc59d2fc68aac..340cd55b60a3d 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/implementation/TextAnalyticsClientImplBuilder.java +++ b/sdk/textanalytics/azure-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/implementation/TextAnalyticsClientImplBuilder.java @@ -11,18 +11,18 @@ import com.azure.core.http.policy.RetryPolicy; import com.azure.core.http.policy.UserAgentPolicy; -/** - * A builder for creating a new instance of the TextAnalyticsClient type. - */ -@ServiceClientBuilder(serviceClients = TextAnalyticsClientImpl.class) +/** A builder for creating a new instance of the TextAnalyticsClient type. */ +@ServiceClientBuilder(serviceClients = {TextAnalyticsClientImpl.class}) public final class TextAnalyticsClientImplBuilder { /* - * Supported Cognitive Services endpoints (protocol and hostname, for example: https://westus.api.cognitive.microsoft.com). + * Supported Cognitive Services endpoints (protocol and hostname, for + * example: https://westus.api.cognitive.microsoft.com). */ private String endpoint; /** - * Sets Supported Cognitive Services endpoints (protocol and hostname, for example: https://westus.api.cognitive.microsoft.com). + * Sets Supported Cognitive Services endpoints (protocol and hostname, for example: + * https://westus.api.cognitive.microsoft.com). * * @param endpoint the endpoint value. * @return the TextAnalyticsClientImplBuilder. @@ -53,14 +53,14 @@ public TextAnalyticsClientImplBuilder pipeline(HttpPipeline pipeline) { * * @return an instance of TextAnalyticsClientImpl. */ - public TextAnalyticsClientImpl build() { + public TextAnalyticsClientImpl buildClient() { if (pipeline == null) { - this.pipeline = new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy(), new CookiePolicy()).build(); - } - TextAnalyticsClientImpl client = new TextAnalyticsClientImpl(pipeline); - if (this.endpoint != null) { - client.setEndpoint(this.endpoint); + this.pipeline = + new HttpPipelineBuilder() + .policies(new UserAgentPolicy(), new RetryPolicy(), new CookiePolicy()) + .build(); } + TextAnalyticsClientImpl client = new TextAnalyticsClientImpl(pipeline, endpoint); return client; } } diff --git a/sdk/textanalytics/azure-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/implementation/models/AspectConfidenceScoreLabel.java b/sdk/textanalytics/azure-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/implementation/models/AspectConfidenceScoreLabel.java new file mode 100644 index 0000000000000..668ede14eb525 --- /dev/null +++ b/sdk/textanalytics/azure-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/implementation/models/AspectConfidenceScoreLabel.java @@ -0,0 +1,64 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.ai.textanalytics.implementation.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The AspectConfidenceScoreLabel model. */ +@Fluent +public final class AspectConfidenceScoreLabel { + /* + * The positive property. + */ + @JsonProperty(value = "positive", required = true) + private double positive; + + /* + * The negative property. + */ + @JsonProperty(value = "negative", required = true) + private double negative; + + /** + * Get the positive property: The positive property. + * + * @return the positive value. + */ + public double getPositive() { + return this.positive; + } + + /** + * Set the positive property: The positive property. + * + * @param positive the positive value to set. + * @return the AspectConfidenceScoreLabel object itself. + */ + public AspectConfidenceScoreLabel setPositive(double positive) { + this.positive = positive; + return this; + } + + /** + * Get the negative property: The negative property. + * + * @return the negative value. + */ + public double getNegative() { + return this.negative; + } + + /** + * Set the negative property: The negative property. + * + * @param negative the negative value to set. + * @return the AspectConfidenceScoreLabel object itself. + */ + public AspectConfidenceScoreLabel setNegative(double negative) { + this.negative = negative; + return this; + } +} diff --git a/sdk/textanalytics/azure-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/implementation/models/AspectRelation.java b/sdk/textanalytics/azure-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/implementation/models/AspectRelation.java new file mode 100644 index 0000000000000..05ce364475299 --- /dev/null +++ b/sdk/textanalytics/azure-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/implementation/models/AspectRelation.java @@ -0,0 +1,64 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.ai.textanalytics.implementation.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The AspectRelation model. */ +@Fluent +public final class AspectRelation { + /* + * The type related to the aspect. + */ + @JsonProperty(value = "relationType", required = true) + private AspectRelationType relationType; + + /* + * The JSON pointer indicating the linked object. + */ + @JsonProperty(value = "ref", required = true) + private String ref; + + /** + * Get the relationType property: The type related to the aspect. + * + * @return the relationType value. + */ + public AspectRelationType getRelationType() { + return this.relationType; + } + + /** + * Set the relationType property: The type related to the aspect. + * + * @param relationType the relationType value to set. + * @return the AspectRelation object itself. + */ + public AspectRelation setRelationType(AspectRelationType relationType) { + this.relationType = relationType; + return this; + } + + /** + * Get the ref property: The JSON pointer indicating the linked object. + * + * @return the ref value. + */ + public String getRef() { + return this.ref; + } + + /** + * Set the ref property: The JSON pointer indicating the linked object. + * + * @param ref the ref value to set. + * @return the AspectRelation object itself. + */ + public AspectRelation setRef(String ref) { + this.ref = ref; + return this; + } +} diff --git a/sdk/textanalytics/azure-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/implementation/models/AspectRelationType.java b/sdk/textanalytics/azure-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/implementation/models/AspectRelationType.java new file mode 100644 index 0000000000000..77fd22fbbc108 --- /dev/null +++ b/sdk/textanalytics/azure-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/implementation/models/AspectRelationType.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.ai.textanalytics.implementation.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for AspectRelationType. */ +public final class AspectRelationType extends ExpandableStringEnum { + /** Static value opinion for AspectRelationType. */ + public static final AspectRelationType OPINION = fromString("opinion"); + + /** Static value aspect for AspectRelationType. */ + public static final AspectRelationType ASPECT = fromString("aspect"); + + /** + * Creates or finds a AspectRelationType from its string representation. + * + * @param name a name to look for. + * @return the corresponding AspectRelationType. + */ + @JsonCreator + public static AspectRelationType fromString(String name) { + return fromString(name, AspectRelationType.class); + } + + /** @return known AspectRelationType values. */ + public static Collection values() { + return values(AspectRelationType.class); + } +} diff --git a/sdk/textanalytics/azure-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/implementation/models/DetectedLanguage.java b/sdk/textanalytics/azure-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/implementation/models/DetectedLanguage.java index bd031227091f8..db9538d2c0043 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/implementation/models/DetectedLanguage.java +++ b/sdk/textanalytics/azure-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/implementation/models/DetectedLanguage.java @@ -7,9 +7,7 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** - * The DetectedLanguage model. - */ +/** The DetectedLanguage model. */ @Fluent public final class DetectedLanguage { /* @@ -33,9 +31,8 @@ public final class DetectedLanguage { private double confidenceScore; /** - * Get the name property: Long name of a detected language (e.g. English, - * French). - * + * Get the name property: Long name of a detected language (e.g. English, French). + * * @return the name value. */ public String getName() { @@ -43,9 +40,8 @@ public String getName() { } /** - * Set the name property: Long name of a detected language (e.g. English, - * French). - * + * Set the name property: Long name of a detected language (e.g. English, French). + * * @param name the name value to set. * @return the DetectedLanguage object itself. */ @@ -55,9 +51,9 @@ public DetectedLanguage setName(String name) { } /** - * Get the iso6391Name property: A two letter representation of the - * detected language according to the ISO 639-1 standard (e.g. en, fr). - * + * Get the iso6391Name property: A two letter representation of the detected language according to the ISO 639-1 + * standard (e.g. en, fr). + * * @return the iso6391Name value. */ public String getIso6391Name() { @@ -65,9 +61,9 @@ public String getIso6391Name() { } /** - * Set the iso6391Name property: A two letter representation of the - * detected language according to the ISO 639-1 standard (e.g. en, fr). - * + * Set the iso6391Name property: A two letter representation of the detected language according to the ISO 639-1 + * standard (e.g. en, fr). + * * @param iso6391Name the iso6391Name value to set. * @return the DetectedLanguage object itself. */ @@ -77,10 +73,9 @@ public DetectedLanguage setIso6391Name(String iso6391Name) { } /** - * Get the confidenceScore property: A confidence score between 0 and 1. - * Scores close to 1 indicate 100% certainty that the identified language - * is true. - * + * Get the confidenceScore property: A confidence score between 0 and 1. Scores close to 1 indicate 100% certainty + * that the identified language is true. + * * @return the confidenceScore value. */ public double getConfidenceScore() { @@ -88,10 +83,9 @@ public double getConfidenceScore() { } /** - * Set the confidenceScore property: A confidence score between 0 and 1. - * Scores close to 1 indicate 100% certainty that the identified language - * is true. - * + * Set the confidenceScore property: A confidence score between 0 and 1. Scores close to 1 indicate 100% certainty + * that the identified language is true. + * * @param confidenceScore the confidenceScore value to set. * @return the DetectedLanguage object itself. */ diff --git a/sdk/textanalytics/azure-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/implementation/models/DocumentEntities.java b/sdk/textanalytics/azure-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/implementation/models/DocumentEntities.java index dd1637927928f..19f70d0823d81 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/implementation/models/DocumentEntities.java +++ b/sdk/textanalytics/azure-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/implementation/models/DocumentEntities.java @@ -8,9 +8,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** - * The DocumentEntities model. - */ +/** The DocumentEntities model. */ @Fluent public final class DocumentEntities { /* @@ -40,7 +38,7 @@ public final class DocumentEntities { /** * Get the id property: Unique, non-empty document identifier. - * + * * @return the id value. */ public String getId() { @@ -49,7 +47,7 @@ public String getId() { /** * Set the id property: Unique, non-empty document identifier. - * + * * @param id the id value to set. * @return the DocumentEntities object itself. */ @@ -60,7 +58,7 @@ public DocumentEntities setId(String id) { /** * Get the entities property: Recognized entities in the document. - * + * * @return the entities value. */ public List getEntities() { @@ -69,7 +67,7 @@ public List getEntities() { /** * Set the entities property: Recognized entities in the document. - * + * * @param entities the entities value to set. * @return the DocumentEntities object itself. */ @@ -79,9 +77,8 @@ public DocumentEntities setEntities(List entities) { } /** - * Get the warnings property: Warnings encountered while processing - * document. - * + * Get the warnings property: Warnings encountered while processing document. + * * @return the warnings value. */ public List getWarnings() { @@ -89,9 +86,8 @@ public List getWarnings() { } /** - * Set the warnings property: Warnings encountered while processing - * document. - * + * Set the warnings property: Warnings encountered while processing document. + * * @param warnings the warnings value to set. * @return the DocumentEntities object itself. */ @@ -101,9 +97,9 @@ public DocumentEntities setWarnings(List warnings) { } /** - * Get the statistics property: if showStats=true was specified in the - * request this field will contain information about the document payload. - * + * Get the statistics property: if showStats=true was specified in the request this field will contain information + * about the document payload. + * * @return the statistics value. */ public DocumentStatistics getStatistics() { @@ -111,9 +107,9 @@ public DocumentStatistics getStatistics() { } /** - * Set the statistics property: if showStats=true was specified in the - * request this field will contain information about the document payload. - * + * Set the statistics property: if showStats=true was specified in the request this field will contain information + * about the document payload. + * * @param statistics the statistics value to set. * @return the DocumentEntities object itself. */ diff --git a/sdk/textanalytics/azure-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/implementation/models/DocumentError.java b/sdk/textanalytics/azure-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/implementation/models/DocumentError.java index 7d1ac563e085b..cdcc457d59e3e 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/implementation/models/DocumentError.java +++ b/sdk/textanalytics/azure-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/implementation/models/DocumentError.java @@ -7,9 +7,7 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** - * The DocumentError model. - */ +/** The DocumentError model. */ @Fluent public final class DocumentError { /* @@ -26,7 +24,7 @@ public final class DocumentError { /** * Get the id property: Document Id. - * + * * @return the id value. */ public String getId() { @@ -35,7 +33,7 @@ public String getId() { /** * Set the id property: Document Id. - * + * * @param id the id value to set. * @return the DocumentError object itself. */ @@ -46,7 +44,7 @@ public DocumentError setId(String id) { /** * Get the error property: Document Error. - * + * * @return the error value. */ public TextAnalyticsError getError() { @@ -55,7 +53,7 @@ public TextAnalyticsError getError() { /** * Set the error property: Document Error. - * + * * @param error the error value to set. * @return the DocumentError object itself. */ diff --git a/sdk/textanalytics/azure-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/implementation/models/DocumentKeyPhrases.java b/sdk/textanalytics/azure-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/implementation/models/DocumentKeyPhrases.java index 98c442b0fe7d7..7246406feabd5 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/implementation/models/DocumentKeyPhrases.java +++ b/sdk/textanalytics/azure-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/implementation/models/DocumentKeyPhrases.java @@ -8,9 +8,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** - * The DocumentKeyPhrases model. - */ +/** The DocumentKeyPhrases model. */ @Fluent public final class DocumentKeyPhrases { /* @@ -41,7 +39,7 @@ public final class DocumentKeyPhrases { /** * Get the id property: Unique, non-empty document identifier. - * + * * @return the id value. */ public String getId() { @@ -50,7 +48,7 @@ public String getId() { /** * Set the id property: Unique, non-empty document identifier. - * + * * @param id the id value to set. * @return the DocumentKeyPhrases object itself. */ @@ -60,10 +58,9 @@ public DocumentKeyPhrases setId(String id) { } /** - * Get the keyPhrases property: A list of representative words or phrases. - * The number of key phrases returned is proportional to the number of - * words in the input document. - * + * Get the keyPhrases property: A list of representative words or phrases. The number of key phrases returned is + * proportional to the number of words in the input document. + * * @return the keyPhrases value. */ public List getKeyPhrases() { @@ -71,10 +68,9 @@ public List getKeyPhrases() { } /** - * Set the keyPhrases property: A list of representative words or phrases. - * The number of key phrases returned is proportional to the number of - * words in the input document. - * + * Set the keyPhrases property: A list of representative words or phrases. The number of key phrases returned is + * proportional to the number of words in the input document. + * * @param keyPhrases the keyPhrases value to set. * @return the DocumentKeyPhrases object itself. */ @@ -84,9 +80,8 @@ public DocumentKeyPhrases setKeyPhrases(List keyPhrases) { } /** - * Get the warnings property: Warnings encountered while processing - * document. - * + * Get the warnings property: Warnings encountered while processing document. + * * @return the warnings value. */ public List getWarnings() { @@ -94,9 +89,8 @@ public List getWarnings() { } /** - * Set the warnings property: Warnings encountered while processing - * document. - * + * Set the warnings property: Warnings encountered while processing document. + * * @param warnings the warnings value to set. * @return the DocumentKeyPhrases object itself. */ @@ -106,9 +100,9 @@ public DocumentKeyPhrases setWarnings(List warnings) { } /** - * Get the statistics property: if showStats=true was specified in the - * request this field will contain information about the document payload. - * + * Get the statistics property: if showStats=true was specified in the request this field will contain information + * about the document payload. + * * @return the statistics value. */ public DocumentStatistics getStatistics() { @@ -116,9 +110,9 @@ public DocumentStatistics getStatistics() { } /** - * Set the statistics property: if showStats=true was specified in the - * request this field will contain information about the document payload. - * + * Set the statistics property: if showStats=true was specified in the request this field will contain information + * about the document payload. + * * @param statistics the statistics value to set. * @return the DocumentKeyPhrases object itself. */ diff --git a/sdk/textanalytics/azure-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/implementation/models/DocumentLanguage.java b/sdk/textanalytics/azure-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/implementation/models/DocumentLanguage.java index 80fa6fb3efab2..b195406d85350 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/implementation/models/DocumentLanguage.java +++ b/sdk/textanalytics/azure-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/implementation/models/DocumentLanguage.java @@ -8,9 +8,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** - * The DocumentLanguage model. - */ +/** The DocumentLanguage model. */ @Fluent public final class DocumentLanguage { /* @@ -79,8 +77,7 @@ public DocumentLanguage setDetectedLanguage(DetectedLanguage detectedLanguage) { } /** - * Get the warnings property: Warnings encountered while processing - * document. + * Get the warnings property: Warnings encountered while processing document. * * @return the warnings value. */ @@ -89,8 +86,7 @@ public List getWarnings() { } /** - * Set the warnings property: Warnings encountered while processing - * document. + * Set the warnings property: Warnings encountered while processing document. * * @param warnings the warnings value to set. * @return the DocumentLanguage object itself. @@ -101,8 +97,8 @@ public DocumentLanguage setWarnings(List warnings) { } /** - * Get the statistics property: if showStats=true was specified in the - * request this field will contain information about the document payload. + * Get the statistics property: if showStats=true was specified in the request this field will contain information + * about the document payload. * * @return the statistics value. */ @@ -111,8 +107,8 @@ public DocumentStatistics getStatistics() { } /** - * Set the statistics property: if showStats=true was specified in the - * request this field will contain information about the document payload. + * Set the statistics property: if showStats=true was specified in the request this field will contain information + * about the document payload. * * @param statistics the statistics value to set. * @return the DocumentLanguage object itself. diff --git a/sdk/textanalytics/azure-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/implementation/models/DocumentLinkedEntities.java b/sdk/textanalytics/azure-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/implementation/models/DocumentLinkedEntities.java index c6c548e484b84..952b1f972ddc0 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/implementation/models/DocumentLinkedEntities.java +++ b/sdk/textanalytics/azure-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/implementation/models/DocumentLinkedEntities.java @@ -8,9 +8,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** - * The DocumentLinkedEntities model. - */ +/** The DocumentLinkedEntities model. */ @Fluent public final class DocumentLinkedEntities { /* @@ -40,7 +38,7 @@ public final class DocumentLinkedEntities { /** * Get the id property: Unique, non-empty document identifier. - * + * * @return the id value. */ public String getId() { @@ -49,7 +47,7 @@ public String getId() { /** * Set the id property: Unique, non-empty document identifier. - * + * * @param id the id value to set. * @return the DocumentLinkedEntities object itself. */ @@ -59,9 +57,8 @@ public DocumentLinkedEntities setId(String id) { } /** - * Get the entities property: Recognized well-known entities in the - * document. - * + * Get the entities property: Recognized well-known entities in the document. + * * @return the entities value. */ public List getEntities() { @@ -69,9 +66,8 @@ public List getEntities() { } /** - * Set the entities property: Recognized well-known entities in the - * document. - * + * Set the entities property: Recognized well-known entities in the document. + * * @param entities the entities value to set. * @return the DocumentLinkedEntities object itself. */ @@ -81,9 +77,8 @@ public DocumentLinkedEntities setEntities(List entities) { } /** - * Get the warnings property: Warnings encountered while processing - * document. - * + * Get the warnings property: Warnings encountered while processing document. + * * @return the warnings value. */ public List getWarnings() { @@ -91,9 +86,8 @@ public List getWarnings() { } /** - * Set the warnings property: Warnings encountered while processing - * document. - * + * Set the warnings property: Warnings encountered while processing document. + * * @param warnings the warnings value to set. * @return the DocumentLinkedEntities object itself. */ @@ -103,9 +97,9 @@ public DocumentLinkedEntities setWarnings(List warnings) { } /** - * Get the statistics property: if showStats=true was specified in the - * request this field will contain information about the document payload. - * + * Get the statistics property: if showStats=true was specified in the request this field will contain information + * about the document payload. + * * @return the statistics value. */ public DocumentStatistics getStatistics() { @@ -113,9 +107,9 @@ public DocumentStatistics getStatistics() { } /** - * Set the statistics property: if showStats=true was specified in the - * request this field will contain information about the document payload. - * + * Set the statistics property: if showStats=true was specified in the request this field will contain information + * about the document payload. + * * @param statistics the statistics value to set. * @return the DocumentLinkedEntities object itself. */ diff --git a/sdk/textanalytics/azure-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/implementation/models/DocumentSentiment.java b/sdk/textanalytics/azure-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/implementation/models/DocumentSentiment.java index 80d62cfe0082f..d029dc57e4b9b 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/implementation/models/DocumentSentiment.java +++ b/sdk/textanalytics/azure-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/implementation/models/DocumentSentiment.java @@ -8,9 +8,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** - * The DocumentSentiment model. - */ +/** The DocumentSentiment model. */ @Fluent public final class DocumentSentiment { /* @@ -54,7 +52,7 @@ public final class DocumentSentiment { /** * Get the id property: Unique, non-empty document identifier. - * + * * @return the id value. */ public String getId() { @@ -63,7 +61,7 @@ public String getId() { /** * Set the id property: Unique, non-empty document identifier. - * + * * @param id the id value to set. * @return the DocumentSentiment object itself. */ @@ -73,9 +71,8 @@ public DocumentSentiment setId(String id) { } /** - * Get the sentiment property: Predicted sentiment for document (Negative, - * Neutral, Positive, or Mixed). - * + * Get the sentiment property: Predicted sentiment for document (Negative, Neutral, Positive, or Mixed). + * * @return the sentiment value. */ public DocumentSentimentValue getSentiment() { @@ -83,9 +80,8 @@ public DocumentSentimentValue getSentiment() { } /** - * Set the sentiment property: Predicted sentiment for document (Negative, - * Neutral, Positive, or Mixed). - * + * Set the sentiment property: Predicted sentiment for document (Negative, Neutral, Positive, or Mixed). + * * @param sentiment the sentiment value to set. * @return the DocumentSentiment object itself. */ @@ -95,9 +91,9 @@ public DocumentSentiment setSentiment(DocumentSentimentValue sentiment) { } /** - * Get the statistics property: if showStats=true was specified in the - * request this field will contain information about the document payload. - * + * Get the statistics property: if showStats=true was specified in the request this field will contain information + * about the document payload. + * * @return the statistics value. */ public DocumentStatistics getStatistics() { @@ -105,9 +101,9 @@ public DocumentStatistics getStatistics() { } /** - * Set the statistics property: if showStats=true was specified in the - * request this field will contain information about the document payload. - * + * Set the statistics property: if showStats=true was specified in the request this field will contain information + * about the document payload. + * * @param statistics the statistics value to set. * @return the DocumentSentiment object itself. */ @@ -117,9 +113,9 @@ public DocumentSentiment setStatistics(DocumentStatistics statistics) { } /** - * Get the confidenceScores property: Document level sentiment confidence - * scores between 0 and 1 for each sentiment class. - * + * Get the confidenceScores property: Document level sentiment confidence scores between 0 and 1 for each sentiment + * class. + * * @return the confidenceScores value. */ public SentimentConfidenceScorePerLabel getConfidenceScores() { @@ -127,9 +123,9 @@ public SentimentConfidenceScorePerLabel getConfidenceScores() { } /** - * Set the confidenceScores property: Document level sentiment confidence - * scores between 0 and 1 for each sentiment class. - * + * Set the confidenceScores property: Document level sentiment confidence scores between 0 and 1 for each sentiment + * class. + * * @param confidenceScores the confidenceScores value to set. * @return the DocumentSentiment object itself. */ @@ -140,7 +136,7 @@ public DocumentSentiment setConfidenceScores(SentimentConfidenceScorePerLabel co /** * Get the sentences property: Sentence level sentiment analysis. - * + * * @return the sentences value. */ public List getSentences() { @@ -149,7 +145,7 @@ public List getSentences() { /** * Set the sentences property: Sentence level sentiment analysis. - * + * * @param sentences the sentences value to set. * @return the DocumentSentiment object itself. */ @@ -159,9 +155,8 @@ public DocumentSentiment setSentences(List sentences) { } /** - * Get the warnings property: Warnings encountered while processing - * document. - * + * Get the warnings property: Warnings encountered while processing document. + * * @return the warnings value. */ public List getWarnings() { @@ -169,9 +164,8 @@ public List getWarnings() { } /** - * Set the warnings property: Warnings encountered while processing - * document. - * + * Set the warnings property: Warnings encountered while processing document. + * * @param warnings the warnings value to set. * @return the DocumentSentiment object itself. */ diff --git a/sdk/textanalytics/azure-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/implementation/models/DocumentSentimentValue.java b/sdk/textanalytics/azure-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/implementation/models/DocumentSentimentValue.java index 3348780b91a96..0964d67bafe2d 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/implementation/models/DocumentSentimentValue.java +++ b/sdk/textanalytics/azure-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/implementation/models/DocumentSentimentValue.java @@ -7,33 +7,21 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; -/** - * Defines values for DocumentSentimentValue. - */ +/** Defines values for DocumentSentimentValue. */ public enum DocumentSentimentValue { - /** - * Enum value positive. - */ + /** Enum value positive. */ POSITIVE("positive"), - /** - * Enum value neutral. - */ + /** Enum value neutral. */ NEUTRAL("neutral"), - /** - * Enum value negative. - */ + /** Enum value negative. */ NEGATIVE("negative"), - /** - * Enum value mixed. - */ + /** Enum value mixed. */ MIXED("mixed"); - /** - * The actual serialized value for a DocumentSentimentValue instance. - */ + /** The actual serialized value for a DocumentSentimentValue instance. */ private final String value; DocumentSentimentValue(String value) { @@ -42,7 +30,7 @@ public enum DocumentSentimentValue { /** * Parses a serialized value to a DocumentSentimentValue instance. - * + * * @param value the serialized value to parse. * @return the parsed DocumentSentimentValue object, or null if unable to parse. */ diff --git a/sdk/textanalytics/azure-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/implementation/models/DocumentStatistics.java b/sdk/textanalytics/azure-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/implementation/models/DocumentStatistics.java index ef73e3f47e57f..93d26d27cfd03 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/implementation/models/DocumentStatistics.java +++ b/sdk/textanalytics/azure-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/implementation/models/DocumentStatistics.java @@ -7,9 +7,7 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** - * The DocumentStatistics model. - */ +/** The DocumentStatistics model. */ @Fluent public final class DocumentStatistics { /* @@ -25,9 +23,8 @@ public final class DocumentStatistics { private int transactionsCount; /** - * Get the charactersCount property: Number of text elements recognized in - * the document. - * + * Get the charactersCount property: Number of text elements recognized in the document. + * * @return the charactersCount value. */ public int getCharactersCount() { @@ -35,9 +32,8 @@ public int getCharactersCount() { } /** - * Set the charactersCount property: Number of text elements recognized in - * the document. - * + * Set the charactersCount property: Number of text elements recognized in the document. + * * @param charactersCount the charactersCount value to set. * @return the DocumentStatistics object itself. */ @@ -47,9 +43,8 @@ public DocumentStatistics setCharactersCount(int charactersCount) { } /** - * Get the transactionsCount property: Number of transactions for the - * document. - * + * Get the transactionsCount property: Number of transactions for the document. + * * @return the transactionsCount value. */ public int getTransactionsCount() { @@ -57,9 +52,8 @@ public int getTransactionsCount() { } /** - * Set the transactionsCount property: Number of transactions for the - * document. - * + * Set the transactionsCount property: Number of transactions for the document. + * * @param transactionsCount the transactionsCount value to set. * @return the DocumentStatistics object itself. */ diff --git a/sdk/textanalytics/azure-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/implementation/models/EntitiesResult.java b/sdk/textanalytics/azure-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/implementation/models/EntitiesResult.java index e103245b3c997..51baf6e747dff 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/implementation/models/EntitiesResult.java +++ b/sdk/textanalytics/azure-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/implementation/models/EntitiesResult.java @@ -8,9 +8,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** - * The EntitiesResult model. - */ +/** The EntitiesResult model. */ @Fluent public final class EntitiesResult { /* @@ -40,7 +38,7 @@ public final class EntitiesResult { /** * Get the documents property: Response by document. - * + * * @return the documents value. */ public List getDocuments() { @@ -49,7 +47,7 @@ public List getDocuments() { /** * Set the documents property: Response by document. - * + * * @param documents the documents value to set. * @return the EntitiesResult object itself. */ @@ -60,7 +58,7 @@ public EntitiesResult setDocuments(List documents) { /** * Get the errors property: Errors by document id. - * + * * @return the errors value. */ public List getErrors() { @@ -69,7 +67,7 @@ public List getErrors() { /** * Set the errors property: Errors by document id. - * + * * @param errors the errors value to set. * @return the EntitiesResult object itself. */ @@ -79,9 +77,9 @@ public EntitiesResult setErrors(List errors) { } /** - * Get the statistics property: if showStats=true was specified in the - * request this field will contain information about the request payload. - * + * Get the statistics property: if showStats=true was specified in the request this field will contain information + * about the request payload. + * * @return the statistics value. */ public RequestStatistics getStatistics() { @@ -89,9 +87,9 @@ public RequestStatistics getStatistics() { } /** - * Set the statistics property: if showStats=true was specified in the - * request this field will contain information about the request payload. - * + * Set the statistics property: if showStats=true was specified in the request this field will contain information + * about the request payload. + * * @param statistics the statistics value to set. * @return the EntitiesResult object itself. */ @@ -101,9 +99,8 @@ public EntitiesResult setStatistics(RequestStatistics statistics) { } /** - * Get the modelVersion property: This field indicates which model is used - * for scoring. - * + * Get the modelVersion property: This field indicates which model is used for scoring. + * * @return the modelVersion value. */ public String getModelVersion() { @@ -111,9 +108,8 @@ public String getModelVersion() { } /** - * Set the modelVersion property: This field indicates which model is used - * for scoring. - * + * Set the modelVersion property: This field indicates which model is used for scoring. + * * @param modelVersion the modelVersion value to set. * @return the EntitiesResult object itself. */ diff --git a/sdk/textanalytics/azure-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/implementation/models/Entity.java b/sdk/textanalytics/azure-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/implementation/models/Entity.java index afb9da844ae36..bf46484caa80a 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/implementation/models/Entity.java +++ b/sdk/textanalytics/azure-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/implementation/models/Entity.java @@ -7,9 +7,7 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** - * The Entity model. - */ +/** The Entity model. */ @Fluent public final class Entity { /* @@ -31,13 +29,13 @@ public final class Entity { private String subcategory; /* - * Start position (in Unicode characters) for the entity text. + * Start position for the entity text. */ @JsonProperty(value = "offset", required = true) private int offset; /* - * Length (in Unicode characters) for the entity text. + * Length for the entity text. */ @JsonProperty(value = "length", required = true) private int length; @@ -50,7 +48,7 @@ public final class Entity { /** * Get the text property: Entity text as appears in the request. - * + * * @return the text value. */ public String getText() { @@ -59,7 +57,7 @@ public String getText() { /** * Set the text property: Entity text as appears in the request. - * + * * @param text the text value to set. * @return the Entity object itself. */ @@ -69,9 +67,8 @@ public Entity setText(String text) { } /** - * Get the category property: Entity type, such as Person/Location/Org/SSN - * etc. - * + * Get the category property: Entity type, such as Person/Location/Org/SSN etc. + * * @return the category value. */ public String getCategory() { @@ -79,9 +76,8 @@ public String getCategory() { } /** - * Set the category property: Entity type, such as Person/Location/Org/SSN - * etc. - * + * Set the category property: Entity type, such as Person/Location/Org/SSN etc. + * * @param category the category value to set. * @return the Entity object itself. */ @@ -91,9 +87,8 @@ public Entity setCategory(String category) { } /** - * Get the subcategory property: Entity sub type, such as - * Age/Year/TimeRange etc. - * + * Get the subcategory property: Entity sub type, such as Age/Year/TimeRange etc. + * * @return the subcategory value. */ public String getSubcategory() { @@ -101,9 +96,8 @@ public String getSubcategory() { } /** - * Set the subcategory property: Entity sub type, such as - * Age/Year/TimeRange etc. - * + * Set the subcategory property: Entity sub type, such as Age/Year/TimeRange etc. + * * @param subcategory the subcategory value to set. * @return the Entity object itself. */ @@ -113,9 +107,8 @@ public Entity setSubcategory(String subcategory) { } /** - * Get the offset property: Start position (in Unicode characters) for the - * entity text. - * + * Get the offset property: Start position for the entity text. + * * @return the offset value. */ public int getOffset() { @@ -123,9 +116,8 @@ public int getOffset() { } /** - * Set the offset property: Start position (in Unicode characters) for the - * entity text. - * + * Set the offset property: Start position for the entity text. + * * @param offset the offset value to set. * @return the Entity object itself. */ @@ -135,9 +127,8 @@ public Entity setOffset(int offset) { } /** - * Get the length property: Length (in Unicode characters) for the entity - * text. - * + * Get the length property: Length for the entity text. + * * @return the length value. */ public int getLength() { @@ -145,9 +136,8 @@ public int getLength() { } /** - * Set the length property: Length (in Unicode characters) for the entity - * text. - * + * Set the length property: Length for the entity text. + * * @param length the length value to set. * @return the Entity object itself. */ @@ -157,9 +147,8 @@ public Entity setLength(int length) { } /** - * Get the confidenceScore property: Confidence score between 0 and 1 of - * the extracted entity. - * + * Get the confidenceScore property: Confidence score between 0 and 1 of the extracted entity. + * * @return the confidenceScore value. */ public double getConfidenceScore() { @@ -167,9 +156,8 @@ public double getConfidenceScore() { } /** - * Set the confidenceScore property: Confidence score between 0 and 1 of - * the extracted entity. - * + * Set the confidenceScore property: Confidence score between 0 and 1 of the extracted entity. + * * @param confidenceScore the confidenceScore value to set. * @return the Entity object itself. */ diff --git a/sdk/textanalytics/azure-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/implementation/models/EntityLinkingResult.java b/sdk/textanalytics/azure-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/implementation/models/EntityLinkingResult.java index ffadfa03a1188..35b71cc3b8b05 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/implementation/models/EntityLinkingResult.java +++ b/sdk/textanalytics/azure-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/implementation/models/EntityLinkingResult.java @@ -8,9 +8,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** - * The EntityLinkingResult model. - */ +/** The EntityLinkingResult model. */ @Fluent public final class EntityLinkingResult { /* @@ -40,7 +38,7 @@ public final class EntityLinkingResult { /** * Get the documents property: Response by document. - * + * * @return the documents value. */ public List getDocuments() { @@ -49,7 +47,7 @@ public List getDocuments() { /** * Set the documents property: Response by document. - * + * * @param documents the documents value to set. * @return the EntityLinkingResult object itself. */ @@ -60,7 +58,7 @@ public EntityLinkingResult setDocuments(List documents) /** * Get the errors property: Errors by document id. - * + * * @return the errors value. */ public List getErrors() { @@ -69,7 +67,7 @@ public List getErrors() { /** * Set the errors property: Errors by document id. - * + * * @param errors the errors value to set. * @return the EntityLinkingResult object itself. */ @@ -79,9 +77,9 @@ public EntityLinkingResult setErrors(List errors) { } /** - * Get the statistics property: if showStats=true was specified in the - * request this field will contain information about the request payload. - * + * Get the statistics property: if showStats=true was specified in the request this field will contain information + * about the request payload. + * * @return the statistics value. */ public RequestStatistics getStatistics() { @@ -89,9 +87,9 @@ public RequestStatistics getStatistics() { } /** - * Set the statistics property: if showStats=true was specified in the - * request this field will contain information about the request payload. - * + * Set the statistics property: if showStats=true was specified in the request this field will contain information + * about the request payload. + * * @param statistics the statistics value to set. * @return the EntityLinkingResult object itself. */ @@ -101,9 +99,8 @@ public EntityLinkingResult setStatistics(RequestStatistics statistics) { } /** - * Get the modelVersion property: This field indicates which model is used - * for scoring. - * + * Get the modelVersion property: This field indicates which model is used for scoring. + * * @return the modelVersion value. */ public String getModelVersion() { @@ -111,9 +108,8 @@ public String getModelVersion() { } /** - * Set the modelVersion property: This field indicates which model is used - * for scoring. - * + * Set the modelVersion property: This field indicates which model is used for scoring. + * * @param modelVersion the modelVersion value to set. * @return the EntityLinkingResult object itself. */ diff --git a/sdk/textanalytics/azure-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/implementation/models/ErrorCodeValue.java b/sdk/textanalytics/azure-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/implementation/models/ErrorCodeValue.java index 3431f8803c636..fd24a2ff645e2 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/implementation/models/ErrorCodeValue.java +++ b/sdk/textanalytics/azure-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/implementation/models/ErrorCodeValue.java @@ -7,33 +7,21 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; -/** - * Defines values for ErrorCodeValue. - */ +/** Defines values for ErrorCodeValue. */ public enum ErrorCodeValue { - /** - * Enum value invalidRequest. - */ + /** Enum value invalidRequest. */ INVALID_REQUEST("invalidRequest"), - /** - * Enum value invalidArgument. - */ + /** Enum value invalidArgument. */ INVALID_ARGUMENT("invalidArgument"), - /** - * Enum value internalServerError. - */ + /** Enum value internalServerError. */ INTERNAL_SERVER_ERROR("internalServerError"), - /** - * Enum value serviceUnavailable. - */ + /** Enum value serviceUnavailable. */ SERVICE_UNAVAILABLE("serviceUnavailable"); - /** - * The actual serialized value for a ErrorCodeValue instance. - */ + /** The actual serialized value for a ErrorCodeValue instance. */ private final String value; ErrorCodeValue(String value) { @@ -42,7 +30,7 @@ public enum ErrorCodeValue { /** * Parses a serialized value to a ErrorCodeValue instance. - * + * * @param value the serialized value to parse. * @return the parsed ErrorCodeValue object, or null if unable to parse. */ diff --git a/sdk/textanalytics/azure-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/implementation/models/InnerError.java b/sdk/textanalytics/azure-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/implementation/models/InnerError.java index e2a97c1c062ee..554a5c86ddcc7 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/implementation/models/InnerError.java +++ b/sdk/textanalytics/azure-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/implementation/models/InnerError.java @@ -8,9 +8,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.Map; -/** - * The InnerError model. - */ +/** The InnerError model. */ @Fluent public final class InnerError { /* @@ -45,7 +43,7 @@ public final class InnerError { /** * Get the code property: Error code. - * + * * @return the code value. */ public InnerErrorCodeValue getCode() { @@ -54,7 +52,7 @@ public InnerErrorCodeValue getCode() { /** * Set the code property: Error code. - * + * * @param code the code value to set. * @return the InnerError object itself. */ @@ -65,7 +63,7 @@ public InnerError setCode(InnerErrorCodeValue code) { /** * Get the message property: Error message. - * + * * @return the message value. */ public String getMessage() { @@ -74,7 +72,7 @@ public String getMessage() { /** * Set the message property: Error message. - * + * * @param message the message value to set. * @return the InnerError object itself. */ @@ -85,7 +83,7 @@ public InnerError setMessage(String message) { /** * Get the details property: Error details. - * + * * @return the details value. */ public Map getDetails() { @@ -94,7 +92,7 @@ public Map getDetails() { /** * Set the details property: Error details. - * + * * @param details the details value to set. * @return the InnerError object itself. */ @@ -105,7 +103,7 @@ public InnerError setDetails(Map details) { /** * Get the target property: Error target. - * + * * @return the target value. */ public String getTarget() { @@ -114,7 +112,7 @@ public String getTarget() { /** * Set the target property: Error target. - * + * * @param target the target value to set. * @return the InnerError object itself. */ @@ -124,9 +122,8 @@ public InnerError setTarget(String target) { } /** - * Get the innererror property: Inner error contains more specific - * information. - * + * Get the innererror property: Inner error contains more specific information. + * * @return the innererror value. */ public InnerError getInnererror() { @@ -134,9 +131,8 @@ public InnerError getInnererror() { } /** - * Set the innererror property: Inner error contains more specific - * information. - * + * Set the innererror property: Inner error contains more specific information. + * * @param innererror the innererror value to set. * @return the InnerError object itself. */ diff --git a/sdk/textanalytics/azure-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/implementation/models/InnerErrorCodeValue.java b/sdk/textanalytics/azure-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/implementation/models/InnerErrorCodeValue.java index 4294b1b886a1d..4f1ac83a949c0 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/implementation/models/InnerErrorCodeValue.java +++ b/sdk/textanalytics/azure-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/implementation/models/InnerErrorCodeValue.java @@ -7,58 +7,36 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; -/** - * Defines values for InnerErrorCodeValue. - */ +/** Defines values for InnerErrorCodeValue. */ public enum InnerErrorCodeValue { - /** - * Enum value invalidParameterValue. - */ + /** Enum value invalidParameterValue. */ INVALID_PARAMETER_VALUE("invalidParameterValue"), - /** - * Enum value invalidRequestBodyFormat. - */ + /** Enum value invalidRequestBodyFormat. */ INVALID_REQUEST_BODY_FORMAT("invalidRequestBodyFormat"), - /** - * Enum value emptyRequest. - */ + /** Enum value emptyRequest. */ EMPTY_REQUEST("emptyRequest"), - /** - * Enum value missingInputRecords. - */ + /** Enum value missingInputRecords. */ MISSING_INPUT_RECORDS("missingInputRecords"), - /** - * Enum value invalidDocument. - */ + /** Enum value invalidDocument. */ INVALID_DOCUMENT("invalidDocument"), - /** - * Enum value modelVersionIncorrect. - */ + /** Enum value modelVersionIncorrect. */ MODEL_VERSION_INCORRECT("modelVersionIncorrect"), - /** - * Enum value invalidDocumentBatch. - */ + /** Enum value invalidDocumentBatch. */ INVALID_DOCUMENT_BATCH("invalidDocumentBatch"), - /** - * Enum value unsupportedLanguageCode. - */ + /** Enum value unsupportedLanguageCode. */ UNSUPPORTED_LANGUAGE_CODE("unsupportedLanguageCode"), - /** - * Enum value invalidCountryHint. - */ + /** Enum value invalidCountryHint. */ INVALID_COUNTRY_HINT("invalidCountryHint"); - /** - * The actual serialized value for a InnerErrorCodeValue instance. - */ + /** The actual serialized value for a InnerErrorCodeValue instance. */ private final String value; InnerErrorCodeValue(String value) { @@ -67,7 +45,7 @@ public enum InnerErrorCodeValue { /** * Parses a serialized value to a InnerErrorCodeValue instance. - * + * * @param value the serialized value to parse. * @return the parsed InnerErrorCodeValue object, or null if unable to parse. */ diff --git a/sdk/textanalytics/azure-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/implementation/models/KeyPhraseResult.java b/sdk/textanalytics/azure-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/implementation/models/KeyPhraseResult.java index bd7223494fd27..c849875792608 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/implementation/models/KeyPhraseResult.java +++ b/sdk/textanalytics/azure-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/implementation/models/KeyPhraseResult.java @@ -8,9 +8,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** - * The KeyPhraseResult model. - */ +/** The KeyPhraseResult model. */ @Fluent public final class KeyPhraseResult { /* @@ -40,7 +38,7 @@ public final class KeyPhraseResult { /** * Get the documents property: Response by document. - * + * * @return the documents value. */ public List getDocuments() { @@ -49,7 +47,7 @@ public List getDocuments() { /** * Set the documents property: Response by document. - * + * * @param documents the documents value to set. * @return the KeyPhraseResult object itself. */ @@ -60,7 +58,7 @@ public KeyPhraseResult setDocuments(List documents) { /** * Get the errors property: Errors by document id. - * + * * @return the errors value. */ public List getErrors() { @@ -69,7 +67,7 @@ public List getErrors() { /** * Set the errors property: Errors by document id. - * + * * @param errors the errors value to set. * @return the KeyPhraseResult object itself. */ @@ -79,9 +77,9 @@ public KeyPhraseResult setErrors(List errors) { } /** - * Get the statistics property: if showStats=true was specified in the - * request this field will contain information about the request payload. - * + * Get the statistics property: if showStats=true was specified in the request this field will contain information + * about the request payload. + * * @return the statistics value. */ public RequestStatistics getStatistics() { @@ -89,9 +87,9 @@ public RequestStatistics getStatistics() { } /** - * Set the statistics property: if showStats=true was specified in the - * request this field will contain information about the request payload. - * + * Set the statistics property: if showStats=true was specified in the request this field will contain information + * about the request payload. + * * @param statistics the statistics value to set. * @return the KeyPhraseResult object itself. */ @@ -101,9 +99,8 @@ public KeyPhraseResult setStatistics(RequestStatistics statistics) { } /** - * Get the modelVersion property: This field indicates which model is used - * for scoring. - * + * Get the modelVersion property: This field indicates which model is used for scoring. + * * @return the modelVersion value. */ public String getModelVersion() { @@ -111,9 +108,8 @@ public String getModelVersion() { } /** - * Set the modelVersion property: This field indicates which model is used - * for scoring. - * + * Set the modelVersion property: This field indicates which model is used for scoring. + * * @param modelVersion the modelVersion value to set. * @return the KeyPhraseResult object itself. */ diff --git a/sdk/textanalytics/azure-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/implementation/models/LanguageBatchInput.java b/sdk/textanalytics/azure-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/implementation/models/LanguageBatchInput.java index 4ff3423367c42..2e1bde460b170 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/implementation/models/LanguageBatchInput.java +++ b/sdk/textanalytics/azure-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/implementation/models/LanguageBatchInput.java @@ -8,9 +8,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** - * The LanguageBatchInput model. - */ +/** The LanguageBatchInput model. */ @Fluent public final class LanguageBatchInput { /* @@ -21,7 +19,7 @@ public final class LanguageBatchInput { /** * Get the documents property: The documents property. - * + * * @return the documents value. */ public List getDocuments() { @@ -30,7 +28,7 @@ public List getDocuments() { /** * Set the documents property: The documents property. - * + * * @param documents the documents value to set. * @return the LanguageBatchInput object itself. */ diff --git a/sdk/textanalytics/azure-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/implementation/models/LanguageInput.java b/sdk/textanalytics/azure-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/implementation/models/LanguageInput.java index 2a9d7d3f91b55..d81ea140b1a0c 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/implementation/models/LanguageInput.java +++ b/sdk/textanalytics/azure-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/implementation/models/LanguageInput.java @@ -7,9 +7,7 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** - * The LanguageInput model. - */ +/** The LanguageInput model. */ @Fluent public final class LanguageInput { /* @@ -32,7 +30,7 @@ public final class LanguageInput { /** * Get the id property: Unique, non-empty document identifier. - * + * * @return the id value. */ public String getId() { @@ -41,7 +39,7 @@ public String getId() { /** * Set the id property: Unique, non-empty document identifier. - * + * * @param id the id value to set. * @return the LanguageInput object itself. */ @@ -52,7 +50,7 @@ public LanguageInput setId(String id) { /** * Get the text property: The text property. - * + * * @return the text value. */ public String getText() { @@ -61,7 +59,7 @@ public String getText() { /** * Set the text property: The text property. - * + * * @param text the text value to set. * @return the LanguageInput object itself. */ @@ -72,7 +70,7 @@ public LanguageInput setText(String text) { /** * Get the countryHint property: The countryHint property. - * + * * @return the countryHint value. */ public String getCountryHint() { @@ -81,7 +79,7 @@ public String getCountryHint() { /** * Set the countryHint property: The countryHint property. - * + * * @param countryHint the countryHint value to set. * @return the LanguageInput object itself. */ diff --git a/sdk/textanalytics/azure-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/implementation/models/LanguageResult.java b/sdk/textanalytics/azure-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/implementation/models/LanguageResult.java index 46515f53c93be..be55cd24b5d25 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/implementation/models/LanguageResult.java +++ b/sdk/textanalytics/azure-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/implementation/models/LanguageResult.java @@ -8,9 +8,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** - * The LanguageResult model. - */ +/** The LanguageResult model. */ @Fluent public final class LanguageResult { /* @@ -40,7 +38,7 @@ public final class LanguageResult { /** * Get the documents property: Response by document. - * + * * @return the documents value. */ public List getDocuments() { @@ -49,7 +47,7 @@ public List getDocuments() { /** * Set the documents property: Response by document. - * + * * @param documents the documents value to set. * @return the LanguageResult object itself. */ @@ -60,7 +58,7 @@ public LanguageResult setDocuments(List documents) { /** * Get the errors property: Errors by document id. - * + * * @return the errors value. */ public List getErrors() { @@ -69,7 +67,7 @@ public List getErrors() { /** * Set the errors property: Errors by document id. - * + * * @param errors the errors value to set. * @return the LanguageResult object itself. */ @@ -79,9 +77,9 @@ public LanguageResult setErrors(List errors) { } /** - * Get the statistics property: if showStats=true was specified in the - * request this field will contain information about the request payload. - * + * Get the statistics property: if showStats=true was specified in the request this field will contain information + * about the request payload. + * * @return the statistics value. */ public RequestStatistics getStatistics() { @@ -89,9 +87,9 @@ public RequestStatistics getStatistics() { } /** - * Set the statistics property: if showStats=true was specified in the - * request this field will contain information about the request payload. - * + * Set the statistics property: if showStats=true was specified in the request this field will contain information + * about the request payload. + * * @param statistics the statistics value to set. * @return the LanguageResult object itself. */ @@ -101,9 +99,8 @@ public LanguageResult setStatistics(RequestStatistics statistics) { } /** - * Get the modelVersion property: This field indicates which model is used - * for scoring. - * + * Get the modelVersion property: This field indicates which model is used for scoring. + * * @return the modelVersion value. */ public String getModelVersion() { @@ -111,9 +108,8 @@ public String getModelVersion() { } /** - * Set the modelVersion property: This field indicates which model is used - * for scoring. - * + * Set the modelVersion property: This field indicates which model is used for scoring. + * * @param modelVersion the modelVersion value to set. * @return the LanguageResult object itself. */ diff --git a/sdk/textanalytics/azure-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/implementation/models/LinkedEntity.java b/sdk/textanalytics/azure-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/implementation/models/LinkedEntity.java index 18df75ef5dafd..3be72691aa8eb 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/implementation/models/LinkedEntity.java +++ b/sdk/textanalytics/azure-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/implementation/models/LinkedEntity.java @@ -8,9 +8,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** - * The LinkedEntity model. - */ +/** The LinkedEntity model. */ @Fluent public final class LinkedEntity { /* @@ -51,7 +49,7 @@ public final class LinkedEntity { /** * Get the name property: Entity Linking formal name. - * + * * @return the name value. */ public String getName() { @@ -60,7 +58,7 @@ public String getName() { /** * Set the name property: Entity Linking formal name. - * + * * @param name the name value to set. * @return the LinkedEntity object itself. */ @@ -70,9 +68,8 @@ public LinkedEntity setName(String name) { } /** - * Get the matches property: List of instances this entity appears in the - * text. - * + * Get the matches property: List of instances this entity appears in the text. + * * @return the matches value. */ public List getMatches() { @@ -80,9 +77,8 @@ public List getMatches() { } /** - * Set the matches property: List of instances this entity appears in the - * text. - * + * Set the matches property: List of instances this entity appears in the text. + * * @param matches the matches value to set. * @return the LinkedEntity object itself. */ @@ -93,7 +89,7 @@ public LinkedEntity setMatches(List matches) { /** * Get the language property: Language used in the data source. - * + * * @return the language value. */ public String getLanguage() { @@ -102,7 +98,7 @@ public String getLanguage() { /** * Set the language property: Language used in the data source. - * + * * @param language the language value to set. * @return the LinkedEntity object itself. */ @@ -112,9 +108,8 @@ public LinkedEntity setLanguage(String language) { } /** - * Get the id property: Unique identifier of the recognized entity from the - * data source. - * + * Get the id property: Unique identifier of the recognized entity from the data source. + * * @return the id value. */ public String getId() { @@ -122,9 +117,8 @@ public String getId() { } /** - * Set the id property: Unique identifier of the recognized entity from the - * data source. - * + * Set the id property: Unique identifier of the recognized entity from the data source. + * * @param id the id value to set. * @return the LinkedEntity object itself. */ @@ -135,7 +129,7 @@ public LinkedEntity setId(String id) { /** * Get the url property: URL for the entity's page from the data source. - * + * * @return the url value. */ public String getUrl() { @@ -144,7 +138,7 @@ public String getUrl() { /** * Set the url property: URL for the entity's page from the data source. - * + * * @param url the url value to set. * @return the LinkedEntity object itself. */ @@ -154,9 +148,8 @@ public LinkedEntity setUrl(String url) { } /** - * Get the dataSource property: Data source used to extract entity linking, - * such as Wiki/Bing etc. - * + * Get the dataSource property: Data source used to extract entity linking, such as Wiki/Bing etc. + * * @return the dataSource value. */ public String getDataSource() { @@ -164,9 +157,8 @@ public String getDataSource() { } /** - * Set the dataSource property: Data source used to extract entity linking, - * such as Wiki/Bing etc. - * + * Set the dataSource property: Data source used to extract entity linking, such as Wiki/Bing etc. + * * @param dataSource the dataSource value to set. * @return the LinkedEntity object itself. */ diff --git a/sdk/textanalytics/azure-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/implementation/models/Match.java b/sdk/textanalytics/azure-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/implementation/models/Match.java index 19b4a45c097b2..197feeb7ca037 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/implementation/models/Match.java +++ b/sdk/textanalytics/azure-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/implementation/models/Match.java @@ -7,9 +7,7 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** - * The Match model. - */ +/** The Match model. */ @Fluent public final class Match { /* @@ -26,22 +24,21 @@ public final class Match { private String text; /* - * Start position (in Unicode characters) for the entity match text. + * Start position for the entity match text. */ @JsonProperty(value = "offset", required = true) private int offset; /* - * Length (in Unicode characters) for the entity match text. + * Length for the entity match text. */ @JsonProperty(value = "length", required = true) private int length; /** - * Get the confidenceScore property: If a well-known item is recognized, a - * decimal number denoting the confidence level between 0 and 1 will be - * returned. - * + * Get the confidenceScore property: If a well-known item is recognized, a decimal number denoting the confidence + * level between 0 and 1 will be returned. + * * @return the confidenceScore value. */ public double getConfidenceScore() { @@ -49,10 +46,9 @@ public double getConfidenceScore() { } /** - * Set the confidenceScore property: If a well-known item is recognized, a - * decimal number denoting the confidence level between 0 and 1 will be - * returned. - * + * Set the confidenceScore property: If a well-known item is recognized, a decimal number denoting the confidence + * level between 0 and 1 will be returned. + * * @param confidenceScore the confidenceScore value to set. * @return the Match object itself. */ @@ -63,7 +59,7 @@ public Match setConfidenceScore(double confidenceScore) { /** * Get the text property: Entity text as appears in the request. - * + * * @return the text value. */ public String getText() { @@ -72,7 +68,7 @@ public String getText() { /** * Set the text property: Entity text as appears in the request. - * + * * @param text the text value to set. * @return the Match object itself. */ @@ -82,9 +78,8 @@ public Match setText(String text) { } /** - * Get the offset property: Start position (in Unicode characters) for the - * entity match text. - * + * Get the offset property: Start position for the entity match text. + * * @return the offset value. */ public int getOffset() { @@ -92,9 +87,8 @@ public int getOffset() { } /** - * Set the offset property: Start position (in Unicode characters) for the - * entity match text. - * + * Set the offset property: Start position for the entity match text. + * * @param offset the offset value to set. * @return the Match object itself. */ @@ -104,9 +98,8 @@ public Match setOffset(int offset) { } /** - * Get the length property: Length (in Unicode characters) for the entity - * match text. - * + * Get the length property: Length for the entity match text. + * * @return the length value. */ public int getLength() { @@ -114,9 +107,8 @@ public int getLength() { } /** - * Set the length property: Length (in Unicode characters) for the entity - * match text. - * + * Set the length property: Length for the entity match text. + * * @param length the length value to set. * @return the Match object itself. */ diff --git a/sdk/textanalytics/azure-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/implementation/models/MultiLanguageBatchInput.java b/sdk/textanalytics/azure-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/implementation/models/MultiLanguageBatchInput.java index 285b47ab9b3c0..186e5923c357b 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/implementation/models/MultiLanguageBatchInput.java +++ b/sdk/textanalytics/azure-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/implementation/models/MultiLanguageBatchInput.java @@ -8,9 +8,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** - * The MultiLanguageBatchInput model. - */ +/** The MultiLanguageBatchInput model. */ @Fluent public final class MultiLanguageBatchInput { /* @@ -20,9 +18,8 @@ public final class MultiLanguageBatchInput { private List documents; /** - * Get the documents property: The set of documents to process as part of - * this batch. - * + * Get the documents property: The set of documents to process as part of this batch. + * * @return the documents value. */ public List getDocuments() { @@ -30,9 +27,8 @@ public List getDocuments() { } /** - * Set the documents property: The set of documents to process as part of - * this batch. - * + * Set the documents property: The set of documents to process as part of this batch. + * * @param documents the documents value to set. * @return the MultiLanguageBatchInput object itself. */ diff --git a/sdk/textanalytics/azure-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/implementation/models/MultiLanguageInput.java b/sdk/textanalytics/azure-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/implementation/models/MultiLanguageInput.java index f2ba9a4180365..b69c017d068c9 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/implementation/models/MultiLanguageInput.java +++ b/sdk/textanalytics/azure-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/implementation/models/MultiLanguageInput.java @@ -7,9 +7,7 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** - * The MultiLanguageInput model. - */ +/** The MultiLanguageInput model. */ @Fluent public final class MultiLanguageInput { /* @@ -34,7 +32,7 @@ public final class MultiLanguageInput { /** * Get the id property: A unique, non-empty document identifier. - * + * * @return the id value. */ public String getId() { @@ -43,7 +41,7 @@ public String getId() { /** * Set the id property: A unique, non-empty document identifier. - * + * * @param id the id value to set. * @return the MultiLanguageInput object itself. */ @@ -54,7 +52,7 @@ public MultiLanguageInput setId(String id) { /** * Get the text property: The input text to process. - * + * * @return the text value. */ public String getText() { @@ -63,7 +61,7 @@ public String getText() { /** * Set the text property: The input text to process. - * + * * @param text the text value to set. * @return the MultiLanguageInput object itself. */ @@ -73,10 +71,9 @@ public MultiLanguageInput setText(String text) { } /** - * Get the language property: (Optional) This is the 2 letter ISO 639-1 - * representation of a language. For example, use "en" for English; "es" - * for Spanish etc. If not set, use "en" for English as default. - * + * Get the language property: (Optional) This is the 2 letter ISO 639-1 representation of a language. For example, + * use "en" for English; "es" for Spanish etc. If not set, use "en" for English as default. + * * @return the language value. */ public String getLanguage() { @@ -84,10 +81,9 @@ public String getLanguage() { } /** - * Set the language property: (Optional) This is the 2 letter ISO 639-1 - * representation of a language. For example, use "en" for English; "es" - * for Spanish etc. If not set, use "en" for English as default. - * + * Set the language property: (Optional) This is the 2 letter ISO 639-1 representation of a language. For example, + * use "en" for English; "es" for Spanish etc. If not set, use "en" for English as default. + * * @param language the language value to set. * @return the MultiLanguageInput object itself. */ diff --git a/sdk/textanalytics/azure-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/implementation/models/RequestStatistics.java b/sdk/textanalytics/azure-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/implementation/models/RequestStatistics.java index ceb0be002998e..653a40960b82b 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/implementation/models/RequestStatistics.java +++ b/sdk/textanalytics/azure-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/implementation/models/RequestStatistics.java @@ -7,9 +7,7 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** - * The RequestStatistics model. - */ +/** The RequestStatistics model. */ @Fluent public final class RequestStatistics { /* @@ -39,9 +37,8 @@ public final class RequestStatistics { private long transactionsCount; /** - * Get the documentsCount property: Number of documents submitted in the - * request. - * + * Get the documentsCount property: Number of documents submitted in the request. + * * @return the documentsCount value. */ public int getDocumentsCount() { @@ -49,9 +46,8 @@ public int getDocumentsCount() { } /** - * Set the documentsCount property: Number of documents submitted in the - * request. - * + * Set the documentsCount property: Number of documents submitted in the request. + * * @param documentsCount the documentsCount value to set. * @return the RequestStatistics object itself. */ @@ -61,9 +57,9 @@ public RequestStatistics setDocumentsCount(int documentsCount) { } /** - * Get the validDocumentsCount property: Number of valid documents. This - * excludes empty, over-size limit or non-supported languages documents. - * + * Get the validDocumentsCount property: Number of valid documents. This excludes empty, over-size limit or + * non-supported languages documents. + * * @return the validDocumentsCount value. */ public int getValidDocumentsCount() { @@ -71,9 +67,9 @@ public int getValidDocumentsCount() { } /** - * Set the validDocumentsCount property: Number of valid documents. This - * excludes empty, over-size limit or non-supported languages documents. - * + * Set the validDocumentsCount property: Number of valid documents. This excludes empty, over-size limit or + * non-supported languages documents. + * * @param validDocumentsCount the validDocumentsCount value to set. * @return the RequestStatistics object itself. */ @@ -83,10 +79,9 @@ public RequestStatistics setValidDocumentsCount(int validDocumentsCount) { } /** - * Get the erroneousDocumentsCount property: Number of invalid documents. - * This includes empty, over-size limit or non-supported languages - * documents. - * + * Get the erroneousDocumentsCount property: Number of invalid documents. This includes empty, over-size limit or + * non-supported languages documents. + * * @return the erroneousDocumentsCount value. */ public int getErroneousDocumentsCount() { @@ -94,10 +89,9 @@ public int getErroneousDocumentsCount() { } /** - * Set the erroneousDocumentsCount property: Number of invalid documents. - * This includes empty, over-size limit or non-supported languages - * documents. - * + * Set the erroneousDocumentsCount property: Number of invalid documents. This includes empty, over-size limit or + * non-supported languages documents. + * * @param erroneousDocumentsCount the erroneousDocumentsCount value to set. * @return the RequestStatistics object itself. */ @@ -107,9 +101,8 @@ public RequestStatistics setErroneousDocumentsCount(int erroneousDocumentsCount) } /** - * Get the transactionsCount property: Number of transactions for the - * request. - * + * Get the transactionsCount property: Number of transactions for the request. + * * @return the transactionsCount value. */ public long getTransactionsCount() { @@ -117,9 +110,8 @@ public long getTransactionsCount() { } /** - * Set the transactionsCount property: Number of transactions for the - * request. - * + * Set the transactionsCount property: Number of transactions for the request. + * * @param transactionsCount the transactionsCount value to set. * @return the RequestStatistics object itself. */ diff --git a/sdk/textanalytics/azure-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/implementation/models/SentenceAspect.java b/sdk/textanalytics/azure-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/implementation/models/SentenceAspect.java new file mode 100644 index 0000000000000..37a7b5ff14495 --- /dev/null +++ b/sdk/textanalytics/azure-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/implementation/models/SentenceAspect.java @@ -0,0 +1,170 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.ai.textanalytics.implementation.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The SentenceAspect model. */ +@Fluent +public final class SentenceAspect { + /* + * Aspect level sentiment for the aspect in the sentence. + */ + @JsonProperty(value = "sentiment", required = true) + private SentenceAspectSentiment sentiment; + + /* + * Aspect level sentiment confidence scores for the aspect in the sentence. + */ + @JsonProperty(value = "confidenceScores", required = true) + private AspectConfidenceScoreLabel confidenceScores; + + /* + * The aspect offset from the start of the sentence. + */ + @JsonProperty(value = "offset", required = true) + private int offset; + + /* + * The length of the aspect. + */ + @JsonProperty(value = "length", required = true) + private int length; + + /* + * The aspect text detected. + */ + @JsonProperty(value = "text", required = true) + private String text; + + /* + * The array of either opinion or aspect object which is related to the + * aspect. + */ + @JsonProperty(value = "relations", required = true) + private List relations; + + /** + * Get the sentiment property: Aspect level sentiment for the aspect in the sentence. + * + * @return the sentiment value. + */ + public SentenceAspectSentiment getSentiment() { + return this.sentiment; + } + + /** + * Set the sentiment property: Aspect level sentiment for the aspect in the sentence. + * + * @param sentiment the sentiment value to set. + * @return the SentenceAspect object itself. + */ + public SentenceAspect setSentiment(SentenceAspectSentiment sentiment) { + this.sentiment = sentiment; + return this; + } + + /** + * Get the confidenceScores property: Aspect level sentiment confidence scores for the aspect in the sentence. + * + * @return the confidenceScores value. + */ + public AspectConfidenceScoreLabel getConfidenceScores() { + return this.confidenceScores; + } + + /** + * Set the confidenceScores property: Aspect level sentiment confidence scores for the aspect in the sentence. + * + * @param confidenceScores the confidenceScores value to set. + * @return the SentenceAspect object itself. + */ + public SentenceAspect setConfidenceScores(AspectConfidenceScoreLabel confidenceScores) { + this.confidenceScores = confidenceScores; + return this; + } + + /** + * Get the offset property: The aspect offset from the start of the sentence. + * + * @return the offset value. + */ + public int getOffset() { + return this.offset; + } + + /** + * Set the offset property: The aspect offset from the start of the sentence. + * + * @param offset the offset value to set. + * @return the SentenceAspect object itself. + */ + public SentenceAspect setOffset(int offset) { + this.offset = offset; + return this; + } + + /** + * Get the length property: The length of the aspect. + * + * @return the length value. + */ + public int getLength() { + return this.length; + } + + /** + * Set the length property: The length of the aspect. + * + * @param length the length value to set. + * @return the SentenceAspect object itself. + */ + public SentenceAspect setLength(int length) { + this.length = length; + return this; + } + + /** + * Get the text property: The aspect text detected. + * + * @return the text value. + */ + public String getText() { + return this.text; + } + + /** + * Set the text property: The aspect text detected. + * + * @param text the text value to set. + * @return the SentenceAspect object itself. + */ + public SentenceAspect setText(String text) { + this.text = text; + return this; + } + + /** + * Get the relations property: The array of either opinion or aspect object which is related to the aspect. + * + * @return the relations value. + */ + public List getRelations() { + return this.relations; + } + + /** + * Set the relations property: The array of either opinion or aspect object which is related to the aspect. + * + * @param relations the relations value to set. + * @return the SentenceAspect object itself. + */ + public SentenceAspect setRelations(List relations) { + this.relations = relations; + return this; + } +} diff --git a/sdk/textanalytics/azure-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/implementation/models/SentenceAspectSentiment.java b/sdk/textanalytics/azure-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/implementation/models/SentenceAspectSentiment.java new file mode 100644 index 0000000000000..efb6a08ee97e4 --- /dev/null +++ b/sdk/textanalytics/azure-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/implementation/models/SentenceAspectSentiment.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.ai.textanalytics.implementation.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for SentenceAspectSentiment. */ +public final class SentenceAspectSentiment extends ExpandableStringEnum { + /** Static value positive for SentenceAspectSentiment. */ + public static final SentenceAspectSentiment POSITIVE = fromString("positive"); + + /** Static value mixed for SentenceAspectSentiment. */ + public static final SentenceAspectSentiment MIXED = fromString("mixed"); + + /** Static value negative for SentenceAspectSentiment. */ + public static final SentenceAspectSentiment NEGATIVE = fromString("negative"); + + /** + * Creates or finds a SentenceAspectSentiment from its string representation. + * + * @param name a name to look for. + * @return the corresponding SentenceAspectSentiment. + */ + @JsonCreator + public static SentenceAspectSentiment fromString(String name) { + return fromString(name, SentenceAspectSentiment.class); + } + + /** @return known SentenceAspectSentiment values. */ + public static Collection values() { + return values(SentenceAspectSentiment.class); + } +} diff --git a/sdk/textanalytics/azure-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/implementation/models/SentenceOpinion.java b/sdk/textanalytics/azure-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/implementation/models/SentenceOpinion.java new file mode 100644 index 0000000000000..bce2356d9fc78 --- /dev/null +++ b/sdk/textanalytics/azure-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/implementation/models/SentenceOpinion.java @@ -0,0 +1,169 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.ai.textanalytics.implementation.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The SentenceOpinion model. */ +@Fluent +public final class SentenceOpinion { + /* + * Opinion level sentiment for the aspect in the sentence. + */ + @JsonProperty(value = "sentiment", required = true) + private SentenceOpinionSentiment sentiment; + + /* + * Opinion level sentiment confidence scores for the aspect in the + * sentence. + */ + @JsonProperty(value = "confidenceScores", required = true) + private AspectConfidenceScoreLabel confidenceScores; + + /* + * The opinion offset from the start of the sentence. + */ + @JsonProperty(value = "offset", required = true) + private int offset; + + /* + * The length of the opinion. + */ + @JsonProperty(value = "length", required = true) + private int length; + + /* + * The aspect text detected. + */ + @JsonProperty(value = "text", required = true) + private String text; + + /* + * The indicator representing if the opinion is negated. + */ + @JsonProperty(value = "isNegated", required = true) + private boolean isNegated; + + /** + * Get the sentiment property: Opinion level sentiment for the aspect in the sentence. + * + * @return the sentiment value. + */ + public SentenceOpinionSentiment getSentiment() { + return this.sentiment; + } + + /** + * Set the sentiment property: Opinion level sentiment for the aspect in the sentence. + * + * @param sentiment the sentiment value to set. + * @return the SentenceOpinion object itself. + */ + public SentenceOpinion setSentiment(SentenceOpinionSentiment sentiment) { + this.sentiment = sentiment; + return this; + } + + /** + * Get the confidenceScores property: Opinion level sentiment confidence scores for the aspect in the sentence. + * + * @return the confidenceScores value. + */ + public AspectConfidenceScoreLabel getConfidenceScores() { + return this.confidenceScores; + } + + /** + * Set the confidenceScores property: Opinion level sentiment confidence scores for the aspect in the sentence. + * + * @param confidenceScores the confidenceScores value to set. + * @return the SentenceOpinion object itself. + */ + public SentenceOpinion setConfidenceScores(AspectConfidenceScoreLabel confidenceScores) { + this.confidenceScores = confidenceScores; + return this; + } + + /** + * Get the offset property: The opinion offset from the start of the sentence. + * + * @return the offset value. + */ + public int getOffset() { + return this.offset; + } + + /** + * Set the offset property: The opinion offset from the start of the sentence. + * + * @param offset the offset value to set. + * @return the SentenceOpinion object itself. + */ + public SentenceOpinion setOffset(int offset) { + this.offset = offset; + return this; + } + + /** + * Get the length property: The length of the opinion. + * + * @return the length value. + */ + public int getLength() { + return this.length; + } + + /** + * Set the length property: The length of the opinion. + * + * @param length the length value to set. + * @return the SentenceOpinion object itself. + */ + public SentenceOpinion setLength(int length) { + this.length = length; + return this; + } + + /** + * Get the text property: The aspect text detected. + * + * @return the text value. + */ + public String getText() { + return this.text; + } + + /** + * Set the text property: The aspect text detected. + * + * @param text the text value to set. + * @return the SentenceOpinion object itself. + */ + public SentenceOpinion setText(String text) { + this.text = text; + return this; + } + + /** + * Get the isNegated property: The indicator representing if the opinion is negated. + * + * @return the isNegated value. + */ + public boolean isNegated() { + return this.isNegated; + } + + /** + * Set the isNegated property: The indicator representing if the opinion is negated. + * + * @param isNegated the isNegated value to set. + * @return the SentenceOpinion object itself. + */ + public SentenceOpinion setIsNegated(boolean isNegated) { + this.isNegated = isNegated; + return this; + } +} diff --git a/sdk/textanalytics/azure-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/implementation/models/SentenceOpinionSentiment.java b/sdk/textanalytics/azure-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/implementation/models/SentenceOpinionSentiment.java new file mode 100644 index 0000000000000..976677a4f2e50 --- /dev/null +++ b/sdk/textanalytics/azure-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/implementation/models/SentenceOpinionSentiment.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.ai.textanalytics.implementation.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for SentenceOpinionSentiment. */ +public final class SentenceOpinionSentiment extends ExpandableStringEnum { + /** Static value positive for SentenceOpinionSentiment. */ + public static final SentenceOpinionSentiment POSITIVE = fromString("positive"); + + /** Static value mixed for SentenceOpinionSentiment. */ + public static final SentenceOpinionSentiment MIXED = fromString("mixed"); + + /** Static value negative for SentenceOpinionSentiment. */ + public static final SentenceOpinionSentiment NEGATIVE = fromString("negative"); + + /** + * Creates or finds a SentenceOpinionSentiment from its string representation. + * + * @param name a name to look for. + * @return the corresponding SentenceOpinionSentiment. + */ + @JsonCreator + public static SentenceOpinionSentiment fromString(String name) { + return fromString(name, SentenceOpinionSentiment.class); + } + + /** @return known SentenceOpinionSentiment values. */ + public static Collection values() { + return values(SentenceOpinionSentiment.class); + } +} diff --git a/sdk/textanalytics/azure-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/implementation/models/SentenceSentiment.java b/sdk/textanalytics/azure-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/implementation/models/SentenceSentiment.java index 600f1e838c8c7..5bdd3283c6808 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/implementation/models/SentenceSentiment.java +++ b/sdk/textanalytics/azure-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/implementation/models/SentenceSentiment.java @@ -6,16 +6,15 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; -/** - * The SentenceSentiment model. - */ +/** The SentenceSentiment model. */ @Fluent public final class SentenceSentiment { /* * The sentence text. */ - @JsonProperty(value = "text") + @JsonProperty(value = "text", required = true) private String text; /* @@ -38,14 +37,26 @@ public final class SentenceSentiment { private int offset; /* - * The length of the sentence by Unicode standard. + * The length of the sentence. */ @JsonProperty(value = "length", required = true) private int length; + /* + * The array of aspect object for the sentence. + */ + @JsonProperty(value = "aspects") + private List aspects; + + /* + * The array of opinion object for the sentence. + */ + @JsonProperty(value = "opinions") + private List opinions; + /** * Get the text property: The sentence text. - * + * * @return the text value. */ public String getText() { @@ -54,7 +65,7 @@ public String getText() { /** * Set the text property: The sentence text. - * + * * @param text the text value to set. * @return the SentenceSentiment object itself. */ @@ -65,7 +76,7 @@ public SentenceSentiment setText(String text) { /** * Get the sentiment property: The predicted Sentiment for the sentence. - * + * * @return the sentiment value. */ public SentenceSentimentValue getSentiment() { @@ -74,7 +85,7 @@ public SentenceSentimentValue getSentiment() { /** * Set the sentiment property: The predicted Sentiment for the sentence. - * + * * @param sentiment the sentiment value to set. * @return the SentenceSentiment object itself. */ @@ -84,9 +95,9 @@ public SentenceSentiment setSentiment(SentenceSentimentValue sentiment) { } /** - * Get the confidenceScores property: The sentiment confidence score - * between 0 and 1 for the sentence for all classes. - * + * Get the confidenceScores property: The sentiment confidence score between 0 and 1 for the sentence for all + * classes. + * * @return the confidenceScores value. */ public SentimentConfidenceScorePerLabel getConfidenceScores() { @@ -94,9 +105,9 @@ public SentimentConfidenceScorePerLabel getConfidenceScores() { } /** - * Set the confidenceScores property: The sentiment confidence score - * between 0 and 1 for the sentence for all classes. - * + * Set the confidenceScores property: The sentiment confidence score between 0 and 1 for the sentence for all + * classes. + * * @param confidenceScores the confidenceScores value to set. * @return the SentenceSentiment object itself. */ @@ -106,9 +117,8 @@ public SentenceSentiment setConfidenceScores(SentimentConfidenceScorePerLabel co } /** - * Get the offset property: The sentence offset from the start of the - * document. - * + * Get the offset property: The sentence offset from the start of the document. + * * @return the offset value. */ public int getOffset() { @@ -116,9 +126,8 @@ public int getOffset() { } /** - * Set the offset property: The sentence offset from the start of the - * document. - * + * Set the offset property: The sentence offset from the start of the document. + * * @param offset the offset value to set. * @return the SentenceSentiment object itself. */ @@ -128,8 +137,8 @@ public SentenceSentiment setOffset(int offset) { } /** - * Get the length property: The length of the sentence by Unicode standard. - * + * Get the length property: The length of the sentence. + * * @return the length value. */ public int getLength() { @@ -137,8 +146,8 @@ public int getLength() { } /** - * Set the length property: The length of the sentence by Unicode standard. - * + * Set the length property: The length of the sentence. + * * @param length the length value to set. * @return the SentenceSentiment object itself. */ @@ -146,4 +155,44 @@ public SentenceSentiment setLength(int length) { this.length = length; return this; } + + /** + * Get the aspects property: The array of aspect object for the sentence. + * + * @return the aspects value. + */ + public List getAspects() { + return this.aspects; + } + + /** + * Set the aspects property: The array of aspect object for the sentence. + * + * @param aspects the aspects value to set. + * @return the SentenceSentiment object itself. + */ + public SentenceSentiment setAspects(List aspects) { + this.aspects = aspects; + return this; + } + + /** + * Get the opinions property: The array of opinion object for the sentence. + * + * @return the opinions value. + */ + public List getOpinions() { + return this.opinions; + } + + /** + * Set the opinions property: The array of opinion object for the sentence. + * + * @param opinions the opinions value to set. + * @return the SentenceSentiment object itself. + */ + public SentenceSentiment setOpinions(List opinions) { + this.opinions = opinions; + return this; + } } diff --git a/sdk/textanalytics/azure-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/implementation/models/SentenceSentimentValue.java b/sdk/textanalytics/azure-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/implementation/models/SentenceSentimentValue.java index c80b516477d59..5be87d8a7036f 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/implementation/models/SentenceSentimentValue.java +++ b/sdk/textanalytics/azure-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/implementation/models/SentenceSentimentValue.java @@ -7,28 +7,18 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; -/** - * Defines values for SentenceSentimentValue. - */ +/** Defines values for SentenceSentimentValue. */ public enum SentenceSentimentValue { - /** - * Enum value positive. - */ + /** Enum value positive. */ POSITIVE("positive"), - /** - * Enum value neutral. - */ + /** Enum value neutral. */ NEUTRAL("neutral"), - /** - * Enum value negative. - */ + /** Enum value negative. */ NEGATIVE("negative"); - /** - * The actual serialized value for a SentenceSentimentValue instance. - */ + /** The actual serialized value for a SentenceSentimentValue instance. */ private final String value; SentenceSentimentValue(String value) { @@ -37,7 +27,7 @@ public enum SentenceSentimentValue { /** * Parses a serialized value to a SentenceSentimentValue instance. - * + * * @param value the serialized value to parse. * @return the parsed SentenceSentimentValue object, or null if unable to parse. */ diff --git a/sdk/textanalytics/azure-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/implementation/models/SentimentConfidenceScorePerLabel.java b/sdk/textanalytics/azure-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/implementation/models/SentimentConfidenceScorePerLabel.java index 9c7561cf86b60..94da963ed515a 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/implementation/models/SentimentConfidenceScorePerLabel.java +++ b/sdk/textanalytics/azure-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/implementation/models/SentimentConfidenceScorePerLabel.java @@ -7,9 +7,7 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** - * The SentimentConfidenceScorePerLabel model. - */ +/** The SentimentConfidenceScorePerLabel model. */ @Fluent public final class SentimentConfidenceScorePerLabel { /* @@ -32,7 +30,7 @@ public final class SentimentConfidenceScorePerLabel { /** * Get the positive property: The positive property. - * + * * @return the positive value. */ public double getPositive() { @@ -41,7 +39,7 @@ public double getPositive() { /** * Set the positive property: The positive property. - * + * * @param positive the positive value to set. * @return the SentimentConfidenceScorePerLabel object itself. */ @@ -52,7 +50,7 @@ public SentimentConfidenceScorePerLabel setPositive(double positive) { /** * Get the neutral property: The neutral property. - * + * * @return the neutral value. */ public double getNeutral() { @@ -61,7 +59,7 @@ public double getNeutral() { /** * Set the neutral property: The neutral property. - * + * * @param neutral the neutral value to set. * @return the SentimentConfidenceScorePerLabel object itself. */ @@ -72,7 +70,7 @@ public SentimentConfidenceScorePerLabel setNeutral(double neutral) { /** * Get the negative property: The negative property. - * + * * @return the negative value. */ public double getNegative() { @@ -81,7 +79,7 @@ public double getNegative() { /** * Set the negative property: The negative property. - * + * * @param negative the negative value to set. * @return the SentimentConfidenceScorePerLabel object itself. */ diff --git a/sdk/textanalytics/azure-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/implementation/models/SentimentResponse.java b/sdk/textanalytics/azure-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/implementation/models/SentimentResponse.java index b9175434c7200..f2b2394796892 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/implementation/models/SentimentResponse.java +++ b/sdk/textanalytics/azure-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/implementation/models/SentimentResponse.java @@ -8,9 +8,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** - * The SentimentResponse model. - */ +/** The SentimentResponse model. */ @Fluent public final class SentimentResponse { /* @@ -40,7 +38,7 @@ public final class SentimentResponse { /** * Get the documents property: Sentiment analysis per document. - * + * * @return the documents value. */ public List getDocuments() { @@ -49,7 +47,7 @@ public List getDocuments() { /** * Set the documents property: Sentiment analysis per document. - * + * * @param documents the documents value to set. * @return the SentimentResponse object itself. */ @@ -60,7 +58,7 @@ public SentimentResponse setDocuments(List documents) { /** * Get the errors property: Errors by document id. - * + * * @return the errors value. */ public List getErrors() { @@ -69,7 +67,7 @@ public List getErrors() { /** * Set the errors property: Errors by document id. - * + * * @param errors the errors value to set. * @return the SentimentResponse object itself. */ @@ -79,9 +77,9 @@ public SentimentResponse setErrors(List errors) { } /** - * Get the statistics property: if showStats=true was specified in the - * request this field will contain information about the request payload. - * + * Get the statistics property: if showStats=true was specified in the request this field will contain information + * about the request payload. + * * @return the statistics value. */ public RequestStatistics getStatistics() { @@ -89,9 +87,9 @@ public RequestStatistics getStatistics() { } /** - * Set the statistics property: if showStats=true was specified in the - * request this field will contain information about the request payload. - * + * Set the statistics property: if showStats=true was specified in the request this field will contain information + * about the request payload. + * * @param statistics the statistics value to set. * @return the SentimentResponse object itself. */ @@ -101,9 +99,8 @@ public SentimentResponse setStatistics(RequestStatistics statistics) { } /** - * Get the modelVersion property: This field indicates which model is used - * for scoring. - * + * Get the modelVersion property: This field indicates which model is used for scoring. + * * @return the modelVersion value. */ public String getModelVersion() { @@ -111,9 +108,8 @@ public String getModelVersion() { } /** - * Set the modelVersion property: This field indicates which model is used - * for scoring. - * + * Set the modelVersion property: This field indicates which model is used for scoring. + * * @param modelVersion the modelVersion value to set. * @return the SentimentResponse object itself. */ diff --git a/sdk/textanalytics/azure-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/implementation/models/TextAnalyticsError.java b/sdk/textanalytics/azure-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/implementation/models/TextAnalyticsError.java index 5e5d1a837d602..e3da62cd7a965 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/implementation/models/TextAnalyticsError.java +++ b/sdk/textanalytics/azure-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/implementation/models/TextAnalyticsError.java @@ -8,9 +8,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** - * The TextAnalyticsError model. - */ +/** The TextAnalyticsError model. */ @Fluent public final class TextAnalyticsError { /* @@ -45,7 +43,7 @@ public final class TextAnalyticsError { /** * Get the code property: Error code. - * + * * @return the code value. */ public ErrorCodeValue getCode() { @@ -54,7 +52,7 @@ public ErrorCodeValue getCode() { /** * Set the code property: Error code. - * + * * @param code the code value to set. * @return the TextAnalyticsError object itself. */ @@ -65,7 +63,7 @@ public TextAnalyticsError setCode(ErrorCodeValue code) { /** * Get the message property: Error message. - * + * * @return the message value. */ public String getMessage() { @@ -74,7 +72,7 @@ public String getMessage() { /** * Set the message property: Error message. - * + * * @param message the message value to set. * @return the TextAnalyticsError object itself. */ @@ -85,7 +83,7 @@ public TextAnalyticsError setMessage(String message) { /** * Get the target property: Error target. - * + * * @return the target value. */ public String getTarget() { @@ -94,7 +92,7 @@ public String getTarget() { /** * Set the target property: Error target. - * + * * @param target the target value to set. * @return the TextAnalyticsError object itself. */ @@ -104,9 +102,8 @@ public TextAnalyticsError setTarget(String target) { } /** - * Get the innererror property: Inner error contains more specific - * information. - * + * Get the innererror property: Inner error contains more specific information. + * * @return the innererror value. */ public InnerError getInnererror() { @@ -114,9 +111,8 @@ public InnerError getInnererror() { } /** - * Set the innererror property: Inner error contains more specific - * information. - * + * Set the innererror property: Inner error contains more specific information. + * * @param innererror the innererror value to set. * @return the TextAnalyticsError object itself. */ @@ -126,9 +122,8 @@ public TextAnalyticsError setInnererror(InnerError innererror) { } /** - * Get the details property: Details about specific errors that led to this - * reported error. - * + * Get the details property: Details about specific errors that led to this reported error. + * * @return the details value. */ public List getDetails() { @@ -136,9 +131,8 @@ public List getDetails() { } /** - * Set the details property: Details about specific errors that led to this - * reported error. - * + * Set the details property: Details about specific errors that led to this reported error. + * * @param details the details value to set. * @return the TextAnalyticsError object itself. */ diff --git a/sdk/textanalytics/azure-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/implementation/models/TextAnalyticsErrorException.java b/sdk/textanalytics/azure-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/implementation/models/TextAnalyticsErrorException.java index 64537e34050e4..f98cb2de2d13d 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/implementation/models/TextAnalyticsErrorException.java +++ b/sdk/textanalytics/azure-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/implementation/models/TextAnalyticsErrorException.java @@ -7,13 +7,11 @@ import com.azure.core.exception.HttpResponseException; import com.azure.core.http.HttpResponse; -/** - * Exception thrown for an invalid response with TextAnalyticsError information. - */ +/** Exception thrown for an invalid response with TextAnalyticsError information. */ public final class TextAnalyticsErrorException extends HttpResponseException { /** * Initializes a new instance of the TextAnalyticsErrorException class. - * + * * @param message the exception message or the response content if a message is not available. * @param response the HTTP response. */ @@ -23,7 +21,7 @@ public TextAnalyticsErrorException(String message, HttpResponse response) { /** * Initializes a new instance of the TextAnalyticsErrorException class. - * + * * @param message the exception message or the response content if a message is not available. * @param response the HTTP response. * @param value the deserialized response value. diff --git a/sdk/textanalytics/azure-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/implementation/models/TextAnalyticsWarning.java b/sdk/textanalytics/azure-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/implementation/models/TextAnalyticsWarning.java index 50318f1fbc3ae..bbd1e6c2b6fc1 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/implementation/models/TextAnalyticsWarning.java +++ b/sdk/textanalytics/azure-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/implementation/models/TextAnalyticsWarning.java @@ -7,9 +7,7 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** - * The TextAnalyticsWarning model. - */ +/** The TextAnalyticsWarning model. */ @Fluent public final class TextAnalyticsWarning { /* @@ -32,7 +30,7 @@ public final class TextAnalyticsWarning { /** * Get the code property: Error code. - * + * * @return the code value. */ public WarningCodeValue getCode() { @@ -41,7 +39,7 @@ public WarningCodeValue getCode() { /** * Set the code property: Error code. - * + * * @param code the code value to set. * @return the TextAnalyticsWarning object itself. */ @@ -52,7 +50,7 @@ public TextAnalyticsWarning setCode(WarningCodeValue code) { /** * Get the message property: Warning message. - * + * * @return the message value. */ public String getMessage() { @@ -61,7 +59,7 @@ public String getMessage() { /** * Set the message property: Warning message. - * + * * @param message the message value to set. * @return the TextAnalyticsWarning object itself. */ @@ -71,9 +69,8 @@ public TextAnalyticsWarning setMessage(String message) { } /** - * Get the targetRef property: A JSON pointer reference indicating the - * target object. - * + * Get the targetRef property: A JSON pointer reference indicating the target object. + * * @return the targetRef value. */ public String getTargetRef() { @@ -81,9 +78,8 @@ public String getTargetRef() { } /** - * Set the targetRef property: A JSON pointer reference indicating the - * target object. - * + * Set the targetRef property: A JSON pointer reference indicating the target object. + * * @param targetRef the targetRef value to set. * @return the TextAnalyticsWarning object itself. */ diff --git a/sdk/textanalytics/azure-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/implementation/models/WarningCodeValue.java b/sdk/textanalytics/azure-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/implementation/models/WarningCodeValue.java index d620e009cacfb..5aadf16b51b9c 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/implementation/models/WarningCodeValue.java +++ b/sdk/textanalytics/azure-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/implementation/models/WarningCodeValue.java @@ -7,23 +7,15 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; -/** - * Defines values for WarningCodeValue. - */ +/** Defines values for WarningCodeValue. */ public enum WarningCodeValue { - /** - * Enum value LongWordsInDocument. - */ + /** Enum value LongWordsInDocument. */ LONG_WORDS_IN_DOCUMENT("LongWordsInDocument"), - /** - * Enum value DocumentTruncated. - */ + /** Enum value DocumentTruncated. */ DOCUMENT_TRUNCATED("DocumentTruncated"); - /** - * The actual serialized value for a WarningCodeValue instance. - */ + /** The actual serialized value for a WarningCodeValue instance. */ private final String value; WarningCodeValue(String value) { @@ -32,7 +24,7 @@ public enum WarningCodeValue { /** * Parses a serialized value to a WarningCodeValue instance. - * + * * @param value the serialized value to parse. * @return the parsed WarningCodeValue object, or null if unable to parse. */ diff --git a/sdk/textanalytics/azure-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/implementation/models/package-info.java b/sdk/textanalytics/azure-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/implementation/models/package-info.java index 3e23bae65d862..99e5843b9cc75 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/implementation/models/package-info.java +++ b/sdk/textanalytics/azure-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/implementation/models/package-info.java @@ -3,14 +3,11 @@ // Code generated by Microsoft (R) AutoRest Code Generator. /** - * Package containing the data models for TextAnalyticsClient. - * The Text Analytics API is a suite of text analytics web services built with - * best-in-class Microsoft machine learning algorithms. The API can be used to - * analyze unstructured text for tasks such as sentiment analysis, key phrase - * extraction and language detection. No training data is needed to use this - * API; just bring your text data. This API uses advanced natural language - * processing techniques to deliver best in class predictions. Further - * documentation can be found in + * Package containing the data models for TextAnalyticsClient. The Text Analytics API is a suite of text analytics web + * services built with best-in-class Microsoft machine learning algorithms. The API can be used to analyze unstructured + * text for tasks such as sentiment analysis, key phrase extraction and language detection. No training data is needed + * to use this API; just bring your text data. This API uses advanced natural language processing techniques to deliver + * best in class predictions. Further documentation can be found in * https://docs.microsoft.com/en-us/azure/cognitive-services/text-analytics/overview. */ package com.azure.ai.textanalytics.implementation.models; diff --git a/sdk/textanalytics/azure-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/implementation/package-info.java b/sdk/textanalytics/azure-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/implementation/package-info.java index 14f77f46074d6..583ec2fb820b2 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/implementation/package-info.java +++ b/sdk/textanalytics/azure-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/implementation/package-info.java @@ -3,15 +3,11 @@ // Code generated by Microsoft (R) AutoRest Code Generator. /** - * Package containing the implementations and inner classes for - * TextAnalyticsClient. - * The Text Analytics API is a suite of text analytics web services built with - * best-in-class Microsoft machine learning algorithms. The API can be used to - * analyze unstructured text for tasks such as sentiment analysis, key phrase - * extraction and language detection. No training data is needed to use this - * API; just bring your text data. This API uses advanced natural language - * processing techniques to deliver best in class predictions. Further - * documentation can be found in + * Package containing the implementations and inner classes for TextAnalyticsClient. The Text Analytics API is a suite + * of text analytics web services built with best-in-class Microsoft machine learning algorithms. The API can be used to + * analyze unstructured text for tasks such as sentiment analysis, key phrase extraction and language detection. No + * training data is needed to use this API; just bring your text data. This API uses advanced natural language + * processing techniques to deliver best in class predictions. Further documentation can be found in * https://docs.microsoft.com/en-us/azure/cognitive-services/text-analytics/overview. */ package com.azure.ai.textanalytics.implementation; diff --git a/sdk/textanalytics/azure-ai-textanalytics/src/test/java/com/azure/ai/textanalytics/TextAnalyticsAsyncClientTest.java b/sdk/textanalytics/azure-ai-textanalytics/src/test/java/com/azure/ai/textanalytics/TextAnalyticsAsyncClientTest.java index 83de30a3024c7..d1ce483bfbbce 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/src/test/java/com/azure/ai/textanalytics/TextAnalyticsAsyncClientTest.java +++ b/sdk/textanalytics/azure-ai-textanalytics/src/test/java/com/azure/ai/textanalytics/TextAnalyticsAsyncClientTest.java @@ -9,6 +9,8 @@ import com.azure.ai.textanalytics.models.LinkedEntityMatch; import com.azure.ai.textanalytics.models.SentenceSentiment; import com.azure.ai.textanalytics.models.SentimentConfidenceScores; +import com.azure.ai.textanalytics.models.TextAnalyticsError; +import com.azure.ai.textanalytics.models.TextAnalyticsErrorCode; import com.azure.ai.textanalytics.models.TextAnalyticsException; import com.azure.ai.textanalytics.models.TextSentiment; import com.azure.core.exception.HttpResponseException; @@ -150,7 +152,8 @@ public void detectLanguageInvalidCountryHint(HttpClient httpClient, TextAnalytic client = getTextAnalyticsAsyncClient(httpClient, serviceVersion); StepVerifier.create(client.detectLanguage("Este es un documento escrito en Español.", "en")) .expectErrorMatches(throwable -> throwable instanceof TextAnalyticsException - && throwable.getMessage().equals(INVALID_COUNTRY_HINT_EXPECTED_EXCEPTION_MESSAGE)); + && throwable.getMessage().equals(INVALID_COUNTRY_HINT_EXPECTED_EXCEPTION_MESSAGE)) + .verify(); } /** @@ -162,7 +165,8 @@ public void detectLanguageEmptyText(HttpClient httpClient, TextAnalyticsServiceV client = getTextAnalyticsAsyncClient(httpClient, serviceVersion); StepVerifier.create(client.detectLanguage("")) .expectErrorMatches(throwable -> throwable instanceof TextAnalyticsException - && throwable.getMessage().equals(INVALID_DOCUMENT_EXPECTED_EXCEPTION_MESSAGE)); + && throwable.getMessage().equals(INVALID_DOCUMENT_EXPECTED_EXCEPTION_MESSAGE)) + .verify(); } /** @@ -233,7 +237,8 @@ public void recognizeEntitiesForEmptyText(HttpClient httpClient, TextAnalyticsSe client = getTextAnalyticsAsyncClient(httpClient, serviceVersion); StepVerifier.create(client.recognizeEntities("")) .expectErrorMatches(throwable -> throwable instanceof TextAnalyticsException - && throwable.getMessage().equals(INVALID_DOCUMENT_EXPECTED_EXCEPTION_MESSAGE)); + && throwable.getMessage().equals(INVALID_DOCUMENT_EXPECTED_EXCEPTION_MESSAGE)) + .verify(); } @ParameterizedTest(name = DISPLAY_NAME_WITH_ARGUMENTS) @@ -260,8 +265,15 @@ public void recognizeEntitiesBatchInputSingleError(HttpClient httpClient, TextAn client = getTextAnalyticsAsyncClient(httpClient, serviceVersion); recognizeBatchCategorizedEntitySingleErrorRunner((inputs) -> StepVerifier.create(client.recognizeEntitiesBatchWithResponse(inputs, null)) - .expectErrorMatches(throwable -> throwable instanceof TextAnalyticsException - && throwable.getMessage().equals(BATCH_ERROR_EXCEPTION_MESSAGE))); + .assertNext(resultCollection -> { + resultCollection.getValue().forEach(result -> { + assertTrue(result.isError()); + final TextAnalyticsError error = result.getError(); + TextAnalyticsErrorCode errorCode = error.getErrorCode(); + assertTrue(TextAnalyticsErrorCode.fromString("invalidDocument").equals(errorCode)); + assertTrue("Document text is empty.".equals(error.getMessage())); + }); + }).verifyComplete()); } @ParameterizedTest(name = DISPLAY_NAME_WITH_ARGUMENTS) @@ -348,7 +360,8 @@ public void recognizeLinkedEntitiesForEmptyText(HttpClient httpClient, TextAnaly client = getTextAnalyticsAsyncClient(httpClient, serviceVersion); StepVerifier.create(client.recognizeLinkedEntities("")) .expectErrorMatches(throwable -> throwable instanceof TextAnalyticsException - && throwable.getMessage().equals(INVALID_DOCUMENT_EXPECTED_EXCEPTION_MESSAGE)); + && throwable.getMessage().equals(INVALID_DOCUMENT_EXPECTED_EXCEPTION_MESSAGE)) + .verify(); } @ParameterizedTest(name = DISPLAY_NAME_WITH_ARGUMENTS) @@ -450,7 +463,8 @@ public void extractKeyPhrasesForEmptyText(HttpClient httpClient, TextAnalyticsSe client = getTextAnalyticsAsyncClient(httpClient, serviceVersion); StepVerifier.create(client.extractKeyPhrases("")) .expectErrorMatches(throwable -> throwable instanceof TextAnalyticsException - && throwable.getMessage().equals(INVALID_DOCUMENT_EXPECTED_EXCEPTION_MESSAGE)); + && throwable.getMessage().equals(INVALID_DOCUMENT_EXPECTED_EXCEPTION_MESSAGE)) + .verify(); } @ParameterizedTest(name = DISPLAY_NAME_WITH_ARGUMENTS) @@ -584,7 +598,8 @@ public void analyzeSentimentForEmptyText(HttpClient httpClient, TextAnalyticsSer client = getTextAnalyticsAsyncClient(httpClient, serviceVersion); StepVerifier.create(client.analyzeSentiment("")) .expectErrorMatches(throwable -> throwable instanceof TextAnalyticsException - && throwable.getMessage().equals(INVALID_DOCUMENT_EXPECTED_EXCEPTION_MESSAGE)); + && throwable.getMessage().equals(INVALID_DOCUMENT_EXPECTED_EXCEPTION_MESSAGE)) + .verify(); } /** diff --git a/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/analyzeSentimentDuplicateIdInput.json b/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/analyzeSentimentDuplicateIdInput.json index 981578e39fb65..c9d5ef0d29908 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/analyzeSentimentDuplicateIdInput.json +++ b/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/analyzeSentimentDuplicateIdInput.json @@ -1,22 +1,22 @@ { "networkCallRecords" : [ { "Method" : "POST", - "Uri" : "https://westus2.ppe.cognitiveservices.azure.com/text/analytics/v3.0//sentiment", + "Uri" : "https://REDACTED.cognitiveservices.azure.com/text/analytics/v3.1-preview.1//sentiment", "Headers" : { - "User-Agent" : "azsdk-java-azure-ai-textanalytics/1.0.0-beta.5 (11.0.4; Windows 10 10.0)", - "x-ms-client-request-id" : "6157e5fc-f3a3-4917-8509-cf4d293c4444", + "User-Agent" : "azsdk-java-azure-ai-textanalytics/1.1.0-beta.1 (11.0.7; Windows 10; 10.0)", + "x-ms-client-request-id" : "35eb8773-e999-4513-8d99-2be40442eefa", "Content-Type" : "application/json" }, "Response" : { "Transfer-Encoding" : "chunked", - "x-envoy-upstream-service-time" : "7", + "x-envoy-upstream-service-time" : "4", "Strict-Transport-Security" : "max-age=31536000; includeSubDomains; preload", "x-content-type-options" : "nosniff", - "apim-request-id" : "cc8ae190-2e4c-4271-b95e-0ccbd1d57cdb", + "apim-request-id" : "03e3f07a-e90c-4caf-8e74-fb8216119043", "retry-after" : "0", "StatusCode" : "400", - "Body" : "{\"error\":{\"code\":\"InvalidRequest\",\"message\":\"Invalid document in request.\",\"innerError\":{\"code\":\"InvalidDocument\",\"message\":\"Request contains duplicated Ids. Make sure each document has a unique Id.\"}}}", - "Date" : "Thu, 30 Apr 2020 04:52:39 GMT", + "Body" : "{\"error\":{\"code\":\"InvalidRequest\",\"message\":\"Invalid document in request.\",\"innererror\":{\"code\":\"InvalidDocument\",\"message\":\"Request contains duplicated Ids. Make sure each document has a unique Id.\"}}}", + "Date" : "Wed, 15 Jul 2020 04:14:29 GMT", "Content-Type" : "application/json; charset=utf-8" }, "Exception" : null diff --git a/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/analyzeSentimentForBatchInput.json b/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/analyzeSentimentForBatchInput.json index db9e4dfdaed6a..f6e6cb2e01910 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/analyzeSentimentForBatchInput.json +++ b/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/analyzeSentimentForBatchInput.json @@ -1,23 +1,23 @@ { "networkCallRecords" : [ { "Method" : "POST", - "Uri" : "https://westus2.ppe.cognitiveservices.azure.com/text/analytics/v3.0//sentiment", + "Uri" : "https://REDACTED.cognitiveservices.azure.com/text/analytics/v3.1-preview.1//sentiment", "Headers" : { - "User-Agent" : "azsdk-java-azure-ai-textanalytics/1.0.0-beta.5 (11.0.4; Windows 10 10.0)", - "x-ms-client-request-id" : "a5fdc3a0-3fa7-4b80-98e8-7a739d4c352a", + "User-Agent" : "azsdk-java-azure-ai-textanalytics/1.1.0-beta.1 (11.0.7; Windows 10; 10.0)", + "x-ms-client-request-id" : "9b455e87-cc48-44f2-bd68-d1707c29fa34", "Content-Type" : "application/json" }, "Response" : { "Transfer-Encoding" : "chunked", - "x-envoy-upstream-service-time" : "109", + "x-envoy-upstream-service-time" : "91", "Strict-Transport-Security" : "max-age=31536000; includeSubDomains; preload", "x-content-type-options" : "nosniff", "csp-billing-usage" : "CognitiveServices.TextAnalytics.BatchScoring=2", - "apim-request-id" : "48f66acf-87f2-4d9b-96e1-e782aff54539", + "apim-request-id" : "ca2e5376-b597-446c-8ec3-cda901902bd0", "retry-after" : "0", "StatusCode" : "200", - "Body" : "{\"documents\":[{\"id\":\"0\",\"sentiment\":\"mixed\",\"confidenceScores\":{\"positive\":0.5,\"neutral\":0.0,\"negative\":0.5},\"sentences\":[{\"sentiment\":\"negative\",\"confidenceScores\":{\"positive\":0.0,\"neutral\":0.0,\"negative\":1.0},\"offset\":0,\"length\":31,\"text\":\"The hotel was dark and unclean.\"},{\"sentiment\":\"positive\",\"confidenceScores\":{\"positive\":1.0,\"neutral\":0.0,\"negative\":0.0},\"offset\":32,\"length\":35,\"text\":\"The restaurant had amazing gnocchi.\"}],\"warnings\":[]},{\"id\":\"1\",\"sentiment\":\"mixed\",\"confidenceScores\":{\"positive\":0.5,\"neutral\":0.0,\"negative\":0.5},\"sentences\":[{\"sentiment\":\"positive\",\"confidenceScores\":{\"positive\":1.0,\"neutral\":0.0,\"negative\":0.0},\"offset\":0,\"length\":35,\"text\":\"The restaurant had amazing gnocchi.\"},{\"sentiment\":\"negative\",\"confidenceScores\":{\"positive\":0.0,\"neutral\":0.0,\"negative\":1.0},\"offset\":36,\"length\":31,\"text\":\"The hotel was dark and unclean.\"}],\"warnings\":[]}],\"errors\":[],\"modelVersion\":\"2019-10-01\"}", - "Date" : "Wed, 29 Apr 2020 17:12:19 GMT", + "Body" : "{\"documents\":[{\"id\":\"0\",\"sentiment\":\"mixed\",\"confidenceScores\":{\"positive\":0.5,\"neutral\":0.0,\"negative\":0.5},\"sentences\":[{\"sentiment\":\"negative\",\"confidenceScores\":{\"positive\":0.0,\"neutral\":0.0,\"negative\":1.0},\"offset\":0,\"length\":31,\"text\":\"The hotel was dark and unclean.\"},{\"sentiment\":\"positive\",\"confidenceScores\":{\"positive\":1.0,\"neutral\":0.0,\"negative\":0.0},\"offset\":32,\"length\":35,\"text\":\"The restaurant had amazing gnocchi.\"}],\"warnings\":[]},{\"id\":\"1\",\"sentiment\":\"mixed\",\"confidenceScores\":{\"positive\":0.5,\"neutral\":0.0,\"negative\":0.5},\"sentences\":[{\"sentiment\":\"positive\",\"confidenceScores\":{\"positive\":1.0,\"neutral\":0.0,\"negative\":0.0},\"offset\":0,\"length\":35,\"text\":\"The restaurant had amazing gnocchi.\"},{\"sentiment\":\"negative\",\"confidenceScores\":{\"positive\":0.0,\"neutral\":0.0,\"negative\":1.0},\"offset\":36,\"length\":31,\"text\":\"The hotel was dark and unclean.\"}],\"warnings\":[]}],\"errors\":[],\"modelVersion\":\"2020-04-01\"}", + "Date" : "Wed, 15 Jul 2020 04:14:32 GMT", "Content-Type" : "application/json; charset=utf-8" }, "Exception" : null diff --git a/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/analyzeSentimentForBatchInputShowStatistics.json b/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/analyzeSentimentForBatchInputShowStatistics.json index b207bb28e59d7..d743331018666 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/analyzeSentimentForBatchInputShowStatistics.json +++ b/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/analyzeSentimentForBatchInputShowStatistics.json @@ -1,23 +1,23 @@ { "networkCallRecords" : [ { "Method" : "POST", - "Uri" : "https://westus2.ppe.cognitiveservices.azure.com/text/analytics/v3.0//sentiment?showStats=true", + "Uri" : "https://REDACTED.cognitiveservices.azure.com/text/analytics/v3.1-preview.1//sentiment?showStats=true", "Headers" : { - "User-Agent" : "azsdk-java-azure-ai-textanalytics/1.0.0-beta.5 (11.0.4; Windows 10 10.0)", - "x-ms-client-request-id" : "5bfc2f94-994e-4501-bc55-7bef62ab587a", + "User-Agent" : "azsdk-java-azure-ai-textanalytics/1.1.0-beta.1 (11.0.7; Windows 10; 10.0)", + "x-ms-client-request-id" : "cee9a1c2-b321-4ac5-8081-d779b9fe17f9", "Content-Type" : "application/json" }, "Response" : { "Transfer-Encoding" : "chunked", - "x-envoy-upstream-service-time" : "120", + "x-envoy-upstream-service-time" : "85", "Strict-Transport-Security" : "max-age=31536000; includeSubDomains; preload", "x-content-type-options" : "nosniff", "csp-billing-usage" : "CognitiveServices.TextAnalytics.BatchScoring=2", - "apim-request-id" : "baf52579-73a8-4377-8a02-d5ab016d55ca", + "apim-request-id" : "427cc017-f2bc-42f0-bda4-aa1c305be30c", "retry-after" : "0", "StatusCode" : "200", - "Body" : "{\"statistics\":{\"documentsCount\":2,\"validDocumentsCount\":2,\"erroneousDocumentsCount\":0,\"transactionsCount\":2},\"documents\":[{\"id\":\"0\",\"sentiment\":\"mixed\",\"statistics\":{\"charactersCount\":67,\"transactionsCount\":1},\"confidenceScores\":{\"positive\":0.5,\"neutral\":0.0,\"negative\":0.5},\"sentences\":[{\"sentiment\":\"negative\",\"confidenceScores\":{\"positive\":0.0,\"neutral\":0.0,\"negative\":1.0},\"offset\":0,\"length\":31,\"text\":\"The hotel was dark and unclean.\"},{\"sentiment\":\"positive\",\"confidenceScores\":{\"positive\":1.0,\"neutral\":0.0,\"negative\":0.0},\"offset\":32,\"length\":35,\"text\":\"The restaurant had amazing gnocchi.\"}],\"warnings\":[]},{\"id\":\"1\",\"sentiment\":\"mixed\",\"statistics\":{\"charactersCount\":67,\"transactionsCount\":1},\"confidenceScores\":{\"positive\":0.5,\"neutral\":0.0,\"negative\":0.5},\"sentences\":[{\"sentiment\":\"positive\",\"confidenceScores\":{\"positive\":1.0,\"neutral\":0.0,\"negative\":0.0},\"offset\":0,\"length\":35,\"text\":\"The restaurant had amazing gnocchi.\"},{\"sentiment\":\"negative\",\"confidenceScores\":{\"positive\":0.0,\"neutral\":0.0,\"negative\":1.0},\"offset\":36,\"length\":31,\"text\":\"The hotel was dark and unclean.\"}],\"warnings\":[]}],\"errors\":[],\"modelVersion\":\"2019-10-01\"}", - "Date" : "Wed, 29 Apr 2020 17:12:18 GMT", + "Body" : "{\"statistics\":{\"documentsCount\":2,\"validDocumentsCount\":2,\"erroneousDocumentsCount\":0,\"transactionsCount\":2},\"documents\":[{\"id\":\"0\",\"sentiment\":\"mixed\",\"statistics\":{\"charactersCount\":67,\"transactionsCount\":1},\"confidenceScores\":{\"positive\":0.5,\"neutral\":0.0,\"negative\":0.5},\"sentences\":[{\"sentiment\":\"negative\",\"confidenceScores\":{\"positive\":0.0,\"neutral\":0.0,\"negative\":1.0},\"offset\":0,\"length\":31,\"text\":\"The hotel was dark and unclean.\"},{\"sentiment\":\"positive\",\"confidenceScores\":{\"positive\":1.0,\"neutral\":0.0,\"negative\":0.0},\"offset\":32,\"length\":35,\"text\":\"The restaurant had amazing gnocchi.\"}],\"warnings\":[]},{\"id\":\"1\",\"sentiment\":\"mixed\",\"statistics\":{\"charactersCount\":67,\"transactionsCount\":1},\"confidenceScores\":{\"positive\":0.5,\"neutral\":0.0,\"negative\":0.5},\"sentences\":[{\"sentiment\":\"positive\",\"confidenceScores\":{\"positive\":1.0,\"neutral\":0.0,\"negative\":0.0},\"offset\":0,\"length\":35,\"text\":\"The restaurant had amazing gnocchi.\"},{\"sentiment\":\"negative\",\"confidenceScores\":{\"positive\":0.0,\"neutral\":0.0,\"negative\":1.0},\"offset\":36,\"length\":31,\"text\":\"The hotel was dark and unclean.\"}],\"warnings\":[]}],\"errors\":[],\"modelVersion\":\"2020-04-01\"}", + "Date" : "Wed, 15 Jul 2020 04:14:39 GMT", "Content-Type" : "application/json; charset=utf-8" }, "Exception" : null diff --git a/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/analyzeSentimentForBatchStringInput.json b/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/analyzeSentimentForBatchStringInput.json index aca336e6ecb31..b0dbe661191fa 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/analyzeSentimentForBatchStringInput.json +++ b/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/analyzeSentimentForBatchStringInput.json @@ -1,23 +1,23 @@ { "networkCallRecords" : [ { "Method" : "POST", - "Uri" : "https://westus2.ppe.cognitiveservices.azure.com/text/analytics/v3.0//sentiment", + "Uri" : "https://REDACTED.cognitiveservices.azure.com/text/analytics/v3.1-preview.1//sentiment", "Headers" : { - "User-Agent" : "azsdk-java-azure-ai-textanalytics/1.0.0-beta.5 (11.0.4; Windows 10 10.0)", - "x-ms-client-request-id" : "390d98ec-ee3c-46d8-9157-8fb209d916d4", + "User-Agent" : "azsdk-java-azure-ai-textanalytics/1.1.0-beta.1 (11.0.7; Windows 10; 10.0)", + "x-ms-client-request-id" : "6a149fed-28e9-4051-92b5-ce68098984a3", "Content-Type" : "application/json" }, "Response" : { "Transfer-Encoding" : "chunked", - "x-envoy-upstream-service-time" : "137", + "x-envoy-upstream-service-time" : "112", "Strict-Transport-Security" : "max-age=31536000; includeSubDomains; preload", "x-content-type-options" : "nosniff", "csp-billing-usage" : "CognitiveServices.TextAnalytics.BatchScoring=2", - "apim-request-id" : "dc845cbb-ed0b-4139-8690-ffa5ce91d351", + "apim-request-id" : "58d21046-7255-4c36-b95a-d73489a85088", "retry-after" : "0", "StatusCode" : "200", - "Body" : "{\"documents\":[{\"id\":\"0\",\"sentiment\":\"mixed\",\"confidenceScores\":{\"positive\":0.5,\"neutral\":0.0,\"negative\":0.5},\"sentences\":[{\"sentiment\":\"negative\",\"confidenceScores\":{\"positive\":0.0,\"neutral\":0.0,\"negative\":1.0},\"offset\":0,\"length\":31,\"text\":\"The hotel was dark and unclean.\"},{\"sentiment\":\"positive\",\"confidenceScores\":{\"positive\":1.0,\"neutral\":0.0,\"negative\":0.0},\"offset\":32,\"length\":35,\"text\":\"The restaurant had amazing gnocchi.\"}],\"warnings\":[]},{\"id\":\"1\",\"sentiment\":\"mixed\",\"confidenceScores\":{\"positive\":0.5,\"neutral\":0.0,\"negative\":0.5},\"sentences\":[{\"sentiment\":\"positive\",\"confidenceScores\":{\"positive\":1.0,\"neutral\":0.0,\"negative\":0.0},\"offset\":0,\"length\":35,\"text\":\"The restaurant had amazing gnocchi.\"},{\"sentiment\":\"negative\",\"confidenceScores\":{\"positive\":0.0,\"neutral\":0.0,\"negative\":1.0},\"offset\":36,\"length\":31,\"text\":\"The hotel was dark and unclean.\"}],\"warnings\":[]}],\"errors\":[],\"modelVersion\":\"2019-10-01\"}", - "Date" : "Wed, 29 Apr 2020 17:12:19 GMT", + "Body" : "{\"documents\":[{\"id\":\"0\",\"sentiment\":\"mixed\",\"confidenceScores\":{\"positive\":0.5,\"neutral\":0.0,\"negative\":0.5},\"sentences\":[{\"sentiment\":\"negative\",\"confidenceScores\":{\"positive\":0.0,\"neutral\":0.0,\"negative\":1.0},\"offset\":0,\"length\":31,\"text\":\"The hotel was dark and unclean.\"},{\"sentiment\":\"positive\",\"confidenceScores\":{\"positive\":1.0,\"neutral\":0.0,\"negative\":0.0},\"offset\":32,\"length\":35,\"text\":\"The restaurant had amazing gnocchi.\"}],\"warnings\":[]},{\"id\":\"1\",\"sentiment\":\"mixed\",\"confidenceScores\":{\"positive\":0.5,\"neutral\":0.0,\"negative\":0.5},\"sentences\":[{\"sentiment\":\"positive\",\"confidenceScores\":{\"positive\":1.0,\"neutral\":0.0,\"negative\":0.0},\"offset\":0,\"length\":35,\"text\":\"The restaurant had amazing gnocchi.\"},{\"sentiment\":\"negative\",\"confidenceScores\":{\"positive\":0.0,\"neutral\":0.0,\"negative\":1.0},\"offset\":36,\"length\":31,\"text\":\"The hotel was dark and unclean.\"}],\"warnings\":[]}],\"errors\":[],\"modelVersion\":\"2020-04-01\"}", + "Date" : "Wed, 15 Jul 2020 04:14:33 GMT", "Content-Type" : "application/json; charset=utf-8" }, "Exception" : null diff --git a/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/analyzeSentimentForEmptyText.json b/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/analyzeSentimentForEmptyText.json index ea87abfb662a0..e9a4adbda0652 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/analyzeSentimentForEmptyText.json +++ b/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/analyzeSentimentForEmptyText.json @@ -1,22 +1,22 @@ { "networkCallRecords" : [ { "Method" : "POST", - "Uri" : "https://westus2.ppe.cognitiveservices.azure.com/text/analytics/v3.0//sentiment", + "Uri" : "https://REDACTED.cognitiveservices.azure.com/text/analytics/v3.1-preview.1//sentiment", "Headers" : { - "User-Agent" : "azsdk-java-azure-ai-textanalytics/1.0.0-beta.5 (11.0.4; Windows 10 10.0)", - "x-ms-client-request-id" : "c7f450bb-9aa1-46a1-bd87-e76c7441bc67", + "User-Agent" : "azsdk-java-azure-ai-textanalytics/1.1.0-beta.1 (11.0.7; Windows 10; 10.0)", + "x-ms-client-request-id" : "f67f970f-c761-4c83-a20e-083e7a6ae6f1", "Content-Type" : "application/json" }, "Response" : { "Transfer-Encoding" : "chunked", - "x-envoy-upstream-service-time" : "2", + "x-envoy-upstream-service-time" : "283", "Strict-Transport-Security" : "max-age=31536000; includeSubDomains; preload", "x-content-type-options" : "nosniff", - "apim-request-id" : "efbe390c-f5c2-41a3-886b-d6dcc12c2ab5", + "apim-request-id" : "2a27fe98-5923-47bf-83c7-22091d7fd4b6", "retry-after" : "0", "StatusCode" : "200", - "Body" : "{\"documents\":[],\"errors\":[{\"id\":\"0\",\"error\":{\"code\":\"InvalidArgument\",\"message\":\"Invalid document in request.\",\"innererror\":{\"code\":\"InvalidDocument\",\"message\":\"Document text is empty.\"}}}],\"modelVersion\":\"2019-10-01\"}", - "Date" : "Wed, 29 Apr 2020 17:12:19 GMT", + "Body" : "{\"documents\":[],\"errors\":[{\"id\":\"0\",\"error\":{\"code\":\"InvalidArgument\",\"message\":\"Invalid document in request.\",\"innererror\":{\"code\":\"InvalidDocument\",\"message\":\"Document text is empty.\"}}}],\"modelVersion\":\"2020-04-01\"}", + "Date" : "Wed, 15 Jul 2020 06:20:06 GMT", "Content-Type" : "application/json; charset=utf-8" }, "Exception" : null diff --git a/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/analyzeSentimentForFaultyText.json b/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/analyzeSentimentForFaultyText.json index 190918010d9d7..7c961368f5869 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/analyzeSentimentForFaultyText.json +++ b/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/analyzeSentimentForFaultyText.json @@ -1,23 +1,23 @@ { "networkCallRecords" : [ { "Method" : "POST", - "Uri" : "https://westus2.ppe.cognitiveservices.azure.com/text/analytics/v3.0//sentiment", + "Uri" : "https://REDACTED.cognitiveservices.azure.com/text/analytics/v3.1-preview.1//sentiment", "Headers" : { - "User-Agent" : "azsdk-java-azure-ai-textanalytics/1.0.0-beta.5 (11.0.4; Windows 10 10.0)", - "x-ms-client-request-id" : "c715c68e-bf05-43a7-92e6-152e7c0833d2", + "User-Agent" : "azsdk-java-azure-ai-textanalytics/1.1.0-beta.1 (11.0.7; Windows 10; 10.0)", + "x-ms-client-request-id" : "314fc550-6a3e-4b08-b0eb-6a78f5c43a7d", "Content-Type" : "application/json" }, "Response" : { "Transfer-Encoding" : "chunked", - "x-envoy-upstream-service-time" : "110", + "x-envoy-upstream-service-time" : "95", "Strict-Transport-Security" : "max-age=31536000; includeSubDomains; preload", "x-content-type-options" : "nosniff", "csp-billing-usage" : "CognitiveServices.TextAnalytics.BatchScoring=1", - "apim-request-id" : "7d859041-8a10-45dc-b769-662885e9ee7e", + "apim-request-id" : "80d8febf-8794-4f72-a306-103a88fb9088", "retry-after" : "0", "StatusCode" : "200", - "Body" : "{\"documents\":[{\"id\":\"0\",\"sentiment\":\"neutral\",\"confidenceScores\":{\"positive\":0.06,\"neutral\":0.91,\"negative\":0.03},\"sentences\":[{\"sentiment\":\"neutral\",\"confidenceScores\":{\"positive\":0.06,\"neutral\":0.91,\"negative\":0.03},\"offset\":0,\"length\":1,\"text\":\"!\"},{\"sentiment\":\"neutral\",\"confidenceScores\":{\"positive\":0.06,\"neutral\":0.91,\"negative\":0.03},\"offset\":1,\"length\":4,\"text\":\"@#%%\"}],\"warnings\":[]}],\"errors\":[],\"modelVersion\":\"2019-10-01\"}", - "Date" : "Wed, 29 Apr 2020 17:12:20 GMT", + "Body" : "{\"documents\":[{\"id\":\"0\",\"sentiment\":\"neutral\",\"confidenceScores\":{\"positive\":0.06,\"neutral\":0.91,\"negative\":0.03},\"sentences\":[{\"sentiment\":\"neutral\",\"confidenceScores\":{\"positive\":0.06,\"neutral\":0.91,\"negative\":0.03},\"offset\":0,\"length\":1,\"text\":\"!\"},{\"sentiment\":\"neutral\",\"confidenceScores\":{\"positive\":0.06,\"neutral\":0.91,\"negative\":0.03},\"offset\":1,\"length\":4,\"text\":\"@#%%\"}],\"warnings\":[]}],\"errors\":[],\"modelVersion\":\"2020-04-01\"}", + "Date" : "Wed, 15 Jul 2020 04:14:36 GMT", "Content-Type" : "application/json; charset=utf-8" }, "Exception" : null diff --git a/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/analyzeSentimentForListLanguageHint.json b/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/analyzeSentimentForListLanguageHint.json index 5416b59e4f20e..d44c0e87b37a6 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/analyzeSentimentForListLanguageHint.json +++ b/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/analyzeSentimentForListLanguageHint.json @@ -1,23 +1,23 @@ { "networkCallRecords" : [ { "Method" : "POST", - "Uri" : "https://westus2.ppe.cognitiveservices.azure.com/text/analytics/v3.0//sentiment", + "Uri" : "https://REDACTED.cognitiveservices.azure.com/text/analytics/v3.1-preview.1//sentiment", "Headers" : { - "User-Agent" : "azsdk-java-azure-ai-textanalytics/1.0.0-beta.5 (11.0.4; Windows 10 10.0)", - "x-ms-client-request-id" : "8c4f6331-de27-4bd5-94e9-62694e7bf1ce", + "User-Agent" : "azsdk-java-azure-ai-textanalytics/1.1.0-beta.1 (11.0.7; Windows 10; 10.0)", + "x-ms-client-request-id" : "bfacc9cd-d097-40bd-84cb-e4a7d639641e", "Content-Type" : "application/json" }, "Response" : { "Transfer-Encoding" : "chunked", - "x-envoy-upstream-service-time" : "111", + "x-envoy-upstream-service-time" : "145", "Strict-Transport-Security" : "max-age=31536000; includeSubDomains; preload", "x-content-type-options" : "nosniff", "csp-billing-usage" : "CognitiveServices.TextAnalytics.BatchScoring=2", - "apim-request-id" : "94a7a5af-8561-4e49-a42d-2c4691b42f94", + "apim-request-id" : "af1778a3-0d86-4f67-a583-becbc1bf24e8", "retry-after" : "0", "StatusCode" : "200", - "Body" : "{\"documents\":[{\"id\":\"0\",\"sentiment\":\"mixed\",\"confidenceScores\":{\"positive\":0.5,\"neutral\":0.0,\"negative\":0.5},\"sentences\":[{\"sentiment\":\"negative\",\"confidenceScores\":{\"positive\":0.0,\"neutral\":0.0,\"negative\":1.0},\"offset\":0,\"length\":31,\"text\":\"The hotel was dark and unclean.\"},{\"sentiment\":\"positive\",\"confidenceScores\":{\"positive\":1.0,\"neutral\":0.0,\"negative\":0.0},\"offset\":32,\"length\":35,\"text\":\"The restaurant had amazing gnocchi.\"}],\"warnings\":[]},{\"id\":\"1\",\"sentiment\":\"mixed\",\"confidenceScores\":{\"positive\":0.5,\"neutral\":0.0,\"negative\":0.5},\"sentences\":[{\"sentiment\":\"positive\",\"confidenceScores\":{\"positive\":1.0,\"neutral\":0.0,\"negative\":0.0},\"offset\":0,\"length\":35,\"text\":\"The restaurant had amazing gnocchi.\"},{\"sentiment\":\"negative\",\"confidenceScores\":{\"positive\":0.0,\"neutral\":0.0,\"negative\":1.0},\"offset\":36,\"length\":31,\"text\":\"The hotel was dark and unclean.\"}],\"warnings\":[]}],\"errors\":[],\"modelVersion\":\"2019-10-01\"}", - "Date" : "Wed, 29 Apr 2020 17:12:19 GMT", + "Body" : "{\"documents\":[{\"id\":\"0\",\"sentiment\":\"mixed\",\"confidenceScores\":{\"positive\":0.5,\"neutral\":0.0,\"negative\":0.5},\"sentences\":[{\"sentiment\":\"negative\",\"confidenceScores\":{\"positive\":0.0,\"neutral\":0.0,\"negative\":1.0},\"offset\":0,\"length\":31,\"text\":\"The hotel was dark and unclean.\"},{\"sentiment\":\"positive\",\"confidenceScores\":{\"positive\":1.0,\"neutral\":0.0,\"negative\":0.0},\"offset\":32,\"length\":35,\"text\":\"The restaurant had amazing gnocchi.\"}],\"warnings\":[]},{\"id\":\"1\",\"sentiment\":\"mixed\",\"confidenceScores\":{\"positive\":0.5,\"neutral\":0.0,\"negative\":0.5},\"sentences\":[{\"sentiment\":\"positive\",\"confidenceScores\":{\"positive\":1.0,\"neutral\":0.0,\"negative\":0.0},\"offset\":0,\"length\":35,\"text\":\"The restaurant had amazing gnocchi.\"},{\"sentiment\":\"negative\",\"confidenceScores\":{\"positive\":0.0,\"neutral\":0.0,\"negative\":1.0},\"offset\":36,\"length\":31,\"text\":\"The hotel was dark and unclean.\"}],\"warnings\":[]}],\"errors\":[],\"modelVersion\":\"2020-04-01\"}", + "Date" : "Wed, 15 Jul 2020 04:14:32 GMT", "Content-Type" : "application/json; charset=utf-8" }, "Exception" : null diff --git a/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/analyzeSentimentForListStringWithOptions.json b/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/analyzeSentimentForListStringWithOptions.json index 0e5fe7cae062f..1c0b90702e698 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/analyzeSentimentForListStringWithOptions.json +++ b/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/analyzeSentimentForListStringWithOptions.json @@ -1,23 +1,23 @@ { "networkCallRecords" : [ { "Method" : "POST", - "Uri" : "https://westus2.ppe.cognitiveservices.azure.com/text/analytics/v3.0//sentiment?showStats=true", + "Uri" : "https://REDACTED.cognitiveservices.azure.com/text/analytics/v3.1-preview.1//sentiment?showStats=true", "Headers" : { - "User-Agent" : "azsdk-java-azure-ai-textanalytics/1.0.0-beta.5 (11.0.4; Windows 10 10.0)", - "x-ms-client-request-id" : "7a71ad5f-9e38-46d3-a97f-7d22b6be4147", + "User-Agent" : "azsdk-java-azure-ai-textanalytics/1.1.0-beta.1 (11.0.7; Windows 10; 10.0)", + "x-ms-client-request-id" : "b05cb28f-b425-48ab-8e47-caacf51b806d", "Content-Type" : "application/json" }, "Response" : { "Transfer-Encoding" : "chunked", - "x-envoy-upstream-service-time" : "116", + "x-envoy-upstream-service-time" : "106", "Strict-Transport-Security" : "max-age=31536000; includeSubDomains; preload", "x-content-type-options" : "nosniff", "csp-billing-usage" : "CognitiveServices.TextAnalytics.BatchScoring=2", - "apim-request-id" : "f81daae1-a4e8-4afa-be62-a6b466a0c7b5", + "apim-request-id" : "767af6d1-b389-4453-9aa7-064af57d0f1c", "retry-after" : "0", "StatusCode" : "200", - "Body" : "{\"statistics\":{\"documentsCount\":2,\"validDocumentsCount\":2,\"erroneousDocumentsCount\":0,\"transactionsCount\":2},\"documents\":[{\"id\":\"0\",\"sentiment\":\"mixed\",\"statistics\":{\"charactersCount\":67,\"transactionsCount\":1},\"confidenceScores\":{\"positive\":0.5,\"neutral\":0.0,\"negative\":0.5},\"sentences\":[{\"sentiment\":\"negative\",\"confidenceScores\":{\"positive\":0.0,\"neutral\":0.0,\"negative\":1.0},\"offset\":0,\"length\":31,\"text\":\"The hotel was dark and unclean.\"},{\"sentiment\":\"positive\",\"confidenceScores\":{\"positive\":1.0,\"neutral\":0.0,\"negative\":0.0},\"offset\":32,\"length\":35,\"text\":\"The restaurant had amazing gnocchi.\"}],\"warnings\":[]},{\"id\":\"1\",\"sentiment\":\"mixed\",\"statistics\":{\"charactersCount\":67,\"transactionsCount\":1},\"confidenceScores\":{\"positive\":0.5,\"neutral\":0.0,\"negative\":0.5},\"sentences\":[{\"sentiment\":\"positive\",\"confidenceScores\":{\"positive\":1.0,\"neutral\":0.0,\"negative\":0.0},\"offset\":0,\"length\":35,\"text\":\"The restaurant had amazing gnocchi.\"},{\"sentiment\":\"negative\",\"confidenceScores\":{\"positive\":0.0,\"neutral\":0.0,\"negative\":1.0},\"offset\":36,\"length\":31,\"text\":\"The hotel was dark and unclean.\"}],\"warnings\":[]}],\"errors\":[],\"modelVersion\":\"2019-10-01\"}", - "Date" : "Wed, 29 Apr 2020 17:12:20 GMT", + "Body" : "{\"statistics\":{\"documentsCount\":2,\"validDocumentsCount\":2,\"erroneousDocumentsCount\":0,\"transactionsCount\":2},\"documents\":[{\"id\":\"0\",\"sentiment\":\"mixed\",\"statistics\":{\"charactersCount\":67,\"transactionsCount\":1},\"confidenceScores\":{\"positive\":0.5,\"neutral\":0.0,\"negative\":0.5},\"sentences\":[{\"sentiment\":\"negative\",\"confidenceScores\":{\"positive\":0.0,\"neutral\":0.0,\"negative\":1.0},\"offset\":0,\"length\":31,\"text\":\"The hotel was dark and unclean.\"},{\"sentiment\":\"positive\",\"confidenceScores\":{\"positive\":1.0,\"neutral\":0.0,\"negative\":0.0},\"offset\":32,\"length\":35,\"text\":\"The restaurant had amazing gnocchi.\"}],\"warnings\":[]},{\"id\":\"1\",\"sentiment\":\"mixed\",\"statistics\":{\"charactersCount\":67,\"transactionsCount\":1},\"confidenceScores\":{\"positive\":0.5,\"neutral\":0.0,\"negative\":0.5},\"sentences\":[{\"sentiment\":\"positive\",\"confidenceScores\":{\"positive\":1.0,\"neutral\":0.0,\"negative\":0.0},\"offset\":0,\"length\":35,\"text\":\"The restaurant had amazing gnocchi.\"},{\"sentiment\":\"negative\",\"confidenceScores\":{\"positive\":0.0,\"neutral\":0.0,\"negative\":1.0},\"offset\":36,\"length\":31,\"text\":\"The hotel was dark and unclean.\"}],\"warnings\":[]}],\"errors\":[],\"modelVersion\":\"2020-04-01\"}", + "Date" : "Wed, 15 Jul 2020 04:14:38 GMT", "Content-Type" : "application/json; charset=utf-8" }, "Exception" : null diff --git a/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/analyzeSentimentForTextInput.json b/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/analyzeSentimentForTextInput.json index 98a159515f80e..d32e2e898c1b7 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/analyzeSentimentForTextInput.json +++ b/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/analyzeSentimentForTextInput.json @@ -1,23 +1,23 @@ { "networkCallRecords" : [ { "Method" : "POST", - "Uri" : "https://westus2.ppe.cognitiveservices.azure.com/text/analytics/v3.0//sentiment", + "Uri" : "https://REDACTED.cognitiveservices.azure.com/text/analytics/v3.1-preview.1//sentiment", "Headers" : { - "User-Agent" : "azsdk-java-azure-ai-textanalytics/1.0.0-beta.5 (11.0.4; Windows 10 10.0)", - "x-ms-client-request-id" : "3a1c8bc7-9278-4a60-8baa-c5c304b349f3", + "User-Agent" : "azsdk-java-azure-ai-textanalytics/1.1.0-beta.1 (11.0.7; Windows 10; 10.0)", + "x-ms-client-request-id" : "6d57c5af-70da-47e5-b258-8c5bb75ec473", "Content-Type" : "application/json" }, "Response" : { "Transfer-Encoding" : "chunked", - "x-envoy-upstream-service-time" : "116", + "x-envoy-upstream-service-time" : "87", "Strict-Transport-Security" : "max-age=31536000; includeSubDomains; preload", "x-content-type-options" : "nosniff", "csp-billing-usage" : "CognitiveServices.TextAnalytics.BatchScoring=1", - "apim-request-id" : "75039135-fa22-4c6c-825d-6452b99e24ca", + "apim-request-id" : "78660fca-0348-4a7d-8e3d-ac2e82141f7f", "retry-after" : "0", "StatusCode" : "200", - "Body" : "{\"documents\":[{\"id\":\"0\",\"sentiment\":\"mixed\",\"confidenceScores\":{\"positive\":0.5,\"neutral\":0.0,\"negative\":0.5},\"sentences\":[{\"sentiment\":\"negative\",\"confidenceScores\":{\"positive\":0.0,\"neutral\":0.0,\"negative\":1.0},\"offset\":0,\"length\":31,\"text\":\"The hotel was dark and unclean.\"},{\"sentiment\":\"positive\",\"confidenceScores\":{\"positive\":1.0,\"neutral\":0.0,\"negative\":0.0},\"offset\":32,\"length\":35,\"text\":\"The restaurant had amazing gnocchi.\"}],\"warnings\":[]}],\"errors\":[],\"modelVersion\":\"2019-10-01\"}", - "Date" : "Wed, 29 Apr 2020 17:12:19 GMT", + "Body" : "{\"documents\":[{\"id\":\"0\",\"sentiment\":\"mixed\",\"confidenceScores\":{\"positive\":0.5,\"neutral\":0.0,\"negative\":0.5},\"sentences\":[{\"sentiment\":\"negative\",\"confidenceScores\":{\"positive\":0.0,\"neutral\":0.0,\"negative\":1.0},\"offset\":0,\"length\":31,\"text\":\"The hotel was dark and unclean.\"},{\"sentiment\":\"positive\",\"confidenceScores\":{\"positive\":1.0,\"neutral\":0.0,\"negative\":0.0},\"offset\":32,\"length\":35,\"text\":\"The restaurant had amazing gnocchi.\"}],\"warnings\":[]}],\"errors\":[],\"modelVersion\":\"2020-04-01\"}", + "Date" : "Wed, 15 Jul 2020 04:14:36 GMT", "Content-Type" : "application/json; charset=utf-8" }, "Exception" : null diff --git a/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/clientBuilderWithDefaultCountryHint.json b/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/clientBuilderWithDefaultCountryHint.json index 474e09f6baf73..e80fdf1392f5b 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/clientBuilderWithDefaultCountryHint.json +++ b/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/clientBuilderWithDefaultCountryHint.json @@ -1,23 +1,23 @@ { "networkCallRecords" : [ { "Method" : "POST", - "Uri" : "https://westus2.ppe.cognitiveservices.azure.com/text/analytics/v3.0//languages", + "Uri" : "https://REDACTED.cognitiveservices.azure.com/text/analytics/v3.1-preview.1//languages", "Headers" : { - "User-Agent" : "azsdk-java-azure-ai-textanalytics/1.0.0-beta.5 (11.0.4; Windows 10 10.0)", - "x-ms-client-request-id" : "d29baca1-0bf4-47f1-927d-f04f6f2f1f43", + "User-Agent" : "azsdk-java-azure-ai-textanalytics/1.1.0-beta.1 (11.0.7; Windows 10; 10.0)", + "x-ms-client-request-id" : "41e26755-23ea-43a5-8ae4-5e35caaa794a", "Content-Type" : "application/json" }, "Response" : { "Transfer-Encoding" : "chunked", - "x-envoy-upstream-service-time" : "3", + "x-envoy-upstream-service-time" : "6", "Strict-Transport-Security" : "max-age=31536000; includeSubDomains; preload", "x-content-type-options" : "nosniff", "csp-billing-usage" : "CognitiveServices.TextAnalytics.BatchScoring=1", - "apim-request-id" : "219091a3-23fd-4e8f-af46-51788a011907", + "apim-request-id" : "91defeba-9570-40d3-a924-b742acea864e", "retry-after" : "0", "StatusCode" : "200", "Body" : "{\"documents\":[{\"id\":\"0\",\"detectedLanguage\":{\"name\":\"Spanish\",\"iso6391Name\":\"es\",\"confidenceScore\":1.0},\"warnings\":[]}],\"errors\":[],\"modelVersion\":\"2019-10-01\"}", - "Date" : "Wed, 29 Apr 2020 17:12:17 GMT", + "Date" : "Wed, 15 Jul 2020 04:14:42 GMT", "Content-Type" : "application/json; charset=utf-8" }, "Exception" : null diff --git a/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/clientBuilderWithDefaultCountryHintForBatchOperation.json b/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/clientBuilderWithDefaultCountryHintForBatchOperation.json index e5982a5888669..82b3c73ceeb5d 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/clientBuilderWithDefaultCountryHintForBatchOperation.json +++ b/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/clientBuilderWithDefaultCountryHintForBatchOperation.json @@ -1,23 +1,23 @@ { "networkCallRecords" : [ { "Method" : "POST", - "Uri" : "https://westus2.ppe.cognitiveservices.azure.com/text/analytics/v3.0//languages", + "Uri" : "https://REDACTED.cognitiveservices.azure.com/text/analytics/v3.1-preview.1//languages", "Headers" : { - "User-Agent" : "azsdk-java-azure-ai-textanalytics/1.0.0-beta.5 (11.0.4; Windows 10 10.0)", - "x-ms-client-request-id" : "0e50d1aa-13ce-4b88-aa46-cb6786bc979e", + "User-Agent" : "azsdk-java-azure-ai-textanalytics/1.1.0-beta.1 (11.0.7; Windows 10; 10.0)", + "x-ms-client-request-id" : "78a3a306-5107-4d00-9393-e7957b14748c", "Content-Type" : "application/json" }, "Response" : { "Transfer-Encoding" : "chunked", - "x-envoy-upstream-service-time" : "2", + "x-envoy-upstream-service-time" : "7", "Strict-Transport-Security" : "max-age=31536000; includeSubDomains; preload", "x-content-type-options" : "nosniff", "csp-billing-usage" : "CognitiveServices.TextAnalytics.BatchScoring=2", - "apim-request-id" : "0dbd716c-942a-46fd-abca-a903c3e12a1d", + "apim-request-id" : "20dbab91-db76-40b6-97fd-d1bddb472bb9", "retry-after" : "0", "StatusCode" : "200", "Body" : "{\"documents\":[{\"id\":\"0\",\"detectedLanguage\":{\"name\":\"Spanish\",\"iso6391Name\":\"es\",\"confidenceScore\":1.0},\"warnings\":[]},{\"id\":\"1\",\"detectedLanguage\":{\"name\":\"Spanish\",\"iso6391Name\":\"es\",\"confidenceScore\":1.0},\"warnings\":[]}],\"errors\":[],\"modelVersion\":\"2019-10-01\"}", - "Date" : "Wed, 29 Apr 2020 17:12:17 GMT", + "Date" : "Wed, 15 Jul 2020 04:14:42 GMT", "Content-Type" : "application/json; charset=utf-8" }, "Exception" : null diff --git a/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/clientBuilderWithDefaultLanguage.json b/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/clientBuilderWithDefaultLanguage.json index cb08dfb81944e..384244568680b 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/clientBuilderWithDefaultLanguage.json +++ b/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/clientBuilderWithDefaultLanguage.json @@ -1,23 +1,23 @@ { "networkCallRecords" : [ { "Method" : "POST", - "Uri" : "https://westus2.ppe.cognitiveservices.azure.com/text/analytics/v3.0//keyPhrases", + "Uri" : "https://REDACTED.cognitiveservices.azure.com/text/analytics/v3.1-preview.1//keyPhrases", "Headers" : { - "User-Agent" : "azsdk-java-azure-ai-textanalytics/1.0.0-beta.5 (11.0.4; Windows 10 10.0)", - "x-ms-client-request-id" : "d2a6d6de-e582-4584-87f8-129704d4a54a", + "User-Agent" : "azsdk-java-azure-ai-textanalytics/1.1.0-beta.1 (11.0.7; Windows 10; 10.0)", + "x-ms-client-request-id" : "e943340b-e07c-4c92-bed9-ed89b1f6e1ec", "Content-Type" : "application/json" }, "Response" : { "Transfer-Encoding" : "chunked", - "x-envoy-upstream-service-time" : "2", + "x-envoy-upstream-service-time" : "3", "Strict-Transport-Security" : "max-age=31536000; includeSubDomains; preload", "x-content-type-options" : "nosniff", "csp-billing-usage" : "CognitiveServices.TextAnalytics.BatchScoring=1", - "apim-request-id" : "39eb45d0-ea4e-4ed5-88b3-be834a3329b1", + "apim-request-id" : "e85d934d-38bb-42a2-a2dd-41512088953e", "retry-after" : "0", "StatusCode" : "200", "Body" : "{\"documents\":[{\"id\":\"0\",\"keyPhrases\":[\"Mondly\"],\"warnings\":[]}],\"errors\":[],\"modelVersion\":\"2019-10-01\"}", - "Date" : "Wed, 29 Apr 2020 17:12:18 GMT", + "Date" : "Wed, 15 Jul 2020 04:14:43 GMT", "Content-Type" : "application/json; charset=utf-8" }, "Exception" : null diff --git a/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/clientBuilderWithDefaultLanguageForBatchOperation.json b/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/clientBuilderWithDefaultLanguageForBatchOperation.json index 96ed69d31d140..0724d8a22cbdd 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/clientBuilderWithDefaultLanguageForBatchOperation.json +++ b/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/clientBuilderWithDefaultLanguageForBatchOperation.json @@ -1,23 +1,23 @@ { "networkCallRecords" : [ { "Method" : "POST", - "Uri" : "https://westus2.ppe.cognitiveservices.azure.com/text/analytics/v3.0//keyPhrases", + "Uri" : "https://REDACTED.cognitiveservices.azure.com/text/analytics/v3.1-preview.1//keyPhrases", "Headers" : { - "User-Agent" : "azsdk-java-azure-ai-textanalytics/1.0.0-beta.5 (11.0.4; Windows 10 10.0)", - "x-ms-client-request-id" : "5cf9ac37-da20-4c6b-9f71-ab4b9fa90e83", + "User-Agent" : "azsdk-java-azure-ai-textanalytics/1.1.0-beta.1 (11.0.7; Windows 10; 10.0)", + "x-ms-client-request-id" : "0ce16f07-9311-473d-891e-617ed8e876b0", "Content-Type" : "application/json" }, "Response" : { "Transfer-Encoding" : "chunked", - "x-envoy-upstream-service-time" : "4", + "x-envoy-upstream-service-time" : "3", "Strict-Transport-Security" : "max-age=31536000; includeSubDomains; preload", "x-content-type-options" : "nosniff", "csp-billing-usage" : "CognitiveServices.TextAnalytics.BatchScoring=2", - "apim-request-id" : "f57d2158-f80f-4193-a069-ec2f610974b0", + "apim-request-id" : "e5842e25-e10f-4c56-8838-38b39f6f12c8", "retry-after" : "0", "StatusCode" : "200", "Body" : "{\"documents\":[{\"id\":\"0\",\"keyPhrases\":[\"monde\"],\"warnings\":[]},{\"id\":\"1\",\"keyPhrases\":[\"Mondly\"],\"warnings\":[]}],\"errors\":[],\"modelVersion\":\"2019-10-01\"}", - "Date" : "Wed, 29 Apr 2020 17:12:17 GMT", + "Date" : "Wed, 15 Jul 2020 04:14:42 GMT", "Content-Type" : "application/json; charset=utf-8" }, "Exception" : null diff --git a/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/clientBuilderWithDefaultPipeline.json b/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/clientBuilderWithDefaultPipeline.json index 0002fdce69f26..79d249639761d 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/clientBuilderWithDefaultPipeline.json +++ b/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/clientBuilderWithDefaultPipeline.json @@ -1,23 +1,23 @@ { "networkCallRecords" : [ { "Method" : "POST", - "Uri" : "https://westus2.ppe.cognitiveservices.azure.com/text/analytics/v3.0//languages", + "Uri" : "https://REDACTED.cognitiveservices.azure.com/text/analytics/v3.1-preview.1//languages", "Headers" : { - "User-Agent" : "azsdk-java-azure-ai-textanalytics/1.0.0-beta.5 (11.0.4; Windows 10 10.0)", - "x-ms-client-request-id" : "1d791e03-8ed9-4525-b738-129fc648fb45", + "User-Agent" : "azsdk-java-azure-ai-textanalytics/1.1.0-beta.1 (11.0.7; Windows 10; 10.0)", + "x-ms-client-request-id" : "228448f7-ad12-4eb8-94f2-2eed7aa712ad", "Content-Type" : "application/json" }, "Response" : { "Transfer-Encoding" : "chunked", - "x-envoy-upstream-service-time" : "3", + "x-envoy-upstream-service-time" : "7", "Strict-Transport-Security" : "max-age=31536000; includeSubDomains; preload", "x-content-type-options" : "nosniff", "csp-billing-usage" : "CognitiveServices.TextAnalytics.BatchScoring=1", - "apim-request-id" : "3cab5f4e-4710-43a9-acbd-bbed7e479147", + "apim-request-id" : "1c8d58b1-52e5-46f6-a27d-c10bf1f8c32c", "retry-after" : "0", "StatusCode" : "200", "Body" : "{\"documents\":[{\"id\":\"0\",\"detectedLanguage\":{\"name\":\"English\",\"iso6391Name\":\"en\",\"confidenceScore\":1.0},\"warnings\":[]}],\"errors\":[],\"modelVersion\":\"2019-10-01\"}", - "Date" : "Wed, 29 Apr 2020 17:12:17 GMT", + "Date" : "Wed, 15 Jul 2020 04:14:42 GMT", "Content-Type" : "application/json; charset=utf-8" }, "Exception" : null diff --git a/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/clientBuilderWithInvalidApiKeyCredential.json b/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/clientBuilderWithInvalidApiKeyCredential.json index 04880f0930333..328a7000fe9f4 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/clientBuilderWithInvalidApiKeyCredential.json +++ b/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/clientBuilderWithInvalidApiKeyCredential.json @@ -1,23 +1,18 @@ { "networkCallRecords" : [ { "Method" : "POST", - "Uri" : "https://westus2.ppe.cognitiveservices.azure.com/text/analytics/v3.0//languages", + "Uri" : "https://REDACTED.cognitiveservices.azure.com/text/analytics/v3.1-preview.1//languages", "Headers" : { - "User-Agent" : "azsdk-java-azure-ai-textanalytics/1.0.0-beta.5 (11.0.4; Windows 10 10.0)", - "x-ms-client-request-id" : "7668c3a1-18fe-4517-aec6-807f6464d047", + "User-Agent" : "azsdk-java-azure-ai-textanalytics/1.1.0-beta.1 (11.0.7; Windows 10; 10.0)", + "x-ms-client-request-id" : "0a7bf23a-f1b4-426c-84c0-827f723f9659", "Content-Type" : "application/json" }, "Response" : { - "Strict-Transport-Security" : "max-age=31536000; includeSubDomains; preload", - "x-content-type-options" : "nosniff", - "apim-request-id" : "2ef43920-d9b5-4c04-bb25-834463644188", - "WWW-Authenticate" : "AzureApiManagementKey realm=\"https://westus2.ppe.cognitiveservices.azure.com/text/analytics\",name=\"Ocp-Apim-Subscription-Key\",type=\"header\"", "retry-after" : "0", - "Content-Length" : "225", + "Content-Length" : "224", "StatusCode" : "401", - "Body" : "{\"error\":{\"code\":\"401\",\"message\": \"Access denied due to invalid subscription key or wrong API endpoint. Make sure to provide a valid key for an active subscription and use a correct regional API endpoint for your resource.\"}}", - "Date" : "Wed, 29 Apr 2020 17:12:18 GMT", - "Content-Type" : "application/json" + "Body" : "{\"error\":{\"code\":\"401\",\"message\":\"Access denied due to invalid subscription key or wrong API endpoint. Make sure to provide a valid key for an active subscription and use a correct regional API endpoint for your resource.\"}}", + "Date" : "Wed, 15 Jul 2020 04:14:43 GMT" }, "Exception" : null } ], diff --git a/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/clientBuilderWithNewCountryHint.json b/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/clientBuilderWithNewCountryHint.json index 13d83b442b6d1..06f67c9c43310 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/clientBuilderWithNewCountryHint.json +++ b/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/clientBuilderWithNewCountryHint.json @@ -1,23 +1,23 @@ { "networkCallRecords" : [ { "Method" : "POST", - "Uri" : "https://westus2.ppe.cognitiveservices.azure.com/text/analytics/v3.0//languages", + "Uri" : "https://REDACTED.cognitiveservices.azure.com/text/analytics/v3.1-preview.1//languages", "Headers" : { - "User-Agent" : "azsdk-java-azure-ai-textanalytics/1.0.0-beta.5 (11.0.4; Windows 10 10.0)", - "x-ms-client-request-id" : "ec96c7c2-36eb-4a6b-9fa2-0761348f2233", + "User-Agent" : "azsdk-java-azure-ai-textanalytics/1.1.0-beta.1 (11.0.7; Windows 10; 10.0)", + "x-ms-client-request-id" : "9737a876-5b70-44b2-89c2-a41524c1dfed", "Content-Type" : "application/json" }, "Response" : { "Transfer-Encoding" : "chunked", - "x-envoy-upstream-service-time" : "2", + "x-envoy-upstream-service-time" : "7", "Strict-Transport-Security" : "max-age=31536000; includeSubDomains; preload", "x-content-type-options" : "nosniff", "csp-billing-usage" : "CognitiveServices.TextAnalytics.BatchScoring=1", - "apim-request-id" : "8b6a679f-87fb-4b48-8de6-d733c232700f", + "apim-request-id" : "4b410dcf-d2d8-4afb-a39b-87e95d35f393", "retry-after" : "0", "StatusCode" : "200", "Body" : "{\"documents\":[{\"id\":\"0\",\"detectedLanguage\":{\"name\":\"Spanish\",\"iso6391Name\":\"es\",\"confidenceScore\":1.0},\"warnings\":[]}],\"errors\":[],\"modelVersion\":\"2019-10-01\"}", - "Date" : "Wed, 29 Apr 2020 17:12:18 GMT", + "Date" : "Wed, 15 Jul 2020 04:14:43 GMT", "Content-Type" : "application/json; charset=utf-8" }, "Exception" : null diff --git a/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/clientBuilderWithNewCountryHintForBatchOperation.json b/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/clientBuilderWithNewCountryHintForBatchOperation.json index 9a167ad1897a4..bde298e006f12 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/clientBuilderWithNewCountryHintForBatchOperation.json +++ b/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/clientBuilderWithNewCountryHintForBatchOperation.json @@ -1,23 +1,23 @@ { "networkCallRecords" : [ { "Method" : "POST", - "Uri" : "https://westus2.ppe.cognitiveservices.azure.com/text/analytics/v3.0//languages", + "Uri" : "https://REDACTED.cognitiveservices.azure.com/text/analytics/v3.1-preview.1//languages", "Headers" : { - "User-Agent" : "azsdk-java-azure-ai-textanalytics/1.0.0-beta.5 (11.0.4; Windows 10 10.0)", - "x-ms-client-request-id" : "ea9b85d5-fd0b-4b53-91e8-ebc4d05c664a", + "User-Agent" : "azsdk-java-azure-ai-textanalytics/1.1.0-beta.1 (11.0.7; Windows 10; 10.0)", + "x-ms-client-request-id" : "2731d960-9fb3-4c70-8422-9360f9970b04", "Content-Type" : "application/json" }, "Response" : { "Transfer-Encoding" : "chunked", - "x-envoy-upstream-service-time" : "2", + "x-envoy-upstream-service-time" : "7", "Strict-Transport-Security" : "max-age=31536000; includeSubDomains; preload", "x-content-type-options" : "nosniff", "csp-billing-usage" : "CognitiveServices.TextAnalytics.BatchScoring=2", - "apim-request-id" : "2d4567a0-347c-4706-8772-1b84e5c92e32", + "apim-request-id" : "23d96b4c-9a02-4c77-b56b-29ae2bd35cfd", "retry-after" : "0", "StatusCode" : "200", "Body" : "{\"documents\":[{\"id\":\"0\",\"detectedLanguage\":{\"name\":\"English\",\"iso6391Name\":\"en\",\"confidenceScore\":1.0},\"warnings\":[]},{\"id\":\"1\",\"detectedLanguage\":{\"name\":\"English\",\"iso6391Name\":\"en\",\"confidenceScore\":1.0},\"warnings\":[]}],\"errors\":[],\"modelVersion\":\"2019-10-01\"}", - "Date" : "Wed, 29 Apr 2020 17:12:17 GMT", + "Date" : "Wed, 15 Jul 2020 04:14:43 GMT", "Content-Type" : "application/json; charset=utf-8" }, "Exception" : null diff --git a/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/clientBuilderWithNewLanguage.json b/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/clientBuilderWithNewLanguage.json index 46528694c0674..e8fe2940c1289 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/clientBuilderWithNewLanguage.json +++ b/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/clientBuilderWithNewLanguage.json @@ -1,23 +1,23 @@ { "networkCallRecords" : [ { "Method" : "POST", - "Uri" : "https://westus2.ppe.cognitiveservices.azure.com/text/analytics/v3.0//keyPhrases", + "Uri" : "https://REDACTED.cognitiveservices.azure.com/text/analytics/v3.1-preview.1//keyPhrases", "Headers" : { - "User-Agent" : "azsdk-java-azure-ai-textanalytics/1.0.0-beta.5 (11.0.4; Windows 10 10.0)", - "x-ms-client-request-id" : "5e23dec1-dd4a-415e-b600-e109fc2f925c", + "User-Agent" : "azsdk-java-azure-ai-textanalytics/1.1.0-beta.1 (11.0.7; Windows 10; 10.0)", + "x-ms-client-request-id" : "e4ae3aa5-6b11-401b-8ccb-a6acdc59e918", "Content-Type" : "application/json" }, "Response" : { "Transfer-Encoding" : "chunked", - "x-envoy-upstream-service-time" : "3", + "x-envoy-upstream-service-time" : "5", "Strict-Transport-Security" : "max-age=31536000; includeSubDomains; preload", "x-content-type-options" : "nosniff", "csp-billing-usage" : "CognitiveServices.TextAnalytics.BatchScoring=1", - "apim-request-id" : "5a8ac46c-9125-46d2-804b-8e08fdc03089", + "apim-request-id" : "388f89c2-98f1-4675-85e4-57429d2531be", "retry-after" : "0", "StatusCode" : "200", "Body" : "{\"documents\":[{\"id\":\"0\",\"keyPhrases\":[\"Je m'appelle Mondly\"],\"warnings\":[]}],\"errors\":[],\"modelVersion\":\"2019-10-01\"}", - "Date" : "Wed, 29 Apr 2020 17:12:18 GMT", + "Date" : "Wed, 15 Jul 2020 04:14:43 GMT", "Content-Type" : "application/json; charset=utf-8" }, "Exception" : null diff --git a/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/clientBuilderWithNewLanguageForBatchOperation.json b/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/clientBuilderWithNewLanguageForBatchOperation.json index a717ba37d52a4..e2e981970ae0e 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/clientBuilderWithNewLanguageForBatchOperation.json +++ b/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/clientBuilderWithNewLanguageForBatchOperation.json @@ -1,23 +1,23 @@ { "networkCallRecords" : [ { "Method" : "POST", - "Uri" : "https://westus2.ppe.cognitiveservices.azure.com/text/analytics/v3.0//keyPhrases", + "Uri" : "https://REDACTED.cognitiveservices.azure.com/text/analytics/v3.1-preview.1//keyPhrases", "Headers" : { - "User-Agent" : "azsdk-java-azure-ai-textanalytics/1.0.0-beta.5 (11.0.4; Windows 10 10.0)", - "x-ms-client-request-id" : "c0635dfd-294d-4cee-bb49-56849619da59", + "User-Agent" : "azsdk-java-azure-ai-textanalytics/1.1.0-beta.1 (11.0.7; Windows 10; 10.0)", + "x-ms-client-request-id" : "f0a679f7-ce2d-40ca-85fe-ae5a5037b3d0", "Content-Type" : "application/json" }, "Response" : { "Transfer-Encoding" : "chunked", - "x-envoy-upstream-service-time" : "3", + "x-envoy-upstream-service-time" : "4", "Strict-Transport-Security" : "max-age=31536000; includeSubDomains; preload", "x-content-type-options" : "nosniff", "csp-billing-usage" : "CognitiveServices.TextAnalytics.BatchScoring=2", - "apim-request-id" : "723acc13-583f-435c-bb27-9fe3bd416fe9", + "apim-request-id" : "b0db648a-257b-403e-b9d8-a0efd13fa5f1", "retry-after" : "0", "StatusCode" : "200", "Body" : "{\"documents\":[{\"id\":\"0\",\"keyPhrases\":[\"monde\"],\"warnings\":[]},{\"id\":\"1\",\"keyPhrases\":[\"Je m'appelle Mondly\"],\"warnings\":[]}],\"errors\":[],\"modelVersion\":\"2019-10-01\"}", - "Date" : "Wed, 29 Apr 2020 17:12:17 GMT", + "Date" : "Wed, 15 Jul 2020 04:14:42 GMT", "Content-Type" : "application/json; charset=utf-8" }, "Exception" : null diff --git a/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/clientBuilderWithNullServiceVersion.json b/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/clientBuilderWithNullServiceVersion.json index b130c60189f8a..00ed2adcd0cec 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/clientBuilderWithNullServiceVersion.json +++ b/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/clientBuilderWithNullServiceVersion.json @@ -1,23 +1,23 @@ { "networkCallRecords" : [ { "Method" : "POST", - "Uri" : "https://westus2.ppe.cognitiveservices.azure.com/text/analytics/v3.0//languages", + "Uri" : "https://REDACTED.cognitiveservices.azure.com/text/analytics/v3.1-preview.1//languages", "Headers" : { - "User-Agent" : "azsdk-java-azure-ai-textanalytics/1.0.0-beta.5 (11.0.4; Windows 10 10.0)", - "x-ms-client-request-id" : "c26cf288-c912-49f8-89db-f4e93a69ef4e", + "User-Agent" : "azsdk-java-azure-ai-textanalytics/1.1.0-beta.1 (11.0.7; Windows 10; 10.0)", + "x-ms-client-request-id" : "b3c50f6a-8ddd-47ba-a6f7-f0d30505c056", "Content-Type" : "application/json" }, "Response" : { "Transfer-Encoding" : "chunked", - "x-envoy-upstream-service-time" : "2", + "x-envoy-upstream-service-time" : "9", "Strict-Transport-Security" : "max-age=31536000; includeSubDomains; preload", "x-content-type-options" : "nosniff", "csp-billing-usage" : "CognitiveServices.TextAnalytics.BatchScoring=1", - "apim-request-id" : "3e7b8e1a-71c0-4cd5-b5b3-8ca28fe65a0a", + "apim-request-id" : "d7e8807e-f5a2-4f7b-a1a5-eb0fc2856323", "retry-after" : "0", "StatusCode" : "200", "Body" : "{\"documents\":[{\"id\":\"0\",\"detectedLanguage\":{\"name\":\"English\",\"iso6391Name\":\"en\",\"confidenceScore\":1.0},\"warnings\":[]}],\"errors\":[],\"modelVersion\":\"2019-10-01\"}", - "Date" : "Wed, 29 Apr 2020 17:12:17 GMT", + "Date" : "Wed, 15 Jul 2020 04:14:42 GMT", "Content-Type" : "application/json; charset=utf-8" }, "Exception" : null diff --git a/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/clientBuilderWithRotateToInvalidKey.json b/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/clientBuilderWithRotateToInvalidKey.json index 29c306958b925..9798baeee1764 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/clientBuilderWithRotateToInvalidKey.json +++ b/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/clientBuilderWithRotateToInvalidKey.json @@ -1,23 +1,18 @@ { "networkCallRecords" : [ { "Method" : "POST", - "Uri" : "https://westus2.ppe.cognitiveservices.azure.com/text/analytics/v3.0//languages", + "Uri" : "https://REDACTED.cognitiveservices.azure.com/text/analytics/v3.1-preview.1//languages", "Headers" : { - "User-Agent" : "azsdk-java-azure-ai-textanalytics/1.0.0-beta.5 (11.0.4; Windows 10 10.0)", - "x-ms-client-request-id" : "7263d388-8337-4f34-bd89-091877803b4e", + "User-Agent" : "azsdk-java-azure-ai-textanalytics/1.1.0-beta.1 (11.0.7; Windows 10; 10.0)", + "x-ms-client-request-id" : "f9c56da2-fec2-43ac-8423-1601ac330b42", "Content-Type" : "application/json" }, "Response" : { - "Strict-Transport-Security" : "max-age=31536000; includeSubDomains; preload", - "x-content-type-options" : "nosniff", - "apim-request-id" : "8b1cf6a6-aa5b-44b4-8c44-8ab8038c5913", - "WWW-Authenticate" : "AzureApiManagementKey realm=\"https://westus2.ppe.cognitiveservices.azure.com/text/analytics\",name=\"Ocp-Apim-Subscription-Key\",type=\"header\"", "retry-after" : "0", - "Content-Length" : "225", + "Content-Length" : "224", "StatusCode" : "401", - "Body" : "{\"error\":{\"code\":\"401\",\"message\": \"Access denied due to invalid subscription key or wrong API endpoint. Make sure to provide a valid key for an active subscription and use a correct regional API endpoint for your resource.\"}}", - "Date" : "Wed, 29 Apr 2020 17:12:18 GMT", - "Content-Type" : "application/json" + "Body" : "{\"error\":{\"code\":\"401\",\"message\":\"Access denied due to invalid subscription key or wrong API endpoint. Make sure to provide a valid key for an active subscription and use a correct regional API endpoint for your resource.\"}}", + "Date" : "Wed, 15 Jul 2020 04:14:43 GMT" }, "Exception" : null } ], diff --git a/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/clientBuilderWithRotateToValidKey.json b/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/clientBuilderWithRotateToValidKey.json index 038740b6f6fc5..6283e7c93c8ad 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/clientBuilderWithRotateToValidKey.json +++ b/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/clientBuilderWithRotateToValidKey.json @@ -1,23 +1,23 @@ { "networkCallRecords" : [ { "Method" : "POST", - "Uri" : "https://westus2.ppe.cognitiveservices.azure.com/text/analytics/v3.0//languages", + "Uri" : "https://REDACTED.cognitiveservices.azure.com/text/analytics/v3.1-preview.1//languages", "Headers" : { - "User-Agent" : "azsdk-java-azure-ai-textanalytics/1.0.0-beta.5 (11.0.4; Windows 10 10.0)", - "x-ms-client-request-id" : "bd554a3b-56e6-428a-b9c1-ca85499d1396", + "User-Agent" : "azsdk-java-azure-ai-textanalytics/1.1.0-beta.1 (11.0.7; Windows 10; 10.0)", + "x-ms-client-request-id" : "457b620f-e1ca-45d2-b68b-35f721b14854", "Content-Type" : "application/json" }, "Response" : { "Transfer-Encoding" : "chunked", - "x-envoy-upstream-service-time" : "3", + "x-envoy-upstream-service-time" : "7", "Strict-Transport-Security" : "max-age=31536000; includeSubDomains; preload", "x-content-type-options" : "nosniff", "csp-billing-usage" : "CognitiveServices.TextAnalytics.BatchScoring=1", - "apim-request-id" : "814618b0-a84b-4329-8bf1-5c6b00e7dc2b", + "apim-request-id" : "b7e247c6-dcea-49b3-a59a-14f5bd879b34", "retry-after" : "0", "StatusCode" : "200", "Body" : "{\"documents\":[{\"id\":\"0\",\"detectedLanguage\":{\"name\":\"English\",\"iso6391Name\":\"en\",\"confidenceScore\":1.0},\"warnings\":[]}],\"errors\":[],\"modelVersion\":\"2019-10-01\"}", - "Date" : "Wed, 29 Apr 2020 17:12:17 GMT", + "Date" : "Wed, 15 Jul 2020 04:14:42 GMT", "Content-Type" : "application/json; charset=utf-8" }, "Exception" : null diff --git a/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/clientBuilderWithValidApiKeyCredential.json b/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/clientBuilderWithValidApiKeyCredential.json index e0f2a7a8be6d1..0b672fbd3ba5b 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/clientBuilderWithValidApiKeyCredential.json +++ b/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/clientBuilderWithValidApiKeyCredential.json @@ -1,23 +1,23 @@ { "networkCallRecords" : [ { "Method" : "POST", - "Uri" : "https://westus2.ppe.cognitiveservices.azure.com/text/analytics/v3.0//languages", + "Uri" : "https://REDACTED.cognitiveservices.azure.com/text/analytics/v3.1-preview.1//languages", "Headers" : { - "User-Agent" : "azsdk-java-azure-ai-textanalytics/1.0.0-beta.5 (11.0.4; Windows 10 10.0)", - "x-ms-client-request-id" : "15007527-5e92-4b9e-9a43-4ff1a2153247", + "User-Agent" : "azsdk-java-azure-ai-textanalytics/1.1.0-beta.1 (11.0.7; Windows 10; 10.0)", + "x-ms-client-request-id" : "cac692a6-264d-4df5-b82a-1e839148c2bc", "Content-Type" : "application/json" }, "Response" : { "Transfer-Encoding" : "chunked", - "x-envoy-upstream-service-time" : "2", + "x-envoy-upstream-service-time" : "7", "Strict-Transport-Security" : "max-age=31536000; includeSubDomains; preload", "x-content-type-options" : "nosniff", "csp-billing-usage" : "CognitiveServices.TextAnalytics.BatchScoring=1", - "apim-request-id" : "6a90988f-83ad-4a6f-9598-62c3a5958ff7", + "apim-request-id" : "70904319-9f94-49a6-906a-379fe96496fd", "retry-after" : "0", "StatusCode" : "200", "Body" : "{\"documents\":[{\"id\":\"0\",\"detectedLanguage\":{\"name\":\"English\",\"iso6391Name\":\"en\",\"confidenceScore\":1.0},\"warnings\":[]}],\"errors\":[],\"modelVersion\":\"2019-10-01\"}", - "Date" : "Wed, 29 Apr 2020 17:12:17 GMT", + "Date" : "Wed, 15 Jul 2020 04:14:42 GMT", "Content-Type" : "application/json; charset=utf-8" }, "Exception" : null diff --git a/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/detectLanguageDuplicateIdInput.json b/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/detectLanguageDuplicateIdInput.json index 0129d844b940b..ff81a821cb945 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/detectLanguageDuplicateIdInput.json +++ b/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/detectLanguageDuplicateIdInput.json @@ -1,22 +1,22 @@ { "networkCallRecords" : [ { "Method" : "POST", - "Uri" : "https://westus2.ppe.cognitiveservices.azure.com/text/analytics/v3.0//languages", + "Uri" : "https://REDACTED.cognitiveservices.azure.com/text/analytics/v3.1-preview.1//languages", "Headers" : { - "User-Agent" : "azsdk-java-azure-ai-textanalytics/1.0.0-beta.5 (11.0.4; Windows 10 10.0)", - "x-ms-client-request-id" : "b27774bc-d2d4-4f86-94fa-8af830bf480f", + "User-Agent" : "azsdk-java-azure-ai-textanalytics/1.1.0-beta.1 (11.0.7; Windows 10; 10.0)", + "x-ms-client-request-id" : "90d576e3-1b2d-48cb-b8e7-367a653458fb", "Content-Type" : "application/json" }, "Response" : { "Transfer-Encoding" : "chunked", - "x-envoy-upstream-service-time" : "131", + "x-envoy-upstream-service-time" : "4", "Strict-Transport-Security" : "max-age=31536000; includeSubDomains; preload", "x-content-type-options" : "nosniff", - "apim-request-id" : "0c3ce8d9-fd5f-4ee9-9148-ef246412161d", + "apim-request-id" : "232295a8-9591-4b36-8410-36b8bd360449", "retry-after" : "0", "StatusCode" : "400", - "Body" : "{\"error\":{\"code\":\"InvalidRequest\",\"message\":\"Invalid document in request.\",\"innerError\":{\"code\":\"InvalidDocument\",\"message\":\"Request contains duplicated Ids. Make sure each document has a unique Id.\"}}}", - "Date" : "Thu, 30 Apr 2020 03:19:53 GMT", + "Body" : "{\"error\":{\"code\":\"InvalidRequest\",\"message\":\"Invalid document in request.\",\"innererror\":{\"code\":\"InvalidDocument\",\"message\":\"Request contains duplicated Ids. Make sure each document has a unique Id.\"}}}", + "Date" : "Wed, 15 Jul 2020 04:14:34 GMT", "Content-Type" : "application/json; charset=utf-8" }, "Exception" : null diff --git a/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/detectLanguageEmptyCountryHint.json b/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/detectLanguageEmptyCountryHint.json index 171ff3acffe4f..30703f4c87c3d 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/detectLanguageEmptyCountryHint.json +++ b/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/detectLanguageEmptyCountryHint.json @@ -1,23 +1,23 @@ { "networkCallRecords" : [ { "Method" : "POST", - "Uri" : "https://westus2.ppe.cognitiveservices.azure.com/text/analytics/v3.0//languages", + "Uri" : "https://REDACTED.cognitiveservices.azure.com/text/analytics/v3.1-preview.1//languages", "Headers" : { - "User-Agent" : "azsdk-java-azure-ai-textanalytics/1.0.0-beta.5 (11.0.4; Windows 10 10.0)", - "x-ms-client-request-id" : "fc50ed8b-a253-44a0-9a3d-b3ddf8b735ad", + "User-Agent" : "azsdk-java-azure-ai-textanalytics/1.1.0-beta.1 (11.0.7; Windows 10; 10.0)", + "x-ms-client-request-id" : "38581834-8351-460e-a706-57d247d0c8c1", "Content-Type" : "application/json" }, "Response" : { "Transfer-Encoding" : "chunked", - "x-envoy-upstream-service-time" : "2", + "x-envoy-upstream-service-time" : "7", "Strict-Transport-Security" : "max-age=31536000; includeSubDomains; preload", "x-content-type-options" : "nosniff", "csp-billing-usage" : "CognitiveServices.TextAnalytics.BatchScoring=1", - "apim-request-id" : "29ffb9f3-a27e-4153-a3b7-e9b81394c68e", + "apim-request-id" : "5c201a8d-eda4-46e4-81a4-048714871300", "retry-after" : "0", "StatusCode" : "200", "Body" : "{\"documents\":[{\"id\":\"0\",\"detectedLanguage\":{\"name\":\"Spanish\",\"iso6391Name\":\"es\",\"confidenceScore\":1.0},\"warnings\":[]}],\"errors\":[],\"modelVersion\":\"2019-10-01\"}", - "Date" : "Wed, 29 Apr 2020 17:12:19 GMT", + "Date" : "Wed, 15 Jul 2020 04:14:34 GMT", "Content-Type" : "application/json; charset=utf-8" }, "Exception" : null diff --git a/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/detectLanguageEmptyText.json b/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/detectLanguageEmptyText.json index dfa19617cca60..7fddfc69c3796 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/detectLanguageEmptyText.json +++ b/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/detectLanguageEmptyText.json @@ -1,23 +1,22 @@ { "networkCallRecords" : [ { "Method" : "POST", - "Uri" : "https://westus2.ppe.cognitiveservices.azure.com/text/analytics/v3.0//languages", + "Uri" : "https://REDACTED.cognitiveservices.azure.com/text/analytics/v3.1-preview.1//languages", "Headers" : { - "User-Agent" : "azsdk-java-azure-ai-textanalytics/1.0.0-beta.5 (11.0.4; Windows 10 10.0)", - "x-ms-client-request-id" : "fda541db-a54d-40ce-9af8-9c7c31b6720b", + "User-Agent" : "azsdk-java-azure-ai-textanalytics/1.1.0-beta.1 (11.0.7; Windows 10; 10.0)", + "x-ms-client-request-id" : "201beac7-cedd-4db1-8390-5f87cf6ecf95", "Content-Type" : "application/json" }, "Response" : { "Transfer-Encoding" : "chunked", - "x-envoy-upstream-service-time" : "3", + "x-envoy-upstream-service-time" : "6", "Strict-Transport-Security" : "max-age=31536000; includeSubDomains; preload", "x-content-type-options" : "nosniff", - "csp-billing-usage" : "CognitiveServices.TextAnalytics.BatchScoring=0", - "apim-request-id" : "67ed867c-981d-459c-b069-8a83a61f7fbb", + "apim-request-id" : "515a36d0-2ec5-4399-8ab7-c91d0e3deb9f", "retry-after" : "0", "StatusCode" : "200", "Body" : "{\"documents\":[],\"errors\":[{\"id\":\"0\",\"error\":{\"code\":\"InvalidArgument\",\"message\":\"Invalid document in request.\",\"innererror\":{\"code\":\"InvalidDocument\",\"message\":\"Document text is empty.\"}}}],\"modelVersion\":\"2019-10-01\"}", - "Date" : "Wed, 29 Apr 2020 17:12:19 GMT", + "Date" : "Wed, 15 Jul 2020 06:14:50 GMT", "Content-Type" : "application/json; charset=utf-8" }, "Exception" : null diff --git a/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/detectLanguageFaultyText.json b/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/detectLanguageFaultyText.json index cd50802112dc7..da3fb418bf7f5 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/detectLanguageFaultyText.json +++ b/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/detectLanguageFaultyText.json @@ -1,23 +1,23 @@ { "networkCallRecords" : [ { "Method" : "POST", - "Uri" : "https://westus2.ppe.cognitiveservices.azure.com/text/analytics/v3.0//languages", + "Uri" : "https://REDACTED.cognitiveservices.azure.com/text/analytics/v3.1-preview.1//languages", "Headers" : { - "User-Agent" : "azsdk-java-azure-ai-textanalytics/1.0.0-beta.5 (11.0.4; Windows 10 10.0)", - "x-ms-client-request-id" : "b4798dac-a6de-414c-b454-9015fc274e4c", + "User-Agent" : "azsdk-java-azure-ai-textanalytics/1.1.0-beta.1 (11.0.7; Windows 10; 10.0)", + "x-ms-client-request-id" : "7b64255d-f8ad-40a7-817e-325772bb8819", "Content-Type" : "application/json" }, "Response" : { "Transfer-Encoding" : "chunked", - "x-envoy-upstream-service-time" : "3", + "x-envoy-upstream-service-time" : "8", "Strict-Transport-Security" : "max-age=31536000; includeSubDomains; preload", "x-content-type-options" : "nosniff", "csp-billing-usage" : "CognitiveServices.TextAnalytics.BatchScoring=1", - "apim-request-id" : "8464a8c1-5b12-43ed-83ba-57ae307d8daa", + "apim-request-id" : "814ef715-d269-4492-b6bc-4878c75bb9f5", "retry-after" : "0", "StatusCode" : "200", "Body" : "{\"documents\":[{\"id\":\"0\",\"detectedLanguage\":{\"name\":\"(Unknown)\",\"iso6391Name\":\"(Unknown)\",\"confidenceScore\":0.0},\"warnings\":[]}],\"errors\":[],\"modelVersion\":\"2019-10-01\"}", - "Date" : "Wed, 29 Apr 2020 17:12:20 GMT", + "Date" : "Wed, 15 Jul 2020 04:14:40 GMT", "Content-Type" : "application/json; charset=utf-8" }, "Exception" : null diff --git a/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/detectLanguageInvalidCountryHint.json b/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/detectLanguageInvalidCountryHint.json index 7053f03099883..4b2445a572ce3 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/detectLanguageInvalidCountryHint.json +++ b/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/detectLanguageInvalidCountryHint.json @@ -1,23 +1,22 @@ { "networkCallRecords" : [ { "Method" : "POST", - "Uri" : "https://westus2.ppe.cognitiveservices.azure.com/text/analytics/v3.0//languages", + "Uri" : "https://REDACTED.cognitiveservices.azure.com/text/analytics/v3.1-preview.1//languages", "Headers" : { - "User-Agent" : "azsdk-java-azure-ai-textanalytics/1.0.0-beta.5 (11.0.4; Windows 10 10.0)", - "x-ms-client-request-id" : "b9cbba15-0057-4127-adf9-02a6573dbf20", + "User-Agent" : "azsdk-java-azure-ai-textanalytics/1.1.0-beta.1 (11.0.7; Windows 10; 10.0)", + "x-ms-client-request-id" : "9d69b921-32bd-4405-aca9-7735067f0c76", "Content-Type" : "application/json" }, "Response" : { "Transfer-Encoding" : "chunked", - "x-envoy-upstream-service-time" : "2", + "x-envoy-upstream-service-time" : "11", "Strict-Transport-Security" : "max-age=31536000; includeSubDomains; preload", "x-content-type-options" : "nosniff", - "csp-billing-usage" : "CognitiveServices.TextAnalytics.BatchScoring=0", - "apim-request-id" : "d3048c6a-f280-4303-a500-6fbe274e42de", + "apim-request-id" : "64b09a3d-d2df-42c6-9bee-099b1cb4d230", "retry-after" : "0", "StatusCode" : "200", "Body" : "{\"documents\":[],\"errors\":[{\"id\":\"0\",\"error\":{\"code\":\"InvalidArgument\",\"message\":\"Invalid Country Hint.\",\"innererror\":{\"code\":\"InvalidCountryHint\",\"message\":\"Country hint is not valid. Please specify an ISO 3166-1 alpha-2 two letter country code.\"}}}],\"modelVersion\":\"2019-10-01\"}", - "Date" : "Wed, 29 Apr 2020 17:12:20 GMT", + "Date" : "Wed, 15 Jul 2020 05:21:19 GMT", "Content-Type" : "application/json; charset=utf-8" }, "Exception" : null diff --git a/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/detectLanguageNoneCountryHint.json b/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/detectLanguageNoneCountryHint.json index 6c14fdd167380..d0886143a9d92 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/detectLanguageNoneCountryHint.json +++ b/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/detectLanguageNoneCountryHint.json @@ -1,23 +1,23 @@ { "networkCallRecords" : [ { "Method" : "POST", - "Uri" : "https://westus2.ppe.cognitiveservices.azure.com/text/analytics/v3.0//languages", + "Uri" : "https://REDACTED.cognitiveservices.azure.com/text/analytics/v3.1-preview.1//languages", "Headers" : { - "User-Agent" : "azsdk-java-azure-ai-textanalytics/1.0.0-beta.5 (11.0.4; Windows 10 10.0)", - "x-ms-client-request-id" : "b85ce7a1-93c9-4757-ae1e-8aa42c1efb2f", + "User-Agent" : "azsdk-java-azure-ai-textanalytics/1.1.0-beta.1 (11.0.7; Windows 10; 10.0)", + "x-ms-client-request-id" : "c9dfa311-86d8-4af3-9084-1b895aff0328", "Content-Type" : "application/json" }, "Response" : { "Transfer-Encoding" : "chunked", - "x-envoy-upstream-service-time" : "2", + "x-envoy-upstream-service-time" : "8", "Strict-Transport-Security" : "max-age=31536000; includeSubDomains; preload", "x-content-type-options" : "nosniff", "csp-billing-usage" : "CognitiveServices.TextAnalytics.BatchScoring=1", - "apim-request-id" : "650c3b64-125a-4045-aded-945ff682c6aa", + "apim-request-id" : "d24f76ec-1e3c-425c-ada1-d7ad8ed5570a", "retry-after" : "0", "StatusCode" : "200", "Body" : "{\"documents\":[{\"id\":\"0\",\"detectedLanguage\":{\"name\":\"Spanish\",\"iso6391Name\":\"es\",\"confidenceScore\":1.0},\"warnings\":[]}],\"errors\":[],\"modelVersion\":\"2019-10-01\"}", - "Date" : "Wed, 29 Apr 2020 17:12:18 GMT", + "Date" : "Wed, 15 Jul 2020 04:14:26 GMT", "Content-Type" : "application/json; charset=utf-8" }, "Exception" : null diff --git a/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/detectLanguagesBatchInput.json b/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/detectLanguagesBatchInput.json index a0acc03c88e35..e875f162913e2 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/detectLanguagesBatchInput.json +++ b/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/detectLanguagesBatchInput.json @@ -1,23 +1,23 @@ { "networkCallRecords" : [ { "Method" : "POST", - "Uri" : "https://westus2.ppe.cognitiveservices.azure.com/text/analytics/v3.0//languages", + "Uri" : "https://REDACTED.cognitiveservices.azure.com/text/analytics/v3.1-preview.1//languages", "Headers" : { - "User-Agent" : "azsdk-java-azure-ai-textanalytics/1.0.0-beta.5 (11.0.4; Windows 10 10.0)", - "x-ms-client-request-id" : "944c5c64-c881-4308-a447-816f72df9ab0", + "User-Agent" : "azsdk-java-azure-ai-textanalytics/1.1.0-beta.1 (11.0.7; Windows 10; 10.0)", + "x-ms-client-request-id" : "f12701d1-dc38-40ca-8fc4-d3ed25740f18", "Content-Type" : "application/json" }, "Response" : { "Transfer-Encoding" : "chunked", - "x-envoy-upstream-service-time" : "3", + "x-envoy-upstream-service-time" : "8", "Strict-Transport-Security" : "max-age=31536000; includeSubDomains; preload", "x-content-type-options" : "nosniff", "csp-billing-usage" : "CognitiveServices.TextAnalytics.BatchScoring=3", - "apim-request-id" : "52ef94e1-4b42-49db-b8f2-5bd6bfed78de", + "apim-request-id" : "f5a23511-ea35-4fad-b38e-796e6e9021be", "retry-after" : "0", "StatusCode" : "200", "Body" : "{\"documents\":[{\"id\":\"0\",\"detectedLanguage\":{\"name\":\"English\",\"iso6391Name\":\"en\",\"confidenceScore\":1.0},\"warnings\":[]},{\"id\":\"1\",\"detectedLanguage\":{\"name\":\"Spanish\",\"iso6391Name\":\"es\",\"confidenceScore\":1.0},\"warnings\":[]},{\"id\":\"2\",\"detectedLanguage\":{\"name\":\"(Unknown)\",\"iso6391Name\":\"(Unknown)\",\"confidenceScore\":0.0},\"warnings\":[]}],\"errors\":[],\"modelVersion\":\"2019-10-01\"}", - "Date" : "Wed, 29 Apr 2020 17:12:20 GMT", + "Date" : "Wed, 15 Jul 2020 04:14:41 GMT", "Content-Type" : "application/json; charset=utf-8" }, "Exception" : null diff --git a/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/detectLanguagesBatchInputShowStatistics.json b/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/detectLanguagesBatchInputShowStatistics.json index 188f68f3e61f6..4a1532ddfe63e 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/detectLanguagesBatchInputShowStatistics.json +++ b/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/detectLanguagesBatchInputShowStatistics.json @@ -1,23 +1,23 @@ { "networkCallRecords" : [ { "Method" : "POST", - "Uri" : "https://westus2.ppe.cognitiveservices.azure.com/text/analytics/v3.0//languages?showStats=true", + "Uri" : "https://REDACTED.cognitiveservices.azure.com/text/analytics/v3.1-preview.1//languages?showStats=true", "Headers" : { - "User-Agent" : "azsdk-java-azure-ai-textanalytics/1.0.0-beta.5 (11.0.4; Windows 10 10.0)", - "x-ms-client-request-id" : "e1e1b615-a26b-4c9e-961e-ae73b2168cf1", + "User-Agent" : "azsdk-java-azure-ai-textanalytics/1.1.0-beta.1 (11.0.7; Windows 10; 10.0)", + "x-ms-client-request-id" : "d9d1eb82-9746-4cfa-a994-5f48dd37323a", "Content-Type" : "application/json" }, "Response" : { "Transfer-Encoding" : "chunked", - "x-envoy-upstream-service-time" : "3", + "x-envoy-upstream-service-time" : "7", "Strict-Transport-Security" : "max-age=31536000; includeSubDomains; preload", "x-content-type-options" : "nosniff", "csp-billing-usage" : "CognitiveServices.TextAnalytics.BatchScoring=3", - "apim-request-id" : "48410bc9-b67c-4615-8bcf-2cadfe4f2d46", + "apim-request-id" : "c5036c9e-72e2-4ec8-8519-aca69ef8f7fe", "retry-after" : "0", "StatusCode" : "200", "Body" : "{\"statistics\":{\"documentsCount\":3,\"validDocumentsCount\":3,\"erroneousDocumentsCount\":0,\"transactionsCount\":3},\"documents\":[{\"id\":\"0\",\"detectedLanguage\":{\"name\":\"English\",\"iso6391Name\":\"en\",\"confidenceScore\":1.0},\"statistics\":{\"charactersCount\":26,\"transactionsCount\":1},\"warnings\":[]},{\"id\":\"1\",\"detectedLanguage\":{\"name\":\"Spanish\",\"iso6391Name\":\"es\",\"confidenceScore\":1.0},\"statistics\":{\"charactersCount\":40,\"transactionsCount\":1},\"warnings\":[]},{\"id\":\"2\",\"detectedLanguage\":{\"name\":\"(Unknown)\",\"iso6391Name\":\"(Unknown)\",\"confidenceScore\":0.0},\"statistics\":{\"charactersCount\":6,\"transactionsCount\":1},\"warnings\":[]}],\"errors\":[],\"modelVersion\":\"2019-10-01\"}", - "Date" : "Wed, 29 Apr 2020 17:12:19 GMT", + "Date" : "Wed, 15 Jul 2020 04:14:33 GMT", "Content-Type" : "application/json; charset=utf-8" }, "Exception" : null diff --git a/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/detectLanguagesBatchInputShowStatisticsNew.json b/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/detectLanguagesBatchInputShowStatisticsNew.json deleted file mode 100644 index 78dc5f5301c36..0000000000000 --- a/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/detectLanguagesBatchInputShowStatisticsNew.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "networkCallRecords" : [ { - "Method" : "POST", - "Uri" : "https://javatextanalyticstestresources.cognitiveservices.azure.com/text/analytics/v3.0-preview.1/languages?showStats=true", - "Headers" : { - "User-Agent" : "azsdk-java-UnknownName/UnknownVersion (11.0.4; Windows 10 10.0)", - "x-ms-client-request-id" : "7bbf00ca-d6c7-4e17-9bf4-6bdc587fbdb1", - "Content-Type" : "application/json" - }, - "Response" : { - "Transfer-Encoding" : "chunked", - "x-envoy-upstream-service-time" : "6", - "Strict-Transport-Security" : "max-age=31536000; includeSubDomains; preload", - "x-content-type-options" : "nosniff", - "csp-billing-usage" : "CognitiveServices.TextAnalytics.BatchScoring=3", - "apim-request-id" : "0a3819af-a97d-4279-9c1c-30e216082788", - "x-aml-ta-request-id" : "78f53879-b38b-40ec-b441-e47ebc2c5905", - "retry-after" : "0", - "StatusCode" : "200", - "Body" : "{\"statistics\":{\"documentsCount\":3,\"validDocumentsCount\":3,\"erroneousDocumentsCount\":0,\"transactionsCount\":3},\"documents\":[{\"id\":\"0\",\"detectedLanguages\":[{\"name\":\"English\",\"iso6391Name\":\"en\",\"score\":1.0}],\"statistics\":{\"charactersCount\":26,\"transactionsCount\":1}},{\"id\":\"1\",\"detectedLanguages\":[{\"name\":\"Spanish\",\"iso6391Name\":\"es\",\"score\":1.0}],\"statistics\":{\"charactersCount\":39,\"transactionsCount\":1}},{\"id\":\"2\",\"detectedLanguages\":[{\"name\":\"(Unknown)\",\"iso6391Name\":\"(Unknown)\",\"score\":0.0}],\"statistics\":{\"charactersCount\":6,\"transactionsCount\":1}}],\"errors\":[],\"modelVersion\":\"2019-10-01\"}", - "Date" : "Fri, 06 Dec 2019 23:45:12 GMT", - "Content-Type" : "application/json; charset=utf-8" - }, - "Exception" : null - } ], - "variables" : [ ] -} diff --git a/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/detectLanguagesBatchListCountryHint.json b/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/detectLanguagesBatchListCountryHint.json index 515ad3413f89f..95f211e86aeaa 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/detectLanguagesBatchListCountryHint.json +++ b/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/detectLanguagesBatchListCountryHint.json @@ -1,23 +1,23 @@ { "networkCallRecords" : [ { "Method" : "POST", - "Uri" : "https://westus2.ppe.cognitiveservices.azure.com/text/analytics/v3.0//languages", + "Uri" : "https://REDACTED.cognitiveservices.azure.com/text/analytics/v3.1-preview.1//languages", "Headers" : { - "User-Agent" : "azsdk-java-azure-ai-textanalytics/1.0.0-beta.5 (11.0.4; Windows 10 10.0)", - "x-ms-client-request-id" : "e8c4d152-8f81-43ba-beab-333ffc907333", + "User-Agent" : "azsdk-java-azure-ai-textanalytics/1.1.0-beta.1 (11.0.7; Windows 10; 10.0)", + "x-ms-client-request-id" : "1dadde91-c611-4113-b4dd-cb220ff76d93", "Content-Type" : "application/json" }, "Response" : { "Transfer-Encoding" : "chunked", - "x-envoy-upstream-service-time" : "2", + "x-envoy-upstream-service-time" : "8", "Strict-Transport-Security" : "max-age=31536000; includeSubDomains; preload", "x-content-type-options" : "nosniff", "csp-billing-usage" : "CognitiveServices.TextAnalytics.BatchScoring=3", - "apim-request-id" : "a7d6e3ca-f60f-4a20-99ca-a5ac0ef79451", + "apim-request-id" : "63831bed-228f-4060-8075-0290c388cec3", "retry-after" : "0", "StatusCode" : "200", "Body" : "{\"documents\":[{\"id\":\"0\",\"detectedLanguage\":{\"name\":\"English\",\"iso6391Name\":\"en\",\"confidenceScore\":1.0},\"warnings\":[]},{\"id\":\"1\",\"detectedLanguage\":{\"name\":\"Spanish\",\"iso6391Name\":\"es\",\"confidenceScore\":1.0},\"warnings\":[]},{\"id\":\"2\",\"detectedLanguage\":{\"name\":\"(Unknown)\",\"iso6391Name\":\"(Unknown)\",\"confidenceScore\":0.0},\"warnings\":[]}],\"errors\":[],\"modelVersion\":\"2019-10-01\"}", - "Date" : "Wed, 29 Apr 2020 17:12:20 GMT", + "Date" : "Wed, 15 Jul 2020 04:14:39 GMT", "Content-Type" : "application/json; charset=utf-8" }, "Exception" : null diff --git a/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/detectLanguagesBatchListCountryHintWithOptions.json b/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/detectLanguagesBatchListCountryHintWithOptions.json index 92ed0217cccf2..00c1028403452 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/detectLanguagesBatchListCountryHintWithOptions.json +++ b/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/detectLanguagesBatchListCountryHintWithOptions.json @@ -1,23 +1,23 @@ { "networkCallRecords" : [ { "Method" : "POST", - "Uri" : "https://westus2.ppe.cognitiveservices.azure.com/text/analytics/v3.0//languages?showStats=true", + "Uri" : "https://REDACTED.cognitiveservices.azure.com/text/analytics/v3.1-preview.1//languages?showStats=true", "Headers" : { - "User-Agent" : "azsdk-java-azure-ai-textanalytics/1.0.0-beta.5 (11.0.4; Windows 10 10.0)", - "x-ms-client-request-id" : "e54088d4-3873-44d9-b21f-7d26d068896d", + "User-Agent" : "azsdk-java-azure-ai-textanalytics/1.1.0-beta.1 (11.0.7; Windows 10; 10.0)", + "x-ms-client-request-id" : "15d08c28-acf4-44e4-bd7f-41cdcd8ed18c", "Content-Type" : "application/json" }, "Response" : { "Transfer-Encoding" : "chunked", - "x-envoy-upstream-service-time" : "3", + "x-envoy-upstream-service-time" : "8", "Strict-Transport-Security" : "max-age=31536000; includeSubDomains; preload", "x-content-type-options" : "nosniff", "csp-billing-usage" : "CognitiveServices.TextAnalytics.BatchScoring=3", - "apim-request-id" : "bdf7f3e6-3805-4dfd-bdc3-404e12b68a30", + "apim-request-id" : "327012fc-8461-44ba-8cdb-687378056036", "retry-after" : "0", "StatusCode" : "200", "Body" : "{\"statistics\":{\"documentsCount\":3,\"validDocumentsCount\":3,\"erroneousDocumentsCount\":0,\"transactionsCount\":3},\"documents\":[{\"id\":\"0\",\"detectedLanguage\":{\"name\":\"English\",\"iso6391Name\":\"en\",\"confidenceScore\":1.0},\"statistics\":{\"charactersCount\":26,\"transactionsCount\":1},\"warnings\":[]},{\"id\":\"1\",\"detectedLanguage\":{\"name\":\"Spanish\",\"iso6391Name\":\"es\",\"confidenceScore\":1.0},\"statistics\":{\"charactersCount\":40,\"transactionsCount\":1},\"warnings\":[]},{\"id\":\"2\",\"detectedLanguage\":{\"name\":\"(Unknown)\",\"iso6391Name\":\"(Unknown)\",\"confidenceScore\":0.0},\"statistics\":{\"charactersCount\":6,\"transactionsCount\":1},\"warnings\":[]}],\"errors\":[],\"modelVersion\":\"2019-10-01\"}", - "Date" : "Wed, 29 Apr 2020 17:12:19 GMT", + "Date" : "Wed, 15 Jul 2020 04:14:36 GMT", "Content-Type" : "application/json; charset=utf-8" }, "Exception" : null diff --git a/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/detectLanguagesBatchStringInput.json b/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/detectLanguagesBatchStringInput.json index 4f163bf2ab41b..f4152948f34aa 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/detectLanguagesBatchStringInput.json +++ b/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/detectLanguagesBatchStringInput.json @@ -1,23 +1,23 @@ { "networkCallRecords" : [ { "Method" : "POST", - "Uri" : "https://westus2.ppe.cognitiveservices.azure.com/text/analytics/v3.0//languages", + "Uri" : "https://REDACTED.cognitiveservices.azure.com/text/analytics/v3.1-preview.1//languages", "Headers" : { - "User-Agent" : "azsdk-java-azure-ai-textanalytics/1.0.0-beta.5 (11.0.4; Windows 10 10.0)", - "x-ms-client-request-id" : "9fc32873-4b4c-47cb-8378-e1647f654d9a", + "User-Agent" : "azsdk-java-azure-ai-textanalytics/1.1.0-beta.1 (11.0.7; Windows 10; 10.0)", + "x-ms-client-request-id" : "66f3f4d9-3460-4c95-9eff-bc80fcfdd11b", "Content-Type" : "application/json" }, "Response" : { "Transfer-Encoding" : "chunked", - "x-envoy-upstream-service-time" : "3", + "x-envoy-upstream-service-time" : "7", "Strict-Transport-Security" : "max-age=31536000; includeSubDomains; preload", "x-content-type-options" : "nosniff", "csp-billing-usage" : "CognitiveServices.TextAnalytics.BatchScoring=3", - "apim-request-id" : "702da38b-f3d2-4d1f-8c01-c42cf5cdd23d", + "apim-request-id" : "c0c42ba6-d0ca-417d-a1b4-5801af943e22", "retry-after" : "0", "StatusCode" : "200", "Body" : "{\"documents\":[{\"id\":\"0\",\"detectedLanguage\":{\"name\":\"English\",\"iso6391Name\":\"en\",\"confidenceScore\":1.0},\"warnings\":[]},{\"id\":\"1\",\"detectedLanguage\":{\"name\":\"Spanish\",\"iso6391Name\":\"es\",\"confidenceScore\":1.0},\"warnings\":[]},{\"id\":\"2\",\"detectedLanguage\":{\"name\":\"(Unknown)\",\"iso6391Name\":\"(Unknown)\",\"confidenceScore\":0.0},\"warnings\":[]}],\"errors\":[],\"modelVersion\":\"2019-10-01\"}", - "Date" : "Wed, 29 Apr 2020 17:12:18 GMT", + "Date" : "Wed, 15 Jul 2020 04:14:30 GMT", "Content-Type" : "application/json; charset=utf-8" }, "Exception" : null diff --git a/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/detectLanguagesBatchStringList.json b/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/detectLanguagesBatchStringList.json deleted file mode 100644 index 5af42401c1a1c..0000000000000 --- a/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/detectLanguagesBatchStringList.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "networkCallRecords" : [ { - "Method" : "POST", - "Uri" : "https://javatextanalyticstestresources.cognitiveservices.azure.com/text/analytics/v3.0-preview.1/languages", - "Headers" : { - "User-Agent" : "azsdk-java-UnknownName/UnknownVersion (11.0.4; Windows 10 10.0)", - "x-ms-client-request-id" : "f2c6afdf-c7d9-4b64-bb47-df7a395fb176", - "Content-Type" : "application/json" - }, - "Response" : { - "Transfer-Encoding" : "chunked", - "x-envoy-upstream-service-time" : "6", - "Strict-Transport-Security" : "max-age=31536000; includeSubDomains; preload", - "x-content-type-options" : "nosniff", - "csp-billing-usage" : "CognitiveServices.TextAnalytics.BatchScoring=3", - "apim-request-id" : "9f374d46-7574-40a3-8f1f-909d785f9bbb", - "x-aml-ta-request-id" : "5927da90-8c7b-4102-916c-b49197615813", - "retry-after" : "0", - "StatusCode" : "200", - "Body" : "{\"documents\":[{\"id\":\"0\",\"detectedLanguages\":[{\"name\":\"English\",\"iso6391Name\":\"en\",\"score\":1.0}]},{\"id\":\"1\",\"detectedLanguages\":[{\"name\":\"Spanish\",\"iso6391Name\":\"es\",\"score\":1.0}]},{\"id\":\"2\",\"detectedLanguages\":[{\"name\":\"(Unknown)\",\"iso6391Name\":\"(Unknown)\",\"score\":0.0}]}],\"errors\":[],\"modelVersion\":\"2019-10-01\"}", - "Date" : "Fri, 06 Dec 2019 23:45:12 GMT", - "Content-Type" : "application/json; charset=utf-8" - }, - "Exception" : null - } ], - "variables" : [ ] -} diff --git a/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/detectSingleTextLanguage.json b/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/detectSingleTextLanguage.json index 707c7cd281035..fc430dada420e 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/detectSingleTextLanguage.json +++ b/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/detectSingleTextLanguage.json @@ -1,23 +1,23 @@ { "networkCallRecords" : [ { "Method" : "POST", - "Uri" : "https://westus2.ppe.cognitiveservices.azure.com/text/analytics/v3.0//languages", + "Uri" : "https://REDACTED.cognitiveservices.azure.com/text/analytics/v3.1-preview.1//languages", "Headers" : { - "User-Agent" : "azsdk-java-azure-ai-textanalytics/1.0.0-beta.5 (11.0.4; Windows 10 10.0)", - "x-ms-client-request-id" : "98b653f8-4f93-4fdc-b4ee-adabc657071c", + "User-Agent" : "azsdk-java-azure-ai-textanalytics/1.1.0-beta.1 (11.0.7; Windows 10; 10.0)", + "x-ms-client-request-id" : "f1dbbaa8-c081-4059-9d5d-6e5286a06c41", "Content-Type" : "application/json" }, "Response" : { "Transfer-Encoding" : "chunked", - "x-envoy-upstream-service-time" : "2", + "x-envoy-upstream-service-time" : "6", "Strict-Transport-Security" : "max-age=31536000; includeSubDomains; preload", "x-content-type-options" : "nosniff", "csp-billing-usage" : "CognitiveServices.TextAnalytics.BatchScoring=1", - "apim-request-id" : "ce9d081a-00cb-4505-81a9-d845d92a4210", + "apim-request-id" : "52fa2d38-a805-4a66-be05-8dac3f85bff2", "retry-after" : "0", "StatusCode" : "200", "Body" : "{\"documents\":[{\"id\":\"0\",\"detectedLanguage\":{\"name\":\"English\",\"iso6391Name\":\"en\",\"confidenceScore\":1.0},\"warnings\":[]}],\"errors\":[],\"modelVersion\":\"2019-10-01\"}", - "Date" : "Wed, 29 Apr 2020 17:12:20 GMT", + "Date" : "Wed, 15 Jul 2020 04:14:37 GMT", "Content-Type" : "application/json; charset=utf-8" }, "Exception" : null diff --git a/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/extractKeyPhrasesBatchWarning.json b/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/extractKeyPhrasesBatchWarning.json index 574b1e965176d..3029c8b7c7b63 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/extractKeyPhrasesBatchWarning.json +++ b/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/extractKeyPhrasesBatchWarning.json @@ -1,23 +1,23 @@ { "networkCallRecords" : [ { "Method" : "POST", - "Uri" : "https://REDACTED.ppe.cognitiveservices.azure.com/text/analytics/v3.0//keyPhrases", + "Uri" : "https://REDACTED.cognitiveservices.azure.com/text/analytics/v3.1-preview.1//keyPhrases", "Headers" : { - "User-Agent" : "azsdk-java-azure-ai-textanalytics/1.0.0-beta.5 (11.0.4; Windows 10 10.0)", - "x-ms-client-request-id" : "09f7916f-881b-4eda-b39d-9751d3a3807a", + "User-Agent" : "azsdk-java-azure-ai-textanalytics/1.1.0-beta.1 (11.0.7; Windows 10; 10.0)", + "x-ms-client-request-id" : "fbdaf84a-d713-460f-9667-4fea0bb66ce3", "Content-Type" : "application/json" }, "Response" : { "Transfer-Encoding" : "chunked", - "x-envoy-upstream-service-time" : "22", + "x-envoy-upstream-service-time" : "6", "Strict-Transport-Security" : "max-age=31536000; includeSubDomains; preload", "x-content-type-options" : "nosniff", "csp-billing-usage" : "CognitiveServices.TextAnalytics.BatchScoring=2", - "apim-request-id" : "2fe14015-84a7-463c-b291-1c0843a2b509", + "apim-request-id" : "bc125268-a1fa-4433-8aa7-b9153ecb3e71", "retry-after" : "0", "StatusCode" : "200", "Body" : "{\"documents\":[{\"id\":\"0\",\"keyPhrases\":[\"Thisisaveryveryverylongtextwhichgoesonforalongtimeandwhichalmost\"],\"warnings\":[{\"code\":\"LongWordsInDocument\",\"message\":\"The document contains very long words (longer than 64 characters). These words will be truncated and may result in unreliable model predictions.\"}]},{\"id\":\"1\",\"keyPhrases\":[\"Microsoft\"],\"warnings\":[]}],\"errors\":[],\"modelVersion\":\"2019-10-01\"}", - "Date" : "Thu, 07 May 2020 02:48:33 GMT", + "Date" : "Wed, 15 Jul 2020 04:14:41 GMT", "Content-Type" : "application/json; charset=utf-8" }, "Exception" : null diff --git a/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/extractKeyPhrasesDuplicateIdInput.json b/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/extractKeyPhrasesDuplicateIdInput.json index 5f13c5933a9d1..7b549b5c80f65 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/extractKeyPhrasesDuplicateIdInput.json +++ b/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/extractKeyPhrasesDuplicateIdInput.json @@ -1,22 +1,22 @@ { "networkCallRecords" : [ { "Method" : "POST", - "Uri" : "https://westus2.ppe.cognitiveservices.azure.com/text/analytics/v3.0//keyPhrases", + "Uri" : "https://REDACTED.cognitiveservices.azure.com/text/analytics/v3.1-preview.1//keyPhrases", "Headers" : { - "User-Agent" : "azsdk-java-azure-ai-textanalytics/1.0.0-beta.5 (11.0.4; Windows 10 10.0)", - "x-ms-client-request-id" : "bd79c9e5-7980-4380-bc33-b523d2c53e2e", + "User-Agent" : "azsdk-java-azure-ai-textanalytics/1.1.0-beta.1 (11.0.7; Windows 10; 10.0)", + "x-ms-client-request-id" : "ff81219f-02cb-4191-8667-5b88194dc89a", "Content-Type" : "application/json" }, "Response" : { "Transfer-Encoding" : "chunked", - "x-envoy-upstream-service-time" : "112", + "x-envoy-upstream-service-time" : "4", "Strict-Transport-Security" : "max-age=31536000; includeSubDomains; preload", "x-content-type-options" : "nosniff", - "apim-request-id" : "6c965e67-2741-4b70-97f2-6d4705d5f714", + "apim-request-id" : "983040d8-028c-4ae1-a176-8a0d48a87fe1", "retry-after" : "0", "StatusCode" : "400", - "Body" : "{\"error\":{\"code\":\"InvalidRequest\",\"message\":\"Invalid document in request.\",\"innerError\":{\"code\":\"InvalidDocument\",\"message\":\"Request contains duplicated Ids. Make sure each document has a unique Id.\"}}}", - "Date" : "Thu, 30 Apr 2020 04:52:37 GMT", + "Body" : "{\"error\":{\"code\":\"InvalidRequest\",\"message\":\"Invalid document in request.\",\"innererror\":{\"code\":\"InvalidDocument\",\"message\":\"Request contains duplicated Ids. Make sure each document has a unique Id.\"}}}", + "Date" : "Wed, 15 Jul 2020 04:14:29 GMT", "Content-Type" : "application/json; charset=utf-8" }, "Exception" : null diff --git a/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/extractKeyPhrasesForBatchInput.json b/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/extractKeyPhrasesForBatchInput.json index b81a36772db36..7977dcd9620fd 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/extractKeyPhrasesForBatchInput.json +++ b/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/extractKeyPhrasesForBatchInput.json @@ -1,23 +1,23 @@ { "networkCallRecords" : [ { "Method" : "POST", - "Uri" : "https://westus2.ppe.cognitiveservices.azure.com/text/analytics/v3.0//keyPhrases", + "Uri" : "https://REDACTED.cognitiveservices.azure.com/text/analytics/v3.1-preview.1//keyPhrases", "Headers" : { - "User-Agent" : "azsdk-java-azure-ai-textanalytics/1.0.0-beta.5 (11.0.4; Windows 10 10.0)", - "x-ms-client-request-id" : "50ed4022-98a0-4504-a0ca-1e4ab870ab91", + "User-Agent" : "azsdk-java-azure-ai-textanalytics/1.1.0-beta.1 (11.0.7; Windows 10; 10.0)", + "x-ms-client-request-id" : "9542d252-cb21-44cb-8e84-ff122a27bed6", "Content-Type" : "application/json" }, "Response" : { "Transfer-Encoding" : "chunked", - "x-envoy-upstream-service-time" : "5", + "x-envoy-upstream-service-time" : "8", "Strict-Transport-Security" : "max-age=31536000; includeSubDomains; preload", "x-content-type-options" : "nosniff", "csp-billing-usage" : "CognitiveServices.TextAnalytics.BatchScoring=2", - "apim-request-id" : "3390b669-3026-418c-a00e-298bc6d64d38", + "apim-request-id" : "788a61b9-34bf-4d2b-a4f1-ce40115dd8fe", "retry-after" : "0", "StatusCode" : "200", "Body" : "{\"documents\":[{\"id\":\"0\",\"keyPhrases\":[\"input text\",\"world\"],\"warnings\":[]},{\"id\":\"1\",\"keyPhrases\":[\"monde\"],\"warnings\":[]}],\"errors\":[],\"modelVersion\":\"2019-10-01\"}", - "Date" : "Wed, 29 Apr 2020 17:12:18 GMT", + "Date" : "Wed, 15 Jul 2020 04:14:26 GMT", "Content-Type" : "application/json; charset=utf-8" }, "Exception" : null diff --git a/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/extractKeyPhrasesForBatchInputShowStatistics.json b/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/extractKeyPhrasesForBatchInputShowStatistics.json index e122a4129652f..50db86952ee13 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/extractKeyPhrasesForBatchInputShowStatistics.json +++ b/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/extractKeyPhrasesForBatchInputShowStatistics.json @@ -1,23 +1,23 @@ { "networkCallRecords" : [ { "Method" : "POST", - "Uri" : "https://westus2.ppe.cognitiveservices.azure.com/text/analytics/v3.0//keyPhrases?showStats=true", + "Uri" : "https://REDACTED.cognitiveservices.azure.com/text/analytics/v3.1-preview.1//keyPhrases?showStats=true", "Headers" : { - "User-Agent" : "azsdk-java-azure-ai-textanalytics/1.0.0-beta.5 (11.0.4; Windows 10 10.0)", - "x-ms-client-request-id" : "80c81b1a-6682-46cd-a2f3-5c1ec8673a8d", + "User-Agent" : "azsdk-java-azure-ai-textanalytics/1.1.0-beta.1 (11.0.7; Windows 10; 10.0)", + "x-ms-client-request-id" : "91fe1f35-1351-4a13-84b2-3bf39d684d37", "Content-Type" : "application/json" }, "Response" : { "Transfer-Encoding" : "chunked", - "x-envoy-upstream-service-time" : "5", + "x-envoy-upstream-service-time" : "8", "Strict-Transport-Security" : "max-age=31536000; includeSubDomains; preload", "x-content-type-options" : "nosniff", "csp-billing-usage" : "CognitiveServices.TextAnalytics.BatchScoring=2", - "apim-request-id" : "d2d9b818-a6a7-47f5-9606-3ca8118b1d08", + "apim-request-id" : "cf12ce51-f5c4-4ad5-a4e2-4ae74d34e311", "retry-after" : "0", "StatusCode" : "200", "Body" : "{\"statistics\":{\"documentsCount\":2,\"validDocumentsCount\":2,\"erroneousDocumentsCount\":0,\"transactionsCount\":2},\"documents\":[{\"id\":\"0\",\"keyPhrases\":[\"input text\",\"world\"],\"statistics\":{\"charactersCount\":49,\"transactionsCount\":1},\"warnings\":[]},{\"id\":\"1\",\"keyPhrases\":[\"monde\"],\"statistics\":{\"charactersCount\":21,\"transactionsCount\":1},\"warnings\":[]}],\"errors\":[],\"modelVersion\":\"2019-10-01\"}", - "Date" : "Wed, 29 Apr 2020 17:12:18 GMT", + "Date" : "Wed, 15 Jul 2020 04:14:27 GMT", "Content-Type" : "application/json; charset=utf-8" }, "Exception" : null diff --git a/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/extractKeyPhrasesForBatchStringInput.json b/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/extractKeyPhrasesForBatchStringInput.json index 1787566b8905f..bed1d2528eaad 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/extractKeyPhrasesForBatchStringInput.json +++ b/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/extractKeyPhrasesForBatchStringInput.json @@ -1,23 +1,23 @@ { "networkCallRecords" : [ { "Method" : "POST", - "Uri" : "https://westus2.ppe.cognitiveservices.azure.com/text/analytics/v3.0//keyPhrases", + "Uri" : "https://REDACTED.cognitiveservices.azure.com/text/analytics/v3.1-preview.1//keyPhrases", "Headers" : { - "User-Agent" : "azsdk-java-azure-ai-textanalytics/1.0.0-beta.5 (11.0.4; Windows 10 10.0)", - "x-ms-client-request-id" : "d915e11c-f5c4-4147-a491-8b12787a203f", + "User-Agent" : "azsdk-java-azure-ai-textanalytics/1.1.0-beta.1 (11.0.7; Windows 10; 10.0)", + "x-ms-client-request-id" : "10e53ad6-80a5-4639-9060-87dca1400b00", "Content-Type" : "application/json" }, "Response" : { "Transfer-Encoding" : "chunked", - "x-envoy-upstream-service-time" : "6", + "x-envoy-upstream-service-time" : "8", "Strict-Transport-Security" : "max-age=31536000; includeSubDomains; preload", "x-content-type-options" : "nosniff", "csp-billing-usage" : "CognitiveServices.TextAnalytics.BatchScoring=2", - "apim-request-id" : "e73ae469-8ca5-4a26-bbb4-e548ff416167", + "apim-request-id" : "b7e6b269-0a95-4632-9ed5-26b9486d4f63", "retry-after" : "0", "StatusCode" : "200", "Body" : "{\"documents\":[{\"id\":\"0\",\"keyPhrases\":[\"input text\",\"world\"],\"warnings\":[]},{\"id\":\"1\",\"keyPhrases\":[\"monde\"],\"warnings\":[]}],\"errors\":[],\"modelVersion\":\"2019-10-01\"}", - "Date" : "Wed, 29 Apr 2020 17:12:20 GMT", + "Date" : "Wed, 15 Jul 2020 04:14:40 GMT", "Content-Type" : "application/json; charset=utf-8" }, "Exception" : null diff --git a/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/extractKeyPhrasesForEmptyText.json b/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/extractKeyPhrasesForEmptyText.json index e7055afa0c2c0..0897ed4543123 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/extractKeyPhrasesForEmptyText.json +++ b/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/extractKeyPhrasesForEmptyText.json @@ -1,23 +1,23 @@ { "networkCallRecords" : [ { "Method" : "POST", - "Uri" : "https://westus2.ppe.cognitiveservices.azure.com/text/analytics/v3.0//keyPhrases", + "Uri" : "https://REDACTED.cognitiveservices.azure.com/text/analytics/v3.1-preview.1//keyPhrases", "Headers" : { - "User-Agent" : "azsdk-java-azure-ai-textanalytics/1.0.0-beta.5 (11.0.4; Windows 10 10.0)", - "x-ms-client-request-id" : "fcf765fa-9e9f-4c1f-b15b-b7a917cda77c", + "User-Agent" : "azsdk-java-azure-ai-textanalytics/1.1.0-beta.1 (11.0.7; Windows 10; 10.0)", + "x-ms-client-request-id" : "9a086500-1dc1-49b5-a9b3-4bbf69393cc0", "Content-Type" : "application/json" }, "Response" : { "Transfer-Encoding" : "chunked", - "x-envoy-upstream-service-time" : "1", + "x-envoy-upstream-service-time" : "236", "Strict-Transport-Security" : "max-age=31536000; includeSubDomains; preload", "x-content-type-options" : "nosniff", "csp-billing-usage" : "CognitiveServices.TextAnalytics.BatchScoring=0", - "apim-request-id" : "2917c294-c86c-44b3-8eaf-1a087a5332d5", + "apim-request-id" : "8880d2cb-9e96-4c23-b9ef-2fc7c3319058", "retry-after" : "0", "StatusCode" : "200", "Body" : "{\"documents\":[],\"errors\":[{\"id\":\"0\",\"error\":{\"code\":\"InvalidArgument\",\"message\":\"Invalid document in request.\",\"innererror\":{\"code\":\"InvalidDocument\",\"message\":\"Document text is empty.\"}}}],\"modelVersion\":\"2019-10-01\"}", - "Date" : "Wed, 29 Apr 2020 17:12:18 GMT", + "Date" : "Wed, 15 Jul 2020 06:19:40 GMT", "Content-Type" : "application/json; charset=utf-8" }, "Exception" : null diff --git a/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/extractKeyPhrasesForFaultyText.json b/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/extractKeyPhrasesForFaultyText.json index 112abcec8fef8..a7b17f2f16e19 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/extractKeyPhrasesForFaultyText.json +++ b/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/extractKeyPhrasesForFaultyText.json @@ -1,10 +1,10 @@ { "networkCallRecords" : [ { "Method" : "POST", - "Uri" : "https://westus2.ppe.cognitiveservices.azure.com/text/analytics/v3.0//keyPhrases", + "Uri" : "https://REDACTED.cognitiveservices.azure.com/text/analytics/v3.1-preview.1//keyPhrases", "Headers" : { - "User-Agent" : "azsdk-java-azure-ai-textanalytics/1.0.0-beta.5 (11.0.4; Windows 10 10.0)", - "x-ms-client-request-id" : "054f1961-34b0-4f46-ba07-129ef22f203a", + "User-Agent" : "azsdk-java-azure-ai-textanalytics/1.1.0-beta.1 (11.0.7; Windows 10; 10.0)", + "x-ms-client-request-id" : "99b15e2f-fbea-49f2-bd8b-735dba11c076", "Content-Type" : "application/json" }, "Response" : { @@ -13,11 +13,11 @@ "Strict-Transport-Security" : "max-age=31536000; includeSubDomains; preload", "x-content-type-options" : "nosniff", "csp-billing-usage" : "CognitiveServices.TextAnalytics.BatchScoring=1", - "apim-request-id" : "e8821ad2-0c24-40f6-abe4-21a9a0049264", + "apim-request-id" : "ad26b9f3-a44b-4f49-bf0d-440e6bdd1171", "retry-after" : "0", "StatusCode" : "200", "Body" : "{\"documents\":[{\"id\":\"0\",\"keyPhrases\":[],\"warnings\":[]}],\"errors\":[],\"modelVersion\":\"2019-10-01\"}", - "Date" : "Wed, 29 Apr 2020 17:12:18 GMT", + "Date" : "Wed, 15 Jul 2020 04:14:27 GMT", "Content-Type" : "application/json; charset=utf-8" }, "Exception" : null diff --git a/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/extractKeyPhrasesForListLanguageHint.json b/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/extractKeyPhrasesForListLanguageHint.json index d67f8a762f93e..50e741adc9c5e 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/extractKeyPhrasesForListLanguageHint.json +++ b/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/extractKeyPhrasesForListLanguageHint.json @@ -1,23 +1,23 @@ { "networkCallRecords" : [ { "Method" : "POST", - "Uri" : "https://westus2.ppe.cognitiveservices.azure.com/text/analytics/v3.0//keyPhrases", + "Uri" : "https://REDACTED.cognitiveservices.azure.com/text/analytics/v3.1-preview.1//keyPhrases", "Headers" : { - "User-Agent" : "azsdk-java-azure-ai-textanalytics/1.0.0-beta.5 (11.0.4; Windows 10 10.0)", - "x-ms-client-request-id" : "af10e3af-edbd-4433-b60b-f8743c2cb972", + "User-Agent" : "azsdk-java-azure-ai-textanalytics/1.1.0-beta.1 (11.0.7; Windows 10; 10.0)", + "x-ms-client-request-id" : "0250bb3d-c903-4c6d-9b5a-af1408b8a2ea", "Content-Type" : "application/json" }, "Response" : { "Transfer-Encoding" : "chunked", - "x-envoy-upstream-service-time" : "5", + "x-envoy-upstream-service-time" : "6", "Strict-Transport-Security" : "max-age=31536000; includeSubDomains; preload", "x-content-type-options" : "nosniff", "csp-billing-usage" : "CognitiveServices.TextAnalytics.BatchScoring=2", - "apim-request-id" : "0f1c2ba1-0f81-4d8d-ac1b-f8f67f0db9e8", + "apim-request-id" : "f9a8ee49-b556-44d3-912f-dbfb58d20dba", "retry-after" : "0", "StatusCode" : "200", "Body" : "{\"documents\":[{\"id\":\"0\",\"keyPhrases\":[\"input text\",\"world\"],\"warnings\":[]},{\"id\":\"1\",\"keyPhrases\":[\"monde\"],\"warnings\":[]}],\"errors\":[],\"modelVersion\":\"2019-10-01\"}", - "Date" : "Wed, 29 Apr 2020 17:12:20 GMT", + "Date" : "Wed, 15 Jul 2020 04:14:40 GMT", "Content-Type" : "application/json; charset=utf-8" }, "Exception" : null diff --git a/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/extractKeyPhrasesForListStringWithOptions.json b/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/extractKeyPhrasesForListStringWithOptions.json index 9c0bd50d92733..2f038f1c56e9d 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/extractKeyPhrasesForListStringWithOptions.json +++ b/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/extractKeyPhrasesForListStringWithOptions.json @@ -1,23 +1,23 @@ { "networkCallRecords" : [ { "Method" : "POST", - "Uri" : "https://westus2.ppe.cognitiveservices.azure.com/text/analytics/v3.0//keyPhrases?showStats=true", + "Uri" : "https://REDACTED.cognitiveservices.azure.com/text/analytics/v3.1-preview.1//keyPhrases?showStats=true", "Headers" : { - "User-Agent" : "azsdk-java-azure-ai-textanalytics/1.0.0-beta.5 (11.0.4; Windows 10 10.0)", - "x-ms-client-request-id" : "c6ed0a9f-a4ee-4e3d-8a74-e0c603014b4e", + "User-Agent" : "azsdk-java-azure-ai-textanalytics/1.1.0-beta.1 (11.0.7; Windows 10; 10.0)", + "x-ms-client-request-id" : "21234958-3db8-45ff-bb8a-a9f851e47de0", "Content-Type" : "application/json" }, "Response" : { "Transfer-Encoding" : "chunked", - "x-envoy-upstream-service-time" : "5", + "x-envoy-upstream-service-time" : "9", "Strict-Transport-Security" : "max-age=31536000; includeSubDomains; preload", "x-content-type-options" : "nosniff", "csp-billing-usage" : "CognitiveServices.TextAnalytics.BatchScoring=2", - "apim-request-id" : "e1a68dde-4ac7-4e1d-8da5-7527fa757817", + "apim-request-id" : "c233a162-654a-4ea1-886f-acdd93eb8a7e", "retry-after" : "0", "StatusCode" : "200", "Body" : "{\"statistics\":{\"documentsCount\":2,\"validDocumentsCount\":2,\"erroneousDocumentsCount\":0,\"transactionsCount\":2},\"documents\":[{\"id\":\"0\",\"keyPhrases\":[\"input text\",\"world\"],\"statistics\":{\"charactersCount\":49,\"transactionsCount\":1},\"warnings\":[]},{\"id\":\"1\",\"keyPhrases\":[\"monde\"],\"statistics\":{\"charactersCount\":21,\"transactionsCount\":1},\"warnings\":[]}],\"errors\":[],\"modelVersion\":\"2019-10-01\"}", - "Date" : "Wed, 29 Apr 2020 17:12:19 GMT", + "Date" : "Wed, 15 Jul 2020 04:14:34 GMT", "Content-Type" : "application/json; charset=utf-8" }, "Exception" : null diff --git a/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/extractKeyPhrasesForTextInput.json b/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/extractKeyPhrasesForTextInput.json index bd2b2eb3e6758..c05a76dcf9674 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/extractKeyPhrasesForTextInput.json +++ b/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/extractKeyPhrasesForTextInput.json @@ -1,23 +1,23 @@ { "networkCallRecords" : [ { "Method" : "POST", - "Uri" : "https://westus2.ppe.cognitiveservices.azure.com/text/analytics/v3.0//keyPhrases", + "Uri" : "https://REDACTED.cognitiveservices.azure.com/text/analytics/v3.1-preview.1//keyPhrases", "Headers" : { - "User-Agent" : "azsdk-java-azure-ai-textanalytics/1.0.0-beta.5 (11.0.4; Windows 10 10.0)", - "x-ms-client-request-id" : "b57d36cb-3bc5-40f2-aba9-cb9aba3e3d95", + "User-Agent" : "azsdk-java-azure-ai-textanalytics/1.1.0-beta.1 (11.0.7; Windows 10; 10.0)", + "x-ms-client-request-id" : "8908ad2a-3f5c-4b6b-a792-94cdde185ecc", "Content-Type" : "application/json" }, "Response" : { "Transfer-Encoding" : "chunked", - "x-envoy-upstream-service-time" : "4", + "x-envoy-upstream-service-time" : "5", "Strict-Transport-Security" : "max-age=31536000; includeSubDomains; preload", "x-content-type-options" : "nosniff", "csp-billing-usage" : "CognitiveServices.TextAnalytics.BatchScoring=1", - "apim-request-id" : "42f434be-b16a-4b5f-9920-75e5d92d0eed", + "apim-request-id" : "1470a283-af3f-4e96-b849-a08195509963", "retry-after" : "0", "StatusCode" : "200", "Body" : "{\"documents\":[{\"id\":\"0\",\"keyPhrases\":[\"monde\"],\"warnings\":[]}],\"errors\":[],\"modelVersion\":\"2019-10-01\"}", - "Date" : "Wed, 29 Apr 2020 17:12:18 GMT", + "Date" : "Wed, 15 Jul 2020 04:14:29 GMT", "Content-Type" : "application/json; charset=utf-8" }, "Exception" : null diff --git a/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/extractKeyPhrasesWarning.json b/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/extractKeyPhrasesWarning.json index 373d8ae1a0307..41e37e911b388 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/extractKeyPhrasesWarning.json +++ b/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/extractKeyPhrasesWarning.json @@ -1,23 +1,23 @@ { "networkCallRecords" : [ { "Method" : "POST", - "Uri" : "https://REDACTED.ppe.cognitiveservices.azure.com/text/analytics/v3.0//keyPhrases", + "Uri" : "https://REDACTED.cognitiveservices.azure.com/text/analytics/v3.1-preview.1//keyPhrases", "Headers" : { - "User-Agent" : "azsdk-java-azure-ai-textanalytics/1.0.0-beta.5 (11.0.4; Windows 10 10.0)", - "x-ms-client-request-id" : "6070fa8f-51ce-4ee1-8262-bb1413d91844", + "User-Agent" : "azsdk-java-azure-ai-textanalytics/1.1.0-beta.1 (11.0.7; Windows 10; 10.0)", + "x-ms-client-request-id" : "48f8afcf-669d-4109-8fe1-1d9ae9c7cc19", "Content-Type" : "application/json" }, "Response" : { "Transfer-Encoding" : "chunked", - "x-envoy-upstream-service-time" : "4", + "x-envoy-upstream-service-time" : "5", "Strict-Transport-Security" : "max-age=31536000; includeSubDomains; preload", "x-content-type-options" : "nosniff", "csp-billing-usage" : "CognitiveServices.TextAnalytics.BatchScoring=1", - "apim-request-id" : "8d61f6e0-6f52-4d7a-a157-c8380bf2b60d", + "apim-request-id" : "54252be8-2160-4162-9a3a-fb2da1c63482", "retry-after" : "0", "StatusCode" : "200", "Body" : "{\"documents\":[{\"id\":\"0\",\"keyPhrases\":[\"Thisisaveryveryverylongtextwhichgoesonforalongtimeandwhichalmost\"],\"warnings\":[{\"code\":\"LongWordsInDocument\",\"message\":\"The document contains very long words (longer than 64 characters). These words will be truncated and may result in unreliable model predictions.\"}]}],\"errors\":[],\"modelVersion\":\"2019-10-01\"}", - "Date" : "Thu, 07 May 2020 02:48:54 GMT", + "Date" : "Wed, 15 Jul 2020 04:14:35 GMT", "Content-Type" : "application/json; charset=utf-8" }, "Exception" : null diff --git a/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/recognizeEntitiesBatchInputSingleError.json b/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/recognizeEntitiesBatchInputSingleError.json index 8dea8ba2991d7..8d2b18d1fa0a6 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/recognizeEntitiesBatchInputSingleError.json +++ b/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/recognizeEntitiesBatchInputSingleError.json @@ -1,22 +1,22 @@ { "networkCallRecords" : [ { "Method" : "POST", - "Uri" : "https://westus2.ppe.cognitiveservices.azure.com/text/analytics/v3.0//entities/recognition/general", + "Uri" : "https://REDACTED.cognitiveservices.azure.com/text/analytics/v3.1-preview.1//entities/recognition/general", "Headers" : { - "User-Agent" : "azsdk-java-azure-ai-textanalytics/1.0.0-beta.5 (11.0.4; Windows 10 10.0)", - "x-ms-client-request-id" : "c155ee1b-e8ec-4897-a653-351837349cca", + "User-Agent" : "azsdk-java-azure-ai-textanalytics/1.1.0-beta.1 (11.0.7; Windows 10; 10.0)", + "x-ms-client-request-id" : "804f9674-7cdc-48f8-9f2d-b310a4b23844", "Content-Type" : "application/json" }, "Response" : { "Transfer-Encoding" : "chunked", - "x-envoy-upstream-service-time" : "2", + "x-envoy-upstream-service-time" : "4", "Strict-Transport-Security" : "max-age=31536000; includeSubDomains; preload", "x-content-type-options" : "nosniff", - "apim-request-id" : "fde49364-8059-4cb5-b65f-19e1180db44f", + "apim-request-id" : "0353845f-15de-4bd8-9e4b-0c6aba1140a4", "retry-after" : "0", "StatusCode" : "200", "Body" : "{\"documents\":[],\"errors\":[{\"id\":\"2\",\"error\":{\"code\":\"InvalidArgument\",\"message\":\"Invalid document in request.\",\"innererror\":{\"code\":\"InvalidDocument\",\"message\":\"Document text is empty.\"}}}],\"modelVersion\":\"2020-04-01\"}", - "Date" : "Wed, 29 Apr 2020 17:12:18 GMT", + "Date" : "Wed, 15 Jul 2020 07:14:10 GMT", "Content-Type" : "application/json; charset=utf-8" }, "Exception" : null diff --git a/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/recognizeEntitiesDuplicateIdInput.json b/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/recognizeEntitiesDuplicateIdInput.json index 5d75bf441cc7f..b5db55a394d6b 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/recognizeEntitiesDuplicateIdInput.json +++ b/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/recognizeEntitiesDuplicateIdInput.json @@ -1,22 +1,22 @@ { "networkCallRecords" : [ { "Method" : "POST", - "Uri" : "https://westus2.ppe.cognitiveservices.azure.com/text/analytics/v3.0//entities/recognition/general", + "Uri" : "https://REDACTED.cognitiveservices.azure.com/text/analytics/v3.1-preview.1//entities/recognition/general", "Headers" : { - "User-Agent" : "azsdk-java-azure-ai-textanalytics/1.0.0-beta.5 (11.0.4; Windows 10 10.0)", - "x-ms-client-request-id" : "0697cc18-e2ad-40d2-9403-238072c99231", + "User-Agent" : "azsdk-java-azure-ai-textanalytics/1.1.0-beta.1 (11.0.7; Windows 10; 10.0)", + "x-ms-client-request-id" : "7de08f9c-a424-43b9-a1ba-bff22e7b6d78", "Content-Type" : "application/json" }, "Response" : { "Transfer-Encoding" : "chunked", - "x-envoy-upstream-service-time" : "5", + "x-envoy-upstream-service-time" : "4", "Strict-Transport-Security" : "max-age=31536000; includeSubDomains; preload", "x-content-type-options" : "nosniff", - "apim-request-id" : "625712f8-5ad4-4c0f-b446-12ce318345db", + "apim-request-id" : "7b927df4-bc42-48f1-8909-e2daf670d0f6", "retry-after" : "0", "StatusCode" : "400", - "Body" : "{\"error\":{\"code\":\"InvalidRequest\",\"message\":\"Invalid document in request.\",\"innerError\":{\"code\":\"InvalidDocument\",\"message\":\"Request contains duplicated Ids. Make sure each document has a unique Id.\"}}}", - "Date" : "Thu, 30 Apr 2020 04:52:39 GMT", + "Body" : "{\"error\":{\"code\":\"InvalidRequest\",\"message\":\"Invalid document in request.\",\"innererror\":{\"code\":\"InvalidDocument\",\"message\":\"Request contains duplicated Ids. Make sure each document has a unique Id.\"}}}", + "Date" : "Wed, 15 Jul 2020 04:14:42 GMT", "Content-Type" : "application/json; charset=utf-8" }, "Exception" : null diff --git a/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/recognizeEntitiesForBatchInput.json b/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/recognizeEntitiesForBatchInput.json index 2df061228dbc7..da5942f5cc83b 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/recognizeEntitiesForBatchInput.json +++ b/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/recognizeEntitiesForBatchInput.json @@ -1,23 +1,23 @@ { "networkCallRecords" : [ { "Method" : "POST", - "Uri" : "https://westus2.ppe.cognitiveservices.azure.com/text/analytics/v3.0//entities/recognition/general", + "Uri" : "https://REDACTED.cognitiveservices.azure.com/text/analytics/v3.1-preview.1//entities/recognition/general", "Headers" : { - "User-Agent" : "azsdk-java-azure-ai-textanalytics/1.0.0-beta.5 (11.0.4; Windows 10 10.0)", - "x-ms-client-request-id" : "44c61065-7f1f-4b50-a029-f49551867ddd", + "User-Agent" : "azsdk-java-azure-ai-textanalytics/1.1.0-beta.1 (11.0.7; Windows 10; 10.0)", + "x-ms-client-request-id" : "2a46f3f9-1b6b-4873-802d-f7abf49645b0", "Content-Type" : "application/json" }, "Response" : { "Transfer-Encoding" : "chunked", - "x-envoy-upstream-service-time" : "91", + "x-envoy-upstream-service-time" : "106", "Strict-Transport-Security" : "max-age=31536000; includeSubDomains; preload", "x-content-type-options" : "nosniff", "csp-billing-usage" : "CognitiveServices.TextAnalytics.BatchScoring=2", - "apim-request-id" : "a91c7873-b4ef-44bd-9253-e662937f1f59", + "apim-request-id" : "6d0230d1-cf8f-48cd-830b-5139129e60e0", "retry-after" : "0", "StatusCode" : "200", - "Body" : "{\"documents\":[{\"id\":\"0\",\"entities\":[{\"text\":\"trip\",\"category\":\"Event\",\"offset\":18,\"length\":4,\"confidenceScore\":0.62},{\"text\":\"Seattle\",\"category\":\"Location\",\"subcategory\":\"GPE\",\"offset\":26,\"length\":7,\"confidenceScore\":0.6},{\"text\":\"last week\",\"category\":\"DateTime\",\"subcategory\":\"DateRange\",\"offset\":34,\"length\":9,\"confidenceScore\":0.8}],\"warnings\":[]},{\"id\":\"1\",\"entities\":[{\"text\":\"Microsoft\",\"category\":\"Organization\",\"offset\":10,\"length\":9,\"confidenceScore\":0.37}],\"warnings\":[]}],\"errors\":[],\"modelVersion\":\"2020-04-01\"}", - "Date" : "Wed, 29 Apr 2020 17:12:18 GMT", + "Body" : "{\"documents\":[{\"id\":\"0\",\"entities\":[{\"text\":\"trip\",\"category\":\"Event\",\"offset\":18,\"length\":4,\"confidenceScore\":0.61},{\"text\":\"Seattle\",\"category\":\"Location\",\"subcategory\":\"GPE\",\"offset\":26,\"length\":7,\"confidenceScore\":0.82},{\"text\":\"last week\",\"category\":\"DateTime\",\"subcategory\":\"DateRange\",\"offset\":34,\"length\":9,\"confidenceScore\":0.8}],\"warnings\":[]},{\"id\":\"1\",\"entities\":[{\"text\":\"Microsoft\",\"category\":\"Organization\",\"offset\":10,\"length\":9,\"confidenceScore\":0.77}],\"warnings\":[]}],\"errors\":[],\"modelVersion\":\"2020-04-01\"}", + "Date" : "Wed, 15 Jul 2020 04:14:30 GMT", "Content-Type" : "application/json; charset=utf-8" }, "Exception" : null diff --git a/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/recognizeEntitiesForBatchInputShowStatistics.json b/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/recognizeEntitiesForBatchInputShowStatistics.json index b6bd99a9fee78..7eaf842470a4d 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/recognizeEntitiesForBatchInputShowStatistics.json +++ b/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/recognizeEntitiesForBatchInputShowStatistics.json @@ -1,23 +1,23 @@ { "networkCallRecords" : [ { "Method" : "POST", - "Uri" : "https://westus2.ppe.cognitiveservices.azure.com/text/analytics/v3.0//entities/recognition/general?showStats=true", + "Uri" : "https://REDACTED.cognitiveservices.azure.com/text/analytics/v3.1-preview.1//entities/recognition/general?showStats=true", "Headers" : { - "User-Agent" : "azsdk-java-azure-ai-textanalytics/1.0.0-beta.5 (11.0.4; Windows 10 10.0)", - "x-ms-client-request-id" : "33da35c7-b013-4cf9-86aa-c67157d11287", + "User-Agent" : "azsdk-java-azure-ai-textanalytics/1.1.0-beta.1 (11.0.7; Windows 10; 10.0)", + "x-ms-client-request-id" : "b16eb4cc-ece9-4990-917c-3b18d7e525c3", "Content-Type" : "application/json" }, "Response" : { "Transfer-Encoding" : "chunked", - "x-envoy-upstream-service-time" : "95", + "x-envoy-upstream-service-time" : "84", "Strict-Transport-Security" : "max-age=31536000; includeSubDomains; preload", "x-content-type-options" : "nosniff", "csp-billing-usage" : "CognitiveServices.TextAnalytics.BatchScoring=2", - "apim-request-id" : "e8e8adf7-30c7-4bc6-a080-254f68a32b67", + "apim-request-id" : "0de8933d-0dc6-4823-9a83-28287320521c", "retry-after" : "0", "StatusCode" : "200", - "Body" : "{\"statistics\":{\"documentsCount\":2,\"validDocumentsCount\":2,\"erroneousDocumentsCount\":0,\"transactionsCount\":2},\"documents\":[{\"id\":\"0\",\"statistics\":{\"charactersCount\":44,\"transactionsCount\":1},\"entities\":[{\"text\":\"trip\",\"category\":\"Event\",\"offset\":18,\"length\":4,\"confidenceScore\":0.62},{\"text\":\"Seattle\",\"category\":\"Location\",\"subcategory\":\"GPE\",\"offset\":26,\"length\":7,\"confidenceScore\":0.6},{\"text\":\"last week\",\"category\":\"DateTime\",\"subcategory\":\"DateRange\",\"offset\":34,\"length\":9,\"confidenceScore\":0.8}],\"warnings\":[]},{\"id\":\"1\",\"statistics\":{\"charactersCount\":20,\"transactionsCount\":1},\"entities\":[{\"text\":\"Microsoft\",\"category\":\"Organization\",\"offset\":10,\"length\":9,\"confidenceScore\":0.37}],\"warnings\":[]}],\"errors\":[],\"modelVersion\":\"2020-04-01\"}", - "Date" : "Wed, 29 Apr 2020 17:12:20 GMT", + "Body" : "{\"statistics\":{\"documentsCount\":2,\"validDocumentsCount\":2,\"erroneousDocumentsCount\":0,\"transactionsCount\":2},\"documents\":[{\"id\":\"0\",\"statistics\":{\"charactersCount\":44,\"transactionsCount\":1},\"entities\":[{\"text\":\"trip\",\"category\":\"Event\",\"offset\":18,\"length\":4,\"confidenceScore\":0.61},{\"text\":\"Seattle\",\"category\":\"Location\",\"subcategory\":\"GPE\",\"offset\":26,\"length\":7,\"confidenceScore\":0.82},{\"text\":\"last week\",\"category\":\"DateTime\",\"subcategory\":\"DateRange\",\"offset\":34,\"length\":9,\"confidenceScore\":0.8}],\"warnings\":[]},{\"id\":\"1\",\"statistics\":{\"charactersCount\":20,\"transactionsCount\":1},\"entities\":[{\"text\":\"Microsoft\",\"category\":\"Organization\",\"offset\":10,\"length\":9,\"confidenceScore\":0.77}],\"warnings\":[]}],\"errors\":[],\"modelVersion\":\"2020-04-01\"}", + "Date" : "Wed, 15 Jul 2020 04:14:41 GMT", "Content-Type" : "application/json; charset=utf-8" }, "Exception" : null diff --git a/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/recognizeEntitiesForBatchStringInput.json b/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/recognizeEntitiesForBatchStringInput.json index 4f49e89a8bac7..9744c089a40f2 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/recognizeEntitiesForBatchStringInput.json +++ b/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/recognizeEntitiesForBatchStringInput.json @@ -1,23 +1,23 @@ { "networkCallRecords" : [ { "Method" : "POST", - "Uri" : "https://westus2.ppe.cognitiveservices.azure.com/text/analytics/v3.0//entities/recognition/general", + "Uri" : "https://REDACTED.cognitiveservices.azure.com/text/analytics/v3.1-preview.1//entities/recognition/general", "Headers" : { - "User-Agent" : "azsdk-java-azure-ai-textanalytics/1.0.0-beta.5 (11.0.4; Windows 10 10.0)", - "x-ms-client-request-id" : "e1176b08-6a1f-4306-8c72-06140a9d526f", + "User-Agent" : "azsdk-java-azure-ai-textanalytics/1.1.0-beta.1 (11.0.7; Windows 10; 10.0)", + "x-ms-client-request-id" : "d2bf186b-fc0b-48c9-a968-7a5a0a619a1d", "Content-Type" : "application/json" }, "Response" : { "Transfer-Encoding" : "chunked", - "x-envoy-upstream-service-time" : "97", + "x-envoy-upstream-service-time" : "95", "Strict-Transport-Security" : "max-age=31536000; includeSubDomains; preload", "x-content-type-options" : "nosniff", "csp-billing-usage" : "CognitiveServices.TextAnalytics.BatchScoring=2", - "apim-request-id" : "0214cc9d-0063-4c09-aa8f-0940393b9a58", + "apim-request-id" : "a89501b9-279c-46b6-8f27-cc6f291a414e", "retry-after" : "0", "StatusCode" : "200", - "Body" : "{\"documents\":[{\"id\":\"0\",\"entities\":[{\"text\":\"trip\",\"category\":\"Event\",\"offset\":18,\"length\":4,\"confidenceScore\":0.62},{\"text\":\"Seattle\",\"category\":\"Location\",\"subcategory\":\"GPE\",\"offset\":26,\"length\":7,\"confidenceScore\":0.6},{\"text\":\"last week\",\"category\":\"DateTime\",\"subcategory\":\"DateRange\",\"offset\":34,\"length\":9,\"confidenceScore\":0.8}],\"warnings\":[]},{\"id\":\"1\",\"entities\":[{\"text\":\"Microsoft\",\"category\":\"Organization\",\"offset\":10,\"length\":9,\"confidenceScore\":0.37}],\"warnings\":[]}],\"errors\":[],\"modelVersion\":\"2020-04-01\"}", - "Date" : "Wed, 29 Apr 2020 17:12:19 GMT", + "Body" : "{\"documents\":[{\"id\":\"0\",\"entities\":[{\"text\":\"trip\",\"category\":\"Event\",\"offset\":18,\"length\":4,\"confidenceScore\":0.61},{\"text\":\"Seattle\",\"category\":\"Location\",\"subcategory\":\"GPE\",\"offset\":26,\"length\":7,\"confidenceScore\":0.82},{\"text\":\"last week\",\"category\":\"DateTime\",\"subcategory\":\"DateRange\",\"offset\":34,\"length\":9,\"confidenceScore\":0.8}],\"warnings\":[]},{\"id\":\"1\",\"entities\":[{\"text\":\"Microsoft\",\"category\":\"Organization\",\"offset\":10,\"length\":9,\"confidenceScore\":0.77}],\"warnings\":[]}],\"errors\":[],\"modelVersion\":\"2020-04-01\"}", + "Date" : "Wed, 15 Jul 2020 04:14:32 GMT", "Content-Type" : "application/json; charset=utf-8" }, "Exception" : null diff --git a/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/recognizeEntitiesForEmptyText.json b/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/recognizeEntitiesForEmptyText.json index d62ca7b600f96..ed1fafbe01445 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/recognizeEntitiesForEmptyText.json +++ b/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/recognizeEntitiesForEmptyText.json @@ -1,22 +1,22 @@ { "networkCallRecords" : [ { "Method" : "POST", - "Uri" : "https://westus2.ppe.cognitiveservices.azure.com/text/analytics/v3.0//entities/recognition/general", + "Uri" : "https://REDACTED.cognitiveservices.azure.com/text/analytics/v3.1-preview.1//entities/recognition/general", "Headers" : { - "User-Agent" : "azsdk-java-azure-ai-textanalytics/1.0.0-beta.5 (11.0.4; Windows 10 10.0)", - "x-ms-client-request-id" : "235ca2bb-7dd2-452b-9acd-a6196322953f", + "User-Agent" : "azsdk-java-azure-ai-textanalytics/1.1.0-beta.1 (11.0.7; Windows 10; 10.0)", + "x-ms-client-request-id" : "22827ee1-0788-4246-8c34-1319cbbb71c9", "Content-Type" : "application/json" }, "Response" : { "Transfer-Encoding" : "chunked", - "x-envoy-upstream-service-time" : "2", + "x-envoy-upstream-service-time" : "3", "Strict-Transport-Security" : "max-age=31536000; includeSubDomains; preload", "x-content-type-options" : "nosniff", - "apim-request-id" : "9891bfdc-977a-4561-9fa3-e2517e7d3c0e", + "apim-request-id" : "88179958-0667-41d0-8784-312f94f98e28", "retry-after" : "0", "StatusCode" : "200", "Body" : "{\"documents\":[],\"errors\":[{\"id\":\"0\",\"error\":{\"code\":\"InvalidArgument\",\"message\":\"Invalid document in request.\",\"innererror\":{\"code\":\"InvalidDocument\",\"message\":\"Document text is empty.\"}}}],\"modelVersion\":\"2020-04-01\"}", - "Date" : "Wed, 29 Apr 2020 17:12:20 GMT", + "Date" : "Wed, 15 Jul 2020 06:13:34 GMT", "Content-Type" : "application/json; charset=utf-8" }, "Exception" : null diff --git a/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/recognizeEntitiesForFaultyText.json b/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/recognizeEntitiesForFaultyText.json index 86ff28aca6126..e60c4e7f7d049 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/recognizeEntitiesForFaultyText.json +++ b/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/recognizeEntitiesForFaultyText.json @@ -1,23 +1,23 @@ { "networkCallRecords" : [ { "Method" : "POST", - "Uri" : "https://westus2.ppe.cognitiveservices.azure.com/text/analytics/v3.0//entities/recognition/general", + "Uri" : "https://REDACTED.cognitiveservices.azure.com/text/analytics/v3.1-preview.1//entities/recognition/general", "Headers" : { - "User-Agent" : "azsdk-java-azure-ai-textanalytics/1.0.0-beta.5 (11.0.4; Windows 10 10.0)", - "x-ms-client-request-id" : "b23078f9-d856-402d-9138-9ce2e07e0c4a", + "User-Agent" : "azsdk-java-azure-ai-textanalytics/1.1.0-beta.1 (11.0.7; Windows 10; 10.0)", + "x-ms-client-request-id" : "c8d91dc2-3351-49f2-855b-fa80c170ad5e", "Content-Type" : "application/json" }, "Response" : { "Transfer-Encoding" : "chunked", - "x-envoy-upstream-service-time" : "56", + "x-envoy-upstream-service-time" : "62", "Strict-Transport-Security" : "max-age=31536000; includeSubDomains; preload", "x-content-type-options" : "nosniff", "csp-billing-usage" : "CognitiveServices.TextAnalytics.BatchScoring=1", - "apim-request-id" : "e8cccb7c-1b1a-48c5-be73-8eb7435af38c", + "apim-request-id" : "e096da31-8ccc-462b-a528-b5ff0f6a758d", "retry-after" : "0", "StatusCode" : "200", "Body" : "{\"documents\":[{\"id\":\"0\",\"entities\":[],\"warnings\":[]}],\"errors\":[],\"modelVersion\":\"2020-04-01\"}", - "Date" : "Wed, 29 Apr 2020 17:12:19 GMT", + "Date" : "Wed, 15 Jul 2020 04:14:35 GMT", "Content-Type" : "application/json; charset=utf-8" }, "Exception" : null diff --git a/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/recognizeEntitiesForListLanguageHint.json b/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/recognizeEntitiesForListLanguageHint.json index 51630aa29257e..248cb6a1fa354 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/recognizeEntitiesForListLanguageHint.json +++ b/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/recognizeEntitiesForListLanguageHint.json @@ -1,23 +1,23 @@ { "networkCallRecords" : [ { "Method" : "POST", - "Uri" : "https://westus2.ppe.cognitiveservices.azure.com/text/analytics/v3.0//entities/recognition/general", + "Uri" : "https://REDACTED.cognitiveservices.azure.com/text/analytics/v3.1-preview.1//entities/recognition/general", "Headers" : { - "User-Agent" : "azsdk-java-azure-ai-textanalytics/1.0.0-beta.5 (11.0.4; Windows 10 10.0)", - "x-ms-client-request-id" : "039a577f-2ee6-4e6e-a5ca-334386f11459", + "User-Agent" : "azsdk-java-azure-ai-textanalytics/1.1.0-beta.1 (11.0.7; Windows 10; 10.0)", + "x-ms-client-request-id" : "543c03c2-fb0d-4cfc-938b-0dad2acd850d", "Content-Type" : "application/json" }, "Response" : { "Transfer-Encoding" : "chunked", - "x-envoy-upstream-service-time" : "102", + "x-envoy-upstream-service-time" : "107", "Strict-Transport-Security" : "max-age=31536000; includeSubDomains; preload", "x-content-type-options" : "nosniff", "csp-billing-usage" : "CognitiveServices.TextAnalytics.BatchScoring=2", - "apim-request-id" : "5a80653a-fbc5-4e3a-9f55-7ee98a651260", + "apim-request-id" : "e3cfef2b-8054-40f5-ae33-f2b2ff6c5de4", "retry-after" : "0", "StatusCode" : "200", - "Body" : "{\"documents\":[{\"id\":\"0\",\"entities\":[{\"text\":\"trip\",\"category\":\"Event\",\"offset\":18,\"length\":4,\"confidenceScore\":0.62},{\"text\":\"Seattle\",\"category\":\"Location\",\"subcategory\":\"GPE\",\"offset\":26,\"length\":7,\"confidenceScore\":0.6},{\"text\":\"last week\",\"category\":\"DateTime\",\"subcategory\":\"DateRange\",\"offset\":34,\"length\":9,\"confidenceScore\":0.8}],\"warnings\":[]},{\"id\":\"1\",\"entities\":[{\"text\":\"Microsoft\",\"category\":\"Organization\",\"offset\":10,\"length\":9,\"confidenceScore\":0.37}],\"warnings\":[]}],\"errors\":[],\"modelVersion\":\"2020-04-01\"}", - "Date" : "Wed, 29 Apr 2020 17:12:19 GMT", + "Body" : "{\"documents\":[{\"id\":\"0\",\"entities\":[{\"text\":\"trip\",\"category\":\"Event\",\"offset\":18,\"length\":4,\"confidenceScore\":0.61},{\"text\":\"Seattle\",\"category\":\"Location\",\"subcategory\":\"GPE\",\"offset\":26,\"length\":7,\"confidenceScore\":0.82},{\"text\":\"last week\",\"category\":\"DateTime\",\"subcategory\":\"DateRange\",\"offset\":34,\"length\":9,\"confidenceScore\":0.8}],\"warnings\":[]},{\"id\":\"1\",\"entities\":[{\"text\":\"Microsoft\",\"category\":\"Organization\",\"offset\":10,\"length\":9,\"confidenceScore\":0.77}],\"warnings\":[]}],\"errors\":[],\"modelVersion\":\"2020-04-01\"}", + "Date" : "Wed, 15 Jul 2020 04:14:31 GMT", "Content-Type" : "application/json; charset=utf-8" }, "Exception" : null diff --git a/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/recognizeEntitiesForListWithOptions.json b/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/recognizeEntitiesForListWithOptions.json index 626efdfb38703..16c4f9c873d0d 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/recognizeEntitiesForListWithOptions.json +++ b/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/recognizeEntitiesForListWithOptions.json @@ -1,23 +1,23 @@ { "networkCallRecords" : [ { "Method" : "POST", - "Uri" : "https://westus2.ppe.cognitiveservices.azure.com/text/analytics/v3.0//entities/recognition/general?showStats=true", + "Uri" : "https://REDACTED.cognitiveservices.azure.com/text/analytics/v3.1-preview.1//entities/recognition/general?showStats=true", "Headers" : { - "User-Agent" : "azsdk-java-azure-ai-textanalytics/1.0.0-beta.5 (11.0.4; Windows 10 10.0)", - "x-ms-client-request-id" : "008fab9b-6761-4859-a195-0a59e32dd2e4", + "User-Agent" : "azsdk-java-azure-ai-textanalytics/1.1.0-beta.1 (11.0.7; Windows 10; 10.0)", + "x-ms-client-request-id" : "5484539f-0b52-42b5-bd39-9f9285302365", "Content-Type" : "application/json" }, "Response" : { "Transfer-Encoding" : "chunked", - "x-envoy-upstream-service-time" : "87", + "x-envoy-upstream-service-time" : "108", "Strict-Transport-Security" : "max-age=31536000; includeSubDomains; preload", "x-content-type-options" : "nosniff", "csp-billing-usage" : "CognitiveServices.TextAnalytics.BatchScoring=2", - "apim-request-id" : "ea3fa9ac-ebcb-4d7d-8cd8-d6b6db1f6dde", + "apim-request-id" : "90fa5c9a-fcb7-4668-bde5-6847d34fa94c", "retry-after" : "0", "StatusCode" : "200", - "Body" : "{\"statistics\":{\"documentsCount\":2,\"validDocumentsCount\":2,\"erroneousDocumentsCount\":0,\"transactionsCount\":2},\"documents\":[{\"id\":\"0\",\"statistics\":{\"charactersCount\":44,\"transactionsCount\":1},\"entities\":[{\"text\":\"trip\",\"category\":\"Event\",\"offset\":18,\"length\":4,\"confidenceScore\":0.62},{\"text\":\"Seattle\",\"category\":\"Location\",\"subcategory\":\"GPE\",\"offset\":26,\"length\":7,\"confidenceScore\":0.6},{\"text\":\"last week\",\"category\":\"DateTime\",\"subcategory\":\"DateRange\",\"offset\":34,\"length\":9,\"confidenceScore\":0.8}],\"warnings\":[]},{\"id\":\"1\",\"statistics\":{\"charactersCount\":20,\"transactionsCount\":1},\"entities\":[{\"text\":\"Microsoft\",\"category\":\"Organization\",\"offset\":10,\"length\":9,\"confidenceScore\":0.37}],\"warnings\":[]}],\"errors\":[],\"modelVersion\":\"2020-04-01\"}", - "Date" : "Wed, 29 Apr 2020 17:12:18 GMT", + "Body" : "{\"statistics\":{\"documentsCount\":2,\"validDocumentsCount\":2,\"erroneousDocumentsCount\":0,\"transactionsCount\":2},\"documents\":[{\"id\":\"0\",\"statistics\":{\"charactersCount\":44,\"transactionsCount\":1},\"entities\":[{\"text\":\"trip\",\"category\":\"Event\",\"offset\":18,\"length\":4,\"confidenceScore\":0.61},{\"text\":\"Seattle\",\"category\":\"Location\",\"subcategory\":\"GPE\",\"offset\":26,\"length\":7,\"confidenceScore\":0.82},{\"text\":\"last week\",\"category\":\"DateTime\",\"subcategory\":\"DateRange\",\"offset\":34,\"length\":9,\"confidenceScore\":0.8}],\"warnings\":[]},{\"id\":\"1\",\"statistics\":{\"charactersCount\":20,\"transactionsCount\":1},\"entities\":[{\"text\":\"Microsoft\",\"category\":\"Organization\",\"offset\":10,\"length\":9,\"confidenceScore\":0.77}],\"warnings\":[]}],\"errors\":[],\"modelVersion\":\"2020-04-01\"}", + "Date" : "Wed, 15 Jul 2020 04:14:30 GMT", "Content-Type" : "application/json; charset=utf-8" }, "Exception" : null diff --git a/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/recognizeEntitiesForTextInput.json b/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/recognizeEntitiesForTextInput.json index 3e868809568df..9753ffcafa953 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/recognizeEntitiesForTextInput.json +++ b/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/recognizeEntitiesForTextInput.json @@ -1,23 +1,23 @@ { "networkCallRecords" : [ { "Method" : "POST", - "Uri" : "https://westus2.ppe.cognitiveservices.azure.com/text/analytics/v3.0//entities/recognition/general", + "Uri" : "https://REDACTED.cognitiveservices.azure.com/text/analytics/v3.1-preview.1//entities/recognition/general", "Headers" : { - "User-Agent" : "azsdk-java-azure-ai-textanalytics/1.0.0-beta.5 (11.0.4; Windows 10 10.0)", - "x-ms-client-request-id" : "9cb6c777-9a17-45dc-8bc5-144f5bc4d59a", + "User-Agent" : "azsdk-java-azure-ai-textanalytics/1.1.0-beta.1 (11.0.7; Windows 10; 10.0)", + "x-ms-client-request-id" : "9b32a575-b0a6-4689-ad1a-a5fe0389c296", "Content-Type" : "application/json" }, "Response" : { "Transfer-Encoding" : "chunked", - "x-envoy-upstream-service-time" : "76", + "x-envoy-upstream-service-time" : "91", "Strict-Transport-Security" : "max-age=31536000; includeSubDomains; preload", "x-content-type-options" : "nosniff", "csp-billing-usage" : "CognitiveServices.TextAnalytics.BatchScoring=1", - "apim-request-id" : "3297d4e1-232d-46a0-ae46-205a2929c97e", + "apim-request-id" : "81434fee-45a6-4ef6-abaf-a6683d886503", "retry-after" : "0", "StatusCode" : "200", - "Body" : "{\"documents\":[{\"id\":\"0\",\"entities\":[{\"text\":\"trip\",\"category\":\"Event\",\"offset\":18,\"length\":4,\"confidenceScore\":0.62},{\"text\":\"Seattle\",\"category\":\"Location\",\"subcategory\":\"GPE\",\"offset\":26,\"length\":7,\"confidenceScore\":0.6},{\"text\":\"last week\",\"category\":\"DateTime\",\"subcategory\":\"DateRange\",\"offset\":34,\"length\":9,\"confidenceScore\":0.8}],\"warnings\":[]}],\"errors\":[],\"modelVersion\":\"2020-04-01\"}", - "Date" : "Wed, 29 Apr 2020 17:12:20 GMT", + "Body" : "{\"documents\":[{\"id\":\"0\",\"entities\":[{\"text\":\"trip\",\"category\":\"Event\",\"offset\":18,\"length\":4,\"confidenceScore\":0.61},{\"text\":\"Seattle\",\"category\":\"Location\",\"subcategory\":\"GPE\",\"offset\":26,\"length\":7,\"confidenceScore\":0.82},{\"text\":\"last week\",\"category\":\"DateTime\",\"subcategory\":\"DateRange\",\"offset\":34,\"length\":9,\"confidenceScore\":0.8}],\"warnings\":[]}],\"errors\":[],\"modelVersion\":\"2020-04-01\"}", + "Date" : "Wed, 15 Jul 2020 04:14:38 GMT", "Content-Type" : "application/json; charset=utf-8" }, "Exception" : null diff --git a/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/recognizeEntitiesTooManyDocuments.json b/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/recognizeEntitiesTooManyDocuments.json index ff6bc75923457..799fabc968e81 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/recognizeEntitiesTooManyDocuments.json +++ b/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/recognizeEntitiesTooManyDocuments.json @@ -1,23 +1,23 @@ { "networkCallRecords" : [ { "Method" : "POST", - "Uri" : "https://REDACTED.ppe.cognitiveservices.azure.com/text/analytics/v3.0//entities/recognition/general", + "Uri" : "https://REDACTED.cognitiveservices.azure.com/text/analytics/v3.1-preview.1//entities/recognition/general", "Headers" : { - "User-Agent" : "azsdk-java-azure-ai-textanalytics/1.0.0-beta.5 (11.0.4; Windows 10 10.0)", - "x-ms-client-request-id" : "2a6195db-9126-4c71-969d-0d75fa549c6d", + "User-Agent" : "azsdk-java-azure-ai-textanalytics/1.1.0-beta.1 (11.0.7; Windows 10; 10.0)", + "x-ms-client-request-id" : "cd8350fa-8f19-4097-a165-2bf9258a13c6", "Content-Type" : "application/json" }, "Response" : { "Transfer-Encoding" : "chunked", - "x-envoy-upstream-service-time" : "128", + "x-envoy-upstream-service-time" : "112", "Strict-Transport-Security" : "max-age=31536000; includeSubDomains; preload", "x-content-type-options" : "nosniff", "csp-billing-usage" : "CognitiveServices.TextAnalytics.BatchScoring=6", - "apim-request-id" : "bb5b1fee-7fd8-4f5d-be80-8827934adb6e", + "apim-request-id" : "9c63f22a-d4c6-48fd-a3b6-d092a85b76e2", "retry-after" : "0", "StatusCode" : "200", "Body" : "{\"documents\":[{\"id\":\"0\",\"entities\":[{\"text\":\"trip\",\"category\":\"Event\",\"offset\":18,\"length\":4,\"confidenceScore\":0.61},{\"text\":\"Seattle\",\"category\":\"Location\",\"subcategory\":\"GPE\",\"offset\":26,\"length\":7,\"confidenceScore\":0.82},{\"text\":\"last week\",\"category\":\"DateTime\",\"subcategory\":\"DateRange\",\"offset\":34,\"length\":9,\"confidenceScore\":0.8}],\"warnings\":[]},{\"id\":\"1\",\"entities\":[{\"text\":\"trip\",\"category\":\"Event\",\"offset\":18,\"length\":4,\"confidenceScore\":0.61},{\"text\":\"Seattle\",\"category\":\"Location\",\"subcategory\":\"GPE\",\"offset\":26,\"length\":7,\"confidenceScore\":0.82},{\"text\":\"last week\",\"category\":\"DateTime\",\"subcategory\":\"DateRange\",\"offset\":34,\"length\":9,\"confidenceScore\":0.8}],\"warnings\":[]},{\"id\":\"2\",\"entities\":[{\"text\":\"trip\",\"category\":\"Event\",\"offset\":18,\"length\":4,\"confidenceScore\":0.61},{\"text\":\"Seattle\",\"category\":\"Location\",\"subcategory\":\"GPE\",\"offset\":26,\"length\":7,\"confidenceScore\":0.82},{\"text\":\"last week\",\"category\":\"DateTime\",\"subcategory\":\"DateRange\",\"offset\":34,\"length\":9,\"confidenceScore\":0.8}],\"warnings\":[]},{\"id\":\"3\",\"entities\":[{\"text\":\"trip\",\"category\":\"Event\",\"offset\":18,\"length\":4,\"confidenceScore\":0.61},{\"text\":\"Seattle\",\"category\":\"Location\",\"subcategory\":\"GPE\",\"offset\":26,\"length\":7,\"confidenceScore\":0.82},{\"text\":\"last week\",\"category\":\"DateTime\",\"subcategory\":\"DateRange\",\"offset\":34,\"length\":9,\"confidenceScore\":0.8}],\"warnings\":[]},{\"id\":\"4\",\"entities\":[{\"text\":\"trip\",\"category\":\"Event\",\"offset\":18,\"length\":4,\"confidenceScore\":0.61},{\"text\":\"Seattle\",\"category\":\"Location\",\"subcategory\":\"GPE\",\"offset\":26,\"length\":7,\"confidenceScore\":0.82},{\"text\":\"last week\",\"category\":\"DateTime\",\"subcategory\":\"DateRange\",\"offset\":34,\"length\":9,\"confidenceScore\":0.8}],\"warnings\":[]},{\"id\":\"5\",\"entities\":[{\"text\":\"trip\",\"category\":\"Event\",\"offset\":18,\"length\":4,\"confidenceScore\":0.61},{\"text\":\"Seattle\",\"category\":\"Location\",\"subcategory\":\"GPE\",\"offset\":26,\"length\":7,\"confidenceScore\":0.82},{\"text\":\"last week\",\"category\":\"DateTime\",\"subcategory\":\"DateRange\",\"offset\":34,\"length\":9,\"confidenceScore\":0.8}],\"warnings\":[]}],\"errors\":[{\"id\":\"\",\"error\":{\"code\":\"InvalidRequest\",\"message\":\"The request has exceeded the allowed document limits.\",\"innererror\":{\"code\":\"InvalidDocumentBatch\",\"message\":\"The number of documents in the request have exceeded the data limitations. See https://aka.ms/text-analytics-data-limits for additional information\"}}}],\"modelVersion\":\"2020-04-01\"}", - "Date" : "Fri, 08 May 2020 05:52:36 GMT", + "Date" : "Wed, 15 Jul 2020 04:14:25 GMT", "Content-Type" : "application/json; charset=utf-8" }, "Exception" : null diff --git a/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/recognizeLinkedEntitiesDuplicateIdInput.json b/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/recognizeLinkedEntitiesDuplicateIdInput.json index ad7e3561cd815..fa62720ff673f 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/recognizeLinkedEntitiesDuplicateIdInput.json +++ b/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/recognizeLinkedEntitiesDuplicateIdInput.json @@ -1,22 +1,22 @@ { "networkCallRecords" : [ { "Method" : "POST", - "Uri" : "https://westus2.ppe.cognitiveservices.azure.com/text/analytics/v3.0//entities/linking", + "Uri" : "https://REDACTED.cognitiveservices.azure.com/text/analytics/v3.1-preview.1//entities/linking", "Headers" : { - "User-Agent" : "azsdk-java-azure-ai-textanalytics/1.0.0-beta.5 (11.0.4; Windows 10 10.0)", - "x-ms-client-request-id" : "604f60ed-8d4d-43e8-bef7-954acfe4886c", + "User-Agent" : "azsdk-java-azure-ai-textanalytics/1.1.0-beta.1 (11.0.7; Windows 10; 10.0)", + "x-ms-client-request-id" : "8544a8f7-6f2a-4d9d-a2ed-d6f074246ab0", "Content-Type" : "application/json" }, "Response" : { "Transfer-Encoding" : "chunked", - "x-envoy-upstream-service-time" : "5", + "x-envoy-upstream-service-time" : "4", "Strict-Transport-Security" : "max-age=31536000; includeSubDomains; preload", "x-content-type-options" : "nosniff", - "apim-request-id" : "17c4f097-2f3f-4fa4-98a0-a036e24933d6", + "apim-request-id" : "ff2714cb-28d1-4ecb-a7f1-ee9814a6cf44", "retry-after" : "0", "StatusCode" : "400", - "Body" : "{\"error\":{\"code\":\"InvalidRequest\",\"message\":\"Invalid document in request.\",\"innerError\":{\"code\":\"InvalidDocument\",\"message\":\"Request contains duplicated Ids. Make sure each document has a unique Id.\"}}}", - "Date" : "Thu, 30 Apr 2020 04:52:37 GMT", + "Body" : "{\"error\":{\"code\":\"InvalidRequest\",\"message\":\"Invalid document in request.\",\"innererror\":{\"code\":\"InvalidDocument\",\"message\":\"Request contains duplicated Ids. Make sure each document has a unique Id.\"}}}", + "Date" : "Wed, 15 Jul 2020 04:14:31 GMT", "Content-Type" : "application/json; charset=utf-8" }, "Exception" : null diff --git a/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/recognizeLinkedEntitiesForBatchInput.json b/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/recognizeLinkedEntitiesForBatchInput.json index b29849149041a..ed180b1540e5a 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/recognizeLinkedEntitiesForBatchInput.json +++ b/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/recognizeLinkedEntitiesForBatchInput.json @@ -1,23 +1,23 @@ { "networkCallRecords" : [ { "Method" : "POST", - "Uri" : "https://westus2.ppe.cognitiveservices.azure.com/text/analytics/v3.0//entities/linking", + "Uri" : "https://REDACTED.cognitiveservices.azure.com/text/analytics/v3.1-preview.1//entities/linking", "Headers" : { - "User-Agent" : "azsdk-java-azure-ai-textanalytics/1.0.0-beta.5 (11.0.4; Windows 10 10.0)", - "x-ms-client-request-id" : "cb5a7ee7-b977-4b83-866f-39f03af7a7d2", + "User-Agent" : "azsdk-java-azure-ai-textanalytics/1.1.0-beta.1 (11.0.7; Windows 10; 10.0)", + "x-ms-client-request-id" : "6d17372a-4a5c-4666-b3b4-5a9c69fab65a", "Content-Type" : "application/json" }, "Response" : { "Transfer-Encoding" : "chunked", - "x-envoy-upstream-service-time" : "19", + "x-envoy-upstream-service-time" : "20", "Strict-Transport-Security" : "max-age=31536000; includeSubDomains; preload", "x-content-type-options" : "nosniff", "csp-billing-usage" : "CognitiveServices.TextAnalytics.BatchScoring=2", - "apim-request-id" : "21baa840-355e-4ac0-ba17-4434a669aa70", + "apim-request-id" : "f85c7d18-cd5d-47c4-a067-711bf221bd2b", "retry-after" : "0", "StatusCode" : "200", - "Body" : "{\"documents\":[{\"id\":\"0\",\"entities\":[{\"name\":\"Seattle\",\"matches\":[{\"text\":\"Seattle\",\"offset\":26,\"length\":7,\"confidenceScore\":0.0}],\"language\":\"en\",\"id\":\"Seattle\",\"url\":\"https://en.wikipedia.org/wiki/Seattle\",\"dataSource\":\"Wikipedia\"}],\"warnings\":[]},{\"id\":\"1\",\"entities\":[{\"name\":\"Microsoft\",\"matches\":[{\"text\":\"Microsoft\",\"offset\":10,\"length\":9,\"confidenceScore\":0.0}],\"language\":\"en\",\"id\":\"Microsoft\",\"url\":\"https://en.wikipedia.org/wiki/Microsoft\",\"dataSource\":\"Wikipedia\"}],\"warnings\":[]}],\"errors\":[],\"modelVersion\":\"2020-02-01\"}", - "Date" : "Wed, 29 Apr 2020 17:12:19 GMT", + "Body" : "{\"documents\":[{\"id\":\"0\",\"entities\":[{\"name\":\"Seattle\",\"matches\":[{\"text\":\"Seattle\",\"offset\":26,\"length\":7,\"confidenceScore\":0.19}],\"language\":\"en\",\"id\":\"Seattle\",\"url\":\"https://en.wikipedia.org/wiki/Seattle\",\"dataSource\":\"Wikipedia\"}],\"warnings\":[]},{\"id\":\"1\",\"entities\":[{\"name\":\"Microsoft\",\"matches\":[{\"text\":\"Microsoft\",\"offset\":10,\"length\":9,\"confidenceScore\":0.25}],\"language\":\"en\",\"id\":\"Microsoft\",\"url\":\"https://en.wikipedia.org/wiki/Microsoft\",\"dataSource\":\"Wikipedia\"}],\"warnings\":[]}],\"errors\":[],\"modelVersion\":\"2020-02-01\"}", + "Date" : "Wed, 15 Jul 2020 04:14:33 GMT", "Content-Type" : "application/json; charset=utf-8" }, "Exception" : null diff --git a/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/recognizeLinkedEntitiesForBatchInputShowStatistics.json b/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/recognizeLinkedEntitiesForBatchInputShowStatistics.json index fd7689f634631..d9eec0412a031 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/recognizeLinkedEntitiesForBatchInputShowStatistics.json +++ b/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/recognizeLinkedEntitiesForBatchInputShowStatistics.json @@ -1,23 +1,23 @@ { "networkCallRecords" : [ { "Method" : "POST", - "Uri" : "https://westus2.ppe.cognitiveservices.azure.com/text/analytics/v3.0//entities/linking?showStats=true", + "Uri" : "https://REDACTED.cognitiveservices.azure.com/text/analytics/v3.1-preview.1//entities/linking?showStats=true", "Headers" : { - "User-Agent" : "azsdk-java-azure-ai-textanalytics/1.0.0-beta.5 (11.0.4; Windows 10 10.0)", - "x-ms-client-request-id" : "8b28c5ff-1989-459c-925d-8e1de9030f7d", + "User-Agent" : "azsdk-java-azure-ai-textanalytics/1.1.0-beta.1 (11.0.7; Windows 10; 10.0)", + "x-ms-client-request-id" : "7fd12438-4735-4240-9b9c-20d910cd46a1", "Content-Type" : "application/json" }, "Response" : { "Transfer-Encoding" : "chunked", - "x-envoy-upstream-service-time" : "18", + "x-envoy-upstream-service-time" : "21", "Strict-Transport-Security" : "max-age=31536000; includeSubDomains; preload", "x-content-type-options" : "nosniff", "csp-billing-usage" : "CognitiveServices.TextAnalytics.BatchScoring=2", - "apim-request-id" : "4d1fa8fe-1ec6-4fcf-86b7-9f551acf9945", + "apim-request-id" : "50c1c83c-0484-4e3c-b12f-f345c3b956f0", "retry-after" : "0", "StatusCode" : "200", - "Body" : "{\"statistics\":{\"documentsCount\":2,\"validDocumentsCount\":2,\"erroneousDocumentsCount\":0,\"transactionsCount\":2},\"documents\":[{\"id\":\"0\",\"statistics\":{\"charactersCount\":44,\"transactionsCount\":1},\"entities\":[{\"name\":\"Seattle\",\"matches\":[{\"text\":\"Seattle\",\"offset\":26,\"length\":7,\"confidenceScore\":0.0}],\"language\":\"en\",\"id\":\"Seattle\",\"url\":\"https://en.wikipedia.org/wiki/Seattle\",\"dataSource\":\"Wikipedia\"}],\"warnings\":[]},{\"id\":\"1\",\"statistics\":{\"charactersCount\":20,\"transactionsCount\":1},\"entities\":[{\"name\":\"Microsoft\",\"matches\":[{\"text\":\"Microsoft\",\"offset\":10,\"length\":9,\"confidenceScore\":0.0}],\"language\":\"en\",\"id\":\"Microsoft\",\"url\":\"https://en.wikipedia.org/wiki/Microsoft\",\"dataSource\":\"Wikipedia\"}],\"warnings\":[]}],\"errors\":[],\"modelVersion\":\"2020-02-01\"}", - "Date" : "Wed, 29 Apr 2020 17:12:20 GMT", + "Body" : "{\"statistics\":{\"documentsCount\":2,\"validDocumentsCount\":2,\"erroneousDocumentsCount\":0,\"transactionsCount\":2},\"documents\":[{\"id\":\"0\",\"statistics\":{\"charactersCount\":44,\"transactionsCount\":1},\"entities\":[{\"name\":\"Seattle\",\"matches\":[{\"text\":\"Seattle\",\"offset\":26,\"length\":7,\"confidenceScore\":0.19}],\"language\":\"en\",\"id\":\"Seattle\",\"url\":\"https://en.wikipedia.org/wiki/Seattle\",\"dataSource\":\"Wikipedia\"}],\"warnings\":[]},{\"id\":\"1\",\"statistics\":{\"charactersCount\":20,\"transactionsCount\":1},\"entities\":[{\"name\":\"Microsoft\",\"matches\":[{\"text\":\"Microsoft\",\"offset\":10,\"length\":9,\"confidenceScore\":0.25}],\"language\":\"en\",\"id\":\"Microsoft\",\"url\":\"https://en.wikipedia.org/wiki/Microsoft\",\"dataSource\":\"Wikipedia\"}],\"warnings\":[]}],\"errors\":[],\"modelVersion\":\"2020-02-01\"}", + "Date" : "Wed, 15 Jul 2020 04:14:39 GMT", "Content-Type" : "application/json; charset=utf-8" }, "Exception" : null diff --git a/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/recognizeLinkedEntitiesForBatchStringInput.json b/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/recognizeLinkedEntitiesForBatchStringInput.json index da426aaea9fe6..4020a82c412d4 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/recognizeLinkedEntitiesForBatchStringInput.json +++ b/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/recognizeLinkedEntitiesForBatchStringInput.json @@ -1,23 +1,23 @@ { "networkCallRecords" : [ { "Method" : "POST", - "Uri" : "https://westus2.ppe.cognitiveservices.azure.com/text/analytics/v3.0//entities/linking", + "Uri" : "https://REDACTED.cognitiveservices.azure.com/text/analytics/v3.1-preview.1//entities/linking", "Headers" : { - "User-Agent" : "azsdk-java-azure-ai-textanalytics/1.0.0-beta.5 (11.0.4; Windows 10 10.0)", - "x-ms-client-request-id" : "ba5ba3c8-7119-4cff-8888-bc522556cfc3", + "User-Agent" : "azsdk-java-azure-ai-textanalytics/1.1.0-beta.1 (11.0.7; Windows 10; 10.0)", + "x-ms-client-request-id" : "988a54c2-6c04-4be9-b254-3b3b7b4f127c", "Content-Type" : "application/json" }, "Response" : { "Transfer-Encoding" : "chunked", - "x-envoy-upstream-service-time" : "18", + "x-envoy-upstream-service-time" : "19", "Strict-Transport-Security" : "max-age=31536000; includeSubDomains; preload", "x-content-type-options" : "nosniff", "csp-billing-usage" : "CognitiveServices.TextAnalytics.BatchScoring=2", - "apim-request-id" : "db699c2b-7ca7-4348-8570-7ede1f277d4a", + "apim-request-id" : "63395d16-1940-4b55-ad48-1ee0facade6a", "retry-after" : "0", "StatusCode" : "200", - "Body" : "{\"documents\":[{\"id\":\"0\",\"entities\":[{\"name\":\"Seattle\",\"matches\":[{\"text\":\"Seattle\",\"offset\":26,\"length\":7,\"confidenceScore\":0.0}],\"language\":\"en\",\"id\":\"Seattle\",\"url\":\"https://en.wikipedia.org/wiki/Seattle\",\"dataSource\":\"Wikipedia\"}],\"warnings\":[]},{\"id\":\"1\",\"entities\":[{\"name\":\"Microsoft\",\"matches\":[{\"text\":\"Microsoft\",\"offset\":10,\"length\":9,\"confidenceScore\":0.0}],\"language\":\"en\",\"id\":\"Microsoft\",\"url\":\"https://en.wikipedia.org/wiki/Microsoft\",\"dataSource\":\"Wikipedia\"}],\"warnings\":[]}],\"errors\":[],\"modelVersion\":\"2020-02-01\"}", - "Date" : "Wed, 29 Apr 2020 17:12:18 GMT", + "Body" : "{\"documents\":[{\"id\":\"0\",\"entities\":[{\"name\":\"Seattle\",\"matches\":[{\"text\":\"Seattle\",\"offset\":26,\"length\":7,\"confidenceScore\":0.19}],\"language\":\"en\",\"id\":\"Seattle\",\"url\":\"https://en.wikipedia.org/wiki/Seattle\",\"dataSource\":\"Wikipedia\"}],\"warnings\":[]},{\"id\":\"1\",\"entities\":[{\"name\":\"Microsoft\",\"matches\":[{\"text\":\"Microsoft\",\"offset\":10,\"length\":9,\"confidenceScore\":0.25}],\"language\":\"en\",\"id\":\"Microsoft\",\"url\":\"https://en.wikipedia.org/wiki/Microsoft\",\"dataSource\":\"Wikipedia\"}],\"warnings\":[]}],\"errors\":[],\"modelVersion\":\"2020-02-01\"}", + "Date" : "Wed, 15 Jul 2020 04:14:25 GMT", "Content-Type" : "application/json; charset=utf-8" }, "Exception" : null diff --git a/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/recognizeLinkedEntitiesForEmptyText.json b/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/recognizeLinkedEntitiesForEmptyText.json index c8945efee485a..c4e6d38d71ab7 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/recognizeLinkedEntitiesForEmptyText.json +++ b/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/recognizeLinkedEntitiesForEmptyText.json @@ -1,22 +1,22 @@ { "networkCallRecords" : [ { "Method" : "POST", - "Uri" : "https://westus2.ppe.cognitiveservices.azure.com/text/analytics/v3.0//entities/linking", + "Uri" : "https://REDACTED.cognitiveservices.azure.com/text/analytics/v3.1-preview.1//entities/linking", "Headers" : { - "User-Agent" : "azsdk-java-azure-ai-textanalytics/1.0.0-beta.5 (11.0.4; Windows 10 10.0)", - "x-ms-client-request-id" : "5afd8182-c8f2-454c-8278-95132a14f5af", + "User-Agent" : "azsdk-java-azure-ai-textanalytics/1.1.0-beta.1 (11.0.7; Windows 10; 10.0)", + "x-ms-client-request-id" : "2bea51cf-8a7d-4684-9910-aa44683305c3", "Content-Type" : "application/json" }, "Response" : { "Transfer-Encoding" : "chunked", - "x-envoy-upstream-service-time" : "2", + "x-envoy-upstream-service-time" : "464", "Strict-Transport-Security" : "max-age=31536000; includeSubDomains; preload", "x-content-type-options" : "nosniff", - "apim-request-id" : "de80e78b-df15-4a64-8f1a-4ebbe7450dd8", + "apim-request-id" : "3fba3d9e-867f-4f48-a3e3-c3f0d9cac40d", "retry-after" : "0", "StatusCode" : "200", "Body" : "{\"documents\":[],\"errors\":[{\"id\":\"0\",\"error\":{\"code\":\"InvalidArgument\",\"message\":\"Invalid document in request.\",\"innererror\":{\"code\":\"InvalidDocument\",\"message\":\"Document text is empty.\"}}}],\"modelVersion\":\"2020-02-01\"}", - "Date" : "Wed, 29 Apr 2020 17:12:18 GMT", + "Date" : "Wed, 15 Jul 2020 06:18:17 GMT", "Content-Type" : "application/json; charset=utf-8" }, "Exception" : null diff --git a/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/recognizeLinkedEntitiesForFaultyText.json b/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/recognizeLinkedEntitiesForFaultyText.json index f1e76d293f582..788fa793a86ed 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/recognizeLinkedEntitiesForFaultyText.json +++ b/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/recognizeLinkedEntitiesForFaultyText.json @@ -1,23 +1,23 @@ { "networkCallRecords" : [ { "Method" : "POST", - "Uri" : "https://westus2.ppe.cognitiveservices.azure.com/text/analytics/v3.0//entities/linking", + "Uri" : "https://REDACTED.cognitiveservices.azure.com/text/analytics/v3.1-preview.1//entities/linking", "Headers" : { - "User-Agent" : "azsdk-java-azure-ai-textanalytics/1.0.0-beta.5 (11.0.4; Windows 10 10.0)", - "x-ms-client-request-id" : "2f50a5ed-679e-485d-a1c6-59921c90d5a5", + "User-Agent" : "azsdk-java-azure-ai-textanalytics/1.1.0-beta.1 (11.0.7; Windows 10; 10.0)", + "x-ms-client-request-id" : "3f729f50-bdfa-4518-b43b-fbfc81668f12", "Content-Type" : "application/json" }, "Response" : { "Transfer-Encoding" : "chunked", - "x-envoy-upstream-service-time" : "16", + "x-envoy-upstream-service-time" : "17", "Strict-Transport-Security" : "max-age=31536000; includeSubDomains; preload", "x-content-type-options" : "nosniff", "csp-billing-usage" : "CognitiveServices.TextAnalytics.BatchScoring=1", - "apim-request-id" : "56625abf-52f0-4967-b086-0a7a90cbb690", + "apim-request-id" : "e2956b10-6602-43d3-a71f-4214ccad443b", "retry-after" : "0", "StatusCode" : "200", "Body" : "{\"documents\":[{\"id\":\"0\",\"entities\":[],\"warnings\":[]}],\"errors\":[],\"modelVersion\":\"2020-02-01\"}", - "Date" : "Wed, 29 Apr 2020 17:12:20 GMT", + "Date" : "Wed, 15 Jul 2020 04:14:37 GMT", "Content-Type" : "application/json; charset=utf-8" }, "Exception" : null diff --git a/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/recognizeLinkedEntitiesForListLanguageHint.json b/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/recognizeLinkedEntitiesForListLanguageHint.json index 1967eac24394f..d79d2b2f5fc71 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/recognizeLinkedEntitiesForListLanguageHint.json +++ b/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/recognizeLinkedEntitiesForListLanguageHint.json @@ -1,23 +1,23 @@ { "networkCallRecords" : [ { "Method" : "POST", - "Uri" : "https://westus2.ppe.cognitiveservices.azure.com/text/analytics/v3.0//entities/linking", + "Uri" : "https://REDACTED.cognitiveservices.azure.com/text/analytics/v3.1-preview.1//entities/linking", "Headers" : { - "User-Agent" : "azsdk-java-azure-ai-textanalytics/1.0.0-beta.5 (11.0.4; Windows 10 10.0)", - "x-ms-client-request-id" : "3c1af4aa-544e-450e-9b6d-5301807e72ee", + "User-Agent" : "azsdk-java-azure-ai-textanalytics/1.1.0-beta.1 (11.0.7; Windows 10; 10.0)", + "x-ms-client-request-id" : "e0579e3d-1a00-4116-88e6-c23f3f9fb4d4", "Content-Type" : "application/json" }, "Response" : { "Transfer-Encoding" : "chunked", - "x-envoy-upstream-service-time" : "22", + "x-envoy-upstream-service-time" : "21", "Strict-Transport-Security" : "max-age=31536000; includeSubDomains; preload", "x-content-type-options" : "nosniff", "csp-billing-usage" : "CognitiveServices.TextAnalytics.BatchScoring=2", - "apim-request-id" : "40e4642c-01a0-4ab7-9a77-fafd4ca83dc2", + "apim-request-id" : "2a27fdc5-a5b7-4ad6-b103-203954b9d260", "retry-after" : "0", "StatusCode" : "200", - "Body" : "{\"documents\":[{\"id\":\"0\",\"entities\":[{\"name\":\"Seattle\",\"matches\":[{\"text\":\"Seattle\",\"offset\":26,\"length\":7,\"confidenceScore\":0.0}],\"language\":\"en\",\"id\":\"Seattle\",\"url\":\"https://en.wikipedia.org/wiki/Seattle\",\"dataSource\":\"Wikipedia\"}],\"warnings\":[]},{\"id\":\"1\",\"entities\":[{\"name\":\"Microsoft\",\"matches\":[{\"text\":\"Microsoft\",\"offset\":10,\"length\":9,\"confidenceScore\":0.0}],\"language\":\"en\",\"id\":\"Microsoft\",\"url\":\"https://en.wikipedia.org/wiki/Microsoft\",\"dataSource\":\"Wikipedia\"}],\"warnings\":[]}],\"errors\":[],\"modelVersion\":\"2020-02-01\"}", - "Date" : "Wed, 29 Apr 2020 17:12:18 GMT", + "Body" : "{\"documents\":[{\"id\":\"0\",\"entities\":[{\"name\":\"Seattle\",\"matches\":[{\"text\":\"Seattle\",\"offset\":26,\"length\":7,\"confidenceScore\":0.19}],\"language\":\"en\",\"id\":\"Seattle\",\"url\":\"https://en.wikipedia.org/wiki/Seattle\",\"dataSource\":\"Wikipedia\"}],\"warnings\":[]},{\"id\":\"1\",\"entities\":[{\"name\":\"Microsoft\",\"matches\":[{\"text\":\"Microsoft\",\"offset\":10,\"length\":9,\"confidenceScore\":0.25}],\"language\":\"en\",\"id\":\"Microsoft\",\"url\":\"https://en.wikipedia.org/wiki/Microsoft\",\"dataSource\":\"Wikipedia\"}],\"warnings\":[]}],\"errors\":[],\"modelVersion\":\"2020-02-01\"}", + "Date" : "Wed, 15 Jul 2020 04:14:24 GMT", "Content-Type" : "application/json; charset=utf-8" }, "Exception" : null diff --git a/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/recognizeLinkedEntitiesForListStringWithOptions.json b/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/recognizeLinkedEntitiesForListStringWithOptions.json index bf0f9fea801c5..d0a58431a7850 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/recognizeLinkedEntitiesForListStringWithOptions.json +++ b/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/recognizeLinkedEntitiesForListStringWithOptions.json @@ -1,23 +1,23 @@ { "networkCallRecords" : [ { "Method" : "POST", - "Uri" : "https://westus2.ppe.cognitiveservices.azure.com/text/analytics/v3.0//entities/linking?showStats=true", + "Uri" : "https://REDACTED.cognitiveservices.azure.com/text/analytics/v3.1-preview.1//entities/linking?showStats=true", "Headers" : { - "User-Agent" : "azsdk-java-azure-ai-textanalytics/1.0.0-beta.5 (11.0.4; Windows 10 10.0)", - "x-ms-client-request-id" : "e731ff31-c9b5-4844-a5eb-c6e519d2e50a", + "User-Agent" : "azsdk-java-azure-ai-textanalytics/1.1.0-beta.1 (11.0.7; Windows 10; 10.0)", + "x-ms-client-request-id" : "667afabd-0adb-41a0-a04b-0aa32330c4c5", "Content-Type" : "application/json" }, "Response" : { "Transfer-Encoding" : "chunked", - "x-envoy-upstream-service-time" : "20", + "x-envoy-upstream-service-time" : "18", "Strict-Transport-Security" : "max-age=31536000; includeSubDomains; preload", "x-content-type-options" : "nosniff", "csp-billing-usage" : "CognitiveServices.TextAnalytics.BatchScoring=2", - "apim-request-id" : "eb22c862-77fa-4ca4-89e0-3118525a5952", + "apim-request-id" : "dd9e4842-510f-46d1-a328-b51198e22f3e", "retry-after" : "0", "StatusCode" : "200", - "Body" : "{\"statistics\":{\"documentsCount\":2,\"validDocumentsCount\":2,\"erroneousDocumentsCount\":0,\"transactionsCount\":2},\"documents\":[{\"id\":\"0\",\"statistics\":{\"charactersCount\":44,\"transactionsCount\":1},\"entities\":[{\"name\":\"Seattle\",\"matches\":[{\"text\":\"Seattle\",\"offset\":26,\"length\":7,\"confidenceScore\":0.0}],\"language\":\"en\",\"id\":\"Seattle\",\"url\":\"https://en.wikipedia.org/wiki/Seattle\",\"dataSource\":\"Wikipedia\"}],\"warnings\":[]},{\"id\":\"1\",\"statistics\":{\"charactersCount\":20,\"transactionsCount\":1},\"entities\":[{\"name\":\"Microsoft\",\"matches\":[{\"text\":\"Microsoft\",\"offset\":10,\"length\":9,\"confidenceScore\":0.0}],\"language\":\"en\",\"id\":\"Microsoft\",\"url\":\"https://en.wikipedia.org/wiki/Microsoft\",\"dataSource\":\"Wikipedia\"}],\"warnings\":[]}],\"errors\":[],\"modelVersion\":\"2020-02-01\"}", - "Date" : "Wed, 29 Apr 2020 17:12:18 GMT", + "Body" : "{\"statistics\":{\"documentsCount\":2,\"validDocumentsCount\":2,\"erroneousDocumentsCount\":0,\"transactionsCount\":2},\"documents\":[{\"id\":\"0\",\"statistics\":{\"charactersCount\":44,\"transactionsCount\":1},\"entities\":[{\"name\":\"Seattle\",\"matches\":[{\"text\":\"Seattle\",\"offset\":26,\"length\":7,\"confidenceScore\":0.19}],\"language\":\"en\",\"id\":\"Seattle\",\"url\":\"https://en.wikipedia.org/wiki/Seattle\",\"dataSource\":\"Wikipedia\"}],\"warnings\":[]},{\"id\":\"1\",\"statistics\":{\"charactersCount\":20,\"transactionsCount\":1},\"entities\":[{\"name\":\"Microsoft\",\"matches\":[{\"text\":\"Microsoft\",\"offset\":10,\"length\":9,\"confidenceScore\":0.25}],\"language\":\"en\",\"id\":\"Microsoft\",\"url\":\"https://en.wikipedia.org/wiki/Microsoft\",\"dataSource\":\"Wikipedia\"}],\"warnings\":[]}],\"errors\":[],\"modelVersion\":\"2020-02-01\"}", + "Date" : "Wed, 15 Jul 2020 04:14:26 GMT", "Content-Type" : "application/json; charset=utf-8" }, "Exception" : null diff --git a/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/recognizeLinkedEntitiesForTextInput.json b/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/recognizeLinkedEntitiesForTextInput.json index 02a66126f7a60..ff258ed571b28 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/recognizeLinkedEntitiesForTextInput.json +++ b/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/recognizeLinkedEntitiesForTextInput.json @@ -1,23 +1,23 @@ { "networkCallRecords" : [ { "Method" : "POST", - "Uri" : "https://westus2.ppe.cognitiveservices.azure.com/text/analytics/v3.0//entities/linking", + "Uri" : "https://REDACTED.cognitiveservices.azure.com/text/analytics/v3.1-preview.1//entities/linking", "Headers" : { - "User-Agent" : "azsdk-java-azure-ai-textanalytics/1.0.0-beta.5 (11.0.4; Windows 10 10.0)", - "x-ms-client-request-id" : "1e6f521e-b399-45f8-80cd-05eb0f720c22", + "User-Agent" : "azsdk-java-azure-ai-textanalytics/1.1.0-beta.1 (11.0.7; Windows 10; 10.0)", + "x-ms-client-request-id" : "0da10601-b9bc-411a-9f12-945fa3f667dc", "Content-Type" : "application/json" }, "Response" : { "Transfer-Encoding" : "chunked", - "x-envoy-upstream-service-time" : "16", + "x-envoy-upstream-service-time" : "19", "Strict-Transport-Security" : "max-age=31536000; includeSubDomains; preload", "x-content-type-options" : "nosniff", "csp-billing-usage" : "CognitiveServices.TextAnalytics.BatchScoring=1", - "apim-request-id" : "f795a6fd-89cc-41ef-9031-1145491039f9", + "apim-request-id" : "9e3520c5-51b5-4edd-85eb-4fb02ec511d9", "retry-after" : "0", "StatusCode" : "200", - "Body" : "{\"documents\":[{\"id\":\"0\",\"entities\":[{\"name\":\"Seattle\",\"matches\":[{\"text\":\"Seattle\",\"offset\":26,\"length\":7,\"confidenceScore\":0.0}],\"language\":\"en\",\"id\":\"Seattle\",\"url\":\"https://en.wikipedia.org/wiki/Seattle\",\"dataSource\":\"Wikipedia\"}],\"warnings\":[]}],\"errors\":[],\"modelVersion\":\"2020-02-01\"}", - "Date" : "Wed, 29 Apr 2020 17:12:18 GMT", + "Body" : "{\"documents\":[{\"id\":\"0\",\"entities\":[{\"name\":\"Seattle\",\"matches\":[{\"text\":\"Seattle\",\"offset\":26,\"length\":7,\"confidenceScore\":0.19}],\"language\":\"en\",\"id\":\"Seattle\",\"url\":\"https://en.wikipedia.org/wiki/Seattle\",\"dataSource\":\"Wikipedia\"}],\"warnings\":[]}],\"errors\":[],\"modelVersion\":\"2020-02-01\"}", + "Date" : "Wed, 15 Jul 2020 04:14:27 GMT", "Content-Type" : "application/json; charset=utf-8" }, "Exception" : null diff --git a/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/recognizeLinkedEntitiesTooManyDocuments.json b/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/recognizeLinkedEntitiesTooManyDocuments.json index be076b357cc59..33e16bc09775c 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/recognizeLinkedEntitiesTooManyDocuments.json +++ b/sdk/textanalytics/azure-ai-textanalytics/src/test/resources/session-records/recognizeLinkedEntitiesTooManyDocuments.json @@ -1,10 +1,10 @@ { "networkCallRecords" : [ { "Method" : "POST", - "Uri" : "https://REDACTED.ppe.cognitiveservices.azure.com/text/analytics/v3.0//entities/linking", + "Uri" : "https://REDACTED.cognitiveservices.azure.com/text/analytics/v3.1-preview.1//entities/linking", "Headers" : { - "User-Agent" : "azsdk-java-azure-ai-textanalytics/1.0.0-beta.5 (11.0.4; Windows 10 10.0)", - "x-ms-client-request-id" : "ab2a170a-32eb-49d4-9d94-ff4a39902642", + "User-Agent" : "azsdk-java-azure-ai-textanalytics/1.1.0-beta.1 (11.0.7; Windows 10; 10.0)", + "x-ms-client-request-id" : "4e464a1e-85b1-47c2-95e2-787a972954eb", "Content-Type" : "application/json" }, "Response" : { @@ -13,11 +13,11 @@ "Strict-Transport-Security" : "max-age=31536000; includeSubDomains; preload", "x-content-type-options" : "nosniff", "csp-billing-usage" : "CognitiveServices.TextAnalytics.BatchScoring=6", - "apim-request-id" : "819dd030-8b6e-4924-a9de-948c319b02f4", + "apim-request-id" : "7baa13c0-788f-4faf-9f7b-1aec862501fb", "retry-after" : "0", "StatusCode" : "200", "Body" : "{\"documents\":[{\"id\":\"0\",\"entities\":[{\"name\":\"Seattle\",\"matches\":[{\"text\":\"Seattle\",\"offset\":26,\"length\":7,\"confidenceScore\":0.19}],\"language\":\"en\",\"id\":\"Seattle\",\"url\":\"https://en.wikipedia.org/wiki/Seattle\",\"dataSource\":\"Wikipedia\"}],\"warnings\":[]},{\"id\":\"1\",\"entities\":[{\"name\":\"Seattle\",\"matches\":[{\"text\":\"Seattle\",\"offset\":26,\"length\":7,\"confidenceScore\":0.19}],\"language\":\"en\",\"id\":\"Seattle\",\"url\":\"https://en.wikipedia.org/wiki/Seattle\",\"dataSource\":\"Wikipedia\"}],\"warnings\":[]},{\"id\":\"2\",\"entities\":[{\"name\":\"Seattle\",\"matches\":[{\"text\":\"Seattle\",\"offset\":26,\"length\":7,\"confidenceScore\":0.19}],\"language\":\"en\",\"id\":\"Seattle\",\"url\":\"https://en.wikipedia.org/wiki/Seattle\",\"dataSource\":\"Wikipedia\"}],\"warnings\":[]},{\"id\":\"3\",\"entities\":[{\"name\":\"Seattle\",\"matches\":[{\"text\":\"Seattle\",\"offset\":26,\"length\":7,\"confidenceScore\":0.19}],\"language\":\"en\",\"id\":\"Seattle\",\"url\":\"https://en.wikipedia.org/wiki/Seattle\",\"dataSource\":\"Wikipedia\"}],\"warnings\":[]},{\"id\":\"4\",\"entities\":[{\"name\":\"Seattle\",\"matches\":[{\"text\":\"Seattle\",\"offset\":26,\"length\":7,\"confidenceScore\":0.19}],\"language\":\"en\",\"id\":\"Seattle\",\"url\":\"https://en.wikipedia.org/wiki/Seattle\",\"dataSource\":\"Wikipedia\"}],\"warnings\":[]},{\"id\":\"5\",\"entities\":[{\"name\":\"Seattle\",\"matches\":[{\"text\":\"Seattle\",\"offset\":26,\"length\":7,\"confidenceScore\":0.19}],\"language\":\"en\",\"id\":\"Seattle\",\"url\":\"https://en.wikipedia.org/wiki/Seattle\",\"dataSource\":\"Wikipedia\"}],\"warnings\":[]}],\"errors\":[{\"id\":\"\",\"error\":{\"code\":\"InvalidRequest\",\"message\":\"The request has exceeded the allowed document limits.\",\"innererror\":{\"code\":\"InvalidDocumentBatch\",\"message\":\"The number of documents in the request have exceeded the data limitations. See https://aka.ms/text-analytics-data-limits for additional information\"}}}],\"modelVersion\":\"2020-02-01\"}", - "Date" : "Fri, 08 May 2020 05:52:38 GMT", + "Date" : "Wed, 15 Jul 2020 04:14:33 GMT", "Content-Type" : "application/json; charset=utf-8" }, "Exception" : null diff --git a/sdk/textanalytics/azure-ai-textanalytics/swagger/README.md b/sdk/textanalytics/azure-ai-textanalytics/swagger/README.md index 5ff4685eefcfd..c1474438ca8bb 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/swagger/README.md +++ b/sdk/textanalytics/azure-ai-textanalytics/swagger/README.md @@ -20,7 +20,7 @@ autorest --java --use=C:/work/autorest.java ### Code generation settings ``` yaml -input-file: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/master/specification/cognitiveservices/data-plane/TextAnalytics/stable/v3.0/TextAnalytics.json +input-file: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/master/specification/cognitiveservices/data-plane/TextAnalytics/preview/v3.1-preview.1/TextAnalytics.json java: true output-folder: ..\ generate-client-as-impl: true From 001c38fbac53161c7f1bfb784606819c1dc87076 Mon Sep 17 00:00:00 2001 From: James Suplizio Date: Wed, 15 Jul 2020 13:31:58 -0700 Subject: [PATCH 123/129] Update Additional Modules in keyvault/ci.yml (#13204) --- eng/versioning/version_client.txt | 1 + sdk/keyvault/ci.yml | 7 ++++++- sdk/storage/azure-storage-blob-cryptography/pom.xml | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/eng/versioning/version_client.txt b/eng/versioning/version_client.txt index 93d2bbdc12734..e1cdaf5e8af4b 100644 --- a/eng/versioning/version_client.txt +++ b/eng/versioning/version_client.txt @@ -71,6 +71,7 @@ com.microsoft.azure:spring-data-cosmosdb;3.0.0-beta.1;3.0.0-beta.1 # note: The unreleased dependencies will not be manipulated with the automatic PR creation code. unreleased_com.azure:azure-messaging-servicebus;7.0.0-beta.4 +unreleased_com.azure:azure-security-keyvault-keys;4.2.0-beta.5 # Released Beta dependencies: Copy the entry from above, prepend "beta_", remove the current # version and set the version to the released beta. Released beta dependencies are only valid diff --git a/sdk/keyvault/ci.yml b/sdk/keyvault/ci.yml index d4fc84eeb0d34..5665710edbb85 100644 --- a/sdk/keyvault/ci.yml +++ b/sdk/keyvault/ci.yml @@ -57,4 +57,9 @@ extends: safeName: azuresecuritykeyvaultkeys - name: azure-security-keyvault-secrets groupId: com.azure - safeName: azuresecuritykeyvaultsecrets \ No newline at end of file + safeName: azuresecuritykeyvaultsecrets + AdditionalModules: + - name: azure-storage-blob + groupId: com.azure + - name: perf-test-core + groupId: com.azure diff --git a/sdk/storage/azure-storage-blob-cryptography/pom.xml b/sdk/storage/azure-storage-blob-cryptography/pom.xml index cf1be11a813c5..7b569f2cde8c7 100644 --- a/sdk/storage/azure-storage-blob-cryptography/pom.xml +++ b/sdk/storage/azure-storage-blob-cryptography/pom.xml @@ -101,7 +101,7 @@ com.azure azure-security-keyvault-keys - 4.2.0-beta.5 + 4.2.0-beta.5 test From 84cd70c4da775ff5ce921f36f9b21ae0f97692fa Mon Sep 17 00:00:00 2001 From: James Suplizio Date: Wed, 15 Jul 2020 16:18:27 -0700 Subject: [PATCH 124/129] Update for bannedDependency includes and beta_ tags (#13211) * Update for bannedDependency includes and beta_ tags * Update comment to remove sentence fragment --- eng/jacoco-test-coverage/pom.xml | 3 +- eng/versioning/set_versions.py | 39 +++++++++++++++++-- eng/versioning/update_versions.py | 12 ++++++ sdk/core/azure-core-amqp/pom.xml | 1 - sdk/core/azure-core-http-netty/pom.xml | 3 +- sdk/core/azure-core-http-okhttp/pom.xml | 1 - .../azure-core-serializer-avro-apache/pom.xml | 1 - .../pom.xml | 1 - .../azure-core-serializer-json-gson/pom.xml | 1 - sdk/core/azure-core-test/pom.xml | 1 - .../azure-core-tracing-opentelemetry/pom.xml | 1 - sdk/core/azure-core/pom.xml | 1 - sdk/cosmos/azure-cosmos-benchmark/pom.xml | 1 - sdk/cosmos/azure-cosmos/pom.xml | 5 --- sdk/cosmos/azure-spring-data-cosmos/pom.xml | 2 - sdk/e2e/pom.xml | 1 - sdk/identity/azure-identity/pom.xml | 1 - sdk/parents/azure-client-sdk-parent/pom.xml | 2 +- .../azure-data-schemaregistry-avro/pom.xml | 1 - sdk/spring/azure-spring-boot-test-aad/pom.xml | 3 +- .../azure-spring-boot-test-core/pom.xml | 4 +- .../azure-spring-boot-test-cosmosdb/pom.xml | 3 +- .../azure-spring-boot-test-keyvault/pom.xml | 4 +- sdk/spring/azure-spring-boot/pom.xml | 2 - sdk/tables/azure-data-tables/pom.xml | 20 ---------- 25 files changed, 57 insertions(+), 57 deletions(-) diff --git a/eng/jacoco-test-coverage/pom.xml b/eng/jacoco-test-coverage/pom.xml index 27a675955041c..1fc979da046a1 100644 --- a/eng/jacoco-test-coverage/pom.xml +++ b/eng/jacoco-test-coverage/pom.xml @@ -316,7 +316,8 @@ - com.azure:* + com.microsoft.azure:* diff --git a/eng/versioning/set_versions.py b/eng/versioning/set_versions.py index bc16045bd0a5c..98101336fcd46 100644 --- a/eng/versioning/set_versions.py +++ b/eng/versioning/set_versions.py @@ -21,13 +21,13 @@ # Use case: increment the version of a given artifact in the approprate version_[client|data|management].txt file # # python eng/versioning/set_versions.py --bt [client|data|management] --increment-version --artifact-id -# For example: To update increment the version of azure-core +# For example: To increment the version of azure-core # python eng/versioning/set_versions.py --bt client --iv --ar azure-core # # Use case: verify the version of a given artifact in the approprate version_[client|data|management].txt file # # python eng/versioning/set_versions.py --bt [client|data|management] --verify-version --artifact-id -# For example: To update increment the version of azure-core +# For example: To verify the version of azure-core # python eng/versioning/set_versions.py --bt client --vv --ar azure-core # # The script must be run at the root of azure-sdk-for-java. @@ -210,6 +210,9 @@ def prep_version_file_for_source_testing(build_type): print('version_file=' + version_file) file_changed = False + # The version map is needed to get the 'current' version of any beta dependencies + # in order to update the beta_ version in the From Source runs + version_map = {} newlines = [] with open(version_file, encoding='utf-8') as f: for raw_line in f: @@ -221,6 +224,21 @@ def prep_version_file_for_source_testing(build_type): if hasattr(module, 'current') and not module.current == module.dependency: module.dependency = module.current file_changed = True + # In order to ensure that the From Source runs are effectively testing everything + # together using the latest source built libraries, ensure that the beta_ dependency's + # version is set + elif module.name.startswith('beta_'): + tempName = module.name[len('beta_'):] + if tempName in version_map: + # beta_ tags only have a dependency version, set that to + # the current version of the non-beta dependency + module.dependency = version_map[tempName].current + file_changed = True + else: + # if the beta_ dependency doesn't have a non-beta entry in the version file then this is an error + raise ValueError('prep_version_file_for_source_testing: beta library ({}) does not have a non-beta entry {} in version file {}'.format(module.name, tempName, version_file)) + + version_map[module.name] = module newlines.append(module.string_for_version_file()) with open(version_file, 'w', encoding='utf-8') as f: @@ -280,8 +298,21 @@ def increment_library_version(build_type, artifact_id, group_id): # The dependency version only needs to be updated it if is different from the current version. # This would be the case where a library hasn't been released yet and has been released (either GA or preview) if (module.dependency != module.current): - print('library_to_update {}, previous dependency version={}, new dependency version={}'.format(library_to_update, module.dependency, module.current)) - module.dependency = module.current + vDepMatch = version_regex_named.match(module.dependency) + # If the dependency version is a beta then just set it to whatever the current + # version is + if (vDepMatch.group('prerelease') is not None): + print('library_to_update {}, previous dependency version={}, new dependency version={}'.format(library_to_update, module.dependency, module.current)) + module.dependency = module.current + # else, the dependency version isn't a pre-release version + else: + # if the dependency version isn't a beta and the current version is, don't + # update the dependency version + if (vmatch.group('prerelease') is not None): + print('library_to_update {}, has a GA dependency version {} and a beta current version {}. The dependency version will be kept at the GA version. '.format(library_to_update, module.dependency, module.current)) + else: + print('library_to_update {}, has both GA dependency {} and current {} versions. The dependency will be updated to {}. '.format(library_to_update, module.dependency, module.current, module.current)) + module.dependency = module.current print('library_to_update {}, previous current version={}, new current version={}'.format(library_to_update, module.current, new_version)) module.current = new_version newlines.append(module.string_for_version_file()) diff --git a/eng/versioning/update_versions.py b/eng/versioning/update_versions.py index 1514284044277..4366dbf3fdd9e 100644 --- a/eng/versioning/update_versions.py +++ b/eng/versioning/update_versions.py @@ -185,8 +185,20 @@ def load_version_map_from_file(the_file, version_map): if not stripped_line or stripped_line.startswith('#'): continue module = CodeModule(stripped_line) + # verify no duplicate entries if (module.name in version_map): raise ValueError('Version file: {0} contains a duplicate entry: {1}'.format(the_file, module.name)) + # verify that if the module is beta_ or unreleased_ that there's a matching non-beta_ or non-unreleased_ entry + if (module.name.startswith('beta_') or module.name.startswith('unreleased_')): + tempName = module.name + if tempName.startswith('beta_'): + tempName = module.name[len('beta_'):] + else: + tempName = module.name[len('unreleased_'):] + # if there isn't a non beta or unreleased entry then raise an issue + if tempName not in version_map: + raise ValueError('Version file: {0} does not contain a non-beta or non-unreleased entry for beta_/unreleased_ library: {1}'.format(the_file, module.name)) + version_map[module.name] = module def display_version_info(version_map): diff --git a/sdk/core/azure-core-amqp/pom.xml b/sdk/core/azure-core-amqp/pom.xml index 52cbd49021fc9..cf81692d58f0f 100644 --- a/sdk/core/azure-core-amqp/pom.xml +++ b/sdk/core/azure-core-amqp/pom.xml @@ -114,7 +114,6 @@ - com.azure:* com.microsoft.azure:qpid-proton-j-extensions:[1.2.3] org.apache.qpid:proton-j:[0.33.4] diff --git a/sdk/core/azure-core-http-netty/pom.xml b/sdk/core/azure-core-http-netty/pom.xml index b72986cae4356..5254254307c57 100644 --- a/sdk/core/azure-core-http-netty/pom.xml +++ b/sdk/core/azure-core-http-netty/pom.xml @@ -184,7 +184,6 @@ - com.azure:* io.netty:netty-buffer:[4.1.49.Final] io.netty:netty-codec-http:[4.1.49.Final] io.netty:netty-codec-http2:[4.1.49.Final] @@ -193,7 +192,7 @@ io.netty:netty-transport-native-unix-common:[4.1.49.Final] io.netty:netty-transport-native-epoll:[4.1.49.Final] io.projectreactor.netty:reactor-netty:[0.9.7.RELEASE] - io.netty:netty-transport-native-kqueue:[4.1.49.Final] + io.netty:netty-transport-native-kqueue:[4.1.49.Final] diff --git a/sdk/core/azure-core-http-okhttp/pom.xml b/sdk/core/azure-core-http-okhttp/pom.xml index 7a320cc730891..68d95e019ecfc 100644 --- a/sdk/core/azure-core-http-okhttp/pom.xml +++ b/sdk/core/azure-core-http-okhttp/pom.xml @@ -140,7 +140,6 @@ - com.azure:* com.squareup.okhttp3:okhttp:[4.2.2] diff --git a/sdk/core/azure-core-serializer-avro-apache/pom.xml b/sdk/core/azure-core-serializer-avro-apache/pom.xml index cdc26f0ca9528..f263cfa6e31e1 100644 --- a/sdk/core/azure-core-serializer-avro-apache/pom.xml +++ b/sdk/core/azure-core-serializer-avro-apache/pom.xml @@ -108,7 +108,6 @@ - com.azure:* org.apache.avro:avro:[1.9.2] diff --git a/sdk/core/azure-core-serializer-avro-jackson/pom.xml b/sdk/core/azure-core-serializer-avro-jackson/pom.xml index c1fc1800e024c..49aae7d72849b 100644 --- a/sdk/core/azure-core-serializer-avro-jackson/pom.xml +++ b/sdk/core/azure-core-serializer-avro-jackson/pom.xml @@ -108,7 +108,6 @@ - com.azure:* com.fasterxml.jackson.dataformat:jackson-dataformat-avro:[2.10.1] diff --git a/sdk/core/azure-core-serializer-json-gson/pom.xml b/sdk/core/azure-core-serializer-json-gson/pom.xml index 4e83fcebd97d9..33338a63a696c 100644 --- a/sdk/core/azure-core-serializer-json-gson/pom.xml +++ b/sdk/core/azure-core-serializer-json-gson/pom.xml @@ -114,7 +114,6 @@ - com.azure:* com.google.code.gson:gson:[2.8.5] diff --git a/sdk/core/azure-core-test/pom.xml b/sdk/core/azure-core-test/pom.xml index 8364cdb34d29f..444413eeb6a76 100644 --- a/sdk/core/azure-core-test/pom.xml +++ b/sdk/core/azure-core-test/pom.xml @@ -107,7 +107,6 @@ - com.azure:* io.projectreactor:reactor-test:[3.3.5.RELEASE] org.junit.jupiter:junit-jupiter-api:[5.6.2] diff --git a/sdk/core/azure-core-tracing-opentelemetry/pom.xml b/sdk/core/azure-core-tracing-opentelemetry/pom.xml index 0b06941e1d5cb..588fb1208cf87 100644 --- a/sdk/core/azure-core-tracing-opentelemetry/pom.xml +++ b/sdk/core/azure-core-tracing-opentelemetry/pom.xml @@ -80,7 +80,6 @@ - com.azure:* io.opentelemetry:opentelemetry-api:[0.2.4] diff --git a/sdk/core/azure-core/pom.xml b/sdk/core/azure-core/pom.xml index e085c9e8a8790..086085b9ccd0c 100644 --- a/sdk/core/azure-core/pom.xml +++ b/sdk/core/azure-core/pom.xml @@ -180,7 +180,6 @@ com.fasterxml.jackson.datatype:jackson-datatype-jsr310:[2.10.1] - com.google.code.findbugs:jsr305:[3.0.2] org.slf4j:slf4j-api:[1.7.28] diff --git a/sdk/cosmos/azure-cosmos-benchmark/pom.xml b/sdk/cosmos/azure-cosmos-benchmark/pom.xml index 38363860f0ac0..4a12a4f607a45 100644 --- a/sdk/cosmos/azure-cosmos-benchmark/pom.xml +++ b/sdk/cosmos/azure-cosmos-benchmark/pom.xml @@ -223,7 +223,6 @@ Licensed under the MIT License. - com.azure:* com.beust:jcommander:[1.58] io.dropwizard.metrics:metrics-core:[4.1.0] org.slf4j:slf4j-api:[1.7.28] diff --git a/sdk/cosmos/azure-cosmos/pom.xml b/sdk/cosmos/azure-cosmos/pom.xml index 303fa14f63308..3fa73359a2525 100644 --- a/sdk/cosmos/azure-cosmos/pom.xml +++ b/sdk/cosmos/azure-cosmos/pom.xml @@ -277,13 +277,8 @@ Licensed under the MIT License. - com.azure:* - com.fasterxml.jackson.core:jackson-core:[2.10.1] - com.fasterxml.jackson.core:jackson-annotations:[2.10.1] - com.fasterxml.jackson.core:jackson-databind:[2.10.1] com.fasterxml.jackson.datatype:jackson-datatype-jsr310:[2.10.1] com.fasterxml.jackson.module:jackson-module-afterburner:[2.10.1] - com.google.code.findbugs:jsr305:[3.0.2] io.dropwizard.metrics:metrics-core:[4.1.0] io.micrometer:micrometer-core:[1.2.0] io.netty:netty-codec-http:[4.1.49.Final] diff --git a/sdk/cosmos/azure-spring-data-cosmos/pom.xml b/sdk/cosmos/azure-spring-data-cosmos/pom.xml index c08922070a6e3..96e0500a23b46 100644 --- a/sdk/cosmos/azure-spring-data-cosmos/pom.xml +++ b/sdk/cosmos/azure-spring-data-cosmos/pom.xml @@ -191,7 +191,6 @@ - com.azure:* org.springframework:spring-beans:[5.2.6.RELEASE] org.springframework:spring-web:[5.2.6.RELEASE] org.springframework:spring-tx:[5.2.6.RELEASE] @@ -206,7 +205,6 @@ org.json:json:[20140107] com.fasterxml.jackson.module:jackson-module-parameter-names:[2.10.0] javax.annotation:javax.annotation-api:[1.3.2] - org.slf4j:slf4j-simple:[1.7.25] diff --git a/sdk/e2e/pom.xml b/sdk/e2e/pom.xml index 648a174f431bd..302fa972b9021 100644 --- a/sdk/e2e/pom.xml +++ b/sdk/e2e/pom.xml @@ -86,7 +86,6 @@ - com.azure:* org.slf4j:slf4j-api:[1.7.28] diff --git a/sdk/identity/azure-identity/pom.xml b/sdk/identity/azure-identity/pom.xml index 24ffceb057e06..0ec1658be280b 100644 --- a/sdk/identity/azure-identity/pom.xml +++ b/sdk/identity/azure-identity/pom.xml @@ -116,7 +116,6 @@ - com.azure:* com.microsoft.azure:msal4j:[1.3.0] com.microsoft.azure:msal4j-persistence-extension:[0.1] com.nimbusds:oauth2-oidc-sdk:[6.14] diff --git a/sdk/parents/azure-client-sdk-parent/pom.xml b/sdk/parents/azure-client-sdk-parent/pom.xml index ad31d3479c60d..56026116ef6a3 100644 --- a/sdk/parents/azure-client-sdk-parent/pom.xml +++ b/sdk/parents/azure-client-sdk-parent/pom.xml @@ -473,7 +473,7 @@ *:*:*:*:compile *:*:*:*:provided - + com.azure:* diff --git a/sdk/schemaregistry/azure-data-schemaregistry-avro/pom.xml b/sdk/schemaregistry/azure-data-schemaregistry-avro/pom.xml index 519ee9b2104e9..ff9d8f470bf97 100644 --- a/sdk/schemaregistry/azure-data-schemaregistry-avro/pom.xml +++ b/sdk/schemaregistry/azure-data-schemaregistry-avro/pom.xml @@ -85,7 +85,6 @@ - com.azure:* org.apache.avro:avro:[1.9.2] diff --git a/sdk/spring/azure-spring-boot-test-aad/pom.xml b/sdk/spring/azure-spring-boot-test-aad/pom.xml index f263520b730b3..e7f5ff2a695ab 100644 --- a/sdk/spring/azure-spring-boot-test-aad/pom.xml +++ b/sdk/spring/azure-spring-boot-test-aad/pom.xml @@ -47,8 +47,7 @@ - com.azure:* - com.microsoft.azure:* + com.microsoft.azure:azure-active-directory-spring-boot-starter:[2.3.3-beta.1] org.springframework.boot:spring-boot-starter-web:[2.3.0.RELEASE] diff --git a/sdk/spring/azure-spring-boot-test-core/pom.xml b/sdk/spring/azure-spring-boot-test-core/pom.xml index 1752fd094fcd1..63c8380ae9507 100644 --- a/sdk/spring/azure-spring-boot-test-core/pom.xml +++ b/sdk/spring/azure-spring-boot-test-core/pom.xml @@ -95,8 +95,8 @@ - com.azure:* - com.microsoft.azure:* + com.microsoft.azure:azure:[1.34.0] + com.microsoft.azure:azure-spring-boot-starter:[2.3.3-beta.1] com.jcraft:jsch:[0.1.53] com.github.cverges.expect4j:expect4j:[1.6] org.apache.maven:maven-embedder:[3.6.2] diff --git a/sdk/spring/azure-spring-boot-test-cosmosdb/pom.xml b/sdk/spring/azure-spring-boot-test-cosmosdb/pom.xml index 37f3956c8e7a0..6f9aaea13ac72 100644 --- a/sdk/spring/azure-spring-boot-test-cosmosdb/pom.xml +++ b/sdk/spring/azure-spring-boot-test-cosmosdb/pom.xml @@ -47,8 +47,7 @@ - com.azure:* - com.microsoft.azure:* + com.microsoft.azure:azure-cosmosdb-spring-boot-starter:[2.3.3-beta.1] org.springframework.boot:spring-boot-starter-web:[2.3.0.RELEASE] diff --git a/sdk/spring/azure-spring-boot-test-keyvault/pom.xml b/sdk/spring/azure-spring-boot-test-keyvault/pom.xml index d206c8c9c94b2..b2aad1fe2aca3 100644 --- a/sdk/spring/azure-spring-boot-test-keyvault/pom.xml +++ b/sdk/spring/azure-spring-boot-test-keyvault/pom.xml @@ -72,8 +72,8 @@ - com.azure:* - com.microsoft.azure:* + com.microsoft.azure:azure:[1.34.0] + com.microsoft.azure:azure-keyvault-secrets-spring-boot-starter:[2.3.3-beta.1] org.springframework.boot:spring-boot-starter-actuator:[2.3.0.RELEASE] org.springframework.boot:spring-boot-starter-web:[2.3.0.RELEASE] diff --git a/sdk/spring/azure-spring-boot/pom.xml b/sdk/spring/azure-spring-boot/pom.xml index 00f9045da2c93..bd58ba4b45f5b 100644 --- a/sdk/spring/azure-spring-boot/pom.xml +++ b/sdk/spring/azure-spring-boot/pom.xml @@ -263,9 +263,7 @@ - com.azure:* com.fasterxml.jackson.core:jackson-databind:[2.10.1] - com.google.code.findbugs:jsr305:[3.0.2] net.minidev:json-smart:[2.3] com.microsoft.azure:azure-servicebus-jms:[0.0.2] com.microsoft.azure:msal4j:[1.3.0] diff --git a/sdk/tables/azure-data-tables/pom.xml b/sdk/tables/azure-data-tables/pom.xml index 79c42cfcdfd26..6ef0183018917 100644 --- a/sdk/tables/azure-data-tables/pom.xml +++ b/sdk/tables/azure-data-tables/pom.xml @@ -85,24 +85,4 @@ Licensed under the MIT License. - - - - - org.apache.maven.plugins - maven-enforcer-plugin - 3.0.0-M3 - - - - - com.azure:* - - - - - - - - From de27b1b4f64e7252dc48321e86f5b273bab936b0 Mon Sep 17 00:00:00 2001 From: Scott Beddall <45376673+scbedd@users.noreply.github.com> Date: Wed, 15 Jul 2020 18:15:16 -0700 Subject: [PATCH 125/129] Update targeted doc-warden version (#13202) * target newer version of doc-warden --- eng/pipelines/templates/variables/globals.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eng/pipelines/templates/variables/globals.yml b/eng/pipelines/templates/variables/globals.yml index 611421186b18a..4c61548d8c726 100644 --- a/eng/pipelines/templates/variables/globals.yml +++ b/eng/pipelines/templates/variables/globals.yml @@ -1,5 +1,5 @@ variables: - DocWardenVersion: '0.5.0' + DocWardenVersion: '0.7.1' WagonOptions: '-Dmaven.wagon.rto=300000 -Dmaven.wagon.http.retryHandler.count=3' DefaultOptions: '--batch-mode --fail-at-end --settings eng/settings.xml $(WagonOptions)' LoggingOptions: '-Dorg.slf4j.simpleLogger.defaultLogLevel=error -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn' From e212192c7025f253da5c1234603fecc067284b51 Mon Sep 17 00:00:00 2001 From: azure-sdk Date: Thu, 16 Jul 2020 01:30:53 +0000 Subject: [PATCH 126/129] Increment package version after release of com.azure azure-core-serializer-json-gson --- eng/jacoco-test-coverage/pom.xml | 2 +- eng/versioning/version_client.txt | 2 +- sdk/core/azure-core-serializer-json-gson/CHANGELOG.md | 3 +++ sdk/core/azure-core-serializer-json-gson/pom.xml | 2 +- 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/eng/jacoco-test-coverage/pom.xml b/eng/jacoco-test-coverage/pom.xml index edc34637ff9e4..97b676259b5c3 100644 --- a/eng/jacoco-test-coverage/pom.xml +++ b/eng/jacoco-test-coverage/pom.xml @@ -94,7 +94,7 @@ com.azure azure-core-serializer-json-gson - 1.0.0-beta.2 + 1.0.0-beta.3 com.azure diff --git a/eng/versioning/version_client.txt b/eng/versioning/version_client.txt index 26dbd8065682a..95fc62f469c55 100644 --- a/eng/versioning/version_client.txt +++ b/eng/versioning/version_client.txt @@ -15,7 +15,7 @@ com.azure:azure-core-http-okhttp;1.2.3;1.2.4 com.azure:azure-core-management;1.0.0-beta.1;1.0.0-beta.2 com.azure:azure-core-serializer-avro-apache;1.0.0-beta.1;1.0.0-beta.1 com.azure:azure-core-serializer-avro-jackson;1.0.0-beta.1;1.0.0-beta.1 -com.azure:azure-core-serializer-json-gson;1.0.0-beta.1;1.0.0-beta.2 +com.azure:azure-core-serializer-json-gson;1.0.0-beta.2;1.0.0-beta.3 com.azure:azure-core-serializer-json-jackson;1.0.0-beta.1;1.0.0-beta.2 com.azure:azure-core-test;1.3.0;1.3.1 com.azure:azure-core-tracing-opentelemetry;1.0.0-beta.5;1.0.0-beta.6 diff --git a/sdk/core/azure-core-serializer-json-gson/CHANGELOG.md b/sdk/core/azure-core-serializer-json-gson/CHANGELOG.md index 469dfb665dc0e..7ea9495bd6505 100644 --- a/sdk/core/azure-core-serializer-json-gson/CHANGELOG.md +++ b/sdk/core/azure-core-serializer-json-gson/CHANGELOG.md @@ -1,5 +1,8 @@ # Release History +## 1.0.0-beta.3 (Unreleased) + + ## 1.0.0-beta.2 (2020-07-16) - `GsonJsonSerializer` implements `JsonSerializer` instead of `ObjectSerializer`. diff --git a/sdk/core/azure-core-serializer-json-gson/pom.xml b/sdk/core/azure-core-serializer-json-gson/pom.xml index 509ee42ff79ac..a7db3663b8b6f 100644 --- a/sdk/core/azure-core-serializer-json-gson/pom.xml +++ b/sdk/core/azure-core-serializer-json-gson/pom.xml @@ -15,7 +15,7 @@ com.azure azure-core-serializer-json-gson jar - 1.0.0-beta.2 + 1.0.0-beta.3 Microsoft Azure Gson JSON Serializer Library This package contains the Gson JSON serializer client plugin for azure-core. From 5a02525a47774699e8d68c7ce2cf94d79863734c Mon Sep 17 00:00:00 2001 From: azure-sdk Date: Thu, 16 Jul 2020 01:31:06 +0000 Subject: [PATCH 127/129] Increment package version after release of com.azure azure-core-serializer-json-jackson --- eng/jacoco-test-coverage/pom.xml | 2 +- eng/versioning/version_client.txt | 2 +- sdk/core/azure-core-serializer-json-jackson/CHANGELOG.md | 3 +++ sdk/core/azure-core-serializer-json-jackson/pom.xml | 2 +- 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/eng/jacoco-test-coverage/pom.xml b/eng/jacoco-test-coverage/pom.xml index 97b676259b5c3..dccd98aacca28 100644 --- a/eng/jacoco-test-coverage/pom.xml +++ b/eng/jacoco-test-coverage/pom.xml @@ -99,7 +99,7 @@ com.azure azure-core-serializer-json-jackson - 1.0.0-beta.2 + 1.0.0-beta.3 com.azure diff --git a/eng/versioning/version_client.txt b/eng/versioning/version_client.txt index 95fc62f469c55..7c38df7f23b28 100644 --- a/eng/versioning/version_client.txt +++ b/eng/versioning/version_client.txt @@ -16,7 +16,7 @@ com.azure:azure-core-management;1.0.0-beta.1;1.0.0-beta.2 com.azure:azure-core-serializer-avro-apache;1.0.0-beta.1;1.0.0-beta.1 com.azure:azure-core-serializer-avro-jackson;1.0.0-beta.1;1.0.0-beta.1 com.azure:azure-core-serializer-json-gson;1.0.0-beta.2;1.0.0-beta.3 -com.azure:azure-core-serializer-json-jackson;1.0.0-beta.1;1.0.0-beta.2 +com.azure:azure-core-serializer-json-jackson;1.0.0-beta.2;1.0.0-beta.3 com.azure:azure-core-test;1.3.0;1.3.1 com.azure:azure-core-tracing-opentelemetry;1.0.0-beta.5;1.0.0-beta.6 com.azure:azure-cosmos;4.1.0;4.2.0-beta.1 diff --git a/sdk/core/azure-core-serializer-json-jackson/CHANGELOG.md b/sdk/core/azure-core-serializer-json-jackson/CHANGELOG.md index 0dbd8708050c3..fd2ca9d418ab7 100644 --- a/sdk/core/azure-core-serializer-json-jackson/CHANGELOG.md +++ b/sdk/core/azure-core-serializer-json-jackson/CHANGELOG.md @@ -1,5 +1,8 @@ # Release History +## 1.0.0-beta.3 (Unreleased) + + ## 1.0.0-beta.2 (2020-07-16) - `JacksonJsonSerializer` implements `JsonSerializer` instead of `ObjectSerializer`. diff --git a/sdk/core/azure-core-serializer-json-jackson/pom.xml b/sdk/core/azure-core-serializer-json-jackson/pom.xml index 42c6491fb50b6..ceff14afea49e 100644 --- a/sdk/core/azure-core-serializer-json-jackson/pom.xml +++ b/sdk/core/azure-core-serializer-json-jackson/pom.xml @@ -15,7 +15,7 @@ com.azure azure-core-serializer-json-jackson jar - 1.0.0-beta.2 + 1.0.0-beta.3 Microsoft Azure Jackson JSON Serializer Library This package contains the Jackson JSON serializer client plugin for azure-core. From b8022e1c8da2cabe0a3ee1eb5031f73eeced4a19 Mon Sep 17 00:00:00 2001 From: azure-sdk Date: Thu, 16 Jul 2020 01:31:28 +0000 Subject: [PATCH 128/129] Increment package version after release of com.azure azure-core-serializer-avro-jackson --- eng/jacoco-test-coverage/pom.xml | 2 +- eng/versioning/version_client.txt | 2 +- sdk/core/azure-core-serializer-avro-jackson/CHANGELOG.md | 3 +++ sdk/core/azure-core-serializer-avro-jackson/pom.xml | 2 +- 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/eng/jacoco-test-coverage/pom.xml b/eng/jacoco-test-coverage/pom.xml index dccd98aacca28..3d0ed747bc2d1 100644 --- a/eng/jacoco-test-coverage/pom.xml +++ b/eng/jacoco-test-coverage/pom.xml @@ -89,7 +89,7 @@ com.azure azure-core-serializer-avro-jackson - 1.0.0-beta.1 + 1.0.0-beta.2 com.azure diff --git a/eng/versioning/version_client.txt b/eng/versioning/version_client.txt index 7c38df7f23b28..5f940af7a95b1 100644 --- a/eng/versioning/version_client.txt +++ b/eng/versioning/version_client.txt @@ -14,7 +14,7 @@ com.azure:azure-core-http-netty;1.5.2;1.5.3 com.azure:azure-core-http-okhttp;1.2.3;1.2.4 com.azure:azure-core-management;1.0.0-beta.1;1.0.0-beta.2 com.azure:azure-core-serializer-avro-apache;1.0.0-beta.1;1.0.0-beta.1 -com.azure:azure-core-serializer-avro-jackson;1.0.0-beta.1;1.0.0-beta.1 +com.azure:azure-core-serializer-avro-jackson;1.0.0-beta.1;1.0.0-beta.2 com.azure:azure-core-serializer-json-gson;1.0.0-beta.2;1.0.0-beta.3 com.azure:azure-core-serializer-json-jackson;1.0.0-beta.2;1.0.0-beta.3 com.azure:azure-core-test;1.3.0;1.3.1 diff --git a/sdk/core/azure-core-serializer-avro-jackson/CHANGELOG.md b/sdk/core/azure-core-serializer-avro-jackson/CHANGELOG.md index 7e8818bf53d37..148d9840f5cab 100644 --- a/sdk/core/azure-core-serializer-avro-jackson/CHANGELOG.md +++ b/sdk/core/azure-core-serializer-avro-jackson/CHANGELOG.md @@ -1,5 +1,8 @@ # Release History +## 1.0.0-beta.2 (Unreleased) + + ## 1.0.0-beta.1 (2020-07-16) - Initial release. Please see the README and wiki for information on the new design. diff --git a/sdk/core/azure-core-serializer-avro-jackson/pom.xml b/sdk/core/azure-core-serializer-avro-jackson/pom.xml index 9265ae68bc016..6bf9ae3d001ee 100644 --- a/sdk/core/azure-core-serializer-avro-jackson/pom.xml +++ b/sdk/core/azure-core-serializer-avro-jackson/pom.xml @@ -15,7 +15,7 @@ com.azure azure-core-serializer-avro-jackson jar - 1.0.0-beta.1 + 1.0.0-beta.2 Microsoft Azure Jackson Avro Serializer Library This package contains the Jackson Avro serializer client plugin for azure-core. From e43256ababbd12ef19035ad230fd4bed4ca53a7f Mon Sep 17 00:00:00 2001 From: azure-sdk Date: Thu, 16 Jul 2020 01:32:54 +0000 Subject: [PATCH 129/129] Increment package version after release of com.azure azure-core-serializer-avro-apache --- eng/jacoco-test-coverage/pom.xml | 2 +- eng/versioning/version_client.txt | 2 +- sdk/core/azure-core-serializer-avro-apache/CHANGELOG.md | 3 +++ sdk/core/azure-core-serializer-avro-apache/pom.xml | 2 +- 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/eng/jacoco-test-coverage/pom.xml b/eng/jacoco-test-coverage/pom.xml index 3d0ed747bc2d1..b3dbe50062b11 100644 --- a/eng/jacoco-test-coverage/pom.xml +++ b/eng/jacoco-test-coverage/pom.xml @@ -84,7 +84,7 @@ com.azure azure-core-serializer-avro-apache - 1.0.0-beta.1 + 1.0.0-beta.2 com.azure diff --git a/eng/versioning/version_client.txt b/eng/versioning/version_client.txt index 5f940af7a95b1..74e69a986f6ed 100644 --- a/eng/versioning/version_client.txt +++ b/eng/versioning/version_client.txt @@ -13,7 +13,7 @@ com.azure:azure-core-http-jdk-httpclient;1.0.0-beta.1;1.0.0-beta.1 com.azure:azure-core-http-netty;1.5.2;1.5.3 com.azure:azure-core-http-okhttp;1.2.3;1.2.4 com.azure:azure-core-management;1.0.0-beta.1;1.0.0-beta.2 -com.azure:azure-core-serializer-avro-apache;1.0.0-beta.1;1.0.0-beta.1 +com.azure:azure-core-serializer-avro-apache;1.0.0-beta.1;1.0.0-beta.2 com.azure:azure-core-serializer-avro-jackson;1.0.0-beta.1;1.0.0-beta.2 com.azure:azure-core-serializer-json-gson;1.0.0-beta.2;1.0.0-beta.3 com.azure:azure-core-serializer-json-jackson;1.0.0-beta.2;1.0.0-beta.3 diff --git a/sdk/core/azure-core-serializer-avro-apache/CHANGELOG.md b/sdk/core/azure-core-serializer-avro-apache/CHANGELOG.md index 7e8818bf53d37..148d9840f5cab 100644 --- a/sdk/core/azure-core-serializer-avro-apache/CHANGELOG.md +++ b/sdk/core/azure-core-serializer-avro-apache/CHANGELOG.md @@ -1,5 +1,8 @@ # Release History +## 1.0.0-beta.2 (Unreleased) + + ## 1.0.0-beta.1 (2020-07-16) - Initial release. Please see the README and wiki for information on the new design. diff --git a/sdk/core/azure-core-serializer-avro-apache/pom.xml b/sdk/core/azure-core-serializer-avro-apache/pom.xml index cc842249127aa..821422b775a93 100644 --- a/sdk/core/azure-core-serializer-avro-apache/pom.xml +++ b/sdk/core/azure-core-serializer-avro-apache/pom.xml @@ -15,7 +15,7 @@ com.azure azure-core-serializer-avro-apache jar - 1.0.0-beta.1 + 1.0.0-beta.2 Microsoft Azure Apache Avro Serializer Library This package contains the Apache Avro serializer client plugin for azure-core.