Skip to content

Commit 276710b

Browse files
SDKAutoharics24Hari Prasad PerabattulaDeeksha Sharma
committed
CodeGen from PR 17516 in Azure/azure-rest-api-specs
Dev kubernetesconfiguration microsoft.kubernetes configuration 2022 01 15 preview (Azure#17516) * Defining the APIs for the new NSP resource * created new branch for 2022-01-15-preview * updated api-version in all file from 2022-01-01-preview to 2022-01-15-preview * updates examples for extension types * updates to extension types spec * updated the readme files * updated tags in readme * adding definitions and parameters under common dir * fixing schema issues * fixing schema issue with extension type list * remove versions from x-ms-pageable in extension type versions * suppress top level resources list by subscription for extension types * copying files from appropriate GA versions to new extnesion type versions folder * updating the API version * updating operations list * Revert "copying files from appropriate GA versions to new extnesion type versions folder" This reverts commit 2247056e66d5d187c6dbdc20d0d76d1d45bf04bd. * adding namespace scope settings to extension types return data * updating location extension types list example * adding latest changes from the previous released version * removing namespace scope settings property * Revert "removing namespace scope settings property" reverting to previous commit tttt reverts commit 00900af7f4b78b7f40a5da0d6346fab73ef08cdc. Reverting to previous commit. * adding "x-ms-identifiers" * removing namespace scope settings * adding x-ms-identifiers * adding x-ms-identifiers * ran preittier fix on parameters.json file * updating tag in readme.md * reverting tag update change from last commit * removing uneeded files * fix for api readiness check * Removing all unrelated example files * Revert "Removing all unrelated example files" This reverts commit 6391df3e8bed5244aa125c6d85a9af855c058060. * Removing all unrelated example files from 2022-01-15 folder * fixing spelling error * quick change Co-authored-by: Hari Prasad Perabattula <[email protected]> Co-authored-by: Hari Prasad Perabattula <[email protected]> Co-authored-by: Deeksha Sharma <[email protected]>
1 parent 30c7957 commit 276710b

File tree

4 files changed

+58
-23
lines changed

4 files changed

+58
-23
lines changed

sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/CHANGELOG.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# Release History
22

3-
## 1.0.0-beta.4 (Unreleased)
3+
## 1.0.0-beta.1 (2022-04-08)
4+
5+
- Azure Resource Manager SourceControlConfiguration client library for Java. This package contains Microsoft Azure SDK for SourceControlConfiguration Management SDK. KubernetesConfiguration Client. Package tag package-2022-03. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt).
46

57
### Features Added
68

sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ Various documentation is available to help you get started
3232
<dependency>
3333
<groupId>com.azure.resourcemanager</groupId>
3434
<artifactId>azure-resourcemanager-kubernetesconfiguration</artifactId>
35-
<version>1.0.0-beta.3</version>
35+
<version>1.0.0-beta.4</version>
3636
</dependency>
3737
```
3838
[//]: # ({x-version-update-end})

sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/SourceControlConfigurationManager.java

Lines changed: 36 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,13 @@
1010
import com.azure.core.http.HttpPipelineBuilder;
1111
import com.azure.core.http.HttpPipelinePosition;
1212
import com.azure.core.http.policy.AddDatePolicy;
13+
import com.azure.core.http.policy.AddHeadersFromContextPolicy;
1314
import com.azure.core.http.policy.HttpLogOptions;
1415
import com.azure.core.http.policy.HttpLoggingPolicy;
1516
import com.azure.core.http.policy.HttpPipelinePolicy;
1617
import com.azure.core.http.policy.HttpPolicyProviders;
1718
import com.azure.core.http.policy.RequestIdPolicy;
19+
import com.azure.core.http.policy.RetryOptions;
1820
import com.azure.core.http.policy.RetryPolicy;
1921
import com.azure.core.http.policy.UserAgentPolicy;
2022
import com.azure.core.management.http.policy.ArmChallengeAuthenticationPolicy;
@@ -84,6 +86,19 @@ public static SourceControlConfigurationManager authenticate(TokenCredential cre
8486
return configure().authenticate(credential, profile);
8587
}
8688

89+
/**
90+
* Creates an instance of SourceControlConfiguration service API entry point.
91+
*
92+
* @param httpPipeline the {@link HttpPipeline} configured with Azure authentication credential.
93+
* @param profile the Azure profile for client.
94+
* @return the SourceControlConfiguration service API instance.
95+
*/
96+
public static SourceControlConfigurationManager authenticate(HttpPipeline httpPipeline, AzureProfile profile) {
97+
Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null.");
98+
Objects.requireNonNull(profile, "'profile' cannot be null.");
99+
return new SourceControlConfigurationManager(httpPipeline, profile, null);
100+
}
101+
87102
/**
88103
* Gets a Configurable instance that can be used to create SourceControlConfigurationManager with optional
89104
* configuration.
@@ -103,6 +118,7 @@ public static final class Configurable {
103118
private final List<HttpPipelinePolicy> policies = new ArrayList<>();
104119
private final List<String> scopes = new ArrayList<>();
105120
private RetryPolicy retryPolicy;
121+
private RetryOptions retryOptions;
106122
private Duration defaultPollInterval;
107123

108124
private Configurable() {
@@ -163,6 +179,19 @@ public Configurable withRetryPolicy(RetryPolicy retryPolicy) {
163179
return this;
164180
}
165181

182+
/**
183+
* Sets the retry options for the HTTP pipeline retry policy.
184+
*
185+
* <p>This setting has no effect, if retry policy is set via {@link #withRetryPolicy(RetryPolicy)}.
186+
*
187+
* @param retryOptions the retry options for the HTTP pipeline retry policy.
188+
* @return the configurable object itself.
189+
*/
190+
public Configurable withRetryOptions(RetryOptions retryOptions) {
191+
this.retryOptions = Objects.requireNonNull(retryOptions, "'retryOptions' cannot be null.");
192+
return this;
193+
}
194+
166195
/**
167196
* Sets the default poll interval, used when service does not provide "Retry-After" header.
168197
*
@@ -196,7 +225,7 @@ public SourceControlConfigurationManager authenticate(TokenCredential credential
196225
.append("-")
197226
.append("com.azure.resourcemanager.kubernetesconfiguration")
198227
.append("/")
199-
.append("1.0.0-beta.3");
228+
.append("1.0.0-beta.1");
200229
if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) {
201230
userAgentBuilder
202231
.append(" (")
@@ -214,10 +243,15 @@ public SourceControlConfigurationManager authenticate(TokenCredential credential
214243
scopes.add(profile.getEnvironment().getManagementEndpoint() + "/.default");
215244
}
216245
if (retryPolicy == null) {
217-
retryPolicy = new RetryPolicy("Retry-After", ChronoUnit.SECONDS);
246+
if (retryOptions != null) {
247+
retryPolicy = new RetryPolicy(retryOptions);
248+
} else {
249+
retryPolicy = new RetryPolicy("Retry-After", ChronoUnit.SECONDS);
250+
}
218251
}
219252
List<HttpPipelinePolicy> policies = new ArrayList<>();
220253
policies.add(new UserAgentPolicy(userAgentBuilder.toString()));
254+
policies.add(new AddHeadersFromContextPolicy());
221255
policies.add(new RequestIdPolicy());
222256
policies
223257
.addAll(

sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/implementation/SourceControlConfigurationClientBuilder.java

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
import com.azure.core.annotation.ServiceClientBuilder;
88
import com.azure.core.http.HttpPipeline;
99
import com.azure.core.http.HttpPipelineBuilder;
10-
import com.azure.core.http.policy.CookiePolicy;
1110
import com.azure.core.http.policy.RetryPolicy;
1211
import com.azure.core.http.policy.UserAgentPolicy;
1312
import com.azure.core.management.AzureEnvironment;
@@ -67,34 +66,34 @@ public SourceControlConfigurationClientBuilder environment(AzureEnvironment envi
6766
}
6867

6968
/*
70-
* The default poll interval for long-running operation
69+
* The HTTP pipeline to send requests through
7170
*/
72-
private Duration defaultPollInterval;
71+
private HttpPipeline pipeline;
7372

7473
/**
75-
* Sets The default poll interval for long-running operation.
74+
* Sets The HTTP pipeline to send requests through.
7675
*
77-
* @param defaultPollInterval the defaultPollInterval value.
76+
* @param pipeline the pipeline value.
7877
* @return the SourceControlConfigurationClientBuilder.
7978
*/
80-
public SourceControlConfigurationClientBuilder defaultPollInterval(Duration defaultPollInterval) {
81-
this.defaultPollInterval = defaultPollInterval;
79+
public SourceControlConfigurationClientBuilder pipeline(HttpPipeline pipeline) {
80+
this.pipeline = pipeline;
8281
return this;
8382
}
8483

8584
/*
86-
* The HTTP pipeline to send requests through
85+
* The default poll interval for long-running operation
8786
*/
88-
private HttpPipeline pipeline;
87+
private Duration defaultPollInterval;
8988

9089
/**
91-
* Sets The HTTP pipeline to send requests through.
90+
* Sets The default poll interval for long-running operation.
9291
*
93-
* @param pipeline the pipeline value.
92+
* @param defaultPollInterval the defaultPollInterval value.
9493
* @return the SourceControlConfigurationClientBuilder.
9594
*/
96-
public SourceControlConfigurationClientBuilder pipeline(HttpPipeline pipeline) {
97-
this.pipeline = pipeline;
95+
public SourceControlConfigurationClientBuilder defaultPollInterval(Duration defaultPollInterval) {
96+
this.defaultPollInterval = defaultPollInterval;
9897
return this;
9998
}
10099

@@ -120,21 +119,21 @@ public SourceControlConfigurationClientBuilder serializerAdapter(SerializerAdapt
120119
* @return an instance of SourceControlConfigurationClientImpl.
121120
*/
122121
public SourceControlConfigurationClientImpl buildClient() {
122+
if (pipeline == null) {
123+
this.pipeline = new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build();
124+
}
123125
if (endpoint == null) {
124126
this.endpoint = "https://management.azure.com";
125127
}
126128
if (environment == null) {
127129
this.environment = AzureEnvironment.AZURE;
128130
}
131+
if (pipeline == null) {
132+
this.pipeline = new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build();
133+
}
129134
if (defaultPollInterval == null) {
130135
this.defaultPollInterval = Duration.ofSeconds(30);
131136
}
132-
if (pipeline == null) {
133-
this.pipeline =
134-
new HttpPipelineBuilder()
135-
.policies(new UserAgentPolicy(), new RetryPolicy(), new CookiePolicy())
136-
.build();
137-
}
138137
if (serializerAdapter == null) {
139138
this.serializerAdapter = SerializerFactory.createDefaultManagementSerializerAdapter();
140139
}

0 commit comments

Comments
 (0)