Skip to content

Commit e2cf60f

Browse files
authored
Synapse update for Feb 2021 release (Azure#19003)
* Regenerate Synapse for Feb 2021 release * Update change log and readme versions * Add more details to change logs
1 parent 6dec9fb commit e2cf60f

File tree

50 files changed

+1190
-243
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+1190
-243
lines changed

sdk/synapse/azure-analytics-synapse-accesscontrol/CHANGELOG.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1-
## 1.0.0-beta.2 (Unreleased)
1+
## 1.0.0-beta.2 (2021-02-09)
22

3+
- Support specifying the service API version. (AutoRest update)
4+
- Send missing "Accept" request headers
35

46
## 1.0.0-beta.1 (2020-12-08)
57

sdk/synapse/azure-analytics-synapse-accesscontrol/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Maven dependency for the Azure Synapse Access Control client library. Add it to
1414
<dependency>
1515
<groupId>com.azure</groupId>
1616
<artifactId>azure-analytics-synapse-accesscontrol</artifactId>
17-
<version>1.0.0-beta.1</version>
17+
<version>1.0.0-beta.2</version>
1818
</dependency>
1919
```
2020
[//]: # ({x-version-update-end})

sdk/synapse/azure-analytics-synapse-accesscontrol/src/main/java/com/azure/analytics/synapse/accesscontrol/AccessControlClientBuilder.java

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,22 @@ public AccessControlClientBuilder endpoint(String endpoint) {
6565
return this;
6666
}
6767

68+
/*
69+
* Api Version
70+
*/
71+
private String apiVersion;
72+
73+
/**
74+
* Sets Api Version.
75+
*
76+
* @param apiVersion the apiVersion value.
77+
* @return the AccessControlClientBuilder.
78+
*/
79+
public AccessControlClientBuilder apiVersion(String apiVersion) {
80+
this.apiVersion = apiVersion;
81+
return this;
82+
}
83+
6884
/*
6985
* The HTTP pipeline to send requests through
7086
*/
@@ -201,13 +217,16 @@ public AccessControlClientBuilder addPolicy(HttpPipelinePolicy customPolicy) {
201217
* @return an instance of AccessControlClientImpl.
202218
*/
203219
private AccessControlClientImpl buildInnerClient() {
220+
if (apiVersion == null) {
221+
this.apiVersion = "2020-08-01-preview";
222+
}
204223
if (pipeline == null) {
205224
this.pipeline = createHttpPipeline();
206225
}
207226
if (serializerAdapter == null) {
208227
this.serializerAdapter = JacksonAdapter.createDefaultSerializerAdapter();
209228
}
210-
AccessControlClientImpl client = new AccessControlClientImpl(pipeline, serializerAdapter, endpoint);
229+
AccessControlClientImpl client = new AccessControlClientImpl(pipeline, serializerAdapter, endpoint, apiVersion);
211230
return client;
212231
}
213232

sdk/synapse/azure-analytics-synapse-accesscontrol/src/main/java/com/azure/analytics/synapse/accesscontrol/implementation/AccessControlClientImpl.java

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -90,24 +90,27 @@ public RoleDefinitionsImpl getRoleDefinitions() {
9090
* Initializes an instance of AccessControlClient client.
9191
*
9292
* @param endpoint The workspace development endpoint, for example https://myworkspace.dev.azuresynapse.net.
93+
* @param apiVersion Api Version.
9394
*/
94-
public AccessControlClientImpl(String endpoint) {
95+
public AccessControlClientImpl(String endpoint, String apiVersion) {
9596
this(
9697
new HttpPipelineBuilder()
9798
.policies(new UserAgentPolicy(), new RetryPolicy(), new CookiePolicy())
9899
.build(),
99100
JacksonAdapter.createDefaultSerializerAdapter(),
100-
endpoint);
101+
endpoint,
102+
apiVersion);
101103
}
102104

103105
/**
104106
* Initializes an instance of AccessControlClient client.
105107
*
106108
* @param httpPipeline The HTTP pipeline to send requests through.
107109
* @param endpoint The workspace development endpoint, for example https://myworkspace.dev.azuresynapse.net.
110+
* @param apiVersion Api Version.
108111
*/
109-
public AccessControlClientImpl(HttpPipeline httpPipeline, String endpoint) {
110-
this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), endpoint);
112+
public AccessControlClientImpl(HttpPipeline httpPipeline, String endpoint, String apiVersion) {
113+
this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), endpoint, apiVersion);
111114
}
112115

113116
/**
@@ -116,12 +119,14 @@ public AccessControlClientImpl(HttpPipeline httpPipeline, String endpoint) {
116119
* @param httpPipeline The HTTP pipeline to send requests through.
117120
* @param serializerAdapter The serializer to serialize an object into a string.
118121
* @param endpoint The workspace development endpoint, for example https://myworkspace.dev.azuresynapse.net.
122+
* @param apiVersion Api Version.
119123
*/
120-
public AccessControlClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, String endpoint) {
124+
public AccessControlClientImpl(
125+
HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, String endpoint, String apiVersion) {
121126
this.httpPipeline = httpPipeline;
122127
this.serializerAdapter = serializerAdapter;
123128
this.endpoint = endpoint;
124-
this.apiVersion = "2020-08-01-preview";
129+
this.apiVersion = apiVersion;
125130
this.roleAssignments = new RoleAssignmentsImpl(this);
126131
this.roleDefinitions = new RoleDefinitionsImpl(this);
127132
}

sdk/synapse/azure-analytics-synapse-accesscontrol/src/main/java/com/azure/analytics/synapse/accesscontrol/implementation/RoleAssignmentsImpl.java

Lines changed: 30 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ Mono<Response<CheckPrincipalAccessResponse>> checkPrincipalAccess(
6969
@HostParam("endpoint") String endpoint,
7070
@QueryParam("api-version") String apiVersion,
7171
@BodyParam("application/json") CheckPrincipalAccessRequest request,
72+
@HeaderParam("Accept") String accept,
7273
Context context);
7374

7475
@Get("/roleAssignments")
@@ -81,6 +82,7 @@ Mono<RoleAssignmentsListRoleAssignmentsResponse> listRoleAssignments(
8182
@QueryParam("principalId") String principalId,
8283
@QueryParam("scope") String scope,
8384
@HeaderParam("x-ms-continuation") String continuationToken,
85+
@HeaderParam("Accept") String accept,
8486
Context context);
8587

8688
@Put("/roleAssignments/{roleAssignmentId}")
@@ -91,6 +93,7 @@ Mono<Response<RoleAssignmentDetails>> createRoleAssignment(
9193
@QueryParam("api-version") String apiVersion,
9294
@PathParam("roleAssignmentId") String roleAssignmentId,
9395
@BodyParam("application/json") RoleAssignmentRequest request,
96+
@HeaderParam("Accept") String accept,
9497
Context context);
9598

9699
@Get("/roleAssignments/{roleAssignmentId}")
@@ -100,6 +103,7 @@ Mono<Response<RoleAssignmentDetails>> getRoleAssignmentById(
100103
@HostParam("endpoint") String endpoint,
101104
@QueryParam("api-version") String apiVersion,
102105
@PathParam("roleAssignmentId") String roleAssignmentId,
106+
@HeaderParam("Accept") String accept,
103107
Context context);
104108

105109
@Delete("/roleAssignments/{roleAssignmentId}")
@@ -110,6 +114,7 @@ Mono<Response<Void>> deleteRoleAssignmentById(
110114
@QueryParam("api-version") String apiVersion,
111115
@PathParam("roleAssignmentId") String roleAssignmentId,
112116
@QueryParam("scope") String scope,
117+
@HeaderParam("Accept") String accept,
113118
Context context);
114119
}
115120

@@ -127,14 +132,15 @@ Mono<Response<Void>> deleteRoleAssignmentById(
127132
@ServiceMethod(returns = ReturnType.SINGLE)
128133
public Mono<Response<CheckPrincipalAccessResponse>> checkPrincipalAccessWithResponseAsync(
129134
SubjectInfo subject, List<RequiredAction> actions, String scope) {
135+
final String accept = "application/json, text/json";
130136
CheckPrincipalAccessRequest request = new CheckPrincipalAccessRequest();
131137
request.setSubject(subject);
132138
request.setActions(actions);
133139
request.setScope(scope);
134140
return FluxUtil.withContext(
135141
context ->
136142
service.checkPrincipalAccess(
137-
this.client.getEndpoint(), this.client.getApiVersion(), request, context));
143+
this.client.getEndpoint(), this.client.getApiVersion(), request, accept, context));
138144
}
139145

140146
/**
@@ -152,11 +158,13 @@ public Mono<Response<CheckPrincipalAccessResponse>> checkPrincipalAccessWithResp
152158
@ServiceMethod(returns = ReturnType.SINGLE)
153159
public Mono<Response<CheckPrincipalAccessResponse>> checkPrincipalAccessWithResponseAsync(
154160
SubjectInfo subject, List<RequiredAction> actions, String scope, Context context) {
161+
final String accept = "application/json, text/json";
155162
CheckPrincipalAccessRequest request = new CheckPrincipalAccessRequest();
156163
request.setSubject(subject);
157164
request.setActions(actions);
158165
request.setScope(scope);
159-
return service.checkPrincipalAccess(this.client.getEndpoint(), this.client.getApiVersion(), request, context);
166+
return service.checkPrincipalAccess(
167+
this.client.getEndpoint(), this.client.getApiVersion(), request, accept, context);
160168
}
161169

162170
/**
@@ -260,6 +268,7 @@ public Response<CheckPrincipalAccessResponse> checkPrincipalAccessWithResponse(
260268
@ServiceMethod(returns = ReturnType.SINGLE)
261269
public Mono<RoleAssignmentsListRoleAssignmentsResponse> listRoleAssignmentsWithResponseAsync(
262270
String roleId, String principalId, String scope, String continuationToken) {
271+
final String accept = "application/json, text/json";
263272
return FluxUtil.withContext(
264273
context ->
265274
service.listRoleAssignments(
@@ -269,6 +278,7 @@ public Mono<RoleAssignmentsListRoleAssignmentsResponse> listRoleAssignmentsWithR
269278
principalId,
270279
scope,
271280
continuationToken,
281+
accept,
272282
context));
273283
}
274284

@@ -288,13 +298,15 @@ public Mono<RoleAssignmentsListRoleAssignmentsResponse> listRoleAssignmentsWithR
288298
@ServiceMethod(returns = ReturnType.SINGLE)
289299
public Mono<RoleAssignmentsListRoleAssignmentsResponse> listRoleAssignmentsWithResponseAsync(
290300
String roleId, String principalId, String scope, String continuationToken, Context context) {
301+
final String accept = "application/json, text/json";
291302
return service.listRoleAssignments(
292303
this.client.getEndpoint(),
293304
this.client.getApiVersion(),
294305
roleId,
295306
principalId,
296307
scope,
297308
continuationToken,
309+
accept,
298310
context);
299311
}
300312

@@ -444,6 +456,7 @@ public Response<RoleAssignmentDetailsList> listRoleAssignmentsWithResponse(
444456
@ServiceMethod(returns = ReturnType.SINGLE)
445457
public Mono<Response<RoleAssignmentDetails>> createRoleAssignmentWithResponseAsync(
446458
String roleAssignmentId, UUID roleId, UUID principalId, String scope, String principalType) {
459+
final String accept = "application/json, text/json";
447460
RoleAssignmentRequest request = new RoleAssignmentRequest();
448461
request.setRoleId(roleId);
449462
request.setPrincipalId(principalId);
@@ -456,6 +469,7 @@ public Mono<Response<RoleAssignmentDetails>> createRoleAssignmentWithResponseAsy
456469
this.client.getApiVersion(),
457470
roleAssignmentId,
458471
request,
472+
accept,
459473
context));
460474
}
461475

@@ -481,13 +495,14 @@ public Mono<Response<RoleAssignmentDetails>> createRoleAssignmentWithResponseAsy
481495
String scope,
482496
String principalType,
483497
Context context) {
498+
final String accept = "application/json, text/json";
484499
RoleAssignmentRequest request = new RoleAssignmentRequest();
485500
request.setRoleId(roleId);
486501
request.setPrincipalId(principalId);
487502
request.setScope(scope);
488503
request.setPrincipalType(principalType);
489504
return service.createRoleAssignment(
490-
this.client.getEndpoint(), this.client.getApiVersion(), roleAssignmentId, request, context);
505+
this.client.getEndpoint(), this.client.getApiVersion(), roleAssignmentId, request, accept, context);
491506
}
492507

493508
/**
@@ -654,10 +669,15 @@ public Response<RoleAssignmentDetails> createRoleAssignmentWithResponse(
654669
*/
655670
@ServiceMethod(returns = ReturnType.SINGLE)
656671
public Mono<Response<RoleAssignmentDetails>> getRoleAssignmentByIdWithResponseAsync(String roleAssignmentId) {
672+
final String accept = "application/json, text/json";
657673
return FluxUtil.withContext(
658674
context ->
659675
service.getRoleAssignmentById(
660-
this.client.getEndpoint(), this.client.getApiVersion(), roleAssignmentId, context));
676+
this.client.getEndpoint(),
677+
this.client.getApiVersion(),
678+
roleAssignmentId,
679+
accept,
680+
context));
661681
}
662682

663683
/**
@@ -673,8 +693,9 @@ public Mono<Response<RoleAssignmentDetails>> getRoleAssignmentByIdWithResponseAs
673693
@ServiceMethod(returns = ReturnType.SINGLE)
674694
public Mono<Response<RoleAssignmentDetails>> getRoleAssignmentByIdWithResponseAsync(
675695
String roleAssignmentId, Context context) {
696+
final String accept = "application/json, text/json";
676697
return service.getRoleAssignmentById(
677-
this.client.getEndpoint(), this.client.getApiVersion(), roleAssignmentId, context);
698+
this.client.getEndpoint(), this.client.getApiVersion(), roleAssignmentId, accept, context);
678699
}
679700

680701
/**
@@ -763,13 +784,15 @@ public Response<RoleAssignmentDetails> getRoleAssignmentByIdWithResponse(String
763784
*/
764785
@ServiceMethod(returns = ReturnType.SINGLE)
765786
public Mono<Response<Void>> deleteRoleAssignmentByIdWithResponseAsync(String roleAssignmentId, String scope) {
787+
final String accept = "application/json, text/json";
766788
return FluxUtil.withContext(
767789
context ->
768790
service.deleteRoleAssignmentById(
769791
this.client.getEndpoint(),
770792
this.client.getApiVersion(),
771793
roleAssignmentId,
772794
scope,
795+
accept,
773796
context));
774797
}
775798

@@ -787,8 +810,9 @@ public Mono<Response<Void>> deleteRoleAssignmentByIdWithResponseAsync(String rol
787810
@ServiceMethod(returns = ReturnType.SINGLE)
788811
public Mono<Response<Void>> deleteRoleAssignmentByIdWithResponseAsync(
789812
String roleAssignmentId, String scope, Context context) {
813+
final String accept = "application/json, text/json";
790814
return service.deleteRoleAssignmentById(
791-
this.client.getEndpoint(), this.client.getApiVersion(), roleAssignmentId, scope, context);
815+
this.client.getEndpoint(), this.client.getApiVersion(), roleAssignmentId, scope, accept, context);
792816
}
793817

794818
/**

0 commit comments

Comments
 (0)