Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mgmt, azure-json azure-resourcemanager-network migration #41405

Merged
merged 5 commits into from
Aug 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion sdk/resourcemanager/api-specs.json
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@
"dir": "azure-resourcemanager-network",
"source": "specification/network/resource-manager/readme.md",
"package": "com.azure.resourcemanager.network",
"args": "--tag=package-2024-01 --add-inner=ApplicationGatewayIpConfiguration,ApplicationGatewayPathRule,ApplicationGatewayProbe,ApplicationGatewayRedirectConfiguration,ApplicationGatewayRequestRoutingRule,ApplicationGatewaySslCertificate,ApplicationGatewayUrlPathMap,ApplicationGatewayAuthenticationCertificate,VirtualNetworkGatewayIpConfiguration,ConnectionMonitor,PacketCapture,ApplicationGateway,ApplicationGatewayListener --stream-style-serialization=false",
"args": "--tag=package-2024-01 --add-inner=ApplicationGatewayIpConfiguration,ApplicationGatewayPathRule,ApplicationGatewayProbe,ApplicationGatewayRedirectConfiguration,ApplicationGatewayRequestRoutingRule,ApplicationGatewaySslCertificate,ApplicationGatewayUrlPathMap,ApplicationGatewayAuthenticationCertificate,VirtualNetworkGatewayIpConfiguration,ConnectionMonitor,PacketCapture,ApplicationGateway,ApplicationGatewayListener",
"note": "Run DeprecateApplicationGatewaySku to deprecate v1 sku/tier in ApplicationGatewaySku."
},
"network-hybrid": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@

### Other Changes

- Replaced `Jackson` with `azure-json` for serialization/deserialization.

## 2.41.0 (2024-07-25)

### Breaking Changes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,28 +5,30 @@
package com.azure.resourcemanager.network.fluent.models;

import com.azure.core.annotation.Fluent;
import com.azure.json.JsonReader;
import com.azure.json.JsonSerializable;
import com.azure.json.JsonToken;
import com.azure.json.JsonWriter;
import com.azure.resourcemanager.network.models.ActiveConnectivityConfiguration;
import com.fasterxml.jackson.annotation.JsonProperty;

import java.io.IOException;
import java.util.List;

/**
* Result of the request to list active connectivity configurations. It contains a list of active connectivity
* configurations and a skiptoken to get the next set of results.
*/
@Fluent
public final class ActiveConnectivityConfigurationsListResultInner {
public final class ActiveConnectivityConfigurationsListResultInner
implements JsonSerializable<ActiveConnectivityConfigurationsListResultInner> {
/*
* Gets a page of active connectivity configurations.
*/
@JsonProperty(value = "value")
private List<ActiveConnectivityConfiguration> value;

/*
* When present, the value can be passed to a subsequent query call (together with the same query and scopes used in
* the current request) to retrieve the next page of data.
*/
@JsonProperty(value = "skipToken")
private String skipToken;

/**
Expand All @@ -37,7 +39,7 @@ public ActiveConnectivityConfigurationsListResultInner() {

/**
* Get the value property: Gets a page of active connectivity configurations.
*
*
* @return the value value.
*/
public List<ActiveConnectivityConfiguration> value() {
Expand All @@ -46,7 +48,7 @@ public List<ActiveConnectivityConfiguration> value() {

/**
* Set the value property: Gets a page of active connectivity configurations.
*
*
* @param value the value value to set.
* @return the ActiveConnectivityConfigurationsListResultInner object itself.
*/
Expand All @@ -58,7 +60,7 @@ public ActiveConnectivityConfigurationsListResultInner withValue(List<ActiveConn
/**
* Get the skipToken property: When present, the value can be passed to a subsequent query call (together with the
* same query and scopes used in the current request) to retrieve the next page of data.
*
*
* @return the skipToken value.
*/
public String skipToken() {
Expand All @@ -68,7 +70,7 @@ public String skipToken() {
/**
* Set the skipToken property: When present, the value can be passed to a subsequent query call (together with the
* same query and scopes used in the current request) to retrieve the next page of data.
*
*
* @param skipToken the skipToken value to set.
* @return the ActiveConnectivityConfigurationsListResultInner object itself.
*/
Expand All @@ -79,12 +81,54 @@ public ActiveConnectivityConfigurationsListResultInner withSkipToken(String skip

/**
* Validates the instance.
*
*
* @throws IllegalArgumentException thrown if the instance is not valid.
*/
public void validate() {
if (value() != null) {
value().forEach(e -> e.validate());
}
}

/**
* {@inheritDoc}
*/
@Override
public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
jsonWriter.writeStartObject();
jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element));
jsonWriter.writeStringField("skipToken", this.skipToken);
return jsonWriter.writeEndObject();
}

/**
* Reads an instance of ActiveConnectivityConfigurationsListResultInner from the JsonReader.
*
* @param jsonReader The JsonReader being read.
* @return An instance of ActiveConnectivityConfigurationsListResultInner if the JsonReader was pointing to an
* instance of it, or null if it was pointing to JSON null.
* @throws IOException If an error occurs while reading the ActiveConnectivityConfigurationsListResultInner.
*/
public static ActiveConnectivityConfigurationsListResultInner fromJson(JsonReader jsonReader) throws IOException {
return jsonReader.readObject(reader -> {
ActiveConnectivityConfigurationsListResultInner deserializedActiveConnectivityConfigurationsListResultInner
= new ActiveConnectivityConfigurationsListResultInner();
while (reader.nextToken() != JsonToken.END_OBJECT) {
String fieldName = reader.getFieldName();
reader.nextToken();

if ("value".equals(fieldName)) {
List<ActiveConnectivityConfiguration> value
= reader.readArray(reader1 -> ActiveConnectivityConfiguration.fromJson(reader1));
deserializedActiveConnectivityConfigurationsListResultInner.value = value;
} else if ("skipToken".equals(fieldName)) {
deserializedActiveConnectivityConfigurationsListResultInner.skipToken = reader.getString();
} else {
reader.skipChildren();
}
}

return deserializedActiveConnectivityConfigurationsListResultInner;
});
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,28 +5,30 @@
package com.azure.resourcemanager.network.fluent.models;

import com.azure.core.annotation.Fluent;
import com.azure.json.JsonReader;
import com.azure.json.JsonSerializable;
import com.azure.json.JsonToken;
import com.azure.json.JsonWriter;
import com.azure.resourcemanager.network.models.ActiveBaseSecurityAdminRule;
import com.fasterxml.jackson.annotation.JsonProperty;

import java.io.IOException;
import java.util.List;

/**
* Result of the request to list active security admin rules. It contains a list of active security admin rules and a
* skiptoken to get the next set of results.
*/
@Fluent
public final class ActiveSecurityAdminRulesListResultInner {
public final class ActiveSecurityAdminRulesListResultInner
implements JsonSerializable<ActiveSecurityAdminRulesListResultInner> {
/*
* Gets a page of active security admin rules.
*/
@JsonProperty(value = "value")
private List<ActiveBaseSecurityAdminRule> value;

/*
* When present, the value can be passed to a subsequent query call (together with the same query and scopes used in
* the current request) to retrieve the next page of data.
*/
@JsonProperty(value = "skipToken")
private String skipToken;

/**
Expand All @@ -37,7 +39,7 @@ public ActiveSecurityAdminRulesListResultInner() {

/**
* Get the value property: Gets a page of active security admin rules.
*
*
* @return the value value.
*/
public List<ActiveBaseSecurityAdminRule> value() {
Expand All @@ -46,7 +48,7 @@ public List<ActiveBaseSecurityAdminRule> value() {

/**
* Set the value property: Gets a page of active security admin rules.
*
*
* @param value the value value to set.
* @return the ActiveSecurityAdminRulesListResultInner object itself.
*/
Expand All @@ -58,7 +60,7 @@ public ActiveSecurityAdminRulesListResultInner withValue(List<ActiveBaseSecurity
/**
* Get the skipToken property: When present, the value can be passed to a subsequent query call (together with the
* same query and scopes used in the current request) to retrieve the next page of data.
*
*
* @return the skipToken value.
*/
public String skipToken() {
Expand All @@ -68,7 +70,7 @@ public String skipToken() {
/**
* Set the skipToken property: When present, the value can be passed to a subsequent query call (together with the
* same query and scopes used in the current request) to retrieve the next page of data.
*
*
* @param skipToken the skipToken value to set.
* @return the ActiveSecurityAdminRulesListResultInner object itself.
*/
Expand All @@ -79,12 +81,54 @@ public ActiveSecurityAdminRulesListResultInner withSkipToken(String skipToken) {

/**
* Validates the instance.
*
*
* @throws IllegalArgumentException thrown if the instance is not valid.
*/
public void validate() {
if (value() != null) {
value().forEach(e -> e.validate());
}
}

/**
* {@inheritDoc}
*/
@Override
public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
jsonWriter.writeStartObject();
jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element));
jsonWriter.writeStringField("skipToken", this.skipToken);
return jsonWriter.writeEndObject();
}

/**
* Reads an instance of ActiveSecurityAdminRulesListResultInner from the JsonReader.
*
* @param jsonReader The JsonReader being read.
* @return An instance of ActiveSecurityAdminRulesListResultInner if the JsonReader was pointing to an instance of
* it, or null if it was pointing to JSON null.
* @throws IOException If an error occurs while reading the ActiveSecurityAdminRulesListResultInner.
*/
public static ActiveSecurityAdminRulesListResultInner fromJson(JsonReader jsonReader) throws IOException {
return jsonReader.readObject(reader -> {
ActiveSecurityAdminRulesListResultInner deserializedActiveSecurityAdminRulesListResultInner
= new ActiveSecurityAdminRulesListResultInner();
while (reader.nextToken() != JsonToken.END_OBJECT) {
String fieldName = reader.getFieldName();
reader.nextToken();

if ("value".equals(fieldName)) {
List<ActiveBaseSecurityAdminRule> value
= reader.readArray(reader1 -> ActiveBaseSecurityAdminRule.fromJson(reader1));
deserializedActiveSecurityAdminRulesListResultInner.value = value;
} else if ("skipToken".equals(fieldName)) {
deserializedActiveSecurityAdminRulesListResultInner.skipToken = reader.getString();
} else {
reader.skipChildren();
}
}

return deserializedActiveSecurityAdminRulesListResultInner;
});
}
}
Loading