Skip to content

Commit 11b318b

Browse files
regen code to use ManagementException (#11142)
1 parent d064bc9 commit 11b318b

File tree

2,417 files changed

+220158
-18960
lines changed

Some content is hidden

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

2,417 files changed

+220158
-18960
lines changed

sdk/appservice/mgmt/src/main/java/com/azure/management/appservice/AbnormalTimePeriod.java

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,17 @@
55
package com.azure.management.appservice;
66

77
import com.azure.core.annotation.Fluent;
8+
import com.azure.core.util.logging.ClientLogger;
9+
import com.fasterxml.jackson.annotation.JsonIgnore;
810
import com.fasterxml.jackson.annotation.JsonProperty;
911
import java.time.OffsetDateTime;
1012
import java.util.List;
1113

1214
/** The AbnormalTimePeriod model. */
1315
@Fluent
1416
public final class AbnormalTimePeriod {
17+
@JsonIgnore private final ClientLogger logger = new ClientLogger(AbnormalTimePeriod.class);
18+
1519
/*
1620
* Start time of the downtime
1721
*/
@@ -115,4 +119,18 @@ public AbnormalTimePeriod withSolutions(List<Solution> solutions) {
115119
this.solutions = solutions;
116120
return this;
117121
}
122+
123+
/**
124+
* Validates the instance.
125+
*
126+
* @throws IllegalArgumentException thrown if the instance is not valid.
127+
*/
128+
public void validate() {
129+
if (events() != null) {
130+
events().forEach(e -> e.validate());
131+
}
132+
if (solutions() != null) {
133+
solutions().forEach(e -> e.validate());
134+
}
135+
}
118136
}

sdk/appservice/mgmt/src/main/java/com/azure/management/appservice/Address.java

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,15 @@
55
package com.azure.management.appservice;
66

77
import com.azure.core.annotation.Fluent;
8+
import com.azure.core.util.logging.ClientLogger;
9+
import com.fasterxml.jackson.annotation.JsonIgnore;
810
import com.fasterxml.jackson.annotation.JsonProperty;
911

1012
/** The Address model. */
1113
@Fluent
1214
public final class Address {
15+
@JsonIgnore private final ClientLogger logger = new ClientLogger(Address.class);
16+
1317
/*
1418
* First line of an Address.
1519
*/
@@ -165,4 +169,35 @@ public Address withState(String state) {
165169
this.state = state;
166170
return this;
167171
}
172+
173+
/**
174+
* Validates the instance.
175+
*
176+
* @throws IllegalArgumentException thrown if the instance is not valid.
177+
*/
178+
public void validate() {
179+
if (address1() == null) {
180+
throw logger
181+
.logExceptionAsError(
182+
new IllegalArgumentException("Missing required property address1 in model Address"));
183+
}
184+
if (city() == null) {
185+
throw logger
186+
.logExceptionAsError(new IllegalArgumentException("Missing required property city in model Address"));
187+
}
188+
if (country() == null) {
189+
throw logger
190+
.logExceptionAsError(
191+
new IllegalArgumentException("Missing required property country in model Address"));
192+
}
193+
if (postalCode() == null) {
194+
throw logger
195+
.logExceptionAsError(
196+
new IllegalArgumentException("Missing required property postalCode in model Address"));
197+
}
198+
if (state() == null) {
199+
throw logger
200+
.logExceptionAsError(new IllegalArgumentException("Missing required property state in model Address"));
201+
}
202+
}
168203
}

sdk/appservice/mgmt/src/main/java/com/azure/management/appservice/ApiDefinitionInfo.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,15 @@
55
package com.azure.management.appservice;
66

77
import com.azure.core.annotation.Fluent;
8+
import com.azure.core.util.logging.ClientLogger;
9+
import com.fasterxml.jackson.annotation.JsonIgnore;
810
import com.fasterxml.jackson.annotation.JsonProperty;
911

1012
/** The ApiDefinitionInfo model. */
1113
@Fluent
1214
public final class ApiDefinitionInfo {
15+
@JsonIgnore private final ClientLogger logger = new ClientLogger(ApiDefinitionInfo.class);
16+
1317
/*
1418
* The URL of the API definition.
1519
*/
@@ -35,4 +39,12 @@ public ApiDefinitionInfo withUrl(String url) {
3539
this.url = url;
3640
return this;
3741
}
42+
43+
/**
44+
* Validates the instance.
45+
*
46+
* @throws IllegalArgumentException thrown if the instance is not valid.
47+
*/
48+
public void validate() {
49+
}
3850
}

sdk/appservice/mgmt/src/main/java/com/azure/management/appservice/ApiKVReference.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,15 @@
55
package com.azure.management.appservice;
66

77
import com.azure.core.annotation.Fluent;
8+
import com.azure.core.util.logging.ClientLogger;
9+
import com.fasterxml.jackson.annotation.JsonIgnore;
810
import com.fasterxml.jackson.annotation.JsonProperty;
911

1012
/** The ApiKVReference model. */
1113
@Fluent
1214
public final class ApiKVReference {
15+
@JsonIgnore private final ClientLogger logger = new ClientLogger(ApiKVReference.class);
16+
1317
/*
1418
* The reference property.
1519
*/
@@ -243,4 +247,12 @@ public ApiKVReference withLocation(ConfigReferenceLocation location) {
243247
this.location = location;
244248
return this;
245249
}
250+
251+
/**
252+
* Validates the instance.
253+
*
254+
* @throws IllegalArgumentException thrown if the instance is not valid.
255+
*/
256+
public void validate() {
257+
}
246258
}

sdk/appservice/mgmt/src/main/java/com/azure/management/appservice/ApiManagementConfig.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,15 @@
55
package com.azure.management.appservice;
66

77
import com.azure.core.annotation.Fluent;
8+
import com.azure.core.util.logging.ClientLogger;
9+
import com.fasterxml.jackson.annotation.JsonIgnore;
810
import com.fasterxml.jackson.annotation.JsonProperty;
911

1012
/** The ApiManagementConfig model. */
1113
@Fluent
1214
public final class ApiManagementConfig {
15+
@JsonIgnore private final ClientLogger logger = new ClientLogger(ApiManagementConfig.class);
16+
1317
/*
1418
* APIM-Api Identifier.
1519
*/
@@ -35,4 +39,12 @@ public ApiManagementConfig withId(String id) {
3539
this.id = id;
3640
return this;
3741
}
42+
43+
/**
44+
* Validates the instance.
45+
*
46+
* @throws IllegalArgumentException thrown if the instance is not valid.
47+
*/
48+
public void validate() {
49+
}
3850
}

sdk/appservice/mgmt/src/main/java/com/azure/management/appservice/AppServiceCertificateOrderPatchResource.java

Lines changed: 31 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@
66

77
import com.azure.core.annotation.Fluent;
88
import com.azure.core.annotation.JsonFlatten;
9+
import com.azure.core.util.logging.ClientLogger;
910
import com.azure.management.appservice.models.AppServiceCertificateInner;
11+
import com.fasterxml.jackson.annotation.JsonIgnore;
1012
import com.fasterxml.jackson.annotation.JsonProperty;
1113
import java.time.OffsetDateTime;
1214
import java.util.List;
@@ -16,6 +18,8 @@
1618
@JsonFlatten
1719
@Fluent
1820
public class AppServiceCertificateOrderPatchResource extends ProxyOnlyResource {
21+
@JsonIgnore private final ClientLogger logger = new ClientLogger(AppServiceCertificateOrderPatchResource.class);
22+
1923
/*
2024
* State of the Key Vault secret.
2125
*/
@@ -134,7 +138,7 @@ public class AppServiceCertificateOrderPatchResource extends ProxyOnlyResource {
134138
* Time stamp when the certificate would be auto renewed next
135139
*/
136140
@JsonProperty(value = "properties.nextAutoRenewalTimeStamp", access = JsonProperty.Access.WRITE_ONLY)
137-
private OffsetDateTime nextAutoRenewalTimeStamp;
141+
private OffsetDateTime nextAutoRenewalTimestamp;
138142

139143
/**
140144
* Get the certificates property: State of the Key Vault secret.
@@ -382,11 +386,33 @@ public Boolean isPrivateKeyExternal() {
382386
}
383387

384388
/**
385-
* Get the nextAutoRenewalTimeStamp property: Time stamp when the certificate would be auto renewed next.
389+
* Get the nextAutoRenewalTimestamp property: Time stamp when the certificate would be auto renewed next.
386390
*
387-
* @return the nextAutoRenewalTimeStamp value.
391+
* @return the nextAutoRenewalTimestamp value.
388392
*/
389-
public OffsetDateTime nextAutoRenewalTimeStamp() {
390-
return this.nextAutoRenewalTimeStamp;
393+
public OffsetDateTime nextAutoRenewalTimestamp() {
394+
return this.nextAutoRenewalTimestamp;
395+
}
396+
397+
/**
398+
* Validates the instance.
399+
*
400+
* @throws IllegalArgumentException thrown if the instance is not valid.
401+
*/
402+
@Override
403+
public void validate() {
404+
super.validate();
405+
if (certificates() != null) {
406+
certificates().values().forEach(e -> e.validate());
407+
}
408+
if (signedCertificate() != null) {
409+
signedCertificate().validate();
410+
}
411+
if (intermediate() != null) {
412+
intermediate().validate();
413+
}
414+
if (root() != null) {
415+
root().validate();
416+
}
391417
}
392418
}

sdk/appservice/mgmt/src/main/java/com/azure/management/appservice/AppServiceCertificatePatchResource.java

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,16 @@
66

77
import com.azure.core.annotation.Fluent;
88
import com.azure.core.annotation.JsonFlatten;
9+
import com.azure.core.util.logging.ClientLogger;
10+
import com.fasterxml.jackson.annotation.JsonIgnore;
911
import com.fasterxml.jackson.annotation.JsonProperty;
1012

1113
/** The AppServiceCertificatePatchResource model. */
1214
@JsonFlatten
1315
@Fluent
1416
public class AppServiceCertificatePatchResource extends ProxyOnlyResource {
17+
@JsonIgnore private final ClientLogger logger = new ClientLogger(AppServiceCertificatePatchResource.class);
18+
1519
/*
1620
* Key Vault resource Id.
1721
*/
@@ -78,4 +82,14 @@ public AppServiceCertificatePatchResource withKeyVaultSecretName(String keyVault
7882
public KeyVaultSecretStatus provisioningState() {
7983
return this.provisioningState;
8084
}
85+
86+
/**
87+
* Validates the instance.
88+
*
89+
* @throws IllegalArgumentException thrown if the instance is not valid.
90+
*/
91+
@Override
92+
public void validate() {
93+
super.validate();
94+
}
8195
}

sdk/appservice/mgmt/src/main/java/com/azure/management/appservice/AppServiceDomain.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ public interface AppServiceDomain
7070
boolean readyForDnsRecordManagement();
7171

7272
/** @return all hostnames derived from the domain and assigned to Azure resources */
73-
Map<String, HostName> managedHostNames();
73+
Map<String, Hostname> managedHostNames();
7474

7575
/** @return legal agreement consent. */
7676
DomainPurchaseConsent consent();

sdk/appservice/mgmt/src/main/java/com/azure/management/appservice/AppServiceEnvironment.java

Lines changed: 52 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,17 @@
55
package com.azure.management.appservice;
66

77
import com.azure.core.annotation.Fluent;
8+
import com.azure.core.util.logging.ClientLogger;
89
import com.azure.management.appservice.models.StampCapacityInner;
10+
import com.fasterxml.jackson.annotation.JsonIgnore;
911
import com.fasterxml.jackson.annotation.JsonProperty;
1012
import java.util.List;
1113

1214
/** The AppServiceEnvironment model. */
1315
@Fluent
1416
public final class AppServiceEnvironment {
17+
@JsonIgnore private final ClientLogger logger = new ClientLogger(AppServiceEnvironment.class);
18+
1519
/*
1620
* Name of the App Service Environment.
1721
*/
@@ -160,7 +164,7 @@ public final class AppServiceEnvironment {
160164
* Description of IP SSL mapping for the App Service Environment.
161165
*/
162166
@JsonProperty(value = "vipMappings", access = JsonProperty.Access.WRITE_ONLY)
163-
private List<VirtualIPMapping> vipMappings;
167+
private List<VirtualIpMapping> vipMappings;
164168

165169
/*
166170
* Current total, used, and available worker capacities.
@@ -614,7 +618,7 @@ public Integer maximumNumberOfMachines() {
614618
*
615619
* @return the vipMappings value.
616620
*/
617-
public List<VirtualIPMapping> vipMappings() {
621+
public List<VirtualIpMapping> vipMappings() {
618622
return this.vipMappings;
619623
}
620624

@@ -876,4 +880,50 @@ public AppServiceEnvironment withSslCertKeyVaultSecretName(String sslCertKeyVaul
876880
this.sslCertKeyVaultSecretName = sslCertKeyVaultSecretName;
877881
return this;
878882
}
883+
884+
/**
885+
* Validates the instance.
886+
*
887+
* @throws IllegalArgumentException thrown if the instance is not valid.
888+
*/
889+
public void validate() {
890+
if (name() == null) {
891+
throw logger
892+
.logExceptionAsError(
893+
new IllegalArgumentException("Missing required property name in model AppServiceEnvironment"));
894+
}
895+
if (location() == null) {
896+
throw logger
897+
.logExceptionAsError(
898+
new IllegalArgumentException("Missing required property location in model AppServiceEnvironment"));
899+
}
900+
if (virtualNetwork() == null) {
901+
throw logger
902+
.logExceptionAsError(
903+
new IllegalArgumentException(
904+
"Missing required property virtualNetwork in model AppServiceEnvironment"));
905+
} else {
906+
virtualNetwork().validate();
907+
}
908+
if (workerPools() == null) {
909+
throw logger
910+
.logExceptionAsError(
911+
new IllegalArgumentException(
912+
"Missing required property workerPools in model AppServiceEnvironment"));
913+
} else {
914+
workerPools().forEach(e -> e.validate());
915+
}
916+
if (vipMappings() != null) {
917+
vipMappings().forEach(e -> e.validate());
918+
}
919+
if (environmentCapacities() != null) {
920+
environmentCapacities().forEach(e -> e.validate());
921+
}
922+
if (networkAccessControlList() != null) {
923+
networkAccessControlList().forEach(e -> e.validate());
924+
}
925+
if (clusterSettings() != null) {
926+
clusterSettings().forEach(e -> e.validate());
927+
}
928+
}
879929
}

0 commit comments

Comments
 (0)