forked from Azure/azure-sdk-for-java
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Generated from d160e35790ff315b0ce42a090244806f6510eb28
update oprationId
- Loading branch information
SDK Automation
committed
Apr 24, 2020
1 parent
122fe3c
commit 59f9292
Showing
11 changed files
with
353 additions
and
118 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
51 changes: 51 additions & 0 deletions
51
...src/main/java/com/microsoft/azure/management/resourcegraph/v2019_04_01/QueryResponse.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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.resourcegraph.v2019_04_01; | ||
|
||
import com.microsoft.azure.arm.model.HasInner; | ||
import com.microsoft.azure.arm.resources.models.HasManager; | ||
import com.microsoft.azure.management.resourcegraph.v2019_04_01.implementation.ResourceGraphManager; | ||
import com.microsoft.azure.management.resourcegraph.v2019_04_01.implementation.QueryResponseInner; | ||
import java.util.List; | ||
|
||
/** | ||
* Type representing QueryResponse. | ||
*/ | ||
public interface QueryResponse extends HasInner<QueryResponseInner>, HasManager<ResourceGraphManager> { | ||
/** | ||
* @return the count value. | ||
*/ | ||
long count(); | ||
|
||
/** | ||
* @return the data value. | ||
*/ | ||
Object data(); | ||
|
||
/** | ||
* @return the facets value. | ||
*/ | ||
List<Facet> facets(); | ||
|
||
/** | ||
* @return the resultTruncated value. | ||
*/ | ||
ResultTruncated resultTruncated(); | ||
|
||
/** | ||
* @return the skipToken value. | ||
*/ | ||
String skipToken(); | ||
|
||
/** | ||
* @return the totalRecords value. | ||
*/ | ||
long totalRecords(); | ||
|
||
} |
28 changes: 28 additions & 0 deletions
28
..._04_01/src/main/java/com/microsoft/azure/management/resourcegraph/v2019_04_01/Querys.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
/** | ||
* Copyright (c) Microsoft Corporation. All rights reserved. | ||
* Licensed under the MIT License. See License.txt in the project root for | ||
* license information. | ||
* | ||
* Code generated by Microsoft (R) AutoRest Code Generator. | ||
*/ | ||
|
||
package com.microsoft.azure.management.resourcegraph.v2019_04_01; | ||
|
||
import rx.Observable; | ||
import com.microsoft.azure.management.resourcegraph.v2019_04_01.implementation.QuerysInner; | ||
import com.microsoft.azure.arm.model.HasInner; | ||
|
||
/** | ||
* Type representing Querys. | ||
*/ | ||
public interface Querys extends HasInner<QuerysInner> { | ||
/** | ||
* Queries the resources managed by Azure Resource Manager for all subscriptions specified in the request. | ||
* | ||
* @param query Request specifying query and its options. | ||
* @throws IllegalArgumentException thrown if parameters fail the validation | ||
* @return the observable for the request | ||
*/ | ||
Observable<QueryResponse> resourcesAsync(QueryRequest query); | ||
|
||
} |
59 changes: 59 additions & 0 deletions
59
...icrosoft/azure/management/resourcegraph/v2019_04_01/implementation/QueryResponseImpl.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
/** | ||
* Copyright (c) Microsoft Corporation. All rights reserved. | ||
* Licensed under the MIT License. See License.txt in the project root for | ||
* license information. | ||
* | ||
* Code generated by Microsoft (R) AutoRest Code Generator. | ||
*/ | ||
|
||
package com.microsoft.azure.management.resourcegraph.v2019_04_01.implementation; | ||
|
||
import com.microsoft.azure.management.resourcegraph.v2019_04_01.QueryResponse; | ||
import com.microsoft.azure.arm.model.implementation.WrapperImpl; | ||
import java.util.List; | ||
import com.microsoft.azure.management.resourcegraph.v2019_04_01.Facet; | ||
import com.microsoft.azure.management.resourcegraph.v2019_04_01.ResultTruncated; | ||
|
||
class QueryResponseImpl extends WrapperImpl<QueryResponseInner> implements QueryResponse { | ||
private final ResourceGraphManager manager; | ||
QueryResponseImpl(QueryResponseInner inner, ResourceGraphManager manager) { | ||
super(inner); | ||
this.manager = manager; | ||
} | ||
|
||
@Override | ||
public ResourceGraphManager manager() { | ||
return this.manager; | ||
} | ||
|
||
@Override | ||
public long count() { | ||
return this.inner().count(); | ||
} | ||
|
||
@Override | ||
public Object data() { | ||
return this.inner().data(); | ||
} | ||
|
||
@Override | ||
public List<Facet> facets() { | ||
return this.inner().facets(); | ||
} | ||
|
||
@Override | ||
public ResultTruncated resultTruncated() { | ||
return this.inner().resultTruncated(); | ||
} | ||
|
||
@Override | ||
public String skipToken() { | ||
return this.inner().skipToken(); | ||
} | ||
|
||
@Override | ||
public long totalRecords() { | ||
return this.inner().totalRecords(); | ||
} | ||
|
||
} |
43 changes: 43 additions & 0 deletions
43
...a/com/microsoft/azure/management/resourcegraph/v2019_04_01/implementation/QuerysImpl.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
/** | ||
* Copyright (c) Microsoft Corporation. All rights reserved. | ||
* Licensed under the MIT License. See License.txt in the project root for | ||
* license information. | ||
* | ||
* Code generated by Microsoft (R) AutoRest Code Generator. | ||
* abc | ||
*/ | ||
|
||
package com.microsoft.azure.management.resourcegraph.v2019_04_01.implementation; | ||
|
||
import com.microsoft.azure.arm.model.implementation.WrapperImpl; | ||
import com.microsoft.azure.management.resourcegraph.v2019_04_01.Querys; | ||
import rx.functions.Func1; | ||
import rx.Observable; | ||
import com.microsoft.azure.management.resourcegraph.v2019_04_01.QueryResponse; | ||
import com.microsoft.azure.management.resourcegraph.v2019_04_01.QueryRequest; | ||
|
||
class QuerysImpl extends WrapperImpl<QuerysInner> implements Querys { | ||
private final ResourceGraphManager manager; | ||
|
||
QuerysImpl(ResourceGraphManager manager) { | ||
super(manager.inner().querys()); | ||
this.manager = manager; | ||
} | ||
|
||
public ResourceGraphManager manager() { | ||
return this.manager; | ||
} | ||
|
||
@Override | ||
public Observable<QueryResponse> resourcesAsync(QueryRequest query) { | ||
QuerysInner client = this.inner(); | ||
return client.resourcesAsync(query) | ||
.map(new Func1<QueryResponseInner, QueryResponse>() { | ||
@Override | ||
public QueryResponse call(QueryResponseInner inner) { | ||
return new QueryResponseImpl(inner, manager()); | ||
} | ||
}); | ||
} | ||
|
||
} |
139 changes: 139 additions & 0 deletions
139
.../com/microsoft/azure/management/resourcegraph/v2019_04_01/implementation/QuerysInner.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,139 @@ | ||
/** | ||
* Copyright (c) Microsoft Corporation. All rights reserved. | ||
* Licensed under the MIT License. See License.txt in the project root for | ||
* license information. | ||
* | ||
* Code generated by Microsoft (R) AutoRest Code Generator. | ||
*/ | ||
|
||
package com.microsoft.azure.management.resourcegraph.v2019_04_01.implementation; | ||
|
||
import retrofit2.Retrofit; | ||
import com.google.common.reflect.TypeToken; | ||
import com.microsoft.azure.management.resourcegraph.v2019_04_01.ErrorResponseException; | ||
import com.microsoft.azure.management.resourcegraph.v2019_04_01.QueryRequest; | ||
import com.microsoft.rest.ServiceCallback; | ||
import com.microsoft.rest.ServiceFuture; | ||
import com.microsoft.rest.ServiceResponse; | ||
import com.microsoft.rest.Validator; | ||
import java.io.IOException; | ||
import okhttp3.ResponseBody; | ||
import retrofit2.http.Body; | ||
import retrofit2.http.Header; | ||
import retrofit2.http.Headers; | ||
import retrofit2.http.POST; | ||
import retrofit2.http.Query; | ||
import retrofit2.Response; | ||
import rx.functions.Func1; | ||
import rx.Observable; | ||
|
||
/** | ||
* An instance of this class provides access to all the operations defined | ||
* in Querys. | ||
*/ | ||
public class QuerysInner { | ||
/** The Retrofit service to perform REST calls. */ | ||
private QuerysService service; | ||
/** The service client containing this operation class. */ | ||
private ResourceGraphClientImpl client; | ||
|
||
/** | ||
* Initializes an instance of QuerysInner. | ||
* | ||
* @param retrofit the Retrofit instance built from a Retrofit Builder. | ||
* @param client the instance of the service client containing this operation class. | ||
*/ | ||
public QuerysInner(Retrofit retrofit, ResourceGraphClientImpl client) { | ||
this.service = retrofit.create(QuerysService.class); | ||
this.client = client; | ||
} | ||
|
||
/** | ||
* The interface defining all the services for Querys to be | ||
* used by Retrofit to perform actually REST calls. | ||
*/ | ||
interface QuerysService { | ||
@Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.resourcegraph.v2019_04_01.Querys resources" }) | ||
@POST("providers/Microsoft.ResourceGraph/resources") | ||
Observable<Response<ResponseBody>> resources(@Query("api-version") String apiVersion, @Body QueryRequest query, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); | ||
|
||
} | ||
|
||
/** | ||
* Queries the resources managed by Azure Resource Manager for all subscriptions specified in the request. | ||
* | ||
* @param query Request specifying query and its options. | ||
* @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 QueryResponseInner object if successful. | ||
*/ | ||
public QueryResponseInner resources(QueryRequest query) { | ||
return resourcesWithServiceResponseAsync(query).toBlocking().single().body(); | ||
} | ||
|
||
/** | ||
* Queries the resources managed by Azure Resource Manager for all subscriptions specified in the request. | ||
* | ||
* @param query Request specifying query and its options. | ||
* @param serviceCallback the async ServiceCallback to handle successful and failed responses. | ||
* @throws IllegalArgumentException thrown if parameters fail the validation | ||
* @return the {@link ServiceFuture} object | ||
*/ | ||
public ServiceFuture<QueryResponseInner> resourcesAsync(QueryRequest query, final ServiceCallback<QueryResponseInner> serviceCallback) { | ||
return ServiceFuture.fromResponse(resourcesWithServiceResponseAsync(query), serviceCallback); | ||
} | ||
|
||
/** | ||
* Queries the resources managed by Azure Resource Manager for all subscriptions specified in the request. | ||
* | ||
* @param query Request specifying query and its options. | ||
* @throws IllegalArgumentException thrown if parameters fail the validation | ||
* @return the observable to the QueryResponseInner object | ||
*/ | ||
public Observable<QueryResponseInner> resourcesAsync(QueryRequest query) { | ||
return resourcesWithServiceResponseAsync(query).map(new Func1<ServiceResponse<QueryResponseInner>, QueryResponseInner>() { | ||
@Override | ||
public QueryResponseInner call(ServiceResponse<QueryResponseInner> response) { | ||
return response.body(); | ||
} | ||
}); | ||
} | ||
|
||
/** | ||
* Queries the resources managed by Azure Resource Manager for all subscriptions specified in the request. | ||
* | ||
* @param query Request specifying query and its options. | ||
* @throws IllegalArgumentException thrown if parameters fail the validation | ||
* @return the observable to the QueryResponseInner object | ||
*/ | ||
public Observable<ServiceResponse<QueryResponseInner>> resourcesWithServiceResponseAsync(QueryRequest query) { | ||
if (this.client.apiVersion() == null) { | ||
throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); | ||
} | ||
if (query == null) { | ||
throw new IllegalArgumentException("Parameter query is required and cannot be null."); | ||
} | ||
Validator.validate(query); | ||
return service.resources(this.client.apiVersion(), query, this.client.acceptLanguage(), this.client.userAgent()) | ||
.flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<QueryResponseInner>>>() { | ||
@Override | ||
public Observable<ServiceResponse<QueryResponseInner>> call(Response<ResponseBody> response) { | ||
try { | ||
ServiceResponse<QueryResponseInner> clientResponse = resourcesDelegate(response); | ||
return Observable.just(clientResponse); | ||
} catch (Throwable t) { | ||
return Observable.error(t); | ||
} | ||
} | ||
}); | ||
} | ||
|
||
private ServiceResponse<QueryResponseInner> resourcesDelegate(Response<ResponseBody> response) throws ErrorResponseException, IOException, IllegalArgumentException { | ||
return this.client.restClient().responseBuilderFactory().<QueryResponseInner, ErrorResponseException>newInstance(this.client.serializerAdapter()) | ||
.register(200, new TypeToken<QueryResponseInner>() { }.getType()) | ||
.registerError(ErrorResponseException.class) | ||
.build(response); | ||
} | ||
|
||
} |
Oops, something went wrong.